public static string GetPropertyName( EsperEPL2GrammarParser.ChainableContext ctx, int startNode) { var buf = new StringBuilder(); for (var i = startNode; i < ctx.ChildCount; i++) { var tree = ctx.GetChild(i); buf.Append(tree.GetText()); } return buf.ToString(); }
public static IList <Chainable> GetChainables( EsperEPL2GrammarParser.ChainableContext ctx, IDictionary <ITree, ExprNode> astExprNodeMap) { var chain = new List <Chainable>(); // handle root var root = ctx.chainableRootWithOpt(); var optionalRoot = root.q != null; var prop = root.chainableWithArgs(); chain.Add(GetChainable(prop, optionalRoot, astExprNodeMap)); AddChainablesInternal(ctx.chainableElements(), astExprNodeMap, chain); if (chain.IsEmpty()) { throw new ArgumentException("Empty chain"); } return(chain); }
public static void ProcessChainable( EsperEPL2GrammarParser.ChainableContext ctx, IDictionary <ITree, ExprNode> astExprNodeMap, ContextCompileTimeDescriptor contextCompileTimeDescriptor, StatementSpecMapEnv mapEnv, StatementSpecRaw statementSpec, ExpressionDeclDesc expressionDeclarations, LazyAllocatedMap <HashableMultiKey, AggregationMultiFunctionForge> plugInAggregations, IList <ExpressionScriptProvided> scriptExpressions) { // we first convert the event property into chain spec IList <Chainable> chain = ASTChainSpecHelper.GetChainables(ctx, astExprNodeMap); // process chain StatementSpecMapContext mapContext = new StatementSpecMapContext(contextCompileTimeDescriptor, mapEnv, plugInAggregations, scriptExpressions); mapContext.AddExpressionDeclarations(expressionDeclarations); ExprNode node = ChainableWalkHelper.ProcessDot(false, true, chain, mapContext); astExprNodeMap.Put(ctx, node); mapContext.AddTo(statementSpec); }