MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
Loading...
Searching...
No Matches
pascal::ConstDeclNode Class Reference

AST node for constant declarations (const id = value). More...

#include <ast.hpp>

Inheritance diagram for pascal::ConstDeclNode:

Classes

struct  ConstAssignment
 A single constant name = value pair. More...

Public Member Functions

 ConstDeclNode (std::vector< std::unique_ptr< ConstAssignment > > assigns)
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::unique_ptr< ConstAssignment > > assignments
 list of constant assignments

Detailed Description

AST node for constant declarations (const id = value).

Definition at line 174 of file ast.hpp.

Constructor & Destructor Documentation

◆ ConstDeclNode()

pascal::ConstDeclNode::ConstDeclNode ( std::vector< std::unique_ptr< ConstAssignment > > assigns)
inline

Definition at line 186 of file ast.hpp.

References assignments.

Member Function Documentation

◆ accept()

void pascal::ConstDeclNode::accept ( ASTVisitor & visitor)
overridevirtual

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 285 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

std::string pascal::ConstDeclNode::toString ( ) const
overridevirtual

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 289 of file ast.cpp.

Member Data Documentation

◆ assignments

std::vector<std::unique_ptr<ConstAssignment> > pascal::ConstDeclNode::assignments

list of constant assignments

Definition at line 185 of file ast.hpp.

Referenced by ConstDeclNode(), pascal::CodeGenVisitor::registerImportedConst(), and pascal::CodeGenVisitor::visit().


The documentation for this class was generated from the following files: