A binary operator in the rule language. More...
#include <RuleBasedProgramTree.h>
Public Types | |
enum | Operator { LESS , GREATER , AND , OR , ADD , SUB , MUL , DIV } |
Enum of all binary operators. | |
Public Member Functions | |
BinaryOperator (Operator op, std::shared_ptr< Expression > left, std::shared_ptr< Expression > right) | |
Constructs a binary operator 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. | |
![]() | |
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 | |
std::shared_ptr< Expression > | left |
The left subexpression of the operator. | |
Operator | op |
The operator to apply. | |
std::shared_ptr< Expression > | right |
The right subexpression of the operator. | |
A binary operator in the rule language.
autopas::RuleSyntax::BinaryOperator::BinaryOperator | ( | BinaryOperator::Operator | op, |
std::shared_ptr< Expression > | left, | ||
std::shared_ptr< Expression > | right | ||
) |
Constructs a binary operator in the rule language.
op | |
left | |
right |
|
overridevirtual |
Generates code for evaluating this expression at runtime.
Value is put on top of the stack. May consume part of the stack.
context | The context to generate the code in. |
program | The program to append the code to. |
Implements autopas::RuleSyntax::Expression.
|
overridevirtual |
Implements autopas::RuleSyntax::Expression.