ALib C++ Framework
by
Library Version:
2605 R0
Documentation generated by
Loading...
Searching...
No Matches
ALib
src
alib
expressions
detail
ast.hpp
Go to the documentation of this file.
1
//==================================================================================================
2
/// \file
3
/// This header-file is part of module \alib_expressions of the \aliblong.
4
///
5
/// Copyright 2013-2026 A-Worx GmbH, Germany.
6
/// Published under #"mainpage_license".
7
//==================================================================================================
8
ALIB_EXPORT
namespace
alib
{
namespace
expressions
{
namespace
detail
{
9
10
/// Base class for nodes of abstract syntax trees of module \alib_expressions.
11
/// Note that AST objects (and their data) are allocated in a #"MonoAllocator" and
12
/// hence have empty destructors.
13
struct
ASTBase
{
14
/// The type of node.
15
enum class
Types
{
16
Literal
,
///< A literal.
17
Identifier
,
///< An identifier.
18
Function
,
///< A function.
19
UnaryOp
,
///< A unary operator.
20
BinaryOp
,
///< A binary operator.
21
TernaryOp
,
///< A ternary operator.
22
};
23
24
/// Type of derived this AST node
25
Types
NodeType
;
26
27
/// Constructor
28
/// @param type The node type.
29
ASTBase
(
Types
type )
30
:
NodeType
(type) {}
31
};
32
33
}}}
// namespace [alib::expressions::detail]
ALIB_EXPORT
#define ALIB_EXPORT
Definition
alib.prepro.hpp:538
alib::expressions::detail
Definition
compiler.hpp:12
alib::expressions
Definition
compiler.cpp:1
alib
Definition
alox.cpp:14
alib::expressions::detail::ASTBase::ASTBase
ASTBase(Types type)
Definition
ast.hpp:29
alib::expressions::detail::ASTBase::NodeType
Types NodeType
Type of derived this AST node.
Definition
ast.hpp:25
alib::expressions::detail::ASTBase::Types
Types
The type of node.
Definition
ast.hpp:15
alib::expressions::detail::ASTBase::Types::Identifier
@ Identifier
An identifier.
Definition
ast.hpp:17
alib::expressions::detail::ASTBase::Types::UnaryOp
@ UnaryOp
A unary operator.
Definition
ast.hpp:19
alib::expressions::detail::ASTBase::Types::BinaryOp
@ BinaryOp
A binary operator.
Definition
ast.hpp:20
alib::expressions::detail::ASTBase::Types::Function
@ Function
A function.
Definition
ast.hpp:18
alib::expressions::detail::ASTBase::Types::Literal
@ Literal
A literal.
Definition
ast.hpp:16
alib::expressions::detail::ASTBase::Types::TernaryOp
@ TernaryOp
A ternary operator.
Definition
ast.hpp:21