#include <tree.h>
Public Member Functions | |
BinaryArithmeticNode (const SourcePos &sourcePos, AsebaBinaryOperator op, Node *left, Node *right) | |
Constructor. | |
BinaryArithmeticNode (const SourcePos &sourcePos) | |
void | deMorganNotRemoval () |
Recursively apply de Morgan law as long as nodes are logic operations, and then invert comparisons. | |
virtual void | emit (PreLinkBytecode &bytecodes) const |
Generate bytecode. | |
virtual unsigned | getStackDepth () const |
Return the stack depth requirement for this node and its children. | |
virtual Node * | optimize (std::ostream *dump) |
Optimize this node, return the optimized node. | |
virtual std::string | toNodeName () const |
Return a string representation of the name of this node. | |
virtual std::string | toString () const |
Return a string representation of this node. | |
virtual ReturnType | typeCheck () const |
Typecheck this node, throw an exception if there is any type violation. | |
Static Public Member Functions | |
static BinaryArithmeticNode * | fromAddExpression (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right) |
Create a binary arithmetic node for add/sub operation op. | |
static BinaryArithmeticNode * | fromComparison (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right) |
Create a binary arithmetic node for comparaison operation op. | |
static BinaryArithmeticNode * | fromMultExpression (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right) |
Create a binary arithmetic node for mult/div/mod operation op. | |
static BinaryArithmeticNode * | fromShiftExpression (const SourcePos &sourcePos, Compiler::Token::Type op, Node *left, Node *right) |
Create a binary arithmetic node for shift operation op. | |
Public Attributes | |
AsebaBinaryOperator | op |
operator |
Node for binary arithmetic. children[0] is left expression children[1] is right expression
Definition at line 261 of file tree.h.
Aseba::BinaryArithmeticNode::BinaryArithmeticNode | ( | const SourcePos & | sourcePos | ) | [inline] |
virtual std::string Aseba::BinaryArithmeticNode::toNodeName | ( | ) | const [inline, virtual] |
Return a string representation of the name of this node.
Implements Aseba::Node.