|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
AST node for a binary operator expression. More...
#include <ast.hpp>

Public Types | |
| enum | OpType { PLUS , MINUS , MULTIPLY , DIVIDE , DIV , MOD , EQUAL , NOT_EQUAL , LESS , LESS_EQUAL , GREATER , GREATER_EQUAL , AND , OR , IN } |
| Binary operator kinds. More... | |
Public Member Functions | |
| BinaryOpNode (std::unique_ptr< ASTNode > l, OpType op, std::unique_ptr< ASTNode > r) | |
| BinaryOpNode (OpType op, std::unique_ptr< ASTNode > l, std::unique_ptr< ASTNode > r) | |
| void | accept (ASTVisitor &visitor) override |
| Accept an ASTVisitor (double-dispatch). | |
| std::string | toString () const override |
| Return a human-readable description of this node. | |
| Public Member Functions inherited from pascal::ASTNode | |
| virtual | ~ASTNode ()=default |
| virtual void | print (std::ostream &out, int indent=0) const |
| Pretty-print this node to a stream with indentation. | |
| void | setLineNumber (int line) |
| Set the originating source line number. | |
| int | getLineNumber () const |
| Get the originating source line number. | |
Static Public Member Functions | |
| static std::string | opToString (OpType op) |
| Convert an OpType to its string representation. | |
Public Attributes | |
| std::unique_ptr< ASTNode > | left |
| left operand | |
| OpType | operator_ |
| operator kind | |
| std::unique_ptr< ASTNode > | right |
| right operand | |
|
overridevirtual |
Accept an ASTVisitor (double-dispatch).
Implements pascal::ASTNode.
Definition at line 165 of file ast.cpp.
References pascal::ASTVisitor::visit().
|
static |
|
overridevirtual |
Return a human-readable description of this node.
Implements pascal::ASTNode.
Definition at line 169 of file ast.cpp.
References operator_, and opToString().
| std::unique_ptr<ASTNode> pascal::BinaryOpNode::left |
left operand
Definition at line 459 of file ast.hpp.
Referenced by BinaryOpNode(), BinaryOpNode(), and pascal::CodeGenVisitor::visit().
| OpType pascal::BinaryOpNode::operator_ |
operator kind
Definition at line 460 of file ast.hpp.
Referenced by BinaryOpNode(), BinaryOpNode(), toString(), and pascal::CodeGenVisitor::visit().
| std::unique_ptr<ASTNode> pascal::BinaryOpNode::right |
right operand
Definition at line 461 of file ast.hpp.
Referenced by BinaryOpNode(), BinaryOpNode(), and pascal::CodeGenVisitor::visit().