ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
No Matches
ASTUnaryOp Struct Reference


Abstract syntax tree node representing unary operators.

Definition at line 247 of file ast.hpp.

#include <ast.hpp>

Inheritance diagram for ASTUnaryOp:
Collaboration diagram for ASTUnaryOp:

Public Field Index:

 The argument node.
String Operator
 The operator symbol.
- Public Field Index: inherited from AST
Types NodeType
integer Position

Public Method Index:

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

◆ Argument

AST* Argument

The argument node.

Definition at line 250 of file ast.hpp.

◆ Operator

String Operator

The operator symbol.

Definition at line 249 of file ast.hpp.

Constructor(s) / Destructor Details::

◆ ASTUnaryOp()

ASTUnaryOp ( const String & op,
AST * argument,
integer position )

Constructor providing all fields.

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

Definition at line 259 of file ast.hpp.

◆ ~ASTUnaryOp()

virtual ~ASTUnaryOp ( )

Virtual destructor.

Definition at line 267 of file ast.hpp.

Method Details:

◆ Assemble()

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

Implements abstract method.

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 290 of file ast.cpp.

Here is the call graph for this function:

◆ Optimize()

AST * Optimize ( Normalization normalization)

Implements abstract method.

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

Implements AST.

Definition at line 89 of file ast.cpp.

Here is the call graph for this function:

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