C# Class Microsoft.Scripting.Ast.Utils

Mostrar archivo Open project: jschementi/iron Class Usage Examples

Public Methods

Method Description
AddDebugInfo ( Expression expression, SymbolDocumentInfo document, SourceLocation start, SourceLocation end ) : Expression
AddDebugInfo ( Expression expression, SymbolDocumentInfo document, int startLine, int startColumn, int endLine, int endColumn ) : Expression
Box ( Expression expression ) : Expression

Returns an expression that boxes a given value. Uses boxed objects cache for Int32 and Boolean types.

Coalesce ( Expression left, Expression right, ParameterExpression &temp ) : Expression

Null coalescing expression {result} ::= ((tmp = {_left}) == null) ? {right} : tmp '??' operator in C#.

Coalesce ( LambdaBuilder builder, Expression left, Expression right ) : Expression
CoalesceFalse ( Expression left, Expression right, MethodInfo isTrue, ParameterExpression &temp ) : Expression

False coalescing expression. {result} ::= IsTrue(tmp = {left}) ? tmp : {right} Generalized OR semantics.

CoalesceFalse ( LambdaBuilder builder, Expression left, Expression right, MethodInfo isTrue ) : Expression

False coalescing expression. {result} ::= IsTrue(tmp = {left}) ? tmp : {right} Generalized OR semantics.

CoalesceTrue ( Expression left, Expression right, MethodInfo isTrue, ParameterExpression &temp ) : Expression

True coalescing expression. {result} ::= IsTrue(tmp = {left}) ? {right} : tmp Generalized AND semantics.

CoalesceTrue ( LambdaBuilder builder, Expression left, Expression right, MethodInfo isTrue ) : Expression

True coalescing expression. {result} ::= IsTrue(tmp = {left}) ? {right} : tmp Generalized AND semantics.

ComplexCallHelper ( MethodInfo method ) : Expression

The complex call helper to create the AST method call node. Will add conversions (Expression.Convert()), deals with default parameter values and params arrays.

Convert ( Expression expression, Type type ) : Expression
DebugMarker ( string marker ) : Expression
FinallyFlowControl ( Expression body ) : Expression
GetLValueAccess ( this type ) : ExpressionAccess

Determines if the left child of the given expression is read or written to or both.

If ( IfStatementTest tests, Expression @else ) : Expression
If ( ) : IfStatementBuilder
If ( Expression test ) : IfStatementBuilder
If ( Expression test, Expression body ) : IfStatementBuilder
IfThen ( Expression test ) : Expression
IfThen ( Expression test, Expression body ) : Expression
IfThenElse ( Expression test, Expression body, Expression @else ) : Expression
Infinite ( Expression body ) : LoopExpression
Infinite ( Expression body, LabelTarget @break, LabelTarget @continue ) : LoopExpression
IsAssignment ( this type ) : bool

Determines whether specified expression type represents an assignment.

Note that some other nodes can also assign to variables, members or array items: MemberInit, NewArrayInit, Call with ref params, New with ref params, Dynamic with ref params.

IsLValue ( this type ) : bool
IsReadWriteAssignment ( this type ) : bool
IsWriteOnlyAssignment ( this type ) : bool
Loop ( Expression test, Expression increment, Expression body, Expression @else ) : LoopExpression
Loop ( Expression test, Expression increment, Expression body, Expression @else, LabelTarget @break, LabelTarget @continue ) : LoopExpression
NewArrayHelper ( Type type, IEnumerable initializers ) : NewArrayExpression
SimpleCallHelper ( Expression instance, MethodInfo method ) : MethodCallExpression

The helper to create the AST method call node. Will add conversions (Utils.Convert) to parameters and instance if necessary.

SimpleCallHelper ( MethodInfo method ) : MethodCallExpression

The helper to create the AST method call node. Will add conversions (Utils.Convert) to parameters and instance if necessary.

Try ( ) : TryStatementBuilder
Try ( Expression body ) : TryStatementBuilder
Try ( Expression expr0, Expression expr1 ) : TryStatementBuilder
Try ( Expression expr0, Expression expr1, Expression expr2 ) : TryStatementBuilder
Try ( Expression expr0, Expression expr1, Expression expr2, Expression expr3 ) : TryStatementBuilder
Unless ( Expression test, Expression body ) : Expression
Update ( this expression, Expression left, Expression right ) : BinaryExpression
Void ( Expression expression ) : Expression

Converts an expression to a void type.

While ( Expression test, Expression body, Expression @else ) : LoopExpression
While ( Expression test, Expression body, Expression @else, LabelTarget @break, LabelTarget @continue ) : LoopExpression

