public final class

HqlParser

extends HqlBaseParser
java.lang.Object
   ↳ HqlBaseParser
     ↳ org.hibernate.hql.ast.HqlParser

Class Overview

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.

Summary

Public Methods
static HqlParser getInstance(String hql)
ParseErrorHandler getParseErrorHandler()
void handleDotIdent()
AST handleIdentifierError(Token token, RecognitionException ex)
Overrides the base behavior to retry keywords as identifiers.
AST negateNode(AST x)
Returns an equivalent tree for (NOT (a relop b) ), for example:
 (NOT (GT a b) ) => (LE a b)
 
static void panic()
AST processEqualityExpression(AST x)
Post process equality expressions, clean up the subtree.
void processMemberOf(Token n, AST p, ASTPair currentAST)
void reportError(RecognitionException e)
void reportWarning(String s)
void showAst(AST ast, PrintStream out)
void traceIn(String ruleName)
void traceOut(String ruleName)
void weakKeywords()
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static HqlParser getInstance (String hql)

public ParseErrorHandler getParseErrorHandler ()

public void handleDotIdent ()

Throws
TokenStreamException

public AST handleIdentifierError (Token token, RecognitionException ex)

Overrides the base behavior to retry keywords as identifiers.

Parameters
token The token.
ex The recognition exception.
Returns
  • AST - The new AST.
Throws
if the substitution was not possible.
if the substitution was not possible.
RecognitionException
TokenStreamException

public AST negateNode (AST x)

Returns an equivalent tree for (NOT (a relop b) ), for example:

 (NOT (GT a b) ) => (LE a b)
 

Parameters
x The sub tree to transform, the parent is assumed to be NOT.
Returns
  • AST - The equivalent sub-tree.

public static void panic ()

public AST processEqualityExpression (AST x)

Post process equality expressions, clean up the subtree.

Parameters
x The equality expression.
Returns
  • AST - The clean sub-tree.

public void processMemberOf (Token n, AST p, ASTPair currentAST)

public void reportError (RecognitionException e)

public void reportWarning (String s)

public void showAst (AST ast, PrintStream out)

public void traceIn (String ruleName)

public void traceOut (String ruleName)

public void weakKeywords ()

Throws
TokenStreamException