ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
compiler.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
9ALIB_EXPORT namespace alib { namespace expressions {
10
11// forwards
12namespace detail { struct Parser; }
13struct CompilerPlugin;
14
15//==================================================================================================
16/// An implementation of this abstract interface class may be attached to field
17/// #"Compiler::Repository;*" to enable an \e automated definition and retrieval
18/// of expression strings of nested expressions.
19///
20/// A default implementation, which uses typical \alib mechanics to define expression
21/// strings, is given with class #"StandardRepository".
22///
23/// More information about automated nested expressions and the use of this interface class is
24/// provided with manual chapter #"alib_expressions_nested_config".
25//==================================================================================================
27 public:
28 /// Virtual destructor.
30
31 /// This method is called during compilation of expressions in the case a named expression
32 /// is not found by method #"Compiler::GetNamed;*".
33 ///
34 /// @param identifier The name of the required expression.
35 /// @param[out] target The target to write the requested expression string to.
36 /// @return \c true, if the expression string could be retrieved, \c false otherwise.
37 /// If \c true is returned and \p{target} is still empty, then the string is defined
38 /// to be empty, which throws an exception on compilation.
39 virtual bool Get( const String& identifier, AString& target ) =0;
40};
41
42//==================================================================================================
43/// This is a central class of library module \alib_expressions_nl used to compile
44/// expression strings.
45///
46/// For information about general use and features of this class consult the
47/// #"alib::expressions;ALib Expressions User Manual".
48///
49/// ## Friends ##
50/// class #"ExpressionVal"
51//==================================================================================================
52class Compiler : public lang::PluginContainer<CompilerPlugin, CompilePriorities> {
53 #if !DOXYGEN
54 friend class ExpressionVal;
55 friend struct detail::Parser;
56 friend class detail::ProgramBase;
57 #endif
58
59 public:
60 /// Alias shortcut to the type of the plug-in vector inherited from #"%PluginContainer".
61 using Plugins= std::vector<lang::PluginContainer<CompilerPlugin, CompilePriorities>::Slot>;
62
63 //################################################################################################
64 // internal fields
65 //################################################################################################
66 protected:
67 /// Memory for used for permanent allocations during the set-up phase.
68 /// Later it is also used for temporary allocations during compilation and reset to its
69 /// state after setup.
71
72 /// The expression parser.
74
75 /// The map of Type names and bit flag values.
80
81 /// The map of 'named' expressions.
84 std::hash <String>,
85 std::equal_to<String> > namedExpressions;
86
87
88 //################################################################################################
89 // Public fields
90 //################################################################################################
91 public:
92
93 /// The list of unary operators.
94 /// To define a new unary operator, method #"AddUnaryOperator" should be used.
95 /// In debug-builds, the methods asserts that no double insertions are performed.
96 ///
97 /// Custom insertions may be performed before or after invoking #"SetupDefaults",
98 /// but before a first expression is compiled.
99 ///
100 ///
101 /// Flag #"Compilation::DefaultUnaryOperators;*" controls if method
102 /// #"%SetupDefaults" adds operators resourced with enumeration
103 /// #"expressions::DefaultUnaryOperators".
105
106 /// This public map allows defining alias names for unary operators. Such names
107 /// must consist only of alphabetic characters.
108 ///
109 /// Flag #"Compilation::DefaultAlphabeticOperatorAliases;*" controls if method
110 /// #"SetupDefaults" adds the aliases defined with resourced data records of enumeration
111 /// #"DefaultAlphabeticUnaryOperatorAliases" to this map.
113 String, String,
114 alib::hash_string_ignore_case<character>,
115 alib::equal_to_string_ignore_case<character> > AlphabeticUnaryOperatorAliases;
116
117 /// This public map allows defining alias names for binary operators. Such names
118 /// must consist only of alphabetic characters.
119 ///
120 /// Flag #"Compilation::DefaultAlphabeticOperatorAliases;*" controls if method
121 /// #"SetupDefaults" adds the aliases defined with resourced data records of enumeration
122 /// #"DefaultAlphabeticBinaryOperatorAliases" to this map.
124 alib::hash_string_ignore_case<character>,
125 alib::equal_to_string_ignore_case<character> > AlphabeticBinaryOperatorAliases;
126
127 /// Adds an unary operator to this expression compiler.
128 /// This method should be invoked before invoking #"SetupDefaults".
129 ///
130 /// Operator symbols must be added only once.
131 ///
132 /// @param symbol The operator symbol.
133 void AddUnaryOperator( const String& symbol ) {
134 #if ALIB_DEBUG
135 for( auto& op : UnaryOperators )
136 if( op.Equals<NC>( symbol ) )
137 ALIB_ASSERT_ERROR( false, "EXPR", "Unary operator '{}' already defined.",
138 symbol )
139 #endif
140 UnaryOperators.emplace_back(symbol);
141 }
142
143
144 /// The list of binary operators. The map stores the precedences.
145 ///
146 /// To define a new binary operator, entry may be added before invoking #"SetupDefaults"
147 /// using method #"AddBinaryOperator".
148 ///
149 /// Flag #"Compilation::DefaultUnaryOperators;*" controls if method
150 /// #"%SetupDefaults" adds operators resourced with enumeration
151 /// #"expressions::DefaultBinaryOperators".
153
154 /// Adds a binary operator to this expression compiler.
155 /// This method should be invoked before invoking #"SetupDefaults".
156 ///
157 /// Operator symbols must be added only once.
158 ///
159 /// @param symbol The operator symbol.
160 /// @param precedence The precedence of the operator.
161 void AddBinaryOperator( const String& symbol, int precedence ) {
162 ALIB_DBG( auto result= )
163 BinaryOperators.EmplaceOrAssign(symbol, precedence);
164 ALIB_ASSERT_ERROR( result.second == true, "EXPR", // was inserted
165 "Binary operator '{}' already defined.", symbol )
166 }
167
168 /// Returns the precedence of the given operator-symbol.
169 /// @param symbol The operator symbol.
170 /// @return The precedence of the operator as defined with #"AddBinaryOperator".
171 int GetBinaryOperatorPrecedence( const String& symbol ) {
172 // search in operator table first
173 auto it= BinaryOperators.Find( symbol );
174 if( it != BinaryOperators.end() )
175 return it.Mapped();
176
177 // have an alias?
178 auto aliasOp= AlphabeticBinaryOperatorAliases.Find( symbol );
179 ALIB_ASSERT_ERROR( aliasOp != AlphabeticBinaryOperatorAliases.end(), "EXPR",
180 "Unknown binary operator '{}'.", symbol )
181
182 it= BinaryOperators.Find( aliasOp.Mapped() );
183 ALIB_ASSERT_ERROR( it != BinaryOperators.end(), "EXPR",
184 "Unknown binary operator '{}' which was aliased by '{}'.",
185 aliasOp->second, symbol )
186 return it.Mapped();
187 }
188
189
190 /// #"BitwiseTraits;Bitwise enum class" that lists the plug-ins built-into
191 /// \alib expression library. This bitfield is used with method #"SetupDefaults", which
192 /// reads the flags set in #".CfgBuiltInPlugins" and installs the plug-ins accordingly.
193 enum class BuiltInPlugins {
194 NONE = 0, ///< Installs no plug-in.
195 ALL = -1, ///< Installs all plug-ins.
196 ElvisOperator = (1 << 1), ///< Installs #"plugins::ElvisOperator;*".
197 AutoCast = (1 << 2), ///< Installs #"plugins::AutoCast;*".
198 Arithmetics = (1 << 3), ///< Installs #"plugins::Arithmetics;*".
199 Math = (1 << 4), ///< Installs #"plugins::Math;*".
200 Strings = (1 << 5), ///< Installs #"plugins::Strings;*".
201 #if ALIB_CAMP
202 DateAndTime = (1 << 6), ///< Installs #"plugins::DateAndTime;*". )
203 #endif
204 };
205
206
207 /// Bitfield that defines the built-in compiler plug-ins that are created and inserted
208 /// by method #".SetupDefaults".
209 ///
210 /// Defaults to #"BuiltInPlugins::ALL"
211 ///
212 /// \note
213 /// The built-in plug-ins are allowed to be shared by different compiler instances.
214 /// To reach that, they must not be disabled here (or method #".SetupDefaults" must be
215 /// omitted) and instead created once and registered with the compiler using the
216 /// inherited method #"InsertPlugin". In that case, the value
217 /// \c "Responsibility::KeepWithSender" has to be provided as parameter \p{responsibility}.
219
220 /// The operator defined in this public field is used to address nested expressions.
221 /// The operator used can be customized to any defined (!) unary operator.
222 ///
223 /// To disable nested expression parsing, change to empty or \e nulled string.
224 ///
225 /// \note
226 /// If changed, the change hast to be made \b before invoking #".SetupDefaults". Otherwise,
227 /// the default configuration for
228 /// #"alib_expressions_operators_verbal;verbal operator aliases" would be set in
229 /// effect to a wrong (or disabled) target operator.
230 ///
231 /// Defaults to \c "*".
232 ///
233 /// \see Manual chapter #"alib_expressions_nested".
234 ///
236
237 /// Name descriptor for nested expression function.
238 /// Defaults to "Expression" with a minimum abbreviation of \c 4 characters, ignoring letter
239 /// case.<br>
240 /// Resourced with the key \c "EF"
241 ///
242 /// \see Manual chapter #"alib_expressions_nested".
244
245 /// Keyword used with optional third parameter of expression function.
246 /// Defaults to \c "throw". Resourced with key \c "EF"
247 ///
248 /// \see Manual chapter #"alib_expressions_nested".
250
251 /// Compilation flags.
253
254 /// Flags that allow to tweak the result of the normalization of the originally parsed
255 /// expression string.
257
258 /// This list is used with the normalization of the expression string. It contains
259 /// strings, which are not allowed to appear in normalized expression strings.
260 ///
261 /// In the current library version, such strings might occur only if flags
262 /// #"Normalization::UnaryOpSpace;*",
263 /// #"Normalization::UnaryOpSpaceIfUnaryFollows;*" or
264 /// #"Normalization::BinaryOpSpaces;*" are not set.
265 /// As a sample see expression:
266 ///
267 /// 1 - -2
268 ///
269 /// If no space is written after binary operators, this expression would be normalized
270 /// to:
271 /// 1--2
272 ///
273 /// While this just looks irritating to a homo sapiens, it would be even illegal if
274 /// well known C++ operator <c>--</c> was supported. Therefore, string <c>"--"</c> is added
275 /// to this map in method #".SetupDefaults", which forces the normalization logic to insert
276 /// a space, even if spaces are otherwise configured to be omitted.
278
279 /// Formatter used throughout all phases of the life-cycle of an expression:
280 /// - Used for parsing expression strings (Using the encapsulated #"TNumberFormat;NumberFormat"
281 /// object.)
282 /// - Used for the generation of the normalized expression strings.
283 /// - Used for the generation of constant string objects during compilation.
284 /// - Used for the generation of string objects during evaluation.
285 ///
286 /// For the latter two, a copy of the pointer is provided through field
287 /// #"Scope::Formatter".
288 /// It is important not to change the formatting parameters in between the creation of the
289 /// compile-time scope and the creation of the evaluation-time scope. If done,
290 /// the expression results could differ when optimizations during compilation are performed.
291 ///
292 /// In the constructor of this class, a #"Formatter::Clone;clone" of the
293 /// \alib {format::Formatter;Default;default formatter} is copied here.
295
296 /// Optional pointer to a default or custom implementation of a repository that provides
297 /// expression strings for named nested expressions.
298 ///
299 /// \see Manual chapter #"alib_expressions_nested_config".
301
302 //################################################################################################
303 // Public Interface
304 //################################################################################################
305 public:
306 /// Constructor. Construction usually is three steps:
307 /// 1. Create class instance
308 /// 2. Set the various configuration options (fields prefixed <c>Cfg</c>).
309 /// 3. Invoke #".SetupDefaults".
311
312 /// Destructor
314 virtual ~Compiler();
315
316 /// Registers a (custom) type name with this compiler. The name will be used to
317 /// display a type name to end-users, for example, when malformed expressions throw an
318 /// exception.
319 ///
320 /// The built-in types get registered in the constructor of the compiler, where the
321 /// type names are read from the #"ResourcePool" of static library object
322 /// #"EXPRESSIONS".
323 ///
324 /// It is recommended that custom plug-ins invoke this method in their constructor.
325 ///
326 /// \note
327 /// There is no general need to register types for using them
328 /// with \alib_expressions_nl. Parameter \p{name} of this method is exclusively
329 /// used to generate textual, human-readable output!
330 ///
331 /// @param sample A #"alib_expressions_prereq_sb;sample value"
332 /// of the type, which is implicitly boxed when passed.
333 /// @param name The name of the type.
335 void AddType(Type sample, const NString& name);
336
337 /// Returns the name of the type of the boxed value.
338 /// Note that custom types need to be registered with method #".AddType".
339 ///
340 /// If given argument \p{box} is #"alib_boxing_more_void_void;a void box", the returned
341 /// string is <b>"NONE"</b>.
342 ///
343 /// @param box The box to receive the type name for.
344 /// @return The type name as string.
346 NString TypeName(Type box);
347
348 /// Writes the signature of a function (as, for example, found in
349 /// #"Calculus::FunctionEntry") to a string buffer.
350 ///
351 /// @param boxArray The start of the array of pointers.
352 /// @param qty The array's length.
353 /// @param target The string to write into.
355 void WriteFunctionSignature( Box** boxArray, size_t qty, AString& target );
356
357 /// Writes the signature of an argument list to a string buffer.
358 ///
359 /// @param begin Iterator to the first argument.
360 /// @param end End-iterator.
361 /// @param target The string to write into.
364 ArgIterator end,
365 AString& target );
366
367 /// Completes construction according to configuration options provided with fields
368 /// prefixed <c>Cfg</c>.
369 /// In detail, the following actions are performed:
370 /// - If flag #"Compilation::DefaultUnaryOperators;*" is set in field
371 /// #".CfgCompilation", then
372 /// - the unary operators listed in the #"alib_enums_records;enum records" of
373 /// #"expressions::DefaultUnaryOperators" are added using #".AddUnaryOperator".
374 /// - If flag #"Compilation::DefaultAlphabeticOperatorAliases;*" is set in
375 /// field #".CfgCompilation", then the alphabetic alias names found in
376 /// the data records of enumeration
377 /// #"DefaultAlphabeticUnaryOperatorAliases"
378 /// are set in field #".AlphabeticUnaryOperatorAliases". (As of the current version this
379 /// is only the token \b not aliasing operator <b>"!"</b>.
380 /// - If flag #"Compilation::DefaultBinaryOperators;*" is set in field
381 /// #".CfgCompilation", then
382 /// - the binary operators listed in the data records of enumeration
383 /// #"expressions::DefaultBinaryOperators" are added using #".AddBinaryOperator".
384 /// - If flag #"Compilation::AllowSubscriptOperator;*" is not set, the
385 /// subscript operator is omitted.
386 /// - If flag #"Compilation::DefaultAlphabeticOperatorAliases;*" is set in
387 /// field #".CfgCompilation", then the alphabetic alias names found in
388 /// the data records of enumeration
389 /// #"DefaultAlphabeticBinaryOperatorAliases"
390 /// are set in field #".AlphabeticBinaryOperatorAliases". (As of the current version this
391 /// is only the token \b not aliasing operator <b>"!"</b>.
392 /// - Strings <b>"++"</b> and <b>"--"</b> are added to field #".CfgNormalizationDisallowed"
393 /// to prevent the unintentional creation of these potential operators in normalizations.
394 /// (This way, a space character will be added between binary <b>"+"</b> and unary
395 /// <b>"+"</b>, respectively binary <b>"-"</b> and unary <b>"-"</b> operators,
396 /// even if the normalization options do not suggest to do this.
397 /// - Depending on the flags set in #".CfgBuiltInPlugins", the plug-ins listed in
398 /// enumeration #".BuiltInPlugins" are created and added.
400 void SetupDefaults();
401
402 /// Firstly, this method parses the given expression string thereby builds an intermediate
403 /// internal #"detail::AST;abstract syntax tree".
404 /// This tree is then translated into a #"detail::Program;*" which evaluates
405 /// the expression in respect to a #"expressions::Scope" when executed.
406 ///
407 /// For building the program, attached #"CompilerPlugin" instances
408 /// are queried.
409 ///
410 /// During this process, a #"Normalization;normalized" version of the input
411 /// string is always created. While the original input string can
412 /// be accessed with #"ExpressionVal::GetOriginalString;*", the normalized
413 /// version can be retrieved after the compilation with method
414 /// #"ExpressionVal::GetNormalizedString;*". During compilation, the
415 /// normalization rules (flags) stored in field #".CfgNormalization" are applied.
416 ///
417 /// For compilation, a compile-time scope object is created by calling the virtual method
418 /// #".createCompileTimeScope". If not overwritten, a standard scope object is used.
419 /// If custom callbacks exists that are invokable at compile-time
420 /// (to perform program optimization) and that at the same time rely on custom mechanics
421 /// provided with a custom scope class, then a custom, derived version of this class
422 /// has to be used that overrides method #".createCompileTimeScope" accordingly.
423 ///
424 /// @param expressionString The string to parse.
425 /// @return A shared pointer to the compiled expression. Contains \c nullptr on failure.
426 virtual ALIB_DLL
427 Expression Compile( const String& expressionString );
428
429 /// Compiles the given \p{expressionString} and adds a compiled expression to the map of
430 /// named expressions.
431 ///
432 /// @param name The name used to map the expression.
433 /// @param expressionString The string to parse.
434 /// If nulled, entry \p{name} is removed (if existing).
435 /// @return \c true if an expression with the same named existed and was replaced.
436 /// Otherwise, returns \c false.
437 virtual ALIB_DLL
438 bool AddNamed( const String& name, const String& expressionString );
439
440 /// Removes a named expression. This is just a shortcut to #".AddNamed", providing
441 /// a nulled string for parameter \p{expressionString}.
442 ///
443 /// @param name The name of the expression to be removed.
444 /// @return \c true if an expression with the given name existed and was removed.
445 /// Otherwise, returns \c false.
446 bool RemoveNamed( const String& name ) { return AddNamed( name, NULL_STRING ); }
447
448 /// Returns a named expression previously defined using #".AddNamed".
449 /// In the case that no expression with the given \p{name} was defined and optional interface
450 /// #".Repository" is set, then this interface is used to retrieve a corresponding expression
451 /// string and compile the named expression 'on the fly'.
452 ///
453 /// \see
454 /// Manual chapter #"alib_expressions_nested_config".
455 ///
456 /// @param name The name of the expression.
457 /// @return In case of success a shared pointer to the expression.
458 virtual ALIB_DLL
459 Expression GetNamed( const String& name );
460
461 /// Provides access to the internal #"MonoAllocator".
462 /// \note This method is deemed non-standard use of this class, and the using code needs to
463 /// knowing what to do.
464 /// @return The internal monotonous allocator.
466
467 //################################################################################################
468 // Protected Interface
469 //################################################################################################
470 protected:
471 /// This virtual method is called by #".Compile" to create the scope object used
472 /// for allocations that are made for intermediate results at compile-time.
473 ///
474 /// Compile-time allocations occur when expression terms that use purely constant arguments
475 /// are evaluated at compile-time. Such optimization consequently leads to the invocation
476 /// of callback functions at compile-time.
477 ///
478 /// If now, custom callback functions rely on custom allocation mechanics, provided with
479 /// custom scope types, then this method has to be overridden to return such a custom
480 /// scope object.
481 ///
482 /// @param expressionAllocator The allocator of the expression used to allocate the
483 /// compile-time scope.
484 /// @return The default implementation returns the standard scope object.
485 /// For its construction, the field #".CfgFormatter" is provided.<br>
486 /// Derived compilers may need to return a scope object of a derived type.
487 virtual ALIB_DLL
488 Scope* createCompileTimeScope(MonoAllocator& expressionAllocator);
489
490 /// Implements #"ExpressionVal::GetOptimizedString;*".
491 ///
492 /// @param expression the expression to generate an optimized string for.
495};
496
497
498
499namespace detail {
500/// Base class exported by the main module #"F;ALib.Expressions.H" for technical reasons.
502 protected:
503 /// Friendship-access method used by derived implementation.
504 /// @param ev The expression to receive protected data from.
505 /// @return The expression's allocotor.
507
508 /// Friendship-access method used by derived implementation.
509 /// @param ev The expression to receive protected data from.
510 /// @return The expression's compile-time scope.
512
513 /// Friendship-access method used by derived implementation.
514 /// @param cmp The compiler to receive protected data from.
515 /// @return The compiler's plugins.
517};
518
519/// Base class exported by the main module #"F;ALib.Expressions.H" for technical reasons.
521 protected:
522 /// Friendship-access method used by derived implementation.
523 /// @param ev The expression to receive protected data from.
524 /// @return The expression's compile-time scope.
525 static Scope* getExpressionCTScope (ExpressionVal& ev) { return ev.ctScope; }
526};
527
528
529}
530
531} // namespace alib[::expressions]
532
533DOX_MARKER([DOX_MANUAL_ALIASES_COMPILER])
534/// Type alias in namespace #"%alib".
536
537} // namespace [alib]
538DOX_MARKER([DOX_MANUAL_ALIASES_COMPILER])
539
#define ALIB_DLL
#define A_CHAR(STR)
#define ALIB_EXPORT
#define ALIB_DBG(...)
#define ALIB_ASSERT_ERROR(cond, domain,...)
#define ALIB_CAMP
bool RemoveNamed(const String &name)
Definition compiler.hpp:446
Normalization CfgNormalization
Definition compiler.hpp:256
ListMA< String > UnaryOperators
Definition compiler.hpp:104
Compilation CfgCompilation
Compilation flags.
Definition compiler.hpp:252
virtual Expression Compile(const String &expressionString)
Definition compiler.cpp:200
NString TypeName(Type box)
Definition compiler.cpp:384
StringVectorMA CfgNormalizationDisallowed
Definition compiler.hpp:277
void WriteFunctionSignature(Box **boxArray, size_t qty, AString &target)
Definition compiler.cpp:397
virtual Expression GetNamed(const String &name)
Definition compiler.cpp:344
BuiltInPlugins CfgBuiltInPlugins
Definition compiler.hpp:218
void AddBinaryOperator(const String &symbol, int precedence)
Definition compiler.hpp:161
std::vector< lang::PluginContainer< CompilerPlugin, CompilePriorities >::Slot > Plugins
Alias shortcut to the type of the plug-in vector inherited from #"%PluginContainer".
Definition compiler.hpp:61
strings::util::Token CfgNestedExpressionFunction
Definition compiler.hpp:243
virtual bool AddNamed(const String &name, const String &expressionString)
Definition compiler.cpp:313
ExpressionRepository * Repository
Definition compiler.hpp:300
void getOptimizedExpressionString(ExpressionVal &expression)
Definition compiler.cpp:286
HashMap< MonoAllocator, String, int > BinaryOperators
Definition compiler.hpp:152
void AddUnaryOperator(const String &symbol)
Definition compiler.hpp:133
@ AutoCast
Installs #"plugins::AutoCast;*".
Definition compiler.hpp:197
@ DateAndTime
Installs #"plugins::DateAndTime;*". ).
Definition compiler.hpp:202
@ Arithmetics
Installs #"plugins::Arithmetics;*".
Definition compiler.hpp:198
@ Strings
Installs #"plugins::Strings;*".
Definition compiler.hpp:200
@ Math
Installs #"plugins::Math;*".
Definition compiler.hpp:199
@ ElvisOperator
Installs #"plugins::ElvisOperator;*".
Definition compiler.hpp:196
detail::Parser * parser
The expression parser.
Definition compiler.hpp:73
virtual Scope * createCompileTimeScope(MonoAllocator &expressionAllocator)
Definition compiler.cpp:120
void AddType(Type sample, const NString &name)
Definition compiler.cpp:377
HashMap< MonoAllocator, AString, Expression, std::hash< String >, std::equal_to< String > > namedExpressions
The map of 'named' expressions.
Definition compiler.hpp:85
HashMap< MonoAllocator, String, String, alib::hash_string_ignore_case< character >, alib::equal_to_string_ignore_case< character > > AlphabeticUnaryOperatorAliases
Definition compiler.hpp:115
MonoAllocator & GetAllocator()
Definition compiler.hpp:465
HashMap< MonoAllocator, lang::TypeFunctors::Key, NAString, lang::TypeFunctors::Hash, lang::TypeFunctors::EqualTo > typeMap
The map of Type names and bit flag values.
Definition compiler.hpp:79
int GetBinaryOperatorPrecedence(const String &symbol)
Definition compiler.hpp:171
virtual ~Compiler()
Destructor.
Definition compiler.cpp:118
HashMap< MonoAllocator, String, String, alib::hash_string_ignore_case< character >, alib::equal_to_string_ignore_case< character > > AlphabeticBinaryOperatorAliases
Definition compiler.hpp:125
virtual bool Get(const String &identifier, AString &target)=0
virtual ~ExpressionRepository()
Virtual destructor.
Definition compiler.hpp:29
Base class exported by the main module #"F;ALib.Expressions.H" for technical reasons.
Definition compiler.hpp:501
Scope * getExpressionCTScope(ExpressionVal &ev)
Definition compiler.hpp:511
MonoAllocator & getExpressionAllocator(ExpressionVal &ev)
Definition compiler.hpp:506
Compiler::PluginList & getCompilerPlugins(Compiler &cmp)
Definition compiler.hpp:516
PluginList plugins
The plug-ins we have attached in descending priority order.
#define ALIB_ENUMS_MAKE_BITWISE(TEnum)
const alib::boxing::Box & Type
StdVectorMA< Box >::iterator ArgIterator
Definition alox.cpp:14
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
strings::TString< nchar > NString
Type alias in namespace #"%alib".
Definition string.hpp:2174
constexpr String NULL_STRING
A nulled string of the default character type.
Definition string.hpp:2247
containers::SharedPtr< format::Formatter > SPFormatter
Definition formatter.hpp:41
containers::List< T, MonoAllocator, TRecycling > ListMA
Type alias in namespace #"%alib".
Definition list.hpp:689
strings::util::TStringVector< character, MonoAllocator > StringVectorMA
Type alias in namespace #"%alib".
Definition vector.hpp:107
strings::TAString< nchar, lang::HeapAllocator > NAString
Type alias in namespace #"%alib".
boxing::Box Box
Type alias in namespace #"%alib".
Definition box.hpp:1128
expressions::Compiler Compiler
Type alias in namespace #"%alib".
Definition compiler.hpp:535
containers::HashMap< TAllocator, TKey, TMapped, THash, TEqual, THashCaching, TRecycling > HashMap
Type alias in namespace #"%alib".
strings::TString< character > String
Type alias in namespace #"%alib".
Definition string.hpp:2165
strings::TAString< character, lang::HeapAllocator > AString
Type alias in namespace #"%alib".
This detail class constitutes an abstract base class for expression parsers.
Definition parser.hpp:14
Base class exported by the main module #"F;ALib.Expressions.H" for technical reasons.
Definition compiler.hpp:520
static Scope * getExpressionCTScope(ExpressionVal &ev)
Definition compiler.hpp:525
Comparison functor for type const std::type_info*.
Hash code functor for type const std::type_info*.
const ::std::type_info * Key
The key type.