ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Fields | Public Methods | List of all members
ASTIdentifier Struct Reference

#include <ast.hpp>

Inheritance diagram for ASTIdentifier:
[legend]
Collaboration diagram for ASTIdentifier:
[legend]

Class Description

Abstract syntax tree node representing identifiers.

Definition at line 167 of file ast.hpp.

Public Fields

String Name
 The name of the identifier as parsed from the expression string.
 
- Public Fields inherited from AST
Types NodeType
 
integer Position
 

Public Methods

 ASTIdentifier (const String &name, integer position)
 
virtual void Assemble (Program &program, MonoAllocator &allocator, AString &normalized) override
 
virtual ASTOptimize (Normalization normalization) override
 
- Public Methods inherited from AST
 AST ()=delete
 
 AST (Types type, integer position)
 
virtual ~AST ()
 

Additional Inherited Members

- Public Types inherited from AST
enum  Types {
  Literal, Identifier, Function, UnaryOp,
  BinaryOp, TernaryOp
}
 

Constructor & Destructor Documentation

◆ ASTIdentifier()

ASTIdentifier ( const String name,
integer  position 
)
inlineexplicit

Constructor providing all fields.

Parameters
nameThe name of the identifier.
positionThe index of this AST in the expression string.

Definition at line 177 of file ast.hpp.

Member Function Documentation

◆ Assemble()

void Assemble ( Program program,
MonoAllocator allocator,
AString normalized 
)
overridevirtual

Implements abstract method.

Parameters
programThe program to be compiled.
allocatorAn allocator usable for temporary objects.
[out]normalizedThe normalized string, built during recursive compilation of the AST.

Implements AST.

Definition at line 177 of file ast.cpp.

Here is the call graph for this function:

◆ Optimize()

AST * Optimize ( Normalization  normalization)
overridevirtual

Implements abstract method.

Parameters
normalizationThe compiler flags denoting the normalization settings.
Returns
A potentially replaced AST or itself.

Implements AST.

Definition at line 64 of file ast.cpp.


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