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

An if statement in the rule language. More...

#include <RuleBasedProgramTree.h>

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

Public Member Functions

 If (std::shared_ptr< Expression > condition, std::vector< std::shared_ptr< Statement > > consequences)
 Constructs an if statement in the rule language.
 
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::shared_ptr< Expressioncondition
 The condition of the if statement.
 
std::vector< std::shared_ptr< Statement > > consequences
 The statements contained in the body of the if statement.
 

Detailed Description

An if statement in the rule language.

Constructor & Destructor Documentation

◆ If()

autopas::RuleSyntax::If::If ( std::shared_ptr< Expression condition,
std::vector< std::shared_ptr< Statement > >  consequences 
)

Constructs an if statement in the rule language.

Parameters
condition
consequences

Member Function Documentation

◆ generateCode()

void autopas::RuleSyntax::If::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.

Member Data Documentation

◆ consequences

std::vector<std::shared_ptr<Statement> > autopas::RuleSyntax::If::consequences

The statements contained in the body of the if statement.

(Executed if true).


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