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

AST node for a variable declaration in a .data section. More...

#include <ast.hpp>

Inheritance diagram for mxvm::VariableNode:

Public Member Functions

 VariableNode (VarType varType, const std::string &varName)
 VariableNode (VarType varType, const std::string &varName, size_t buf_size)
 VariableNode (VarType varType, const std::string &varName, const std::string &value)
void accept (ASTVisitor &visitor) override
std::string toString () const override
Public Member Functions inherited from mxvm::ASTNode
virtual ~ASTNode ()=default

Public Attributes

std::string name
VarType type
std::string initialValue
bool hasInitializer
size_t buffer_size = 0
 buffer allocation size (for pointer/array types)
bool is_global = false
std::string object
 owning object name, if any

Detailed Description

AST node for a variable declaration in a .data section.

Definition at line 71 of file ast.hpp.

Constructor & Destructor Documentation

◆ VariableNode() [1/3]

mxvm::VariableNode::VariableNode ( VarType varType,
const std::string & varName )
inline

Definition at line 81 of file ast.hpp.

References buffer_size, hasInitializer, name, and type.

◆ VariableNode() [2/3]

mxvm::VariableNode::VariableNode ( VarType varType,
const std::string & varName,
size_t buf_size )
inline

Definition at line 84 of file ast.hpp.

References buffer_size, hasInitializer, name, and type.

◆ VariableNode() [3/3]

mxvm::VariableNode::VariableNode ( VarType varType,
const std::string & varName,
const std::string & value )
inline

Definition at line 87 of file ast.hpp.

References buffer_size, hasInitializer, initialValue, name, and type.

Member Function Documentation

◆ accept()

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

Implements mxvm::ASTNode.

Definition at line 54 of file ast.cpp.

References mxvm::ASTVisitor::visit().

◆ toString()

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

Implements mxvm::ASTNode.

Definition at line 58 of file ast.cpp.

References hasInitializer, initialValue, name, and type.

Member Data Documentation

◆ buffer_size

size_t mxvm::VariableNode::buffer_size = 0

buffer allocation size (for pointer/array types)

Definition at line 77 of file ast.hpp.

Referenced by VariableNode(), VariableNode(), and VariableNode().

◆ hasInitializer

bool mxvm::VariableNode::hasInitializer

Definition at line 76 of file ast.hpp.

Referenced by VariableNode(), VariableNode(), VariableNode(), and toString().

◆ initialValue

std::string mxvm::VariableNode::initialValue

Definition at line 75 of file ast.hpp.

Referenced by VariableNode(), and toString().

◆ is_global

bool mxvm::VariableNode::is_global = false

Definition at line 78 of file ast.hpp.

◆ name

std::string mxvm::VariableNode::name

Definition at line 73 of file ast.hpp.

Referenced by VariableNode(), VariableNode(), VariableNode(), and toString().

◆ object

std::string mxvm::VariableNode::object

owning object name, if any

Definition at line 79 of file ast.hpp.

◆ type

VarType mxvm::VariableNode::type

Definition at line 74 of file ast.hpp.

Referenced by VariableNode(), VariableNode(), VariableNode(), and toString().


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