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

AST node for an enumerated type declaration (type Color = (Red, Green, Blue)). More...

#include <ast.hpp>

Inheritance diagram for pascal::EnumTypeDeclNode:

Public Member Functions

 EnumTypeDeclNode (const std::string &name, std::vector< std::string > vals)
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 typeName
 the enum type name
std::vector< std::string > values
 ordered list of enum value identifiers

Detailed Description

AST node for an enumerated type declaration (type Color = (Red, Green, Blue)).

Definition at line 627 of file ast.hpp.

Constructor & Destructor Documentation

◆ EnumTypeDeclNode()

pascal::EnumTypeDeclNode::EnumTypeDeclNode ( const std::string & name,
std::vector< std::string > vals )
inline

Definition at line 632 of file ast.hpp.

References typeName, and values.

Member Function Documentation

◆ accept()

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

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 462 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

std::string pascal::EnumTypeDeclNode::toString ( ) const
inlineoverridevirtual

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 636 of file ast.hpp.

References typeName.

Member Data Documentation

◆ typeName

std::string pascal::EnumTypeDeclNode::typeName

the enum type name

Definition at line 629 of file ast.hpp.

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

◆ values

std::vector<std::string> pascal::EnumTypeDeclNode::values

ordered list of enum value identifiers

Definition at line 630 of file ast.hpp.

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


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