ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
parser.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//==================================================================================================
9namespace detail {
10
11//==================================================================================================
12/// This detail class constitutes an abstract base class for expression parsers.
13//==================================================================================================
14struct Parser
15{
16 /// Virtual destructor.
17 virtual ~Parser() {}
18
19 /// Parses the given expression string.
20 /// \note
21 /// The return value is hidden by using <c>void*</c>. This is to allow avoid flooding
22 /// of \c boost header includes files to the code entities using module \alib_expressions_nl.
23 ///
24 /// @param expressionString The string to parse.
25 /// @param numberFormat Used to parse literal numbers.
26 /// @return The abstract syntax tree representing the expression.
27 virtual detail::ASTBase* Parse( const String& expressionString,
28 NumberFormat* numberFormat ) = 0;
29
30
31 /// Static method to create a parser object.
32 ///
33 /// @param compiler The compiler that needs a parser.
34 /// @return The parser.
35 ALIB_DLL static
36 Parser* Create( Compiler& compiler );
37};
38
39}} // namespace [alib::expressions::detail]
40
#define ALIB_DLL
Definition alib.inl:496
#define ALIB_EXPORT
Definition alib.inl:488
strings::TNumberFormat< character > NumberFormat
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.
Definition string.inl:2381
This detail class constitutes an abstract base class for expression parsers.
Definition parser.inl:15
virtual ~Parser()
Virtual destructor.
Definition parser.inl:17
static ALIB_DLL Parser * Create(Compiler &compiler)
Definition parser.cpp:29
virtual detail::ASTBase * Parse(const String &expressionString, NumberFormat *numberFormat)=0