org.hibernate.hql.internal.antlr
Class SqlStatementParser

java.lang.Object
  extended by antlr.Parser
      extended by antlr.LLkParser
          extended by org.hibernate.hql.internal.antlr.SqlStatementParser
All Implemented Interfaces:
SqlStatementParserTokenTypes

public class SqlStatementParser
extends antlr.LLkParser
implements SqlStatementParserTokenTypes

Lexer and parser used to extract single statements from import SQL script. Supports instructions/comments and quoted strings spread over multiple lines. Each statement must end with semicolon.


Nested Class Summary
 class SqlStatementParser.StatementParserException
           
 
Field Summary
static String[] _tokenNames
           
static antlr.collections.impl.BitSet _tokenSet_0
           
static antlr.collections.impl.BitSet _tokenSet_1
           
 
Fields inherited from class antlr.Parser
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth
 
Fields inherited from interface org.hibernate.hql.internal.antlr.SqlStatementParserTokenTypes
EOF, ESCqs, LINE_COMMENT, MULTILINE_COMMENT, NOT_STMT_END, NULL_TREE_LOOKAHEAD, QUOTED_STRING, STMT_END
 
Constructor Summary
  SqlStatementParser(antlr.ParserSharedInputState state)
           
  SqlStatementParser(antlr.TokenBuffer tokenBuf)
           
protected SqlStatementParser(antlr.TokenBuffer tokenBuf, int k)
           
  SqlStatementParser(antlr.TokenStream lexer)
           
protected SqlStatementParser(antlr.TokenStream lexer, int k)
           
 
Method Summary
 List<String> getStatementList()
           
protected  void out(String stmt)
           
protected  void out(antlr.Token token)
           
 void reportError(antlr.RecognitionException e)
           
 void reportError(String s)
           
 void reportWarning(String s)
           
 void script()
           
 void statement()
           
protected  void statementEnd()
           
 void throwExceptionIfErrorOccurred()
           
 
Methods inherited from class antlr.LLkParser
consume, LA, LT, traceIn, traceOut
 
Methods inherited from class antlr.Parser
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, panic, recover, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_tokenNames

public static final String[] _tokenNames

_tokenSet_0

public static final antlr.collections.impl.BitSet _tokenSet_0

_tokenSet_1

public static final antlr.collections.impl.BitSet _tokenSet_1
Constructor Detail

SqlStatementParser

protected SqlStatementParser(antlr.TokenBuffer tokenBuf,
                             int k)

SqlStatementParser

public SqlStatementParser(antlr.TokenBuffer tokenBuf)

SqlStatementParser

protected SqlStatementParser(antlr.TokenStream lexer,
                             int k)

SqlStatementParser

public SqlStatementParser(antlr.TokenStream lexer)

SqlStatementParser

public SqlStatementParser(antlr.ParserSharedInputState state)
Method Detail

reportError

public void reportError(antlr.RecognitionException e)
Overrides:
reportError in class antlr.Parser

reportError

public void reportError(String s)
Overrides:
reportError in class antlr.Parser

reportWarning

public void reportWarning(String s)
Overrides:
reportWarning in class antlr.Parser

throwExceptionIfErrorOccurred

public void throwExceptionIfErrorOccurred()

out

protected void out(String stmt)

out

protected void out(antlr.Token token)

getStatementList

public List<String> getStatementList()

statementEnd

protected void statementEnd()

script

public final void script()
                  throws antlr.RecognitionException,
                         antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

statement

public final void statement()
                     throws antlr.RecognitionException,
                            antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.