Class Modifier
Since AST Nodes are read-only, modifying an AST means copying (parts) the tree to a new tree with the nodes requiring modification being replaced. This visitor implementation aids building new AST trees by copying from exisiting and replacing modified nodes through delegation to another visitor.
Inherited Members
Namespace: TimeCockpit.Data.QueryLanguage.Syntax
Assembly: TimeCockpit.Data.dll
Syntax
public class Modifier : Visitor
Constructors
Modifier(Visitor)
Initializes a new instance of the Modifier class.
Declaration
public Modifier(Visitor replacementVisitor)
Parameters
Type | Name | Description |
---|---|---|
Visitor | replacementVisitor | The visitor producing replacements. |
Methods
VisitAggregationFunctionCall(AggregationFunctionCall)
Visits an AggregationFunctionCall AST node.
Declaration
public override Expression VisitAggregationFunctionCall(AggregationFunctionCall aggregateFunctionCall)
Parameters
Type | Name | Description |
---|---|---|
AggregationFunctionCall | aggregateFunctionCall | The AggregateFunction call to visit. |
Returns
Type | Description |
---|---|
Expression | Returns a new AST Node Expression if modified, or the existing aggregateFunctionCall if no modification occurred. |
Overrides
VisitBackReferenceSource(BackReferenceSource)
Visits a BackReferenceSource AST node.
Declaration
public override QuerySource VisitBackReferenceSource(BackReferenceSource backReferenceSource)
Parameters
Type | Name | Description |
---|---|---|
BackReferenceSource | backReferenceSource | The back reference source to visit. |
Returns
Type | Description |
---|---|
QuerySource | Returns the value returned by the replacement visitor. |
Overrides
VisitBinaryExpression(BinaryExpression)
Visits a BinaryExpression.
Declaration
public override Expression VisitBinaryExpression(BinaryExpression binaryExpression)
Parameters
Type | Name | Description |
---|---|---|
BinaryExpression | binaryExpression | The binary expression to visit / modify. |
Returns
Type | Description |
---|---|
Expression | Returns a new BinaryExpression or the existing binaryExpression parameter if no modification occurred. |
Overrides
VisitBooleanConstant(BooleanConstant)
Visits a BooleanConstant AST node.
Declaration
public override Expression VisitBooleanConstant(BooleanConstant booleanConstant)
Parameters
Type | Name | Description |
---|---|---|
BooleanConstant | booleanConstant | The null constant to visit. |
Returns
Type | Description |
---|---|
Expression | Returns the value returned by the replacement visitor. |
Overrides
VisitDateConstant(DateConstant)
Visits a DateConstant AST node.
Declaration
public override Expression VisitDateConstant(DateConstant dateConstant)
Parameters
Type | Name | Description |
---|---|---|
DateConstant | dateConstant | The date constant to visit. |
Returns
Type | Description |
---|---|
Expression | Returns the value returned by the replacement visitor. |
Overrides
VisitDateTimeConstant(DateTimeConstant)
Visits a DateTimeConstant AST node.
Declaration
public override Expression VisitDateTimeConstant(DateTimeConstant dateTimeConstant)
Parameters
Type | Name | Description |
---|---|---|
DateTimeConstant | dateTimeConstant | The DateTimeConstant to visit. |
Returns
Type | Description |
---|---|
Expression | Returns the value returned by the replacement visitor. |
Overrides
VisitDeadOfSource(DeadOfSource)
Calls the replacement visitor to determine if the dead of source should be replaced.
Declaration
public override QuerySource VisitDeadOfSource(DeadOfSource deadOfSource)
Parameters
Type | Name | Description |
---|---|---|
DeadOfSource | deadOfSource | The deadOfSource to check. |
Returns
Type | Description |
---|---|
QuerySource | Returns the (possibly modified) query source. |
Overrides
VisitDecimalConstant(DecimalConstant)
Visits a DecimalConstant AST node.
Declaration
public override Expression VisitDecimalConstant(DecimalConstant decimalConstant)
Parameters
Type | Name | Description |
---|---|---|
DecimalConstant | decimalConstant | The decimal constant to visit. |
Returns
Type | Description |
---|---|
Expression | Returns the value returned by the replacement visitor. |
Overrides
VisitEntitySource(EntitySource)
Visits a EntitySource AST Node.
Declaration
public override QuerySource VisitEntitySource(EntitySource queryTableSource)
Parameters
Type | Name | Description |
---|---|---|
EntitySource | queryTableSource | The query table source to visit. |
Returns
Type | Description |
---|---|
QuerySource | Returns a new instance of the queryTableSource or queryTableSource itself, if no modification occurred. |
Overrides
VisitEntitySourceIncludeConditional(EntitySourceIncludeConditional)
Visits a EntitySourceIncludeConditional AST node.
Declaration
public override EntitySourceInclude VisitEntitySourceIncludeConditional(EntitySourceIncludeConditional includeConditional)
Parameters
Type | Name | Description |
---|---|---|
EntitySourceIncludeConditional | includeConditional | The conditional include to visit. |
Returns
Type | Description |
---|---|
EntitySourceInclude | Returns a new instance of the includeConditional or includeCoditional itself, if no modification occurred. |
Overrides
VisitEntitySourceIncludeRelation(EntitySourceIncludeRelation)
Visits a EntitySourceIncludeRelation AST node.
Declaration
public override EntitySourceInclude VisitEntitySourceIncludeRelation(EntitySourceIncludeRelation includeRelation)
Parameters
Type | Name | Description |
---|---|---|
EntitySourceIncludeRelation | includeRelation | The AST node to visit. |
Returns
Type | Description |
---|---|
EntitySourceInclude | Returns the new / unmodified instance of the EntitySourceIncludeRelation AST node. |
Overrides
VisitExplicitSet(ExplicitSet)
Visits a ExplicitSet AST node.
Declaration
public override Set VisitExplicitSet(ExplicitSet explicitSet)
Parameters
Type | Name | Description |
---|---|---|
ExplicitSet | explicitSet | The null constant to visit. |
Returns
Type | Description |
---|---|
Set | Returns the value returned by the replacement visitor. |
Overrides
VisitFunctionCall(FunctionCall)
Visits a FunctionCall AST Node.
Declaration
public override Expression VisitFunctionCall(FunctionCall functionCall)
Parameters
Type | Name | Description |
---|---|---|
FunctionCall | functionCall | The functionCall AST node to visit / possibly modify.. |
Returns
Type | Description |
---|---|
Expression | Returns a new FunctionCall or the functionCall parameter itself, if no modification occurred. |
Overrides
VisitGuidConstant(GuidConstant)
Visits a GuidConstant AST node.
Declaration
public override Expression VisitGuidConstant(GuidConstant guidConstant)
Parameters
Type | Name | Description |
---|---|---|
GuidConstant | guidConstant | The guid constant to visit. |
Returns
Type | Description |
---|---|
Expression | Returns the value returned by the replacement visitor. |
Overrides
VisitHasChangedFunction(HasChangedFunction)
Visits a HasChangedFunction.
Declaration
public override Expression VisitHasChangedFunction(HasChangedFunction hasChangedFunction)
Parameters
Type | Name | Description |
---|---|---|
HasChangedFunction | hasChangedFunction | The HasChangedFunction to visit. |
Returns
Type | Description |
---|---|
Expression | Returns the possibly modified expression. |
Overrides
VisitMemberAccess(MemberAccess)
Visits a MemberAccess AST node.
Declaration
public override Expression VisitMemberAccess(MemberAccess memberAccess)
Parameters
Type | Name | Description |
---|---|---|
MemberAccess | memberAccess | The null constant to visit. |
Returns
Type | Description |
---|---|
Expression | Returns the value returned by the replacement visitor. |
Overrides
VisitMemberDeclarationForwarded(MemberDeclarationForwarded)
Visits the MemberDeclarationForwarded AST node.
Declaration
public override MemberDeclaration VisitMemberDeclarationForwarded(MemberDeclarationForwarded forwarded)
Parameters
Type | Name | Description |
---|---|---|
MemberDeclarationForwarded | forwarded | The forwarded member declaration to visit / modify. |
Returns
Type | Description |
---|---|
MemberDeclaration | Returns a new instance of the MemberDeclarationForwarded AST node or forwarded itself, if no modification occurred. |
Overrides
VisitMemberDeclarationNamedExpression(MemberDeclarationNamedExpression)
Visits a MemberDeclarationNamedExpression AST node.
Declaration
public override MemberDeclaration VisitMemberDeclarationNamedExpression(MemberDeclarationNamedExpression namedExpression)
Parameters
Type | Name | Description |
---|---|---|
MemberDeclarationNamedExpression | namedExpression | The named expression to visit / modify. |
Returns
Type | Description |
---|---|
MemberDeclaration | Returns a new MemberDeclarationNamedExpression or the namedExpression parameter if no modification occurred. |
Overrides
VisitMemberDeclaratorNamedIdentifier(MemberDeclarationNamedIdentifier)
Visits the MemberDeclarationNamedIdentifier AST node.
Declaration
public override MemberDeclaration VisitMemberDeclaratorNamedIdentifier(MemberDeclarationNamedIdentifier namedIdentifier)
Parameters
Type | Name | Description |
---|---|---|
MemberDeclarationNamedIdentifier | namedIdentifier | The named identifier to visit / modify. |
Returns
Type | Description |
---|---|
MemberDeclaration | Returns a the result of the replacementVisitor call to VisitAndConvert<T>(T). |
Overrides
VisitNamedSetReference(NamedSetReference)
Visits a NamedSetReference AST node.
Declaration
public override Set VisitNamedSetReference(NamedSetReference namedSetReference)
Parameters
Type | Name | Description |
---|---|---|
NamedSetReference | namedSetReference | The named set reference to visit. |
Returns
Type | Description |
---|---|
Set | Returns the value returned by the replacement visitor. |
Overrides
VisitNull(NullConstant)
Visits a NullConstant AST node.
Declaration
public override Expression VisitNull(NullConstant nullConstant)
Parameters
Type | Name | Description |
---|---|---|
NullConstant | nullConstant | The null constant to visit. |
Returns
Type | Description |
---|---|
Expression | Returns the value returned by the replacement visitor. |
Overrides
VisitOrderBy(OrderBy)
Visits an OrderBy.
Declaration
public override OrderBy VisitOrderBy(OrderBy orderBy)
Parameters
Type | Name | Description |
---|---|---|
OrderBy | orderBy | The orderBy to modify / visit. |
Returns
Type | Description |
---|---|
OrderBy | Returns a new OrderBy if modified, the existing modify otherwise. |
Overrides
VisitOrderByExpression(OrderByExpression)
Visits an orderby expression.
Declaration
public override OrderByExpression VisitOrderByExpression(OrderByExpression orderBy)
Parameters
Type | Name | Description |
---|---|---|
OrderByExpression | orderBy | The orderBy expression to visit / modify. |
Returns
Type | Description |
---|---|
OrderByExpression | Returns a new OrderByExpression if it was modified, the existing orderBy AST node is returned otherwise. |
Overrides
VisitParameter(Parameter)
Visits a Parameter AST node.
Declaration
public override Expression VisitParameter(Parameter parameter)
Parameters
Type | Name | Description |
---|---|---|
Parameter | parameter | The null constant to visit. |
Returns
Type | Description |
---|---|
Expression | Returns the value returned by the replacement visitor. |
Overrides
VisitQuery(Query)
Visits a query. Calls the replacementVisitor and a modified instance of query if necessary.
Declaration
public override Query VisitQuery(Query query)
Parameters
Type | Name | Description |
---|---|---|
Query | query | The query to modify. |
Returns
Type | Description |
---|---|
Query | Returns a new Query if it has been modified, the existing query otherwise. |
Overrides
VisitQueryOptions(QueryOptions)
visits a QueryOptions AST node.
Declaration
public override QueryOptions VisitQueryOptions(QueryOptions queryOptions)
Parameters
Type | Name | Description |
---|---|---|
QueryOptions | queryOptions | The QueryOptions object to visit / modify. |
Returns
Type | Description |
---|---|
QueryOptions | Returns the value returned by the call to VisitAndConvert<T>(T) on TimeCockpit.Data.QueryLanguage.Syntax.Modifier.replacementVisitor. |
Overrides
VisitSelectAlias(SelectAlias)
Calls the replacement visitor for the select alias.
Declaration
public override Select VisitSelectAlias(SelectAlias selectAlias)
Parameters
Type | Name | Description |
---|---|---|
SelectAlias | selectAlias | The select alias to modify. |
Returns
Type | Description |
---|---|
Select | Returns a new SelectAlias, if it has been modified, or the passed selectAlias if no modification was performed. |
Overrides
VisitSelectNewWith(SelectNewWith)
Visits a select New With.
Declaration
public override Select VisitSelectNewWith(SelectNewWith selectNewWith)
Parameters
Type | Name | Description |
---|---|---|
SelectNewWith | selectNewWith | The select New With to visit. |
Returns
Type | Description |
---|---|
Select | Returns a new SelectNewWith or the existing one if it has not been modified. |
Overrides
VisitSkipAndTake(SkipAndTake)
visits a SkipAndTake AST node.
Declaration
public override SkipAndTake VisitSkipAndTake(SkipAndTake skipAndTake)
Parameters
Type | Name | Description |
---|---|---|
SkipAndTake | skipAndTake | The SkipAndTake node to visit / modify. |
Returns
Type | Description |
---|---|
SkipAndTake | Returns the value returned by VisitAndConvert<T>(T) on TimeCockpit.Data.QueryLanguage.Syntax.Modifier.replacementVisitor. |
Overrides
VisitStringConstant(StringConstant)
Visits a StringConstant AST node.
Declaration
public override Expression VisitStringConstant(StringConstant stringConstant)
Parameters
Type | Name | Description |
---|---|---|
StringConstant | stringConstant | The string constant to visit. |
Returns
Type | Description |
---|---|
Expression | Returns the value returned by the replacement visitor. |