Ark Server API (ASA) - Wiki
|
Typedefs | |
typedef TValueOrError< TArray< FExpressionToken >, FExpressionError > | LexResultType |
typedef TValueOrError< TArray< FCompiledToken >, FExpressionError > | CompileResultType |
Define some expression types for basic arithmetic
An expression parser, responsible for lexing, compiling, and evaluating expressions. The parser supports 3 functions:
See ExpressionParserExamples.cpp for example usage.
typedef TValueOrError< TArray<FCompiledToken>, FExpressionError > ExpressionParser::CompileResultType |
Definition at line 23 of file ExpressionParser.h.
Definition at line 22 of file ExpressionParser.h.
CompileResultType ExpressionParser::Compile | ( | const TCHAR * | InExpression, |
const FTokenDefinitions & | TokenDefinitions, | ||
const FExpressionGrammar & | InGrammar ) |
Compile the specified expression into an array of Reverse-Polish order nodes for evaluation, according to our grammar definition
CompileResultType ExpressionParser::Compile | ( | TArray< FExpressionToken > | InTokens, |
const FExpressionGrammar & | InGrammar ) |
Compile the specified tokens into an array of Reverse-Polish order nodes for evaluation, according to our grammar definition
TOptional< FExpressionError > ExpressionParser::ConsumeLocalizedNumber | ( | FExpressionTokenConsumer & | Consumer | ) |
Consume a localized number from the specified consumer's stream, if one exists at the current read position
TOptional< FExpressionError > ExpressionParser::ConsumeLocalizedNumberWithAgnosticFallback | ( | FExpressionTokenConsumer & | Consumer | ) |
Consume a localized number from the specified consumer's stream, if one exists at the current read position
TOptional< FExpressionError > ExpressionParser::ConsumeNumber | ( | FExpressionTokenConsumer & | Consumer | ) |
Consume a number from the specified consumer's stream, if one exists at the current read position
TOptional< FExpressionError > ExpressionParser::ConsumeNumberWithRules | ( | FExpressionTokenConsumer & | Consumer, |
const FDecimalNumberFormattingRules & | InFormattingRules ) |
Consume a number formatted using the given rules from the specified consumer's stream, if one exists at the current read position
TOptional< FExpressionError > ExpressionParser::ConsumeSymbol | ( | FExpressionTokenConsumer & | Consumer | ) |
Consume a symbol from the specified consumer's stream, if one exists at the current read position
Definition at line 69 of file BasicMathExpressionEvaluator.h.
FExpressionResult ExpressionParser::Evaluate | ( | const TArray< FCompiledToken > & | CompiledTokens, |
const IOperatorEvaluationEnvironment & | InEnvironment ) |
Evaluate the specified pre-compiled tokens using an evaluation environment
FExpressionResult ExpressionParser::Evaluate | ( | const TArray< FCompiledToken > & | CompiledTokens, |
const TOperatorJumpTable< ContextType > & | InJumpTable, | ||
const ContextType * | InContext = nullptr ) |
Definition at line 49 of file ExpressionParser.h.
FExpressionResult ExpressionParser::Evaluate | ( | const TCHAR * | InExpression, |
const FTokenDefinitions & | InTokenDefinitions, | ||
const FExpressionGrammar & | InGrammar, | ||
const IOperatorEvaluationEnvironment & | InEnvironment ) |
Evaluate the specified expression using the specified token definitions, grammar definition, and evaluation environment
FExpressionResult ExpressionParser::Evaluate | ( | const TCHAR * | InExpression, |
const FTokenDefinitions & | InTokenDefinitions, | ||
const FExpressionGrammar & | InGrammar, | ||
const TOperatorJumpTable< ContextType > & | InJumpTable, | ||
const ContextType * | InContext = nullptr ) |
Templated versions of evaluation functions used when passing a specific jump table and context
Definition at line 42 of file ExpressionParser.h.
const FDecimalNumberFormattingRules & ExpressionParser::GetLocalizedNumberFormattingRules | ( | ) |
Get the default set number formatting rules based on the current locale and user settings
LexResultType ExpressionParser::Lex | ( | const TCHAR * | InExpression, |
const FTokenDefinitions & | TokenDefinitions ) |
Lex the specified string, using the specified grammar
TOptional< FStringToken > ExpressionParser::ParseLocalizedNumber | ( | const FTokenStream & | InStream, |
FStringToken * | Accumulate = nullptr, | ||
double * | OutValue = nullptr ) |
Parse a localized number from the given stream, optionally from a specific read position
TOptional< FStringToken > ExpressionParser::ParseLocalizedNumberWithAgnosticFallback | ( | const FTokenStream & | InStream, |
FStringToken * | Accumulate = nullptr, | ||
double * | OutValue = nullptr ) |
Parse a localized number from the given stream, optionally from a specific read position
TOptional< FStringToken > ExpressionParser::ParseNumber | ( | const FTokenStream & | InStream, |
FStringToken * | Accumulate = nullptr, | ||
double * | OutValue = nullptr ) |
Parse a number from the given stream, optionally from a specific read position
TOptional< FStringToken > ExpressionParser::ParseNumberWithFallback | ( | const FTokenStream & | InStream, |
const FDecimalNumberFormattingRules & | InPrimaryFormattingRules, | ||
const FDecimalNumberFormattingRules & | InFallbackFormattingRules, | ||
FStringToken * | Accumulate = nullptr, | ||
double * | OutValue = nullptr ) |
Parse a number formatted using the given rules from the given stream, optionally from a specific read position
TOptional< FStringToken > ExpressionParser::ParseNumberWithRules | ( | const FTokenStream & | InStream, |
const FDecimalNumberFormattingRules & | InFormattingRules, | ||
FStringToken * | Accumulate = nullptr, | ||
double * | OutValue = nullptr ) |
Parse a number formatted using the given rules from the given stream, optionally from a specific read position