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