类 HqlParser
- java.lang.Object
-
- antlr.Parser
-
- antlr.LLkParser
-
- org.hibernate.hql.internal.antlr.HqlBaseParser
-
- org.hibernate.hql.internal.ast.HqlParser
-
- 所有已实现的接口:
HqlTokenTypes
public final class HqlParser extends HqlBaseParser
Implements the semantic action methods defined in the HQL base parser to keep the grammar source file a little cleaner. Extends the parser class generated by ANTLR.- 作者:
- Joshua Davis (pgmjsd@sourceforge.net)
-
-
字段概要
-
从类继承的字段 org.hibernate.hql.internal.antlr.HqlBaseParser
_tokenNames, _tokenSet_0, _tokenSet_1, _tokenSet_10, _tokenSet_11, _tokenSet_12, _tokenSet_13, _tokenSet_14, _tokenSet_15, _tokenSet_16, _tokenSet_17, _tokenSet_18, _tokenSet_19, _tokenSet_2, _tokenSet_20, _tokenSet_21, _tokenSet_22, _tokenSet_23, _tokenSet_24, _tokenSet_25, _tokenSet_26, _tokenSet_27, _tokenSet_28, _tokenSet_29, _tokenSet_3, _tokenSet_30, _tokenSet_31, _tokenSet_32, _tokenSet_33, _tokenSet_34, _tokenSet_35, _tokenSet_36, _tokenSet_37, _tokenSet_38, _tokenSet_39, _tokenSet_4, _tokenSet_40, _tokenSet_41, _tokenSet_42, _tokenSet_43, _tokenSet_44, _tokenSet_45, _tokenSet_5, _tokenSet_6, _tokenSet_7, _tokenSet_8, _tokenSet_9
-
从接口继承的字段 org.hibernate.hql.internal.antlr.HqlTokenTypes
AGGREGATE, ALIAS, ALL, AND, ANY, AS, ASCENDING, AVG, BETWEEN, BOTH, CASE, CASE2, CAST, CLASS, CLOSE, CLOSE_BRACKET, COLON, COMMA, CONCAT, CONSTANT, CONSTRUCTOR, COUNT, DELETE, DESCENDING, DISTINCT, DIV, DOT, ELEMENTS, ELSE, EMPTY, END, ENTRY, EOF, EQ, ESCAPE, ESCqs, EXISTS, EXPONENT, EXPR_LIST, FALSE, FETCH, FILTER_ENTITY, FIRST, FLOAT_SUFFIX, FROM, FULL, GE, GROUP, GT, HAVING, HEX_DIGIT, ID_LETTER, ID_START_LETTER, IDENT, IN, IN_LIST, INDEX_OP, INDICES, INNER, INSERT, INTO, IS, IS_NOT_NULL, IS_NULL, JAVA_CONSTANT, JOIN, KEY, LAST, LE, LEADING, LEFT, LIKE, LITERAL_ascending, LITERAL_by, LITERAL_descending, LT, MAX, MEMBER, METHOD_CALL, MIN, MINUS, MOD, NE, NEW, NOT, NOT_BETWEEN, NOT_IN, NOT_LIKE, NULL, NULL_TREE_LOOKAHEAD, NULLS, NUM_BIG_DECIMAL, NUM_BIG_INTEGER, NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG, OBJECT, OF, ON, OPEN, OPEN_BRACKET, OR, ORDER, ORDER_ELEMENT, OUTER, PARAM, PLUS, PROPERTIES, QUERY, QUOTED_STRING, RANGE, RIGHT, ROW_STAR, SELECT, SELECT_FROM, SET, SOME, SQL_NE, STAR, SUM, THEN, TRAILING, TRUE, UNARY_MINUS, UNARY_PLUS, UPDATE, VALUE, VECTOR_EXPR, VERSIONED, WEIRD_IDENT, WHEN, WHERE, WITH, WS
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidexpectNamedParameterName()Called after we have recognized ':'.voidfirstPathTokenWeakKeywords()static HqlParsergetInstance(String hql)Get a HqlParser instance for the given HQL string.ParseErrorHandlergetParseErrorHandler()Map<String,Set<String>>getTreatMap()voidhandleDotIdent()This method looks ahead and converts .antlr.collections.ASThandleIdentifierError(antlr.Token token, antlr.RecognitionException ex)Overrides the base behavior to retry keywords as identifiers.voidhandlePrimaryExpressionDotIdent()voidmatchOptionalFrom()Manages the case of an optional FROM allowing the path to start with the "from" keywordantlr.collections.ASTnegateNode(antlr.collections.AST x)Returns an equivalent tree for (NOT (a relop b) ), for example:static voidpanic()antlr.collections.ASTprocessEqualityExpression(antlr.collections.AST x)Post process equality expressions, clean up the subtree.voidprocessMemberOf(antlr.Token n, antlr.collections.AST p, antlr.ASTPair currentAST)protected voidregisterTreat(antlr.collections.AST pathToTreat, antlr.collections.AST treatAs)voidreportError(antlr.RecognitionException e)voidreportError(String s)voidreportWarning(String s)voidshowAst(antlr.collections.AST ast, PrintStream out)voidtraceIn(String ruleName)voidtraceOut(String ruleName)voidweakKeywords()-
从类继承的方法 org.hibernate.hql.internal.antlr.HqlBaseParser
additiveExpression, aggregate, alias, aliasedExpression, asAlias, ascendingOrDescending, assignment, atom, betweenList, buildTokenTypeASTClassMap, caseExpression, castedIdentPrimaryBase, castedJoinPath, castFunction, castTargetType, collectionExpr, compoundExpr, concatenation, constant, deleteStatement, elseClause, equalityExpression, expression, expressionOrVector, exprList, fromClassOrOuterQueryPath, fromClause, fromJoin, fromRange, groupByClause, havingClause, identifier, identPrimary, identPrimaryBase, inClassDeclaration, inCollectionDeclaration, inCollectionElementsDeclaration, inList, insertablePropertySpec, insertStatement, intoClause, isFilter, joinPath, jpaFunctionSyntax, likeEscape, logicalAndExpression, logicalExpression, logicalOrExpression, memberOfPath, multiplyExpression, negatedExpression, newExpression, newValue, nullOrdering, nullPrecedence, optionalFromTokenFromClause, optionalVersioned, orderByClause, orderElement, parameter, path, primaryExpression, propertyFetch, quantifiedExpression, queryRule, relationalExpression, retrieveLookAheadText, searchedCaseStatement, searchedCaseWhenClause, selectClause, selectedPropertiesList, selectFrom, selectObject, selectStatement, setClause, setFilter, simpleCaseStatement, simpleCaseWhenClause, stateField, statement, subQuery, unaryExpression, unquote, updateStatement, validateLookAheadText, validateSoftKeyword, vectorExpr, whereClause, withClause
-
从类继承的方法 antlr.Parser
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, recover, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
-
-
-
-
方法详细资料
-
getInstance
public static HqlParser getInstance(String hql)
Get a HqlParser instance for the given HQL string.- 参数:
hql- The HQL query string- 返回:
- The parser.
-
traceIn
public void traceIn(String ruleName)
- 覆盖:
traceIn在类中antlr.LLkParser
-
traceOut
public void traceOut(String ruleName)
- 覆盖:
traceOut在类中antlr.LLkParser
-
reportError
public void reportError(antlr.RecognitionException e)
- 覆盖:
reportError在类中antlr.Parser
-
reportError
public void reportError(String s)
- 覆盖:
reportError在类中antlr.Parser
-
reportWarning
public void reportWarning(String s)
- 覆盖:
reportWarning在类中antlr.Parser
-
getParseErrorHandler
public ParseErrorHandler getParseErrorHandler()
-
handleIdentifierError
public antlr.collections.AST handleIdentifierError(antlr.Token token, antlr.RecognitionException ex) throws antlr.RecognitionException, antlr.TokenStreamExceptionOverrides the base behavior to retry keywords as identifiers.- 覆盖:
handleIdentifierError在类中HqlBaseParser- 参数:
token- The token.ex- The recognition exception.- 返回:
- The new AST.
- 抛出:
antlr.RecognitionException- if the substitution was not possible.antlr.TokenStreamException- if the substitution was not possible.
-
negateNode
public antlr.collections.AST negateNode(antlr.collections.AST x)
Returns an equivalent tree for (NOT (a relop b) ), for example:(NOT (GT a b) ) => (LE a b)
- 覆盖:
negateNode在类中HqlBaseParser- 参数:
x- The sub tree to transform, the parent is assumed to be NOT.- 返回:
- The equivalent sub-tree.
-
processEqualityExpression
public antlr.collections.AST processEqualityExpression(antlr.collections.AST x)
Post process equality expressions, clean up the subtree.- 覆盖:
processEqualityExpression在类中HqlBaseParser- 参数:
x- The equality expression.- 返回:
- The clean sub-tree.
-
showAst
public void showAst(antlr.collections.AST ast, PrintStream out)
-
matchOptionalFrom
public void matchOptionalFrom() throws antlr.RecognitionException, antlr.TokenStreamException从类复制的说明:HqlBaseParserManages the case of an optional FROM allowing the path to start with the "from" keyword- 覆盖:
matchOptionalFrom在类中HqlBaseParser- 抛出:
antlr.RecognitionExceptionantlr.TokenStreamException
-
firstPathTokenWeakKeywords
public void firstPathTokenWeakKeywords() throws antlr.TokenStreamException- 覆盖:
firstPathTokenWeakKeywords在类中HqlBaseParser- 抛出:
antlr.TokenStreamException
-
handlePrimaryExpressionDotIdent
public void handlePrimaryExpressionDotIdent() throws antlr.TokenStreamException- 覆盖:
handlePrimaryExpressionDotIdent在类中HqlBaseParser- 抛出:
antlr.TokenStreamException
-
weakKeywords
public void weakKeywords() throws antlr.TokenStreamException- 覆盖:
weakKeywords在类中HqlBaseParser- 抛出:
antlr.TokenStreamException
-
expectNamedParameterName
public void expectNamedParameterName() throws antlr.TokenStreamException从类复制的说明:HqlBaseParserCalled after we have recognized ':'. The expectation is to handle converting any non-IDENT token where possibleID == true into an IDENT- 覆盖:
expectNamedParameterName在类中HqlBaseParser- 抛出:
antlr.TokenStreamException
-
handleDotIdent
public void handleDotIdent() throws antlr.TokenStreamException从类复制的说明:HqlBaseParserThis method looks ahead and converts .into . IDENT when appropriate. - 覆盖:
handleDotIdent在类中HqlBaseParser- 抛出:
antlr.TokenStreamException
-
processMemberOf
public void processMemberOf(antlr.Token n, antlr.collections.AST p, antlr.ASTPair currentAST)- 覆盖:
processMemberOf在类中HqlBaseParser
-
registerTreat
protected void registerTreat(antlr.collections.AST pathToTreat, antlr.collections.AST treatAs)- 覆盖:
registerTreat在类中HqlBaseParser
-
panic
public static void panic()
-
-