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

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

#include <RuleBasedProgramTree.h>

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

Public Member Functions

 Variable (const Define *definition)
 Constructs a variable access in the rule language.
 
Type getType () const override
 
void generateCode (CodeGenerationContext &context, RuleVM::Program &program) const override
 Generates code for evaluating this expression at runtime.
 
- Public Member Functions inherited from autopas::RuleSyntax::Expression
virtual ~Expression ()=default
 Virtual default constructor.
 
virtual Type getType () const =0
 
virtual void generateCode (CodeGenerationContext &context, RuleVM::Program &program) const =0
 Generates code for evaluating this expression at runtime.
 

Public Attributes

const Definedefinition
 The definition of the variable to access.
 

Detailed Description

A variable access in the rule language.

Constructor & Destructor Documentation

◆ Variable()

autopas::RuleSyntax::Variable::Variable ( const Define definition)
inlineexplicit

Constructs a variable access in the rule language.

Parameters
definitionThe definition of the variable to access.

Member Function Documentation

◆ generateCode()

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

Generates code for evaluating this expression at runtime.

Value is put on top of the stack. May consume part of the stack.

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

Implements autopas::RuleSyntax::Expression.

◆ getType()

Type autopas::RuleSyntax::Variable::getType ( ) const
overridevirtual
Returns
the type of the expression.

Implements autopas::RuleSyntax::Expression.


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