AntlrSimpleSqlParser.java
// Generated from /home/gsinai/git/microspace/src/main/resources/AntlrSimpleSql.g4 by ANTLR 4.7
package org.microspace.parser;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.misc.*;
import org.antlr.v4.runtime.tree.*;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class AntlrSimpleSqlParser extends Parser {
static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
WHITE_SPACE=1, SELECT=2, DISTINCT=3, FROM=4, WHERE=5, ROWNUM=6, NULL=7,
TRUE=8, FALSE=9, ORDER=10, BY=11, ASC=12, DESC=13, OR=14, AND=15, IS=16,
NOT=17, IN=18, EQ=19, NOT_EQ=20, LET=21, GET=22, GTH=23, LTH=24, LIKE=25,
ASTERISK=26, RPAREN=27, LPAREN=28, DOT=29, COMMA=30, SEMICOLON=31, BACKTICK=32,
PLUS=33, MINUS=34, INTEGER_NUM=35, REAL_NUMBER=36, TEXT_STRING=37, ID=38,
CLASSNAME=39;
public static final int
RULE_relational_op = 0, RULE_string_literal = 1, RULE_number_literal = 2,
RULE_boolean_literal = 3, RULE_literal_value = 4, RULE_string_literal_list = 5,
RULE_number_literal_list = 6, RULE_boolean_literal_list = 7, RULE_literal_list = 8,
RULE_top_select = 9, RULE_select_statement = 10, RULE_table_name = 11,
RULE_column_name = 12, RULE_column_sort_name = 13, RULE_where_clause = 14,
RULE_order_clause = 15, RULE_expression = 16, RULE_select_expression = 17,
RULE_select_expression_and = 18, RULE_select_expression_atom = 19, RULE_column_in_expression = 20,
RULE_column_bool_column = 21, RULE_column_bool_primary = 22, RULE_select_expression_list = 23,
RULE_column_list = 24, RULE_column_sort_list = 25, RULE_rownum_expression = 26,
RULE_rownum_bool_primary = 27;
public static final String[] ruleNames = {
"relational_op", "string_literal", "number_literal", "boolean_literal",
"literal_value", "string_literal_list", "number_literal_list", "boolean_literal_list",
"literal_list", "top_select", "select_statement", "table_name", "column_name",
"column_sort_name", "where_clause", "order_clause", "expression", "select_expression",
"select_expression_and", "select_expression_atom", "column_in_expression",
"column_bool_column", "column_bool_primary", "select_expression_list",
"column_list", "column_sort_list", "rownum_expression", "rownum_bool_primary"
};
private static final String[] _LITERAL_NAMES = {
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, "'='", null, "'<='", "'>='",
"'>'", "'<'", null, "'*'", "')'", "'('", "'.'", "','", "';'", "'`'", "'+'",
"'-'"
};
private static final String[] _SYMBOLIC_NAMES = {
null, "WHITE_SPACE", "SELECT", "DISTINCT", "FROM", "WHERE", "ROWNUM",
"NULL", "TRUE", "FALSE", "ORDER", "BY", "ASC", "DESC", "OR", "AND", "IS",
"NOT", "IN", "EQ", "NOT_EQ", "LET", "GET", "GTH", "LTH", "LIKE", "ASTERISK",
"RPAREN", "LPAREN", "DOT", "COMMA", "SEMICOLON", "BACKTICK", "PLUS", "MINUS",
"INTEGER_NUM", "REAL_NUMBER", "TEXT_STRING", "ID", "CLASSNAME"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
/**
* @deprecated Use {@link #VOCABULARY} instead.
*/
@Deprecated
public static final String[] tokenNames;
static {
tokenNames = new String[_SYMBOLIC_NAMES.length];
for (int i = 0; i < tokenNames.length; i++) {
tokenNames[i] = VOCABULARY.getLiteralName(i);
if (tokenNames[i] == null) {
tokenNames[i] = VOCABULARY.getSymbolicName(i);
}
if (tokenNames[i] == null) {
tokenNames[i] = "<INVALID>";
}
}
}
@Override
@Deprecated
public String[] getTokenNames() {
return tokenNames;
}
@Override
public Vocabulary getVocabulary() {
return VOCABULARY;
}
@Override
public String getGrammarFileName() { return "AntlrSimpleSql.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
@Override
public void notifyErrorListeners(Token offendingToken, String msg, RecognitionException ex)
{
throw new IllegalArgumentException(msg);
}
public AntlrSimpleSqlParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class Relational_opContext extends ParserRuleContext {
public TerminalNode EQ() { return getToken(AntlrSimpleSqlParser.EQ, 0); }
public TerminalNode LTH() { return getToken(AntlrSimpleSqlParser.LTH, 0); }
public TerminalNode GTH() { return getToken(AntlrSimpleSqlParser.GTH, 0); }
public TerminalNode NOT_EQ() { return getToken(AntlrSimpleSqlParser.NOT_EQ, 0); }
public TerminalNode LET() { return getToken(AntlrSimpleSqlParser.LET, 0); }
public TerminalNode GET() { return getToken(AntlrSimpleSqlParser.GET, 0); }
public Relational_opContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_relational_op; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterRelational_op(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitRelational_op(this);
}
}
public final Relational_opContext relational_op() throws RecognitionException {
Relational_opContext _localctx = new Relational_opContext(_ctx, getState());
enterRule(_localctx, 0, RULE_relational_op);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(56);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << EQ) | (1L << NOT_EQ) | (1L << LET) | (1L << GET) | (1L << GTH) | (1L << LTH))) != 0)) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class String_literalContext extends ParserRuleContext {
public TerminalNode TEXT_STRING() { return getToken(AntlrSimpleSqlParser.TEXT_STRING, 0); }
public String_literalContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_string_literal; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterString_literal(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitString_literal(this);
}
}
public final String_literalContext string_literal() throws RecognitionException {
String_literalContext _localctx = new String_literalContext(_ctx, getState());
enterRule(_localctx, 2, RULE_string_literal);
try {
enterOuterAlt(_localctx, 1);
{
setState(58);
match(TEXT_STRING);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Number_literalContext extends ParserRuleContext {
public TerminalNode INTEGER_NUM() { return getToken(AntlrSimpleSqlParser.INTEGER_NUM, 0); }
public TerminalNode REAL_NUMBER() { return getToken(AntlrSimpleSqlParser.REAL_NUMBER, 0); }
public TerminalNode PLUS() { return getToken(AntlrSimpleSqlParser.PLUS, 0); }
public TerminalNode MINUS() { return getToken(AntlrSimpleSqlParser.MINUS, 0); }
public Number_literalContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_number_literal; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterNumber_literal(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitNumber_literal(this);
}
}
public final Number_literalContext number_literal() throws RecognitionException {
Number_literalContext _localctx = new Number_literalContext(_ctx, getState());
enterRule(_localctx, 4, RULE_number_literal);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(61);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PLUS || _la==MINUS) {
{
setState(60);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(63);
_la = _input.LA(1);
if ( !(_la==INTEGER_NUM || _la==REAL_NUMBER) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Boolean_literalContext extends ParserRuleContext {
public TerminalNode TRUE() { return getToken(AntlrSimpleSqlParser.TRUE, 0); }
public TerminalNode FALSE() { return getToken(AntlrSimpleSqlParser.FALSE, 0); }
public Boolean_literalContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_boolean_literal; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterBoolean_literal(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitBoolean_literal(this);
}
}
public final Boolean_literalContext boolean_literal() throws RecognitionException {
Boolean_literalContext _localctx = new Boolean_literalContext(_ctx, getState());
enterRule(_localctx, 6, RULE_boolean_literal);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(65);
_la = _input.LA(1);
if ( !(_la==TRUE || _la==FALSE) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Literal_valueContext extends ParserRuleContext {
public String_literalContext string_literal() {
return getRuleContext(String_literalContext.class,0);
}
public Number_literalContext number_literal() {
return getRuleContext(Number_literalContext.class,0);
}
public Boolean_literalContext boolean_literal() {
return getRuleContext(Boolean_literalContext.class,0);
}
public Literal_valueContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_literal_value; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterLiteral_value(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitLiteral_value(this);
}
}
public final Literal_valueContext literal_value() throws RecognitionException {
Literal_valueContext _localctx = new Literal_valueContext(_ctx, getState());
enterRule(_localctx, 8, RULE_literal_value);
try {
enterOuterAlt(_localctx, 1);
{
setState(70);
_errHandler.sync(this);
switch (_input.LA(1)) {
case TEXT_STRING:
{
setState(67);
string_literal();
}
break;
case PLUS:
case MINUS:
case INTEGER_NUM:
case REAL_NUMBER:
{
setState(68);
number_literal();
}
break;
case TRUE:
case FALSE:
{
setState(69);
boolean_literal();
}
break;
default:
throw new NoViableAltException(this);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class String_literal_listContext extends ParserRuleContext {
public List<String_literalContext> string_literal() {
return getRuleContexts(String_literalContext.class);
}
public String_literalContext string_literal(int i) {
return getRuleContext(String_literalContext.class,i);
}
public List<TerminalNode> COMMA() { return getTokens(AntlrSimpleSqlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(AntlrSimpleSqlParser.COMMA, i);
}
public String_literal_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_string_literal_list; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterString_literal_list(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitString_literal_list(this);
}
}
public final String_literal_listContext string_literal_list() throws RecognitionException {
String_literal_listContext _localctx = new String_literal_listContext(_ctx, getState());
enterRule(_localctx, 10, RULE_string_literal_list);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(72);
string_literal();
setState(77);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(73);
match(COMMA);
setState(74);
string_literal();
}
}
setState(79);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Number_literal_listContext extends ParserRuleContext {
public List<Number_literalContext> number_literal() {
return getRuleContexts(Number_literalContext.class);
}
public Number_literalContext number_literal(int i) {
return getRuleContext(Number_literalContext.class,i);
}
public List<TerminalNode> COMMA() { return getTokens(AntlrSimpleSqlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(AntlrSimpleSqlParser.COMMA, i);
}
public Number_literal_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_number_literal_list; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterNumber_literal_list(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitNumber_literal_list(this);
}
}
public final Number_literal_listContext number_literal_list() throws RecognitionException {
Number_literal_listContext _localctx = new Number_literal_listContext(_ctx, getState());
enterRule(_localctx, 12, RULE_number_literal_list);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(80);
number_literal();
setState(85);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(81);
match(COMMA);
setState(82);
number_literal();
}
}
setState(87);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Boolean_literal_listContext extends ParserRuleContext {
public List<Boolean_literalContext> boolean_literal() {
return getRuleContexts(Boolean_literalContext.class);
}
public Boolean_literalContext boolean_literal(int i) {
return getRuleContext(Boolean_literalContext.class,i);
}
public List<TerminalNode> COMMA() { return getTokens(AntlrSimpleSqlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(AntlrSimpleSqlParser.COMMA, i);
}
public Boolean_literal_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_boolean_literal_list; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterBoolean_literal_list(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitBoolean_literal_list(this);
}
}
public final Boolean_literal_listContext boolean_literal_list() throws RecognitionException {
Boolean_literal_listContext _localctx = new Boolean_literal_listContext(_ctx, getState());
enterRule(_localctx, 14, RULE_boolean_literal_list);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(88);
boolean_literal();
setState(93);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(89);
match(COMMA);
setState(90);
boolean_literal();
}
}
setState(95);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Literal_listContext extends ParserRuleContext {
public String_literal_listContext string_literal_list() {
return getRuleContext(String_literal_listContext.class,0);
}
public Number_literal_listContext number_literal_list() {
return getRuleContext(Number_literal_listContext.class,0);
}
public Boolean_literal_listContext boolean_literal_list() {
return getRuleContext(Boolean_literal_listContext.class,0);
}
public Literal_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_literal_list; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterLiteral_list(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitLiteral_list(this);
}
}
public final Literal_listContext literal_list() throws RecognitionException {
Literal_listContext _localctx = new Literal_listContext(_ctx, getState());
enterRule(_localctx, 16, RULE_literal_list);
try {
enterOuterAlt(_localctx, 1);
{
setState(99);
_errHandler.sync(this);
switch (_input.LA(1)) {
case TEXT_STRING:
{
setState(96);
string_literal_list();
}
break;
case PLUS:
case MINUS:
case INTEGER_NUM:
case REAL_NUMBER:
{
setState(97);
number_literal_list();
}
break;
case TRUE:
case FALSE:
{
setState(98);
boolean_literal_list();
}
break;
default:
throw new NoViableAltException(this);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Top_selectContext extends ParserRuleContext {
public Select_statementContext select_statement() {
return getRuleContext(Select_statementContext.class,0);
}
public TerminalNode EOF() { return getToken(AntlrSimpleSqlParser.EOF, 0); }
public TerminalNode SEMICOLON() { return getToken(AntlrSimpleSqlParser.SEMICOLON, 0); }
public Top_selectContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_top_select; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterTop_select(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitTop_select(this);
}
}
public final Top_selectContext top_select() throws RecognitionException {
Top_selectContext _localctx = new Top_selectContext(_ctx, getState());
enterRule(_localctx, 18, RULE_top_select);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(101);
select_statement();
setState(103);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SEMICOLON) {
{
setState(102);
match(SEMICOLON);
}
}
setState(105);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Select_statementContext extends ParserRuleContext {
public TerminalNode SELECT() { return getToken(AntlrSimpleSqlParser.SELECT, 0); }
public TerminalNode FROM() { return getToken(AntlrSimpleSqlParser.FROM, 0); }
public Table_nameContext table_name() {
return getRuleContext(Table_nameContext.class,0);
}
public TerminalNode ASTERISK() { return getToken(AntlrSimpleSqlParser.ASTERISK, 0); }
public Column_listContext column_list() {
return getRuleContext(Column_listContext.class,0);
}
public TerminalNode DISTINCT() { return getToken(AntlrSimpleSqlParser.DISTINCT, 0); }
public Where_clauseContext where_clause() {
return getRuleContext(Where_clauseContext.class,0);
}
public Order_clauseContext order_clause() {
return getRuleContext(Order_clauseContext.class,0);
}
public Select_statementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_select_statement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterSelect_statement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitSelect_statement(this);
}
}
public final Select_statementContext select_statement() throws RecognitionException {
Select_statementContext _localctx = new Select_statementContext(_ctx, getState());
enterRule(_localctx, 20, RULE_select_statement);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(107);
match(SELECT);
setState(109);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==DISTINCT) {
{
setState(108);
match(DISTINCT);
}
}
setState(113);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ASTERISK:
{
setState(111);
match(ASTERISK);
}
break;
case BACKTICK:
case ID:
{
setState(112);
column_list();
}
break;
default:
throw new NoViableAltException(this);
}
setState(115);
match(FROM);
setState(116);
table_name();
setState(118);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHERE) {
{
setState(117);
where_clause();
}
}
setState(121);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(120);
order_clause();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Table_nameContext extends ParserRuleContext {
public TerminalNode CLASSNAME() { return getToken(AntlrSimpleSqlParser.CLASSNAME, 0); }
public Table_nameContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_table_name; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterTable_name(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitTable_name(this);
}
}
public final Table_nameContext table_name() throws RecognitionException {
Table_nameContext _localctx = new Table_nameContext(_ctx, getState());
enterRule(_localctx, 22, RULE_table_name);
try {
enterOuterAlt(_localctx, 1);
{
setState(123);
match(CLASSNAME);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Column_nameContext extends ParserRuleContext {
public List<TerminalNode> BACKTICK() { return getTokens(AntlrSimpleSqlParser.BACKTICK); }
public TerminalNode BACKTICK(int i) {
return getToken(AntlrSimpleSqlParser.BACKTICK, i);
}
public TerminalNode ID() { return getToken(AntlrSimpleSqlParser.ID, 0); }
public Column_nameContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_column_name; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterColumn_name(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitColumn_name(this);
}
}
public final Column_nameContext column_name() throws RecognitionException {
Column_nameContext _localctx = new Column_nameContext(_ctx, getState());
enterRule(_localctx, 24, RULE_column_name);
try {
setState(129);
_errHandler.sync(this);
switch (_input.LA(1)) {
case BACKTICK:
enterOuterAlt(_localctx, 1);
{
setState(125);
match(BACKTICK);
setState(126);
match(ID);
setState(127);
match(BACKTICK);
}
break;
case ID:
enterOuterAlt(_localctx, 2);
{
setState(128);
match(ID);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Column_sort_nameContext extends ParserRuleContext {
public List<TerminalNode> BACKTICK() { return getTokens(AntlrSimpleSqlParser.BACKTICK); }
public TerminalNode BACKTICK(int i) {
return getToken(AntlrSimpleSqlParser.BACKTICK, i);
}
public TerminalNode ID() { return getToken(AntlrSimpleSqlParser.ID, 0); }
public TerminalNode ASC() { return getToken(AntlrSimpleSqlParser.ASC, 0); }
public TerminalNode DESC() { return getToken(AntlrSimpleSqlParser.DESC, 0); }
public Column_sort_nameContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_column_sort_name; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterColumn_sort_name(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitColumn_sort_name(this);
}
}
public final Column_sort_nameContext column_sort_name() throws RecognitionException {
Column_sort_nameContext _localctx = new Column_sort_nameContext(_ctx, getState());
enterRule(_localctx, 26, RULE_column_sort_name);
int _la;
try {
setState(141);
_errHandler.sync(this);
switch (_input.LA(1)) {
case BACKTICK:
enterOuterAlt(_localctx, 1);
{
setState(131);
match(BACKTICK);
setState(132);
match(ID);
setState(133);
match(BACKTICK);
setState(135);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASC || _la==DESC) {
{
setState(134);
_la = _input.LA(1);
if ( !(_la==ASC || _la==DESC) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
}
break;
case ID:
enterOuterAlt(_localctx, 2);
{
setState(137);
match(ID);
setState(139);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASC || _la==DESC) {
{
setState(138);
_la = _input.LA(1);
if ( !(_la==ASC || _la==DESC) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Where_clauseContext extends ParserRuleContext {
public TerminalNode WHERE() { return getToken(AntlrSimpleSqlParser.WHERE, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public Where_clauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_where_clause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterWhere_clause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitWhere_clause(this);
}
}
public final Where_clauseContext where_clause() throws RecognitionException {
Where_clauseContext _localctx = new Where_clauseContext(_ctx, getState());
enterRule(_localctx, 28, RULE_where_clause);
try {
enterOuterAlt(_localctx, 1);
{
setState(143);
match(WHERE);
setState(144);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Order_clauseContext extends ParserRuleContext {
public TerminalNode ORDER() { return getToken(AntlrSimpleSqlParser.ORDER, 0); }
public TerminalNode BY() { return getToken(AntlrSimpleSqlParser.BY, 0); }
public Column_sort_listContext column_sort_list() {
return getRuleContext(Column_sort_listContext.class,0);
}
public Order_clauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_order_clause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterOrder_clause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitOrder_clause(this);
}
}
public final Order_clauseContext order_clause() throws RecognitionException {
Order_clauseContext _localctx = new Order_clauseContext(_ctx, getState());
enterRule(_localctx, 30, RULE_order_clause);
try {
enterOuterAlt(_localctx, 1);
{
setState(146);
match(ORDER);
setState(147);
match(BY);
setState(148);
column_sort_list();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExpressionContext extends ParserRuleContext {
public Select_expressionContext select_expression() {
return getRuleContext(Select_expressionContext.class,0);
}
public TerminalNode AND() { return getToken(AntlrSimpleSqlParser.AND, 0); }
public Rownum_expressionContext rownum_expression() {
return getRuleContext(Rownum_expressionContext.class,0);
}
public ExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_expression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitExpression(this);
}
}
public final ExpressionContext expression() throws RecognitionException {
ExpressionContext _localctx = new ExpressionContext(_ctx, getState());
enterRule(_localctx, 32, RULE_expression);
try {
setState(156);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(150);
select_expression();
setState(151);
match(AND);
setState(152);
rownum_expression();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(154);
rownum_expression();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(155);
select_expression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Select_expressionContext extends ParserRuleContext {
public List<Select_expression_andContext> select_expression_and() {
return getRuleContexts(Select_expression_andContext.class);
}
public Select_expression_andContext select_expression_and(int i) {
return getRuleContext(Select_expression_andContext.class,i);
}
public List<TerminalNode> OR() { return getTokens(AntlrSimpleSqlParser.OR); }
public TerminalNode OR(int i) {
return getToken(AntlrSimpleSqlParser.OR, i);
}
public Select_expressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_select_expression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterSelect_expression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitSelect_expression(this);
}
}
public final Select_expressionContext select_expression() throws RecognitionException {
Select_expressionContext _localctx = new Select_expressionContext(_ctx, getState());
enterRule(_localctx, 34, RULE_select_expression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(158);
select_expression_and();
setState(163);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==OR) {
{
{
setState(159);
match(OR);
setState(160);
select_expression_and();
}
}
setState(165);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Select_expression_andContext extends ParserRuleContext {
public List<Select_expression_atomContext> select_expression_atom() {
return getRuleContexts(Select_expression_atomContext.class);
}
public Select_expression_atomContext select_expression_atom(int i) {
return getRuleContext(Select_expression_atomContext.class,i);
}
public List<TerminalNode> AND() { return getTokens(AntlrSimpleSqlParser.AND); }
public TerminalNode AND(int i) {
return getToken(AntlrSimpleSqlParser.AND, i);
}
public Select_expression_andContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_select_expression_and; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterSelect_expression_and(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitSelect_expression_and(this);
}
}
public final Select_expression_andContext select_expression_and() throws RecognitionException {
Select_expression_andContext _localctx = new Select_expression_andContext(_ctx, getState());
enterRule(_localctx, 36, RULE_select_expression_and);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(166);
select_expression_atom();
setState(171);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,17,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(167);
match(AND);
setState(168);
select_expression_atom();
}
}
}
setState(173);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,17,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Select_expression_atomContext extends ParserRuleContext {
public Select_expression_listContext select_expression_list() {
return getRuleContext(Select_expression_listContext.class,0);
}
public Column_in_expressionContext column_in_expression() {
return getRuleContext(Column_in_expressionContext.class,0);
}
public Column_bool_primaryContext column_bool_primary() {
return getRuleContext(Column_bool_primaryContext.class,0);
}
public Column_bool_columnContext column_bool_column() {
return getRuleContext(Column_bool_columnContext.class,0);
}
public Select_expression_atomContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_select_expression_atom; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterSelect_expression_atom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitSelect_expression_atom(this);
}
}
public final Select_expression_atomContext select_expression_atom() throws RecognitionException {
Select_expression_atomContext _localctx = new Select_expression_atomContext(_ctx, getState());
enterRule(_localctx, 38, RULE_select_expression_atom);
try {
setState(178);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(174);
select_expression_list();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(175);
column_in_expression();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(176);
column_bool_primary();
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(177);
column_bool_column();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Column_in_expressionContext extends ParserRuleContext {
public Column_nameContext column_name() {
return getRuleContext(Column_nameContext.class,0);
}
public TerminalNode IN() { return getToken(AntlrSimpleSqlParser.IN, 0); }
public TerminalNode LPAREN() { return getToken(AntlrSimpleSqlParser.LPAREN, 0); }
public Literal_listContext literal_list() {
return getRuleContext(Literal_listContext.class,0);
}
public TerminalNode RPAREN() { return getToken(AntlrSimpleSqlParser.RPAREN, 0); }
public TerminalNode NOT() { return getToken(AntlrSimpleSqlParser.NOT, 0); }
public Select_statementContext select_statement() {
return getRuleContext(Select_statementContext.class,0);
}
public Column_in_expressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_column_in_expression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterColumn_in_expression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitColumn_in_expression(this);
}
}
public final Column_in_expressionContext column_in_expression() throws RecognitionException {
Column_in_expressionContext _localctx = new Column_in_expressionContext(_ctx, getState());
enterRule(_localctx, 40, RULE_column_in_expression);
int _la;
try {
setState(198);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(180);
column_name();
setState(182);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(181);
match(NOT);
}
}
setState(184);
match(IN);
setState(185);
match(LPAREN);
setState(186);
literal_list();
setState(187);
match(RPAREN);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(189);
column_name();
setState(191);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(190);
match(NOT);
}
}
setState(193);
match(IN);
setState(194);
match(LPAREN);
setState(195);
select_statement();
setState(196);
match(RPAREN);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Column_bool_columnContext extends ParserRuleContext {
public List<Column_nameContext> column_name() {
return getRuleContexts(Column_nameContext.class);
}
public Column_nameContext column_name(int i) {
return getRuleContext(Column_nameContext.class,i);
}
public Relational_opContext relational_op() {
return getRuleContext(Relational_opContext.class,0);
}
public Column_bool_columnContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_column_bool_column; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterColumn_bool_column(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitColumn_bool_column(this);
}
}
public final Column_bool_columnContext column_bool_column() throws RecognitionException {
Column_bool_columnContext _localctx = new Column_bool_columnContext(_ctx, getState());
enterRule(_localctx, 42, RULE_column_bool_column);
try {
enterOuterAlt(_localctx, 1);
{
setState(200);
column_name();
setState(201);
relational_op();
setState(202);
column_name();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Column_bool_primaryContext extends ParserRuleContext {
public Column_nameContext column_name() {
return getRuleContext(Column_nameContext.class,0);
}
public Relational_opContext relational_op() {
return getRuleContext(Relational_opContext.class,0);
}
public Literal_valueContext literal_value() {
return getRuleContext(Literal_valueContext.class,0);
}
public TerminalNode IS() { return getToken(AntlrSimpleSqlParser.IS, 0); }
public TerminalNode NULL() { return getToken(AntlrSimpleSqlParser.NULL, 0); }
public TerminalNode NOT() { return getToken(AntlrSimpleSqlParser.NOT, 0); }
public TerminalNode LIKE() { return getToken(AntlrSimpleSqlParser.LIKE, 0); }
public Column_bool_primaryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_column_bool_primary; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterColumn_bool_primary(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitColumn_bool_primary(this);
}
}
public final Column_bool_primaryContext column_bool_primary() throws RecognitionException {
Column_bool_primaryContext _localctx = new Column_bool_primaryContext(_ctx, getState());
enterRule(_localctx, 44, RULE_column_bool_primary);
int _la;
try {
setState(222);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(204);
column_name();
setState(205);
relational_op();
setState(206);
literal_value();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(208);
column_name();
setState(209);
match(IS);
setState(211);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(210);
match(NOT);
}
}
setState(213);
match(NULL);
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(215);
column_name();
setState(217);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(216);
match(NOT);
}
}
setState(219);
match(LIKE);
setState(220);
literal_value();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Select_expression_listContext extends ParserRuleContext {
public TerminalNode LPAREN() { return getToken(AntlrSimpleSqlParser.LPAREN, 0); }
public Select_expressionContext select_expression() {
return getRuleContext(Select_expressionContext.class,0);
}
public TerminalNode RPAREN() { return getToken(AntlrSimpleSqlParser.RPAREN, 0); }
public Select_expression_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_select_expression_list; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterSelect_expression_list(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitSelect_expression_list(this);
}
}
public final Select_expression_listContext select_expression_list() throws RecognitionException {
Select_expression_listContext _localctx = new Select_expression_listContext(_ctx, getState());
enterRule(_localctx, 46, RULE_select_expression_list);
try {
enterOuterAlt(_localctx, 1);
{
setState(224);
match(LPAREN);
setState(225);
select_expression();
setState(226);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Column_listContext extends ParserRuleContext {
public List<Column_nameContext> column_name() {
return getRuleContexts(Column_nameContext.class);
}
public Column_nameContext column_name(int i) {
return getRuleContext(Column_nameContext.class,i);
}
public List<TerminalNode> COMMA() { return getTokens(AntlrSimpleSqlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(AntlrSimpleSqlParser.COMMA, i);
}
public Column_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_column_list; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterColumn_list(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitColumn_list(this);
}
}
public final Column_listContext column_list() throws RecognitionException {
Column_listContext _localctx = new Column_listContext(_ctx, getState());
enterRule(_localctx, 48, RULE_column_list);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(228);
column_name();
setState(233);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(229);
match(COMMA);
setState(230);
column_name();
}
}
setState(235);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Column_sort_listContext extends ParserRuleContext {
public List<Column_sort_nameContext> column_sort_name() {
return getRuleContexts(Column_sort_nameContext.class);
}
public Column_sort_nameContext column_sort_name(int i) {
return getRuleContext(Column_sort_nameContext.class,i);
}
public List<TerminalNode> COMMA() { return getTokens(AntlrSimpleSqlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(AntlrSimpleSqlParser.COMMA, i);
}
public Column_sort_listContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_column_sort_list; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterColumn_sort_list(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitColumn_sort_list(this);
}
}
public final Column_sort_listContext column_sort_list() throws RecognitionException {
Column_sort_listContext _localctx = new Column_sort_listContext(_ctx, getState());
enterRule(_localctx, 50, RULE_column_sort_list);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(236);
column_sort_name();
setState(241);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(237);
match(COMMA);
setState(238);
column_sort_name();
}
}
setState(243);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Rownum_expressionContext extends ParserRuleContext {
public List<Rownum_bool_primaryContext> rownum_bool_primary() {
return getRuleContexts(Rownum_bool_primaryContext.class);
}
public Rownum_bool_primaryContext rownum_bool_primary(int i) {
return getRuleContext(Rownum_bool_primaryContext.class,i);
}
public TerminalNode AND() { return getToken(AntlrSimpleSqlParser.AND, 0); }
public Rownum_expressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rownum_expression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterRownum_expression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitRownum_expression(this);
}
}
public final Rownum_expressionContext rownum_expression() throws RecognitionException {
Rownum_expressionContext _localctx = new Rownum_expressionContext(_ctx, getState());
enterRule(_localctx, 52, RULE_rownum_expression);
try {
setState(249);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(244);
rownum_bool_primary();
setState(245);
match(AND);
setState(246);
rownum_bool_primary();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(248);
rownum_bool_primary();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class Rownum_bool_primaryContext extends ParserRuleContext {
public TerminalNode ROWNUM() { return getToken(AntlrSimpleSqlParser.ROWNUM, 0); }
public Relational_opContext relational_op() {
return getRuleContext(Relational_opContext.class,0);
}
public TerminalNode INTEGER_NUM() { return getToken(AntlrSimpleSqlParser.INTEGER_NUM, 0); }
public Rownum_bool_primaryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rownum_bool_primary; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).enterRownum_bool_primary(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof AntlrSimpleSqlListener ) ((AntlrSimpleSqlListener)listener).exitRownum_bool_primary(this);
}
}
public final Rownum_bool_primaryContext rownum_bool_primary() throws RecognitionException {
Rownum_bool_primaryContext _localctx = new Rownum_bool_primaryContext(_ctx, getState());
enterRule(_localctx, 54, RULE_rownum_bool_primary);
try {
enterOuterAlt(_localctx, 1);
{
setState(251);
match(ROWNUM);
setState(252);
relational_op();
setState(253);
match(INTEGER_NUM);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static final String _serializedATN =
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3)\u0102\4\2\t\2\4"+
"\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+
"\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
"\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\3\2\3\2\3\3\3\3\3\4\5\4@\n\4"+
"\3\4\3\4\3\5\3\5\3\6\3\6\3\6\5\6I\n\6\3\7\3\7\3\7\7\7N\n\7\f\7\16\7Q\13"+
"\7\3\b\3\b\3\b\7\bV\n\b\f\b\16\bY\13\b\3\t\3\t\3\t\7\t^\n\t\f\t\16\ta"+
"\13\t\3\n\3\n\3\n\5\nf\n\n\3\13\3\13\5\13j\n\13\3\13\3\13\3\f\3\f\5\f"+
"p\n\f\3\f\3\f\5\ft\n\f\3\f\3\f\3\f\5\fy\n\f\3\f\5\f|\n\f\3\r\3\r\3\16"+
"\3\16\3\16\3\16\5\16\u0084\n\16\3\17\3\17\3\17\3\17\5\17\u008a\n\17\3"+
"\17\3\17\5\17\u008e\n\17\5\17\u0090\n\17\3\20\3\20\3\20\3\21\3\21\3\21"+
"\3\21\3\22\3\22\3\22\3\22\3\22\3\22\5\22\u009f\n\22\3\23\3\23\3\23\7\23"+
"\u00a4\n\23\f\23\16\23\u00a7\13\23\3\24\3\24\3\24\7\24\u00ac\n\24\f\24"+
"\16\24\u00af\13\24\3\25\3\25\3\25\3\25\5\25\u00b5\n\25\3\26\3\26\5\26"+
"\u00b9\n\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u00c2\n\26\3\26\3"+
"\26\3\26\3\26\3\26\5\26\u00c9\n\26\3\27\3\27\3\27\3\27\3\30\3\30\3\30"+
"\3\30\3\30\3\30\3\30\5\30\u00d6\n\30\3\30\3\30\3\30\3\30\5\30\u00dc\n"+
"\30\3\30\3\30\3\30\5\30\u00e1\n\30\3\31\3\31\3\31\3\31\3\32\3\32\3\32"+
"\7\32\u00ea\n\32\f\32\16\32\u00ed\13\32\3\33\3\33\3\33\7\33\u00f2\n\33"+
"\f\33\16\33\u00f5\13\33\3\34\3\34\3\34\3\34\3\34\5\34\u00fc\n\34\3\35"+
"\3\35\3\35\3\35\3\35\2\2\36\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \""+
"$&(*,.\60\62\64\668\2\7\3\2\25\32\3\2#$\3\2%&\3\2\n\13\3\2\16\17\2\u0107"+
"\2:\3\2\2\2\4<\3\2\2\2\6?\3\2\2\2\bC\3\2\2\2\nH\3\2\2\2\fJ\3\2\2\2\16"+
"R\3\2\2\2\20Z\3\2\2\2\22e\3\2\2\2\24g\3\2\2\2\26m\3\2\2\2\30}\3\2\2\2"+
"\32\u0083\3\2\2\2\34\u008f\3\2\2\2\36\u0091\3\2\2\2 \u0094\3\2\2\2\"\u009e"+
"\3\2\2\2$\u00a0\3\2\2\2&\u00a8\3\2\2\2(\u00b4\3\2\2\2*\u00c8\3\2\2\2,"+
"\u00ca\3\2\2\2.\u00e0\3\2\2\2\60\u00e2\3\2\2\2\62\u00e6\3\2\2\2\64\u00ee"+
"\3\2\2\2\66\u00fb\3\2\2\28\u00fd\3\2\2\2:;\t\2\2\2;\3\3\2\2\2<=\7\'\2"+
"\2=\5\3\2\2\2>@\t\3\2\2?>\3\2\2\2?@\3\2\2\2@A\3\2\2\2AB\t\4\2\2B\7\3\2"+
"\2\2CD\t\5\2\2D\t\3\2\2\2EI\5\4\3\2FI\5\6\4\2GI\5\b\5\2HE\3\2\2\2HF\3"+
"\2\2\2HG\3\2\2\2I\13\3\2\2\2JO\5\4\3\2KL\7 \2\2LN\5\4\3\2MK\3\2\2\2NQ"+
"\3\2\2\2OM\3\2\2\2OP\3\2\2\2P\r\3\2\2\2QO\3\2\2\2RW\5\6\4\2ST\7 \2\2T"+
"V\5\6\4\2US\3\2\2\2VY\3\2\2\2WU\3\2\2\2WX\3\2\2\2X\17\3\2\2\2YW\3\2\2"+
"\2Z_\5\b\5\2[\\\7 \2\2\\^\5\b\5\2][\3\2\2\2^a\3\2\2\2_]\3\2\2\2_`\3\2"+
"\2\2`\21\3\2\2\2a_\3\2\2\2bf\5\f\7\2cf\5\16\b\2df\5\20\t\2eb\3\2\2\2e"+
"c\3\2\2\2ed\3\2\2\2f\23\3\2\2\2gi\5\26\f\2hj\7!\2\2ih\3\2\2\2ij\3\2\2"+
"\2jk\3\2\2\2kl\7\2\2\3l\25\3\2\2\2mo\7\4\2\2np\7\5\2\2on\3\2\2\2op\3\2"+
"\2\2ps\3\2\2\2qt\7\34\2\2rt\5\62\32\2sq\3\2\2\2sr\3\2\2\2tu\3\2\2\2uv"+
"\7\6\2\2vx\5\30\r\2wy\5\36\20\2xw\3\2\2\2xy\3\2\2\2y{\3\2\2\2z|\5 \21"+
"\2{z\3\2\2\2{|\3\2\2\2|\27\3\2\2\2}~\7)\2\2~\31\3\2\2\2\177\u0080\7\""+
"\2\2\u0080\u0081\7(\2\2\u0081\u0084\7\"\2\2\u0082\u0084\7(\2\2\u0083\177"+
"\3\2\2\2\u0083\u0082\3\2\2\2\u0084\33\3\2\2\2\u0085\u0086\7\"\2\2\u0086"+
"\u0087\7(\2\2\u0087\u0089\7\"\2\2\u0088\u008a\t\6\2\2\u0089\u0088\3\2"+
"\2\2\u0089\u008a\3\2\2\2\u008a\u0090\3\2\2\2\u008b\u008d\7(\2\2\u008c"+
"\u008e\t\6\2\2\u008d\u008c\3\2\2\2\u008d\u008e\3\2\2\2\u008e\u0090\3\2"+
"\2\2\u008f\u0085\3\2\2\2\u008f\u008b\3\2\2\2\u0090\35\3\2\2\2\u0091\u0092"+
"\7\7\2\2\u0092\u0093\5\"\22\2\u0093\37\3\2\2\2\u0094\u0095\7\f\2\2\u0095"+
"\u0096\7\r\2\2\u0096\u0097\5\64\33\2\u0097!\3\2\2\2\u0098\u0099\5$\23"+
"\2\u0099\u009a\7\21\2\2\u009a\u009b\5\66\34\2\u009b\u009f\3\2\2\2\u009c"+
"\u009f\5\66\34\2\u009d\u009f\5$\23\2\u009e\u0098\3\2\2\2\u009e\u009c\3"+
"\2\2\2\u009e\u009d\3\2\2\2\u009f#\3\2\2\2\u00a0\u00a5\5&\24\2\u00a1\u00a2"+
"\7\20\2\2\u00a2\u00a4\5&\24\2\u00a3\u00a1\3\2\2\2\u00a4\u00a7\3\2\2\2"+
"\u00a5\u00a3\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6%\3\2\2\2\u00a7\u00a5\3"+
"\2\2\2\u00a8\u00ad\5(\25\2\u00a9\u00aa\7\21\2\2\u00aa\u00ac\5(\25\2\u00ab"+
"\u00a9\3\2\2\2\u00ac\u00af\3\2\2\2\u00ad\u00ab\3\2\2\2\u00ad\u00ae\3\2"+
"\2\2\u00ae\'\3\2\2\2\u00af\u00ad\3\2\2\2\u00b0\u00b5\5\60\31\2\u00b1\u00b5"+
"\5*\26\2\u00b2\u00b5\5.\30\2\u00b3\u00b5\5,\27\2\u00b4\u00b0\3\2\2\2\u00b4"+
"\u00b1\3\2\2\2\u00b4\u00b2\3\2\2\2\u00b4\u00b3\3\2\2\2\u00b5)\3\2\2\2"+
"\u00b6\u00b8\5\32\16\2\u00b7\u00b9\7\23\2\2\u00b8\u00b7\3\2\2\2\u00b8"+
"\u00b9\3\2\2\2\u00b9\u00ba\3\2\2\2\u00ba\u00bb\7\24\2\2\u00bb\u00bc\7"+
"\36\2\2\u00bc\u00bd\5\22\n\2\u00bd\u00be\7\35\2\2\u00be\u00c9\3\2\2\2"+
"\u00bf\u00c1\5\32\16\2\u00c0\u00c2\7\23\2\2\u00c1\u00c0\3\2\2\2\u00c1"+
"\u00c2\3\2\2\2\u00c2\u00c3\3\2\2\2\u00c3\u00c4\7\24\2\2\u00c4\u00c5\7"+
"\36\2\2\u00c5\u00c6\5\26\f\2\u00c6\u00c7\7\35\2\2\u00c7\u00c9\3\2\2\2"+
"\u00c8\u00b6\3\2\2\2\u00c8\u00bf\3\2\2\2\u00c9+\3\2\2\2\u00ca\u00cb\5"+
"\32\16\2\u00cb\u00cc\5\2\2\2\u00cc\u00cd\5\32\16\2\u00cd-\3\2\2\2\u00ce"+
"\u00cf\5\32\16\2\u00cf\u00d0\5\2\2\2\u00d0\u00d1\5\n\6\2\u00d1\u00e1\3"+
"\2\2\2\u00d2\u00d3\5\32\16\2\u00d3\u00d5\7\22\2\2\u00d4\u00d6\7\23\2\2"+
"\u00d5\u00d4\3\2\2\2\u00d5\u00d6\3\2\2\2\u00d6\u00d7\3\2\2\2\u00d7\u00d8"+
"\7\t\2\2\u00d8\u00e1\3\2\2\2\u00d9\u00db\5\32\16\2\u00da\u00dc\7\23\2"+
"\2\u00db\u00da\3\2\2\2\u00db\u00dc\3\2\2\2\u00dc\u00dd\3\2\2\2\u00dd\u00de"+
"\7\33\2\2\u00de\u00df\5\n\6\2\u00df\u00e1\3\2\2\2\u00e0\u00ce\3\2\2\2"+
"\u00e0\u00d2\3\2\2\2\u00e0\u00d9\3\2\2\2\u00e1/\3\2\2\2\u00e2\u00e3\7"+
"\36\2\2\u00e3\u00e4\5$\23\2\u00e4\u00e5\7\35\2\2\u00e5\61\3\2\2\2\u00e6"+
"\u00eb\5\32\16\2\u00e7\u00e8\7 \2\2\u00e8\u00ea\5\32\16\2\u00e9\u00e7"+
"\3\2\2\2\u00ea\u00ed\3\2\2\2\u00eb\u00e9\3\2\2\2\u00eb\u00ec\3\2\2\2\u00ec"+
"\63\3\2\2\2\u00ed\u00eb\3\2\2\2\u00ee\u00f3\5\34\17\2\u00ef\u00f0\7 \2"+
"\2\u00f0\u00f2\5\34\17\2\u00f1\u00ef\3\2\2\2\u00f2\u00f5\3\2\2\2\u00f3"+
"\u00f1\3\2\2\2\u00f3\u00f4\3\2\2\2\u00f4\65\3\2\2\2\u00f5\u00f3\3\2\2"+
"\2\u00f6\u00f7\58\35\2\u00f7\u00f8\7\21\2\2\u00f8\u00f9\58\35\2\u00f9"+
"\u00fc\3\2\2\2\u00fa\u00fc\58\35\2\u00fb\u00f6\3\2\2\2\u00fb\u00fa\3\2"+
"\2\2\u00fc\67\3\2\2\2\u00fd\u00fe\7\b\2\2\u00fe\u00ff\5\2\2\2\u00ff\u0100"+
"\7%\2\2\u01009\3\2\2\2\36?HOW_eiosx{\u0083\u0089\u008d\u008f\u009e\u00a5"+
"\u00ad\u00b4\u00b8\u00c1\u00c8\u00d5\u00db\u00e0\u00eb\u00f3\u00fb";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
}
}
}