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

Public Types | |
| enum | Operator { PLUS , MINUS , NOT } |
| Unary operator kinds. More... | |
Public Member Functions | |
| UnaryOpNode (Operator op, std::unique_ptr< ASTNode > operandNode) | |
| 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 (Operator op) |
| Convert a unary Operator to its string representation. | |
Public Attributes | |
| Operator | operator_ |
| the unary operator | |
| std::unique_ptr< ASTNode > | operand |
| the operand expression | |
|
overridevirtual |
Accept an ASTVisitor (double-dispatch).
Implements pascal::ASTNode.
Definition at line 210 of file ast.cpp.
References pascal::ASTVisitor::visit().
|
static |
|
overridevirtual |
Return a human-readable description of this node.
Implements pascal::ASTNode.
Definition at line 214 of file ast.cpp.
References operator_, and opToString().
| std::unique_ptr<ASTNode> pascal::UnaryOpNode::operand |
the operand expression
Definition at line 487 of file ast.hpp.
Referenced by UnaryOpNode(), and pascal::CodeGenVisitor::visit().
| Operator pascal::UnaryOpNode::operator_ |
the unary operator
Definition at line 486 of file ast.hpp.
Referenced by UnaryOpNode(), toString(), and pascal::CodeGenVisitor::visit().