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

AST node for accessing a record field (record.field). More...

#include <ast.hpp>

Inheritance diagram for pascal::FieldAccessNode:

Public Member Functions

 FieldAccessNode (std::unique_ptr< ASTNode > recordExpr, const std::string &fieldName)
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::unique_ptr< ASTNoderecordExpr
 expression yielding a record
std::string fieldName
 name of the accessed field

Detailed Description

AST node for accessing a record field (record.field).

Definition at line 726 of file ast.hpp.

Constructor & Destructor Documentation

◆ FieldAccessNode()

pascal::FieldAccessNode::FieldAccessNode ( std::unique_ptr< ASTNode > recordExpr,
const std::string & fieldName )

Definition at line 364 of file ast.cpp.

References fieldName, and recordExpr.

Member Function Documentation

◆ accept()

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

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 367 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

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

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 369 of file ast.cpp.

References fieldName.

Member Data Documentation

◆ fieldName

std::string pascal::FieldAccessNode::fieldName

name of the accessed field

Definition at line 729 of file ast.hpp.

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

◆ recordExpr

std::unique_ptr<ASTNode> pascal::FieldAccessNode::recordExpr

expression yielding a record

Definition at line 728 of file ast.hpp.

Referenced by FieldAccessNode(), and pascal::CodeGenVisitor::visit().


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