net.esper.eql.parse
Class EQLTreeWalker

java.lang.Object
  extended by antlr.TreeParser
      extended by net.esper.eql.generated.EQLBaseWalker
          extended by net.esper.eql.parse.EQLTreeWalker
All Implemented Interfaces:
EqlEvalTokenTypes

public class EQLTreeWalker
extends EQLBaseWalker

Called during the walks of a EQL expression AST tree as specified in the grammar file. Constructs filter and view specifications etc.


Field Summary
 
Fields inherited from class net.esper.eql.generated.EQLBaseWalker
_tokenNames, _tokenSet_0, _tokenSet_1, _tokenSet_2
 
Fields inherited from class antlr.TreeParser
_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNames, traceDepth
 
Fields inherited from interface net.esper.eql.generated.EqlEvalTokenTypes
ALL, AND_EXPR, ARRAY_PARAM_LIST, AS, ASC, AVEDEV, AVG, BAND, BAND_ASSIGN, BNOT, BOGUS, BOOL_TYPE, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, BY, CLASS_IDENT, COLON, COMMA, CONCAT, COUNT, DEC, DESC, DISTINCT, DIV, DIV_ASSIGN, DOT, DOUBLE_TYPE, EOF, EQUAL, EQUALS, ESC, EVAL_AND_EXPR, EVAL_BITWISE_EXPR, EVAL_EQUALS_EXPR, EVAL_IDENT, EVAL_NOTEQUALS_EXPR, EVAL_OR_EXPR, EVENT_FILTER_EXPR, EVENT_FILTER_IDENT, EVENT_FILTER_NAME_TAG, EVENT_FILTER_PARAM, EVENT_LIMIT_EXPR, EVENT_PROP_EXPR, EVENT_PROP_INDEXED, EVENT_PROP_MAPPED, EVENT_PROP_SIMPLE, EVENTS, EVERY_EXPR, EXPONENT, FLOAT_SUFFIX, FLOAT_TYPE, FOLLOWED_BY, FOLLOWED_BY_EXPR, FROM, FULL, FULL_OUTERJOIN_EXPR, GE, GROUP, GROUP_BY_EXPR, GT, GUARD_EXPR, HAVING, HAVING_EXPR, HEX_DIGIT, IDENT, IN, INC, INSERT, INSERTINTO_EXPR, INSERTINTO_EXPRCOL, INT_TYPE, INTO, IS, ISTREAM, JOIN, LAND, LAST, LBRACK, LCURLY, LE, LEFT, LEFT_OUTERJOIN_EXPR, LIB_FUNCTION, LITERAL_false, LITERAL_null, LITERAL_true, LNOT, LONG_TYPE, LOR, LPAREN, LT, MAX, MEDIAN, MIN, MIN_LIMIT_EXPR, MINUS, MINUS_ASSIGN, MINUTES, ML_COMMENT, MOD, MOD_ASSIGN, NOT_EQUAL, NOT_EXPR, NULL_TREE_LOOKAHEAD, NULL_TYPE, NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG, NUMERIC_PARAM_FREQUENCE, NUMERIC_PARAM_FREQUENCY, NUMERIC_PARAM_LIST, NUMERIC_PARAM_RANGE, OBSERVER_EXPR, ON, OR_EXPR, ORDER, ORDER_BY_EXPR, ORDER_ELEMENT_EXPR, OUTER, OUTERJOIN_EXPR, OUTPUT, PLUS, PLUS_ASSIGN, QUESTION, QUOTED_STRING_LITERAL, RBRACK, RCURLY, RIGHT, RIGHT_OUTERJOIN_EXPR, RPAREN, RSTREAM, SEC_LIMIT_EXPR, SECONDS, SELECT, SELECTION_ELEMENT_EXPR, SELECTION_EXPR, SEMI, SL, SL_ASSIGN, SL_COMMENT, SQL_NE, SR, SR_ASSIGN, STAR, STAR_ASSIGN, STDDEV, STREAM_EXPR, STRING_LITERAL, STRING_TYPE, SUM, UNARY_MINUS, VIEW_EXPR, WHERE, WHERE_EXPR, WS
 
Constructor Summary
EQLTreeWalker(EventAdapterService eventAdapterService)
          Ctor.
 
