Show / Hide Table of Contents

Class ChangeExpressions

General purpose "base visitor" for operations which potentially replace one expression by another.

Inheritance
Object
ChangeDag<Expression, Table, IExpressionVisitor>
ChangeExpressions
InjectLiteralType
AdjustConstantDependencies
EnsureDenominatorIsTypeDouble
InsertColumnReferences
InsertIntermediateComputations
NullSafeStringMatch
ReplaceNonRecursiveAggregations
ShortcircuitExpressions
FluentChangeExpressions
ReplaceExpressionParentsViaMapping
Implements
IGenericExpressionVisitor<IEnumerable<Expression>>
IExpressionVisitor
IGenericVisitor<IEnumerable<Expression>>
Inherited Members
ChangeDag<Expression, Table, IExpressionVisitor>.Mapping
ChangeDag<Expression, Table, IExpressionVisitor>.Reset()
ChangeDag<Expression, Table, IExpressionVisitor>.Identifier(Expression)
ChangeDag<Expression, Table, IExpressionVisitor>.ChangeIdentifier(Expression)
ChangeDag<Expression, Table, IExpressionVisitor>.ReplaceParent(Expression, Expression, Expression)
ChangeDag<Expression, Table, IExpressionVisitor>.UberVisit<TSubnode>(TSubnode, Func<TSubnode, Expression>)
ChangeDag<Expression, Table, IExpressionVisitor>.UberVisit<TSubnode, TSubidentifier>(TSubnode, Func<TSubnode, Expression>)
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Mangrove.MetricSetTransformers.Utilities
Assembly: MetricSetTransformers.dll
Syntax
public class ChangeExpressions : ChangeDag<Expression, Table, IExpressionVisitor>, IGenericExpressionVisitor<IEnumerable<Expression>>, IExpressionVisitor, IGenericVisitor<IEnumerable<Expression>>
Remarks

There are two ways of using this visitor, which may be combined.

1. Replacing Expression nodes

This visitor with no overriding is a no-op. Inheritors should override at least one of the "Change" methods to return a new expression different than the input. That expression will be referenced automatically by all descendents.

The "change" methods may assume that their input has already been updated to reflect any "uparentstream" changes. For example, if e1 depends on e2, and e2 is changed, then the "change" method called for e1 is actually called on the replacement of e1 with e2 as a parent.

2. Replacing the tables that expressions live in

You can give this class a function for replacing the table nodes that expressions live in. That function can assume its being called on the original expression, before any dependency-related parent swapping happens.

Constructors

View Source

ChangeExpressions()

Declaration
public ChangeExpressions()
View Source

ChangeExpressions(IDictionary<Table, Table>)

Change expressions by attempting to swap out their tables using newTables. If an expressions table does not live in newTables, its table is left unchanged.

Declaration
public ChangeExpressions(IDictionary<Table, Table> newTables)
Parameters
Type Name Description
IDictionary<Table, Table> newTables
View Source

ChangeExpressions(Func<Expression, Table>)

Change expressions by swapping out their tables using newTable.

Declaration
public ChangeExpressions(Func<Expression, Table> newTable)
Parameters
Type Name Description
Func<Expression, Table> newTable

Properties

View Source

CreatedExpressions

New expressions created by calling this visitor (i.e. not replacements of any existing expressions).

Declaration
protected ISet<Expression> CreatedExpressions { get; }
Property Value
Type Description
ISet<Expression>
Remarks

NOTE: the collection does not have to include all the parents. The necessary parents would be added by taking expression closure when returning the result.

This is used when Change methods have "side-effects", i.e. when you need not just replace expressions but create completely new ones that did not exist before.

View Source

Result

Declaration
public IEnumerable<Expression> Result { get; }
Property Value
Type Description
IEnumerable<Expression>

Methods

View Source

Change(Aggregand)

Declaration
protected virtual Expression Change(Aggregand expr)
Parameters
Type Name Description
Aggregand expr
Returns
Type Description
Expression
View Source

Change(BinaryAggregation)

Declaration
protected virtual Expression Change(BinaryAggregation expr)
Parameters
Type Name Description
BinaryAggregation expr
Returns
Type Description
Expression
View Source

Change(BinaryOperation)

Declaration
protected virtual Expression Change(BinaryOperation expr)
Parameters
Type Name Description
BinaryOperation expr
Returns
Type Description
Expression
View Source

Change(ColumnReference)

Declaration
protected virtual Expression Change(ColumnReference expr)
Parameters
Type Name Description
ColumnReference expr
Returns
Type Description
Expression
View Source

Change(DataSourceColumn)

Declaration
protected virtual Expression Change(DataSourceColumn expr)
Parameters
Type Name Description
DataSourceColumn expr
Returns
Type Description
Expression
View Source

Change(Extern)

Declaration
protected virtual Expression Change(Extern expr)
Parameters
Type Name Description
Extern expr
Returns
Type Description
Expression
View Source

Change(Filter)

Declaration
protected virtual Expression Change(Filter expr)
Parameters
Type Name Description
Filter expr
Returns
Type Description
Expression
View Source

Change(JoinKey)

Declaration
protected virtual Expression Change(JoinKey expr)
Parameters
Type Name Description
JoinKey expr
Returns
Type Description
Expression
View Source

Change(Literal)

