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

AST node for a named record declaration. More...

#include <ast.hpp>

Inheritance diagram for pascal::RecordDeclarationNode:

Public Member Functions

 RecordDeclarationNode (const std::string &name, std::unique_ptr< RecordTypeNode > recordType)
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
 record type name
std::unique_ptr< RecordTypeNode > recordType
 the record body

Detailed Description

AST node for a named record declaration.

Definition at line 658 of file ast.hpp.

Constructor & Destructor Documentation

◆ RecordDeclarationNode()

pascal::RecordDeclarationNode::RecordDeclarationNode ( const std::string & name,
std::unique_ptr< RecordTypeNode > recordType )

Definition at line 357 of file ast.cpp.

References name, and recordType.

Member Function Documentation

◆ accept()

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

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 360 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

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

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 362 of file ast.cpp.

References name.

Member Data Documentation

◆ name

std::string pascal::RecordDeclarationNode::name

record type name

Definition at line 660 of file ast.hpp.

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

◆ recordType

std::unique_ptr<RecordTypeNode> pascal::RecordDeclarationNode::recordType

the record body

Definition at line 661 of file ast.hpp.

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


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