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

Description:

Abstract syntax tree node representing unary operators.

Definition at line 178 of file ast_impl.inl.

Inheritance diagram for alib::expressions::detail::ASTUnaryOp:
[legend]
Collaboration diagram for alib::expressions::detail::ASTUnaryOp:
[legend]

Public Field Index:

ASTArgument
 The argument node.
 
String Operator
 The operator symbol.
 
- 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:

 ASTUnaryOp (const String &op, AST *argument, integer position)
 
virtual ~ASTUnaryOp () 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:

◆ Argument

AST* alib::expressions::detail::ASTUnaryOp::Argument

The argument node.

Definition at line 181 of file ast_impl.inl.

◆ Operator

String alib::expressions::detail::ASTUnaryOp::Operator

The operator symbol.

Definition at line 180 of file ast_impl.inl.

Constructor(s) / Destructor Details:

◆ ASTUnaryOp()

alib::expressions::detail::ASTUnaryOp::ASTUnaryOp ( const String & op,
AST * argument,
integer position )
inlineexplicit

Constructor providing all fields.

Parameters
opThe operator symbol.
argumentThe argument of the operator.
positionThe index of this AST in the expression string.

Definition at line 188 of file ast_impl.inl.

Here is the call graph for this function:

◆ ~ASTUnaryOp()

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

Virtual destructor.

Definition at line 194 of file ast_impl.inl.

Method Details:

◆ Assemble()

void alib::expressions::detail::ASTUnaryOp::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 286 of file ast.cpp.

Here is the call graph for this function:

◆ Optimize()

AST * alib::expressions::detail::ASTUnaryOp::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 86 of file ast.cpp.

Here is the call graph for this function:

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