Private Methods

Method Description
AddScopedVariable ( Expression body, System.Linq.Expressions.ParameterExpression variable, Expression variableInit ) : Expression
ArgumentConvertHelper ( Expression argument, Type type ) : Expression
ArgumentConvertHelper ( Expression arguments, ParameterInfo parameters ) : Expression[]
Block ( Expression expressions ) : System.Linq.Expressions.BlockExpression
BlockVoid ( Expression expressions ) : BlockExpression
CallDebugWriteLine ( string marker ) : MethodCallExpression
CoalesceInternal ( Expression left, Expression right, MethodInfo isTrue, bool isReverse, ParameterExpression &temp ) : Expression
CompatibleParameterTypes ( Type parameter, Type argument ) : bool
ComplexCallHelper ( Expression instance, MethodInfo method ) : Expression
CreateDefaultValueExpression ( ParameterInfo parameter ) : Expression
DebugMark ( Expression expression, string marker ) : Expression

Method Details

AddDebugInfo() public static method

public static AddDebugInfo ( Expression expression, SymbolDocumentInfo document, SourceLocation start, SourceLocation end ) : Expression
expression Expression
document System.Linq.Expressions.SymbolDocumentInfo
start SourceLocation
end SourceLocation
return Expression

AddDebugInfo() public static method

public static AddDebugInfo ( Expression expression, SymbolDocumentInfo document, int startLine, int startColumn, int endLine, int endColumn ) : Expression
expression Expression
document System.Linq.Expressions.SymbolDocumentInfo
startLine int
startColumn int
endLine int
endColumn int
return Expression

Box() public static method

Returns an expression that boxes a given value. Uses boxed objects cache for Int32 and Boolean types.
public static Box ( Expression expression ) : Expression
expression Expression
return Expression

Coalesce() public static method

Null coalescing expression {result} ::= ((tmp = {_left}) == null) ? {right} : tmp '??' operator in C#.
public static Coalesce ( Expression left, Expression right, ParameterExpression &temp ) : Expression
left Expression
right Expression
temp ParameterExpression
return Expression

Coalesce() public static method

public static Coalesce ( LambdaBuilder builder, Expression left, Expression right ) : Expression
builder LambdaBuilder
left Expression
right Expression
return Expression

CoalesceFalse() public static method

False coalescing expression. {result} ::= IsTrue(tmp = {left}) ? tmp : {right} Generalized OR semantics.
public static CoalesceFalse ( Expression left, Expression right, MethodInfo isTrue, ParameterExpression &temp ) : Expression
left Expression
right Expression
isTrue MethodInfo
temp ParameterExpression
return Expression

CoalesceFalse() public static method

False coalescing expression. {result} ::= IsTrue(tmp = {left}) ? tmp : {right} Generalized OR semantics.
public static CoalesceFalse ( LambdaBuilder builder, Expression left, Expression right, MethodInfo isTrue ) : Expression
builder LambdaBuilder
left Expression
right Expression
isTrue MethodInfo
return Expression

CoalesceTrue() public static method

True coalescing expression. {result} ::= IsTrue(tmp = {left}) ? {right} : tmp Generalized AND semantics.
public static CoalesceTrue ( Expression left, Expression right, MethodInfo isTrue, ParameterExpression &temp ) : Expression
left Expression
right Expression
isTrue MethodInfo
temp ParameterExpression
return Expression

CoalesceTrue() public static method

True coalescing expression. {result} ::= IsTrue(tmp = {left}) ? {right} : tmp Generalized AND semantics.
public static CoalesceTrue ( LambdaBuilder builder, Expression left, Expression right, MethodInfo isTrue ) : Expression
builder LambdaBuilder
left Expression
right Expression
isTrue MethodInfo
return Expression

ComplexCallHelper() public static method

The complex call helper to create the AST method call node. Will add conversions (Expression.Convert()), deals with default parameter values and params arrays.
public static ComplexCallHelper ( MethodInfo method ) : Expression
method MethodInfo
return Expression

Convert() public static method

public static Convert ( Expression expression, Type type ) : Expression
expression Expression
type Type
return Expression

DebugMarker() public static method

public static DebugMarker ( string marker ) : Expression
marker string
return Expression

FinallyFlowControl() public static method

public static FinallyFlowControl ( Expression body ) : Expression
body Expression
return Expression

GetLValueAccess() public static method

Determines if the left child of the given expression is read or written to or both.
public static GetLValueAccess ( this type ) : ExpressionAccess
type this
return ExpressionAccess

If() public static method

