|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
AST node for variable declarations (var id1, id2 : type). More...
#include <ast.hpp>

Public Member Functions | |
| VarDeclNode (std::vector< std::string > identifiers, std::variant< std::string, std::unique_ptr< ASTNode > > type, std::vector< std::unique_ptr< ASTNode > > initializers) | |
| 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::vector< std::string > | identifiers |
| declared variable names | |
| std::variant< std::string, std::unique_ptr< ASTNode > > | type |
| type (simple name or complex type node) | |
| std::vector< std::unique_ptr< ASTNode > > | initializers |
| optional initialisers | |
|
inline |
Definition at line 138 of file ast.hpp.
References identifiers, initializers, and type.
|
overridevirtual |
Accept an ASTVisitor (double-dispatch).
Implements pascal::ASTNode.
Definition at line 47 of file ast.cpp.
References pascal::ASTVisitor::visit().
|
overridevirtual |
Return a human-readable description of this node.
Implements pascal::ASTNode.
Definition at line 51 of file ast.cpp.
References identifiers, and type.
| std::vector<std::string> pascal::VarDeclNode::identifiers |
declared variable names
Definition at line 134 of file ast.hpp.
Referenced by VarDeclNode(), pascal::CodeGenVisitor::registerImportedVar(), toString(), and pascal::CodeGenVisitor::visit().
| std::vector<std::unique_ptr<ASTNode> > pascal::VarDeclNode::initializers |
| std::variant<std::string, std::unique_ptr<ASTNode> > pascal::VarDeclNode::type |
type (simple name or complex type node)
Definition at line 135 of file ast.hpp.
Referenced by VarDeclNode(), pascal::CodeGenVisitor::getTypeString(), pascal::CodeGenVisitor::registerImportedVar(), toString(), and pascal::CodeGenVisitor::visit().