ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::expressions::detail::ASTFunction Struct Reference

Description:

Abstract syntax tree node representing a function call.

Definition at line 133 of file ast_impl.inl.

Inheritance diagram for alib::expressions::detail::ASTFunction:
alib::expressions::detail::AST alib::expressions::detail::ASTBase

Public Field Index:

ListMA< AST * > Arguments
 The argument nodes.
String Name
 The function name as parsed.
Public Field Index: inherited from alib::expressions::detail::AST
integer Position
 Position in the original expression string.
Public Field Index: inherited from alib::expressions::detail::ASTBase
Types NodeType
 Type of derived this AST node.

Public Method Index:

 ASTFunction (const String name, integer position, MonoAllocator &pAllocator)
virtual ~ASTFunction () override
 Virtual destructor.
virtual void Assemble (Program &program, MonoAllocator &allocator, AString &normalized) override
virtual ASTOptimize (Normalization normalization) override
Public Method Index: inherited from alib::expressions::detail::AST
 AST ()=delete
 Deleted default constructor.
 AST (Types type, integer position)
virtual ~AST ()
 Virtual destructor.
Public Method Index: inherited from alib::expressions::detail::ASTBase
 ASTBase (Types type)

Additional Inherited Members

Public Type Index: inherited from alib::expressions::detail::ASTBase
enum class  Types {
  Literal , Identifier , Function , UnaryOp ,
  BinaryOp , TernaryOp
}
 The type of node. More...

Field Details:

◆ Arguments

ListMA<AST*> alib::expressions::detail::ASTFunction::Arguments

The argument nodes.

Definition at line 136 of file ast_impl.inl.

◆ Name

String alib::expressions::detail::ASTFunction::Name

The function name as parsed.

Definition at line 135 of file ast_impl.inl.

Constructor(s) / Destructor Details:

◆ ASTFunction()

alib::expressions::detail::ASTFunction::ASTFunction ( const String name,
integer position,
MonoAllocator & pAllocator )
inlineexplicit

Constructor providing name, but not arguments, yet.

Parameters
nameThe name of the function
positionThe index of this AST in the expression string.
pAllocatorAllocator used to clone the given name and for storing arguments.

Definition at line 143 of file ast_impl.inl.

◆ ~ASTFunction()

virtual alib::expressions::detail::ASTFunction::~ASTFunction ( )
inlineoverridevirtual

Virtual destructor.

Definition at line 149 of file ast_impl.inl.

Method Details:

◆ Assemble()

void alib::expressions::detail::ASTFunction::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 alib::expressions::detail::AST.

Definition at line 171 of file ast.cpp.

◆ Optimize()

AST * alib::expressions::detail::ASTFunction::Optimize ( Normalization normalization)
overridevirtual

Implements abstract method.

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

Implements alib::expressions::detail::AST.

Definition at line 61 of file ast.cpp.


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