AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
autopas::RuleSyntax::Define Struct Reference

A variable definition in the rule language. More...

#include <RuleBasedProgramTree.h>

Inheritance diagram for autopas::RuleSyntax::Define:
Inheritance graph
[legend]
Collaboration diagram for autopas::RuleSyntax::Define:
Collaboration graph
[legend]

Public Member Functions

 Define (std::string variable, std::shared_ptr< Expression > value)
 Constructs a variable definition in the rule language.
 
 ~Define () override
 Destructor.
 
void generateCode (CodeGenerationContext &context, RuleVM::Program &program) const override
 Generates code for this statement.
 
- Public Member Functions inherited from autopas::RuleSyntax::Statement
virtual ~Statement ()=default
 Virtual default constructor.
 
virtual void generateCode (CodeGenerationContext &context, RuleVM::Program &program) const =0
 Generates code for this statement.
 

Public Attributes

std::string variable
 The name of the variable.
 
std::shared_ptr< Expressionvalue
 The value of the variable.
 

Detailed Description

A variable definition in the rule language.

Variables are always constant.

Constructor & Destructor Documentation

◆ Define()

autopas::RuleSyntax::Define::Define ( std::string  variable,
std::shared_ptr< Expression value 
)

Constructs a variable definition in the rule language.

Parameters
variable
value

Member Function Documentation

◆ generateCode()

void autopas::RuleSyntax::Define::generateCode ( CodeGenerationContext context,
RuleVM::Program program 
) const
overridevirtual

Generates code for this statement.

Parameters
contextThe context to generate code in.
programThe program to append the code to.

Implements autopas::RuleSyntax::Statement.


The documentation for this struct was generated from the following files: