Top Description Fields Constructors Methods
org.hibernate.sql.ordering.antlr

public Class GeneratedOrderByFragmentParser

extends LLkParser
implements OrderByTemplateTokenTypes
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.ordering.antlr.OrderByTemplateTokenTypes
Known Direct Subclasses
org.hibernate.sql.ordering.antlr.OrderByFragmentParser
Imports
antlr.TokenBuffer, .TokenStreamException, .TokenStreamIOException, .ANTLRException, .LLkParser, .Token, .TokenStream, .RecognitionException, .NoViableAltException, .MismatchedTokenException, .SemanticException, .ParserSharedInputState, .ASTFactory, .ASTPair, antlr.collections.impl.BitSet, .ASTArray, antlr.collections.AST, java.util.Hashtable

Antlr grammar for dealing with order-by mapping fragments.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
public static final String[]
public static final BitSet
public static final BitSet
public static final BitSet
public static final BitSet
public static final BitSet
public static final BitSet
public static final BitSet
public static final BitSet
public static final BitSet
public static final BitSet

Constructor Summary

AccessConstructor and Description
protected
public
protected
public
public

Method Summary

Modifier and TypeMethod and Description
protected void
public final void
collationName()

The collation name wrt collationSpecification.

public final void
collationSpecification()

Recognition rule for what ANSI SQL terms the collation specification used to allow specifying that sorting for the given sortSpecification be treated within a specific character-set.

public final void
expression()

Recognition rule what this grammar recognizes as valid sort key.

protected final String

Returns:

The text.
extractText
(AST
The node
ast
)

Extract a node's text.

public final void
functionCall()

Recognition rule for a function call

public final void
functionCallCheck()

Intended for use as a syntactic predicate to determine whether an IDENT represents a known SQL function name.

public final void
functionName()

A function-name is an IDENT followed by zero or more (DOT IDENT) sequences

public final void
functionParameter()

Recognized function parameters.

public final void
functionParameterList()

Recognition rule used to "wrap" all function parameters into an EXPR_LIST node

protected boolean

Returns:

True if the node's text is a known function name, false otherwise.
isFunctionName
(AST
The node whose text we want to check.
ast
)

A check to see if the text of the given node represents a known function name.

private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final long[]
private static final long[]
public final void
nullOrdering()

Recognition rule for what SQL-2003 terms the null ordering; NULLS FIRST or NULLS LAST.

public final void
public final void
orderByFragment()

Main recognition rule for this grammar

public final void
orderingSpecification()

Recognition rule for what ANSI SQL terms the ordering specification; ASCENDING or DESCENDING.

protected AST

Returns:

The processed sort specification subtree.
postProcessSortSpecification
(AST
The grammar-built sort specification subtree.
sortSpec
)

Allow post processing of each sort specification

protected AST

Returns:

The processed node.
quotedIdentifier
(AST
The quoted-identifier node.
ident
)

Process the given node as a quote identifier.

protected AST

Returns:

The processed node.
quotedString
(AST
The quoted string. This is used from within function param recognition, and represents a SQL-quoted string.
ident
)

Process the given node as a quote string.

protected AST

Returns:

The processed node.
resolveFunction
(AST
The node representing the function invocation (including parameters as subtree components).
ast
)

Process the given node as a function.

protected AST

Returns:

The processed node.
resolveIdent
(AST
The node whose text represents either a column or property reference.
ident
)

Process the given node as an IDENT.

public final void
simplePropertyPath()

A simple-property-path is an IDENT followed by one or more (DOT IDENT) sequences

public final void
sortKey()

Recognition rule for what ANSI SQL terms the sort key which is the expression (column, function, etc) upon which to base the sorting.

public final void
sortSpecification()

Recognition rule for what ANSI SQL terms the sort specification, which is essentially each thing upon which the results should be sorted.

protected void
trace(String
The trace message.
msg
)

Method for logging execution trace information.

Inherited from antlr.LLkParser:
consumeLALTtraceIntraceOut

Field Detail

_tokenNamesback to summary
public static final String[] _tokenNames
_tokenSet_0back to summary
public static final BitSet _tokenSet_0
_tokenSet_1back to summary
public static final BitSet _tokenSet_1
_tokenSet_2back to summary
public static final BitSet _tokenSet_2
_tokenSet_3back to summary
public static final BitSet _tokenSet_3
_tokenSet_4back to summary
public static final BitSet _tokenSet_4
_tokenSet_5back to summary
public static final BitSet _tokenSet_5
_tokenSet_6back to summary
public static final BitSet _tokenSet_6
_tokenSet_7back to summary
public static final BitSet _tokenSet_7
_tokenSet_8back to summary
public static final BitSet _tokenSet_8
_tokenSet_9back to summary
public static final BitSet _tokenSet_9

Constructor Detail

GeneratedOrderByFragmentParserback to summary
protected GeneratedOrderByFragmentParser(TokenBuffer tokenBuf, int k)
GeneratedOrderByFragmentParserback to summary
public GeneratedOrderByFragmentParser(TokenBuffer tokenBuf)
GeneratedOrderByFragmentParserback to summary
protected GeneratedOrderByFragmentParser(TokenStream lexer, int k)
GeneratedOrderByFragmentParserback to summary
public GeneratedOrderByFragmentParser(TokenStream lexer)
GeneratedOrderByFragmentParserback to summary
public GeneratedOrderByFragmentParser(ParserSharedInputState state)

Method Detail

buildTokenTypeASTClassMapback to summary
protected void buildTokenTypeASTClassMap()
collationNameback to summary
public final void collationName() throws RecognitionException, TokenStreamException

The collation name wrt collationSpecification. Namely, the character-set.

collationSpecificationback to summary
public final void collationSpecification() throws RecognitionException, TokenStreamException

Recognition rule for what ANSI SQL terms the collation specification used to allow specifying that sorting for the given sortSpecification be treated within a specific character-set.

expressionback to summary
public final void expression() throws RecognitionException, TokenStreamException

Recognition rule what this grammar recognizes as valid sort key.

extractTextback to summary
protected final String extractText(AST ast)

Extract a node's text.

Parameters
ast:AST

The node

Returns:String

The text.

functionCallback to summary
public final void functionCall() throws RecognitionException, TokenStreamException

Recognition rule for a function call

functionCallCheckback to summary
public final void functionCallCheck() throws RecognitionException, TokenStreamException

Intended for use as a syntactic predicate to determine whether an IDENT represents a known SQL function name.

functionNameback to summary
public final void functionName() throws RecognitionException, TokenStreamException

A function-name is an IDENT followed by zero or more (DOT IDENT) sequences

functionParameterback to summary
public final void functionParameter() throws RecognitionException, TokenStreamException

Recognized function parameters.

functionParameterListback to summary
public final void functionParameterList() throws RecognitionException, TokenStreamException

Recognition rule used to "wrap" all function parameters into an EXPR_LIST node

isFunctionNameback to summary
protected boolean isFunctionName(AST ast)

A check to see if the text of the given node represents a known function name.

Parameters
ast:AST

The node whose text we want to check.

Returns:boolean

True if the node's text is a known function name, false otherwise.

See Also
org.hibernate.dialect.function.SQLFunctionRegistry
mk_tokenSet_0back to summary
private static final long[] mk_tokenSet_0()
mk_tokenSet_1back to summary
private static final long[] mk_tokenSet_1()
mk_tokenSet_2back to summary
private static final long[] mk_tokenSet_2()
mk_tokenSet_3back to summary
private static final long[] mk_tokenSet_3()
mk_tokenSet_4back to summary
private static final long[] mk_tokenSet_4()
mk_tokenSet_5back to summary
private static final long[] mk_tokenSet_5()
mk_tokenSet_6back to summary
private static final long[] mk_tokenSet_6()
mk_tokenSet_7back to summary
private static final long[] mk_tokenSet_7()
mk_tokenSet_8back to summary
private static final long[] mk_tokenSet_8()
mk_tokenSet_9back to summary
private static final long[] mk_tokenSet_9()
nullOrderingback to summary
public final void nullOrdering() throws RecognitionException, TokenStreamException

Recognition rule for what SQL-2003 terms the null ordering; NULLS FIRST or NULLS LAST.

nullPrecedenceback to summary
public final void nullPrecedence() throws RecognitionException, TokenStreamException
orderByFragmentback to summary
public final void orderByFragment() throws RecognitionException, TokenStreamException

Main recognition rule for this grammar

orderingSpecificationback to summary
public final void orderingSpecification() throws RecognitionException, TokenStreamException

Recognition rule for what ANSI SQL terms the ordering specification; ASCENDING or DESCENDING.

postProcessSortSpecificationback to summary
protected AST postProcessSortSpecification(AST sortSpec)

Allow post processing of each sort specification

Parameters
sortSpec:AST

The grammar-built sort specification subtree.

Returns:AST

The processed sort specification subtree.

quotedIdentifierback to summary
protected AST quotedIdentifier(AST ident)

Process the given node as a quote identifier. These need to be quoted in the dialect-specific way.

Parameters
ident:AST

The quoted-identifier node.

Returns:AST

The processed node.

See Also
org.hibernate.dialect.Dialect#quote
quotedStringback to summary
protected AST quotedString(AST ident)

Process the given node as a quote string.

Parameters
ident:AST

The quoted string. This is used from within function param recognition, and represents a SQL-quoted string.

Returns:AST

The processed node.

resolveFunctionback to summary
protected AST resolveFunction(AST ast)

Process the given node as a function.

Parameters
ast:AST

The node representing the function invocation (including parameters as subtree components).

Returns:AST

The processed node.

resolveIdentback to summary
protected AST resolveIdent(AST ident)

Process the given node as an IDENT. May represent either a column reference or a property reference.

Parameters
ident:AST

The node whose text represents either a column or property reference.

Returns:AST

The processed node.

simplePropertyPathback to summary
public final void simplePropertyPath() throws RecognitionException, TokenStreamException

A simple-property-path is an IDENT followed by one or more (DOT IDENT) sequences

sortKeyback to summary
public final void sortKey() throws RecognitionException, TokenStreamException

Recognition rule for what ANSI SQL terms the sort key which is the expression (column, function, etc) upon which to base the sorting.

sortSpecificationback to summary
public final void sortSpecification() throws RecognitionException, TokenStreamException

Recognition rule for what ANSI SQL terms the sort specification, which is essentially each thing upon which the results should be sorted.

traceback to summary
protected void trace(String msg)

Method for logging execution trace information.

Parameters
msg:String

The trace message.

Annotations
@AllowSysOut