ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
ASTFunction Struct Reference

Description:

Abstract syntax tree node representing a function call.

Definition at line 202 of file ast.hpp.

#include <ast.hpp>

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

Public Field Index:

List< AST * > Arguments
 The argument nodes.
 
String Name
 The function name as parsed.
 
- Public Field Index: inherited from AST
Types NodeType
 
integer Position
 

Public Method Index:

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

Additional Inherited Members

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

Field Details:

◆ Arguments

List<AST*> Arguments

The argument nodes.

Definition at line 205 of file ast.hpp.

◆ Name

String Name

The function name as parsed.

Definition at line 204 of file ast.hpp.

Constructor(s) / Destructor Details::

◆ 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 214 of file ast.hpp.

◆ ~ASTFunction()

virtual ~ASTFunction ( )
inlineoverridevirtual

Virtual destructor.

Definition at line 223 of file ast.hpp.

Method Details:

◆ 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 192 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 65 of file ast.cpp.

Here is the call graph for this function:

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