C# Class Veil.Parser.SyntaxTreeExpression

Factory methods for create expression nodes
Show file Open project: namics/TerrificNet

Public Methods

Method Description
Field ( Type modelType, string fieldName, SourceLocation location, ExpressionScope scope = ExpressionScope.CurrentModelOnStack, int recursionLevel ) : FieldExpressionNode

Evaluate a field on the model object

Function ( Type modelType, string functionName, SourceLocation location, ExpressionScope scope = ExpressionScope.CurrentModelOnStack ) : FunctionCallExpressionNode

Evaluate a function call on the model

HasItems ( ExpressionNode collectionExpression, SourceLocation location, int recursionLevel ) : CollectionHasItemsExpressionNode

Evaluate whether the collectionExpression has Count > 0 Can only be used on types that implement System.Collections.ICollection

Helper ( string expression, IHelperHandler helperHandler, SourceLocation location ) : HelperExpressionNode
LateBound ( string itemName, SourceLocation location, IMemberLocator memberLocator = null, bool isCaseSensitive = true, ExpressionScope scope = ExpressionScope.CurrentModelOnStack, int recursionLevel ) : LateBoundExpressionNode

Evaluate a property at runtime against an unknown model type

Property ( Type modelType, string propertyName, SourceLocation location, ExpressionScope scope = ExpressionScope.CurrentModelOnStack, int recursionLevel ) : PropertyExpressionNode

Evaluate a property on the model object

Self ( Type modelType, SourceLocation location, ExpressionScope scope = ExpressionScope.CurrentModelOnStack ) : SelfExpressionNode

Evaluate the model itself e.g. Value types

SubModel ( ExpressionNode modelExpression, ExpressionNode subModelExpression, SourceLocation location, ExpressionScope scope = ExpressionScope.CurrentModelOnStack ) : SubModelExpressionNode

Evaluate an expression on a sub model, can be nested to traverse any depth of sub models

Method Details

Field() public static method

Evaluate a field on the model object
public static Field ( Type modelType, string fieldName, SourceLocation location, ExpressionScope scope = ExpressionScope.CurrentModelOnStack, int recursionLevel ) : FieldExpressionNode
modelType System.Type The type of the scoped model
fieldName string The name of the field
location SourceLocation
scope ExpressionScope The scope this expression evaluated in
recursionLevel int
return Veil.Parser.Nodes.FieldExpressionNode

Function() public static method

Evaluate a function call on the model
public static Function ( Type modelType, string functionName, SourceLocation location, ExpressionScope scope = ExpressionScope.CurrentModelOnStack ) : FunctionCallExpressionNode
modelType System.Type The type of the scoped model
functionName string The name of the function
location SourceLocation
scope ExpressionScope The scope this expression evaluated in
return Veil.Parser.Nodes.FunctionCallExpressionNode

HasItems() public static method

Evaluate whether the collectionExpression has Count > 0 Can only be used on types that implement System.Collections.ICollection
public static HasItems ( ExpressionNode collectionExpression, SourceLocation location, int recursionLevel ) : CollectionHasItemsExpressionNode
collectionExpression ExpressionNode An expression referencing a Collection
location SourceLocation
recursionLevel int
return Veil.Parser.Nodes.CollectionHasItemsExpressionNode

Helper() public static method

public static Helper ( string expression, IHelperHandler helperHandler, SourceLocation location ) : HelperExpressionNode
expression string
helperHandler IHelperHandler
location SourceLocation
return HelperExpressionNode

LateBound() public static method

Evaluate a property at runtime against an unknown model type
public static LateBound ( string itemName, SourceLocation location, IMemberLocator memberLocator = null, bool isCaseSensitive = true, ExpressionScope scope = ExpressionScope.CurrentModelOnStack, int recursionLevel ) : LateBoundExpressionNode
itemName string The name of the proeprty that will be searched for
location SourceLocation
memberLocator IMemberLocator
isCaseSensitive bool Indcates whether the expression should be evaluated with case sensitivity
scope ExpressionScope The scope this expression evaluated in
recursionLevel int
return Veil.Parser.Nodes.LateBoundExpressionNode

Property() public static method

Evaluate a property on the model object
public static Property ( Type modelType, string propertyName, SourceLocation location, ExpressionScope scope = ExpressionScope.CurrentModelOnStack, int recursionLevel ) : PropertyExpressionNode
modelType System.Type The type of the scoped model
propertyName string The name of the property
location SourceLocation
scope ExpressionScope The scope this expression evaluated in
recursionLevel int
return Veil.Parser.Nodes.PropertyExpressionNode

Self() public static method

Evaluate the model itself e.g. Value types
public static Self ( Type modelType, SourceLocation location, ExpressionScope scope = ExpressionScope.CurrentModelOnStack ) : SelfExpressionNode
modelType System.Type The type of the scoped model
location SourceLocation
scope ExpressionScope The scope this expression evaluated in
return Veil.Parser.Nodes.SelfExpressionNode

SubModel() public static method

Evaluate an expression on a sub model, can be nested to traverse any depth of sub models
public static SubModel ( ExpressionNode modelExpression, ExpressionNode subModelExpression, SourceLocation location, ExpressionScope scope = ExpressionScope.CurrentModelOnStack ) : SubModelExpressionNode
modelExpression ExpressionNode An expression referencing the model to traverse to
subModelExpression ExpressionNode An expression to evaluate in the scope of the model that has been traversed to
location SourceLocation
scope ExpressionScope The scope this expression evaluated in
return SubModelExpressionNode