Interface IParsedExpressionFactory
- Namespace
- LfrlAnvil.Computable.Expressions
- Assembly
- LfrlAnvil.Computable.Expressions.dll
Represents a parsed expression factory.
public interface IParsedExpressionFactoryProperties
Configuration
Configuration of this factory.
IParsedExpressionFactoryConfiguration Configuration { get; }Property Value
Methods
Create<TArg, TResult>(string)
Creates a new IParsedExpression<TArg, TResult> instance.
[Pure]
IParsedExpression<TArg, TResult> Create<TArg, TResult>(string input)Parameters
- inputstring
- Input to parse. 
Returns
- IParsedExpression<TArg, TResult>
- New IParsedExpression<TArg, TResult> instance. 
Type Parameters
- TArg
- Argument type. 
- TResult
- Result type. 
Exceptions
- ParsedExpressionCreationException
- When - inputparsing failed.
GetBinaryOperatorPrecedence(StringSegment)
Returns the binary operator precedence associated with the provided symbol.
[Pure]
int? GetBinaryOperatorPrecedence(StringSegment symbol)Parameters
- symbolStringSegment
- Symbol to check. 
Returns
- int?
- Binary operator precedence if it exists. 
GetConstantExpression(StringSegment)
Returns the ConstantExpression associated with the provided symbol.
[Pure]
ConstantExpression? GetConstantExpression(StringSegment symbol)Parameters
- symbolStringSegment
- Symbol to check. 
Returns
- ConstantExpression
- ConstantExpression if it exists. 
GetConstructSymbols()
Creates a new IEnumerable<T> instance that contains all available construct symbols.
[Pure]
IEnumerable<StringSegment> GetConstructSymbols()Returns
- IEnumerable<StringSegment>
- New IEnumerable<T> instance. 
GetConstructType(StringSegment)
Returns the ParsedExpressionConstructType of the provided symbol.
[Pure]
ParsedExpressionConstructType GetConstructType(StringSegment symbol)Parameters
- symbolStringSegment
- Construct symbol to check. 
Returns
- ParsedExpressionConstructType
- ParsedExpressionConstructType associated with the provided - symbol.
GetFunctionExpressions(StringSegment)
Returns a collection of all function expressions for the provided symbol.
[Pure]
IEnumerable<LambdaExpression> GetFunctionExpressions(StringSegment symbol)Parameters
- symbolStringSegment
- Construct symbol to check. 
Returns
- IEnumerable<LambdaExpression>
- Collection of all function expressions. 
GetGenericBinaryOperatorType(StringSegment)
Returns the generic binary operator construct's type for the provided symbol.
[Pure]
Type? GetGenericBinaryOperatorType(StringSegment symbol)Parameters
- symbolStringSegment
- Construct symbol to check. 
Returns
- Type
- Type of the generic binary operator construct's type if it exists. 
GetGenericPostfixUnaryConstructType(StringSegment)
Returns the generic postfix unary construct's type for the provided symbol.
[Pure]
Type? GetGenericPostfixUnaryConstructType(StringSegment symbol)Parameters
- symbolStringSegment
- Construct symbol to check. 
Returns
- Type
- Type of the generic postfix unary construct's type if it exists. 
GetGenericPrefixUnaryConstructType(StringSegment)
Returns the generic prefix unary construct's type for the provided symbol.
[Pure]
Type? GetGenericPrefixUnaryConstructType(StringSegment symbol)Parameters
- symbolStringSegment
- Construct symbol to check. 
Returns
- Type
- Type of the generic prefix unary construct's type if it exists. 
GetPostfixUnaryConstructPrecedence(StringSegment)
Returns the postfix unary construct precedence associated with the provided symbol.
[Pure]
int? GetPostfixUnaryConstructPrecedence(StringSegment symbol)Parameters
- symbolStringSegment
- Symbol to check. 
Returns
- int?
- Postfix unary construct precedence if it exists. 
GetPrefixUnaryConstructPrecedence(StringSegment)
Returns the prefix unary construct precedence associated with the provided symbol.
[Pure]
int? GetPrefixUnaryConstructPrecedence(StringSegment symbol)Parameters
- symbolStringSegment
- Symbol to check. 
Returns
- int?
- Prefix unary construct precedence if it exists. 
GetSpecializedBinaryOperators(StringSegment)
Returns a collection of all specialized binary operator constructs for the provided symbol.
[Pure]
IEnumerable<ParsedExpressionBinaryOperatorInfo> GetSpecializedBinaryOperators(StringSegment symbol)Parameters
- symbolStringSegment
- Construct symbol to check. 
Returns
- IEnumerable<ParsedExpressionBinaryOperatorInfo>
- Collection of all specialized binary operator constructs. 
GetSpecializedPostfixUnaryConstructs(StringSegment)
Returns a collection of all specialized postfix unary constructs for the provided symbol.
[Pure]
IEnumerable<ParsedExpressionUnaryConstructInfo> GetSpecializedPostfixUnaryConstructs(StringSegment symbol)Parameters
- symbolStringSegment
- Construct symbol to check. 
Returns
- IEnumerable<ParsedExpressionUnaryConstructInfo>
- Collection of all specialized postfix unary constructs. 
GetSpecializedPrefixUnaryConstructs(StringSegment)
Returns a collection of all specialized prefix unary constructs for the provided symbol.
[Pure]
IEnumerable<ParsedExpressionUnaryConstructInfo> GetSpecializedPrefixUnaryConstructs(StringSegment symbol)Parameters
- symbolStringSegment
- Construct symbol to check. 
Returns
- IEnumerable<ParsedExpressionUnaryConstructInfo>
- Collection of all specialized prefix unary constructs. 
GetTypeConverterTargetType(StringSegment)
Returns the type converter's target type associated with the provided symbol.
[Pure]
Type? GetTypeConverterTargetType(StringSegment symbol)Parameters
- symbolStringSegment
- Symbol to check. 
Returns
- Type
- Type converter's target type if it exists. 
GetTypeDeclarationType(StringSegment)
Returns the type declaration's type associated with the provided symbol.
[Pure]
Type? GetTypeDeclarationType(StringSegment symbol)Parameters
- symbolStringSegment
- Symbol to check. 
Returns
- Type
- Type declaration's type if it exists. 
GetVariadicFunctionType(StringSegment)
Returns the type of the variadic function's construct associated with the provided symbol.
[Pure]
Type? GetVariadicFunctionType(StringSegment symbol)Parameters
- symbolStringSegment
- Symbol to check. 
Returns
- Type
- Type od the variadic function's construct if it exists. 
TryCreate<TArg, TResult>(string, out IParsedExpression<TArg, TResult>, out Chain<ParsedExpressionBuilderError>)
Attempts to create a new IParsedExpression<TArg, TResult> instance.
bool TryCreate<TArg, TResult>(string input, out IParsedExpression<TArg, TResult> result, out Chain<ParsedExpressionBuilderError> errors)Parameters
- inputstring
- Input to parse. 
- resultIParsedExpression<TArg, TResult>
- out parameter that returns the created IParsedExpression<TArg, TResult> instance. 
- errorsChain<ParsedExpressionBuilderError>
- out parameter that returns parsing errors. 
Returns
- bool
- true when parsing was successful, otherwise false. 
Type Parameters
- TArg
- Argument type. 
- TResult
- Result type.