Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.facebook.presto.sql.parser.SqlBaseParser Maven / Gradle / Ivy
// Generated from com/facebook/presto/sql/parser/SqlBase.g4 by ANTLR 4.7.1
package com.facebook.presto.sql.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 SqlBaseParser extends Parser {
static { RuntimeMetaData.checkVersion("4.7.1", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9,
ADD=10, ADMIN=11, ALL=12, ALTER=13, ANALYZE=14, AND=15, ANY=16, ARRAY=17,
AS=18, ASC=19, AT=20, BERNOULLI=21, BETWEEN=22, BY=23, CALL=24, CALLED=25,
CASCADE=26, CASE=27, CAST=28, CATALOGS=29, COLUMN=30, COLUMNS=31, COMMENT=32,
COMMIT=33, COMMITTED=34, CONSTRAINT=35, CREATE=36, CROSS=37, CUBE=38,
CURRENT=39, CURRENT_DATE=40, CURRENT_ROLE=41, CURRENT_TIME=42, CURRENT_TIMESTAMP=43,
CURRENT_USER=44, DATA=45, DATE=46, DAY=47, DEALLOCATE=48, DEFINER=49,
DELETE=50, DESC=51, DESCRIBE=52, DETERMINISTIC=53, DISTINCT=54, DISTRIBUTED=55,
DROP=56, ELSE=57, END=58, ESCAPE=59, EXCEPT=60, EXCLUDING=61, EXECUTE=62,
EXISTS=63, EXPLAIN=64, EXTRACT=65, EXTERNAL=66, FALSE=67, FILTER=68, FIRST=69,
FOLLOWING=70, FOR=71, FORMAT=72, FROM=73, FULL=74, FUNCTION=75, FUNCTIONS=76,
GRANT=77, GRANTED=78, GRANTS=79, GRAPHVIZ=80, GROUP=81, GROUPING=82, HAVING=83,
HOUR=84, IF=85, IGNORE=86, IN=87, INCLUDING=88, INNER=89, INPUT=90, INSERT=91,
INTERSECT=92, INTERVAL=93, INTO=94, INVOKER=95, IO=96, IS=97, ISOLATION=98,
JSON=99, JOIN=100, LANGUAGE=101, LAST=102, LATERAL=103, LEFT=104, LEVEL=105,
LIKE=106, LIMIT=107, LOCALTIME=108, LOCALTIMESTAMP=109, LOGICAL=110, MAP=111,
MINUTE=112, MONTH=113, NAME=114, NATURAL=115, NFC=116, NFD=117, NFKC=118,
NFKD=119, NO=120, NONE=121, NORMALIZE=122, NOT=123, NULL=124, NULLIF=125,
NULLS=126, ON=127, ONLY=128, OPTION=129, OR=130, ORDER=131, ORDINALITY=132,
OUTER=133, OUTPUT=134, OVER=135, PARTITION=136, PARTITIONS=137, POSITION=138,
PRECEDING=139, PREPARE=140, PRIVILEGES=141, PROPERTIES=142, RANGE=143,
READ=144, RECURSIVE=145, RENAME=146, REPEATABLE=147, REPLACE=148, RESET=149,
RESPECT=150, RESTRICT=151, RETURN=152, RETURNS=153, REVOKE=154, RIGHT=155,
ROLE=156, ROLES=157, ROLLBACK=158, ROLLUP=159, ROW=160, ROWS=161, SCHEMA=162,
SCHEMAS=163, SECOND=164, SECURITY=165, SELECT=166, SERIALIZABLE=167, SESSION=168,
SET=169, SETS=170, SHOW=171, SOME=172, SQL=173, START=174, STATS=175,
SUBSTRING=176, SYSTEM=177, TABLE=178, TABLES=179, TABLESAMPLE=180, TEXT=181,
THEN=182, TIME=183, TIMESTAMP=184, TO=185, TRANSACTION=186, TRUE=187,
TRY_CAST=188, TYPE=189, UESCAPE=190, UNBOUNDED=191, UNCOMMITTED=192, UNION=193,
UNNEST=194, USE=195, USER=196, USING=197, VALIDATE=198, VALUES=199, VERBOSE=200,
VIEW=201, WHEN=202, WHERE=203, WITH=204, WORK=205, WRITE=206, YEAR=207,
ZONE=208, EQ=209, NEQ=210, LT=211, LTE=212, GT=213, GTE=214, PLUS=215,
MINUS=216, ASTERISK=217, SLASH=218, PERCENT=219, CONCAT=220, STRING=221,
UNICODE_STRING=222, BINARY_LITERAL=223, INTEGER_VALUE=224, DECIMAL_VALUE=225,
DOUBLE_VALUE=226, IDENTIFIER=227, DIGIT_IDENTIFIER=228, QUOTED_IDENTIFIER=229,
BACKQUOTED_IDENTIFIER=230, TIME_WITH_TIME_ZONE=231, TIMESTAMP_WITH_TIME_ZONE=232,
DOUBLE_PRECISION=233, SIMPLE_COMMENT=234, BRACKETED_COMMENT=235, WS=236,
UNRECOGNIZED=237, DELIMITER=238;
public static final int
RULE_singleStatement = 0, RULE_standaloneExpression = 1, RULE_standaloneRoutineBody = 2,
RULE_statement = 3, RULE_query = 4, RULE_with = 5, RULE_tableElement = 6,
RULE_columnDefinition = 7, RULE_likeClause = 8, RULE_properties = 9, RULE_property = 10,
RULE_sqlParameterDeclaration = 11, RULE_routineCharacteristics = 12, RULE_routineCharacteristic = 13,
RULE_alterRoutineCharacteristics = 14, RULE_alterRoutineCharacteristic = 15,
RULE_routineBody = 16, RULE_returnStatement = 17, RULE_externalBodyReference = 18,
RULE_language = 19, RULE_determinism = 20, RULE_nullCallClause = 21, RULE_externalRoutineName = 22,
RULE_queryNoWith = 23, RULE_queryTerm = 24, RULE_queryPrimary = 25, RULE_sortItem = 26,
RULE_querySpecification = 27, RULE_groupBy = 28, RULE_groupingElement = 29,
RULE_groupingSet = 30, RULE_namedQuery = 31, RULE_setQuantifier = 32,
RULE_selectItem = 33, RULE_relation = 34, RULE_joinType = 35, RULE_joinCriteria = 36,
RULE_sampledRelation = 37, RULE_sampleType = 38, RULE_aliasedRelation = 39,
RULE_columnAliases = 40, RULE_relationPrimary = 41, RULE_expression = 42,
RULE_booleanExpression = 43, RULE_predicate = 44, RULE_valueExpression = 45,
RULE_primaryExpression = 46, RULE_string = 47, RULE_nullTreatment = 48,
RULE_timeZoneSpecifier = 49, RULE_comparisonOperator = 50, RULE_comparisonQuantifier = 51,
RULE_booleanValue = 52, RULE_interval = 53, RULE_intervalField = 54, RULE_normalForm = 55,
RULE_types = 56, RULE_type = 57, RULE_typeParameter = 58, RULE_baseType = 59,
RULE_whenClause = 60, RULE_filter = 61, RULE_over = 62, RULE_windowFrame = 63,
RULE_frameBound = 64, RULE_explainOption = 65, RULE_transactionMode = 66,
RULE_levelOfIsolation = 67, RULE_callArgument = 68, RULE_privilege = 69,
RULE_qualifiedName = 70, RULE_grantor = 71, RULE_principal = 72, RULE_roles = 73,
RULE_identifier = 74, RULE_number = 75, RULE_nonReserved = 76;
public static final String[] ruleNames = {
"singleStatement", "standaloneExpression", "standaloneRoutineBody", "statement",
"query", "with", "tableElement", "columnDefinition", "likeClause", "properties",
"property", "sqlParameterDeclaration", "routineCharacteristics", "routineCharacteristic",
"alterRoutineCharacteristics", "alterRoutineCharacteristic", "routineBody",
"returnStatement", "externalBodyReference", "language", "determinism",
"nullCallClause", "externalRoutineName", "queryNoWith", "queryTerm", "queryPrimary",
"sortItem", "querySpecification", "groupBy", "groupingElement", "groupingSet",
"namedQuery", "setQuantifier", "selectItem", "relation", "joinType", "joinCriteria",
"sampledRelation", "sampleType", "aliasedRelation", "columnAliases", "relationPrimary",
"expression", "booleanExpression", "predicate", "valueExpression", "primaryExpression",
"string", "nullTreatment", "timeZoneSpecifier", "comparisonOperator",
"comparisonQuantifier", "booleanValue", "interval", "intervalField", "normalForm",
"types", "type", "typeParameter", "baseType", "whenClause", "filter",
"over", "windowFrame", "frameBound", "explainOption", "transactionMode",
"levelOfIsolation", "callArgument", "privilege", "qualifiedName", "grantor",
"principal", "roles", "identifier", "number", "nonReserved"
};
private static final String[] _LITERAL_NAMES = {
null, "'.'", "'('", "')'", "','", "'?'", "'->'", "'['", "']'", "'=>'",
"'ADD'", "'ADMIN'", "'ALL'", "'ALTER'", "'ANALYZE'", "'AND'", "'ANY'",
"'ARRAY'", "'AS'", "'ASC'", "'AT'", "'BERNOULLI'", "'BETWEEN'", "'BY'",
"'CALL'", "'CALLED'", "'CASCADE'", "'CASE'", "'CAST'", "'CATALOGS'", "'COLUMN'",
"'COLUMNS'", "'COMMENT'", "'COMMIT'", "'COMMITTED'", "'CONSTRAINT'", "'CREATE'",
"'CROSS'", "'CUBE'", "'CURRENT'", "'CURRENT_DATE'", "'CURRENT_ROLE'",
"'CURRENT_TIME'", "'CURRENT_TIMESTAMP'", "'CURRENT_USER'", "'DATA'", "'DATE'",
"'DAY'", "'DEALLOCATE'", "'DEFINER'", "'DELETE'", "'DESC'", "'DESCRIBE'",
"'DETERMINISTIC'", "'DISTINCT'", "'DISTRIBUTED'", "'DROP'", "'ELSE'",
"'END'", "'ESCAPE'", "'EXCEPT'", "'EXCLUDING'", "'EXECUTE'", "'EXISTS'",
"'EXPLAIN'", "'EXTRACT'", "'EXTERNAL'", "'FALSE'", "'FILTER'", "'FIRST'",
"'FOLLOWING'", "'FOR'", "'FORMAT'", "'FROM'", "'FULL'", "'FUNCTION'",
"'FUNCTIONS'", "'GRANT'", "'GRANTED'", "'GRANTS'", "'GRAPHVIZ'", "'GROUP'",
"'GROUPING'", "'HAVING'", "'HOUR'", "'IF'", "'IGNORE'", "'IN'", "'INCLUDING'",
"'INNER'", "'INPUT'", "'INSERT'", "'INTERSECT'", "'INTERVAL'", "'INTO'",
"'INVOKER'", "'IO'", "'IS'", "'ISOLATION'", "'JSON'", "'JOIN'", "'LANGUAGE'",
"'LAST'", "'LATERAL'", "'LEFT'", "'LEVEL'", "'LIKE'", "'LIMIT'", "'LOCALTIME'",
"'LOCALTIMESTAMP'", "'LOGICAL'", "'MAP'", "'MINUTE'", "'MONTH'", "'NAME'",
"'NATURAL'", "'NFC'", "'NFD'", "'NFKC'", "'NFKD'", "'NO'", "'NONE'", "'NORMALIZE'",
"'NOT'", "'NULL'", "'NULLIF'", "'NULLS'", "'ON'", "'ONLY'", "'OPTION'",
"'OR'", "'ORDER'", "'ORDINALITY'", "'OUTER'", "'OUTPUT'", "'OVER'", "'PARTITION'",
"'PARTITIONS'", "'POSITION'", "'PRECEDING'", "'PREPARE'", "'PRIVILEGES'",
"'PROPERTIES'", "'RANGE'", "'READ'", "'RECURSIVE'", "'RENAME'", "'REPEATABLE'",
"'REPLACE'", "'RESET'", "'RESPECT'", "'RESTRICT'", "'RETURN'", "'RETURNS'",
"'REVOKE'", "'RIGHT'", "'ROLE'", "'ROLES'", "'ROLLBACK'", "'ROLLUP'",
"'ROW'", "'ROWS'", "'SCHEMA'", "'SCHEMAS'", "'SECOND'", "'SECURITY'",
"'SELECT'", "'SERIALIZABLE'", "'SESSION'", "'SET'", "'SETS'", "'SHOW'",
"'SOME'", "'SQL'", "'START'", "'STATS'", "'SUBSTRING'", "'SYSTEM'", "'TABLE'",
"'TABLES'", "'TABLESAMPLE'", "'TEXT'", "'THEN'", "'TIME'", "'TIMESTAMP'",
"'TO'", "'TRANSACTION'", "'TRUE'", "'TRY_CAST'", "'TYPE'", "'UESCAPE'",
"'UNBOUNDED'", "'UNCOMMITTED'", "'UNION'", "'UNNEST'", "'USE'", "'USER'",
"'USING'", "'VALIDATE'", "'VALUES'", "'VERBOSE'", "'VIEW'", "'WHEN'",
"'WHERE'", "'WITH'", "'WORK'", "'WRITE'", "'YEAR'", "'ZONE'", "'='", null,
"'<'", "'<='", "'>'", "'>='", "'+'", "'-'", "'*'", "'/'", "'%'", "'||'"
};
private static final String[] _SYMBOLIC_NAMES = {
null, null, null, null, null, null, null, null, null, null, "ADD", "ADMIN",
"ALL", "ALTER", "ANALYZE", "AND", "ANY", "ARRAY", "AS", "ASC", "AT", "BERNOULLI",
"BETWEEN", "BY", "CALL", "CALLED", "CASCADE", "CASE", "CAST", "CATALOGS",
"COLUMN", "COLUMNS", "COMMENT", "COMMIT", "COMMITTED", "CONSTRAINT", "CREATE",
"CROSS", "CUBE", "CURRENT", "CURRENT_DATE", "CURRENT_ROLE", "CURRENT_TIME",
"CURRENT_TIMESTAMP", "CURRENT_USER", "DATA", "DATE", "DAY", "DEALLOCATE",
"DEFINER", "DELETE", "DESC", "DESCRIBE", "DETERMINISTIC", "DISTINCT",
"DISTRIBUTED", "DROP", "ELSE", "END", "ESCAPE", "EXCEPT", "EXCLUDING",
"EXECUTE", "EXISTS", "EXPLAIN", "EXTRACT", "EXTERNAL", "FALSE", "FILTER",
"FIRST", "FOLLOWING", "FOR", "FORMAT", "FROM", "FULL", "FUNCTION", "FUNCTIONS",
"GRANT", "GRANTED", "GRANTS", "GRAPHVIZ", "GROUP", "GROUPING", "HAVING",
"HOUR", "IF", "IGNORE", "IN", "INCLUDING", "INNER", "INPUT", "INSERT",
"INTERSECT", "INTERVAL", "INTO", "INVOKER", "IO", "IS", "ISOLATION", "JSON",
"JOIN", "LANGUAGE", "LAST", "LATERAL", "LEFT", "LEVEL", "LIKE", "LIMIT",
"LOCALTIME", "LOCALTIMESTAMP", "LOGICAL", "MAP", "MINUTE", "MONTH", "NAME",
"NATURAL", "NFC", "NFD", "NFKC", "NFKD", "NO", "NONE", "NORMALIZE", "NOT",
"NULL", "NULLIF", "NULLS", "ON", "ONLY", "OPTION", "OR", "ORDER", "ORDINALITY",
"OUTER", "OUTPUT", "OVER", "PARTITION", "PARTITIONS", "POSITION", "PRECEDING",
"PREPARE", "PRIVILEGES", "PROPERTIES", "RANGE", "READ", "RECURSIVE", "RENAME",
"REPEATABLE", "REPLACE", "RESET", "RESPECT", "RESTRICT", "RETURN", "RETURNS",
"REVOKE", "RIGHT", "ROLE", "ROLES", "ROLLBACK", "ROLLUP", "ROW", "ROWS",
"SCHEMA", "SCHEMAS", "SECOND", "SECURITY", "SELECT", "SERIALIZABLE", "SESSION",
"SET", "SETS", "SHOW", "SOME", "SQL", "START", "STATS", "SUBSTRING", "SYSTEM",
"TABLE", "TABLES", "TABLESAMPLE", "TEXT", "THEN", "TIME", "TIMESTAMP",
"TO", "TRANSACTION", "TRUE", "TRY_CAST", "TYPE", "UESCAPE", "UNBOUNDED",
"UNCOMMITTED", "UNION", "UNNEST", "USE", "USER", "USING", "VALIDATE",
"VALUES", "VERBOSE", "VIEW", "WHEN", "WHERE", "WITH", "WORK", "WRITE",
"YEAR", "ZONE", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "PLUS", "MINUS",
"ASTERISK", "SLASH", "PERCENT", "CONCAT", "STRING", "UNICODE_STRING",
"BINARY_LITERAL", "INTEGER_VALUE", "DECIMAL_VALUE", "DOUBLE_VALUE", "IDENTIFIER",
"DIGIT_IDENTIFIER", "QUOTED_IDENTIFIER", "BACKQUOTED_IDENTIFIER", "TIME_WITH_TIME_ZONE",
"TIMESTAMP_WITH_TIME_ZONE", "DOUBLE_PRECISION", "SIMPLE_COMMENT", "BRACKETED_COMMENT",
"WS", "UNRECOGNIZED", "DELIMITER"
};
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] = "";
}
}
}
@Override
@Deprecated
public String[] getTokenNames() {
return tokenNames;
}
@Override
public Vocabulary getVocabulary() {
return VOCABULARY;
}
@Override
public String getGrammarFileName() { return "SqlBase.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
public SqlBaseParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class SingleStatementContext extends ParserRuleContext {
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public TerminalNode EOF() { return getToken(SqlBaseParser.EOF, 0); }
public SingleStatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_singleStatement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSingleStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSingleStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSingleStatement(this);
else return visitor.visitChildren(this);
}
}
public final SingleStatementContext singleStatement() throws RecognitionException {
SingleStatementContext _localctx = new SingleStatementContext(_ctx, getState());
enterRule(_localctx, 0, RULE_singleStatement);
try {
enterOuterAlt(_localctx, 1);
{
setState(154);
statement();
setState(155);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StandaloneExpressionContext extends ParserRuleContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode EOF() { return getToken(SqlBaseParser.EOF, 0); }
public StandaloneExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_standaloneExpression; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterStandaloneExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitStandaloneExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitStandaloneExpression(this);
else return visitor.visitChildren(this);
}
}
public final StandaloneExpressionContext standaloneExpression() throws RecognitionException {
StandaloneExpressionContext _localctx = new StandaloneExpressionContext(_ctx, getState());
enterRule(_localctx, 2, RULE_standaloneExpression);
try {
enterOuterAlt(_localctx, 1);
{
setState(157);
expression();
setState(158);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StandaloneRoutineBodyContext extends ParserRuleContext {
public RoutineBodyContext routineBody() {
return getRuleContext(RoutineBodyContext.class,0);
}
public TerminalNode EOF() { return getToken(SqlBaseParser.EOF, 0); }
public StandaloneRoutineBodyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_standaloneRoutineBody; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterStandaloneRoutineBody(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitStandaloneRoutineBody(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitStandaloneRoutineBody(this);
else return visitor.visitChildren(this);
}
}
public final StandaloneRoutineBodyContext standaloneRoutineBody() throws RecognitionException {
StandaloneRoutineBodyContext _localctx = new StandaloneRoutineBodyContext(_ctx, getState());
enterRule(_localctx, 4, RULE_standaloneRoutineBody);
try {
enterOuterAlt(_localctx, 1);
{
setState(160);
routineBody();
setState(161);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StatementContext extends ParserRuleContext {
public StatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_statement; }
public StatementContext() { }
public void copyFrom(StatementContext ctx) {
super.copyFrom(ctx);
}
}
public static class ExplainContext extends StatementContext {
public TerminalNode EXPLAIN() { return getToken(SqlBaseParser.EXPLAIN, 0); }
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public TerminalNode ANALYZE() { return getToken(SqlBaseParser.ANALYZE, 0); }
public TerminalNode VERBOSE() { return getToken(SqlBaseParser.VERBOSE, 0); }
public List explainOption() {
return getRuleContexts(ExplainOptionContext.class);
}
public ExplainOptionContext explainOption(int i) {
return getRuleContext(ExplainOptionContext.class,i);
}
public ExplainContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterExplain(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExplain(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExplain(this);
else return visitor.visitChildren(this);
}
}
public static class PrepareContext extends StatementContext {
public TerminalNode PREPARE() { return getToken(SqlBaseParser.PREPARE, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public PrepareContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterPrepare(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitPrepare(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitPrepare(this);
else return visitor.visitChildren(this);
}
}
public static class UseContext extends StatementContext {
public IdentifierContext schema;
public IdentifierContext catalog;
public TerminalNode USE() { return getToken(SqlBaseParser.USE, 0); }
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public UseContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterUse(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitUse(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitUse(this);
else return visitor.visitChildren(this);
}
}
public static class DeallocateContext extends StatementContext {
public TerminalNode DEALLOCATE() { return getToken(SqlBaseParser.DEALLOCATE, 0); }
public TerminalNode PREPARE() { return getToken(SqlBaseParser.PREPARE, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public DeallocateContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDeallocate(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDeallocate(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDeallocate(this);
else return visitor.visitChildren(this);
}
}
public static class RenameTableContext extends StatementContext {
public QualifiedNameContext from;
public QualifiedNameContext to;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode RENAME() { return getToken(SqlBaseParser.RENAME, 0); }
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public List qualifiedName() {
return getRuleContexts(QualifiedNameContext.class);
}
public QualifiedNameContext qualifiedName(int i) {
return getRuleContext(QualifiedNameContext.class,i);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public RenameTableContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRenameTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRenameTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRenameTable(this);
else return visitor.visitChildren(this);
}
}
public static class CommitContext extends StatementContext {
public TerminalNode COMMIT() { return getToken(SqlBaseParser.COMMIT, 0); }
public TerminalNode WORK() { return getToken(SqlBaseParser.WORK, 0); }
public CommitContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCommit(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCommit(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCommit(this);
else return visitor.visitChildren(this);
}
}
public static class CreateRoleContext extends StatementContext {
public IdentifierContext name;
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode ROLE() { return getToken(SqlBaseParser.ROLE, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public TerminalNode ADMIN() { return getToken(SqlBaseParser.ADMIN, 0); }
public GrantorContext grantor() {
return getRuleContext(GrantorContext.class,0);
}
public CreateRoleContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCreateRole(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCreateRole(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCreateRole(this);
else return visitor.visitChildren(this);
}
}
public static class ShowCreateFunctionContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode FUNCTION() { return getToken(SqlBaseParser.FUNCTION, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TypesContext types() {
return getRuleContext(TypesContext.class,0);
}
public ShowCreateFunctionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowCreateFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowCreateFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowCreateFunction(this);
else return visitor.visitChildren(this);
}
}
public static class DropColumnContext extends StatementContext {
public QualifiedNameContext tableName;
public QualifiedNameContext column;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode COLUMN() { return getToken(SqlBaseParser.COLUMN, 0); }
public List qualifiedName() {
return getRuleContexts(QualifiedNameContext.class);
}
public QualifiedNameContext qualifiedName(int i) {
return getRuleContext(QualifiedNameContext.class,i);
}
public List IF() { return getTokens(SqlBaseParser.IF); }
public TerminalNode IF(int i) {
return getToken(SqlBaseParser.IF, i);
}
public List EXISTS() { return getTokens(SqlBaseParser.EXISTS); }
public TerminalNode EXISTS(int i) {
return getToken(SqlBaseParser.EXISTS, i);
}
public DropColumnContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropColumn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropColumn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropColumn(this);
else return visitor.visitChildren(this);
}
}
public static class DropViewContext extends StatementContext {
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode VIEW() { return getToken(SqlBaseParser.VIEW, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public DropViewContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropView(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropView(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropView(this);
else return visitor.visitChildren(this);
}
}
public static class ShowTablesContext extends StatementContext {
public StringContext pattern;
public StringContext escape;
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode TABLES() { return getToken(SqlBaseParser.TABLES, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode LIKE() { return getToken(SqlBaseParser.LIKE, 0); }
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public List string() {
return getRuleContexts(StringContext.class);
}
public StringContext string(int i) {
return getRuleContext(StringContext.class,i);
}
public TerminalNode ESCAPE() { return getToken(SqlBaseParser.ESCAPE, 0); }
public ShowTablesContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowTables(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowTables(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowTables(this);
else return visitor.visitChildren(this);
}
}
public static class ShowCatalogsContext extends StatementContext {
public StringContext pattern;
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode CATALOGS() { return getToken(SqlBaseParser.CATALOGS, 0); }
public TerminalNode LIKE() { return getToken(SqlBaseParser.LIKE, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public ShowCatalogsContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowCatalogs(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowCatalogs(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowCatalogs(this);
else return visitor.visitChildren(this);
}
}
public static class ShowRolesContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode ROLES() { return getToken(SqlBaseParser.ROLES, 0); }
public TerminalNode CURRENT() { return getToken(SqlBaseParser.CURRENT, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public ShowRolesContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowRoles(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowRoles(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowRoles(this);
else return visitor.visitChildren(this);
}
}
public static class RenameColumnContext extends StatementContext {
public QualifiedNameContext tableName;
public IdentifierContext from;
public IdentifierContext to;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode RENAME() { return getToken(SqlBaseParser.RENAME, 0); }
public TerminalNode COLUMN() { return getToken(SqlBaseParser.COLUMN, 0); }
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public List IF() { return getTokens(SqlBaseParser.IF); }
public TerminalNode IF(int i) {
return getToken(SqlBaseParser.IF, i);
}
public List EXISTS() { return getTokens(SqlBaseParser.EXISTS); }
public TerminalNode EXISTS(int i) {
return getToken(SqlBaseParser.EXISTS, i);
}
public RenameColumnContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRenameColumn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRenameColumn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRenameColumn(this);
else return visitor.visitChildren(this);
}
}
public static class RevokeRolesContext extends StatementContext {
public TerminalNode REVOKE() { return getToken(SqlBaseParser.REVOKE, 0); }
public RolesContext roles() {
return getRuleContext(RolesContext.class,0);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public List principal() {
return getRuleContexts(PrincipalContext.class);
}
public PrincipalContext principal(int i) {
return getRuleContext(PrincipalContext.class,i);
}
public TerminalNode ADMIN() { return getToken(SqlBaseParser.ADMIN, 0); }
public TerminalNode OPTION() { return getToken(SqlBaseParser.OPTION, 0); }
public TerminalNode FOR() { return getToken(SqlBaseParser.FOR, 0); }
public TerminalNode GRANTED() { return getToken(SqlBaseParser.GRANTED, 0); }
public TerminalNode BY() { return getToken(SqlBaseParser.BY, 0); }
public GrantorContext grantor() {
return getRuleContext(GrantorContext.class,0);
}
public RevokeRolesContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRevokeRoles(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRevokeRoles(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRevokeRoles(this);
else return visitor.visitChildren(this);
}
}
public static class ShowCreateTableContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public ShowCreateTableContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowCreateTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowCreateTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowCreateTable(this);
else return visitor.visitChildren(this);
}
}
public static class ShowColumnsContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode COLUMNS() { return getToken(SqlBaseParser.COLUMNS, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public TerminalNode DESCRIBE() { return getToken(SqlBaseParser.DESCRIBE, 0); }
public TerminalNode DESC() { return getToken(SqlBaseParser.DESC, 0); }
public ShowColumnsContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowColumns(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowColumns(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowColumns(this);
else return visitor.visitChildren(this);
}
}
public static class ShowRoleGrantsContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode ROLE() { return getToken(SqlBaseParser.ROLE, 0); }
public TerminalNode GRANTS() { return getToken(SqlBaseParser.GRANTS, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public ShowRoleGrantsContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowRoleGrants(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowRoleGrants(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowRoleGrants(this);
else return visitor.visitChildren(this);
}
}
public static class AddColumnContext extends StatementContext {
public QualifiedNameContext tableName;
public ColumnDefinitionContext column;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode ADD() { return getToken(SqlBaseParser.ADD, 0); }
public TerminalNode COLUMN() { return getToken(SqlBaseParser.COLUMN, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public ColumnDefinitionContext columnDefinition() {
return getRuleContext(ColumnDefinitionContext.class,0);
}
public List IF() { return getTokens(SqlBaseParser.IF); }
public TerminalNode IF(int i) {
return getToken(SqlBaseParser.IF, i);
}
public List EXISTS() { return getTokens(SqlBaseParser.EXISTS); }
public TerminalNode EXISTS(int i) {
return getToken(SqlBaseParser.EXISTS, i);
}
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public AddColumnContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterAddColumn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitAddColumn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitAddColumn(this);
else return visitor.visitChildren(this);
}
}
public static class ResetSessionContext extends StatementContext {
public TerminalNode RESET() { return getToken(SqlBaseParser.RESET, 0); }
public TerminalNode SESSION() { return getToken(SqlBaseParser.SESSION, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public ResetSessionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterResetSession(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitResetSession(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitResetSession(this);
else return visitor.visitChildren(this);
}
}
public static class InsertIntoContext extends StatementContext {
public TerminalNode INSERT() { return getToken(SqlBaseParser.INSERT, 0); }
public TerminalNode INTO() { return getToken(SqlBaseParser.INTO, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public ColumnAliasesContext columnAliases() {
return getRuleContext(ColumnAliasesContext.class,0);
}
public InsertIntoContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterInsertInto(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitInsertInto(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitInsertInto(this);
else return visitor.visitChildren(this);
}
}
public static class ShowSessionContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode SESSION() { return getToken(SqlBaseParser.SESSION, 0); }
public ShowSessionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowSession(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowSession(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowSession(this);
else return visitor.visitChildren(this);
}
}
public static class CreateSchemaContext extends StatementContext {
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode SCHEMA() { return getToken(SqlBaseParser.SCHEMA, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public PropertiesContext properties() {
return getRuleContext(PropertiesContext.class,0);
}
public CreateSchemaContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCreateSchema(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCreateSchema(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCreateSchema(this);
else return visitor.visitChildren(this);
}
}
public static class ExecuteContext extends StatementContext {
public TerminalNode EXECUTE() { return getToken(SqlBaseParser.EXECUTE, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode USING() { return getToken(SqlBaseParser.USING, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public ExecuteContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterExecute(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExecute(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExecute(this);
else return visitor.visitChildren(this);
}
}
public static class RenameSchemaContext extends StatementContext {
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode SCHEMA() { return getToken(SqlBaseParser.SCHEMA, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode RENAME() { return getToken(SqlBaseParser.RENAME, 0); }
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public RenameSchemaContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRenameSchema(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRenameSchema(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRenameSchema(this);
else return visitor.visitChildren(this);
}
}
public static class DropRoleContext extends StatementContext {
public IdentifierContext name;
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode ROLE() { return getToken(SqlBaseParser.ROLE, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public DropRoleContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropRole(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropRole(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropRole(this);
else return visitor.visitChildren(this);
}
}
public static class AnalyzeContext extends StatementContext {
public TerminalNode ANALYZE() { return getToken(SqlBaseParser.ANALYZE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public PropertiesContext properties() {
return getRuleContext(PropertiesContext.class,0);
}
public AnalyzeContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterAnalyze(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitAnalyze(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitAnalyze(this);
else return visitor.visitChildren(this);
}
}
public static class SetRoleContext extends StatementContext {
public IdentifierContext role;
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode ROLE() { return getToken(SqlBaseParser.ROLE, 0); }
public TerminalNode ALL() { return getToken(SqlBaseParser.ALL, 0); }
public TerminalNode NONE() { return getToken(SqlBaseParser.NONE, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public SetRoleContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetRole(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetRole(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetRole(this);
else return visitor.visitChildren(this);
}
}
public static class CreateFunctionContext extends StatementContext {
public QualifiedNameContext functionName;
public TypeContext returnType;
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode FUNCTION() { return getToken(SqlBaseParser.FUNCTION, 0); }
public TerminalNode RETURNS() { return getToken(SqlBaseParser.RETURNS, 0); }
public RoutineCharacteristicsContext routineCharacteristics() {
return getRuleContext(RoutineCharacteristicsContext.class,0);
}
public RoutineBodyContext routineBody() {
return getRuleContext(RoutineBodyContext.class,0);
}
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode OR() { return getToken(SqlBaseParser.OR, 0); }
public TerminalNode REPLACE() { return getToken(SqlBaseParser.REPLACE, 0); }
public List sqlParameterDeclaration() {
return getRuleContexts(SqlParameterDeclarationContext.class);
}
public SqlParameterDeclarationContext sqlParameterDeclaration(int i) {
return getRuleContext(SqlParameterDeclarationContext.class,i);
}
public TerminalNode COMMENT() { return getToken(SqlBaseParser.COMMENT, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public CreateFunctionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCreateFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCreateFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCreateFunction(this);
else return visitor.visitChildren(this);
}
}
public static class ShowGrantsContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode GRANTS() { return getToken(SqlBaseParser.GRANTS, 0); }
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public ShowGrantsContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowGrants(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowGrants(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowGrants(this);
else return visitor.visitChildren(this);
}
}
public static class DropSchemaContext extends StatementContext {
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode SCHEMA() { return getToken(SqlBaseParser.SCHEMA, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public TerminalNode CASCADE() { return getToken(SqlBaseParser.CASCADE, 0); }
public TerminalNode RESTRICT() { return getToken(SqlBaseParser.RESTRICT, 0); }
public DropSchemaContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropSchema(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropSchema(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropSchema(this);
else return visitor.visitChildren(this);
}
}
public static class ShowCreateViewContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode VIEW() { return getToken(SqlBaseParser.VIEW, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public ShowCreateViewContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowCreateView(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowCreateView(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowCreateView(this);
else return visitor.visitChildren(this);
}
}
public static class CreateTableContext extends StatementContext {
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public List tableElement() {
return getRuleContexts(TableElementContext.class);
}
public TableElementContext tableElement(int i) {
return getRuleContext(TableElementContext.class,i);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public TerminalNode COMMENT() { return getToken(SqlBaseParser.COMMENT, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public PropertiesContext properties() {
return getRuleContext(PropertiesContext.class,0);
}
public CreateTableContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCreateTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCreateTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCreateTable(this);
else return visitor.visitChildren(this);
}
}
public static class StartTransactionContext extends StatementContext {
public TerminalNode START() { return getToken(SqlBaseParser.START, 0); }
public TerminalNode TRANSACTION() { return getToken(SqlBaseParser.TRANSACTION, 0); }
public List transactionMode() {
return getRuleContexts(TransactionModeContext.class);
}
public TransactionModeContext transactionMode(int i) {
return getRuleContext(TransactionModeContext.class,i);
}
public StartTransactionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterStartTransaction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitStartTransaction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitStartTransaction(this);
else return visitor.visitChildren(this);
}
}
public static class CreateTableAsSelectContext extends StatementContext {
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public ColumnAliasesContext columnAliases() {
return getRuleContext(ColumnAliasesContext.class,0);
}
public TerminalNode COMMENT() { return getToken(SqlBaseParser.COMMENT, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public List WITH() { return getTokens(SqlBaseParser.WITH); }
public TerminalNode WITH(int i) {
return getToken(SqlBaseParser.WITH, i);
}
public PropertiesContext properties() {
return getRuleContext(PropertiesContext.class,0);
}
public TerminalNode DATA() { return getToken(SqlBaseParser.DATA, 0); }
public TerminalNode NO() { return getToken(SqlBaseParser.NO, 0); }
public CreateTableAsSelectContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCreateTableAsSelect(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCreateTableAsSelect(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCreateTableAsSelect(this);
else return visitor.visitChildren(this);
}
}
public static class ShowStatsContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode STATS() { return getToken(SqlBaseParser.STATS, 0); }
public TerminalNode FOR() { return getToken(SqlBaseParser.FOR, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public ShowStatsContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowStats(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowStats(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowStats(this);
else return visitor.visitChildren(this);
}
}
public static class DropFunctionContext extends StatementContext {
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode FUNCTION() { return getToken(SqlBaseParser.FUNCTION, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public TypesContext types() {
return getRuleContext(TypesContext.class,0);
}
public DropFunctionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropFunction(this);
else return visitor.visitChildren(this);
}
}
public static class RevokeContext extends StatementContext {
public PrincipalContext grantee;
public TerminalNode REVOKE() { return getToken(SqlBaseParser.REVOKE, 0); }
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public PrincipalContext principal() {
return getRuleContext(PrincipalContext.class,0);
}
public List privilege() {
return getRuleContexts(PrivilegeContext.class);
}
public PrivilegeContext privilege(int i) {
return getRuleContext(PrivilegeContext.class,i);
}
public TerminalNode ALL() { return getToken(SqlBaseParser.ALL, 0); }
public TerminalNode PRIVILEGES() { return getToken(SqlBaseParser.PRIVILEGES, 0); }
public TerminalNode GRANT() { return getToken(SqlBaseParser.GRANT, 0); }
public TerminalNode OPTION() { return getToken(SqlBaseParser.OPTION, 0); }
public TerminalNode FOR() { return getToken(SqlBaseParser.FOR, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public RevokeContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRevoke(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRevoke(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRevoke(this);
else return visitor.visitChildren(this);
}
}
public static class DeleteContext extends StatementContext {
public TerminalNode DELETE() { return getToken(SqlBaseParser.DELETE, 0); }
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode WHERE() { return getToken(SqlBaseParser.WHERE, 0); }
public BooleanExpressionContext booleanExpression() {
return getRuleContext(BooleanExpressionContext.class,0);
}
public DeleteContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDelete(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDelete(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDelete(this);
else return visitor.visitChildren(this);
}
}
public static class DescribeInputContext extends StatementContext {
public TerminalNode DESCRIBE() { return getToken(SqlBaseParser.DESCRIBE, 0); }
public TerminalNode INPUT() { return getToken(SqlBaseParser.INPUT, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public DescribeInputContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDescribeInput(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDescribeInput(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDescribeInput(this);
else return visitor.visitChildren(this);
}
}
public static class ShowStatsForQueryContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode STATS() { return getToken(SqlBaseParser.STATS, 0); }
public TerminalNode FOR() { return getToken(SqlBaseParser.FOR, 0); }
public QuerySpecificationContext querySpecification() {
return getRuleContext(QuerySpecificationContext.class,0);
}
public ShowStatsForQueryContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowStatsForQuery(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowStatsForQuery(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowStatsForQuery(this);
else return visitor.visitChildren(this);
}
}
public static class StatementDefaultContext extends StatementContext {
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public StatementDefaultContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterStatementDefault(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitStatementDefault(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitStatementDefault(this);
else return visitor.visitChildren(this);
}
}
public static class AlterFunctionContext extends StatementContext {
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode FUNCTION() { return getToken(SqlBaseParser.FUNCTION, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public AlterRoutineCharacteristicsContext alterRoutineCharacteristics() {
return getRuleContext(AlterRoutineCharacteristicsContext.class,0);
}
public TypesContext types() {
return getRuleContext(TypesContext.class,0);
}
public AlterFunctionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterAlterFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitAlterFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitAlterFunction(this);
else return visitor.visitChildren(this);
}
}
public static class SetSessionContext extends StatementContext {
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode SESSION() { return getToken(SqlBaseParser.SESSION, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode EQ() { return getToken(SqlBaseParser.EQ, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public SetSessionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetSession(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetSession(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetSession(this);
else return visitor.visitChildren(this);
}
}
public static class CreateViewContext extends StatementContext {
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode VIEW() { return getToken(SqlBaseParser.VIEW, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public TerminalNode OR() { return getToken(SqlBaseParser.OR, 0); }
public TerminalNode REPLACE() { return getToken(SqlBaseParser.REPLACE, 0); }
public TerminalNode SECURITY() { return getToken(SqlBaseParser.SECURITY, 0); }
public TerminalNode DEFINER() { return getToken(SqlBaseParser.DEFINER, 0); }
public TerminalNode INVOKER() { return getToken(SqlBaseParser.INVOKER, 0); }
public CreateViewContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCreateView(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCreateView(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCreateView(this);
else return visitor.visitChildren(this);
}
}
public static class ShowSchemasContext extends StatementContext {
public StringContext pattern;
public StringContext escape;
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode SCHEMAS() { return getToken(SqlBaseParser.SCHEMAS, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode LIKE() { return getToken(SqlBaseParser.LIKE, 0); }
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public List string() {
return getRuleContexts(StringContext.class);
}
public StringContext string(int i) {
return getRuleContext(StringContext.class,i);
}
public TerminalNode ESCAPE() { return getToken(SqlBaseParser.ESCAPE, 0); }
public ShowSchemasContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowSchemas(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowSchemas(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowSchemas(this);
else return visitor.visitChildren(this);
}
}
public static class DropTableContext extends StatementContext {
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public DropTableContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropTable(this);
else return visitor.visitChildren(this);
}
}
public static class RollbackContext extends StatementContext {
public TerminalNode ROLLBACK() { return getToken(SqlBaseParser.ROLLBACK, 0); }
public TerminalNode WORK() { return getToken(SqlBaseParser.WORK, 0); }
public RollbackContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRollback(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRollback(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRollback(this);
else return visitor.visitChildren(this);
}
}
public static class GrantRolesContext extends StatementContext {
public TerminalNode GRANT() { return getToken(SqlBaseParser.GRANT, 0); }
public RolesContext roles() {
return getRuleContext(RolesContext.class,0);
}
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public List principal() {
return getRuleContexts(PrincipalContext.class);
}
public PrincipalContext principal(int i) {
return getRuleContext(PrincipalContext.class,i);
}
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public TerminalNode ADMIN() { return getToken(SqlBaseParser.ADMIN, 0); }
public TerminalNode OPTION() { return getToken(SqlBaseParser.OPTION, 0); }
public TerminalNode GRANTED() { return getToken(SqlBaseParser.GRANTED, 0); }
public TerminalNode BY() { return getToken(SqlBaseParser.BY, 0); }
public GrantorContext grantor() {
return getRuleContext(GrantorContext.class,0);
}
public GrantRolesContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterGrantRoles(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitGrantRoles(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitGrantRoles(this);
else return visitor.visitChildren(this);
}
}
public static class CallContext extends StatementContext {
public TerminalNode CALL() { return getToken(SqlBaseParser.CALL, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public List callArgument() {
return getRuleContexts(CallArgumentContext.class);
}
public CallArgumentContext callArgument(int i) {
return getRuleContext(CallArgumentContext.class,i);
}
public CallContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCall(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCall(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCall(this);
else return visitor.visitChildren(this);
}
}
public static class ShowFunctionsContext extends StatementContext {
public StringContext pattern;
public StringContext escape;
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode FUNCTIONS() { return getToken(SqlBaseParser.FUNCTIONS, 0); }
public TerminalNode LIKE() { return getToken(SqlBaseParser.LIKE, 0); }
public List string() {
return getRuleContexts(StringContext.class);
}
public StringContext string(int i) {
return getRuleContext(StringContext.class,i);
}
public TerminalNode ESCAPE() { return getToken(SqlBaseParser.ESCAPE, 0); }
public ShowFunctionsContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class DescribeOutputContext extends StatementContext {
public TerminalNode DESCRIBE() { return getToken(SqlBaseParser.DESCRIBE, 0); }
public TerminalNode OUTPUT() { return getToken(SqlBaseParser.OUTPUT, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public DescribeOutputContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDescribeOutput(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDescribeOutput(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDescribeOutput(this);
else return visitor.visitChildren(this);
}
}
public static class GrantContext extends StatementContext {
public PrincipalContext grantee;
public List GRANT() { return getTokens(SqlBaseParser.GRANT); }
public TerminalNode GRANT(int i) {
return getToken(SqlBaseParser.GRANT, i);
}
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public PrincipalContext principal() {
return getRuleContext(PrincipalContext.class,0);
}
public List privilege() {
return getRuleContexts(PrivilegeContext.class);
}
public PrivilegeContext privilege(int i) {
return getRuleContext(PrivilegeContext.class,i);
}
public TerminalNode ALL() { return getToken(SqlBaseParser.ALL, 0); }
public TerminalNode PRIVILEGES() { return getToken(SqlBaseParser.PRIVILEGES, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public TerminalNode OPTION() { return getToken(SqlBaseParser.OPTION, 0); }
public GrantContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterGrant(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitGrant(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitGrant(this);
else return visitor.visitChildren(this);
}
}
public final StatementContext statement() throws RecognitionException {
StatementContext _localctx = new StatementContext(_ctx, getState());
enterRule(_localctx, 6, RULE_statement);
int _la;
try {
setState(722);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,79,_ctx) ) {
case 1:
_localctx = new StatementDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(163);
query();
}
break;
case 2:
_localctx = new UseContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(164);
match(USE);
setState(165);
((UseContext)_localctx).schema = identifier();
}
break;
case 3:
_localctx = new UseContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(166);
match(USE);
setState(167);
((UseContext)_localctx).catalog = identifier();
setState(168);
match(T__0);
setState(169);
((UseContext)_localctx).schema = identifier();
}
break;
case 4:
_localctx = new CreateSchemaContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(171);
match(CREATE);
setState(172);
match(SCHEMA);
setState(176);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) {
case 1:
{
setState(173);
match(IF);
setState(174);
match(NOT);
setState(175);
match(EXISTS);
}
break;
}
setState(178);
qualifiedName();
setState(181);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(179);
match(WITH);
setState(180);
properties();
}
}
}
break;
case 5:
_localctx = new DropSchemaContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(183);
match(DROP);
setState(184);
match(SCHEMA);
setState(187);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) {
case 1:
{
setState(185);
match(IF);
setState(186);
match(EXISTS);
}
break;
}
setState(189);
qualifiedName();
setState(191);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CASCADE || _la==RESTRICT) {
{
setState(190);
_la = _input.LA(1);
if ( !(_la==CASCADE || _la==RESTRICT) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
}
break;
case 6:
_localctx = new RenameSchemaContext(_localctx);
enterOuterAlt(_localctx, 6);
{
setState(193);
match(ALTER);
setState(194);
match(SCHEMA);
setState(195);
qualifiedName();
setState(196);
match(RENAME);
setState(197);
match(TO);
setState(198);
identifier();
}
break;
case 7:
_localctx = new CreateTableAsSelectContext(_localctx);
enterOuterAlt(_localctx, 7);
{
setState(200);
match(CREATE);
setState(201);
match(TABLE);
setState(205);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
case 1:
{
setState(202);
match(IF);
setState(203);
match(NOT);
setState(204);
match(EXISTS);
}
break;
}
setState(207);
qualifiedName();
setState(209);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(208);
columnAliases();
}
}
setState(213);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(211);
match(COMMENT);
setState(212);
string();
}
}
setState(217);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(215);
match(WITH);
setState(216);
properties();
}
}
setState(219);
match(AS);
setState(225);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,8,_ctx) ) {
case 1:
{
setState(220);
query();
}
break;
case 2:
{
setState(221);
match(T__1);
setState(222);
query();
setState(223);
match(T__2);
}
break;
}
setState(232);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(227);
match(WITH);
setState(229);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NO) {
{
setState(228);
match(NO);
}
}
setState(231);
match(DATA);
}
}
}
break;
case 8:
_localctx = new CreateTableContext(_localctx);
enterOuterAlt(_localctx, 8);
{
setState(234);
match(CREATE);
setState(235);
match(TABLE);
setState(239);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) {
case 1:
{
setState(236);
match(IF);
setState(237);
match(NOT);
setState(238);
match(EXISTS);
}
break;
}
setState(241);
qualifiedName();
setState(242);
match(T__1);
setState(243);
tableElement();
setState(248);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(244);
match(T__3);
setState(245);
tableElement();
}
}
setState(250);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(251);
match(T__2);
setState(254);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(252);
match(COMMENT);
setState(253);
string();
}
}
setState(258);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(256);
match(WITH);
setState(257);
properties();
}
}
}
break;
case 9:
_localctx = new DropTableContext(_localctx);
enterOuterAlt(_localctx, 9);
{
setState(260);
match(DROP);
setState(261);
match(TABLE);
setState(264);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) {
case 1:
{
setState(262);
match(IF);
setState(263);
match(EXISTS);
}
break;
}
setState(266);
qualifiedName();
}
break;
case 10:
_localctx = new InsertIntoContext(_localctx);
enterOuterAlt(_localctx, 10);
{
setState(267);
match(INSERT);
setState(268);
match(INTO);
setState(269);
qualifiedName();
setState(271);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) {
case 1:
{
setState(270);
columnAliases();
}
break;
}
setState(273);
query();
}
break;
case 11:
_localctx = new DeleteContext(_localctx);
enterOuterAlt(_localctx, 11);
{
setState(275);
match(DELETE);
setState(276);
match(FROM);
setState(277);
qualifiedName();
setState(280);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHERE) {
{
setState(278);
match(WHERE);
setState(279);
booleanExpression(0);
}
}
}
break;
case 12:
_localctx = new RenameTableContext(_localctx);
enterOuterAlt(_localctx, 12);
{
setState(282);
match(ALTER);
setState(283);
match(TABLE);
setState(286);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) {
case 1:
{
setState(284);
match(IF);
setState(285);
match(EXISTS);
}
break;
}
setState(288);
((RenameTableContext)_localctx).from = qualifiedName();
setState(289);
match(RENAME);
setState(290);
match(TO);
setState(291);
((RenameTableContext)_localctx).to = qualifiedName();
}
break;
case 13:
_localctx = new RenameColumnContext(_localctx);
enterOuterAlt(_localctx, 13);
{
setState(293);
match(ALTER);
setState(294);
match(TABLE);
setState(297);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) {
case 1:
{
setState(295);
match(IF);
setState(296);
match(EXISTS);
}
break;
}
setState(299);
((RenameColumnContext)_localctx).tableName = qualifiedName();
setState(300);
match(RENAME);
setState(301);
match(COLUMN);
setState(304);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) {
case 1:
{
setState(302);
match(IF);
setState(303);
match(EXISTS);
}
break;
}
setState(306);
((RenameColumnContext)_localctx).from = identifier();
setState(307);
match(TO);
setState(308);
((RenameColumnContext)_localctx).to = identifier();
}
break;
case 14:
_localctx = new DropColumnContext(_localctx);
enterOuterAlt(_localctx, 14);
{
setState(310);
match(ALTER);
setState(311);
match(TABLE);
setState(314);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) {
case 1:
{
setState(312);
match(IF);
setState(313);
match(EXISTS);
}
break;
}
setState(316);
((DropColumnContext)_localctx).tableName = qualifiedName();
setState(317);
match(DROP);
setState(318);
match(COLUMN);
setState(321);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) {
case 1:
{
setState(319);
match(IF);
setState(320);
match(EXISTS);
}
break;
}
setState(323);
((DropColumnContext)_localctx).column = qualifiedName();
}
break;
case 15:
_localctx = new AddColumnContext(_localctx);
enterOuterAlt(_localctx, 15);
{
setState(325);
match(ALTER);
setState(326);
match(TABLE);
setState(329);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) {
case 1:
{
setState(327);
match(IF);
setState(328);
match(EXISTS);
}
break;
}
setState(331);
((AddColumnContext)_localctx).tableName = qualifiedName();
setState(332);
match(ADD);
setState(333);
match(COLUMN);
setState(337);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
case 1:
{
setState(334);
match(IF);
setState(335);
match(NOT);
setState(336);
match(EXISTS);
}
break;
}
setState(339);
((AddColumnContext)_localctx).column = columnDefinition();
}
break;
case 16:
_localctx = new AnalyzeContext(_localctx);
enterOuterAlt(_localctx, 16);
{
setState(341);
match(ANALYZE);
setState(342);
qualifiedName();
setState(345);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(343);
match(WITH);
setState(344);
properties();
}
}
}
break;
case 17:
_localctx = new CreateViewContext(_localctx);
enterOuterAlt(_localctx, 17);
{
setState(347);
match(CREATE);
setState(350);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OR) {
{
setState(348);
match(OR);
setState(349);
match(REPLACE);
}
}
setState(352);
match(VIEW);
setState(353);
qualifiedName();
setState(356);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SECURITY) {
{
setState(354);
match(SECURITY);
setState(355);
_la = _input.LA(1);
if ( !(_la==DEFINER || _la==INVOKER) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(358);
match(AS);
setState(359);
query();
}
break;
case 18:
_localctx = new DropViewContext(_localctx);
enterOuterAlt(_localctx, 18);
{
setState(361);
match(DROP);
setState(362);
match(VIEW);
setState(365);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) {
case 1:
{
setState(363);
match(IF);
setState(364);
match(EXISTS);
}
break;
}
setState(367);
qualifiedName();
}
break;
case 19:
_localctx = new CreateFunctionContext(_localctx);
enterOuterAlt(_localctx, 19);
{
setState(368);
match(CREATE);
setState(371);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OR) {
{
setState(369);
match(OR);
setState(370);
match(REPLACE);
}
}
setState(373);
match(FUNCTION);
setState(374);
((CreateFunctionContext)_localctx).functionName = qualifiedName();
setState(375);
match(T__1);
setState(384);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ADD) | (1L << ADMIN) | (1L << ALL) | (1L << ANALYZE) | (1L << ANY) | (1L << ARRAY) | (1L << ASC) | (1L << AT) | (1L << BERNOULLI) | (1L << CALL) | (1L << CALLED) | (1L << CASCADE) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_ROLE) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DETERMINISTIC) | (1L << DISTRIBUTED) | (1L << EXCLUDING))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXPLAIN - 64)) | (1L << (EXTERNAL - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 64)) | (1L << (FUNCTION - 64)) | (1L << (FUNCTIONS - 64)) | (1L << (GRANT - 64)) | (1L << (GRANTED - 64)) | (1L << (GRANTS - 64)) | (1L << (GRAPHVIZ - 64)) | (1L << (HOUR - 64)) | (1L << (IF - 64)) | (1L << (IGNORE - 64)) | (1L << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 64)) | (1L << (LANGUAGE - 64)) | (1L << (LAST - 64)) | (1L << (LATERAL - 64)) | (1L << (LEVEL - 64)) | (1L << (LIMIT - 64)) | (1L << (LOGICAL - 64)) | (1L << (MAP - 64)) | (1L << (MINUTE - 64)) | (1L << (MONTH - 64)) | (1L << (NAME - 64)) | (1L << (NFC - 64)) | (1L << (NFD - 64)) | (1L << (NFKC - 64)) | (1L << (NFKD - 64)) | (1L << (NO - 64)) | (1L << (NONE - 64)) | (1L << (NULLIF - 64)) | (1L << (NULLS - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (ONLY - 128)) | (1L << (OPTION - 128)) | (1L << (ORDINALITY - 128)) | (1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (POSITION - 128)) | (1L << (PRECEDING - 128)) | (1L << (PRIVILEGES - 128)) | (1L << (PROPERTIES - 128)) | (1L << (RANGE - 128)) | (1L << (READ - 128)) | (1L << (RENAME - 128)) | (1L << (REPEATABLE - 128)) | (1L << (REPLACE - 128)) | (1L << (RESET - 128)) | (1L << (RESPECT - 128)) | (1L << (RESTRICT - 128)) | (1L << (RETURN - 128)) | (1L << (RETURNS - 128)) | (1L << (REVOKE - 128)) | (1L << (ROLE - 128)) | (1L << (ROLES - 128)) | (1L << (ROLLBACK - 128)) | (1L << (ROW - 128)) | (1L << (ROWS - 128)) | (1L << (SCHEMA - 128)) | (1L << (SCHEMAS - 128)) | (1L << (SECOND - 128)) | (1L << (SECURITY - 128)) | (1L << (SERIALIZABLE - 128)) | (1L << (SESSION - 128)) | (1L << (SET - 128)) | (1L << (SETS - 128)) | (1L << (SHOW - 128)) | (1L << (SOME - 128)) | (1L << (SQL - 128)) | (1L << (START - 128)) | (1L << (STATS - 128)) | (1L << (SUBSTRING - 128)) | (1L << (SYSTEM - 128)) | (1L << (TABLES - 128)) | (1L << (TABLESAMPLE - 128)) | (1L << (TEXT - 128)) | (1L << (TIME - 128)) | (1L << (TIMESTAMP - 128)) | (1L << (TO - 128)) | (1L << (TRANSACTION - 128)) | (1L << (TRY_CAST - 128)) | (1L << (TYPE - 128)) | (1L << (UNBOUNDED - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & ((1L << (UNCOMMITTED - 192)) | (1L << (USE - 192)) | (1L << (USER - 192)) | (1L << (VALIDATE - 192)) | (1L << (VERBOSE - 192)) | (1L << (VIEW - 192)) | (1L << (WORK - 192)) | (1L << (WRITE - 192)) | (1L << (YEAR - 192)) | (1L << (ZONE - 192)) | (1L << (IDENTIFIER - 192)) | (1L << (DIGIT_IDENTIFIER - 192)) | (1L << (QUOTED_IDENTIFIER - 192)) | (1L << (BACKQUOTED_IDENTIFIER - 192)))) != 0)) {
{
setState(376);
sqlParameterDeclaration();
setState(381);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(377);
match(T__3);
setState(378);
sqlParameterDeclaration();
}
}
setState(383);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(386);
match(T__2);
setState(387);
match(RETURNS);
setState(388);
((CreateFunctionContext)_localctx).returnType = type(0);
setState(391);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(389);
match(COMMENT);
setState(390);
string();
}
}
setState(393);
routineCharacteristics();
setState(394);
routineBody();
}
break;
case 20:
_localctx = new AlterFunctionContext(_localctx);
enterOuterAlt(_localctx, 20);
{
setState(396);
match(ALTER);
setState(397);
match(FUNCTION);
setState(398);
qualifiedName();
setState(400);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(399);
types();
}
}
setState(402);
alterRoutineCharacteristics();
}
break;
case 21:
_localctx = new DropFunctionContext(_localctx);
enterOuterAlt(_localctx, 21);
{
setState(404);
match(DROP);
setState(405);
match(FUNCTION);
setState(408);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) {
case 1:
{
setState(406);
match(IF);
setState(407);
match(EXISTS);
}
break;
}
setState(410);
qualifiedName();
setState(412);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(411);
types();
}
}
}
break;
case 22:
_localctx = new CallContext(_localctx);
enterOuterAlt(_localctx, 22);
{
setState(414);
match(CALL);
setState(415);
qualifiedName();
setState(416);
match(T__1);
setState(425);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__4) | (1L << ADD) | (1L << ADMIN) | (1L << ALL) | (1L << ANALYZE) | (1L << ANY) | (1L << ARRAY) | (1L << ASC) | (1L << AT) | (1L << BERNOULLI) | (1L << CALL) | (1L << CALLED) | (1L << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_ROLE) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DETERMINISTIC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXPLAIN - 64)) | (1L << (EXTRACT - 64)) | (1L << (EXTERNAL - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 64)) | (1L << (FUNCTION - 64)) | (1L << (FUNCTIONS - 64)) | (1L << (GRANT - 64)) | (1L << (GRANTED - 64)) | (1L << (GRANTS - 64)) | (1L << (GRAPHVIZ - 64)) | (1L << (GROUPING - 64)) | (1L << (HOUR - 64)) | (1L << (IF - 64)) | (1L << (IGNORE - 64)) | (1L << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 64)) | (1L << (LANGUAGE - 64)) | (1L << (LAST - 64)) | (1L << (LATERAL - 64)) | (1L << (LEVEL - 64)) | (1L << (LIMIT - 64)) | (1L << (LOCALTIME - 64)) | (1L << (LOCALTIMESTAMP - 64)) | (1L << (LOGICAL - 64)) | (1L << (MAP - 64)) | (1L << (MINUTE - 64)) | (1L << (MONTH - 64)) | (1L << (NAME - 64)) | (1L << (NFC - 64)) | (1L << (NFD - 64)) | (1L << (NFKC - 64)) | (1L << (NFKD - 64)) | (1L << (NO - 64)) | (1L << (NONE - 64)) | (1L << (NORMALIZE - 64)) | (1L << (NOT - 64)) | (1L << (NULL - 64)) | (1L << (NULLIF - 64)) | (1L << (NULLS - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (ONLY - 128)) | (1L << (OPTION - 128)) | (1L << (ORDINALITY - 128)) | (1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (POSITION - 128)) | (1L << (PRECEDING - 128)) | (1L << (PRIVILEGES - 128)) | (1L << (PROPERTIES - 128)) | (1L << (RANGE - 128)) | (1L << (READ - 128)) | (1L << (RENAME - 128)) | (1L << (REPEATABLE - 128)) | (1L << (REPLACE - 128)) | (1L << (RESET - 128)) | (1L << (RESPECT - 128)) | (1L << (RESTRICT - 128)) | (1L << (RETURN - 128)) | (1L << (RETURNS - 128)) | (1L << (REVOKE - 128)) | (1L << (ROLE - 128)) | (1L << (ROLES - 128)) | (1L << (ROLLBACK - 128)) | (1L << (ROW - 128)) | (1L << (ROWS - 128)) | (1L << (SCHEMA - 128)) | (1L << (SCHEMAS - 128)) | (1L << (SECOND - 128)) | (1L << (SECURITY - 128)) | (1L << (SERIALIZABLE - 128)) | (1L << (SESSION - 128)) | (1L << (SET - 128)) | (1L << (SETS - 128)) | (1L << (SHOW - 128)) | (1L << (SOME - 128)) | (1L << (SQL - 128)) | (1L << (START - 128)) | (1L << (STATS - 128)) | (1L << (SUBSTRING - 128)) | (1L << (SYSTEM - 128)) | (1L << (TABLES - 128)) | (1L << (TABLESAMPLE - 128)) | (1L << (TEXT - 128)) | (1L << (TIME - 128)) | (1L << (TIMESTAMP - 128)) | (1L << (TO - 128)) | (1L << (TRANSACTION - 128)) | (1L << (TRUE - 128)) | (1L << (TRY_CAST - 128)) | (1L << (TYPE - 128)) | (1L << (UNBOUNDED - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & ((1L << (UNCOMMITTED - 192)) | (1L << (USE - 192)) | (1L << (USER - 192)) | (1L << (VALIDATE - 192)) | (1L << (VERBOSE - 192)) | (1L << (VIEW - 192)) | (1L << (WORK - 192)) | (1L << (WRITE - 192)) | (1L << (YEAR - 192)) | (1L << (ZONE - 192)) | (1L << (PLUS - 192)) | (1L << (MINUS - 192)) | (1L << (STRING - 192)) | (1L << (UNICODE_STRING - 192)) | (1L << (BINARY_LITERAL - 192)) | (1L << (INTEGER_VALUE - 192)) | (1L << (DECIMAL_VALUE - 192)) | (1L << (DOUBLE_VALUE - 192)) | (1L << (IDENTIFIER - 192)) | (1L << (DIGIT_IDENTIFIER - 192)) | (1L << (QUOTED_IDENTIFIER - 192)) | (1L << (BACKQUOTED_IDENTIFIER - 192)) | (1L << (DOUBLE_PRECISION - 192)))) != 0)) {
{
setState(417);
callArgument();
setState(422);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(418);
match(T__3);
setState(419);
callArgument();
}
}
setState(424);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(427);
match(T__2);
}
break;
case 23:
_localctx = new CreateRoleContext(_localctx);
enterOuterAlt(_localctx, 23);
{
setState(429);
match(CREATE);
setState(430);
match(ROLE);
setState(431);
((CreateRoleContext)_localctx).name = identifier();
setState(435);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(432);
match(WITH);
setState(433);
match(ADMIN);
setState(434);
grantor();
}
}
}
break;
case 24:
_localctx = new DropRoleContext(_localctx);
enterOuterAlt(_localctx, 24);
{
setState(437);
match(DROP);
setState(438);
match(ROLE);
setState(439);
((DropRoleContext)_localctx).name = identifier();
}
break;
case 25:
_localctx = new GrantRolesContext(_localctx);
enterOuterAlt(_localctx, 25);
{
setState(440);
match(GRANT);
setState(441);
roles();
setState(442);
match(TO);
setState(443);
principal();
setState(448);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(444);
match(T__3);
setState(445);
principal();
}
}
setState(450);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(454);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(451);
match(WITH);
setState(452);
match(ADMIN);
setState(453);
match(OPTION);
}
}
setState(459);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GRANTED) {
{
setState(456);
match(GRANTED);
setState(457);
match(BY);
setState(458);
grantor();
}
}
}
break;
case 26:
_localctx = new RevokeRolesContext(_localctx);
enterOuterAlt(_localctx, 26);
{
setState(461);
match(REVOKE);
setState(465);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,42,_ctx) ) {
case 1:
{
setState(462);
match(ADMIN);
setState(463);
match(OPTION);
setState(464);
match(FOR);
}
break;
}
setState(467);
roles();
setState(468);
match(FROM);
setState(469);
principal();
setState(474);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(470);
match(T__3);
setState(471);
principal();
}
}
setState(476);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(480);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GRANTED) {
{
setState(477);
match(GRANTED);
setState(478);
match(BY);
setState(479);
grantor();
}
}
}
break;
case 27:
_localctx = new SetRoleContext(_localctx);
enterOuterAlt(_localctx, 27);
{
setState(482);
match(SET);
setState(483);
match(ROLE);
setState(487);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,45,_ctx) ) {
case 1:
{
setState(484);
match(ALL);
}
break;
case 2:
{
setState(485);
match(NONE);
}
break;
case 3:
{
setState(486);
((SetRoleContext)_localctx).role = identifier();
}
break;
}
}
break;
case 28:
_localctx = new GrantContext(_localctx);
enterOuterAlt(_localctx, 28);
{
setState(489);
match(GRANT);
setState(500);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,47,_ctx) ) {
case 1:
{
setState(490);
privilege();
setState(495);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(491);
match(T__3);
setState(492);
privilege();
}
}
setState(497);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case 2:
{
setState(498);
match(ALL);
setState(499);
match(PRIVILEGES);
}
break;
}
setState(502);
match(ON);
setState(504);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==TABLE) {
{
setState(503);
match(TABLE);
}
}
setState(506);
qualifiedName();
setState(507);
match(TO);
setState(508);
((GrantContext)_localctx).grantee = principal();
setState(512);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(509);
match(WITH);
setState(510);
match(GRANT);
setState(511);
match(OPTION);
}
}
}
break;
case 29:
_localctx = new RevokeContext(_localctx);
enterOuterAlt(_localctx, 29);
{
setState(514);
match(REVOKE);
setState(518);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,50,_ctx) ) {
case 1:
{
setState(515);
match(GRANT);
setState(516);
match(OPTION);
setState(517);
match(FOR);
}
break;
}
setState(530);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,52,_ctx) ) {
case 1:
{
setState(520);
privilege();
setState(525);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(521);
match(T__3);
setState(522);
privilege();
}
}
setState(527);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case 2:
{
setState(528);
match(ALL);
setState(529);
match(PRIVILEGES);
}
break;
}
setState(532);
match(ON);
setState(534);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==TABLE) {
{
setState(533);
match(TABLE);
}
}
setState(536);
qualifiedName();
setState(537);
match(FROM);
setState(538);
((RevokeContext)_localctx).grantee = principal();
}
break;
case 30:
_localctx = new ShowGrantsContext(_localctx);
enterOuterAlt(_localctx, 30);
{
setState(540);
match(SHOW);
setState(541);
match(GRANTS);
setState(547);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ON) {
{
setState(542);
match(ON);
setState(544);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==TABLE) {
{
setState(543);
match(TABLE);
}
}
setState(546);
qualifiedName();
}
}
}
break;
case 31:
_localctx = new ExplainContext(_localctx);
enterOuterAlt(_localctx, 31);
{
setState(549);
match(EXPLAIN);
setState(551);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,56,_ctx) ) {
case 1:
{
setState(550);
match(ANALYZE);
}
break;
}
setState(554);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==VERBOSE) {
{
setState(553);
match(VERBOSE);
}
}
setState(567);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,59,_ctx) ) {
case 1:
{
setState(556);
match(T__1);
setState(557);
explainOption();
setState(562);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(558);
match(T__3);
setState(559);
explainOption();
}
}
setState(564);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(565);
match(T__2);
}
break;
}
setState(569);
statement();
}
break;
case 32:
_localctx = new ShowCreateTableContext(_localctx);
enterOuterAlt(_localctx, 32);
{
setState(570);
match(SHOW);
setState(571);
match(CREATE);
setState(572);
match(TABLE);
setState(573);
qualifiedName();
}
break;
case 33:
_localctx = new ShowCreateViewContext(_localctx);
enterOuterAlt(_localctx, 33);
{
setState(574);
match(SHOW);
setState(575);
match(CREATE);
setState(576);
match(VIEW);
setState(577);
qualifiedName();
}
break;
case 34:
_localctx = new ShowCreateFunctionContext(_localctx);
enterOuterAlt(_localctx, 34);
{
setState(578);
match(SHOW);
setState(579);
match(CREATE);
setState(580);
match(FUNCTION);
setState(581);
qualifiedName();
setState(583);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(582);
types();
}
}
}
break;
case 35:
_localctx = new ShowTablesContext(_localctx);
enterOuterAlt(_localctx, 35);
{
setState(585);
match(SHOW);
setState(586);
match(TABLES);
setState(589);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(587);
_la = _input.LA(1);
if ( !(_la==FROM || _la==IN) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(588);
qualifiedName();
}
}
setState(597);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(591);
match(LIKE);
setState(592);
((ShowTablesContext)_localctx).pattern = string();
setState(595);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(593);
match(ESCAPE);
setState(594);
((ShowTablesContext)_localctx).escape = string();
}
}
}
}
}
break;
case 36:
_localctx = new ShowSchemasContext(_localctx);
enterOuterAlt(_localctx, 36);
{
setState(599);
match(SHOW);
setState(600);
match(SCHEMAS);
setState(603);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(601);
_la = _input.LA(1);
if ( !(_la==FROM || _la==IN) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(602);
identifier();
}
}
setState(611);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(605);
match(LIKE);
setState(606);
((ShowSchemasContext)_localctx).pattern = string();
setState(609);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(607);
match(ESCAPE);
setState(608);
((ShowSchemasContext)_localctx).escape = string();
}
}
}
}
}
break;
case 37:
_localctx = new ShowCatalogsContext(_localctx);
enterOuterAlt(_localctx, 37);
{
setState(613);
match(SHOW);
setState(614);
match(CATALOGS);
setState(617);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(615);
match(LIKE);
setState(616);
((ShowCatalogsContext)_localctx).pattern = string();
}
}
}
break;
case 38:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 38);
{
setState(619);
match(SHOW);
setState(620);
match(COLUMNS);
setState(621);
_la = _input.LA(1);
if ( !(_la==FROM || _la==IN) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(622);
qualifiedName();
}
break;
case 39:
_localctx = new ShowStatsContext(_localctx);
enterOuterAlt(_localctx, 39);
{
setState(623);
match(SHOW);
setState(624);
match(STATS);
setState(625);
match(FOR);
setState(626);
qualifiedName();
}
break;
case 40:
_localctx = new ShowStatsForQueryContext(_localctx);
enterOuterAlt(_localctx, 40);
{
setState(627);
match(SHOW);
setState(628);
match(STATS);
setState(629);
match(FOR);
setState(630);
match(T__1);
setState(631);
querySpecification();
setState(632);
match(T__2);
}
break;
case 41:
_localctx = new ShowRolesContext(_localctx);
enterOuterAlt(_localctx, 41);
{
setState(634);
match(SHOW);
setState(636);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CURRENT) {
{
setState(635);
match(CURRENT);
}
}
setState(638);
match(ROLES);
setState(641);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(639);
_la = _input.LA(1);
if ( !(_la==FROM || _la==IN) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(640);
identifier();
}
}
}
break;
case 42:
_localctx = new ShowRoleGrantsContext(_localctx);
enterOuterAlt(_localctx, 42);
{
setState(643);
match(SHOW);
setState(644);
match(ROLE);
setState(645);
match(GRANTS);
setState(648);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(646);
_la = _input.LA(1);
if ( !(_la==FROM || _la==IN) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(647);
identifier();
}
}
}
break;
case 43:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 43);
{
setState(650);
match(DESCRIBE);
setState(651);
qualifiedName();
}
break;
case 44:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 44);
{
setState(652);
match(DESC);
setState(653);
qualifiedName();
}
break;
case 45:
_localctx = new ShowFunctionsContext(_localctx);
enterOuterAlt(_localctx, 45);
{
setState(654);
match(SHOW);
setState(655);
match(FUNCTIONS);
setState(662);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(656);
match(LIKE);
setState(657);
((ShowFunctionsContext)_localctx).pattern = string();
setState(660);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(658);
match(ESCAPE);
setState(659);
((ShowFunctionsContext)_localctx).escape = string();
}
}
}
}
}
break;
case 46:
_localctx = new ShowSessionContext(_localctx);
enterOuterAlt(_localctx, 46);
{
setState(664);
match(SHOW);
setState(665);
match(SESSION);
}
break;
case 47:
_localctx = new SetSessionContext(_localctx);
enterOuterAlt(_localctx, 47);
{
setState(666);
match(SET);
setState(667);
match(SESSION);
setState(668);
qualifiedName();
setState(669);
match(EQ);
setState(670);
expression();
}
break;
case 48:
_localctx = new ResetSessionContext(_localctx);
enterOuterAlt(_localctx, 48);
{
setState(672);
match(RESET);
setState(673);
match(SESSION);
setState(674);
qualifiedName();
}
break;
case 49:
_localctx = new StartTransactionContext(_localctx);
enterOuterAlt(_localctx, 49);
{
setState(675);
match(START);
setState(676);
match(TRANSACTION);
setState(685);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ISOLATION || _la==READ) {
{
setState(677);
transactionMode();
setState(682);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(678);
match(T__3);
setState(679);
transactionMode();
}
}
setState(684);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
}
break;
case 50:
_localctx = new CommitContext(_localctx);
enterOuterAlt(_localctx, 50);
{
setState(687);
match(COMMIT);
setState(689);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WORK) {
{
setState(688);
match(WORK);
}
}
}
break;
case 51:
_localctx = new RollbackContext(_localctx);
enterOuterAlt(_localctx, 51);
{
setState(691);
match(ROLLBACK);
setState(693);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WORK) {
{
setState(692);
match(WORK);
}
}
}
break;
case 52:
_localctx = new PrepareContext(_localctx);
enterOuterAlt(_localctx, 52);
{
setState(695);
match(PREPARE);
setState(696);
identifier();
setState(697);
match(FROM);
setState(698);
statement();
}
break;
case 53:
_localctx = new DeallocateContext(_localctx);
enterOuterAlt(_localctx, 53);
{
setState(700);
match(DEALLOCATE);
setState(701);
match(PREPARE);
setState(702);
identifier();
}
break;
case 54:
_localctx = new ExecuteContext(_localctx);
enterOuterAlt(_localctx, 54);
{
setState(703);
match(EXECUTE);
setState(704);
identifier();
setState(714);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==USING) {
{
setState(705);
match(USING);
setState(706);
expression();
setState(711);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(707);
match(T__3);
setState(708);
expression();
}
}
setState(713);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
}
break;
case 55:
_localctx = new DescribeInputContext(_localctx);
enterOuterAlt(_localctx, 55);
{
setState(716);
match(DESCRIBE);
setState(717);
match(INPUT);
setState(718);
identifier();
}
break;
case 56:
_localctx = new DescribeOutputContext(_localctx);
enterOuterAlt(_localctx, 56);
{
setState(719);
match(DESCRIBE);
setState(720);
match(OUTPUT);
setState(721);
identifier();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class QueryContext extends ParserRuleContext {
public QueryNoWithContext queryNoWith() {
return getRuleContext(QueryNoWithContext.class,0);
}
public WithContext with() {
return getRuleContext(WithContext.class,0);
}
public QueryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_query; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterQuery(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitQuery(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitQuery(this);
else return visitor.visitChildren(this);
}
}
public final QueryContext query() throws RecognitionException {
QueryContext _localctx = new QueryContext(_ctx, getState());
enterRule(_localctx, 8, RULE_query);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(725);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(724);
with();
}
}
setState(727);
queryNoWith();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class WithContext extends ParserRuleContext {
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public List namedQuery() {
return getRuleContexts(NamedQueryContext.class);
}
public NamedQueryContext namedQuery(int i) {
return getRuleContext(NamedQueryContext.class,i);
}
public TerminalNode RECURSIVE() { return getToken(SqlBaseParser.RECURSIVE, 0); }
public WithContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_with; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterWith(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitWith(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitWith(this);
else return visitor.visitChildren(this);
}
}
public final WithContext with() throws RecognitionException {
WithContext _localctx = new WithContext(_ctx, getState());
enterRule(_localctx, 10, RULE_with);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(729);
match(WITH);
setState(731);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==RECURSIVE) {
{
setState(730);
match(RECURSIVE);
}
}
setState(733);
namedQuery();
setState(738);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(734);
match(T__3);
setState(735);
namedQuery();
}
}
setState(740);
_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 TableElementContext extends ParserRuleContext {
public ColumnDefinitionContext columnDefinition() {
return getRuleContext(ColumnDefinitionContext.class,0);
}
public LikeClauseContext likeClause() {
return getRuleContext(LikeClauseContext.class,0);
}
public TableElementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_tableElement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTableElement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTableElement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTableElement(this);
else return visitor.visitChildren(this);
}
}
public final TableElementContext tableElement() throws RecognitionException {
TableElementContext _localctx = new TableElementContext(_ctx, getState());
enterRule(_localctx, 12, RULE_tableElement);
try {
setState(743);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ADD:
case ADMIN:
case ALL:
case ANALYZE:
case ANY:
case ARRAY:
case ASC:
case AT:
case BERNOULLI:
case CALL:
case CALLED:
case CASCADE:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case CURRENT_ROLE:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DETERMINISTIC:
case DISTRIBUTED:
case EXCLUDING:
case EXPLAIN:
case EXTERNAL:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTION:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case HOUR:
case IF:
case IGNORE:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LANGUAGE:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
case NAME:
case NFC:
case NFD:
case NFKC:
case NFKD:
case NO:
case NONE:
case NULLIF:
case NULLS:
case ONLY:
case OPTION:
case ORDINALITY:
case OUTPUT:
case OVER:
case PARTITION:
case PARTITIONS:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESPECT:
case RESTRICT:
case RETURN:
case RETURNS:
case REVOKE:
case ROLE:
case ROLES:
case ROLLBACK:
case ROW:
case ROWS:
case SCHEMA:
case SCHEMAS:
case SECOND:
case SECURITY:
case SERIALIZABLE:
case SESSION:
case SET:
case SETS:
case SHOW:
case SOME:
case SQL:
case START:
case STATS:
case SUBSTRING:
case SYSTEM:
case TABLES:
case TABLESAMPLE:
case TEXT:
case TIME:
case TIMESTAMP:
case TO:
case TRANSACTION:
case TRY_CAST:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case USE:
case USER:
case VALIDATE:
case VERBOSE:
case VIEW:
case WORK:
case WRITE:
case YEAR:
case ZONE:
case IDENTIFIER:
case DIGIT_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACKQUOTED_IDENTIFIER:
enterOuterAlt(_localctx, 1);
{
setState(741);
columnDefinition();
}
break;
case LIKE:
enterOuterAlt(_localctx, 2);
{
setState(742);
likeClause();
}
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 ColumnDefinitionContext extends ParserRuleContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public TerminalNode NULL() { return getToken(SqlBaseParser.NULL, 0); }
public TerminalNode COMMENT() { return getToken(SqlBaseParser.COMMENT, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public PropertiesContext properties() {
return getRuleContext(PropertiesContext.class,0);
}
public ColumnDefinitionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_columnDefinition; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterColumnDefinition(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitColumnDefinition(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitColumnDefinition(this);
else return visitor.visitChildren(this);
}
}
public final ColumnDefinitionContext columnDefinition() throws RecognitionException {
ColumnDefinitionContext _localctx = new ColumnDefinitionContext(_ctx, getState());
enterRule(_localctx, 14, RULE_columnDefinition);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(745);
identifier();
setState(746);
type(0);
setState(749);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(747);
match(NOT);
setState(748);
match(NULL);
}
}
setState(753);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(751);
match(COMMENT);
setState(752);
string();
}
}
setState(757);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(755);
match(WITH);
setState(756);
properties();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LikeClauseContext extends ParserRuleContext {
public Token optionType;
public TerminalNode LIKE() { return getToken(SqlBaseParser.LIKE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode PROPERTIES() { return getToken(SqlBaseParser.PROPERTIES, 0); }
public TerminalNode INCLUDING() { return getToken(SqlBaseParser.INCLUDING, 0); }
public TerminalNode EXCLUDING() { return getToken(SqlBaseParser.EXCLUDING, 0); }
public LikeClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_likeClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterLikeClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitLikeClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitLikeClause(this);
else return visitor.visitChildren(this);
}
}
public final LikeClauseContext likeClause() throws RecognitionException {
LikeClauseContext _localctx = new LikeClauseContext(_ctx, getState());
enterRule(_localctx, 16, RULE_likeClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(759);
match(LIKE);
setState(760);
qualifiedName();
setState(763);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==EXCLUDING || _la==INCLUDING) {
{
setState(761);
((LikeClauseContext)_localctx).optionType = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==EXCLUDING || _la==INCLUDING) ) {
((LikeClauseContext)_localctx).optionType = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(762);
match(PROPERTIES);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PropertiesContext extends ParserRuleContext {
public List property() {
return getRuleContexts(PropertyContext.class);
}
public PropertyContext property(int i) {
return getRuleContext(PropertyContext.class,i);
}
public PropertiesContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_properties; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterProperties(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitProperties(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitProperties(this);
else return visitor.visitChildren(this);
}
}
public final PropertiesContext properties() throws RecognitionException {
PropertiesContext _localctx = new PropertiesContext(_ctx, getState());
enterRule(_localctx, 18, RULE_properties);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(765);
match(T__1);
setState(766);
property();
setState(771);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(767);
match(T__3);
setState(768);
property();
}
}
setState(773);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(774);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PropertyContext extends ParserRuleContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode EQ() { return getToken(SqlBaseParser.EQ, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public PropertyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_property; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterProperty(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitProperty(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitProperty(this);
else return visitor.visitChildren(this);
}
}
public final PropertyContext property() throws RecognitionException {
PropertyContext _localctx = new PropertyContext(_ctx, getState());
enterRule(_localctx, 20, RULE_property);
try {
enterOuterAlt(_localctx, 1);
{
setState(776);
identifier();
setState(777);
match(EQ);
setState(778);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SqlParameterDeclarationContext extends ParserRuleContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public SqlParameterDeclarationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_sqlParameterDeclaration; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSqlParameterDeclaration(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSqlParameterDeclaration(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSqlParameterDeclaration(this);
else return visitor.visitChildren(this);
}
}
public final SqlParameterDeclarationContext sqlParameterDeclaration() throws RecognitionException {
SqlParameterDeclarationContext _localctx = new SqlParameterDeclarationContext(_ctx, getState());
enterRule(_localctx, 22, RULE_sqlParameterDeclaration);
try {
enterOuterAlt(_localctx, 1);
{
setState(780);
identifier();
setState(781);
type(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RoutineCharacteristicsContext extends ParserRuleContext {
public List routineCharacteristic() {
return getRuleContexts(RoutineCharacteristicContext.class);
}
public RoutineCharacteristicContext routineCharacteristic(int i) {
return getRuleContext(RoutineCharacteristicContext.class,i);
}
public RoutineCharacteristicsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_routineCharacteristics; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRoutineCharacteristics(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRoutineCharacteristics(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRoutineCharacteristics(this);
else return visitor.visitChildren(this);
}
}
public final RoutineCharacteristicsContext routineCharacteristics() throws RecognitionException {
RoutineCharacteristicsContext _localctx = new RoutineCharacteristicsContext(_ctx, getState());
enterRule(_localctx, 24, RULE_routineCharacteristics);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(786);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==CALLED || _la==DETERMINISTIC || ((((_la - 101)) & ~0x3f) == 0 && ((1L << (_la - 101)) & ((1L << (LANGUAGE - 101)) | (1L << (NOT - 101)) | (1L << (RETURNS - 101)))) != 0)) {
{
{
setState(783);
routineCharacteristic();
}
}
setState(788);
_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 RoutineCharacteristicContext extends ParserRuleContext {
public TerminalNode LANGUAGE() { return getToken(SqlBaseParser.LANGUAGE, 0); }
public LanguageContext language() {
return getRuleContext(LanguageContext.class,0);
}
public DeterminismContext determinism() {
return getRuleContext(DeterminismContext.class,0);
}
public NullCallClauseContext nullCallClause() {
return getRuleContext(NullCallClauseContext.class,0);
}
public RoutineCharacteristicContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_routineCharacteristic; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRoutineCharacteristic(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRoutineCharacteristic(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRoutineCharacteristic(this);
else return visitor.visitChildren(this);
}
}
public final RoutineCharacteristicContext routineCharacteristic() throws RecognitionException {
RoutineCharacteristicContext _localctx = new RoutineCharacteristicContext(_ctx, getState());
enterRule(_localctx, 26, RULE_routineCharacteristic);
try {
setState(793);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LANGUAGE:
enterOuterAlt(_localctx, 1);
{
setState(789);
match(LANGUAGE);
setState(790);
language();
}
break;
case DETERMINISTIC:
case NOT:
enterOuterAlt(_localctx, 2);
{
setState(791);
determinism();
}
break;
case CALLED:
case RETURNS:
enterOuterAlt(_localctx, 3);
{
setState(792);
nullCallClause();
}
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 AlterRoutineCharacteristicsContext extends ParserRuleContext {
public List alterRoutineCharacteristic() {
return getRuleContexts(AlterRoutineCharacteristicContext.class);
}
public AlterRoutineCharacteristicContext alterRoutineCharacteristic(int i) {
return getRuleContext(AlterRoutineCharacteristicContext.class,i);
}
public AlterRoutineCharacteristicsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_alterRoutineCharacteristics; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterAlterRoutineCharacteristics(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitAlterRoutineCharacteristics(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitAlterRoutineCharacteristics(this);
else return visitor.visitChildren(this);
}
}
public final AlterRoutineCharacteristicsContext alterRoutineCharacteristics() throws RecognitionException {
AlterRoutineCharacteristicsContext _localctx = new AlterRoutineCharacteristicsContext(_ctx, getState());
enterRule(_localctx, 28, RULE_alterRoutineCharacteristics);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(798);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==CALLED || _la==RETURNS) {
{
{
setState(795);
alterRoutineCharacteristic();
}
}
setState(800);
_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 AlterRoutineCharacteristicContext extends ParserRuleContext {
public NullCallClauseContext nullCallClause() {
return getRuleContext(NullCallClauseContext.class,0);
}
public AlterRoutineCharacteristicContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_alterRoutineCharacteristic; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterAlterRoutineCharacteristic(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitAlterRoutineCharacteristic(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitAlterRoutineCharacteristic(this);
else return visitor.visitChildren(this);
}
}
public final AlterRoutineCharacteristicContext alterRoutineCharacteristic() throws RecognitionException {
AlterRoutineCharacteristicContext _localctx = new AlterRoutineCharacteristicContext(_ctx, getState());
enterRule(_localctx, 30, RULE_alterRoutineCharacteristic);
try {
enterOuterAlt(_localctx, 1);
{
setState(801);
nullCallClause();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RoutineBodyContext extends ParserRuleContext {
public ReturnStatementContext returnStatement() {
return getRuleContext(ReturnStatementContext.class,0);
}
public ExternalBodyReferenceContext externalBodyReference() {
return getRuleContext(ExternalBodyReferenceContext.class,0);
}
public RoutineBodyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_routineBody; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRoutineBody(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRoutineBody(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRoutineBody(this);
else return visitor.visitChildren(this);
}
}
public final RoutineBodyContext routineBody() throws RecognitionException {
RoutineBodyContext _localctx = new RoutineBodyContext(_ctx, getState());
enterRule(_localctx, 32, RULE_routineBody);
try {
setState(805);
_errHandler.sync(this);
switch (_input.LA(1)) {
case RETURN:
enterOuterAlt(_localctx, 1);
{
setState(803);
returnStatement();
}
break;
case EXTERNAL:
enterOuterAlt(_localctx, 2);
{
setState(804);
externalBodyReference();
}
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 ReturnStatementContext extends ParserRuleContext {
public TerminalNode RETURN() { return getToken(SqlBaseParser.RETURN, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ReturnStatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_returnStatement; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterReturnStatement(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitReturnStatement(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitReturnStatement(this);
else return visitor.visitChildren(this);
}
}
public final ReturnStatementContext returnStatement() throws RecognitionException {
ReturnStatementContext _localctx = new ReturnStatementContext(_ctx, getState());
enterRule(_localctx, 34, RULE_returnStatement);
try {
enterOuterAlt(_localctx, 1);
{
setState(807);
match(RETURN);
setState(808);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExternalBodyReferenceContext extends ParserRuleContext {
public TerminalNode EXTERNAL() { return getToken(SqlBaseParser.EXTERNAL, 0); }
public TerminalNode NAME() { return getToken(SqlBaseParser.NAME, 0); }
public ExternalRoutineNameContext externalRoutineName() {
return getRuleContext(ExternalRoutineNameContext.class,0);
}
public ExternalBodyReferenceContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_externalBodyReference; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterExternalBodyReference(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExternalBodyReference(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExternalBodyReference(this);
else return visitor.visitChildren(this);
}
}
public final ExternalBodyReferenceContext externalBodyReference() throws RecognitionException {
ExternalBodyReferenceContext _localctx = new ExternalBodyReferenceContext(_ctx, getState());
enterRule(_localctx, 36, RULE_externalBodyReference);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(810);
match(EXTERNAL);
setState(813);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NAME) {
{
setState(811);
match(NAME);
setState(812);
externalRoutineName();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LanguageContext extends ParserRuleContext {
public TerminalNode SQL() { return getToken(SqlBaseParser.SQL, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public LanguageContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_language; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterLanguage(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitLanguage(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitLanguage(this);
else return visitor.visitChildren(this);
}
}
public final LanguageContext language() throws RecognitionException {
LanguageContext _localctx = new LanguageContext(_ctx, getState());
enterRule(_localctx, 38, RULE_language);
try {
setState(817);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,94,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(815);
match(SQL);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(816);
identifier();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DeterminismContext extends ParserRuleContext {
public TerminalNode DETERMINISTIC() { return getToken(SqlBaseParser.DETERMINISTIC, 0); }
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public DeterminismContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_determinism; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDeterminism(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDeterminism(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDeterminism(this);
else return visitor.visitChildren(this);
}
}
public final DeterminismContext determinism() throws RecognitionException {
DeterminismContext _localctx = new DeterminismContext(_ctx, getState());
enterRule(_localctx, 40, RULE_determinism);
try {
setState(822);
_errHandler.sync(this);
switch (_input.LA(1)) {
case DETERMINISTIC:
enterOuterAlt(_localctx, 1);
{
setState(819);
match(DETERMINISTIC);
}
break;
case NOT:
enterOuterAlt(_localctx, 2);
{
setState(820);
match(NOT);
setState(821);
match(DETERMINISTIC);
}
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 NullCallClauseContext extends ParserRuleContext {
public TerminalNode RETURNS() { return getToken(SqlBaseParser.RETURNS, 0); }
public List NULL() { return getTokens(SqlBaseParser.NULL); }
public TerminalNode NULL(int i) {
return getToken(SqlBaseParser.NULL, i);
}
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public TerminalNode INPUT() { return getToken(SqlBaseParser.INPUT, 0); }
public TerminalNode CALLED() { return getToken(SqlBaseParser.CALLED, 0); }
public NullCallClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_nullCallClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNullCallClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNullCallClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNullCallClause(this);
else return visitor.visitChildren(this);
}
}
public final NullCallClauseContext nullCallClause() throws RecognitionException {
NullCallClauseContext _localctx = new NullCallClauseContext(_ctx, getState());
enterRule(_localctx, 42, RULE_nullCallClause);
try {
setState(833);
_errHandler.sync(this);
switch (_input.LA(1)) {
case RETURNS:
enterOuterAlt(_localctx, 1);
{
setState(824);
match(RETURNS);
setState(825);
match(NULL);
setState(826);
match(ON);
setState(827);
match(NULL);
setState(828);
match(INPUT);
}
break;
case CALLED:
enterOuterAlt(_localctx, 2);
{
setState(829);
match(CALLED);
setState(830);
match(ON);
setState(831);
match(NULL);
setState(832);
match(INPUT);
}
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 ExternalRoutineNameContext extends ParserRuleContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public ExternalRoutineNameContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_externalRoutineName; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterExternalRoutineName(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExternalRoutineName(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExternalRoutineName(this);
else return visitor.visitChildren(this);
}
}
public final ExternalRoutineNameContext externalRoutineName() throws RecognitionException {
ExternalRoutineNameContext _localctx = new ExternalRoutineNameContext(_ctx, getState());
enterRule(_localctx, 44, RULE_externalRoutineName);
try {
enterOuterAlt(_localctx, 1);
{
setState(835);
identifier();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class QueryNoWithContext extends ParserRuleContext {
public Token limit;
public QueryTermContext queryTerm() {
return getRuleContext(QueryTermContext.class,0);
}
public TerminalNode ORDER() { return getToken(SqlBaseParser.ORDER, 0); }
public TerminalNode BY() { return getToken(SqlBaseParser.BY, 0); }
public List sortItem() {
return getRuleContexts(SortItemContext.class);
}
public SortItemContext sortItem(int i) {
return getRuleContext(SortItemContext.class,i);
}
public TerminalNode LIMIT() { return getToken(SqlBaseParser.LIMIT, 0); }
public TerminalNode INTEGER_VALUE() { return getToken(SqlBaseParser.INTEGER_VALUE, 0); }
public TerminalNode ALL() { return getToken(SqlBaseParser.ALL, 0); }
public QueryNoWithContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_queryNoWith; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterQueryNoWith(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitQueryNoWith(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitQueryNoWith(this);
else return visitor.visitChildren(this);
}
}
public final QueryNoWithContext queryNoWith() throws RecognitionException {
QueryNoWithContext _localctx = new QueryNoWithContext(_ctx, getState());
enterRule(_localctx, 46, RULE_queryNoWith);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(837);
queryTerm(0);
setState(848);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(838);
match(ORDER);
setState(839);
match(BY);
setState(840);
sortItem();
setState(845);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(841);
match(T__3);
setState(842);
sortItem();
}
}
setState(847);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(852);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIMIT) {
{
setState(850);
match(LIMIT);
setState(851);
((QueryNoWithContext)_localctx).limit = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==ALL || _la==INTEGER_VALUE) ) {
((QueryNoWithContext)_localctx).limit = (Token)_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 QueryTermContext extends ParserRuleContext {
public QueryTermContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_queryTerm; }
public QueryTermContext() { }
public void copyFrom(QueryTermContext ctx) {
super.copyFrom(ctx);
}
}
public static class QueryTermDefaultContext extends QueryTermContext {
public QueryPrimaryContext queryPrimary() {
return getRuleContext(QueryPrimaryContext.class,0);
}
public QueryTermDefaultContext(QueryTermContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterQueryTermDefault(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitQueryTermDefault(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitQueryTermDefault(this);
else return visitor.visitChildren(this);
}
}
public static class SetOperationContext extends QueryTermContext {
public QueryTermContext left;
public Token operator;
public QueryTermContext right;
public List queryTerm() {
return getRuleContexts(QueryTermContext.class);
}
public QueryTermContext queryTerm(int i) {
return getRuleContext(QueryTermContext.class,i);
}
public TerminalNode INTERSECT() { return getToken(SqlBaseParser.INTERSECT, 0); }
public SetQuantifierContext setQuantifier() {
return getRuleContext(SetQuantifierContext.class,0);
}
public TerminalNode UNION() { return getToken(SqlBaseParser.UNION, 0); }
public TerminalNode EXCEPT() { return getToken(SqlBaseParser.EXCEPT, 0); }
public SetOperationContext(QueryTermContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetOperation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetOperation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetOperation(this);
else return visitor.visitChildren(this);
}
}
public final QueryTermContext queryTerm() throws RecognitionException {
return queryTerm(0);
}
private QueryTermContext queryTerm(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
QueryTermContext _localctx = new QueryTermContext(_ctx, _parentState);
QueryTermContext _prevctx = _localctx;
int _startState = 48;
enterRecursionRule(_localctx, 48, RULE_queryTerm, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
{
_localctx = new QueryTermDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(855);
queryPrimary();
}
_ctx.stop = _input.LT(-1);
setState(871);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,103,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(869);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,102,_ctx) ) {
case 1:
{
_localctx = new SetOperationContext(new QueryTermContext(_parentctx, _parentState));
((SetOperationContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_queryTerm);
setState(857);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(858);
((SetOperationContext)_localctx).operator = match(INTERSECT);
setState(860);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==DISTINCT) {
{
setState(859);
setQuantifier();
}
}
setState(862);
((SetOperationContext)_localctx).right = queryTerm(3);
}
break;
case 2:
{
_localctx = new SetOperationContext(new QueryTermContext(_parentctx, _parentState));
((SetOperationContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_queryTerm);
setState(863);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
setState(864);
((SetOperationContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==EXCEPT || _la==UNION) ) {
((SetOperationContext)_localctx).operator = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(866);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==DISTINCT) {
{
setState(865);
setQuantifier();
}
}
setState(868);
((SetOperationContext)_localctx).right = queryTerm(2);
}
break;
}
}
}
setState(873);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,103,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
public static class QueryPrimaryContext extends ParserRuleContext {
public QueryPrimaryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_queryPrimary; }
public QueryPrimaryContext() { }
public void copyFrom(QueryPrimaryContext ctx) {
super.copyFrom(ctx);
}
}
public static class SubqueryContext extends QueryPrimaryContext {
public QueryNoWithContext queryNoWith() {
return getRuleContext(QueryNoWithContext.class,0);
}
public SubqueryContext(QueryPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSubquery(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSubquery(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSubquery(this);
else return visitor.visitChildren(this);
}
}
public static class QueryPrimaryDefaultContext extends QueryPrimaryContext {
public QuerySpecificationContext querySpecification() {
return getRuleContext(QuerySpecificationContext.class,0);
}
public QueryPrimaryDefaultContext(QueryPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterQueryPrimaryDefault(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitQueryPrimaryDefault(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitQueryPrimaryDefault(this);
else return visitor.visitChildren(this);
}
}
public static class TableContext extends QueryPrimaryContext {
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TableContext(QueryPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTable(this);
else return visitor.visitChildren(this);
}
}
public static class InlineTableContext extends QueryPrimaryContext {
public TerminalNode VALUES() { return getToken(SqlBaseParser.VALUES, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public InlineTableContext(QueryPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterInlineTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitInlineTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitInlineTable(this);
else return visitor.visitChildren(this);
}
}
public final QueryPrimaryContext queryPrimary() throws RecognitionException {
QueryPrimaryContext _localctx = new QueryPrimaryContext(_ctx, getState());
enterRule(_localctx, 50, RULE_queryPrimary);
try {
int _alt;
setState(890);
_errHandler.sync(this);
switch (_input.LA(1)) {
case SELECT:
_localctx = new QueryPrimaryDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(874);
querySpecification();
}
break;
case TABLE:
_localctx = new TableContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(875);
match(TABLE);
setState(876);
qualifiedName();
}
break;
case VALUES:
_localctx = new InlineTableContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(877);
match(VALUES);
setState(878);
expression();
setState(883);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,104,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(879);
match(T__3);
setState(880);
expression();
}
}
}
setState(885);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,104,_ctx);
}
}
break;
case T__1:
_localctx = new SubqueryContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(886);
match(T__1);
setState(887);
queryNoWith();
setState(888);
match(T__2);
}
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 SortItemContext extends ParserRuleContext {
public Token ordering;
public Token nullOrdering;
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode NULLS() { return getToken(SqlBaseParser.NULLS, 0); }
public TerminalNode ASC() { return getToken(SqlBaseParser.ASC, 0); }
public TerminalNode DESC() { return getToken(SqlBaseParser.DESC, 0); }
public TerminalNode FIRST() { return getToken(SqlBaseParser.FIRST, 0); }
public TerminalNode LAST() { return getToken(SqlBaseParser.LAST, 0); }
public SortItemContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_sortItem; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSortItem(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSortItem(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSortItem(this);
else return visitor.visitChildren(this);
}
}
public final SortItemContext sortItem() throws RecognitionException {
SortItemContext _localctx = new SortItemContext(_ctx, getState());
enterRule(_localctx, 52, RULE_sortItem);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(892);
expression();
setState(894);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASC || _la==DESC) {
{
setState(893);
((SortItemContext)_localctx).ordering = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==ASC || _la==DESC) ) {
((SortItemContext)_localctx).ordering = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(898);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NULLS) {
{
setState(896);
match(NULLS);
setState(897);
((SortItemContext)_localctx).nullOrdering = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==FIRST || _la==LAST) ) {
((SortItemContext)_localctx).nullOrdering = (Token)_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 QuerySpecificationContext extends ParserRuleContext {
public BooleanExpressionContext where;
public BooleanExpressionContext having;
public TerminalNode SELECT() { return getToken(SqlBaseParser.SELECT, 0); }
public List selectItem() {
return getRuleContexts(SelectItemContext.class);
}
public SelectItemContext selectItem(int i) {
return getRuleContext(SelectItemContext.class,i);
}
public SetQuantifierContext setQuantifier() {
return getRuleContext(SetQuantifierContext.class,0);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public List relation() {
return getRuleContexts(RelationContext.class);
}
public RelationContext relation(int i) {
return getRuleContext(RelationContext.class,i);
}
public TerminalNode WHERE() { return getToken(SqlBaseParser.WHERE, 0); }
public TerminalNode GROUP() { return getToken(SqlBaseParser.GROUP, 0); }
public TerminalNode BY() { return getToken(SqlBaseParser.BY, 0); }
public GroupByContext groupBy() {
return getRuleContext(GroupByContext.class,0);
}
public TerminalNode HAVING() { return getToken(SqlBaseParser.HAVING, 0); }
public List booleanExpression() {
return getRuleContexts(BooleanExpressionContext.class);
}
public BooleanExpressionContext booleanExpression(int i) {
return getRuleContext(BooleanExpressionContext.class,i);
}
public QuerySpecificationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_querySpecification; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterQuerySpecification(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitQuerySpecification(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitQuerySpecification(this);
else return visitor.visitChildren(this);
}
}
public final QuerySpecificationContext querySpecification() throws RecognitionException {
QuerySpecificationContext _localctx = new QuerySpecificationContext(_ctx, getState());
enterRule(_localctx, 54, RULE_querySpecification);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(900);
match(SELECT);
setState(902);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,108,_ctx) ) {
case 1:
{
setState(901);
setQuantifier();
}
break;
}
setState(904);
selectItem();
setState(909);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,109,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(905);
match(T__3);
setState(906);
selectItem();
}
}
}
setState(911);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,109,_ctx);
}
setState(921);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,111,_ctx) ) {
case 1:
{
setState(912);
match(FROM);
setState(913);
relation(0);
setState(918);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,110,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(914);
match(T__3);
setState(915);
relation(0);
}
}
}
setState(920);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,110,_ctx);
}
}
break;
}
setState(925);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,112,_ctx) ) {
case 1:
{
setState(923);
match(WHERE);
setState(924);
((QuerySpecificationContext)_localctx).where = booleanExpression(0);
}
break;
}
setState(930);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,113,_ctx) ) {
case 1:
{
setState(927);
match(GROUP);
setState(928);
match(BY);
setState(929);
groupBy();
}
break;
}
setState(934);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,114,_ctx) ) {
case 1:
{
setState(932);
match(HAVING);
setState(933);
((QuerySpecificationContext)_localctx).having = booleanExpression(0);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class GroupByContext extends ParserRuleContext {
public List groupingElement() {
return getRuleContexts(GroupingElementContext.class);
}
public GroupingElementContext groupingElement(int i) {
return getRuleContext(GroupingElementContext.class,i);
}
public SetQuantifierContext setQuantifier() {
return getRuleContext(SetQuantifierContext.class,0);
}
public GroupByContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_groupBy; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterGroupBy(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitGroupBy(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitGroupBy(this);
else return visitor.visitChildren(this);
}
}
public final GroupByContext groupBy() throws RecognitionException {
GroupByContext _localctx = new GroupByContext(_ctx, getState());
enterRule(_localctx, 56, RULE_groupBy);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(937);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,115,_ctx) ) {
case 1:
{
setState(936);
setQuantifier();
}
break;
}
setState(939);
groupingElement();
setState(944);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,116,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(940);
match(T__3);
setState(941);
groupingElement();
}
}
}
setState(946);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,116,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class GroupingElementContext extends ParserRuleContext {
public GroupingElementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_groupingElement; }
public GroupingElementContext() { }
public void copyFrom(GroupingElementContext ctx) {
super.copyFrom(ctx);
}
}
public static class MultipleGroupingSetsContext extends GroupingElementContext {
public TerminalNode GROUPING() { return getToken(SqlBaseParser.GROUPING, 0); }
public TerminalNode SETS() { return getToken(SqlBaseParser.SETS, 0); }
public List groupingSet() {
return getRuleContexts(GroupingSetContext.class);
}
public GroupingSetContext groupingSet(int i) {
return getRuleContext(GroupingSetContext.class,i);
}
public MultipleGroupingSetsContext(GroupingElementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterMultipleGroupingSets(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitMultipleGroupingSets(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitMultipleGroupingSets(this);
else return visitor.visitChildren(this);
}
}
public static class SingleGroupingSetContext extends GroupingElementContext {
public GroupingSetContext groupingSet() {
return getRuleContext(GroupingSetContext.class,0);
}
public SingleGroupingSetContext(GroupingElementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSingleGroupingSet(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSingleGroupingSet(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSingleGroupingSet(this);
else return visitor.visitChildren(this);
}
}
public static class CubeContext extends GroupingElementContext {
public TerminalNode CUBE() { return getToken(SqlBaseParser.CUBE, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public CubeContext(GroupingElementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCube(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCube(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCube(this);
else return visitor.visitChildren(this);
}
}
public static class RollupContext extends GroupingElementContext {
public TerminalNode ROLLUP() { return getToken(SqlBaseParser.ROLLUP, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public RollupContext(GroupingElementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRollup(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRollup(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRollup(this);
else return visitor.visitChildren(this);
}
}
public final GroupingElementContext groupingElement() throws RecognitionException {
GroupingElementContext _localctx = new GroupingElementContext(_ctx, getState());
enterRule(_localctx, 58, RULE_groupingElement);
int _la;
try {
setState(987);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,122,_ctx) ) {
case 1:
_localctx = new SingleGroupingSetContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(947);
groupingSet();
}
break;
case 2:
_localctx = new RollupContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(948);
match(ROLLUP);
setState(949);
match(T__1);
setState(958);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__4) | (1L << ADD) | (1L << ADMIN) | (1L << ALL) | (1L << ANALYZE) | (1L << ANY) | (1L << ARRAY) | (1L << ASC) | (1L << AT) | (1L << BERNOULLI) | (1L << CALL) | (1L << CALLED) | (1L << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_ROLE) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DETERMINISTIC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXPLAIN - 64)) | (1L << (EXTRACT - 64)) | (1L << (EXTERNAL - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 64)) | (1L << (FUNCTION - 64)) | (1L << (FUNCTIONS - 64)) | (1L << (GRANT - 64)) | (1L << (GRANTED - 64)) | (1L << (GRANTS - 64)) | (1L << (GRAPHVIZ - 64)) | (1L << (GROUPING - 64)) | (1L << (HOUR - 64)) | (1L << (IF - 64)) | (1L << (IGNORE - 64)) | (1L << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 64)) | (1L << (LANGUAGE - 64)) | (1L << (LAST - 64)) | (1L << (LATERAL - 64)) | (1L << (LEVEL - 64)) | (1L << (LIMIT - 64)) | (1L << (LOCALTIME - 64)) | (1L << (LOCALTIMESTAMP - 64)) | (1L << (LOGICAL - 64)) | (1L << (MAP - 64)) | (1L << (MINUTE - 64)) | (1L << (MONTH - 64)) | (1L << (NAME - 64)) | (1L << (NFC - 64)) | (1L << (NFD - 64)) | (1L << (NFKC - 64)) | (1L << (NFKD - 64)) | (1L << (NO - 64)) | (1L << (NONE - 64)) | (1L << (NORMALIZE - 64)) | (1L << (NOT - 64)) | (1L << (NULL - 64)) | (1L << (NULLIF - 64)) | (1L << (NULLS - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (ONLY - 128)) | (1L << (OPTION - 128)) | (1L << (ORDINALITY - 128)) | (1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (POSITION - 128)) | (1L << (PRECEDING - 128)) | (1L << (PRIVILEGES - 128)) | (1L << (PROPERTIES - 128)) | (1L << (RANGE - 128)) | (1L << (READ - 128)) | (1L << (RENAME - 128)) | (1L << (REPEATABLE - 128)) | (1L << (REPLACE - 128)) | (1L << (RESET - 128)) | (1L << (RESPECT - 128)) | (1L << (RESTRICT - 128)) | (1L << (RETURN - 128)) | (1L << (RETURNS - 128)) | (1L << (REVOKE - 128)) | (1L << (ROLE - 128)) | (1L << (ROLES - 128)) | (1L << (ROLLBACK - 128)) | (1L << (ROW - 128)) | (1L << (ROWS - 128)) | (1L << (SCHEMA - 128)) | (1L << (SCHEMAS - 128)) | (1L << (SECOND - 128)) | (1L << (SECURITY - 128)) | (1L << (SERIALIZABLE - 128)) | (1L << (SESSION - 128)) | (1L << (SET - 128)) | (1L << (SETS - 128)) | (1L << (SHOW - 128)) | (1L << (SOME - 128)) | (1L << (SQL - 128)) | (1L << (START - 128)) | (1L << (STATS - 128)) | (1L << (SUBSTRING - 128)) | (1L << (SYSTEM - 128)) | (1L << (TABLES - 128)) | (1L << (TABLESAMPLE - 128)) | (1L << (TEXT - 128)) | (1L << (TIME - 128)) | (1L << (TIMESTAMP - 128)) | (1L << (TO - 128)) | (1L << (TRANSACTION - 128)) | (1L << (TRUE - 128)) | (1L << (TRY_CAST - 128)) | (1L << (TYPE - 128)) | (1L << (UNBOUNDED - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & ((1L << (UNCOMMITTED - 192)) | (1L << (USE - 192)) | (1L << (USER - 192)) | (1L << (VALIDATE - 192)) | (1L << (VERBOSE - 192)) | (1L << (VIEW - 192)) | (1L << (WORK - 192)) | (1L << (WRITE - 192)) | (1L << (YEAR - 192)) | (1L << (ZONE - 192)) | (1L << (PLUS - 192)) | (1L << (MINUS - 192)) | (1L << (STRING - 192)) | (1L << (UNICODE_STRING - 192)) | (1L << (BINARY_LITERAL - 192)) | (1L << (INTEGER_VALUE - 192)) | (1L << (DECIMAL_VALUE - 192)) | (1L << (DOUBLE_VALUE - 192)) | (1L << (IDENTIFIER - 192)) | (1L << (DIGIT_IDENTIFIER - 192)) | (1L << (QUOTED_IDENTIFIER - 192)) | (1L << (BACKQUOTED_IDENTIFIER - 192)) | (1L << (DOUBLE_PRECISION - 192)))) != 0)) {
{
setState(950);
expression();
setState(955);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(951);
match(T__3);
setState(952);
expression();
}
}
setState(957);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(960);
match(T__2);
}
break;
case 3:
_localctx = new CubeContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(961);
match(CUBE);
setState(962);
match(T__1);
setState(971);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__4) | (1L << ADD) | (1L << ADMIN) | (1L << ALL) | (1L << ANALYZE) | (1L << ANY) | (1L << ARRAY) | (1L << ASC) | (1L << AT) | (1L << BERNOULLI) | (1L << CALL) | (1L << CALLED) | (1L << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_ROLE) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DETERMINISTIC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXPLAIN - 64)) | (1L << (EXTRACT - 64)) | (1L << (EXTERNAL - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 64)) | (1L << (FUNCTION - 64)) | (1L << (FUNCTIONS - 64)) | (1L << (GRANT - 64)) | (1L << (GRANTED - 64)) | (1L << (GRANTS - 64)) | (1L << (GRAPHVIZ - 64)) | (1L << (GROUPING - 64)) | (1L << (HOUR - 64)) | (1L << (IF - 64)) | (1L << (IGNORE - 64)) | (1L << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 64)) | (1L << (LANGUAGE - 64)) | (1L << (LAST - 64)) | (1L << (LATERAL - 64)) | (1L << (LEVEL - 64)) | (1L << (LIMIT - 64)) | (1L << (LOCALTIME - 64)) | (1L << (LOCALTIMESTAMP - 64)) | (1L << (LOGICAL - 64)) | (1L << (MAP - 64)) | (1L << (MINUTE - 64)) | (1L << (MONTH - 64)) | (1L << (NAME - 64)) | (1L << (NFC - 64)) | (1L << (NFD - 64)) | (1L << (NFKC - 64)) | (1L << (NFKD - 64)) | (1L << (NO - 64)) | (1L << (NONE - 64)) | (1L << (NORMALIZE - 64)) | (1L << (NOT - 64)) | (1L << (NULL - 64)) | (1L << (NULLIF - 64)) | (1L << (NULLS - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (ONLY - 128)) | (1L << (OPTION - 128)) | (1L << (ORDINALITY - 128)) | (1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (POSITION - 128)) | (1L << (PRECEDING - 128)) | (1L << (PRIVILEGES - 128)) | (1L << (PROPERTIES - 128)) | (1L << (RANGE - 128)) | (1L << (READ - 128)) | (1L << (RENAME - 128)) | (1L << (REPEATABLE - 128)) | (1L << (REPLACE - 128)) | (1L << (RESET - 128)) | (1L << (RESPECT - 128)) | (1L << (RESTRICT - 128)) | (1L << (RETURN - 128)) | (1L << (RETURNS - 128)) | (1L << (REVOKE - 128)) | (1L << (ROLE - 128)) | (1L << (ROLES - 128)) | (1L << (ROLLBACK - 128)) | (1L << (ROW - 128)) | (1L << (ROWS - 128)) | (1L << (SCHEMA - 128)) | (1L << (SCHEMAS - 128)) | (1L << (SECOND - 128)) | (1L << (SECURITY - 128)) | (1L << (SERIALIZABLE - 128)) | (1L << (SESSION - 128)) | (1L << (SET - 128)) | (1L << (SETS - 128)) | (1L << (SHOW - 128)) | (1L << (SOME - 128)) | (1L << (SQL - 128)) | (1L << (START - 128)) | (1L << (STATS - 128)) | (1L << (SUBSTRING - 128)) | (1L << (SYSTEM - 128)) | (1L << (TABLES - 128)) | (1L << (TABLESAMPLE - 128)) | (1L << (TEXT - 128)) | (1L << (TIME - 128)) | (1L << (TIMESTAMP - 128)) | (1L << (TO - 128)) | (1L << (TRANSACTION - 128)) | (1L << (TRUE - 128)) | (1L << (TRY_CAST - 128)) | (1L << (TYPE - 128)) | (1L << (UNBOUNDED - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & ((1L << (UNCOMMITTED - 192)) | (1L << (USE - 192)) | (1L << (USER - 192)) | (1L << (VALIDATE - 192)) | (1L << (VERBOSE - 192)) | (1L << (VIEW - 192)) | (1L << (WORK - 192)) | (1L << (WRITE - 192)) | (1L << (YEAR - 192)) | (1L << (ZONE - 192)) | (1L << (PLUS - 192)) | (1L << (MINUS - 192)) | (1L << (STRING - 192)) | (1L << (UNICODE_STRING - 192)) | (1L << (BINARY_LITERAL - 192)) | (1L << (INTEGER_VALUE - 192)) | (1L << (DECIMAL_VALUE - 192)) | (1L << (DOUBLE_VALUE - 192)) | (1L << (IDENTIFIER - 192)) | (1L << (DIGIT_IDENTIFIER - 192)) | (1L << (QUOTED_IDENTIFIER - 192)) | (1L << (BACKQUOTED_IDENTIFIER - 192)) | (1L << (DOUBLE_PRECISION - 192)))) != 0)) {
{
setState(963);
expression();
setState(968);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(964);
match(T__3);
setState(965);
expression();
}
}
setState(970);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(973);
match(T__2);
}
break;
case 4:
_localctx = new MultipleGroupingSetsContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(974);
match(GROUPING);
setState(975);
match(SETS);
setState(976);
match(T__1);
setState(977);
groupingSet();
setState(982);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(978);
match(T__3);
setState(979);
groupingSet();
}
}
setState(984);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(985);
match(T__2);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class GroupingSetContext extends ParserRuleContext {
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public GroupingSetContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_groupingSet; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterGroupingSet(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitGroupingSet(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitGroupingSet(this);
else return visitor.visitChildren(this);
}
}
public final GroupingSetContext groupingSet() throws RecognitionException {
GroupingSetContext _localctx = new GroupingSetContext(_ctx, getState());
enterRule(_localctx, 60, RULE_groupingSet);
int _la;
try {
setState(1002);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,125,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(989);
match(T__1);
setState(998);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__4) | (1L << ADD) | (1L << ADMIN) | (1L << ALL) | (1L << ANALYZE) | (1L << ANY) | (1L << ARRAY) | (1L << ASC) | (1L << AT) | (1L << BERNOULLI) | (1L << CALL) | (1L << CALLED) | (1L << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_ROLE) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DETERMINISTIC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXPLAIN - 64)) | (1L << (EXTRACT - 64)) | (1L << (EXTERNAL - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 64)) | (1L << (FUNCTION - 64)) | (1L << (FUNCTIONS - 64)) | (1L << (GRANT - 64)) | (1L << (GRANTED - 64)) | (1L << (GRANTS - 64)) | (1L << (GRAPHVIZ - 64)) | (1L << (GROUPING - 64)) | (1L << (HOUR - 64)) | (1L << (IF - 64)) | (1L << (IGNORE - 64)) | (1L << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 64)) | (1L << (LANGUAGE - 64)) | (1L << (LAST - 64)) | (1L << (LATERAL - 64)) | (1L << (LEVEL - 64)) | (1L << (LIMIT - 64)) | (1L << (LOCALTIME - 64)) | (1L << (LOCALTIMESTAMP - 64)) | (1L << (LOGICAL - 64)) | (1L << (MAP - 64)) | (1L << (MINUTE - 64)) | (1L << (MONTH - 64)) | (1L << (NAME - 64)) | (1L << (NFC - 64)) | (1L << (NFD - 64)) | (1L << (NFKC - 64)) | (1L << (NFKD - 64)) | (1L << (NO - 64)) | (1L << (NONE - 64)) | (1L << (NORMALIZE - 64)) | (1L << (NOT - 64)) | (1L << (NULL - 64)) | (1L << (NULLIF - 64)) | (1L << (NULLS - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (ONLY - 128)) | (1L << (OPTION - 128)) | (1L << (ORDINALITY - 128)) | (1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (POSITION - 128)) | (1L << (PRECEDING - 128)) | (1L << (PRIVILEGES - 128)) | (1L << (PROPERTIES - 128)) | (1L << (RANGE - 128)) | (1L << (READ - 128)) | (1L << (RENAME - 128)) | (1L << (REPEATABLE - 128)) | (1L << (REPLACE - 128)) | (1L << (RESET - 128)) | (1L << (RESPECT - 128)) | (1L << (RESTRICT - 128)) | (1L << (RETURN - 128)) | (1L << (RETURNS - 128)) | (1L << (REVOKE - 128)) | (1L << (ROLE - 128)) | (1L << (ROLES - 128)) | (1L << (ROLLBACK - 128)) | (1L << (ROW - 128)) | (1L << (ROWS - 128)) | (1L << (SCHEMA - 128)) | (1L << (SCHEMAS - 128)) | (1L << (SECOND - 128)) | (1L << (SECURITY - 128)) | (1L << (SERIALIZABLE - 128)) | (1L << (SESSION - 128)) | (1L << (SET - 128)) | (1L << (SETS - 128)) | (1L << (SHOW - 128)) | (1L << (SOME - 128)) | (1L << (SQL - 128)) | (1L << (START - 128)) | (1L << (STATS - 128)) | (1L << (SUBSTRING - 128)) | (1L << (SYSTEM - 128)) | (1L << (TABLES - 128)) | (1L << (TABLESAMPLE - 128)) | (1L << (TEXT - 128)) | (1L << (TIME - 128)) | (1L << (TIMESTAMP - 128)) | (1L << (TO - 128)) | (1L << (TRANSACTION - 128)) | (1L << (TRUE - 128)) | (1L << (TRY_CAST - 128)) | (1L << (TYPE - 128)) | (1L << (UNBOUNDED - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & ((1L << (UNCOMMITTED - 192)) | (1L << (USE - 192)) | (1L << (USER - 192)) | (1L << (VALIDATE - 192)) | (1L << (VERBOSE - 192)) | (1L << (VIEW - 192)) | (1L << (WORK - 192)) | (1L << (WRITE - 192)) | (1L << (YEAR - 192)) | (1L << (ZONE - 192)) | (1L << (PLUS - 192)) | (1L << (MINUS - 192)) | (1L << (STRING - 192)) | (1L << (UNICODE_STRING - 192)) | (1L << (BINARY_LITERAL - 192)) | (1L << (INTEGER_VALUE - 192)) | (1L << (DECIMAL_VALUE - 192)) | (1L << (DOUBLE_VALUE - 192)) | (1L << (IDENTIFIER - 192)) | (1L << (DIGIT_IDENTIFIER - 192)) | (1L << (QUOTED_IDENTIFIER - 192)) | (1L << (BACKQUOTED_IDENTIFIER - 192)) | (1L << (DOUBLE_PRECISION - 192)))) != 0)) {
{
setState(990);
expression();
setState(995);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(991);
match(T__3);
setState(992);
expression();
}
}
setState(997);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1000);
match(T__2);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1001);
expression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class NamedQueryContext extends ParserRuleContext {
public IdentifierContext name;
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public ColumnAliasesContext columnAliases() {
return getRuleContext(ColumnAliasesContext.class,0);
}
public NamedQueryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_namedQuery; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNamedQuery(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNamedQuery(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNamedQuery(this);
else return visitor.visitChildren(this);
}
}
public final NamedQueryContext namedQuery() throws RecognitionException {
NamedQueryContext _localctx = new NamedQueryContext(_ctx, getState());
enterRule(_localctx, 62, RULE_namedQuery);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1004);
((NamedQueryContext)_localctx).name = identifier();
setState(1006);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(1005);
columnAliases();
}
}
setState(1008);
match(AS);
setState(1009);
match(T__1);
setState(1010);
query();
setState(1011);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SetQuantifierContext extends ParserRuleContext {
public TerminalNode DISTINCT() { return getToken(SqlBaseParser.DISTINCT, 0); }
public TerminalNode ALL() { return getToken(SqlBaseParser.ALL, 0); }
public SetQuantifierContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_setQuantifier; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetQuantifier(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetQuantifier(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetQuantifier(this);
else return visitor.visitChildren(this);
}
}
public final SetQuantifierContext setQuantifier() throws RecognitionException {
SetQuantifierContext _localctx = new SetQuantifierContext(_ctx, getState());
enterRule(_localctx, 64, RULE_setQuantifier);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1013);
_la = _input.LA(1);
if ( !(_la==ALL || _la==DISTINCT) ) {
_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 SelectItemContext extends ParserRuleContext {
public SelectItemContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_selectItem; }
public SelectItemContext() { }
public void copyFrom(SelectItemContext ctx) {
super.copyFrom(ctx);
}
}
public static class SelectAllContext extends SelectItemContext {
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode ASTERISK() { return getToken(SqlBaseParser.ASTERISK, 0); }
public SelectAllContext(SelectItemContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSelectAll(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSelectAll(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSelectAll(this);
else return visitor.visitChildren(this);
}
}
public static class SelectSingleContext extends SelectItemContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public SelectSingleContext(SelectItemContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSelectSingle(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSelectSingle(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSelectSingle(this);
else return visitor.visitChildren(this);
}
}
public final SelectItemContext selectItem() throws RecognitionException {
SelectItemContext _localctx = new SelectItemContext(_ctx, getState());
enterRule(_localctx, 66, RULE_selectItem);
int _la;
try {
setState(1027);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,129,_ctx) ) {
case 1:
_localctx = new SelectSingleContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1015);
expression();
setState(1020);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,128,_ctx) ) {
case 1:
{
setState(1017);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1016);
match(AS);
}
}
setState(1019);
identifier();
}
break;
}
}
break;
case 2:
_localctx = new SelectAllContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1022);
qualifiedName();
setState(1023);
match(T__0);
setState(1024);
match(ASTERISK);
}
break;
case 3:
_localctx = new SelectAllContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1026);
match(ASTERISK);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RelationContext extends ParserRuleContext {
public RelationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_relation; }
public RelationContext() { }
public void copyFrom(RelationContext ctx) {
super.copyFrom(ctx);
}
}
public static class RelationDefaultContext extends RelationContext {
public SampledRelationContext sampledRelation() {
return getRuleContext(SampledRelationContext.class,0);
}
public RelationDefaultContext(RelationContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRelationDefault(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRelationDefault(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRelationDefault(this);
else return visitor.visitChildren(this);
}
}
public static class JoinRelationContext extends RelationContext {
public RelationContext left;
public SampledRelationContext right;
public RelationContext rightRelation;
public List relation() {
return getRuleContexts(RelationContext.class);
}
public RelationContext relation(int i) {
return getRuleContext(RelationContext.class,i);
}
public TerminalNode CROSS() { return getToken(SqlBaseParser.CROSS, 0); }
public TerminalNode JOIN() { return getToken(SqlBaseParser.JOIN, 0); }
public JoinTypeContext joinType() {
return getRuleContext(JoinTypeContext.class,0);
}
public JoinCriteriaContext joinCriteria() {
return getRuleContext(JoinCriteriaContext.class,0);
}
public TerminalNode NATURAL() { return getToken(SqlBaseParser.NATURAL, 0); }
public SampledRelationContext sampledRelation() {
return getRuleContext(SampledRelationContext.class,0);
}
public JoinRelationContext(RelationContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterJoinRelation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitJoinRelation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitJoinRelation(this);
else return visitor.visitChildren(this);
}
}
public final RelationContext relation() throws RecognitionException {
return relation(0);
}
private RelationContext relation(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
RelationContext _localctx = new RelationContext(_ctx, _parentState);
RelationContext _prevctx = _localctx;
int _startState = 68;
enterRecursionRule(_localctx, 68, RULE_relation, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
{
_localctx = new RelationDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1030);
sampledRelation();
}
_ctx.stop = _input.LT(-1);
setState(1050);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,131,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
{
_localctx = new JoinRelationContext(new RelationContext(_parentctx, _parentState));
((JoinRelationContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_relation);
setState(1032);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1046);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CROSS:
{
setState(1033);
match(CROSS);
setState(1034);
match(JOIN);
setState(1035);
((JoinRelationContext)_localctx).right = sampledRelation();
}
break;
case FULL:
case INNER:
case JOIN:
case LEFT:
case RIGHT:
{
setState(1036);
joinType();
setState(1037);
match(JOIN);
setState(1038);
((JoinRelationContext)_localctx).rightRelation = relation(0);
setState(1039);
joinCriteria();
}
break;
case NATURAL:
{
setState(1041);
match(NATURAL);
setState(1042);
joinType();
setState(1043);
match(JOIN);
setState(1044);
((JoinRelationContext)_localctx).right = sampledRelation();
}
break;
default:
throw new NoViableAltException(this);
}
}
}
}
setState(1052);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,131,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
public static class JoinTypeContext extends ParserRuleContext {
public TerminalNode INNER() { return getToken(SqlBaseParser.INNER, 0); }
public TerminalNode LEFT() { return getToken(SqlBaseParser.LEFT, 0); }
public TerminalNode OUTER() { return getToken(SqlBaseParser.OUTER, 0); }
public TerminalNode RIGHT() { return getToken(SqlBaseParser.RIGHT, 0); }
public TerminalNode FULL() { return getToken(SqlBaseParser.FULL, 0); }
public JoinTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_joinType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterJoinType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitJoinType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitJoinType(this);
else return visitor.visitChildren(this);
}
}
public final JoinTypeContext joinType() throws RecognitionException {
JoinTypeContext _localctx = new JoinTypeContext(_ctx, getState());
enterRule(_localctx, 70, RULE_joinType);
int _la;
try {
setState(1068);
_errHandler.sync(this);
switch (_input.LA(1)) {
case INNER:
case JOIN:
enterOuterAlt(_localctx, 1);
{
setState(1054);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==INNER) {
{
setState(1053);
match(INNER);
}
}
}
break;
case LEFT:
enterOuterAlt(_localctx, 2);
{
setState(1056);
match(LEFT);
setState(1058);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(1057);
match(OUTER);
}
}
}
break;
case RIGHT:
enterOuterAlt(_localctx, 3);
{
setState(1060);
match(RIGHT);
setState(1062);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(1061);
match(OUTER);
}
}
}
break;
case FULL:
enterOuterAlt(_localctx, 4);
{
setState(1064);
match(FULL);
setState(1066);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(1065);
match(OUTER);
}
}
}
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 JoinCriteriaContext extends ParserRuleContext {
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public BooleanExpressionContext booleanExpression() {
return getRuleContext(BooleanExpressionContext.class,0);
}
public TerminalNode USING() { return getToken(SqlBaseParser.USING, 0); }
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public JoinCriteriaContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_joinCriteria; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterJoinCriteria(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitJoinCriteria(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitJoinCriteria(this);
else return visitor.visitChildren(this);
}
}
public final JoinCriteriaContext joinCriteria() throws RecognitionException {
JoinCriteriaContext _localctx = new JoinCriteriaContext(_ctx, getState());
enterRule(_localctx, 72, RULE_joinCriteria);
int _la;
try {
setState(1084);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ON:
enterOuterAlt(_localctx, 1);
{
setState(1070);
match(ON);
setState(1071);
booleanExpression(0);
}
break;
case USING:
enterOuterAlt(_localctx, 2);
{
setState(1072);
match(USING);
setState(1073);
match(T__1);
setState(1074);
identifier();
setState(1079);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1075);
match(T__3);
setState(1076);
identifier();
}
}
setState(1081);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1082);
match(T__2);
}
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 SampledRelationContext extends ParserRuleContext {
public ExpressionContext percentage;
public AliasedRelationContext aliasedRelation() {
return getRuleContext(AliasedRelationContext.class,0);
}
public TerminalNode TABLESAMPLE() { return getToken(SqlBaseParser.TABLESAMPLE, 0); }
public SampleTypeContext sampleType() {
return getRuleContext(SampleTypeContext.class,0);
}
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public SampledRelationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_sampledRelation; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSampledRelation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSampledRelation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSampledRelation(this);
else return visitor.visitChildren(this);
}
}
public final SampledRelationContext sampledRelation() throws RecognitionException {
SampledRelationContext _localctx = new SampledRelationContext(_ctx, getState());
enterRule(_localctx, 74, RULE_sampledRelation);
try {
enterOuterAlt(_localctx, 1);
{
setState(1086);
aliasedRelation();
setState(1093);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,139,_ctx) ) {
case 1:
{
setState(1087);
match(TABLESAMPLE);
setState(1088);
sampleType();
setState(1089);
match(T__1);
setState(1090);
((SampledRelationContext)_localctx).percentage = expression();
setState(1091);
match(T__2);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SampleTypeContext extends ParserRuleContext {
public TerminalNode BERNOULLI() { return getToken(SqlBaseParser.BERNOULLI, 0); }
public TerminalNode SYSTEM() { return getToken(SqlBaseParser.SYSTEM, 0); }
public SampleTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_sampleType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSampleType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSampleType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSampleType(this);
else return visitor.visitChildren(this);
}
}
public final SampleTypeContext sampleType() throws RecognitionException {
SampleTypeContext _localctx = new SampleTypeContext(_ctx, getState());
enterRule(_localctx, 76, RULE_sampleType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1095);
_la = _input.LA(1);
if ( !(_la==BERNOULLI || _la==SYSTEM) ) {
_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 AliasedRelationContext extends ParserRuleContext {
public RelationPrimaryContext relationPrimary() {
return getRuleContext(RelationPrimaryContext.class,0);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public ColumnAliasesContext columnAliases() {
return getRuleContext(ColumnAliasesContext.class,0);
}
public AliasedRelationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_aliasedRelation; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterAliasedRelation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitAliasedRelation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitAliasedRelation(this);
else return visitor.visitChildren(this);
}
}
public final AliasedRelationContext aliasedRelation() throws RecognitionException {
AliasedRelationContext _localctx = new AliasedRelationContext(_ctx, getState());
enterRule(_localctx, 78, RULE_aliasedRelation);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1097);
relationPrimary();
setState(1105);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,142,_ctx) ) {
case 1:
{
setState(1099);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1098);
match(AS);
}
}
setState(1101);
identifier();
setState(1103);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,141,_ctx) ) {
case 1:
{
setState(1102);
columnAliases();
}
break;
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ColumnAliasesContext extends ParserRuleContext {
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public ColumnAliasesContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_columnAliases; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterColumnAliases(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitColumnAliases(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitColumnAliases(this);
else return visitor.visitChildren(this);
}
}
public final ColumnAliasesContext columnAliases() throws RecognitionException {
ColumnAliasesContext _localctx = new ColumnAliasesContext(_ctx, getState());
enterRule(_localctx, 80, RULE_columnAliases);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1107);
match(T__1);
setState(1108);
identifier();
setState(1113);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1109);
match(T__3);
setState(1110);
identifier();
}
}
setState(1115);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1116);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RelationPrimaryContext extends ParserRuleContext {
public RelationPrimaryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_relationPrimary; }
public RelationPrimaryContext() { }
public void copyFrom(RelationPrimaryContext ctx) {
super.copyFrom(ctx);
}
}
public static class SubqueryRelationContext extends RelationPrimaryContext {
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public SubqueryRelationContext(RelationPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSubqueryRelation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSubqueryRelation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSubqueryRelation(this);
else return visitor.visitChildren(this);
}
}
public static class ParenthesizedRelationContext extends RelationPrimaryContext {
public RelationContext relation() {
return getRuleContext(RelationContext.class,0);
}
public ParenthesizedRelationContext(RelationPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterParenthesizedRelation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitParenthesizedRelation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitParenthesizedRelation(this);
else return visitor.visitChildren(this);
}
}
public static class UnnestContext extends RelationPrimaryContext {
public TerminalNode UNNEST() { return getToken(SqlBaseParser.UNNEST, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public TerminalNode ORDINALITY() { return getToken(SqlBaseParser.ORDINALITY, 0); }
public UnnestContext(RelationPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterUnnest(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitUnnest(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitUnnest(this);
else return visitor.visitChildren(this);
}
}
public static class LateralContext extends RelationPrimaryContext {
public TerminalNode LATERAL() { return getToken(SqlBaseParser.LATERAL, 0); }
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public LateralContext(RelationPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterLateral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitLateral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitLateral(this);
else return visitor.visitChildren(this);
}
}
public static class TableNameContext extends RelationPrimaryContext {
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TableNameContext(RelationPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTableName(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTableName(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTableName(this);
else return visitor.visitChildren(this);
}
}
public final RelationPrimaryContext relationPrimary() throws RecognitionException {
RelationPrimaryContext _localctx = new RelationPrimaryContext(_ctx, getState());
enterRule(_localctx, 82, RULE_relationPrimary);
int _la;
try {
setState(1147);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,146,_ctx) ) {
case 1:
_localctx = new TableNameContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1118);
qualifiedName();
}
break;
case 2:
_localctx = new SubqueryRelationContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1119);
match(T__1);
setState(1120);
query();
setState(1121);
match(T__2);
}
break;
case 3:
_localctx = new UnnestContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1123);
match(UNNEST);
setState(1124);
match(T__1);
setState(1125);
expression();
setState(1130);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1126);
match(T__3);
setState(1127);
expression();
}
}
setState(1132);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1133);
match(T__2);
setState(1136);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,145,_ctx) ) {
case 1:
{
setState(1134);
match(WITH);
setState(1135);
match(ORDINALITY);
}
break;
}
}
break;
case 4:
_localctx = new LateralContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1138);
match(LATERAL);
setState(1139);
match(T__1);
setState(1140);
query();
setState(1141);
match(T__2);
}
break;
case 5:
_localctx = new ParenthesizedRelationContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(1143);
match(T__1);
setState(1144);
relation(0);
setState(1145);
match(T__2);
}
break;
}
}
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 BooleanExpressionContext booleanExpression() {
return getRuleContext(BooleanExpressionContext.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 SqlBaseListener ) ((SqlBaseListener)listener).enterExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExpression(this);
else return visitor.visitChildren(this);
}
}
public final ExpressionContext expression() throws RecognitionException {
ExpressionContext _localctx = new ExpressionContext(_ctx, getState());
enterRule(_localctx, 84, RULE_expression);
try {
enterOuterAlt(_localctx, 1);
{
setState(1149);
booleanExpression(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class BooleanExpressionContext extends ParserRuleContext {
public BooleanExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_booleanExpression; }
public BooleanExpressionContext() { }
public void copyFrom(BooleanExpressionContext ctx) {
super.copyFrom(ctx);
}
}
public static class LogicalNotContext extends BooleanExpressionContext {
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public BooleanExpressionContext booleanExpression() {
return getRuleContext(BooleanExpressionContext.class,0);
}
public LogicalNotContext(BooleanExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterLogicalNot(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitLogicalNot(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitLogicalNot(this);
else return visitor.visitChildren(this);
}
}
public static class PredicatedContext extends BooleanExpressionContext {
public ValueExpressionContext valueExpression;
public ValueExpressionContext valueExpression() {
return getRuleContext(ValueExpressionContext.class,0);
}
public PredicateContext predicate() {
return getRuleContext(PredicateContext.class,0);
}
public PredicatedContext(BooleanExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterPredicated(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitPredicated(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitPredicated(this);
else return visitor.visitChildren(this);
}
}
public static class LogicalBinaryContext extends BooleanExpressionContext {
public BooleanExpressionContext left;
public Token operator;
public BooleanExpressionContext right;
public List booleanExpression() {
return getRuleContexts(BooleanExpressionContext.class);
}
public BooleanExpressionContext booleanExpression(int i) {
return getRuleContext(BooleanExpressionContext.class,i);
}
public TerminalNode AND() { return getToken(SqlBaseParser.AND, 0); }
public TerminalNode OR() { return getToken(SqlBaseParser.OR, 0); }
public LogicalBinaryContext(BooleanExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterLogicalBinary(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitLogicalBinary(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitLogicalBinary(this);
else return visitor.visitChildren(this);
}
}
public final BooleanExpressionContext booleanExpression() throws RecognitionException {
return booleanExpression(0);
}
private BooleanExpressionContext booleanExpression(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
BooleanExpressionContext _localctx = new BooleanExpressionContext(_ctx, _parentState);
BooleanExpressionContext _prevctx = _localctx;
int _startState = 86;
enterRecursionRule(_localctx, 86, RULE_booleanExpression, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1158);
_errHandler.sync(this);
switch (_input.LA(1)) {
case T__1:
case T__4:
case ADD:
case ADMIN:
case ALL:
case ANALYZE:
case ANY:
case ARRAY:
case ASC:
case AT:
case BERNOULLI:
case CALL:
case CALLED:
case CASCADE:
case CASE:
case CAST:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case CURRENT_DATE:
case CURRENT_ROLE:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DETERMINISTIC:
case DISTRIBUTED:
case EXCLUDING:
case EXISTS:
case EXPLAIN:
case EXTRACT:
case EXTERNAL:
case FALSE:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTION:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case GROUPING:
case HOUR:
case IF:
case IGNORE:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LANGUAGE:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
case NAME:
case NFC:
case NFD:
case NFKC:
case NFKD:
case NO:
case NONE:
case NORMALIZE:
case NULL:
case NULLIF:
case NULLS:
case ONLY:
case OPTION:
case ORDINALITY:
case OUTPUT:
case OVER:
case PARTITION:
case PARTITIONS:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESPECT:
case RESTRICT:
case RETURN:
case RETURNS:
case REVOKE:
case ROLE:
case ROLES:
case ROLLBACK:
case ROW:
case ROWS:
case SCHEMA:
case SCHEMAS:
case SECOND:
case SECURITY:
case SERIALIZABLE:
case SESSION:
case SET:
case SETS:
case SHOW:
case SOME:
case SQL:
case START:
case STATS:
case SUBSTRING:
case SYSTEM:
case TABLES:
case TABLESAMPLE:
case TEXT:
case TIME:
case TIMESTAMP:
case TO:
case TRANSACTION:
case TRUE:
case TRY_CAST:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case USE:
case USER:
case VALIDATE:
case VERBOSE:
case VIEW:
case WORK:
case WRITE:
case YEAR:
case ZONE:
case PLUS:
case MINUS:
case STRING:
case UNICODE_STRING:
case BINARY_LITERAL:
case INTEGER_VALUE:
case DECIMAL_VALUE:
case DOUBLE_VALUE:
case IDENTIFIER:
case DIGIT_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACKQUOTED_IDENTIFIER:
case DOUBLE_PRECISION:
{
_localctx = new PredicatedContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1152);
((PredicatedContext)_localctx).valueExpression = valueExpression(0);
setState(1154);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,147,_ctx) ) {
case 1:
{
setState(1153);
predicate(((PredicatedContext)_localctx).valueExpression);
}
break;
}
}
break;
case NOT:
{
_localctx = new LogicalNotContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1156);
match(NOT);
setState(1157);
booleanExpression(3);
}
break;
default:
throw new NoViableAltException(this);
}
_ctx.stop = _input.LT(-1);
setState(1168);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,150,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(1166);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,149,_ctx) ) {
case 1:
{
_localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState));
((LogicalBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
setState(1160);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1161);
((LogicalBinaryContext)_localctx).operator = match(AND);
setState(1162);
((LogicalBinaryContext)_localctx).right = booleanExpression(3);
}
break;
case 2:
{
_localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState));
((LogicalBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
setState(1163);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
setState(1164);
((LogicalBinaryContext)_localctx).operator = match(OR);
setState(1165);
((LogicalBinaryContext)_localctx).right = booleanExpression(2);
}
break;
}
}
}
setState(1170);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,150,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
public static class PredicateContext extends ParserRuleContext {
public ParserRuleContext value;
public PredicateContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); }
public PredicateContext(ParserRuleContext parent, int invokingState, ParserRuleContext value) {
super(parent, invokingState);
this.value = value;
}
@Override public int getRuleIndex() { return RULE_predicate; }
public PredicateContext() { }
public void copyFrom(PredicateContext ctx) {
super.copyFrom(ctx);
this.value = ctx.value;
}
}
public static class ComparisonContext extends PredicateContext {
public ValueExpressionContext right;
public ComparisonOperatorContext comparisonOperator() {
return getRuleContext(ComparisonOperatorContext.class,0);
}
public ValueExpressionContext valueExpression() {
return getRuleContext(ValueExpressionContext.class,0);
}
public ComparisonContext(PredicateContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterComparison(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitComparison(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitComparison(this);
else return visitor.visitChildren(this);
}
}
public static class LikeContext extends PredicateContext {
public ValueExpressionContext pattern;
public ValueExpressionContext escape;
public TerminalNode LIKE() { return getToken(SqlBaseParser.LIKE, 0); }
public List valueExpression() {
return getRuleContexts(ValueExpressionContext.class);
}
public ValueExpressionContext valueExpression(int i) {
return getRuleContext(ValueExpressionContext.class,i);
}
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public TerminalNode ESCAPE() { return getToken(SqlBaseParser.ESCAPE, 0); }
public LikeContext(PredicateContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterLike(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitLike(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitLike(this);
else return visitor.visitChildren(this);
}
}
public static class InSubqueryContext extends PredicateContext {
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public InSubqueryContext(PredicateContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterInSubquery(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitInSubquery(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitInSubquery(this);
else return visitor.visitChildren(this);
}
}
public static class DistinctFromContext extends PredicateContext {
public ValueExpressionContext right;
public TerminalNode IS() { return getToken(SqlBaseParser.IS, 0); }
public TerminalNode DISTINCT() { return getToken(SqlBaseParser.DISTINCT, 0); }
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public ValueExpressionContext valueExpression() {
return getRuleContext(ValueExpressionContext.class,0);
}
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public DistinctFromContext(PredicateContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDistinctFrom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDistinctFrom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDistinctFrom(this);
else return visitor.visitChildren(this);
}
}
public static class InListContext extends PredicateContext {
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public InListContext(PredicateContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterInList(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitInList(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitInList(this);
else return visitor.visitChildren(this);
}
}
public static class NullPredicateContext extends PredicateContext {
public TerminalNode IS() { return getToken(SqlBaseParser.IS, 0); }
public TerminalNode NULL() { return getToken(SqlBaseParser.NULL, 0); }
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public NullPredicateContext(PredicateContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNullPredicate(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNullPredicate(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNullPredicate(this);
else return visitor.visitChildren(this);
}
}
public static class BetweenContext extends PredicateContext {
public ValueExpressionContext lower;
public ValueExpressionContext upper;
public TerminalNode BETWEEN() { return getToken(SqlBaseParser.BETWEEN, 0); }
public TerminalNode AND() { return getToken(SqlBaseParser.AND, 0); }
public List valueExpression() {
return getRuleContexts(ValueExpressionContext.class);
}
public ValueExpressionContext valueExpression(int i) {
return getRuleContext(ValueExpressionContext.class,i);
}
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public BetweenContext(PredicateContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterBetween(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitBetween(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitBetween(this);
else return visitor.visitChildren(this);
}
}
public static class QuantifiedComparisonContext extends PredicateContext {
public ComparisonOperatorContext comparisonOperator() {
return getRuleContext(ComparisonOperatorContext.class,0);
}
public ComparisonQuantifierContext comparisonQuantifier() {
return getRuleContext(ComparisonQuantifierContext.class,0);
}
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public QuantifiedComparisonContext(PredicateContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterQuantifiedComparison(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitQuantifiedComparison(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitQuantifiedComparison(this);
else return visitor.visitChildren(this);
}
}
public final PredicateContext predicate(ParserRuleContext value) throws RecognitionException {
PredicateContext _localctx = new PredicateContext(_ctx, getState(), value);
enterRule(_localctx, 88, RULE_predicate);
int _la;
try {
setState(1232);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,159,_ctx) ) {
case 1:
_localctx = new ComparisonContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1171);
comparisonOperator();
setState(1172);
((ComparisonContext)_localctx).right = valueExpression(0);
}
break;
case 2:
_localctx = new QuantifiedComparisonContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1174);
comparisonOperator();
setState(1175);
comparisonQuantifier();
setState(1176);
match(T__1);
setState(1177);
query();
setState(1178);
match(T__2);
}
break;
case 3:
_localctx = new BetweenContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1181);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1180);
match(NOT);
}
}
setState(1183);
match(BETWEEN);
setState(1184);
((BetweenContext)_localctx).lower = valueExpression(0);
setState(1185);
match(AND);
setState(1186);
((BetweenContext)_localctx).upper = valueExpression(0);
}
break;
case 4:
_localctx = new InListContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1189);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1188);
match(NOT);
}
}
setState(1191);
match(IN);
setState(1192);
match(T__1);
setState(1193);
expression();
setState(1198);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1194);
match(T__3);
setState(1195);
expression();
}
}
setState(1200);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1201);
match(T__2);
}
break;
case 5:
_localctx = new InSubqueryContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(1204);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1203);
match(NOT);
}
}
setState(1206);
match(IN);
setState(1207);
match(T__1);
setState(1208);
query();
setState(1209);
match(T__2);
}
break;
case 6:
_localctx = new LikeContext(_localctx);
enterOuterAlt(_localctx, 6);
{
setState(1212);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1211);
match(NOT);
}
}
setState(1214);
match(LIKE);
setState(1215);
((LikeContext)_localctx).pattern = valueExpression(0);
setState(1218);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,156,_ctx) ) {
case 1:
{
setState(1216);
match(ESCAPE);
setState(1217);
((LikeContext)_localctx).escape = valueExpression(0);
}
break;
}
}
break;
case 7:
_localctx = new NullPredicateContext(_localctx);
enterOuterAlt(_localctx, 7);
{
setState(1220);
match(IS);
setState(1222);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1221);
match(NOT);
}
}
setState(1224);
match(NULL);
}
break;
case 8:
_localctx = new DistinctFromContext(_localctx);
enterOuterAlt(_localctx, 8);
{
setState(1225);
match(IS);
setState(1227);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1226);
match(NOT);
}
}
setState(1229);
match(DISTINCT);
setState(1230);
match(FROM);
setState(1231);
((DistinctFromContext)_localctx).right = valueExpression(0);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ValueExpressionContext extends ParserRuleContext {
public ValueExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_valueExpression; }
public ValueExpressionContext() { }
public void copyFrom(ValueExpressionContext ctx) {
super.copyFrom(ctx);
}
}
public static class ValueExpressionDefaultContext extends ValueExpressionContext {
public PrimaryExpressionContext primaryExpression() {
return getRuleContext(PrimaryExpressionContext.class,0);
}
public ValueExpressionDefaultContext(ValueExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterValueExpressionDefault(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitValueExpressionDefault(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitValueExpressionDefault(this);
else return visitor.visitChildren(this);
}
}
public static class ConcatenationContext extends ValueExpressionContext {
public ValueExpressionContext left;
public ValueExpressionContext right;
public TerminalNode CONCAT() { return getToken(SqlBaseParser.CONCAT, 0); }
public List valueExpression() {
return getRuleContexts(ValueExpressionContext.class);
}
public ValueExpressionContext valueExpression(int i) {
return getRuleContext(ValueExpressionContext.class,i);
}
public ConcatenationContext(ValueExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterConcatenation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitConcatenation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitConcatenation(this);
else return visitor.visitChildren(this);
}
}
public static class ArithmeticBinaryContext extends ValueExpressionContext {
public ValueExpressionContext left;
public Token operator;
public ValueExpressionContext right;
public List valueExpression() {
return getRuleContexts(ValueExpressionContext.class);
}
public ValueExpressionContext valueExpression(int i) {
return getRuleContext(ValueExpressionContext.class,i);
}
public TerminalNode ASTERISK() { return getToken(SqlBaseParser.ASTERISK, 0); }
public TerminalNode SLASH() { return getToken(SqlBaseParser.SLASH, 0); }
public TerminalNode PERCENT() { return getToken(SqlBaseParser.PERCENT, 0); }
public TerminalNode PLUS() { return getToken(SqlBaseParser.PLUS, 0); }
public TerminalNode MINUS() { return getToken(SqlBaseParser.MINUS, 0); }
public ArithmeticBinaryContext(ValueExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterArithmeticBinary(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitArithmeticBinary(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitArithmeticBinary(this);
else return visitor.visitChildren(this);
}
}
public static class ArithmeticUnaryContext extends ValueExpressionContext {
public Token operator;
public ValueExpressionContext valueExpression() {
return getRuleContext(ValueExpressionContext.class,0);
}
public TerminalNode MINUS() { return getToken(SqlBaseParser.MINUS, 0); }
public TerminalNode PLUS() { return getToken(SqlBaseParser.PLUS, 0); }
public ArithmeticUnaryContext(ValueExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterArithmeticUnary(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitArithmeticUnary(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitArithmeticUnary(this);
else return visitor.visitChildren(this);
}
}
public static class AtTimeZoneContext extends ValueExpressionContext {
public ValueExpressionContext valueExpression() {
return getRuleContext(ValueExpressionContext.class,0);
}
public TerminalNode AT() { return getToken(SqlBaseParser.AT, 0); }
public TimeZoneSpecifierContext timeZoneSpecifier() {
return getRuleContext(TimeZoneSpecifierContext.class,0);
}
public AtTimeZoneContext(ValueExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterAtTimeZone(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitAtTimeZone(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitAtTimeZone(this);
else return visitor.visitChildren(this);
}
}
public final ValueExpressionContext valueExpression() throws RecognitionException {
return valueExpression(0);
}
private ValueExpressionContext valueExpression(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
ValueExpressionContext _localctx = new ValueExpressionContext(_ctx, _parentState);
ValueExpressionContext _prevctx = _localctx;
int _startState = 90;
enterRecursionRule(_localctx, 90, RULE_valueExpression, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1238);
_errHandler.sync(this);
switch (_input.LA(1)) {
case T__1:
case T__4:
case ADD:
case ADMIN:
case ALL:
case ANALYZE:
case ANY:
case ARRAY:
case ASC:
case AT:
case BERNOULLI:
case CALL:
case CALLED:
case CASCADE:
case CASE:
case CAST:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case CURRENT_DATE:
case CURRENT_ROLE:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DETERMINISTIC:
case DISTRIBUTED:
case EXCLUDING:
case EXISTS:
case EXPLAIN:
case EXTRACT:
case EXTERNAL:
case FALSE:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTION:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case GROUPING:
case HOUR:
case IF:
case IGNORE:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LANGUAGE:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
case NAME:
case NFC:
case NFD:
case NFKC:
case NFKD:
case NO:
case NONE:
case NORMALIZE:
case NULL:
case NULLIF:
case NULLS:
case ONLY:
case OPTION:
case ORDINALITY:
case OUTPUT:
case OVER:
case PARTITION:
case PARTITIONS:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESPECT:
case RESTRICT:
case RETURN:
case RETURNS:
case REVOKE:
case ROLE:
case ROLES:
case ROLLBACK:
case ROW:
case ROWS:
case SCHEMA:
case SCHEMAS:
case SECOND:
case SECURITY:
case SERIALIZABLE:
case SESSION:
case SET:
case SETS:
case SHOW:
case SOME:
case SQL:
case START:
case STATS:
case SUBSTRING:
case SYSTEM:
case TABLES:
case TABLESAMPLE:
case TEXT:
case TIME:
case TIMESTAMP:
case TO:
case TRANSACTION:
case TRUE:
case TRY_CAST:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case USE:
case USER:
case VALIDATE:
case VERBOSE:
case VIEW:
case WORK:
case WRITE:
case YEAR:
case ZONE:
case STRING:
case UNICODE_STRING:
case BINARY_LITERAL:
case INTEGER_VALUE:
case DECIMAL_VALUE:
case DOUBLE_VALUE:
case IDENTIFIER:
case DIGIT_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACKQUOTED_IDENTIFIER:
case DOUBLE_PRECISION:
{
_localctx = new ValueExpressionDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1235);
primaryExpression(0);
}
break;
case PLUS:
case MINUS:
{
_localctx = new ArithmeticUnaryContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1236);
((ArithmeticUnaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
((ArithmeticUnaryContext)_localctx).operator = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1237);
valueExpression(4);
}
break;
default:
throw new NoViableAltException(this);
}
_ctx.stop = _input.LT(-1);
setState(1254);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,162,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(1252);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,161,_ctx) ) {
case 1:
{
_localctx = new ArithmeticBinaryContext(new ValueExpressionContext(_parentctx, _parentState));
((ArithmeticBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
setState(1240);
if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)");
setState(1241);
((ArithmeticBinaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(((((_la - 217)) & ~0x3f) == 0 && ((1L << (_la - 217)) & ((1L << (ASTERISK - 217)) | (1L << (SLASH - 217)) | (1L << (PERCENT - 217)))) != 0)) ) {
((ArithmeticBinaryContext)_localctx).operator = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1242);
((ArithmeticBinaryContext)_localctx).right = valueExpression(4);
}
break;
case 2:
{
_localctx = new ArithmeticBinaryContext(new ValueExpressionContext(_parentctx, _parentState));
((ArithmeticBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
setState(1243);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1244);
((ArithmeticBinaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
((ArithmeticBinaryContext)_localctx).operator = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1245);
((ArithmeticBinaryContext)_localctx).right = valueExpression(3);
}
break;
case 3:
{
_localctx = new ConcatenationContext(new ValueExpressionContext(_parentctx, _parentState));
((ConcatenationContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
setState(1246);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
setState(1247);
match(CONCAT);
setState(1248);
((ConcatenationContext)_localctx).right = valueExpression(2);
}
break;
case 4:
{
_localctx = new AtTimeZoneContext(new ValueExpressionContext(_parentctx, _parentState));
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
setState(1249);
if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)");
setState(1250);
match(AT);
setState(1251);
timeZoneSpecifier();
}
break;
}
}
}
setState(1256);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,162,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
public static class PrimaryExpressionContext extends ParserRuleContext {
public PrimaryExpressionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_primaryExpression; }
public PrimaryExpressionContext() { }
public void copyFrom(PrimaryExpressionContext ctx) {
super.copyFrom(ctx);
}
}
public static class DereferenceContext extends PrimaryExpressionContext {
public PrimaryExpressionContext base;
public IdentifierContext fieldName;
public PrimaryExpressionContext primaryExpression() {
return getRuleContext(PrimaryExpressionContext.class,0);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public DereferenceContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDereference(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDereference(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDereference(this);
else return visitor.visitChildren(this);
}
}
public static class TypeConstructorContext extends PrimaryExpressionContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public TerminalNode DOUBLE_PRECISION() { return getToken(SqlBaseParser.DOUBLE_PRECISION, 0); }
public TypeConstructorContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTypeConstructor(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTypeConstructor(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTypeConstructor(this);
else return visitor.visitChildren(this);
}
}
public static class SpecialDateTimeFunctionContext extends PrimaryExpressionContext {
public Token name;
public Token precision;
public TerminalNode CURRENT_DATE() { return getToken(SqlBaseParser.CURRENT_DATE, 0); }
public TerminalNode CURRENT_TIME() { return getToken(SqlBaseParser.CURRENT_TIME, 0); }
public TerminalNode INTEGER_VALUE() { return getToken(SqlBaseParser.INTEGER_VALUE, 0); }
public TerminalNode CURRENT_TIMESTAMP() { return getToken(SqlBaseParser.CURRENT_TIMESTAMP, 0); }
public TerminalNode LOCALTIME() { return getToken(SqlBaseParser.LOCALTIME, 0); }
public TerminalNode LOCALTIMESTAMP() { return getToken(SqlBaseParser.LOCALTIMESTAMP, 0); }
public SpecialDateTimeFunctionContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSpecialDateTimeFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSpecialDateTimeFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSpecialDateTimeFunction(this);
else return visitor.visitChildren(this);
}
}
public static class SubstringContext extends PrimaryExpressionContext {
public TerminalNode SUBSTRING() { return getToken(SqlBaseParser.SUBSTRING, 0); }
public List valueExpression() {
return getRuleContexts(ValueExpressionContext.class);
}
public ValueExpressionContext valueExpression(int i) {
return getRuleContext(ValueExpressionContext.class,i);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public TerminalNode FOR() { return getToken(SqlBaseParser.FOR, 0); }
public SubstringContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSubstring(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSubstring(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSubstring(this);
else return visitor.visitChildren(this);
}
}
public static class CastContext extends PrimaryExpressionContext {
public TerminalNode CAST() { return getToken(SqlBaseParser.CAST, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode TRY_CAST() { return getToken(SqlBaseParser.TRY_CAST, 0); }
public CastContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCast(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCast(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCast(this);
else return visitor.visitChildren(this);
}
}
public static class LambdaContext extends PrimaryExpressionContext {
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public LambdaContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterLambda(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitLambda(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitLambda(this);
else return visitor.visitChildren(this);
}
}
public static class ParenthesizedExpressionContext extends PrimaryExpressionContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public ParenthesizedExpressionContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterParenthesizedExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitParenthesizedExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitParenthesizedExpression(this);
else return visitor.visitChildren(this);
}
}
public static class ParameterContext extends PrimaryExpressionContext {
public ParameterContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterParameter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitParameter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitParameter(this);
else return visitor.visitChildren(this);
}
}
public static class NormalizeContext extends PrimaryExpressionContext {
public TerminalNode NORMALIZE() { return getToken(SqlBaseParser.NORMALIZE, 0); }
public ValueExpressionContext valueExpression() {
return getRuleContext(ValueExpressionContext.class,0);
}
public NormalFormContext normalForm() {
return getRuleContext(NormalFormContext.class,0);
}
public NormalizeContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNormalize(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNormalize(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNormalize(this);
else return visitor.visitChildren(this);
}
}
public static class IntervalLiteralContext extends PrimaryExpressionContext {
public IntervalContext interval() {
return getRuleContext(IntervalContext.class,0);
}
public IntervalLiteralContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterIntervalLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitIntervalLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitIntervalLiteral(this);
else return visitor.visitChildren(this);
}
}
public static class NumericLiteralContext extends PrimaryExpressionContext {
public NumberContext number() {
return getRuleContext(NumberContext.class,0);
}
public NumericLiteralContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNumericLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNumericLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNumericLiteral(this);
else return visitor.visitChildren(this);
}
}
public static class BooleanLiteralContext extends PrimaryExpressionContext {
public BooleanValueContext booleanValue() {
return getRuleContext(BooleanValueContext.class,0);
}
public BooleanLiteralContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterBooleanLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitBooleanLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitBooleanLiteral(this);
else return visitor.visitChildren(this);
}
}
public static class SimpleCaseContext extends PrimaryExpressionContext {
public ExpressionContext elseExpression;
public TerminalNode CASE() { return getToken(SqlBaseParser.CASE, 0); }
public ValueExpressionContext valueExpression() {
return getRuleContext(ValueExpressionContext.class,0);
}
public TerminalNode END() { return getToken(SqlBaseParser.END, 0); }
public List whenClause() {
return getRuleContexts(WhenClauseContext.class);
}
public WhenClauseContext whenClause(int i) {
return getRuleContext(WhenClauseContext.class,i);
}
public TerminalNode ELSE() { return getToken(SqlBaseParser.ELSE, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public SimpleCaseContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSimpleCase(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSimpleCase(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSimpleCase(this);
else return visitor.visitChildren(this);
}
}
public static class ColumnReferenceContext extends PrimaryExpressionContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public ColumnReferenceContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterColumnReference(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitColumnReference(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitColumnReference(this);
else return visitor.visitChildren(this);
}
}
public static class NullLiteralContext extends PrimaryExpressionContext {
public TerminalNode NULL() { return getToken(SqlBaseParser.NULL, 0); }
public NullLiteralContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNullLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNullLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNullLiteral(this);
else return visitor.visitChildren(this);
}
}
public static class RowConstructorContext extends PrimaryExpressionContext {
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public TerminalNode ROW() { return getToken(SqlBaseParser.ROW, 0); }
public RowConstructorContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRowConstructor(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRowConstructor(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRowConstructor(this);
else return visitor.visitChildren(this);
}
}
public static class SubscriptContext extends PrimaryExpressionContext {
public PrimaryExpressionContext value;
public ValueExpressionContext index;
public PrimaryExpressionContext primaryExpression() {
return getRuleContext(PrimaryExpressionContext.class,0);
}
public ValueExpressionContext valueExpression() {
return getRuleContext(ValueExpressionContext.class,0);
}
public SubscriptContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSubscript(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSubscript(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSubscript(this);
else return visitor.visitChildren(this);
}
}
public static class SubqueryExpressionContext extends PrimaryExpressionContext {
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public SubqueryExpressionContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSubqueryExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSubqueryExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSubqueryExpression(this);
else return visitor.visitChildren(this);
}
}
public static class BinaryLiteralContext extends PrimaryExpressionContext {
public TerminalNode BINARY_LITERAL() { return getToken(SqlBaseParser.BINARY_LITERAL, 0); }
public BinaryLiteralContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterBinaryLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitBinaryLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitBinaryLiteral(this);
else return visitor.visitChildren(this);
}
}
public static class CurrentUserContext extends PrimaryExpressionContext {
public Token name;
public TerminalNode CURRENT_USER() { return getToken(SqlBaseParser.CURRENT_USER, 0); }
public CurrentUserContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCurrentUser(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCurrentUser(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCurrentUser(this);
else return visitor.visitChildren(this);
}
}
public static class ExtractContext extends PrimaryExpressionContext {
public TerminalNode EXTRACT() { return getToken(SqlBaseParser.EXTRACT, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public ValueExpressionContext valueExpression() {
return getRuleContext(ValueExpressionContext.class,0);
}
public ExtractContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterExtract(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExtract(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExtract(this);
else return visitor.visitChildren(this);
}
}
public static class StringLiteralContext extends PrimaryExpressionContext {
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public StringLiteralContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterStringLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitStringLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitStringLiteral(this);
else return visitor.visitChildren(this);
}
}
public static class ArrayConstructorContext extends PrimaryExpressionContext {
public TerminalNode ARRAY() { return getToken(SqlBaseParser.ARRAY, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public ArrayConstructorContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterArrayConstructor(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitArrayConstructor(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitArrayConstructor(this);
else return visitor.visitChildren(this);
}
}
public static class FunctionCallContext extends PrimaryExpressionContext {
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode ASTERISK() { return getToken(SqlBaseParser.ASTERISK, 0); }
public FilterContext filter() {
return getRuleContext(FilterContext.class,0);
}
public OverContext over() {
return getRuleContext(OverContext.class,0);
}
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public TerminalNode ORDER() { return getToken(SqlBaseParser.ORDER, 0); }
public TerminalNode BY() { return getToken(SqlBaseParser.BY, 0); }
public List sortItem() {
return getRuleContexts(SortItemContext.class);
}
public SortItemContext sortItem(int i) {
return getRuleContext(SortItemContext.class,i);
}
public SetQuantifierContext setQuantifier() {
return getRuleContext(SetQuantifierContext.class,0);
}
public NullTreatmentContext nullTreatment() {
return getRuleContext(NullTreatmentContext.class,0);
}
public FunctionCallContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterFunctionCall(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitFunctionCall(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitFunctionCall(this);
else return visitor.visitChildren(this);
}
}
public static class ExistsContext extends PrimaryExpressionContext {
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public ExistsContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterExists(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExists(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExists(this);
else return visitor.visitChildren(this);
}
}
public static class PositionContext extends PrimaryExpressionContext {
public TerminalNode POSITION() { return getToken(SqlBaseParser.POSITION, 0); }
public List valueExpression() {
return getRuleContexts(ValueExpressionContext.class);
}
public ValueExpressionContext valueExpression(int i) {
return getRuleContext(ValueExpressionContext.class,i);
}
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public PositionContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterPosition(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitPosition(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitPosition(this);
else return visitor.visitChildren(this);
}
}
public static class SearchedCaseContext extends PrimaryExpressionContext {
public ExpressionContext elseExpression;
public TerminalNode CASE() { return getToken(SqlBaseParser.CASE, 0); }
public TerminalNode END() { return getToken(SqlBaseParser.END, 0); }
public List whenClause() {
return getRuleContexts(WhenClauseContext.class);
}
public WhenClauseContext whenClause(int i) {
return getRuleContext(WhenClauseContext.class,i);
}
public TerminalNode ELSE() { return getToken(SqlBaseParser.ELSE, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public SearchedCaseContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSearchedCase(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSearchedCase(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSearchedCase(this);
else return visitor.visitChildren(this);
}
}
public static class GroupingOperationContext extends PrimaryExpressionContext {
public TerminalNode GROUPING() { return getToken(SqlBaseParser.GROUPING, 0); }
public List qualifiedName() {
return getRuleContexts(QualifiedNameContext.class);
}
public QualifiedNameContext qualifiedName(int i) {
return getRuleContext(QualifiedNameContext.class,i);
}
public GroupingOperationContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterGroupingOperation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitGroupingOperation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitGroupingOperation(this);
else return visitor.visitChildren(this);
}
}
public final PrimaryExpressionContext primaryExpression() throws RecognitionException {
return primaryExpression(0);
}
private PrimaryExpressionContext primaryExpression(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, _parentState);
PrimaryExpressionContext _prevctx = _localctx;
int _startState = 92;
enterRecursionRule(_localctx, 92, RULE_primaryExpression, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1496);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,191,_ctx) ) {
case 1:
{
_localctx = new NullLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1258);
match(NULL);
}
break;
case 2:
{
_localctx = new IntervalLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1259);
interval();
}
break;
case 3:
{
_localctx = new TypeConstructorContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1260);
identifier();
setState(1261);
string();
}
break;
case 4:
{
_localctx = new TypeConstructorContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1263);
match(DOUBLE_PRECISION);
setState(1264);
string();
}
break;
case 5:
{
_localctx = new NumericLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1265);
number();
}
break;
case 6:
{
_localctx = new BooleanLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1266);
booleanValue();
}
break;
case 7:
{
_localctx = new StringLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1267);
string();
}
break;
case 8:
{
_localctx = new BinaryLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1268);
match(BINARY_LITERAL);
}
break;
case 9:
{
_localctx = new ParameterContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1269);
match(T__4);
}
break;
case 10:
{
_localctx = new PositionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1270);
match(POSITION);
setState(1271);
match(T__1);
setState(1272);
valueExpression(0);
setState(1273);
match(IN);
setState(1274);
valueExpression(0);
setState(1275);
match(T__2);
}
break;
case 11:
{
_localctx = new RowConstructorContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1277);
match(T__1);
setState(1278);
expression();
setState(1281);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(1279);
match(T__3);
setState(1280);
expression();
}
}
setState(1283);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==T__3 );
setState(1285);
match(T__2);
}
break;
case 12:
{
_localctx = new RowConstructorContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1287);
match(ROW);
setState(1288);
match(T__1);
setState(1289);
expression();
setState(1294);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1290);
match(T__3);
setState(1291);
expression();
}
}
setState(1296);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1297);
match(T__2);
}
break;
case 13:
{
_localctx = new FunctionCallContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1299);
qualifiedName();
setState(1300);
match(T__1);
setState(1301);
match(ASTERISK);
setState(1302);
match(T__2);
setState(1304);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,165,_ctx) ) {
case 1:
{
setState(1303);
filter();
}
break;
}
setState(1307);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,166,_ctx) ) {
case 1:
{
setState(1306);
over();
}
break;
}
}
break;
case 14:
{
_localctx = new FunctionCallContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1309);
qualifiedName();
setState(1310);
match(T__1);
setState(1322);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__4) | (1L << ADD) | (1L << ADMIN) | (1L << ALL) | (1L << ANALYZE) | (1L << ANY) | (1L << ARRAY) | (1L << ASC) | (1L << AT) | (1L << BERNOULLI) | (1L << CALL) | (1L << CALLED) | (1L << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_ROLE) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DETERMINISTIC) | (1L << DISTINCT) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXPLAIN - 64)) | (1L << (EXTRACT - 64)) | (1L << (EXTERNAL - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 64)) | (1L << (FUNCTION - 64)) | (1L << (FUNCTIONS - 64)) | (1L << (GRANT - 64)) | (1L << (GRANTED - 64)) | (1L << (GRANTS - 64)) | (1L << (GRAPHVIZ - 64)) | (1L << (GROUPING - 64)) | (1L << (HOUR - 64)) | (1L << (IF - 64)) | (1L << (IGNORE - 64)) | (1L << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 64)) | (1L << (LANGUAGE - 64)) | (1L << (LAST - 64)) | (1L << (LATERAL - 64)) | (1L << (LEVEL - 64)) | (1L << (LIMIT - 64)) | (1L << (LOCALTIME - 64)) | (1L << (LOCALTIMESTAMP - 64)) | (1L << (LOGICAL - 64)) | (1L << (MAP - 64)) | (1L << (MINUTE - 64)) | (1L << (MONTH - 64)) | (1L << (NAME - 64)) | (1L << (NFC - 64)) | (1L << (NFD - 64)) | (1L << (NFKC - 64)) | (1L << (NFKD - 64)) | (1L << (NO - 64)) | (1L << (NONE - 64)) | (1L << (NORMALIZE - 64)) | (1L << (NOT - 64)) | (1L << (NULL - 64)) | (1L << (NULLIF - 64)) | (1L << (NULLS - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (ONLY - 128)) | (1L << (OPTION - 128)) | (1L << (ORDINALITY - 128)) | (1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (POSITION - 128)) | (1L << (PRECEDING - 128)) | (1L << (PRIVILEGES - 128)) | (1L << (PROPERTIES - 128)) | (1L << (RANGE - 128)) | (1L << (READ - 128)) | (1L << (RENAME - 128)) | (1L << (REPEATABLE - 128)) | (1L << (REPLACE - 128)) | (1L << (RESET - 128)) | (1L << (RESPECT - 128)) | (1L << (RESTRICT - 128)) | (1L << (RETURN - 128)) | (1L << (RETURNS - 128)) | (1L << (REVOKE - 128)) | (1L << (ROLE - 128)) | (1L << (ROLES - 128)) | (1L << (ROLLBACK - 128)) | (1L << (ROW - 128)) | (1L << (ROWS - 128)) | (1L << (SCHEMA - 128)) | (1L << (SCHEMAS - 128)) | (1L << (SECOND - 128)) | (1L << (SECURITY - 128)) | (1L << (SERIALIZABLE - 128)) | (1L << (SESSION - 128)) | (1L << (SET - 128)) | (1L << (SETS - 128)) | (1L << (SHOW - 128)) | (1L << (SOME - 128)) | (1L << (SQL - 128)) | (1L << (START - 128)) | (1L << (STATS - 128)) | (1L << (SUBSTRING - 128)) | (1L << (SYSTEM - 128)) | (1L << (TABLES - 128)) | (1L << (TABLESAMPLE - 128)) | (1L << (TEXT - 128)) | (1L << (TIME - 128)) | (1L << (TIMESTAMP - 128)) | (1L << (TO - 128)) | (1L << (TRANSACTION - 128)) | (1L << (TRUE - 128)) | (1L << (TRY_CAST - 128)) | (1L << (TYPE - 128)) | (1L << (UNBOUNDED - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & ((1L << (UNCOMMITTED - 192)) | (1L << (USE - 192)) | (1L << (USER - 192)) | (1L << (VALIDATE - 192)) | (1L << (VERBOSE - 192)) | (1L << (VIEW - 192)) | (1L << (WORK - 192)) | (1L << (WRITE - 192)) | (1L << (YEAR - 192)) | (1L << (ZONE - 192)) | (1L << (PLUS - 192)) | (1L << (MINUS - 192)) | (1L << (STRING - 192)) | (1L << (UNICODE_STRING - 192)) | (1L << (BINARY_LITERAL - 192)) | (1L << (INTEGER_VALUE - 192)) | (1L << (DECIMAL_VALUE - 192)) | (1L << (DOUBLE_VALUE - 192)) | (1L << (IDENTIFIER - 192)) | (1L << (DIGIT_IDENTIFIER - 192)) | (1L << (QUOTED_IDENTIFIER - 192)) | (1L << (BACKQUOTED_IDENTIFIER - 192)) | (1L << (DOUBLE_PRECISION - 192)))) != 0)) {
{
setState(1312);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,167,_ctx) ) {
case 1:
{
setState(1311);
setQuantifier();
}
break;
}
setState(1314);
expression();
setState(1319);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1315);
match(T__3);
setState(1316);
expression();
}
}
setState(1321);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1334);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1324);
match(ORDER);
setState(1325);
match(BY);
setState(1326);
sortItem();
setState(1331);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1327);
match(T__3);
setState(1328);
sortItem();
}
}
setState(1333);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1336);
match(T__2);
setState(1338);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,172,_ctx) ) {
case 1:
{
setState(1337);
filter();
}
break;
}
setState(1344);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,174,_ctx) ) {
case 1:
{
setState(1341);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IGNORE || _la==RESPECT) {
{
setState(1340);
nullTreatment();
}
}
setState(1343);
over();
}
break;
}
}
break;
case 15:
{
_localctx = new LambdaContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1346);
identifier();
setState(1347);
match(T__5);
setState(1348);
expression();
}
break;
case 16:
{
_localctx = new LambdaContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1350);
match(T__1);
setState(1359);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ADD) | (1L << ADMIN) | (1L << ALL) | (1L << ANALYZE) | (1L << ANY) | (1L << ARRAY) | (1L << ASC) | (1L << AT) | (1L << BERNOULLI) | (1L << CALL) | (1L << CALLED) | (1L << CASCADE) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_ROLE) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DETERMINISTIC) | (1L << DISTRIBUTED) | (1L << EXCLUDING))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXPLAIN - 64)) | (1L << (EXTERNAL - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 64)) | (1L << (FUNCTION - 64)) | (1L << (FUNCTIONS - 64)) | (1L << (GRANT - 64)) | (1L << (GRANTED - 64)) | (1L << (GRANTS - 64)) | (1L << (GRAPHVIZ - 64)) | (1L << (HOUR - 64)) | (1L << (IF - 64)) | (1L << (IGNORE - 64)) | (1L << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 64)) | (1L << (LANGUAGE - 64)) | (1L << (LAST - 64)) | (1L << (LATERAL - 64)) | (1L << (LEVEL - 64)) | (1L << (LIMIT - 64)) | (1L << (LOGICAL - 64)) | (1L << (MAP - 64)) | (1L << (MINUTE - 64)) | (1L << (MONTH - 64)) | (1L << (NAME - 64)) | (1L << (NFC - 64)) | (1L << (NFD - 64)) | (1L << (NFKC - 64)) | (1L << (NFKD - 64)) | (1L << (NO - 64)) | (1L << (NONE - 64)) | (1L << (NULLIF - 64)) | (1L << (NULLS - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (ONLY - 128)) | (1L << (OPTION - 128)) | (1L << (ORDINALITY - 128)) | (1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (POSITION - 128)) | (1L << (PRECEDING - 128)) | (1L << (PRIVILEGES - 128)) | (1L << (PROPERTIES - 128)) | (1L << (RANGE - 128)) | (1L << (READ - 128)) | (1L << (RENAME - 128)) | (1L << (REPEATABLE - 128)) | (1L << (REPLACE - 128)) | (1L << (RESET - 128)) | (1L << (RESPECT - 128)) | (1L << (RESTRICT - 128)) | (1L << (RETURN - 128)) | (1L << (RETURNS - 128)) | (1L << (REVOKE - 128)) | (1L << (ROLE - 128)) | (1L << (ROLES - 128)) | (1L << (ROLLBACK - 128)) | (1L << (ROW - 128)) | (1L << (ROWS - 128)) | (1L << (SCHEMA - 128)) | (1L << (SCHEMAS - 128)) | (1L << (SECOND - 128)) | (1L << (SECURITY - 128)) | (1L << (SERIALIZABLE - 128)) | (1L << (SESSION - 128)) | (1L << (SET - 128)) | (1L << (SETS - 128)) | (1L << (SHOW - 128)) | (1L << (SOME - 128)) | (1L << (SQL - 128)) | (1L << (START - 128)) | (1L << (STATS - 128)) | (1L << (SUBSTRING - 128)) | (1L << (SYSTEM - 128)) | (1L << (TABLES - 128)) | (1L << (TABLESAMPLE - 128)) | (1L << (TEXT - 128)) | (1L << (TIME - 128)) | (1L << (TIMESTAMP - 128)) | (1L << (TO - 128)) | (1L << (TRANSACTION - 128)) | (1L << (TRY_CAST - 128)) | (1L << (TYPE - 128)) | (1L << (UNBOUNDED - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & ((1L << (UNCOMMITTED - 192)) | (1L << (USE - 192)) | (1L << (USER - 192)) | (1L << (VALIDATE - 192)) | (1L << (VERBOSE - 192)) | (1L << (VIEW - 192)) | (1L << (WORK - 192)) | (1L << (WRITE - 192)) | (1L << (YEAR - 192)) | (1L << (ZONE - 192)) | (1L << (IDENTIFIER - 192)) | (1L << (DIGIT_IDENTIFIER - 192)) | (1L << (QUOTED_IDENTIFIER - 192)) | (1L << (BACKQUOTED_IDENTIFIER - 192)))) != 0)) {
{
setState(1351);
identifier();
setState(1356);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1352);
match(T__3);
setState(1353);
identifier();
}
}
setState(1358);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1361);
match(T__2);
setState(1362);
match(T__5);
setState(1363);
expression();
}
break;
case 17:
{
_localctx = new SubqueryExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1364);
match(T__1);
setState(1365);
query();
setState(1366);
match(T__2);
}
break;
case 18:
{
_localctx = new ExistsContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1368);
match(EXISTS);
setState(1369);
match(T__1);
setState(1370);
query();
setState(1371);
match(T__2);
}
break;
case 19:
{
_localctx = new SimpleCaseContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1373);
match(CASE);
setState(1374);
valueExpression(0);
setState(1376);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(1375);
whenClause();
}
}
setState(1378);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==WHEN );
setState(1382);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ELSE) {
{
setState(1380);
match(ELSE);
setState(1381);
((SimpleCaseContext)_localctx).elseExpression = expression();
}
}
setState(1384);
match(END);
}
break;
case 20:
{
_localctx = new SearchedCaseContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1386);
match(CASE);
setState(1388);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(1387);
whenClause();
}
}
setState(1390);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==WHEN );
setState(1394);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ELSE) {
{
setState(1392);
match(ELSE);
setState(1393);
((SearchedCaseContext)_localctx).elseExpression = expression();
}
}
setState(1396);
match(END);
}
break;
case 21:
{
_localctx = new CastContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1398);
match(CAST);
setState(1399);
match(T__1);
setState(1400);
expression();
setState(1401);
match(AS);
setState(1402);
type(0);
setState(1403);
match(T__2);
}
break;
case 22:
{
_localctx = new CastContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1405);
match(TRY_CAST);
setState(1406);
match(T__1);
setState(1407);
expression();
setState(1408);
match(AS);
setState(1409);
type(0);
setState(1410);
match(T__2);
}
break;
case 23:
{
_localctx = new ArrayConstructorContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1412);
match(ARRAY);
setState(1413);
match(T__6);
setState(1422);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__4) | (1L << ADD) | (1L << ADMIN) | (1L << ALL) | (1L << ANALYZE) | (1L << ANY) | (1L << ARRAY) | (1L << ASC) | (1L << AT) | (1L << BERNOULLI) | (1L << CALL) | (1L << CALLED) | (1L << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_ROLE) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DETERMINISTIC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXPLAIN - 64)) | (1L << (EXTRACT - 64)) | (1L << (EXTERNAL - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 64)) | (1L << (FUNCTION - 64)) | (1L << (FUNCTIONS - 64)) | (1L << (GRANT - 64)) | (1L << (GRANTED - 64)) | (1L << (GRANTS - 64)) | (1L << (GRAPHVIZ - 64)) | (1L << (GROUPING - 64)) | (1L << (HOUR - 64)) | (1L << (IF - 64)) | (1L << (IGNORE - 64)) | (1L << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 64)) | (1L << (LANGUAGE - 64)) | (1L << (LAST - 64)) | (1L << (LATERAL - 64)) | (1L << (LEVEL - 64)) | (1L << (LIMIT - 64)) | (1L << (LOCALTIME - 64)) | (1L << (LOCALTIMESTAMP - 64)) | (1L << (LOGICAL - 64)) | (1L << (MAP - 64)) | (1L << (MINUTE - 64)) | (1L << (MONTH - 64)) | (1L << (NAME - 64)) | (1L << (NFC - 64)) | (1L << (NFD - 64)) | (1L << (NFKC - 64)) | (1L << (NFKD - 64)) | (1L << (NO - 64)) | (1L << (NONE - 64)) | (1L << (NORMALIZE - 64)) | (1L << (NOT - 64)) | (1L << (NULL - 64)) | (1L << (NULLIF - 64)) | (1L << (NULLS - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (ONLY - 128)) | (1L << (OPTION - 128)) | (1L << (ORDINALITY - 128)) | (1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (POSITION - 128)) | (1L << (PRECEDING - 128)) | (1L << (PRIVILEGES - 128)) | (1L << (PROPERTIES - 128)) | (1L << (RANGE - 128)) | (1L << (READ - 128)) | (1L << (RENAME - 128)) | (1L << (REPEATABLE - 128)) | (1L << (REPLACE - 128)) | (1L << (RESET - 128)) | (1L << (RESPECT - 128)) | (1L << (RESTRICT - 128)) | (1L << (RETURN - 128)) | (1L << (RETURNS - 128)) | (1L << (REVOKE - 128)) | (1L << (ROLE - 128)) | (1L << (ROLES - 128)) | (1L << (ROLLBACK - 128)) | (1L << (ROW - 128)) | (1L << (ROWS - 128)) | (1L << (SCHEMA - 128)) | (1L << (SCHEMAS - 128)) | (1L << (SECOND - 128)) | (1L << (SECURITY - 128)) | (1L << (SERIALIZABLE - 128)) | (1L << (SESSION - 128)) | (1L << (SET - 128)) | (1L << (SETS - 128)) | (1L << (SHOW - 128)) | (1L << (SOME - 128)) | (1L << (SQL - 128)) | (1L << (START - 128)) | (1L << (STATS - 128)) | (1L << (SUBSTRING - 128)) | (1L << (SYSTEM - 128)) | (1L << (TABLES - 128)) | (1L << (TABLESAMPLE - 128)) | (1L << (TEXT - 128)) | (1L << (TIME - 128)) | (1L << (TIMESTAMP - 128)) | (1L << (TO - 128)) | (1L << (TRANSACTION - 128)) | (1L << (TRUE - 128)) | (1L << (TRY_CAST - 128)) | (1L << (TYPE - 128)) | (1L << (UNBOUNDED - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & ((1L << (UNCOMMITTED - 192)) | (1L << (USE - 192)) | (1L << (USER - 192)) | (1L << (VALIDATE - 192)) | (1L << (VERBOSE - 192)) | (1L << (VIEW - 192)) | (1L << (WORK - 192)) | (1L << (WRITE - 192)) | (1L << (YEAR - 192)) | (1L << (ZONE - 192)) | (1L << (PLUS - 192)) | (1L << (MINUS - 192)) | (1L << (STRING - 192)) | (1L << (UNICODE_STRING - 192)) | (1L << (BINARY_LITERAL - 192)) | (1L << (INTEGER_VALUE - 192)) | (1L << (DECIMAL_VALUE - 192)) | (1L << (DOUBLE_VALUE - 192)) | (1L << (IDENTIFIER - 192)) | (1L << (DIGIT_IDENTIFIER - 192)) | (1L << (QUOTED_IDENTIFIER - 192)) | (1L << (BACKQUOTED_IDENTIFIER - 192)) | (1L << (DOUBLE_PRECISION - 192)))) != 0)) {
{
setState(1414);
expression();
setState(1419);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1415);
match(T__3);
setState(1416);
expression();
}
}
setState(1421);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1424);
match(T__7);
}
break;
case 24:
{
_localctx = new ColumnReferenceContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1425);
identifier();
}
break;
case 25:
{
_localctx = new SpecialDateTimeFunctionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1426);
((SpecialDateTimeFunctionContext)_localctx).name = match(CURRENT_DATE);
}
break;
case 26:
{
_localctx = new SpecialDateTimeFunctionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1427);
((SpecialDateTimeFunctionContext)_localctx).name = match(CURRENT_TIME);
setState(1431);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,183,_ctx) ) {
case 1:
{
setState(1428);
match(T__1);
setState(1429);
((SpecialDateTimeFunctionContext)_localctx).precision = match(INTEGER_VALUE);
setState(1430);
match(T__2);
}
break;
}
}
break;
case 27:
{
_localctx = new SpecialDateTimeFunctionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1433);
((SpecialDateTimeFunctionContext)_localctx).name = match(CURRENT_TIMESTAMP);
setState(1437);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,184,_ctx) ) {
case 1:
{
setState(1434);
match(T__1);
setState(1435);
((SpecialDateTimeFunctionContext)_localctx).precision = match(INTEGER_VALUE);
setState(1436);
match(T__2);
}
break;
}
}
break;
case 28:
{
_localctx = new SpecialDateTimeFunctionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1439);
((SpecialDateTimeFunctionContext)_localctx).name = match(LOCALTIME);
setState(1443);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,185,_ctx) ) {
case 1:
{
setState(1440);
match(T__1);
setState(1441);
((SpecialDateTimeFunctionContext)_localctx).precision = match(INTEGER_VALUE);
setState(1442);
match(T__2);
}
break;
}
}
break;
case 29:
{
_localctx = new SpecialDateTimeFunctionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1445);
((SpecialDateTimeFunctionContext)_localctx).name = match(LOCALTIMESTAMP);
setState(1449);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,186,_ctx) ) {
case 1:
{
setState(1446);
match(T__1);
setState(1447);
((SpecialDateTimeFunctionContext)_localctx).precision = match(INTEGER_VALUE);
setState(1448);
match(T__2);
}
break;
}
}
break;
case 30:
{
_localctx = new CurrentUserContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1451);
((CurrentUserContext)_localctx).name = match(CURRENT_USER);
}
break;
case 31:
{
_localctx = new SubstringContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1452);
match(SUBSTRING);
setState(1453);
match(T__1);
setState(1454);
valueExpression(0);
setState(1455);
match(FROM);
setState(1456);
valueExpression(0);
setState(1459);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FOR) {
{
setState(1457);
match(FOR);
setState(1458);
valueExpression(0);
}
}
setState(1461);
match(T__2);
}
break;
case 32:
{
_localctx = new NormalizeContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1463);
match(NORMALIZE);
setState(1464);
match(T__1);
setState(1465);
valueExpression(0);
setState(1468);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__3) {
{
setState(1466);
match(T__3);
setState(1467);
normalForm();
}
}
setState(1470);
match(T__2);
}
break;
case 33:
{
_localctx = new ExtractContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1472);
match(EXTRACT);
setState(1473);
match(T__1);
setState(1474);
identifier();
setState(1475);
match(FROM);
setState(1476);
valueExpression(0);
setState(1477);
match(T__2);
}
break;
case 34:
{
_localctx = new ParenthesizedExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1479);
match(T__1);
setState(1480);
expression();
setState(1481);
match(T__2);
}
break;
case 35:
{
_localctx = new GroupingOperationContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1483);
match(GROUPING);
setState(1484);
match(T__1);
setState(1493);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ADD) | (1L << ADMIN) | (1L << ALL) | (1L << ANALYZE) | (1L << ANY) | (1L << ARRAY) | (1L << ASC) | (1L << AT) | (1L << BERNOULLI) | (1L << CALL) | (1L << CALLED) | (1L << CASCADE) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_ROLE) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DETERMINISTIC) | (1L << DISTRIBUTED) | (1L << EXCLUDING))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXPLAIN - 64)) | (1L << (EXTERNAL - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 64)) | (1L << (FUNCTION - 64)) | (1L << (FUNCTIONS - 64)) | (1L << (GRANT - 64)) | (1L << (GRANTED - 64)) | (1L << (GRANTS - 64)) | (1L << (GRAPHVIZ - 64)) | (1L << (HOUR - 64)) | (1L << (IF - 64)) | (1L << (IGNORE - 64)) | (1L << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 64)) | (1L << (LANGUAGE - 64)) | (1L << (LAST - 64)) | (1L << (LATERAL - 64)) | (1L << (LEVEL - 64)) | (1L << (LIMIT - 64)) | (1L << (LOGICAL - 64)) | (1L << (MAP - 64)) | (1L << (MINUTE - 64)) | (1L << (MONTH - 64)) | (1L << (NAME - 64)) | (1L << (NFC - 64)) | (1L << (NFD - 64)) | (1L << (NFKC - 64)) | (1L << (NFKD - 64)) | (1L << (NO - 64)) | (1L << (NONE - 64)) | (1L << (NULLIF - 64)) | (1L << (NULLS - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (ONLY - 128)) | (1L << (OPTION - 128)) | (1L << (ORDINALITY - 128)) | (1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (POSITION - 128)) | (1L << (PRECEDING - 128)) | (1L << (PRIVILEGES - 128)) | (1L << (PROPERTIES - 128)) | (1L << (RANGE - 128)) | (1L << (READ - 128)) | (1L << (RENAME - 128)) | (1L << (REPEATABLE - 128)) | (1L << (REPLACE - 128)) | (1L << (RESET - 128)) | (1L << (RESPECT - 128)) | (1L << (RESTRICT - 128)) | (1L << (RETURN - 128)) | (1L << (RETURNS - 128)) | (1L << (REVOKE - 128)) | (1L << (ROLE - 128)) | (1L << (ROLES - 128)) | (1L << (ROLLBACK - 128)) | (1L << (ROW - 128)) | (1L << (ROWS - 128)) | (1L << (SCHEMA - 128)) | (1L << (SCHEMAS - 128)) | (1L << (SECOND - 128)) | (1L << (SECURITY - 128)) | (1L << (SERIALIZABLE - 128)) | (1L << (SESSION - 128)) | (1L << (SET - 128)) | (1L << (SETS - 128)) | (1L << (SHOW - 128)) | (1L << (SOME - 128)) | (1L << (SQL - 128)) | (1L << (START - 128)) | (1L << (STATS - 128)) | (1L << (SUBSTRING - 128)) | (1L << (SYSTEM - 128)) | (1L << (TABLES - 128)) | (1L << (TABLESAMPLE - 128)) | (1L << (TEXT - 128)) | (1L << (TIME - 128)) | (1L << (TIMESTAMP - 128)) | (1L << (TO - 128)) | (1L << (TRANSACTION - 128)) | (1L << (TRY_CAST - 128)) | (1L << (TYPE - 128)) | (1L << (UNBOUNDED - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & ((1L << (UNCOMMITTED - 192)) | (1L << (USE - 192)) | (1L << (USER - 192)) | (1L << (VALIDATE - 192)) | (1L << (VERBOSE - 192)) | (1L << (VIEW - 192)) | (1L << (WORK - 192)) | (1L << (WRITE - 192)) | (1L << (YEAR - 192)) | (1L << (ZONE - 192)) | (1L << (IDENTIFIER - 192)) | (1L << (DIGIT_IDENTIFIER - 192)) | (1L << (QUOTED_IDENTIFIER - 192)) | (1L << (BACKQUOTED_IDENTIFIER - 192)))) != 0)) {
{
setState(1485);
qualifiedName();
setState(1490);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1486);
match(T__3);
setState(1487);
qualifiedName();
}
}
setState(1492);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1495);
match(T__2);
}
break;
}
_ctx.stop = _input.LT(-1);
setState(1508);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,193,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(1506);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,192,_ctx) ) {
case 1:
{
_localctx = new SubscriptContext(new PrimaryExpressionContext(_parentctx, _parentState));
((SubscriptContext)_localctx).value = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_primaryExpression);
setState(1498);
if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)");
setState(1499);
match(T__6);
setState(1500);
((SubscriptContext)_localctx).index = valueExpression(0);
setState(1501);
match(T__7);
}
break;
case 2:
{
_localctx = new DereferenceContext(new PrimaryExpressionContext(_parentctx, _parentState));
((DereferenceContext)_localctx).base = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_primaryExpression);
setState(1503);
if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)");
setState(1504);
match(T__0);
setState(1505);
((DereferenceContext)_localctx).fieldName = identifier();
}
break;
}
}
}
setState(1510);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,193,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
public static class StringContext extends ParserRuleContext {
public StringContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_string; }
public StringContext() { }
public void copyFrom(StringContext ctx) {
super.copyFrom(ctx);
}
}
public static class UnicodeStringLiteralContext extends StringContext {
public TerminalNode UNICODE_STRING() { return getToken(SqlBaseParser.UNICODE_STRING, 0); }
public TerminalNode UESCAPE() { return getToken(SqlBaseParser.UESCAPE, 0); }
public TerminalNode STRING() { return getToken(SqlBaseParser.STRING, 0); }
public UnicodeStringLiteralContext(StringContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterUnicodeStringLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitUnicodeStringLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitUnicodeStringLiteral(this);
else return visitor.visitChildren(this);
}
}
public static class BasicStringLiteralContext extends StringContext {
public TerminalNode STRING() { return getToken(SqlBaseParser.STRING, 0); }
public BasicStringLiteralContext(StringContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterBasicStringLiteral(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitBasicStringLiteral(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitBasicStringLiteral(this);
else return visitor.visitChildren(this);
}
}
public final StringContext string() throws RecognitionException {
StringContext _localctx = new StringContext(_ctx, getState());
enterRule(_localctx, 94, RULE_string);
try {
setState(1517);
_errHandler.sync(this);
switch (_input.LA(1)) {
case STRING:
_localctx = new BasicStringLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1511);
match(STRING);
}
break;
case UNICODE_STRING:
_localctx = new UnicodeStringLiteralContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1512);
match(UNICODE_STRING);
setState(1515);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,194,_ctx) ) {
case 1:
{
setState(1513);
match(UESCAPE);
setState(1514);
match(STRING);
}
break;
}
}
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 NullTreatmentContext extends ParserRuleContext {
public TerminalNode IGNORE() { return getToken(SqlBaseParser.IGNORE, 0); }
public TerminalNode NULLS() { return getToken(SqlBaseParser.NULLS, 0); }
public TerminalNode RESPECT() { return getToken(SqlBaseParser.RESPECT, 0); }
public NullTreatmentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_nullTreatment; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNullTreatment(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNullTreatment(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNullTreatment(this);
else return visitor.visitChildren(this);
}
}
public final NullTreatmentContext nullTreatment() throws RecognitionException {
NullTreatmentContext _localctx = new NullTreatmentContext(_ctx, getState());
enterRule(_localctx, 96, RULE_nullTreatment);
try {
setState(1523);
_errHandler.sync(this);
switch (_input.LA(1)) {
case IGNORE:
enterOuterAlt(_localctx, 1);
{
setState(1519);
match(IGNORE);
setState(1520);
match(NULLS);
}
break;
case RESPECT:
enterOuterAlt(_localctx, 2);
{
setState(1521);
match(RESPECT);
setState(1522);
match(NULLS);
}
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 TimeZoneSpecifierContext extends ParserRuleContext {
public TimeZoneSpecifierContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_timeZoneSpecifier; }
public TimeZoneSpecifierContext() { }
public void copyFrom(TimeZoneSpecifierContext ctx) {
super.copyFrom(ctx);
}
}
public static class TimeZoneIntervalContext extends TimeZoneSpecifierContext {
public TerminalNode TIME() { return getToken(SqlBaseParser.TIME, 0); }
public TerminalNode ZONE() { return getToken(SqlBaseParser.ZONE, 0); }
public IntervalContext interval() {
return getRuleContext(IntervalContext.class,0);
}
public TimeZoneIntervalContext(TimeZoneSpecifierContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTimeZoneInterval(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTimeZoneInterval(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTimeZoneInterval(this);
else return visitor.visitChildren(this);
}
}
public static class TimeZoneStringContext extends TimeZoneSpecifierContext {
public TerminalNode TIME() { return getToken(SqlBaseParser.TIME, 0); }
public TerminalNode ZONE() { return getToken(SqlBaseParser.ZONE, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public TimeZoneStringContext(TimeZoneSpecifierContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTimeZoneString(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTimeZoneString(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTimeZoneString(this);
else return visitor.visitChildren(this);
}
}
public final TimeZoneSpecifierContext timeZoneSpecifier() throws RecognitionException {
TimeZoneSpecifierContext _localctx = new TimeZoneSpecifierContext(_ctx, getState());
enterRule(_localctx, 98, RULE_timeZoneSpecifier);
try {
setState(1531);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,197,_ctx) ) {
case 1:
_localctx = new TimeZoneIntervalContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1525);
match(TIME);
setState(1526);
match(ZONE);
setState(1527);
interval();
}
break;
case 2:
_localctx = new TimeZoneStringContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1528);
match(TIME);
setState(1529);
match(ZONE);
setState(1530);
string();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ComparisonOperatorContext extends ParserRuleContext {
public TerminalNode EQ() { return getToken(SqlBaseParser.EQ, 0); }
public TerminalNode NEQ() { return getToken(SqlBaseParser.NEQ, 0); }
public TerminalNode LT() { return getToken(SqlBaseParser.LT, 0); }
public TerminalNode LTE() { return getToken(SqlBaseParser.LTE, 0); }
public TerminalNode GT() { return getToken(SqlBaseParser.GT, 0); }
public TerminalNode GTE() { return getToken(SqlBaseParser.GTE, 0); }
public ComparisonOperatorContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_comparisonOperator; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterComparisonOperator(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitComparisonOperator(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitComparisonOperator(this);
else return visitor.visitChildren(this);
}
}
public final ComparisonOperatorContext comparisonOperator() throws RecognitionException {
ComparisonOperatorContext _localctx = new ComparisonOperatorContext(_ctx, getState());
enterRule(_localctx, 100, RULE_comparisonOperator);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1533);
_la = _input.LA(1);
if ( !(((((_la - 209)) & ~0x3f) == 0 && ((1L << (_la - 209)) & ((1L << (EQ - 209)) | (1L << (NEQ - 209)) | (1L << (LT - 209)) | (1L << (LTE - 209)) | (1L << (GT - 209)) | (1L << (GTE - 209)))) != 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 ComparisonQuantifierContext extends ParserRuleContext {
public TerminalNode ALL() { return getToken(SqlBaseParser.ALL, 0); }
public TerminalNode SOME() { return getToken(SqlBaseParser.SOME, 0); }
public TerminalNode ANY() { return getToken(SqlBaseParser.ANY, 0); }
public ComparisonQuantifierContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_comparisonQuantifier; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterComparisonQuantifier(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitComparisonQuantifier(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitComparisonQuantifier(this);
else return visitor.visitChildren(this);
}
}
public final ComparisonQuantifierContext comparisonQuantifier() throws RecognitionException {
ComparisonQuantifierContext _localctx = new ComparisonQuantifierContext(_ctx, getState());
enterRule(_localctx, 102, RULE_comparisonQuantifier);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1535);
_la = _input.LA(1);
if ( !(_la==ALL || _la==ANY || _la==SOME) ) {
_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 BooleanValueContext extends ParserRuleContext {
public TerminalNode TRUE() { return getToken(SqlBaseParser.TRUE, 0); }
public TerminalNode FALSE() { return getToken(SqlBaseParser.FALSE, 0); }
public BooleanValueContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_booleanValue; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterBooleanValue(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitBooleanValue(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitBooleanValue(this);
else return visitor.visitChildren(this);
}
}
public final BooleanValueContext booleanValue() throws RecognitionException {
BooleanValueContext _localctx = new BooleanValueContext(_ctx, getState());
enterRule(_localctx, 104, RULE_booleanValue);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1537);
_la = _input.LA(1);
if ( !(_la==FALSE || _la==TRUE) ) {
_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 IntervalContext extends ParserRuleContext {
public Token sign;
public IntervalFieldContext from;
public IntervalFieldContext to;
public TerminalNode INTERVAL() { return getToken(SqlBaseParser.INTERVAL, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public List intervalField() {
return getRuleContexts(IntervalFieldContext.class);
}
public IntervalFieldContext intervalField(int i) {
return getRuleContext(IntervalFieldContext.class,i);
}
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public TerminalNode PLUS() { return getToken(SqlBaseParser.PLUS, 0); }
public TerminalNode MINUS() { return getToken(SqlBaseParser.MINUS, 0); }
public IntervalContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_interval; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterInterval(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitInterval(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitInterval(this);
else return visitor.visitChildren(this);
}
}
public final IntervalContext interval() throws RecognitionException {
IntervalContext _localctx = new IntervalContext(_ctx, getState());
enterRule(_localctx, 106, RULE_interval);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1539);
match(INTERVAL);
setState(1541);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PLUS || _la==MINUS) {
{
setState(1540);
((IntervalContext)_localctx).sign = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
((IntervalContext)_localctx).sign = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(1543);
string();
setState(1544);
((IntervalContext)_localctx).from = intervalField();
setState(1547);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,199,_ctx) ) {
case 1:
{
setState(1545);
match(TO);
setState(1546);
((IntervalContext)_localctx).to = intervalField();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class IntervalFieldContext extends ParserRuleContext {
public TerminalNode YEAR() { return getToken(SqlBaseParser.YEAR, 0); }
public TerminalNode MONTH() { return getToken(SqlBaseParser.MONTH, 0); }
public TerminalNode DAY() { return getToken(SqlBaseParser.DAY, 0); }
public TerminalNode HOUR() { return getToken(SqlBaseParser.HOUR, 0); }
public TerminalNode MINUTE() { return getToken(SqlBaseParser.MINUTE, 0); }
public TerminalNode SECOND() { return getToken(SqlBaseParser.SECOND, 0); }
public IntervalFieldContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_intervalField; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterIntervalField(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitIntervalField(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitIntervalField(this);
else return visitor.visitChildren(this);
}
}
public final IntervalFieldContext intervalField() throws RecognitionException {
IntervalFieldContext _localctx = new IntervalFieldContext(_ctx, getState());
enterRule(_localctx, 108, RULE_intervalField);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1549);
_la = _input.LA(1);
if ( !(_la==DAY || ((((_la - 84)) & ~0x3f) == 0 && ((1L << (_la - 84)) & ((1L << (HOUR - 84)) | (1L << (MINUTE - 84)) | (1L << (MONTH - 84)))) != 0) || _la==SECOND || _la==YEAR) ) {
_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 NormalFormContext extends ParserRuleContext {
public TerminalNode NFD() { return getToken(SqlBaseParser.NFD, 0); }
public TerminalNode NFC() { return getToken(SqlBaseParser.NFC, 0); }
public TerminalNode NFKD() { return getToken(SqlBaseParser.NFKD, 0); }
public TerminalNode NFKC() { return getToken(SqlBaseParser.NFKC, 0); }
public NormalFormContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_normalForm; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNormalForm(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNormalForm(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNormalForm(this);
else return visitor.visitChildren(this);
}
}
public final NormalFormContext normalForm() throws RecognitionException {
NormalFormContext _localctx = new NormalFormContext(_ctx, getState());
enterRule(_localctx, 110, RULE_normalForm);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1551);
_la = _input.LA(1);
if ( !(((((_la - 116)) & ~0x3f) == 0 && ((1L << (_la - 116)) & ((1L << (NFC - 116)) | (1L << (NFD - 116)) | (1L << (NFKC - 116)) | (1L << (NFKD - 116)))) != 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 TypesContext extends ParserRuleContext {
public List type() {
return getRuleContexts(TypeContext.class);
}
public TypeContext type(int i) {
return getRuleContext(TypeContext.class,i);
}
public TypesContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_types; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTypes(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTypes(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTypes(this);
else return visitor.visitChildren(this);
}
}
public final TypesContext types() throws RecognitionException {
TypesContext _localctx = new TypesContext(_ctx, getState());
enterRule(_localctx, 112, RULE_types);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1553);
match(T__1);
setState(1562);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ADD) | (1L << ADMIN) | (1L << ALL) | (1L << ANALYZE) | (1L << ANY) | (1L << ARRAY) | (1L << ASC) | (1L << AT) | (1L << BERNOULLI) | (1L << CALL) | (1L << CALLED) | (1L << CASCADE) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_ROLE) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DETERMINISTIC) | (1L << DISTRIBUTED) | (1L << EXCLUDING))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXPLAIN - 64)) | (1L << (EXTERNAL - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 64)) | (1L << (FUNCTION - 64)) | (1L << (FUNCTIONS - 64)) | (1L << (GRANT - 64)) | (1L << (GRANTED - 64)) | (1L << (GRANTS - 64)) | (1L << (GRAPHVIZ - 64)) | (1L << (HOUR - 64)) | (1L << (IF - 64)) | (1L << (IGNORE - 64)) | (1L << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 64)) | (1L << (LANGUAGE - 64)) | (1L << (LAST - 64)) | (1L << (LATERAL - 64)) | (1L << (LEVEL - 64)) | (1L << (LIMIT - 64)) | (1L << (LOGICAL - 64)) | (1L << (MAP - 64)) | (1L << (MINUTE - 64)) | (1L << (MONTH - 64)) | (1L << (NAME - 64)) | (1L << (NFC - 64)) | (1L << (NFD - 64)) | (1L << (NFKC - 64)) | (1L << (NFKD - 64)) | (1L << (NO - 64)) | (1L << (NONE - 64)) | (1L << (NULLIF - 64)) | (1L << (NULLS - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (ONLY - 128)) | (1L << (OPTION - 128)) | (1L << (ORDINALITY - 128)) | (1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (POSITION - 128)) | (1L << (PRECEDING - 128)) | (1L << (PRIVILEGES - 128)) | (1L << (PROPERTIES - 128)) | (1L << (RANGE - 128)) | (1L << (READ - 128)) | (1L << (RENAME - 128)) | (1L << (REPEATABLE - 128)) | (1L << (REPLACE - 128)) | (1L << (RESET - 128)) | (1L << (RESPECT - 128)) | (1L << (RESTRICT - 128)) | (1L << (RETURN - 128)) | (1L << (RETURNS - 128)) | (1L << (REVOKE - 128)) | (1L << (ROLE - 128)) | (1L << (ROLES - 128)) | (1L << (ROLLBACK - 128)) | (1L << (ROW - 128)) | (1L << (ROWS - 128)) | (1L << (SCHEMA - 128)) | (1L << (SCHEMAS - 128)) | (1L << (SECOND - 128)) | (1L << (SECURITY - 128)) | (1L << (SERIALIZABLE - 128)) | (1L << (SESSION - 128)) | (1L << (SET - 128)) | (1L << (SETS - 128)) | (1L << (SHOW - 128)) | (1L << (SOME - 128)) | (1L << (SQL - 128)) | (1L << (START - 128)) | (1L << (STATS - 128)) | (1L << (SUBSTRING - 128)) | (1L << (SYSTEM - 128)) | (1L << (TABLES - 128)) | (1L << (TABLESAMPLE - 128)) | (1L << (TEXT - 128)) | (1L << (TIME - 128)) | (1L << (TIMESTAMP - 128)) | (1L << (TO - 128)) | (1L << (TRANSACTION - 128)) | (1L << (TRY_CAST - 128)) | (1L << (TYPE - 128)) | (1L << (UNBOUNDED - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & ((1L << (UNCOMMITTED - 192)) | (1L << (USE - 192)) | (1L << (USER - 192)) | (1L << (VALIDATE - 192)) | (1L << (VERBOSE - 192)) | (1L << (VIEW - 192)) | (1L << (WORK - 192)) | (1L << (WRITE - 192)) | (1L << (YEAR - 192)) | (1L << (ZONE - 192)) | (1L << (IDENTIFIER - 192)) | (1L << (DIGIT_IDENTIFIER - 192)) | (1L << (QUOTED_IDENTIFIER - 192)) | (1L << (BACKQUOTED_IDENTIFIER - 192)) | (1L << (TIME_WITH_TIME_ZONE - 192)) | (1L << (TIMESTAMP_WITH_TIME_ZONE - 192)) | (1L << (DOUBLE_PRECISION - 192)))) != 0)) {
{
setState(1554);
type(0);
setState(1559);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1555);
match(T__3);
setState(1556);
type(0);
}
}
setState(1561);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1564);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TypeContext extends ParserRuleContext {
public IntervalFieldContext from;
public IntervalFieldContext to;
public TerminalNode ARRAY() { return getToken(SqlBaseParser.ARRAY, 0); }
public List type() {
return getRuleContexts(TypeContext.class);
}
public TypeContext type(int i) {
return getRuleContext(TypeContext.class,i);
}
public TerminalNode MAP() { return getToken(SqlBaseParser.MAP, 0); }
public TerminalNode ROW() { return getToken(SqlBaseParser.ROW, 0); }
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public BaseTypeContext baseType() {
return getRuleContext(BaseTypeContext.class,0);
}
public List typeParameter() {
return getRuleContexts(TypeParameterContext.class);
}
public TypeParameterContext typeParameter(int i) {
return getRuleContext(TypeParameterContext.class,i);
}
public TerminalNode INTERVAL() { return getToken(SqlBaseParser.INTERVAL, 0); }
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public List intervalField() {
return getRuleContexts(IntervalFieldContext.class);
}
public IntervalFieldContext intervalField(int i) {
return getRuleContext(IntervalFieldContext.class,i);
}
public TypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_type; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitType(this);
else return visitor.visitChildren(this);
}
}
public final TypeContext type() throws RecognitionException {
return type(0);
}
private TypeContext type(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
TypeContext _localctx = new TypeContext(_ctx, _parentState);
TypeContext _prevctx = _localctx;
int _startState = 114;
enterRecursionRule(_localctx, 114, RULE_type, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1613);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,205,_ctx) ) {
case 1:
{
setState(1567);
match(ARRAY);
setState(1568);
match(LT);
setState(1569);
type(0);
setState(1570);
match(GT);
}
break;
case 2:
{
setState(1572);
match(MAP);
setState(1573);
match(LT);
setState(1574);
type(0);
setState(1575);
match(T__3);
setState(1576);
type(0);
setState(1577);
match(GT);
}
break;
case 3:
{
setState(1579);
match(ROW);
setState(1580);
match(T__1);
setState(1581);
identifier();
setState(1582);
type(0);
setState(1589);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1583);
match(T__3);
setState(1584);
identifier();
setState(1585);
type(0);
}
}
setState(1591);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1592);
match(T__2);
}
break;
case 4:
{
setState(1594);
baseType();
setState(1606);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,204,_ctx) ) {
case 1:
{
setState(1595);
match(T__1);
setState(1596);
typeParameter();
setState(1601);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1597);
match(T__3);
setState(1598);
typeParameter();
}
}
setState(1603);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1604);
match(T__2);
}
break;
}
}
break;
case 5:
{
setState(1608);
match(INTERVAL);
setState(1609);
((TypeContext)_localctx).from = intervalField();
setState(1610);
match(TO);
setState(1611);
((TypeContext)_localctx).to = intervalField();
}
break;
}
_ctx.stop = _input.LT(-1);
setState(1619);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,206,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
{
_localctx = new TypeContext(_parentctx, _parentState);
pushNewRecursionContext(_localctx, _startState, RULE_type);
setState(1615);
if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)");
setState(1616);
match(ARRAY);
}
}
}
setState(1621);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,206,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
public static class TypeParameterContext extends ParserRuleContext {
public TerminalNode INTEGER_VALUE() { return getToken(SqlBaseParser.INTEGER_VALUE, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TypeParameterContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_typeParameter; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTypeParameter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTypeParameter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTypeParameter(this);
else return visitor.visitChildren(this);
}
}
public final TypeParameterContext typeParameter() throws RecognitionException {
TypeParameterContext _localctx = new TypeParameterContext(_ctx, getState());
enterRule(_localctx, 116, RULE_typeParameter);
try {
setState(1624);
_errHandler.sync(this);
switch (_input.LA(1)) {
case INTEGER_VALUE:
enterOuterAlt(_localctx, 1);
{
setState(1622);
match(INTEGER_VALUE);
}
break;
case ADD:
case ADMIN:
case ALL:
case ANALYZE:
case ANY:
case ARRAY:
case ASC:
case AT:
case BERNOULLI:
case CALL:
case CALLED:
case CASCADE:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case CURRENT_ROLE:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DETERMINISTIC:
case DISTRIBUTED:
case EXCLUDING:
case EXPLAIN:
case EXTERNAL:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTION:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case HOUR:
case IF:
case IGNORE:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LANGUAGE:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
case NAME:
case NFC:
case NFD:
case NFKC:
case NFKD:
case NO:
case NONE:
case NULLIF:
case NULLS:
case ONLY:
case OPTION:
case ORDINALITY:
case OUTPUT:
case OVER:
case PARTITION:
case PARTITIONS:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESPECT:
case RESTRICT:
case RETURN:
case RETURNS:
case REVOKE:
case ROLE:
case ROLES:
case ROLLBACK:
case ROW:
case ROWS:
case SCHEMA:
case SCHEMAS:
case SECOND:
case SECURITY:
case SERIALIZABLE:
case SESSION:
case SET:
case SETS:
case SHOW:
case SOME:
case SQL:
case START:
case STATS:
case SUBSTRING:
case SYSTEM:
case TABLES:
case TABLESAMPLE:
case TEXT:
case TIME:
case TIMESTAMP:
case TO:
case TRANSACTION:
case TRY_CAST:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case USE:
case USER:
case VALIDATE:
case VERBOSE:
case VIEW:
case WORK:
case WRITE:
case YEAR:
case ZONE:
case IDENTIFIER:
case DIGIT_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACKQUOTED_IDENTIFIER:
case TIME_WITH_TIME_ZONE:
case TIMESTAMP_WITH_TIME_ZONE:
case DOUBLE_PRECISION:
enterOuterAlt(_localctx, 2);
{
setState(1623);
type(0);
}
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 BaseTypeContext extends ParserRuleContext {
public TerminalNode TIME_WITH_TIME_ZONE() { return getToken(SqlBaseParser.TIME_WITH_TIME_ZONE, 0); }
public TerminalNode TIMESTAMP_WITH_TIME_ZONE() { return getToken(SqlBaseParser.TIMESTAMP_WITH_TIME_ZONE, 0); }
public TerminalNode DOUBLE_PRECISION() { return getToken(SqlBaseParser.DOUBLE_PRECISION, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public BaseTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_baseType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterBaseType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitBaseType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitBaseType(this);
else return visitor.visitChildren(this);
}
}
public final BaseTypeContext baseType() throws RecognitionException {
BaseTypeContext _localctx = new BaseTypeContext(_ctx, getState());
enterRule(_localctx, 118, RULE_baseType);
try {
setState(1630);
_errHandler.sync(this);
switch (_input.LA(1)) {
case TIME_WITH_TIME_ZONE:
enterOuterAlt(_localctx, 1);
{
setState(1626);
match(TIME_WITH_TIME_ZONE);
}
break;
case TIMESTAMP_WITH_TIME_ZONE:
enterOuterAlt(_localctx, 2);
{
setState(1627);
match(TIMESTAMP_WITH_TIME_ZONE);
}
break;
case DOUBLE_PRECISION:
enterOuterAlt(_localctx, 3);
{
setState(1628);
match(DOUBLE_PRECISION);
}
break;
case ADD:
case ADMIN:
case ALL:
case ANALYZE:
case ANY:
case ARRAY:
case ASC:
case AT:
case BERNOULLI:
case CALL:
case CALLED:
case CASCADE:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case CURRENT_ROLE:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DETERMINISTIC:
case DISTRIBUTED:
case EXCLUDING:
case EXPLAIN:
case EXTERNAL:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTION:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case HOUR:
case IF:
case IGNORE:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LANGUAGE:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
case NAME:
case NFC:
case NFD:
case NFKC:
case NFKD:
case NO:
case NONE:
case NULLIF:
case NULLS:
case ONLY:
case OPTION:
case ORDINALITY:
case OUTPUT:
case OVER:
case PARTITION:
case PARTITIONS:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESPECT:
case RESTRICT:
case RETURN:
case RETURNS:
case REVOKE:
case ROLE:
case ROLES:
case ROLLBACK:
case ROW:
case ROWS:
case SCHEMA:
case SCHEMAS:
case SECOND:
case SECURITY:
case SERIALIZABLE:
case SESSION:
case SET:
case SETS:
case SHOW:
case SOME:
case SQL:
case START:
case STATS:
case SUBSTRING:
case SYSTEM:
case TABLES:
case TABLESAMPLE:
case TEXT:
case TIME:
case TIMESTAMP:
case TO:
case TRANSACTION:
case TRY_CAST:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case USE:
case USER:
case VALIDATE:
case VERBOSE:
case VIEW:
case WORK:
case WRITE:
case YEAR:
case ZONE:
case IDENTIFIER:
case DIGIT_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACKQUOTED_IDENTIFIER:
enterOuterAlt(_localctx, 4);
{
setState(1629);
qualifiedName();
}
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 WhenClauseContext extends ParserRuleContext {
public ExpressionContext condition;
public ExpressionContext result;
public TerminalNode WHEN() { return getToken(SqlBaseParser.WHEN, 0); }
public TerminalNode THEN() { return getToken(SqlBaseParser.THEN, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public WhenClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_whenClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterWhenClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitWhenClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitWhenClause(this);
else return visitor.visitChildren(this);
}
}
public final WhenClauseContext whenClause() throws RecognitionException {
WhenClauseContext _localctx = new WhenClauseContext(_ctx, getState());
enterRule(_localctx, 120, RULE_whenClause);
try {
enterOuterAlt(_localctx, 1);
{
setState(1632);
match(WHEN);
setState(1633);
((WhenClauseContext)_localctx).condition = expression();
setState(1634);
match(THEN);
setState(1635);
((WhenClauseContext)_localctx).result = expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FilterContext extends ParserRuleContext {
public TerminalNode FILTER() { return getToken(SqlBaseParser.FILTER, 0); }
public TerminalNode WHERE() { return getToken(SqlBaseParser.WHERE, 0); }
public BooleanExpressionContext booleanExpression() {
return getRuleContext(BooleanExpressionContext.class,0);
}
public FilterContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_filter; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterFilter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitFilter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitFilter(this);
else return visitor.visitChildren(this);
}
}
public final FilterContext filter() throws RecognitionException {
FilterContext _localctx = new FilterContext(_ctx, getState());
enterRule(_localctx, 122, RULE_filter);
try {
enterOuterAlt(_localctx, 1);
{
setState(1637);
match(FILTER);
setState(1638);
match(T__1);
setState(1639);
match(WHERE);
setState(1640);
booleanExpression(0);
setState(1641);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class OverContext extends ParserRuleContext {
public ExpressionContext expression;
public List partition = new ArrayList();
public TerminalNode OVER() { return getToken(SqlBaseParser.OVER, 0); }
public TerminalNode PARTITION() { return getToken(SqlBaseParser.PARTITION, 0); }
public List BY() { return getTokens(SqlBaseParser.BY); }
public TerminalNode BY(int i) {
return getToken(SqlBaseParser.BY, i);
}
public TerminalNode ORDER() { return getToken(SqlBaseParser.ORDER, 0); }
public List sortItem() {
return getRuleContexts(SortItemContext.class);
}
public SortItemContext sortItem(int i) {
return getRuleContext(SortItemContext.class,i);
}
public WindowFrameContext windowFrame() {
return getRuleContext(WindowFrameContext.class,0);
}
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public OverContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_over; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterOver(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitOver(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitOver(this);
else return visitor.visitChildren(this);
}
}
public final OverContext over() throws RecognitionException {
OverContext _localctx = new OverContext(_ctx, getState());
enterRule(_localctx, 124, RULE_over);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1643);
match(OVER);
setState(1644);
match(T__1);
setState(1655);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PARTITION) {
{
setState(1645);
match(PARTITION);
setState(1646);
match(BY);
setState(1647);
((OverContext)_localctx).expression = expression();
((OverContext)_localctx).partition.add(((OverContext)_localctx).expression);
setState(1652);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1648);
match(T__3);
setState(1649);
((OverContext)_localctx).expression = expression();
((OverContext)_localctx).partition.add(((OverContext)_localctx).expression);
}
}
setState(1654);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1667);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1657);
match(ORDER);
setState(1658);
match(BY);
setState(1659);
sortItem();
setState(1664);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1660);
match(T__3);
setState(1661);
sortItem();
}
}
setState(1666);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1670);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==RANGE || _la==ROWS) {
{
setState(1669);
windowFrame();
}
}
setState(1672);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class WindowFrameContext extends ParserRuleContext {
public Token frameType;
public FrameBoundContext start;
public FrameBoundContext end;
public TerminalNode RANGE() { return getToken(SqlBaseParser.RANGE, 0); }
public List frameBound() {
return getRuleContexts(FrameBoundContext.class);
}
public FrameBoundContext frameBound(int i) {
return getRuleContext(FrameBoundContext.class,i);
}
public TerminalNode ROWS() { return getToken(SqlBaseParser.ROWS, 0); }
public TerminalNode BETWEEN() { return getToken(SqlBaseParser.BETWEEN, 0); }
public TerminalNode AND() { return getToken(SqlBaseParser.AND, 0); }
public WindowFrameContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_windowFrame; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterWindowFrame(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitWindowFrame(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitWindowFrame(this);
else return visitor.visitChildren(this);
}
}
public final WindowFrameContext windowFrame() throws RecognitionException {
WindowFrameContext _localctx = new WindowFrameContext(_ctx, getState());
enterRule(_localctx, 126, RULE_windowFrame);
try {
setState(1690);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,214,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1674);
((WindowFrameContext)_localctx).frameType = match(RANGE);
setState(1675);
((WindowFrameContext)_localctx).start = frameBound();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1676);
((WindowFrameContext)_localctx).frameType = match(ROWS);
setState(1677);
((WindowFrameContext)_localctx).start = frameBound();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1678);
((WindowFrameContext)_localctx).frameType = match(RANGE);
setState(1679);
match(BETWEEN);
setState(1680);
((WindowFrameContext)_localctx).start = frameBound();
setState(1681);
match(AND);
setState(1682);
((WindowFrameContext)_localctx).end = frameBound();
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(1684);
((WindowFrameContext)_localctx).frameType = match(ROWS);
setState(1685);
match(BETWEEN);
setState(1686);
((WindowFrameContext)_localctx).start = frameBound();
setState(1687);
match(AND);
setState(1688);
((WindowFrameContext)_localctx).end = frameBound();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FrameBoundContext extends ParserRuleContext {
public FrameBoundContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_frameBound; }
public FrameBoundContext() { }
public void copyFrom(FrameBoundContext ctx) {
super.copyFrom(ctx);
}
}
public static class BoundedFrameContext extends FrameBoundContext {
public Token boundType;
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode PRECEDING() { return getToken(SqlBaseParser.PRECEDING, 0); }
public TerminalNode FOLLOWING() { return getToken(SqlBaseParser.FOLLOWING, 0); }
public BoundedFrameContext(FrameBoundContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterBoundedFrame(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitBoundedFrame(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitBoundedFrame(this);
else return visitor.visitChildren(this);
}
}
public static class UnboundedFrameContext extends FrameBoundContext {
public Token boundType;
public TerminalNode UNBOUNDED() { return getToken(SqlBaseParser.UNBOUNDED, 0); }
public TerminalNode PRECEDING() { return getToken(SqlBaseParser.PRECEDING, 0); }
public TerminalNode FOLLOWING() { return getToken(SqlBaseParser.FOLLOWING, 0); }
public UnboundedFrameContext(FrameBoundContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterUnboundedFrame(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitUnboundedFrame(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitUnboundedFrame(this);
else return visitor.visitChildren(this);
}
}
public static class CurrentRowBoundContext extends FrameBoundContext {
public TerminalNode CURRENT() { return getToken(SqlBaseParser.CURRENT, 0); }
public TerminalNode ROW() { return getToken(SqlBaseParser.ROW, 0); }
public CurrentRowBoundContext(FrameBoundContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCurrentRowBound(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCurrentRowBound(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCurrentRowBound(this);
else return visitor.visitChildren(this);
}
}
public final FrameBoundContext frameBound() throws RecognitionException {
FrameBoundContext _localctx = new FrameBoundContext(_ctx, getState());
enterRule(_localctx, 128, RULE_frameBound);
int _la;
try {
setState(1701);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,215,_ctx) ) {
case 1:
_localctx = new UnboundedFrameContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1692);
match(UNBOUNDED);
setState(1693);
((UnboundedFrameContext)_localctx).boundType = match(PRECEDING);
}
break;
case 2:
_localctx = new UnboundedFrameContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1694);
match(UNBOUNDED);
setState(1695);
((UnboundedFrameContext)_localctx).boundType = match(FOLLOWING);
}
break;
case 3:
_localctx = new CurrentRowBoundContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1696);
match(CURRENT);
setState(1697);
match(ROW);
}
break;
case 4:
_localctx = new BoundedFrameContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1698);
expression();
setState(1699);
((BoundedFrameContext)_localctx).boundType = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==FOLLOWING || _la==PRECEDING) ) {
((BoundedFrameContext)_localctx).boundType = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExplainOptionContext extends ParserRuleContext {
public ExplainOptionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_explainOption; }
public ExplainOptionContext() { }
public void copyFrom(ExplainOptionContext ctx) {
super.copyFrom(ctx);
}
}
public static class ExplainFormatContext extends ExplainOptionContext {
public Token value;
public TerminalNode FORMAT() { return getToken(SqlBaseParser.FORMAT, 0); }
public TerminalNode TEXT() { return getToken(SqlBaseParser.TEXT, 0); }
public TerminalNode GRAPHVIZ() { return getToken(SqlBaseParser.GRAPHVIZ, 0); }
public TerminalNode JSON() { return getToken(SqlBaseParser.JSON, 0); }
public ExplainFormatContext(ExplainOptionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterExplainFormat(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExplainFormat(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExplainFormat(this);
else return visitor.visitChildren(this);
}
}
public static class ExplainTypeContext extends ExplainOptionContext {
public Token value;
public TerminalNode TYPE() { return getToken(SqlBaseParser.TYPE, 0); }
public TerminalNode LOGICAL() { return getToken(SqlBaseParser.LOGICAL, 0); }
public TerminalNode DISTRIBUTED() { return getToken(SqlBaseParser.DISTRIBUTED, 0); }
public TerminalNode VALIDATE() { return getToken(SqlBaseParser.VALIDATE, 0); }
public TerminalNode IO() { return getToken(SqlBaseParser.IO, 0); }
public ExplainTypeContext(ExplainOptionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterExplainType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExplainType(this);
}
@Override
public