Method Summary
protected  void end()
          End processing of the AST tree, check that expression nodes found their homes.
 ExprNode getFilterRootNode()
          Returns the WHERE-clause root node of filter expression.
 java.util.List<ExprNode> getGroupByExpressions()
          Returns list of group-by expressions.
 ExprNode getHavingExprRootNode()
          Returns expression root node representing the having-clause, if present, or null if no having clause was supplied.
 InsertIntoDesc getInsertIntoDesc()
          Return a descriptor with the insert-into event name and optional list of columns.
 java.util.List<Pair<ExprNode,java.lang.Boolean>> getOrderByList()
          Returns the list of order-by expression as specified in the ORDER BY clause.
 java.util.List<OuterJoinDesc> getOuterJoinDescList()
          Returns the LEFT/RIGHT/FULL OUTER JOIN-type and property name descriptor, if applicable.
 OutputLimitSpec getOutputLimitSpec()
          Returns the output limit definition, if any.
 java.util.List<Pair<ExprNode,java.lang.String>> getSelectListExpressions()
          Returns SELECT-clause list of expressions.
 java.util.List<StreamSpec> getStreamSpecs()
          Returns the FROM-clause stream definitions.
protected  void leaveNode(antlr.collections.AST node)
          Leave AST node and process it's type and child nodes.
 
Methods inherited from class net.esper.eql.generated.EQLBaseWalker
arithmeticExpr, atomicExpr, builtinFunc, constant, evalExprChoice, eventFilterExpr, eventPropertyAtomic, eventPropertyExpr, exprChoice, filterAtom, filterIdentifier, filterParam, filterParamComparator, groupByClause, havingClause, insertIntoExpr, insertIntoExprCol, libFunc, number, numericParameterList, orderByClause, orderByElement, outerJoin, outerJoinIdent, outputLimitExpr, parameter, patternOp, relationalExpr, selectionListElement, selectionListExpr, singleParameter, startEQLExpressionRule, startPatternExpressionRule, streamExpression, valueExpr, viewExpr, viewListExpr, whereClause
 
Methods inherited from class antlr.TreeParser
getAST, getASTFactory, getTokenName, getTokenNames, match, match, matchNot, panic, reportError, reportError, reportWarning, setASTFactory, setASTNodeClass, setASTNodeType, traceIn, traceIndent, traceOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EQLTreeWalker

public EQLTreeWalker(EventAdapterService eventAdapterService)
Ctor.

Parameters:
eventAdapterService - for resolving event names
Method Detail

getStreamSpecs

public java.util.List<StreamSpec> getStreamSpecs()
Returns the FROM-clause stream definitions.

Returns:
list of stream specifications

getSelectListExpressions

public java.util.List<Pair<ExprNode,java.lang.String>> getSelectListExpressions()
Returns SELECT-clause list of expressions.

Returns:
list of expressions and optional name

getFilterRootNode

public ExprNode getFilterRootNode()
Returns the WHERE-clause root node of filter expression.

Returns:
filter expression root node

getOuterJoinDescList

public java.util.List<OuterJoinDesc> getOuterJoinDescList()
Returns the LEFT/RIGHT/FULL OUTER JOIN-type and property name descriptor, if applicable. Returns null if regular join.

Returns:
outer join type, stream names and property names

getGroupByExpressions

public java.util.List<ExprNode> getGroupByExpressions()
Returns list of group-by expressions.

Returns:
group-by expression nodes as specified in group-by clause

getHavingExprRootNode

public ExprNode getHavingExprRootNode()
Returns expression root node representing the having-clause, if present, or null if no having clause was supplied.

Returns:
having-clause expression top node

getOutputLimitSpec

public OutputLimitSpec getOutputLimitSpec()
Returns the output limit definition, if any.

Returns:
output limit spec

getInsertIntoDesc

public InsertIntoDesc getInsertIntoDesc()
Return a descriptor with the insert-into event name and optional list of columns.

Returns:
insert into specification

getOrderByList

public java.util.List<Pair<ExprNode,java.lang.Boolean>> getOrderByList()
Returns the list of order-by expression as specified in the ORDER BY clause.

Returns:
Returns the orderByList.

leaveNode

protected void leaveNode(antlr.collections.AST node)
                  throws ASTWalkException
Leave AST node and process it's type and child nodes.

Overrides:
leaveNode in class EQLBaseWalker
Parameters:
node - is the node to complete
Throws:
ASTWalkException

end

protected void end()
            throws ASTWalkException
End processing of the AST tree, check that expression nodes found their homes.

Overrides:
end in class EQLBaseWalker
Throws:
ASTWalkException