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

AST node for a variable reference. More...

#include <ast.hpp>

Inheritance diagram for pascal::VariableNode:

Public Member Functions

 VariableNode (const std::string &varName)
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 name
 variable name

Detailed Description

AST node for a variable reference.

Definition at line 513 of file ast.hpp.

Constructor & Destructor Documentation

◆ VariableNode()

pascal::VariableNode::VariableNode ( const std::string & varName)
inline

Definition at line 517 of file ast.hpp.

References name.

Member Function Documentation

◆ accept()

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

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 239 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

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

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 243 of file ast.cpp.

References name.

Member Data Documentation

◆ name

std::string pascal::VariableNode::name

variable name

Definition at line 515 of file ast.hpp.

Referenced by VariableNode(), toString(), pascal::CodeGenVisitor::visit(), and pascal::CodeGenVisitor::visit().


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