8#ifndef HPP_ALIB_EXPRESSIONS_DETAIL_AST
9#define HPP_ALIB_EXPRESSIONS_DETAIL_AST 1
15#include "alib/containers/list.hpp"
17namespace alib {
namespace expressions {
namespace detail {
129 AString & normalized )
override;
157 AString & normalized )
override;
178 ,
Name (pAllocator, name )
191 AString & normalized )
override;
#define ALIB_ASSERT_MODULE(modulename)
lang::integer integer
Type alias in namespace alib.
Abstract syntax tree node representing binary operators.
String Operator
The operator symbol.
ASTBinaryOp(const String &op, AST *lhs, AST *rhs, integer position)
virtual AST * Optimize(Normalization normalization) override
virtual void Assemble(Program &program, MonoAllocator &allocator, AString &normalized) override
AST * Lhs
The left-hand-side expression node.
virtual ~ASTBinaryOp() override
Virtual destructor.
Abstract syntax tree node representing ternary operator Q ? T : F.
integer ColonPosition
The index of the colon in the expression string.
ASTConditional(AST *q, AST *t, AST *f, integer position, integer colonPosition)
virtual AST * Optimize(Normalization normalization) override
virtual ~ASTConditional() override
Virtual destructor.
virtual void Assemble(Program &program, MonoAllocator &allocator, AString &normalized) override
Abstract syntax tree node representing a function call.
ASTFunction(const String name, integer position, MonoAllocator &pAllocator)
String Name
The function name as parsed.
virtual AST * Optimize(Normalization normalization) override
virtual void Assemble(Program &program, MonoAllocator &allocator, AString &normalized) override
virtual ~ASTFunction() override
Virtual destructor.
List< MonoAllocator, AST * > Arguments
The argument nodes.
Abstract syntax tree node representing identifiers.
ASTIdentifier(const String &name, integer position)
String Name
The name of the identifier as parsed from the expression string.
virtual AST * Optimize(Normalization normalization) override
virtual void Assemble(Program &program, MonoAllocator &allocator, AString &normalized) override
Abstract syntax tree node representing identifiers.
ASTLiteral(integer value, integer position, NFHint hint=NFHint::NONE)
Box Value
The value of the literal.
@ Scientific
Float was given in scientific format.
@ Hexadecimal
Integral value was given in hexadecimal format.
@ Binary
Integral value was given in binary format.
@ Octal
Integral value was given in octal format.
virtual AST * Optimize(Normalization normalization) override
NFHint Format
Format hints.
virtual void Assemble(Program &program, MonoAllocator &allocator, AString &normalized) override
ASTLiteral(double value, integer position, NFHint hint=NFHint::NONE)
ASTLiteral(const String &string, integer position)
Abstract syntax tree node representing unary operators.
String Operator
The operator symbol.
virtual ~ASTUnaryOp() override
Virtual destructor.
AST * Argument
The argument node.
virtual AST * Optimize(Normalization normalization) override
virtual void Assemble(Program &program, MonoAllocator &allocator, AString &normalized) override
ASTUnaryOp(const String &op, AST *argument, integer position)
AST(Types type, integer position)
AST()=delete
Deleted default constructor.
virtual AST * Optimize(Normalization normalization)=0
virtual void Assemble(Program &program, MonoAllocator &allocator, AString &normalized)=0
virtual ~AST()
Virtual destructor.
Types NodeType
Type of derived this AST node.
integer Position
Position in original expression string.