|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
AST node for an integer or real numeric literal. More...
#include <ast.hpp>

Public Member Functions | |
| NumberNode (const std::string &val, bool integer=true, bool real=false) | |
| 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. | |
Public Attributes | |
| std::string | value |
| textual representation of the number | |
| bool | isInteger |
| true if integer literal | |
| bool | isReal |
| true if real (floating-point) literal | |
|
inline |
|
overridevirtual |
Accept an ASTVisitor (double-dispatch).
Implements pascal::ASTNode.
Definition at line 247 of file ast.cpp.
References pascal::ASTVisitor::visit().
|
overridevirtual |
Return a human-readable description of this node.
Implements pascal::ASTNode.
| bool pascal::NumberNode::isInteger |
true if integer literal
Definition at line 527 of file ast.hpp.
Referenced by NumberNode(), and toString().
| bool pascal::NumberNode::isReal |
true if real (floating-point) literal
Definition at line 528 of file ast.hpp.
Referenced by NumberNode(), pascal::CodeGenVisitor::getExpressionType(), and pascal::CodeGenVisitor::visit().
| std::string pascal::NumberNode::value |
textual representation of the number
Definition at line 526 of file ast.hpp.
Referenced by NumberNode(), toString(), and pascal::CodeGenVisitor::visit().