ALib C++ Library
by
Library Version:
2510 R0
Documentation generated by
Loading...
Searching...
No Matches
home
dev
A-Worx
ALib
src
alib
expressions
detail
ast.inl
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
/// \emoji :copyright: 2013-2025 A-Worx GmbH, Germany.
6
/// Published under \ref mainpage_license "Boost Software 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 \alib{MonoAllocator} and
12
/// hence have empty destructors.
13
struct
ASTBase
14
{
15
/// The type of node.
16
enum class
Types
17
{
18
Literal
,
///< A literal.
19
Identifier
,
///< An identifier.
20
Function
,
///< A function.
21
UnaryOp
,
///< A unary operator.
22
BinaryOp
,
///< A binary operator.
23
TernaryOp
,
///< A ternary operator.
24
};
25
26
/// Type of derived this AST node
27
Types
NodeType
;
28
29
/// Constructor
30
/// @param type The node type.
31
ASTBase
(
Types
type )
32
:
NodeType
(type)
33
{}
34
};
35
36
}}}
// namespace [alib::expressions::detail]
ALIB_EXPORT
#define ALIB_EXPORT
Definition
alib.inl:488
alib::expressions::detail
Definition
compiler.inl:12
alib::expressions
Definition
compiler.cpp:32
alib
Definition
ALib.Boxing.StdFunctors.H:18
alib::expressions::detail::ASTBase::ASTBase
ASTBase(Types type)
Definition
ast.inl:31
alib::expressions::detail::ASTBase::NodeType
Types NodeType
Type of derived this AST node.
Definition
ast.inl:27
alib::expressions::detail::ASTBase::Types
Types
The type of node.
Definition
ast.inl:17
alib::expressions::detail::ASTBase::Types::Identifier
@ Identifier
An identifier.
Definition
ast.inl:19
alib::expressions::detail::ASTBase::Types::UnaryOp
@ UnaryOp
A unary operator.
Definition
ast.inl:21
alib::expressions::detail::ASTBase::Types::BinaryOp
@ BinaryOp
A binary operator.
Definition
ast.inl:22
alib::expressions::detail::ASTBase::Types::Function
@ Function
A function.
Definition
ast.inl:20
alib::expressions::detail::ASTBase::Types::Literal
@ Literal
A literal.
Definition
ast.inl:18
alib::expressions::detail::ASTBase::Types::TernaryOp
@ TernaryOp
A ternary operator.
Definition
ast.inl:23