We're updating the issue view to help you get more done. 

Create a TransformingExpressionTreeVisitor that applies IExpressionTransformers to an expression tree

Description

  • Add a ExpressionTransformerRegistry class encapsulating a MultiDictionary<ExpressionType, Func<Expression, ReadOnlyExpressionStack, Expression>>:

    • public void Register<T> (IExpressionTransformer<T> transformer, ExpressionType nodeType) where T: Expression

    • public IList<T> GetTransformers (ExpressionType nodeType)

  • Add a TransformingExpressionTreeVisitor

    • Implement VisitExpression:

      • Get transformers, iterate; invoke while no changes; when a transformer changes the expression, visit the changed expression

      • Visit base expression - post-order (first, transform the children, then, the node itself)

      • Keep track of the expression stack

Status

Assignee

Fabian Schmied

Reporter

User

Labels

None

Time tracking

2h

Components

Fix versions

Priority

Normal
Configure