C# Class System.Linq.Dynamic.ExpressionParser

显示文件 Open project: TargetProcess/Target-Process-Plugins Class Usage Examples

Public Methods

Method Description
ExpressionParser ( IReadOnlyList parameters, string expression, object values ) : System.Collections
Parse ( Type resultType ) : Expression
ParseOrdering ( ) : IEnumerable

Protected Methods

Method Description
FindBestMethod ( IEnumerable candidates, Maybe methodName, Expression methodArgs, MethodBase &method ) : int
GenerateDynamicClassType ( IReadOnlyList properties ) : Type
GenerateMethodCall ( Type type, Expression instance, int errorPos, string id, Lazy argumentList ) : Maybe
GetIdentifier ( ) : string
NextToken ( ) : void
ParseError ( Exception innerException ) : Exception
ParseError ( IFormattedMessage message ) : Exception
ParseError ( int pos, Exception innerException ) : Exception
ParseError ( int pos, IFormattedMessage message ) : Exception
TryParseMemberAccess ( Type type, Expression instance, TokenId nextToken, int errorPos, string name ) : Try

Private Methods

Method Description
AddInterface ( ICollection types, Type type ) : void
AddSymbol ( string name, object value ) : void
CheckAndPromoteOperand ( Type signatures, string opName, Expression &expr, int errorPos ) : void
CheckAndPromoteOperands ( Type signatures, string opName, Expression &left, Expression &right, int errorPos ) : void
CompareConversions ( Type s, Type t1, Type t2 ) : int
CreateKeywords ( ) : object>.Dictionary
CreateLiteral ( object value, string text ) : Expression
CreateMemberInit ( IReadOnlyList properties, IReadOnlyList expressions ) : Expression
EnumerableMethod ( Type type, Expression instance, string id, Lazy argumentList ) : Maybe
EqualizeTypesAndCombine ( Expression expr1, Expression expr2, int errorPos, Func combineResults ) : Expression
ExpressionParser ( ) : System.Linq.Expressions
FindGenericType ( Type generic, Type type ) : Type
FindIndexer ( Type type, Expression args, MethodBase &method ) : int
FindPropertyOrField ( Type type, string memberName, bool staticAccess ) : MemberInfo
GenerateAdd ( Expression left, Expression right ) : Expression
GenerateCoalesce ( Expression valueExpr, Expression ifNoneExpr, int errorPos ) : Expression
GenerateConditional ( Expression test, Expression expr1, Expression expr2, int errorPos ) : Expression
GenerateConversion ( Expression expr, Type type, int errorPos ) : Expression
GenerateDivide ( Expression left, Expression right ) : Expression
GenerateEqual ( Expression left, Expression right ) : Expression
GenerateGreaterThan ( Expression left, Expression right ) : Expression
GenerateGreaterThanEqual ( Expression left, Expression right ) : Expression
GenerateIn ( Expression operand, IEnumerable args ) : Expression
GenerateLessThan ( Expression left, Expression right ) : Expression
GenerateLessThanEqual ( Expression left, Expression right ) : Expression
GenerateMemberAccess ( Type type, Expression instance, int errorPos, string name ) : Maybe
GenerateNotEqual ( Expression left, Expression right ) : Expression
GenerateNullableMethodCall ( Type type, Expression instance, int errorPos, string id, TokenId nextToken ) : Maybe
GenerateStaticMethodCall ( string methodName, Expression left, Expression right ) : Expression
GenerateStringConcat ( Expression left, Expression right ) : Expression
GenerateSubtract ( Expression left, Expression right ) : Expression
GetAppropriateMethodCount ( Type type, string methodName, bool staticAccess, Expression args, MethodBase &method ) : int
GetConditionName ( Expression expr, int exprPos ) : Maybe
GetEnumerableMethod ( string methodName, Type types ) : MethodInfo
GetEnumerableRootName ( Expression expr, int exprPos ) : Maybe
GetLiteralToken ( Action first, Action second ) : TokenId
GetMethodName ( Expression expr ) : Maybe
GetNonNullableType ( Type type ) : Type
GetNumericTypeKind ( Type type ) : int
GetPropertyName ( Expression expr, int exprPos ) : Maybe
GetStaticMethod ( string methodName, Expression left, Expression right ) : MethodInfo
GetTypeName ( Type type ) : string
IncompatibleOperandsError ( string opName, Expression left, Expression right, int pos ) : Exception
IsApplicable ( MethodData method, Expression args ) : bool
IsBetterThan ( Expression args, MethodData m1, MethodData m2 ) : bool
IsCompatibleWith ( Type source, Type target ) : bool
IsEnumType ( Type type ) : bool
IsMethodSuitByName ( string methodName, MemberInfo m ) : bool
IsNullableType ( Type type ) : bool
IsNumericType ( Type type ) : bool
IsPredefinedType ( Type type ) : bool
IsSignedIntegralType ( Type type ) : bool
IsUnsignedIntegralType ( Type type ) : bool
NextChar ( ) : void
ParseAdditive ( ) : Expression
ParseArgumentList ( ) : Expression[]
ParseArguments ( ) : Expression[]
ParseBracketExpression ( bool throwOnEmptyArgs ) : Expression[]
ParseComparison ( ) : Expression
ParseElementAccess ( Expression expr ) : Expression
ParseEnum ( string name, Type type ) : object
ParseEnumerableMethods ( Expression instance, Type elementType, string methodName, Lazy parseArgumentList ) : Maybe
ParseExpression ( ) : Expression
ParseIdentifier ( ) : Expression
ParseIfNone ( ) : Expression
ParseIif ( ) : Expression
ParseIntegerLiteral ( ) : Expression
ParseIt ( ) : Expression
ParseLambdaInvocation ( LambdaExpression lambda ) : Expression
ParseLogicalAnd ( ) : Expression
ParseLogicalOr ( ) : Expression
ParseMemberAccess ( Type type, Expression instance ) : Expression
ParseMultiplicative ( ) : Expression
ParseNewJson ( ) : Expression
ParseNewObject ( ) : Expression
ParseNumber ( string text, Type type ) : object
ParseObjectPropertyDefinition ( Expression &expr, string &propName ) : void
ParseParenExpression ( ) : Expression
ParsePrimary ( ) : Expression
ParsePrimaryStart ( ) : Expression
ParseRealLiteral ( ) : Expression
ParseStringLiteral ( ) : Expression
ParseTypeAccess ( Type type ) : Expression
ParseUnary ( ) : Expression
ProcessParameters ( IReadOnlyList parameters ) : void
ProcessValues ( IReadOnlyList values ) : void
PromoteExpression ( Expression expr, Type type, bool exact ) : Expression
PromoteLeftOrRight ( Expression &left, Expression &right, Token op ) : void
SelfAndBaseClasses ( Type type ) : IEnumerable
SelfAndBaseTypes ( Type type ) : IEnumerable
SelfMethod ( Type type, Expression instance, int errorPos, string id, Lazy args ) : Maybe
SetTextPos ( int pos ) : void
TokenIdentifierIs ( string id ) : bool
ValidateDigit ( ) : void
ValidateToken ( TokenId t ) : void
ValidateToken ( TokenId t, IFormattedMessage errorMessage ) : void

