Package com.espertech.esper.epl.expression

Examples of com.espertech.esper.epl.expression.ExprNode


            RowRegexExprNodeAtom atom = (RowRegexExprNodeAtom) node;

            // assign stream number for single-variables for most direct expression eval; multiple-variable gets -1
            int streamNum = variableStreams.get(atom.getTag()).getFirst();
            boolean multiple = variableStreams.get(atom.getTag()).getSecond();
            ExprNode expressionDef = variableDefinitions.get(atom.getTag());

            RegexNFAStateBase nextState;
            if ((atom.getType() == RegexNFATypeEnum.ZERO_TO_MANY) || (atom.getType() == RegexNFATypeEnum.ZERO_TO_MANY_RELUCTANT))
            {
                nextState = new RegexNFAStateZeroToMany(toString(nodeNumStack), atom.getTag(), streamNum, multiple, atom.getType().isGreedy(), expressionDef);
View Full Code Here


  {
    List<ExprNode> childNodes = node.getChildNodes();

    for (ListIterator<ExprNode> itor = childNodes.listIterator(); itor.hasNext(); )
    {
      ExprNode childNode = itor.next();
      if(isColumnNameNode(childNode, name))
      {
        itor.set(fullExpr);
      }
      else
View Full Code Here

  {
    List<ExprNode> childNodes = node.getChildNodes();

    for (ListIterator<ExprNode> itor = childNodes.listIterator(); itor.hasNext(); )
    {
      ExprNode childNode = itor.next();
      if(isColumnNameNode(childNode, name))
      {
        itor.set(fullExpr);
      }
      else
View Full Code Here

        return raw.getStreamSpecs().get(0).getViewSpecs().get(0).getObjectParameters().get(0);
    }

    public Expression compileExpressionToSODA(String expression) throws EPException
    {
        ExprNode node = compileExpression(expression);
        return StatementSpecMapper.unmap(node);
    }
View Full Code Here

        {
            // Evaluate assignment expression
            StreamTypeService typeService = new StreamTypeServiceImpl(new EventType[0], new String[0], new boolean[0], services.getEngineURI(), false);
            ExprEvaluatorContextStatement evaluatorContextStmt = new ExprEvaluatorContextStatement(statementContext);
            ExprValidationContext validationContext = new ExprValidationContext(typeService, statementContext.getMethodResolutionService(), null, statementContext.getSchedulingService(), statementContext.getVariableService(), evaluatorContextStmt, statementContext.getEventAdapterService(), statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getContextDescriptor());
            ExprNode validated = ExprNodeUtility.getValidatedSubtree(createDesc.getAssignment(), validationContext);
            value = validated.getExprEvaluator().evaluate(null, true, evaluatorContextStmt);
        }

        // Create variable
        try
        {
View Full Code Here

                        "} or a plug-in single-row function or script but received '" + hashFuncName + "'");
                }
            }

            // get first parameter
            ExprNode paramExpr = item.getFunction().getParameters().get(0);
            ExprEvaluator eval = paramExpr.getExprEvaluator();
            Class paramType = eval.getType();
            EventPropertyGetter getter;

            if (hashFunction == HashFunctionEnum.CONSISTENT_HASH_CRC32) {
                if (item.getFunction().getParameters().size() > 1 || paramType != String.class) {
View Full Code Here

        // categorized
        else if (detailParent.getType() == EsperEPL2Ast.CREATE_CTX_CAT){
            List<ContextDetailCategoryItem> items = new ArrayList<ContextDetailCategoryItem>();
            for (int i = 0; i < detailParent.getChildCount() -1; i++) {
                Tree categoryParent = detailParent.getChild(i);
                ExprNode exprNode = astExprNodeMap.remove(categoryParent.getChild(0));
                String name = categoryParent.getChild(1).getText();
                items.add(new ContextDetailCategoryItem(exprNode, name));
            }
            filterSpec = ASTExprHelper.walkFilterSpec(detailParent.getChild(detailParent.getChildCount() - 1), propertyEvalSpec, astExprNodeMap);
            contextDetail = new ContextDetailCategory(items, filterSpec);
View Full Code Here

     * @param astExprNodeMap map to remove node from
     * @return expression
     */
    public static ExprNode getRemoveExpr(Tree child, Map<Tree, ExprNode> astExprNodeMap)
    {
        ExprNode thisEvalNode = astExprNodeMap.get(child);
        astExprNodeMap.remove(child);
        return thisEvalNode;
    }
View Full Code Here

        List<ExprNode> exprNodes = new LinkedList<ExprNode>();

        for (int i = startIndex; i < parentNode.getChildCount(); i++)
        {
          Tree currentNode = parentNode.getChild(i);
            ExprNode exprNode = astExprNodeMap.get(currentNode);
            if (exprNode == null)
            {
                throw new IllegalStateException("Expression node for AST node not found for type " + currentNode.getType() + " and text " + currentNode.getText());
            }
            exprNodes.add(exprNode);
View Full Code Here

        return exprNodes;
    }

    public static ExprTimePeriod getTimePeriodExpr(Tree node, Map<Tree, ExprNode> astExprNodeMap) {

        ExprNode nodes[] = new ExprNode[8];
        for (int i = 0; i < node.getChildCount(); i++)
        {
            Tree child = node.getChild(i);
            if (child.getType() == EsperEPL2Ast.MILLISECOND_PART)
            {
View Full Code Here

TOP

Related Classes of com.espertech.esper.epl.expression.ExprNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.