Declaration
protected virtual Expression Change(Literal expr)
Parameters
Type Name Description
Literal expr
Returns
Type Description
Expression
View Source

Change(RuntimeVariable)

Declaration
protected virtual Expression Change(RuntimeVariable expr)
Parameters
Type Name Description
RuntimeVariable expr
Returns
Type Description
Expression
View Source

Change(TernaryOperation)

Declaration
protected virtual Expression Change(TernaryOperation expr)
Parameters
Type Name Description
TernaryOperation expr
Returns
Type Description
Expression
View Source

Change(UnaryAggregation)

Declaration
protected virtual Expression Change(UnaryAggregation expr)
Parameters
Type Name Description
UnaryAggregation expr
Returns
Type Description
Expression
View Source

Change(UnaryOperation)

Declaration
protected virtual Expression Change(UnaryOperation expr)
Parameters
Type Name Description
UnaryOperation expr
Returns
Type Description
Expression
View Source

Change(UnaryWindowFunction)

Declaration
protected virtual Expression Change(UnaryWindowFunction expr)
Parameters
Type Name Description
UnaryWindowFunction expr
Returns
Type Description
Expression
View Source

Change(UnionExpression)

Declaration
protected virtual Expression Change(UnionExpression expr)
Parameters
Type Name Description
UnionExpression expr
Returns
Type Description
Expression
View Source

Change(VectorOperation)

Declaration
protected virtual Expression Change(VectorOperation expr)
Parameters
Type Name Description
VectorOperation expr
Returns
Type Description
Expression
View Source

ChangeIdentifier(Expression)

Declaration
protected override Table ChangeIdentifier(Expression node)
Parameters
Type Name Description
Expression node
Returns
Type Description
Table
Overrides
Mangrove.MetricSetTransformers.Utilities.ChangeDag<Mangrove.MetricSetSyntaxTree.Expression, Mangrove.MetricSetSyntaxTree.Table, Mangrove.MetricSetSyntaxTree.IExpressionVisitor>.ChangeIdentifier(Mangrove.MetricSetSyntaxTree.Expression)
View Source

Identifier(Expression)

Declaration
protected override Table Identifier(Expression node)
Parameters
Type Name Description
Expression node
Returns
Type Description
Table
Overrides
Mangrove.MetricSetTransformers.Utilities.ChangeDag<Mangrove.MetricSetSyntaxTree.Expression, Mangrove.MetricSetSyntaxTree.Table, Mangrove.MetricSetSyntaxTree.IExpressionVisitor>.Identifier(Mangrove.MetricSetSyntaxTree.Expression)
View Source

Visit(Aggregand)

Declaration
public virtual void Visit(Aggregand expr)
Parameters
Type Name Description
Aggregand expr
View Source

Visit(BinaryAggregation)

Declaration
public virtual void Visit(BinaryAggregation expr)
Parameters
Type Name Description
BinaryAggregation expr
View Source

Visit(BinaryOperation)

Declaration
public virtual void Visit(BinaryOperation expr)
Parameters
Type Name Description
BinaryOperation expr
View Source

Visit(ColumnReference)

Declaration
public virtual void Visit(ColumnReference expr)
Parameters
Type Name Description
ColumnReference expr
View Source

Visit(DataSourceColumn)

Declaration
public virtual void Visit(DataSourceColumn expr)
Parameters
Type Name Description
DataSourceColumn expr
View Source

Visit(Extern)

Declaration
public virtual void Visit(Extern expr)
Parameters
Type Name Description
Extern expr
View Source

Visit(Filter)

Declaration
public virtual void Visit(Filter expr)
Parameters
Type Name Description
Filter expr
View Source

Visit(JoinKey)

Declaration
public virtual void Visit(JoinKey expr)
Parameters
Type Name Description
JoinKey expr
View Source

Visit(Literal)

Declaration
public virtual void Visit(Literal expr)
Parameters
Type Name Description
Literal expr
View Source

Visit(RuntimeVariable)

Declaration
public virtual void Visit(RuntimeVariable expr)
Parameters
Type Name Description
RuntimeVariable expr
View Source

Visit(TernaryOperation)

Declaration
public virtual void Visit(TernaryOperation expr)
Parameters
Type Name Description
TernaryOperation expr
View Source

Visit(UnaryAggregation)

Declaration
public virtual void Visit(UnaryAggregation expr)
Parameters
Type Name Description
UnaryAggregation expr
View Source

Visit(UnaryOperation)

Declaration
public virtual void Visit(UnaryOperation expr)
Parameters
Type Name Description
UnaryOperation expr
View Source

Visit(UnaryWindowFunction)

Declaration
public virtual void Visit(UnaryWindowFunction expr)
Parameters
Type Name Description
UnaryWindowFunction expr
View Source

Visit(UnionExpression)

Declaration
public virtual void Visit(UnionExpression expr)
Parameters
Type Name Description
UnionExpression expr
View Source

Visit(VectorOperation)

Declaration
public virtual void Visit(VectorOperation expr)
Parameters
Type Name Description
VectorOperation expr

Implements

IGenericExpressionVisitor<T>
IExpressionVisitor
IGenericVisitor<T>

Extension Methods

ObjectExtensions.EventId(Object)
  • View Source
Back to top Generated by DocFX