public static If ( IfStatementTest tests, Expression @else ) : Expression
tests IfStatementTest
@else Expression
return Expression

If() public static method

public static If ( ) : IfStatementBuilder
return IfStatementBuilder

If() public static method

public static If ( Expression test ) : IfStatementBuilder
test Expression
return IfStatementBuilder

If() public static method

public static If ( Expression test, Expression body ) : IfStatementBuilder
test Expression
body Expression
return IfStatementBuilder

IfThen() public static method

public static IfThen ( Expression test ) : Expression
test Expression
return Expression

IfThen() public static method

public static IfThen ( Expression test, Expression body ) : Expression
test Expression
body Expression
return Expression

IfThenElse() public static method

public static IfThenElse ( Expression test, Expression body, Expression @else ) : Expression
test Expression
body Expression
@else Expression
return Expression

Infinite() public static method

public static Infinite ( Expression body ) : LoopExpression
body Expression
return LoopExpression

Infinite() public static method

public static Infinite ( Expression body, LabelTarget @break, LabelTarget @continue ) : LoopExpression
body Expression
@break LabelTarget
@continue LabelTarget
return LoopExpression

IsAssignment() public static method

Determines whether specified expression type represents an assignment.
Note that some other nodes can also assign to variables, members or array items: MemberInit, NewArrayInit, Call with ref params, New with ref params, Dynamic with ref params.
public static IsAssignment ( this type ) : bool
type this
return bool

IsLValue() public static method

public static IsLValue ( this type ) : bool
type this
return bool

IsReadWriteAssignment() public static method

public static IsReadWriteAssignment ( this type ) : bool
type this
return bool

IsWriteOnlyAssignment() public static method

public static IsWriteOnlyAssignment ( this type ) : bool
type this
return bool

Loop() public static method

public static Loop ( Expression test, Expression increment, Expression body, Expression @else ) : LoopExpression
test Expression
increment Expression
body Expression
@else Expression
return LoopExpression

Loop() public static method

public static Loop ( Expression test, Expression increment, Expression body, Expression @else, LabelTarget @break, LabelTarget @continue ) : LoopExpression
test Expression
increment Expression
body Expression
@else Expression
@break LabelTarget
@continue LabelTarget
return LoopExpression

NewArrayHelper() public static method

public static NewArrayHelper ( Type type, IEnumerable initializers ) : NewArrayExpression
type Type
initializers IEnumerable
return NewArrayExpression

SimpleCallHelper() public static method

The helper to create the AST method call node. Will add conversions (Utils.Convert) to parameters and instance if necessary.
public static SimpleCallHelper ( Expression instance, MethodInfo method ) : MethodCallExpression
instance Expression
method MethodInfo
return MethodCallExpression

SimpleCallHelper() public static method

The helper to create the AST method call node. Will add conversions (Utils.Convert) to parameters and instance if necessary.
public static SimpleCallHelper ( MethodInfo method ) : MethodCallExpression
method MethodInfo
return MethodCallExpression

Try() public static method

public static Try ( ) : TryStatementBuilder
return TryStatementBuilder

Try() public static method

public static Try ( Expression body ) : TryStatementBuilder
body Expression
return TryStatementBuilder

Try() public static method

public static Try ( Expression expr0, Expression expr1 ) : TryStatementBuilder
expr0 Expression
expr1 Expression
return TryStatementBuilder

Try() public static method

public static Try ( Expression expr0, Expression expr1, Expression expr2 ) : TryStatementBuilder
expr0 Expression
expr1 Expression
expr2 Expression
return TryStatementBuilder

Try() public static method

public static Try ( Expression expr0, Expression expr1, Expression expr2, Expression expr3 ) : TryStatementBuilder
expr0 Expression
expr1 Expression
expr2 Expression
expr3 Expression
return TryStatementBuilder

Unless() public static method

public static Unless ( Expression test, Expression body ) : Expression
test Expression
body Expression
return Expression

Update() public static method

public static Update ( this expression, Expression left, Expression right ) : BinaryExpression
expression this
left Expression
right Expression
return BinaryExpression

Void() public static method

Converts an expression to a void type.
public static Void ( Expression expression ) : Expression
expression Expression An to convert to void.
return Expression

While() public static method

public static While ( Expression test, Expression body, Expression @else ) : LoopExpression
test Expression
body Expression
@else Expression
return LoopExpression

While() public static method

public static While ( Expression test, Expression body, Expression @else, LabelTarget @break, LabelTarget @continue ) : LoopExpression
test Expression
body Expression
@else Expression
@break LabelTarget
@continue LabelTarget
return LoopExpression