Package org.hibernate.hql.ast.origin.hql.parse

Examples of org.hibernate.hql.ast.origin.hql.parse.HQLLexer


   * normalize/validate it and create the parsing result
   * @return the result of this parsing as created by the given processing chain
   * @throws ParsingException in case any exception occurs during parsing
   */
  public <T> T parseQuery(String queryString, AstProcessingChain<T> processingChain) throws ParsingException {
    HQLLexer lexer = new HQLLexer( new ANTLRStringStream( queryString ) );
    CommonTokenStream tokens = new CommonTokenStream( lexer );
    HQLParser parser = new HQLParser( tokens );

    try {
      // parser#statement() is the entry point for evaluation of any kind of statement
View Full Code Here


   * normalize/validate it and create the parsing result
   * @return the result of this parsing as created by the given processing chain
   * @throws ParsingException in case any exception occurs during parsing
   */
  public <T> T parseQuery(String queryString, AstProcessingChain<T> processingChain) throws ParsingException {
    HQLLexer lexer = new HQLLexer( new ANTLRStringStream( queryString ) );
    CommonTokenStream tokens = new CommonTokenStream( lexer );
    HQLParser parser = new HQLParser( tokens );

    try {
      // parser#statement() is the entry point for evaluation of any kind of statement
View Full Code Here

    assertTreeParsed( null, "from com.acme.EntityName e where e.name = 'Jack Daniel''s Old No. 7'",
      "(QUERY (QUERY_SPEC (SELECT_FROM (from (PERSISTER_SPACE (ENTITY_PERSISTER_REF com.acme.EntityName e))) (SELECT (SELECT_LIST (SELECT_ITEM e)))) (where (= (PATH (. e name)) (CONST_STRING_VALUE Jack Daniel's Old No. 7)))))");
  }

  private void assertTreeParsed(ParserContext context, String input, String treeExpectation) {
    HQLLexer lexed = new HQLLexer( new ANTLRStringStream( input ) );
    CommonTokenStream tokens = new CommonTokenStream( lexed );

    HQLParser parser = new HQLParser( tokens );
    if ( context != null ) {
      parser.setParserContext( context );
View Full Code Here

public class SingleParserTest {

  public static void main(String[] args) throws RecognitionException {
    String testCase = "select an.mother.id, max(an.bodyWeight) from Animal an group by an.mother.id having max(an.bodyWeight)>1.0";
    ANTLRStringStream antlrStream = new ANTLRStringStream( testCase );
    HQLLexer lexer = new HQLLexer( antlrStream );
    CommonTokenStream tokens = new CommonTokenStream( lexer );
    HQLParser parser = new HQLParser( tokens );
    statement_return statement = parser.statement();
    System.out.println( tokens.getTokens() );
    CommonTree tree = (CommonTree) statement.getTree();
View Full Code Here

   * normalize/validate it and create the parsing result
   * @return the result of this parsing as created by the given processing chain
   * @throws ParsingException in case any exception occurs during parsing
   */
  public <T> T parseQuery(String queryString, AstProcessingChain<T> processingChain) throws ParsingException {
    HQLLexer lexer = new HQLLexer( new ANTLRStringStream( queryString ) );
    CommonTokenStream tokens = new CommonTokenStream( lexer );
    HQLParser parser = new HQLParser( tokens );

    try {
      // parser#statement() is the entry point for evaluation of any kind of statement
View Full Code Here

TOP

Related Classes of org.hibernate.hql.ast.origin.hql.parse.HQLLexer

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.