ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
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//==================================================================================================
8ALIB_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.
13struct 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
26
27 /// Constructor
28 /// @param type The node type.
29 ASTBase( Types type )
30 : NodeType(type) {}
31};
32
33}}} // namespace [alib::expressions::detail]
#define ALIB_EXPORT
Definition alox.cpp:14
Types NodeType
Type of derived this AST node.
Definition ast.hpp:25