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

AST node for a formal parameter list entry. More...

#include <ast.hpp>

Inheritance diagram for pascal::ParameterNode:

Public Member Functions

 ParameterNode (std::vector< std::string > ids, const std::string &paramType, bool var=false)
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::string > identifiers
 parameter names
std::string type
 parameter type name
bool isVar
 true if passed by reference (var parameter)

Detailed Description

AST node for a formal parameter list entry.

Definition at line 223 of file ast.hpp.

Constructor & Destructor Documentation

◆ ParameterNode()

pascal::ParameterNode::ParameterNode ( std::vector< std::string > ids,
const std::string & paramType,
bool var = false )
inline

Definition at line 229 of file ast.hpp.

References identifiers, isVar, and type.

Member Function Documentation

◆ accept()

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

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 91 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

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

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 95 of file ast.cpp.

References identifiers, isVar, and type.

Member Data Documentation

◆ identifiers

std::vector<std::string> pascal::ParameterNode::identifiers

parameter names

Definition at line 225 of file ast.hpp.

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

◆ isVar

bool pascal::ParameterNode::isVar

true if passed by reference (var parameter)

Definition at line 227 of file ast.hpp.

Referenced by ParameterNode(), and toString().

◆ type

std::string pascal::ParameterNode::type

parameter type name

Definition at line 226 of file ast.hpp.

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


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