Method Details

ExpressionParser() public method

public ExpressionParser ( IReadOnlyList parameters, string expression, object values ) : System.Collections
parameters IReadOnlyList
expression string
values object
return System.Collections

FindBestMethod() protected method

protected FindBestMethod ( IEnumerable candidates, Maybe methodName, Expression methodArgs, MethodBase &method ) : int
candidates IEnumerable
methodName Maybe
methodArgs System.Linq.Expressions.Expression
method System.Reflection.MethodBase
return int

GenerateDynamicClassType() protected method

protected GenerateDynamicClassType ( IReadOnlyList properties ) : Type
properties IReadOnlyList
return System.Type

GenerateMethodCall() protected method

protected GenerateMethodCall ( Type type, Expression instance, int errorPos, string id, Lazy argumentList ) : Maybe
type Type
instance Expression
errorPos int
id string
argumentList Lazy
return Maybe

GetIdentifier() protected method

protected GetIdentifier ( ) : string
return string

NextToken() protected method

protected NextToken ( ) : void
return void

Parse() public method

public Parse ( Type resultType ) : Expression
resultType Type
return Expression

ParseError() protected method

protected ParseError ( Exception innerException ) : Exception
innerException Exception
return Exception

ParseError() protected method

protected ParseError ( IFormattedMessage message ) : Exception
message IFormattedMessage
return Exception

ParseError() protected method

protected ParseError ( int pos, Exception innerException ) : Exception
pos int
innerException Exception
return Exception

ParseError() protected method

protected ParseError ( int pos, IFormattedMessage message ) : Exception
pos int
message IFormattedMessage
return Exception

ParseOrdering() public method

public ParseOrdering ( ) : IEnumerable
return IEnumerable

TryParseMemberAccess() protected method

protected TryParseMemberAccess ( Type type, Expression instance, TokenId nextToken, int errorPos, string name ) : Try
type Type
instance Expression
nextToken TokenId
errorPos int
name string
return Try