public ExprNode Copy(ExprNode exprNode) { var expression = StatementSpecMapper.Unmap(exprNode); var mapEnv = services.StatementSpecMapEnv; var mapContext = new StatementSpecMapContext(contextCompileTimeDescriptor, mapEnv); var copy = StatementSpecMapper.MapExpression(expression, mapContext); statementSpecRaw.TableExpressions.AddAll(mapContext.TableExpressions); copy.Accept(visitor); return copy; }
private static Pair<ExprNode, StatementSpecMapContext> GetExprDeclaredNode( Expression expression, ICollection<ExpressionDeclItem> stmtLocalExpressions, ContextCompileTimeDescriptor contextCompileTimeDescriptor, StatementSpecMapEnv mapEnv) { var mapContext = new StatementSpecMapContext(contextCompileTimeDescriptor, mapEnv); foreach (var item in stmtLocalExpressions) { mapContext.AddExpressionDeclarations(item); } var body = StatementSpecMapper.MapExpression(expression, mapContext); return new Pair<ExprNode, StatementSpecMapContext>(body, mapContext); }
private static Pair<ExprNode, StatementSpecMapContext> GetExprDeclaredNode( Expression expression, ICollection<ExpressionDeclItem> stmtLocalExpressions, ContextCompileTimeDescriptor contextCompileTimeDescriptor, StatementSpecMapEnv mapEnv, LazyAllocatedMap<HashableMultiKey, AggregationMultiFunctionForge> plugInAggregations, IList<ExpressionScriptProvided> scripts) { var mapContext = new StatementSpecMapContext(contextCompileTimeDescriptor, mapEnv, plugInAggregations, scripts); foreach (var item in stmtLocalExpressions) { mapContext.AddExpressionDeclaration(item); } var body = StatementSpecMapper.MapExpression(expression, mapContext); return new Pair<ExprNode, StatementSpecMapContext>(body, mapContext); }