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.
io.prestosql.sql.parser.SqlBaseParser Maven / Gradle / Ivy
// Generated from io/prestosql/sql/parser/SqlBase.g4 by ANTLR 4.7.1
package io.prestosql.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, CASCADE=25,
CASE=26, CAST=27, CATALOGS=28, COLUMN=29, COLUMNS=30, COMMENT=31, COMMIT=32,
COMMITTED=33, CONSTRAINT=34, CREATE=35, CROSS=36, CUBE=37, CURRENT=38,
CURRENT_DATE=39, CURRENT_PATH=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, DISTINCT=53, DISTRIBUTED=54, DROP=55,
ELSE=56, END=57, ESCAPE=58, EXCEPT=59, EXCLUDING=60, EXECUTE=61, EXISTS=62,
EXPLAIN=63, EXTRACT=64, FALSE=65, FILTER=66, FIRST=67, FOLLOWING=68, FOR=69,
FORMAT=70, FROM=71, FULL=72, FUNCTIONS=73, GRANT=74, GRANTED=75, GRANTS=76,
GRAPHVIZ=77, GROUP=78, GROUPING=79, HAVING=80, HOUR=81, IF=82, IN=83,
INCLUDING=84, INNER=85, INPUT=86, INSERT=87, INTERSECT=88, INTERVAL=89,
INTO=90, INVOKER=91, IO=92, IS=93, ISOLATION=94, JSON=95, JOIN=96, LAST=97,
LATERAL=98, LEFT=99, LEVEL=100, LIKE=101, LIMIT=102, LOCALTIME=103, LOCALTIMESTAMP=104,
LOGICAL=105, MAP=106, MINUTE=107, MONTH=108, NATURAL=109, NFC=110, NFD=111,
NFKC=112, NFKD=113, NO=114, NONE=115, NORMALIZE=116, NOT=117, NULL=118,
NULLIF=119, NULLS=120, ON=121, ONLY=122, OPTION=123, OR=124, ORDER=125,
ORDINALITY=126, OUTER=127, OUTPUT=128, OVER=129, PARTITION=130, PARTITIONS=131,
PATH=132, POSITION=133, PRECEDING=134, PREPARE=135, PRIVILEGES=136, PROPERTIES=137,
RANGE=138, READ=139, RECURSIVE=140, RENAME=141, REPEATABLE=142, REPLACE=143,
RESET=144, RESTRICT=145, REVOKE=146, RIGHT=147, ROLE=148, ROLES=149, ROLLBACK=150,
ROLLUP=151, ROW=152, ROWS=153, SCHEMA=154, SCHEMAS=155, SECOND=156, SECURITY=157,
SELECT=158, SERIALIZABLE=159, SESSION=160, SET=161, SETS=162, SHOW=163,
SOME=164, START=165, STATS=166, SUBSTRING=167, SYSTEM=168, TABLE=169,
TABLES=170, TABLESAMPLE=171, TEXT=172, THEN=173, TIME=174, TIMESTAMP=175,
TO=176, TRANSACTION=177, TRUE=178, TRY_CAST=179, TYPE=180, UESCAPE=181,
UNBOUNDED=182, UNCOMMITTED=183, UNION=184, UNNEST=185, USE=186, USER=187,
USING=188, VALIDATE=189, VALUES=190, VERBOSE=191, VIEW=192, WHEN=193,
WHERE=194, WITH=195, WORK=196, WRITE=197, YEAR=198, ZONE=199, EQ=200,
NEQ=201, LT=202, LTE=203, GT=204, GTE=205, PLUS=206, MINUS=207, ASTERISK=208,
SLASH=209, PERCENT=210, CONCAT=211, STRING=212, UNICODE_STRING=213, BINARY_LITERAL=214,
INTEGER_VALUE=215, DECIMAL_VALUE=216, DOUBLE_VALUE=217, IDENTIFIER=218,
DIGIT_IDENTIFIER=219, QUOTED_IDENTIFIER=220, BACKQUOTED_IDENTIFIER=221,
TIME_WITH_TIME_ZONE=222, TIMESTAMP_WITH_TIME_ZONE=223, DOUBLE_PRECISION=224,
SIMPLE_COMMENT=225, BRACKETED_COMMENT=226, WS=227, UNRECOGNIZED=228, DELIMITER=229;
public static final int
RULE_singleStatement = 0, RULE_standaloneExpression = 1, RULE_standalonePathSpecification = 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_queryNoWith = 11, RULE_queryTerm = 12, RULE_queryPrimary = 13, RULE_sortItem = 14,
RULE_querySpecification = 15, RULE_groupBy = 16, RULE_groupingElement = 17,
RULE_groupingSet = 18, RULE_namedQuery = 19, RULE_setQuantifier = 20,
RULE_selectItem = 21, RULE_relation = 22, RULE_joinType = 23, RULE_joinCriteria = 24,
RULE_sampledRelation = 25, RULE_sampleType = 26, RULE_aliasedRelation = 27,
RULE_columnAliases = 28, RULE_relationPrimary = 29, RULE_expression = 30,
RULE_booleanExpression = 31, RULE_predicate = 32, RULE_valueExpression = 33,
RULE_primaryExpression = 34, RULE_string = 35, RULE_timeZoneSpecifier = 36,
RULE_comparisonOperator = 37, RULE_comparisonQuantifier = 38, RULE_booleanValue = 39,
RULE_interval = 40, RULE_intervalField = 41, RULE_normalForm = 42, RULE_type = 43,
RULE_typeParameter = 44, RULE_baseType = 45, RULE_whenClause = 46, RULE_filter = 47,
RULE_over = 48, RULE_windowFrame = 49, RULE_frameBound = 50, RULE_explainOption = 51,
RULE_transactionMode = 52, RULE_levelOfIsolation = 53, RULE_callArgument = 54,
RULE_pathElement = 55, RULE_pathSpecification = 56, RULE_privilege = 57,
RULE_qualifiedName = 58, RULE_grantor = 59, RULE_principal = 60, RULE_roles = 61,
RULE_identifier = 62, RULE_number = 63, RULE_nonReserved = 64;
public static final String[] ruleNames = {
"singleStatement", "standaloneExpression", "standalonePathSpecification",
"statement", "query", "with", "tableElement", "columnDefinition", "likeClause",
"properties", "property", "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", "timeZoneSpecifier", "comparisonOperator", "comparisonQuantifier",
"booleanValue", "interval", "intervalField", "normalForm", "type", "typeParameter",
"baseType", "whenClause", "filter", "over", "windowFrame", "frameBound",
"explainOption", "transactionMode", "levelOfIsolation", "callArgument",
"pathElement", "pathSpecification", "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'", "'CASCADE'", "'CASE'", "'CAST'", "'CATALOGS'", "'COLUMN'", "'COLUMNS'",
"'COMMENT'", "'COMMIT'", "'COMMITTED'", "'CONSTRAINT'", "'CREATE'", "'CROSS'",
"'CUBE'", "'CURRENT'", "'CURRENT_DATE'", "'CURRENT_PATH'", "'CURRENT_ROLE'",
"'CURRENT_TIME'", "'CURRENT_TIMESTAMP'", "'CURRENT_USER'", "'DATA'", "'DATE'",
"'DAY'", "'DEALLOCATE'", "'DEFINER'", "'DELETE'", "'DESC'", "'DESCRIBE'",
"'DISTINCT'", "'DISTRIBUTED'", "'DROP'", "'ELSE'", "'END'", "'ESCAPE'",
"'EXCEPT'", "'EXCLUDING'", "'EXECUTE'", "'EXISTS'", "'EXPLAIN'", "'EXTRACT'",
"'FALSE'", "'FILTER'", "'FIRST'", "'FOLLOWING'", "'FOR'", "'FORMAT'",
"'FROM'", "'FULL'", "'FUNCTIONS'", "'GRANT'", "'GRANTED'", "'GRANTS'",
"'GRAPHVIZ'", "'GROUP'", "'GROUPING'", "'HAVING'", "'HOUR'", "'IF'", "'IN'",
"'INCLUDING'", "'INNER'", "'INPUT'", "'INSERT'", "'INTERSECT'", "'INTERVAL'",
"'INTO'", "'INVOKER'", "'IO'", "'IS'", "'ISOLATION'", "'JSON'", "'JOIN'",
"'LAST'", "'LATERAL'", "'LEFT'", "'LEVEL'", "'LIKE'", "'LIMIT'", "'LOCALTIME'",
"'LOCALTIMESTAMP'", "'LOGICAL'", "'MAP'", "'MINUTE'", "'MONTH'", "'NATURAL'",
"'NFC'", "'NFD'", "'NFKC'", "'NFKD'", "'NO'", "'NONE'", "'NORMALIZE'",
"'NOT'", "'NULL'", "'NULLIF'", "'NULLS'", "'ON'", "'ONLY'", "'OPTION'",
"'OR'", "'ORDER'", "'ORDINALITY'", "'OUTER'", "'OUTPUT'", "'OVER'", "'PARTITION'",
"'PARTITIONS'", "'PATH'", "'POSITION'", "'PRECEDING'", "'PREPARE'", "'PRIVILEGES'",
"'PROPERTIES'", "'RANGE'", "'READ'", "'RECURSIVE'", "'RENAME'", "'REPEATABLE'",
"'REPLACE'", "'RESET'", "'RESTRICT'", "'REVOKE'", "'RIGHT'", "'ROLE'",
"'ROLES'", "'ROLLBACK'", "'ROLLUP'", "'ROW'", "'ROWS'", "'SCHEMA'", "'SCHEMAS'",
"'SECOND'", "'SECURITY'", "'SELECT'", "'SERIALIZABLE'", "'SESSION'", "'SET'",
"'SETS'", "'SHOW'", "'SOME'", "'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", "CASCADE", "CASE", "CAST", "CATALOGS", "COLUMN",
"COLUMNS", "COMMENT", "COMMIT", "COMMITTED", "CONSTRAINT", "CREATE", "CROSS",
"CUBE", "CURRENT", "CURRENT_DATE", "CURRENT_PATH", "CURRENT_ROLE", "CURRENT_TIME",
"CURRENT_TIMESTAMP", "CURRENT_USER", "DATA", "DATE", "DAY", "DEALLOCATE",
"DEFINER", "DELETE", "DESC", "DESCRIBE", "DISTINCT", "DISTRIBUTED", "DROP",
"ELSE", "END", "ESCAPE", "EXCEPT", "EXCLUDING", "EXECUTE", "EXISTS", "EXPLAIN",
"EXTRACT", "FALSE", "FILTER", "FIRST", "FOLLOWING", "FOR", "FORMAT", "FROM",
"FULL", "FUNCTIONS", "GRANT", "GRANTED", "GRANTS", "GRAPHVIZ", "GROUP",
"GROUPING", "HAVING", "HOUR", "IF", "IN", "INCLUDING", "INNER", "INPUT",
"INSERT", "INTERSECT", "INTERVAL", "INTO", "INVOKER", "IO", "IS", "ISOLATION",
"JSON", "JOIN", "LAST", "LATERAL", "LEFT", "LEVEL", "LIKE", "LIMIT", "LOCALTIME",
"LOCALTIMESTAMP", "LOGICAL", "MAP", "MINUTE", "MONTH", "NATURAL", "NFC",
"NFD", "NFKC", "NFKD", "NO", "NONE", "NORMALIZE", "NOT", "NULL", "NULLIF",
"NULLS", "ON", "ONLY", "OPTION", "OR", "ORDER", "ORDINALITY", "OUTER",
"OUTPUT", "OVER", "PARTITION", "PARTITIONS", "PATH", "POSITION", "PRECEDING",
"PREPARE", "PRIVILEGES", "PROPERTIES", "RANGE", "READ", "RECURSIVE", "RENAME",
"REPEATABLE", "REPLACE", "RESET", "RESTRICT", "REVOKE", "RIGHT", "ROLE",
"ROLES", "ROLLBACK", "ROLLUP", "ROW", "ROWS", "SCHEMA", "SCHEMAS", "SECOND",
"SECURITY", "SELECT", "SERIALIZABLE", "SESSION", "SET", "SETS", "SHOW",
"SOME", "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(130);
statement();
setState(131);
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(133);
expression();
setState(134);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StandalonePathSpecificationContext extends ParserRuleContext {
public PathSpecificationContext pathSpecification() {
return getRuleContext(PathSpecificationContext.class,0);
}
public TerminalNode EOF() { return getToken(SqlBaseParser.EOF, 0); }
public StandalonePathSpecificationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_standalonePathSpecification; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterStandalonePathSpecification(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitStandalonePathSpecification(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitStandalonePathSpecification(this);
else return visitor.visitChildren(this);
}
}
public final StandalonePathSpecificationContext standalonePathSpecification() throws RecognitionException {
StandalonePathSpecificationContext _localctx = new StandalonePathSpecificationContext(_ctx, getState());
enterRule(_localctx, 4, RULE_standalonePathSpecification);
try {
enterOuterAlt(_localctx, 1);
{
setState(136);
pathSpecification();
setState(137);
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 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 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 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 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 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 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 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 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 CommentTableContext extends StatementContext {
public TerminalNode COMMENT() { return getToken(SqlBaseParser.COMMENT, 0); }
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode IS() { return getToken(SqlBaseParser.IS, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public TerminalNode NULL() { return getToken(SqlBaseParser.NULL, 0); }
public CommentTableContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCommentTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCommentTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCommentTable(this);
else return visitor.visitChildren(this);
}
}
public static class SetPathContext extends StatementContext {
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode PATH() { return getToken(SqlBaseParser.PATH, 0); }
public PathSpecificationContext pathSpecification() {
return getRuleContext(PathSpecificationContext.class,0);
}
public SetPathContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetPath(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetPath(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetPath(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 TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode FUNCTIONS() { return getToken(SqlBaseParser.FUNCTIONS, 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(620);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,63,_ctx) ) {
case 1:
_localctx = new StatementDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(139);
query();
}
break;
case 2:
_localctx = new UseContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(140);
match(USE);
setState(141);
((UseContext)_localctx).schema = identifier();
}
break;
case 3:
_localctx = new UseContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(142);
match(USE);
setState(143);
((UseContext)_localctx).catalog = identifier();
setState(144);
match(T__0);
setState(145);
((UseContext)_localctx).schema = identifier();
}
break;
case 4:
_localctx = new CreateSchemaContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(147);
match(CREATE);
setState(148);
match(SCHEMA);
setState(152);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) {
case 1:
{
setState(149);
match(IF);
setState(150);
match(NOT);
setState(151);
match(EXISTS);
}
break;
}
setState(154);
qualifiedName();
setState(157);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(155);
match(WITH);
setState(156);
properties();
}
}
}
break;
case 5:
_localctx = new DropSchemaContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(159);
match(DROP);
setState(160);
match(SCHEMA);
setState(163);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) {
case 1:
{
setState(161);
match(IF);
setState(162);
match(EXISTS);
}
break;
}
setState(165);
qualifiedName();
setState(167);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CASCADE || _la==RESTRICT) {
{
setState(166);
_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(169);
match(ALTER);
setState(170);
match(SCHEMA);
setState(171);
qualifiedName();
setState(172);
match(RENAME);
setState(173);
match(TO);
setState(174);
identifier();
}
break;
case 7:
_localctx = new CreateTableAsSelectContext(_localctx);
enterOuterAlt(_localctx, 7);
{
setState(176);
match(CREATE);
setState(177);
match(TABLE);
setState(181);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
case 1:
{
setState(178);
match(IF);
setState(179);
match(NOT);
setState(180);
match(EXISTS);
}
break;
}
setState(183);
qualifiedName();
setState(185);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(184);
columnAliases();
}
}
setState(189);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(187);
match(COMMENT);
setState(188);
string();
}
}
setState(193);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(191);
match(WITH);
setState(192);
properties();
}
}
setState(195);
match(AS);
setState(201);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,8,_ctx) ) {
case 1:
{
setState(196);
query();
}
break;
case 2:
{
setState(197);
match(T__1);
setState(198);
query();
setState(199);
match(T__2);
}
break;
}
setState(208);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(203);
match(WITH);
setState(205);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NO) {
{
setState(204);
match(NO);
}
}
setState(207);
match(DATA);
}
}
}
break;
case 8:
_localctx = new CreateTableContext(_localctx);
enterOuterAlt(_localctx, 8);
{
setState(210);
match(CREATE);
setState(211);
match(TABLE);
setState(215);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) {
case 1:
{
setState(212);
match(IF);
setState(213);
match(NOT);
setState(214);
match(EXISTS);
}
break;
}
setState(217);
qualifiedName();
setState(218);
match(T__1);
setState(219);
tableElement();
setState(224);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(220);
match(T__3);
setState(221);
tableElement();
}
}
setState(226);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(227);
match(T__2);
setState(230);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(228);
match(COMMENT);
setState(229);
string();
}
}
setState(234);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(232);
match(WITH);
setState(233);
properties();
}
}
}
break;
case 9:
_localctx = new DropTableContext(_localctx);
enterOuterAlt(_localctx, 9);
{
setState(236);
match(DROP);
setState(237);
match(TABLE);
setState(240);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) {
case 1:
{
setState(238);
match(IF);
setState(239);
match(EXISTS);
}
break;
}
setState(242);
qualifiedName();
}
break;
case 10:
_localctx = new InsertIntoContext(_localctx);
enterOuterAlt(_localctx, 10);
{
setState(243);
match(INSERT);
setState(244);
match(INTO);
setState(245);
qualifiedName();
setState(247);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) {
case 1:
{
setState(246);
columnAliases();
}
break;
}
setState(249);
query();
}
break;
case 11:
_localctx = new DeleteContext(_localctx);
enterOuterAlt(_localctx, 11);
{
setState(251);
match(DELETE);
setState(252);
match(FROM);
setState(253);
qualifiedName();
setState(256);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHERE) {
{
setState(254);
match(WHERE);
setState(255);
booleanExpression(0);
}
}
}
break;
case 12:
_localctx = new RenameTableContext(_localctx);
enterOuterAlt(_localctx, 12);
{
setState(258);
match(ALTER);
setState(259);
match(TABLE);
setState(260);
((RenameTableContext)_localctx).from = qualifiedName();
setState(261);
match(RENAME);
setState(262);
match(TO);
setState(263);
((RenameTableContext)_localctx).to = qualifiedName();
}
break;
case 13:
_localctx = new CommentTableContext(_localctx);
enterOuterAlt(_localctx, 13);
{
setState(265);
match(COMMENT);
setState(266);
match(ON);
setState(267);
match(TABLE);
setState(268);
qualifiedName();
setState(269);
match(IS);
setState(272);
_errHandler.sync(this);
switch (_input.LA(1)) {
case STRING:
case UNICODE_STRING:
{
setState(270);
string();
}
break;
case NULL:
{
setState(271);
match(NULL);
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
case 14:
_localctx = new RenameColumnContext(_localctx);
enterOuterAlt(_localctx, 14);
{
setState(274);
match(ALTER);
setState(275);
match(TABLE);
setState(276);
((RenameColumnContext)_localctx).tableName = qualifiedName();
setState(277);
match(RENAME);
setState(278);
match(COLUMN);
setState(279);
((RenameColumnContext)_localctx).from = identifier();
setState(280);
match(TO);
setState(281);
((RenameColumnContext)_localctx).to = identifier();
}
break;
case 15:
_localctx = new DropColumnContext(_localctx);
enterOuterAlt(_localctx, 15);
{
setState(283);
match(ALTER);
setState(284);
match(TABLE);
setState(285);
((DropColumnContext)_localctx).tableName = qualifiedName();
setState(286);
match(DROP);
setState(287);
match(COLUMN);
setState(288);
((DropColumnContext)_localctx).column = qualifiedName();
}
break;
case 16:
_localctx = new AddColumnContext(_localctx);
enterOuterAlt(_localctx, 16);
{
setState(290);
match(ALTER);
setState(291);
match(TABLE);
setState(292);
((AddColumnContext)_localctx).tableName = qualifiedName();
setState(293);
match(ADD);
setState(294);
match(COLUMN);
setState(295);
((AddColumnContext)_localctx).column = columnDefinition();
}
break;
case 17:
_localctx = new AnalyzeContext(_localctx);
enterOuterAlt(_localctx, 17);
{
setState(297);
match(ANALYZE);
setState(298);
qualifiedName();
setState(301);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(299);
match(WITH);
setState(300);
properties();
}
}
}
break;
case 18:
_localctx = new CreateViewContext(_localctx);
enterOuterAlt(_localctx, 18);
{
setState(303);
match(CREATE);
setState(306);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OR) {
{
setState(304);
match(OR);
setState(305);
match(REPLACE);
}
}
setState(308);
match(VIEW);
setState(309);
qualifiedName();
setState(312);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SECURITY) {
{
setState(310);
match(SECURITY);
setState(311);
_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(314);
match(AS);
setState(315);
query();
}
break;
case 19:
_localctx = new DropViewContext(_localctx);
enterOuterAlt(_localctx, 19);
{
setState(317);
match(DROP);
setState(318);
match(VIEW);
setState(321);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) {
case 1:
{
setState(319);
match(IF);
setState(320);
match(EXISTS);
}
break;
}
setState(323);
qualifiedName();
}
break;
case 20:
_localctx = new CallContext(_localctx);
enterOuterAlt(_localctx, 20);
{
setState(324);
match(CALL);
setState(325);
qualifiedName();
setState(326);
match(T__1);
setState(335);
_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 << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_PATH) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS) | (1L << EXPLAIN))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXTRACT - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 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 << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 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 << (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)) | (1L << (ONLY - 64)) | (1L << (OPTION - 64)) | (1L << (ORDINALITY - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (PATH - 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 << (RESTRICT - 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 << (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)) | (1L << (UNCOMMITTED - 128)) | (1L << (USE - 128)) | (1L << (USER - 128)) | (1L << (VALIDATE - 128)) | (1L << (VERBOSE - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 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(327);
callArgument();
setState(332);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(328);
match(T__3);
setState(329);
callArgument();
}
}
setState(334);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(337);
match(T__2);
}
break;
case 21:
_localctx = new CreateRoleContext(_localctx);
enterOuterAlt(_localctx, 21);
{
setState(339);
match(CREATE);
setState(340);
match(ROLE);
setState(341);
((CreateRoleContext)_localctx).name = identifier();
setState(345);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(342);
match(WITH);
setState(343);
match(ADMIN);
setState(344);
grantor();
}
}
}
break;
case 22:
_localctx = new DropRoleContext(_localctx);
enterOuterAlt(_localctx, 22);
{
setState(347);
match(DROP);
setState(348);
match(ROLE);
setState(349);
((DropRoleContext)_localctx).name = identifier();
}
break;
case 23:
_localctx = new GrantRolesContext(_localctx);
enterOuterAlt(_localctx, 23);
{
setState(350);
match(GRANT);
setState(351);
roles();
setState(352);
match(TO);
setState(353);
principal();
setState(358);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(354);
match(T__3);
setState(355);
principal();
}
}
setState(360);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(364);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(361);
match(WITH);
setState(362);
match(ADMIN);
setState(363);
match(OPTION);
}
}
setState(369);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GRANTED) {
{
setState(366);
match(GRANTED);
setState(367);
match(BY);
setState(368);
grantor();
}
}
}
break;
case 24:
_localctx = new RevokeRolesContext(_localctx);
enterOuterAlt(_localctx, 24);
{
setState(371);
match(REVOKE);
setState(375);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,29,_ctx) ) {
case 1:
{
setState(372);
match(ADMIN);
setState(373);
match(OPTION);
setState(374);
match(FOR);
}
break;
}
setState(377);
roles();
setState(378);
match(FROM);
setState(379);
principal();
setState(384);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(380);
match(T__3);
setState(381);
principal();
}
}
setState(386);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(390);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GRANTED) {
{
setState(387);
match(GRANTED);
setState(388);
match(BY);
setState(389);
grantor();
}
}
}
break;
case 25:
_localctx = new SetRoleContext(_localctx);
enterOuterAlt(_localctx, 25);
{
setState(392);
match(SET);
setState(393);
match(ROLE);
setState(397);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,32,_ctx) ) {
case 1:
{
setState(394);
match(ALL);
}
break;
case 2:
{
setState(395);
match(NONE);
}
break;
case 3:
{
setState(396);
((SetRoleContext)_localctx).role = identifier();
}
break;
}
}
break;
case 26:
_localctx = new GrantContext(_localctx);
enterOuterAlt(_localctx, 26);
{
setState(399);
match(GRANT);
setState(410);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) {
case 1:
{
setState(400);
privilege();
setState(405);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(401);
match(T__3);
setState(402);
privilege();
}
}
setState(407);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case 2:
{
setState(408);
match(ALL);
setState(409);
match(PRIVILEGES);
}
break;
}
setState(412);
match(ON);
setState(414);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==TABLE) {
{
setState(413);
match(TABLE);
}
}
setState(416);
qualifiedName();
setState(417);
match(TO);
setState(418);
((GrantContext)_localctx).grantee = principal();
setState(422);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(419);
match(WITH);
setState(420);
match(GRANT);
setState(421);
match(OPTION);
}
}
}
break;
case 27:
_localctx = new RevokeContext(_localctx);
enterOuterAlt(_localctx, 27);
{
setState(424);
match(REVOKE);
setState(428);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) {
case 1:
{
setState(425);
match(GRANT);
setState(426);
match(OPTION);
setState(427);
match(FOR);
}
break;
}
setState(440);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,39,_ctx) ) {
case 1:
{
setState(430);
privilege();
setState(435);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(431);
match(T__3);
setState(432);
privilege();
}
}
setState(437);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case 2:
{
setState(438);
match(ALL);
setState(439);
match(PRIVILEGES);
}
break;
}
setState(442);
match(ON);
setState(444);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==TABLE) {
{
setState(443);
match(TABLE);
}
}
setState(446);
qualifiedName();
setState(447);
match(FROM);
setState(448);
((RevokeContext)_localctx).grantee = principal();
}
break;
case 28:
_localctx = new ShowGrantsContext(_localctx);
enterOuterAlt(_localctx, 28);
{
setState(450);
match(SHOW);
setState(451);
match(GRANTS);
setState(457);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ON) {
{
setState(452);
match(ON);
setState(454);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==TABLE) {
{
setState(453);
match(TABLE);
}
}
setState(456);
qualifiedName();
}
}
}
break;
case 29:
_localctx = new ExplainContext(_localctx);
enterOuterAlt(_localctx, 29);
{
setState(459);
match(EXPLAIN);
setState(461);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,43,_ctx) ) {
case 1:
{
setState(460);
match(ANALYZE);
}
break;
}
setState(464);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==VERBOSE) {
{
setState(463);
match(VERBOSE);
}
}
setState(477);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,46,_ctx) ) {
case 1:
{
setState(466);
match(T__1);
setState(467);
explainOption();
setState(472);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(468);
match(T__3);
setState(469);
explainOption();
}
}
setState(474);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(475);
match(T__2);
}
break;
}
setState(479);
statement();
}
break;
case 30:
_localctx = new ShowCreateTableContext(_localctx);
enterOuterAlt(_localctx, 30);
{
setState(480);
match(SHOW);
setState(481);
match(CREATE);
setState(482);
match(TABLE);
setState(483);
qualifiedName();
}
break;
case 31:
_localctx = new ShowCreateViewContext(_localctx);
enterOuterAlt(_localctx, 31);
{
setState(484);
match(SHOW);
setState(485);
match(CREATE);
setState(486);
match(VIEW);
setState(487);
qualifiedName();
}
break;
case 32:
_localctx = new ShowTablesContext(_localctx);
enterOuterAlt(_localctx, 32);
{
setState(488);
match(SHOW);
setState(489);
match(TABLES);
setState(492);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(490);
_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(491);
qualifiedName();
}
}
setState(500);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(494);
match(LIKE);
setState(495);
((ShowTablesContext)_localctx).pattern = string();
setState(498);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(496);
match(ESCAPE);
setState(497);
((ShowTablesContext)_localctx).escape = string();
}
}
}
}
}
break;
case 33:
_localctx = new ShowSchemasContext(_localctx);
enterOuterAlt(_localctx, 33);
{
setState(502);
match(SHOW);
setState(503);
match(SCHEMAS);
setState(506);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(504);
_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(505);
identifier();
}
}
setState(514);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(508);
match(LIKE);
setState(509);
((ShowSchemasContext)_localctx).pattern = string();
setState(512);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(510);
match(ESCAPE);
setState(511);
((ShowSchemasContext)_localctx).escape = string();
}
}
}
}
}
break;
case 34:
_localctx = new ShowCatalogsContext(_localctx);
enterOuterAlt(_localctx, 34);
{
setState(516);
match(SHOW);
setState(517);
match(CATALOGS);
setState(520);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(518);
match(LIKE);
setState(519);
((ShowCatalogsContext)_localctx).pattern = string();
}
}
}
break;
case 35:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 35);
{
setState(522);
match(SHOW);
setState(523);
match(COLUMNS);
setState(524);
_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(525);
qualifiedName();
}
break;
case 36:
_localctx = new ShowStatsContext(_localctx);
enterOuterAlt(_localctx, 36);
{
setState(526);
match(SHOW);
setState(527);
match(STATS);
setState(528);
match(FOR);
setState(529);
qualifiedName();
}
break;
case 37:
_localctx = new ShowStatsForQueryContext(_localctx);
enterOuterAlt(_localctx, 37);
{
setState(530);
match(SHOW);
setState(531);
match(STATS);
setState(532);
match(FOR);
setState(533);
match(T__1);
setState(534);
querySpecification();
setState(535);
match(T__2);
}
break;
case 38:
_localctx = new ShowRolesContext(_localctx);
enterOuterAlt(_localctx, 38);
{
setState(537);
match(SHOW);
setState(539);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CURRENT) {
{
setState(538);
match(CURRENT);
}
}
setState(541);
match(ROLES);
setState(544);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(542);
_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(543);
identifier();
}
}
}
break;
case 39:
_localctx = new ShowRoleGrantsContext(_localctx);
enterOuterAlt(_localctx, 39);
{
setState(546);
match(SHOW);
setState(547);
match(ROLE);
setState(548);
match(GRANTS);
setState(551);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(549);
_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(550);
identifier();
}
}
}
break;
case 40:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 40);
{
setState(553);
match(DESCRIBE);
setState(554);
qualifiedName();
}
break;
case 41:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 41);
{
setState(555);
match(DESC);
setState(556);
qualifiedName();
}
break;
case 42:
_localctx = new ShowFunctionsContext(_localctx);
enterOuterAlt(_localctx, 42);
{
setState(557);
match(SHOW);
setState(558);
match(FUNCTIONS);
}
break;
case 43:
_localctx = new ShowSessionContext(_localctx);
enterOuterAlt(_localctx, 43);
{
setState(559);
match(SHOW);
setState(560);
match(SESSION);
}
break;
case 44:
_localctx = new SetSessionContext(_localctx);
enterOuterAlt(_localctx, 44);
{
setState(561);
match(SET);
setState(562);
match(SESSION);
setState(563);
qualifiedName();
setState(564);
match(EQ);
setState(565);
expression();
}
break;
case 45:
_localctx = new ResetSessionContext(_localctx);
enterOuterAlt(_localctx, 45);
{
setState(567);
match(RESET);
setState(568);
match(SESSION);
setState(569);
qualifiedName();
}
break;
case 46:
_localctx = new StartTransactionContext(_localctx);
enterOuterAlt(_localctx, 46);
{
setState(570);
match(START);
setState(571);
match(TRANSACTION);
setState(580);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ISOLATION || _la==READ) {
{
setState(572);
transactionMode();
setState(577);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(573);
match(T__3);
setState(574);
transactionMode();
}
}
setState(579);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
}
break;
case 47:
_localctx = new CommitContext(_localctx);
enterOuterAlt(_localctx, 47);
{
setState(582);
match(COMMIT);
setState(584);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WORK) {
{
setState(583);
match(WORK);
}
}
}
break;
case 48:
_localctx = new RollbackContext(_localctx);
enterOuterAlt(_localctx, 48);
{
setState(586);
match(ROLLBACK);
setState(588);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WORK) {
{
setState(587);
match(WORK);
}
}
}
break;
case 49:
_localctx = new PrepareContext(_localctx);
enterOuterAlt(_localctx, 49);
{
setState(590);
match(PREPARE);
setState(591);
identifier();
setState(592);
match(FROM);
setState(593);
statement();
}
break;
case 50:
_localctx = new DeallocateContext(_localctx);
enterOuterAlt(_localctx, 50);
{
setState(595);
match(DEALLOCATE);
setState(596);
match(PREPARE);
setState(597);
identifier();
}
break;
case 51:
_localctx = new ExecuteContext(_localctx);
enterOuterAlt(_localctx, 51);
{
setState(598);
match(EXECUTE);
setState(599);
identifier();
setState(609);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==USING) {
{
setState(600);
match(USING);
setState(601);
expression();
setState(606);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(602);
match(T__3);
setState(603);
expression();
}
}
setState(608);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
}
break;
case 52:
_localctx = new DescribeInputContext(_localctx);
enterOuterAlt(_localctx, 52);
{
setState(611);
match(DESCRIBE);
setState(612);
match(INPUT);
setState(613);
identifier();
}
break;
case 53:
_localctx = new DescribeOutputContext(_localctx);
enterOuterAlt(_localctx, 53);
{
setState(614);
match(DESCRIBE);
setState(615);
match(OUTPUT);
setState(616);
identifier();
}
break;
case 54:
_localctx = new SetPathContext(_localctx);
enterOuterAlt(_localctx, 54);
{
setState(617);
match(SET);
setState(618);
match(PATH);
setState(619);
pathSpecification();
}
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(623);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(622);
with();
}
}
setState(625);
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(627);
match(WITH);
setState(629);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==RECURSIVE) {
{
setState(628);
match(RECURSIVE);
}
}
setState(631);
namedQuery();
setState(636);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(632);
match(T__3);
setState(633);
namedQuery();
}
}
setState(638);
_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(641);
_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 CASCADE:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DISTRIBUTED:
case EXCLUDING:
case EXPLAIN:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case HOUR:
case IF:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
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 PATH:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESTRICT:
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 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(639);
columnDefinition();
}
break;
case LIKE:
enterOuterAlt(_localctx, 2);
{
setState(640);
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(643);
identifier();
setState(644);
type(0);
setState(647);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(645);
match(NOT);
setState(646);
match(NULL);
}
}
setState(651);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(649);
match(COMMENT);
setState(650);
string();
}
}
setState(655);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(653);
match(WITH);
setState(654);
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(657);
match(LIKE);
setState(658);
qualifiedName();
setState(661);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==EXCLUDING || _la==INCLUDING) {
{
setState(659);
((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(660);
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(663);
match(T__1);
setState(664);
property();
setState(669);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(665);
match(T__3);
setState(666);
property();
}
}
setState(671);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(672);
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(674);
identifier();
setState(675);
match(EQ);
setState(676);
expression();
}
}
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, 22, RULE_queryNoWith);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(678);
queryTerm(0);
setState(689);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(679);
match(ORDER);
setState(680);
match(BY);
setState(681);
sortItem();
setState(686);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(682);
match(T__3);
setState(683);
sortItem();
}
}
setState(688);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(693);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIMIT) {
{
setState(691);
match(LIMIT);
setState(692);
((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 = 24;
enterRecursionRule(_localctx, 24, RULE_queryTerm, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
{
_localctx = new QueryTermDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(696);
queryPrimary();
}
_ctx.stop = _input.LT(-1);
setState(712);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,79,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(710);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,78,_ctx) ) {
case 1:
{
_localctx = new SetOperationContext(new QueryTermContext(_parentctx, _parentState));
((SetOperationContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_queryTerm);
setState(698);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(699);
((SetOperationContext)_localctx).operator = match(INTERSECT);
setState(701);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==DISTINCT) {
{
setState(700);
setQuantifier();
}
}
setState(703);
((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(704);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
setState(705);
((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(707);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==DISTINCT) {
{
setState(706);
setQuantifier();
}
}
setState(709);
((SetOperationContext)_localctx).right = queryTerm(2);
}
break;
}
}
}
setState(714);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,79,_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, 26, RULE_queryPrimary);
try {
int _alt;
setState(731);
_errHandler.sync(this);
switch (_input.LA(1)) {
case SELECT:
_localctx = new QueryPrimaryDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(715);
querySpecification();
}
break;
case TABLE:
_localctx = new TableContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(716);
match(TABLE);
setState(717);
qualifiedName();
}
break;
case VALUES:
_localctx = new InlineTableContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(718);
match(VALUES);
setState(719);
expression();
setState(724);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,80,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(720);
match(T__3);
setState(721);
expression();
}
}
}
setState(726);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,80,_ctx);
}
}
break;
case T__1:
_localctx = new SubqueryContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(727);
match(T__1);
setState(728);
queryNoWith();
setState(729);
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, 28, RULE_sortItem);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(733);
expression();
setState(735);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASC || _la==DESC) {
{
setState(734);
((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(739);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NULLS) {
{
setState(737);
match(NULLS);
setState(738);
((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, 30, RULE_querySpecification);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(741);
match(SELECT);
setState(743);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,84,_ctx) ) {
case 1:
{
setState(742);
setQuantifier();
}
break;
}
setState(745);
selectItem();
setState(750);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,85,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(746);
match(T__3);
setState(747);
selectItem();
}
}
}
setState(752);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,85,_ctx);
}
setState(762);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,87,_ctx) ) {
case 1:
{
setState(753);
match(FROM);
setState(754);
relation(0);
setState(759);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,86,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(755);
match(T__3);
setState(756);
relation(0);
}
}
}
setState(761);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,86,_ctx);
}
}
break;
}
setState(766);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,88,_ctx) ) {
case 1:
{
setState(764);
match(WHERE);
setState(765);
((QuerySpecificationContext)_localctx).where = booleanExpression(0);
}
break;
}
setState(771);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,89,_ctx) ) {
case 1:
{
setState(768);
match(GROUP);
setState(769);
match(BY);
setState(770);
groupBy();
}
break;
}
setState(775);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,90,_ctx) ) {
case 1:
{
setState(773);
match(HAVING);
setState(774);
((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, 32, RULE_groupBy);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(778);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,91,_ctx) ) {
case 1:
{
setState(777);
setQuantifier();
}
break;
}
setState(780);
groupingElement();
setState(785);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,92,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(781);
match(T__3);
setState(782);
groupingElement();
}
}
}
setState(787);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,92,_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, 34, RULE_groupingElement);
int _la;
try {
setState(828);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,98,_ctx) ) {
case 1:
_localctx = new SingleGroupingSetContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(788);
groupingSet();
}
break;
case 2:
_localctx = new RollupContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(789);
match(ROLLUP);
setState(790);
match(T__1);
setState(799);
_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 << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_PATH) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS) | (1L << EXPLAIN))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXTRACT - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 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 << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 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 << (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)) | (1L << (ONLY - 64)) | (1L << (OPTION - 64)) | (1L << (ORDINALITY - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (PATH - 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 << (RESTRICT - 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 << (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)) | (1L << (UNCOMMITTED - 128)) | (1L << (USE - 128)) | (1L << (USER - 128)) | (1L << (VALIDATE - 128)) | (1L << (VERBOSE - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 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(791);
expression();
setState(796);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(792);
match(T__3);
setState(793);
expression();
}
}
setState(798);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(801);
match(T__2);
}
break;
case 3:
_localctx = new CubeContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(802);
match(CUBE);
setState(803);
match(T__1);
setState(812);
_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 << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_PATH) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS) | (1L << EXPLAIN))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXTRACT - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 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 << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 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 << (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)) | (1L << (ONLY - 64)) | (1L << (OPTION - 64)) | (1L << (ORDINALITY - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (PATH - 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 << (RESTRICT - 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 << (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)) | (1L << (UNCOMMITTED - 128)) | (1L << (USE - 128)) | (1L << (USER - 128)) | (1L << (VALIDATE - 128)) | (1L << (VERBOSE - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 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(804);
expression();
setState(809);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(805);
match(T__3);
setState(806);
expression();
}
}
setState(811);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(814);
match(T__2);
}
break;
case 4:
_localctx = new MultipleGroupingSetsContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(815);
match(GROUPING);
setState(816);
match(SETS);
setState(817);
match(T__1);
setState(818);
groupingSet();
setState(823);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(819);
match(T__3);
setState(820);
groupingSet();
}
}
setState(825);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(826);
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, 36, RULE_groupingSet);
int _la;
try {
setState(843);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,101,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(830);
match(T__1);
setState(839);
_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 << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_PATH) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS) | (1L << EXPLAIN))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXTRACT - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 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 << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 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 << (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)) | (1L << (ONLY - 64)) | (1L << (OPTION - 64)) | (1L << (ORDINALITY - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (PATH - 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 << (RESTRICT - 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 << (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)) | (1L << (UNCOMMITTED - 128)) | (1L << (USE - 128)) | (1L << (USER - 128)) | (1L << (VALIDATE - 128)) | (1L << (VERBOSE - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 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(831);
expression();
setState(836);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(832);
match(T__3);
setState(833);
expression();
}
}
setState(838);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(841);
match(T__2);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(842);
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, 38, RULE_namedQuery);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(845);
((NamedQueryContext)_localctx).name = identifier();
setState(847);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(846);
columnAliases();
}
}
setState(849);
match(AS);
setState(850);
match(T__1);
setState(851);
query();
setState(852);
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, 40, RULE_setQuantifier);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(854);
_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, 42, RULE_selectItem);
int _la;
try {
setState(868);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,105,_ctx) ) {
case 1:
_localctx = new SelectSingleContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(856);
expression();
setState(861);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,104,_ctx) ) {
case 1:
{
setState(858);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(857);
match(AS);
}
}
setState(860);
identifier();
}
break;
}
}
break;
case 2:
_localctx = new SelectAllContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(863);
qualifiedName();
setState(864);
match(T__0);
setState(865);
match(ASTERISK);
}
break;
case 3:
_localctx = new SelectAllContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(867);
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 = 44;
enterRecursionRule(_localctx, 44, RULE_relation, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
{
_localctx = new RelationDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(871);
sampledRelation();
}
_ctx.stop = _input.LT(-1);
setState(891);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,107,_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(873);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(887);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CROSS:
{
setState(874);
match(CROSS);
setState(875);
match(JOIN);
setState(876);
((JoinRelationContext)_localctx).right = sampledRelation();
}
break;
case FULL:
case INNER:
case JOIN:
case LEFT:
case RIGHT:
{
setState(877);
joinType();
setState(878);
match(JOIN);
setState(879);
((JoinRelationContext)_localctx).rightRelation = relation(0);
setState(880);
joinCriteria();
}
break;
case NATURAL:
{
setState(882);
match(NATURAL);
setState(883);
joinType();
setState(884);
match(JOIN);
setState(885);
((JoinRelationContext)_localctx).right = sampledRelation();
}
break;
default:
throw new NoViableAltException(this);
}
}
}
}
setState(893);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,107,_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, 46, RULE_joinType);
int _la;
try {
setState(909);
_errHandler.sync(this);
switch (_input.LA(1)) {
case INNER:
case JOIN:
enterOuterAlt(_localctx, 1);
{
setState(895);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==INNER) {
{
setState(894);
match(INNER);
}
}
}
break;
case LEFT:
enterOuterAlt(_localctx, 2);
{
setState(897);
match(LEFT);
setState(899);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(898);
match(OUTER);
}
}
}
break;
case RIGHT:
enterOuterAlt(_localctx, 3);
{
setState(901);
match(RIGHT);
setState(903);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(902);
match(OUTER);
}
}
}
break;
case FULL:
enterOuterAlt(_localctx, 4);
{
setState(905);
match(FULL);
setState(907);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(906);
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, 48, RULE_joinCriteria);
int _la;
try {
setState(925);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ON:
enterOuterAlt(_localctx, 1);
{
setState(911);
match(ON);
setState(912);
booleanExpression(0);
}
break;
case USING:
enterOuterAlt(_localctx, 2);
{
setState(913);
match(USING);
setState(914);
match(T__1);
setState(915);
identifier();
setState(920);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(916);
match(T__3);
setState(917);
identifier();
}
}
setState(922);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(923);
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, 50, RULE_sampledRelation);
try {
enterOuterAlt(_localctx, 1);
{
setState(927);
aliasedRelation();
setState(934);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,115,_ctx) ) {
case 1:
{
setState(928);
match(TABLESAMPLE);
setState(929);
sampleType();
setState(930);
match(T__1);
setState(931);
((SampledRelationContext)_localctx).percentage = expression();
setState(932);
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, 52, RULE_sampleType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(936);
_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, 54, RULE_aliasedRelation);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(938);
relationPrimary();
setState(946);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,118,_ctx) ) {
case 1:
{
setState(940);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(939);
match(AS);
}
}
setState(942);
identifier();
setState(944);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,117,_ctx) ) {
case 1:
{
setState(943);
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, 56, RULE_columnAliases);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(948);
match(T__1);
setState(949);
identifier();
setState(954);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(950);
match(T__3);
setState(951);
identifier();
}
}
setState(956);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(957);
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, 58, RULE_relationPrimary);
int _la;
try {
setState(988);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,122,_ctx) ) {
case 1:
_localctx = new TableNameContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(959);
qualifiedName();
}
break;
case 2:
_localctx = new SubqueryRelationContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(960);
match(T__1);
setState(961);
query();
setState(962);
match(T__2);
}
break;
case 3:
_localctx = new UnnestContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(964);
match(UNNEST);
setState(965);
match(T__1);
setState(966);
expression();
setState(971);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(967);
match(T__3);
setState(968);
expression();
}
}
setState(973);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(974);
match(T__2);
setState(977);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,121,_ctx) ) {
case 1:
{
setState(975);
match(WITH);
setState(976);
match(ORDINALITY);
}
break;
}
}
break;
case 4:
_localctx = new LateralContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(979);
match(LATERAL);
setState(980);
match(T__1);
setState(981);
query();
setState(982);
match(T__2);
}
break;
case 5:
_localctx = new ParenthesizedRelationContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(984);
match(T__1);
setState(985);
relation(0);
setState(986);
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, 60, RULE_expression);
try {
enterOuterAlt(_localctx, 1);
{
setState(990);
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 = 62;
enterRecursionRule(_localctx, 62, RULE_booleanExpression, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(999);
_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 CASCADE:
case CASE:
case CAST:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case CURRENT_DATE:
case CURRENT_PATH:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DISTRIBUTED:
case EXCLUDING:
case EXISTS:
case EXPLAIN:
case EXTRACT:
case FALSE:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case GROUPING:
case HOUR:
case IF:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
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 PATH:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESTRICT:
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 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(993);
((PredicatedContext)_localctx).valueExpression = valueExpression(0);
setState(995);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,123,_ctx) ) {
case 1:
{
setState(994);
predicate(((PredicatedContext)_localctx).valueExpression);
}
break;
}
}
break;
case NOT:
{
_localctx = new LogicalNotContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(997);
match(NOT);
setState(998);
booleanExpression(3);
}
break;
default:
throw new NoViableAltException(this);
}
_ctx.stop = _input.LT(-1);
setState(1009);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,126,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(1007);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,125,_ctx) ) {
case 1:
{
_localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState));
((LogicalBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
setState(1001);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1002);
((LogicalBinaryContext)_localctx).operator = match(AND);
setState(1003);
((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(1004);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
setState(1005);
((LogicalBinaryContext)_localctx).operator = match(OR);
setState(1006);
((LogicalBinaryContext)_localctx).right = booleanExpression(2);
}
break;
}
}
}
setState(1011);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,126,_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, 64, RULE_predicate);
int _la;
try {
setState(1073);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,135,_ctx) ) {
case 1:
_localctx = new ComparisonContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1012);
comparisonOperator();
setState(1013);
((ComparisonContext)_localctx).right = valueExpression(0);
}
break;
case 2:
_localctx = new QuantifiedComparisonContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1015);
comparisonOperator();
setState(1016);
comparisonQuantifier();
setState(1017);
match(T__1);
setState(1018);
query();
setState(1019);
match(T__2);
}
break;
case 3:
_localctx = new BetweenContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1022);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1021);
match(NOT);
}
}
setState(1024);
match(BETWEEN);
setState(1025);
((BetweenContext)_localctx).lower = valueExpression(0);
setState(1026);
match(AND);
setState(1027);
((BetweenContext)_localctx).upper = valueExpression(0);
}
break;
case 4:
_localctx = new InListContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1030);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1029);
match(NOT);
}
}
setState(1032);
match(IN);
setState(1033);
match(T__1);
setState(1034);
expression();
setState(1039);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1035);
match(T__3);
setState(1036);
expression();
}
}
setState(1041);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1042);
match(T__2);
}
break;
case 5:
_localctx = new InSubqueryContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(1045);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1044);
match(NOT);
}
}
setState(1047);
match(IN);
setState(1048);
match(T__1);
setState(1049);
query();
setState(1050);
match(T__2);
}
break;
case 6:
_localctx = new LikeContext(_localctx);
enterOuterAlt(_localctx, 6);
{
setState(1053);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1052);
match(NOT);
}
}
setState(1055);
match(LIKE);
setState(1056);
((LikeContext)_localctx).pattern = valueExpression(0);
setState(1059);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,132,_ctx) ) {
case 1:
{
setState(1057);
match(ESCAPE);
setState(1058);
((LikeContext)_localctx).escape = valueExpression(0);
}
break;
}
}
break;
case 7:
_localctx = new NullPredicateContext(_localctx);
enterOuterAlt(_localctx, 7);
{
setState(1061);
match(IS);
setState(1063);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1062);
match(NOT);
}
}
setState(1065);
match(NULL);
}
break;
case 8:
_localctx = new DistinctFromContext(_localctx);
enterOuterAlt(_localctx, 8);
{
setState(1066);
match(IS);
setState(1068);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1067);
match(NOT);
}
}
setState(1070);
match(DISTINCT);
setState(1071);
match(FROM);
setState(1072);
((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 = 66;
enterRecursionRule(_localctx, 66, RULE_valueExpression, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1079);
_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 CASCADE:
case CASE:
case CAST:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case CURRENT_DATE:
case CURRENT_PATH:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DISTRIBUTED:
case EXCLUDING:
case EXISTS:
case EXPLAIN:
case EXTRACT:
case FALSE:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case GROUPING:
case HOUR:
case IF:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
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 PATH:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESTRICT:
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 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(1076);
primaryExpression(0);
}
break;
case PLUS:
case MINUS:
{
_localctx = new ArithmeticUnaryContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1077);
((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(1078);
valueExpression(4);
}
break;
default:
throw new NoViableAltException(this);
}
_ctx.stop = _input.LT(-1);
setState(1095);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,138,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(1093);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,137,_ctx) ) {
case 1:
{
_localctx = new ArithmeticBinaryContext(new ValueExpressionContext(_parentctx, _parentState));
((ArithmeticBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
setState(1081);
if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)");
setState(1082);
((ArithmeticBinaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(((((_la - 208)) & ~0x3f) == 0 && ((1L << (_la - 208)) & ((1L << (ASTERISK - 208)) | (1L << (SLASH - 208)) | (1L << (PERCENT - 208)))) != 0)) ) {
((ArithmeticBinaryContext)_localctx).operator = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1083);
((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(1084);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1085);
((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(1086);
((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(1087);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
setState(1088);
match(CONCAT);
setState(1089);
((ConcatenationContext)_localctx).right = valueExpression(2);
}
break;
case 4:
{
_localctx = new AtTimeZoneContext(new ValueExpressionContext(_parentctx, _parentState));
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
setState(1090);
if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)");
setState(1091);
match(AT);
setState(1092);
timeZoneSpecifier();
}
break;
}
}
}
setState(1097);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,138,_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 CurrentPathContext extends PrimaryExpressionContext {
public Token name;
public TerminalNode CURRENT_PATH() { return getToken(SqlBaseParser.CURRENT_PATH, 0); }
public CurrentPathContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCurrentPath(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCurrentPath(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCurrentPath(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 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 = 68;
enterRecursionRule(_localctx, 68, RULE_primaryExpression, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1335);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,166,_ctx) ) {
case 1:
{
_localctx = new NullLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1099);
match(NULL);
}
break;
case 2:
{
_localctx = new IntervalLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1100);
interval();
}
break;
case 3:
{
_localctx = new TypeConstructorContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1101);
identifier();
setState(1102);
string();
}
break;
case 4:
{
_localctx = new TypeConstructorContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1104);
match(DOUBLE_PRECISION);
setState(1105);
string();
}
break;
case 5:
{
_localctx = new NumericLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1106);
number();
}
break;
case 6:
{
_localctx = new BooleanLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1107);
booleanValue();
}
break;
case 7:
{
_localctx = new StringLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1108);
string();
}
break;
case 8:
{
_localctx = new BinaryLiteralContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1109);
match(BINARY_LITERAL);
}
break;
case 9:
{
_localctx = new ParameterContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1110);
match(T__4);
}
break;
case 10:
{
_localctx = new PositionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1111);
match(POSITION);
setState(1112);
match(T__1);
setState(1113);
valueExpression(0);
setState(1114);
match(IN);
setState(1115);
valueExpression(0);
setState(1116);
match(T__2);
}
break;
case 11:
{
_localctx = new RowConstructorContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1118);
match(T__1);
setState(1119);
expression();
setState(1122);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(1120);
match(T__3);
setState(1121);
expression();
}
}
setState(1124);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==T__3 );
setState(1126);
match(T__2);
}
break;
case 12:
{
_localctx = new RowConstructorContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1128);
match(ROW);
setState(1129);
match(T__1);
setState(1130);
expression();
setState(1135);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1131);
match(T__3);
setState(1132);
expression();
}
}
setState(1137);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1138);
match(T__2);
}
break;
case 13:
{
_localctx = new FunctionCallContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1140);
qualifiedName();
setState(1141);
match(T__1);
setState(1142);
match(ASTERISK);
setState(1143);
match(T__2);
setState(1145);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,141,_ctx) ) {
case 1:
{
setState(1144);
filter();
}
break;
}
setState(1148);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,142,_ctx) ) {
case 1:
{
setState(1147);
over();
}
break;
}
}
break;
case 14:
{
_localctx = new FunctionCallContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1150);
qualifiedName();
setState(1151);
match(T__1);
setState(1163);
_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 << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_PATH) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DISTINCT) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS) | (1L << EXPLAIN))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXTRACT - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 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 << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 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 << (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)) | (1L << (ONLY - 64)) | (1L << (OPTION - 64)) | (1L << (ORDINALITY - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (PATH - 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 << (RESTRICT - 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 << (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)) | (1L << (UNCOMMITTED - 128)) | (1L << (USE - 128)) | (1L << (USER - 128)) | (1L << (VALIDATE - 128)) | (1L << (VERBOSE - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 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(1153);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,143,_ctx) ) {
case 1:
{
setState(1152);
setQuantifier();
}
break;
}
setState(1155);
expression();
setState(1160);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1156);
match(T__3);
setState(1157);
expression();
}
}
setState(1162);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1175);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1165);
match(ORDER);
setState(1166);
match(BY);
setState(1167);
sortItem();
setState(1172);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1168);
match(T__3);
setState(1169);
sortItem();
}
}
setState(1174);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1177);
match(T__2);
setState(1179);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,148,_ctx) ) {
case 1:
{
setState(1178);
filter();
}
break;
}
setState(1182);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,149,_ctx) ) {
case 1:
{
setState(1181);
over();
}
break;
}
}
break;
case 15:
{
_localctx = new LambdaContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1184);
identifier();
setState(1185);
match(T__5);
setState(1186);
expression();
}
break;
case 16:
{
_localctx = new LambdaContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1188);
match(T__1);
setState(1197);
_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 << CASCADE) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXPLAIN))) != 0) || ((((_la - 66)) & ~0x3f) == 0 && ((1L << (_la - 66)) & ((1L << (FILTER - 66)) | (1L << (FIRST - 66)) | (1L << (FOLLOWING - 66)) | (1L << (FORMAT - 66)) | (1L << (FUNCTIONS - 66)) | (1L << (GRANT - 66)) | (1L << (GRANTED - 66)) | (1L << (GRANTS - 66)) | (1L << (GRAPHVIZ - 66)) | (1L << (HOUR - 66)) | (1L << (IF - 66)) | (1L << (INCLUDING - 66)) | (1L << (INPUT - 66)) | (1L << (INTERVAL - 66)) | (1L << (INVOKER - 66)) | (1L << (IO - 66)) | (1L << (ISOLATION - 66)) | (1L << (JSON - 66)) | (1L << (LAST - 66)) | (1L << (LATERAL - 66)) | (1L << (LEVEL - 66)) | (1L << (LIMIT - 66)) | (1L << (LOGICAL - 66)) | (1L << (MAP - 66)) | (1L << (MINUTE - 66)) | (1L << (MONTH - 66)) | (1L << (NFC - 66)) | (1L << (NFD - 66)) | (1L << (NFKC - 66)) | (1L << (NFKD - 66)) | (1L << (NO - 66)) | (1L << (NONE - 66)) | (1L << (NULLIF - 66)) | (1L << (NULLS - 66)) | (1L << (ONLY - 66)) | (1L << (OPTION - 66)) | (1L << (ORDINALITY - 66)) | (1L << (OUTPUT - 66)) | (1L << (OVER - 66)))) != 0) || ((((_la - 130)) & ~0x3f) == 0 && ((1L << (_la - 130)) & ((1L << (PARTITION - 130)) | (1L << (PARTITIONS - 130)) | (1L << (PATH - 130)) | (1L << (POSITION - 130)) | (1L << (PRECEDING - 130)) | (1L << (PRIVILEGES - 130)) | (1L << (PROPERTIES - 130)) | (1L << (RANGE - 130)) | (1L << (READ - 130)) | (1L << (RENAME - 130)) | (1L << (REPEATABLE - 130)) | (1L << (REPLACE - 130)) | (1L << (RESET - 130)) | (1L << (RESTRICT - 130)) | (1L << (REVOKE - 130)) | (1L << (ROLE - 130)) | (1L << (ROLES - 130)) | (1L << (ROLLBACK - 130)) | (1L << (ROW - 130)) | (1L << (ROWS - 130)) | (1L << (SCHEMA - 130)) | (1L << (SCHEMAS - 130)) | (1L << (SECOND - 130)) | (1L << (SECURITY - 130)) | (1L << (SERIALIZABLE - 130)) | (1L << (SESSION - 130)) | (1L << (SET - 130)) | (1L << (SETS - 130)) | (1L << (SHOW - 130)) | (1L << (SOME - 130)) | (1L << (START - 130)) | (1L << (STATS - 130)) | (1L << (SUBSTRING - 130)) | (1L << (SYSTEM - 130)) | (1L << (TABLES - 130)) | (1L << (TABLESAMPLE - 130)) | (1L << (TEXT - 130)) | (1L << (TIME - 130)) | (1L << (TIMESTAMP - 130)) | (1L << (TO - 130)) | (1L << (TRANSACTION - 130)) | (1L << (TRY_CAST - 130)) | (1L << (TYPE - 130)) | (1L << (UNBOUNDED - 130)) | (1L << (UNCOMMITTED - 130)) | (1L << (USE - 130)) | (1L << (USER - 130)) | (1L << (VALIDATE - 130)) | (1L << (VERBOSE - 130)) | (1L << (VIEW - 130)))) != 0) || ((((_la - 196)) & ~0x3f) == 0 && ((1L << (_la - 196)) & ((1L << (WORK - 196)) | (1L << (WRITE - 196)) | (1L << (YEAR - 196)) | (1L << (ZONE - 196)) | (1L << (IDENTIFIER - 196)) | (1L << (DIGIT_IDENTIFIER - 196)) | (1L << (QUOTED_IDENTIFIER - 196)) | (1L << (BACKQUOTED_IDENTIFIER - 196)))) != 0)) {
{
setState(1189);
identifier();
setState(1194);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1190);
match(T__3);
setState(1191);
identifier();
}
}
setState(1196);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1199);
match(T__2);
setState(1200);
match(T__5);
setState(1201);
expression();
}
break;
case 17:
{
_localctx = new SubqueryExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1202);
match(T__1);
setState(1203);
query();
setState(1204);
match(T__2);
}
break;
case 18:
{
_localctx = new ExistsContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1206);
match(EXISTS);
setState(1207);
match(T__1);
setState(1208);
query();
setState(1209);
match(T__2);
}
break;
case 19:
{
_localctx = new SimpleCaseContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1211);
match(CASE);
setState(1212);
valueExpression(0);
setState(1214);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(1213);
whenClause();
}
}
setState(1216);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==WHEN );
setState(1220);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ELSE) {
{
setState(1218);
match(ELSE);
setState(1219);
((SimpleCaseContext)_localctx).elseExpression = expression();
}
}
setState(1222);
match(END);
}
break;
case 20:
{
_localctx = new SearchedCaseContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1224);
match(CASE);
setState(1226);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(1225);
whenClause();
}
}
setState(1228);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==WHEN );
setState(1232);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ELSE) {
{
setState(1230);
match(ELSE);
setState(1231);
((SearchedCaseContext)_localctx).elseExpression = expression();
}
}
setState(1234);
match(END);
}
break;
case 21:
{
_localctx = new CastContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1236);
match(CAST);
setState(1237);
match(T__1);
setState(1238);
expression();
setState(1239);
match(AS);
setState(1240);
type(0);
setState(1241);
match(T__2);
}
break;
case 22:
{
_localctx = new CastContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1243);
match(TRY_CAST);
setState(1244);
match(T__1);
setState(1245);
expression();
setState(1246);
match(AS);
setState(1247);
type(0);
setState(1248);
match(T__2);
}
break;
case 23:
{
_localctx = new ArrayConstructorContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1250);
match(ARRAY);
setState(1251);
match(T__6);
setState(1260);
_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 << CASCADE) | (1L << CASE) | (1L << CAST) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << CURRENT_DATE) | (1L << CURRENT_PATH) | (1L << CURRENT_TIME) | (1L << CURRENT_TIMESTAMP) | (1L << CURRENT_USER) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXISTS) | (1L << EXPLAIN))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (EXTRACT - 64)) | (1L << (FALSE - 64)) | (1L << (FILTER - 64)) | (1L << (FIRST - 64)) | (1L << (FOLLOWING - 64)) | (1L << (FORMAT - 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 << (INCLUDING - 64)) | (1L << (INPUT - 64)) | (1L << (INTERVAL - 64)) | (1L << (INVOKER - 64)) | (1L << (IO - 64)) | (1L << (ISOLATION - 64)) | (1L << (JSON - 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 << (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)) | (1L << (ONLY - 64)) | (1L << (OPTION - 64)) | (1L << (ORDINALITY - 64)))) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & ((1L << (OUTPUT - 128)) | (1L << (OVER - 128)) | (1L << (PARTITION - 128)) | (1L << (PARTITIONS - 128)) | (1L << (PATH - 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 << (RESTRICT - 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 << (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)) | (1L << (UNCOMMITTED - 128)) | (1L << (USE - 128)) | (1L << (USER - 128)) | (1L << (VALIDATE - 128)) | (1L << (VERBOSE - 128)))) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 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(1252);
expression();
setState(1257);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1253);
match(T__3);
setState(1254);
expression();
}
}
setState(1259);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1262);
match(T__7);
}
break;
case 24:
{
_localctx = new ColumnReferenceContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1263);
identifier();
}
break;
case 25:
{
_localctx = new SpecialDateTimeFunctionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1264);
((SpecialDateTimeFunctionContext)_localctx).name = match(CURRENT_DATE);
}
break;
case 26:
{
_localctx = new SpecialDateTimeFunctionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1265);
((SpecialDateTimeFunctionContext)_localctx).name = match(CURRENT_TIME);
setState(1269);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,158,_ctx) ) {
case 1:
{
setState(1266);
match(T__1);
setState(1267);
((SpecialDateTimeFunctionContext)_localctx).precision = match(INTEGER_VALUE);
setState(1268);
match(T__2);
}
break;
}
}
break;
case 27:
{
_localctx = new SpecialDateTimeFunctionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1271);
((SpecialDateTimeFunctionContext)_localctx).name = match(CURRENT_TIMESTAMP);
setState(1275);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,159,_ctx) ) {
case 1:
{
setState(1272);
match(T__1);
setState(1273);
((SpecialDateTimeFunctionContext)_localctx).precision = match(INTEGER_VALUE);
setState(1274);
match(T__2);
}
break;
}
}
break;
case 28:
{
_localctx = new SpecialDateTimeFunctionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1277);
((SpecialDateTimeFunctionContext)_localctx).name = match(LOCALTIME);
setState(1281);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,160,_ctx) ) {
case 1:
{
setState(1278);
match(T__1);
setState(1279);
((SpecialDateTimeFunctionContext)_localctx).precision = match(INTEGER_VALUE);
setState(1280);
match(T__2);
}
break;
}
}
break;
case 29:
{
_localctx = new SpecialDateTimeFunctionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1283);
((SpecialDateTimeFunctionContext)_localctx).name = match(LOCALTIMESTAMP);
setState(1287);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,161,_ctx) ) {
case 1:
{
setState(1284);
match(T__1);
setState(1285);
((SpecialDateTimeFunctionContext)_localctx).precision = match(INTEGER_VALUE);
setState(1286);
match(T__2);
}
break;
}
}
break;
case 30:
{
_localctx = new CurrentUserContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1289);
((CurrentUserContext)_localctx).name = match(CURRENT_USER);
}
break;
case 31:
{
_localctx = new CurrentPathContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1290);
((CurrentPathContext)_localctx).name = match(CURRENT_PATH);
}
break;
case 32:
{
_localctx = new SubstringContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1291);
match(SUBSTRING);
setState(1292);
match(T__1);
setState(1293);
valueExpression(0);
setState(1294);
match(FROM);
setState(1295);
valueExpression(0);
setState(1298);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FOR) {
{
setState(1296);
match(FOR);
setState(1297);
valueExpression(0);
}
}
setState(1300);
match(T__2);
}
break;
case 33:
{
_localctx = new NormalizeContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1302);
match(NORMALIZE);
setState(1303);
match(T__1);
setState(1304);
valueExpression(0);
setState(1307);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__3) {
{
setState(1305);
match(T__3);
setState(1306);
normalForm();
}
}
setState(1309);
match(T__2);
}
break;
case 34:
{
_localctx = new ExtractContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1311);
match(EXTRACT);
setState(1312);
match(T__1);
setState(1313);
identifier();
setState(1314);
match(FROM);
setState(1315);
valueExpression(0);
setState(1316);
match(T__2);
}
break;
case 35:
{
_localctx = new ParenthesizedExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1318);
match(T__1);
setState(1319);
expression();
setState(1320);
match(T__2);
}
break;
case 36:
{
_localctx = new GroupingOperationContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1322);
match(GROUPING);
setState(1323);
match(T__1);
setState(1332);
_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 << CASCADE) | (1L << CATALOGS) | (1L << COLUMN) | (1L << COLUMNS) | (1L << COMMENT) | (1L << COMMIT) | (1L << COMMITTED) | (1L << CURRENT) | (1L << DATA) | (1L << DATE) | (1L << DAY) | (1L << DEFINER) | (1L << DESC) | (1L << DISTRIBUTED) | (1L << EXCLUDING) | (1L << EXPLAIN))) != 0) || ((((_la - 66)) & ~0x3f) == 0 && ((1L << (_la - 66)) & ((1L << (FILTER - 66)) | (1L << (FIRST - 66)) | (1L << (FOLLOWING - 66)) | (1L << (FORMAT - 66)) | (1L << (FUNCTIONS - 66)) | (1L << (GRANT - 66)) | (1L << (GRANTED - 66)) | (1L << (GRANTS - 66)) | (1L << (GRAPHVIZ - 66)) | (1L << (HOUR - 66)) | (1L << (IF - 66)) | (1L << (INCLUDING - 66)) | (1L << (INPUT - 66)) | (1L << (INTERVAL - 66)) | (1L << (INVOKER - 66)) | (1L << (IO - 66)) | (1L << (ISOLATION - 66)) | (1L << (JSON - 66)) | (1L << (LAST - 66)) | (1L << (LATERAL - 66)) | (1L << (LEVEL - 66)) | (1L << (LIMIT - 66)) | (1L << (LOGICAL - 66)) | (1L << (MAP - 66)) | (1L << (MINUTE - 66)) | (1L << (MONTH - 66)) | (1L << (NFC - 66)) | (1L << (NFD - 66)) | (1L << (NFKC - 66)) | (1L << (NFKD - 66)) | (1L << (NO - 66)) | (1L << (NONE - 66)) | (1L << (NULLIF - 66)) | (1L << (NULLS - 66)) | (1L << (ONLY - 66)) | (1L << (OPTION - 66)) | (1L << (ORDINALITY - 66)) | (1L << (OUTPUT - 66)) | (1L << (OVER - 66)))) != 0) || ((((_la - 130)) & ~0x3f) == 0 && ((1L << (_la - 130)) & ((1L << (PARTITION - 130)) | (1L << (PARTITIONS - 130)) | (1L << (PATH - 130)) | (1L << (POSITION - 130)) | (1L << (PRECEDING - 130)) | (1L << (PRIVILEGES - 130)) | (1L << (PROPERTIES - 130)) | (1L << (RANGE - 130)) | (1L << (READ - 130)) | (1L << (RENAME - 130)) | (1L << (REPEATABLE - 130)) | (1L << (REPLACE - 130)) | (1L << (RESET - 130)) | (1L << (RESTRICT - 130)) | (1L << (REVOKE - 130)) | (1L << (ROLE - 130)) | (1L << (ROLES - 130)) | (1L << (ROLLBACK - 130)) | (1L << (ROW - 130)) | (1L << (ROWS - 130)) | (1L << (SCHEMA - 130)) | (1L << (SCHEMAS - 130)) | (1L << (SECOND - 130)) | (1L << (SECURITY - 130)) | (1L << (SERIALIZABLE - 130)) | (1L << (SESSION - 130)) | (1L << (SET - 130)) | (1L << (SETS - 130)) | (1L << (SHOW - 130)) | (1L << (SOME - 130)) | (1L << (START - 130)) | (1L << (STATS - 130)) | (1L << (SUBSTRING - 130)) | (1L << (SYSTEM - 130)) | (1L << (TABLES - 130)) | (1L << (TABLESAMPLE - 130)) | (1L << (TEXT - 130)) | (1L << (TIME - 130)) | (1L << (TIMESTAMP - 130)) | (1L << (TO - 130)) | (1L << (TRANSACTION - 130)) | (1L << (TRY_CAST - 130)) | (1L << (TYPE - 130)) | (1L << (UNBOUNDED - 130)) | (1L << (UNCOMMITTED - 130)) | (1L << (USE - 130)) | (1L << (USER - 130)) | (1L << (VALIDATE - 130)) | (1L << (VERBOSE - 130)) | (1L << (VIEW - 130)))) != 0) || ((((_la - 196)) & ~0x3f) == 0 && ((1L << (_la - 196)) & ((1L << (WORK - 196)) | (1L << (WRITE - 196)) | (1L << (YEAR - 196)) | (1L << (ZONE - 196)) | (1L << (IDENTIFIER - 196)) | (1L << (DIGIT_IDENTIFIER - 196)) | (1L << (QUOTED_IDENTIFIER - 196)) | (1L << (BACKQUOTED_IDENTIFIER - 196)))) != 0)) {
{
setState(1324);
qualifiedName();
setState(1329);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1325);
match(T__3);
setState(1326);
qualifiedName();
}
}
setState(1331);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1334);
match(T__2);
}
break;
}
_ctx.stop = _input.LT(-1);
setState(1347);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,168,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(1345);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,167,_ctx) ) {
case 1:
{
_localctx = new SubscriptContext(new PrimaryExpressionContext(_parentctx, _parentState));
((SubscriptContext)_localctx).value = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_primaryExpression);
setState(1337);
if (!(precpred(_ctx, 15))) throw new FailedPredicateException(this, "precpred(_ctx, 15)");
setState(1338);
match(T__6);
setState(1339);
((SubscriptContext)_localctx).index = valueExpression(0);
setState(1340);
match(T__7);
}
break;
case 2:
{
_localctx = new DereferenceContext(new PrimaryExpressionContext(_parentctx, _parentState));
((DereferenceContext)_localctx).base = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_primaryExpression);
setState(1342);
if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)");
setState(1343);
match(T__0);
setState(1344);
((DereferenceContext)_localctx).fieldName = identifier();
}
break;
}
}
}
setState(1349);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,168,_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, 70, RULE_string);
try {
setState(1356);
_errHandler.sync(this);
switch (_input.LA(1)) {
case STRING:
_localctx = new BasicStringLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1350);
match(STRING);
}
break;
case UNICODE_STRING:
_localctx = new UnicodeStringLiteralContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1351);
match(UNICODE_STRING);
setState(1354);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,169,_ctx) ) {
case 1:
{
setState(1352);
match(UESCAPE);
setState(1353);
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 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, 72, RULE_timeZoneSpecifier);
try {
setState(1364);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,171,_ctx) ) {
case 1:
_localctx = new TimeZoneIntervalContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1358);
match(TIME);
setState(1359);
match(ZONE);
setState(1360);
interval();
}
break;
case 2:
_localctx = new TimeZoneStringContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1361);
match(TIME);
setState(1362);
match(ZONE);
setState(1363);
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, 74, RULE_comparisonOperator);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1366);
_la = _input.LA(1);
if ( !(((((_la - 200)) & ~0x3f) == 0 && ((1L << (_la - 200)) & ((1L << (EQ - 200)) | (1L << (NEQ - 200)) | (1L << (LT - 200)) | (1L << (LTE - 200)) | (1L << (GT - 200)) | (1L << (GTE - 200)))) != 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, 76, RULE_comparisonQuantifier);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1368);
_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, 78, RULE_booleanValue);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1370);
_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, 80, RULE_interval);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1372);
match(INTERVAL);
setState(1374);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PLUS || _la==MINUS) {
{
setState(1373);
((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(1376);
string();
setState(1377);
((IntervalContext)_localctx).from = intervalField();
setState(1380);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,173,_ctx) ) {
case 1:
{
setState(1378);
match(TO);
setState(1379);
((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, 82, RULE_intervalField);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1382);
_la = _input.LA(1);
if ( !(((((_la - 47)) & ~0x3f) == 0 && ((1L << (_la - 47)) & ((1L << (DAY - 47)) | (1L << (HOUR - 47)) | (1L << (MINUTE - 47)) | (1L << (MONTH - 47)))) != 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, 84, RULE_normalForm);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1384);
_la = _input.LA(1);
if ( !(((((_la - 110)) & ~0x3f) == 0 && ((1L << (_la - 110)) & ((1L << (NFC - 110)) | (1L << (NFD - 110)) | (1L << (NFKC - 110)) | (1L << (NFKD - 110)))) != 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 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 = 86;
enterRecursionRule(_localctx, 86, RULE_type, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1433);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,177,_ctx) ) {
case 1:
{
setState(1387);
match(ARRAY);
setState(1388);
match(LT);
setState(1389);
type(0);
setState(1390);
match(GT);
}
break;
case 2:
{
setState(1392);
match(MAP);
setState(1393);
match(LT);
setState(1394);
type(0);
setState(1395);
match(T__3);
setState(1396);
type(0);
setState(1397);
match(GT);
}
break;
case 3:
{
setState(1399);
match(ROW);
setState(1400);
match(T__1);
setState(1401);
identifier();
setState(1402);
type(0);
setState(1409);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1403);
match(T__3);
setState(1404);
identifier();
setState(1405);
type(0);
}
}
setState(1411);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1412);
match(T__2);
}
break;
case 4:
{
setState(1414);
baseType();
setState(1426);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,176,_ctx) ) {
case 1:
{
setState(1415);
match(T__1);
setState(1416);
typeParameter();
setState(1421);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1417);
match(T__3);
setState(1418);
typeParameter();
}
}
setState(1423);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1424);
match(T__2);
}
break;
}
}
break;
case 5:
{
setState(1428);
match(INTERVAL);
setState(1429);
((TypeContext)_localctx).from = intervalField();
setState(1430);
match(TO);
setState(1431);
((TypeContext)_localctx).to = intervalField();
}
break;
}
_ctx.stop = _input.LT(-1);
setState(1439);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,178,_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(1435);
if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)");
setState(1436);
match(ARRAY);
}
}
}
setState(1441);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,178,_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, 88, RULE_typeParameter);
try {
setState(1444);
_errHandler.sync(this);
switch (_input.LA(1)) {
case INTEGER_VALUE:
enterOuterAlt(_localctx, 1);
{
setState(1442);
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 CASCADE:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DISTRIBUTED:
case EXCLUDING:
case EXPLAIN:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case HOUR:
case IF:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
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 PATH:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESTRICT:
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 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(1443);
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 IdentifierContext identifier() {
return getRuleContext(IdentifierContext.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, 90, RULE_baseType);
try {
setState(1450);
_errHandler.sync(this);
switch (_input.LA(1)) {
case TIME_WITH_TIME_ZONE:
enterOuterAlt(_localctx, 1);
{
setState(1446);
match(TIME_WITH_TIME_ZONE);
}
break;
case TIMESTAMP_WITH_TIME_ZONE:
enterOuterAlt(_localctx, 2);
{
setState(1447);
match(TIMESTAMP_WITH_TIME_ZONE);
}
break;
case DOUBLE_PRECISION:
enterOuterAlt(_localctx, 3);
{
setState(1448);
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 CASCADE:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DISTRIBUTED:
case EXCLUDING:
case EXPLAIN:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case HOUR:
case IF:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
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 PATH:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESTRICT:
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 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(1449);
identifier();
}
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, 92, RULE_whenClause);
try {
enterOuterAlt(_localctx, 1);
{
setState(1452);
match(WHEN);
setState(1453);
((WhenClauseContext)_localctx).condition = expression();
setState(1454);
match(THEN);
setState(1455);
((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, 94, RULE_filter);
try {
enterOuterAlt(_localctx, 1);
{
setState(1457);
match(FILTER);
setState(1458);
match(T__1);
setState(1459);
match(WHERE);
setState(1460);
booleanExpression(0);
setState(1461);
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, 96, RULE_over);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1463);
match(OVER);
setState(1464);
match(T__1);
setState(1475);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PARTITION) {
{
setState(1465);
match(PARTITION);
setState(1466);
match(BY);
setState(1467);
((OverContext)_localctx).expression = expression();
((OverContext)_localctx).partition.add(((OverContext)_localctx).expression);
setState(1472);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1468);
match(T__3);
setState(1469);
((OverContext)_localctx).expression = expression();
((OverContext)_localctx).partition.add(((OverContext)_localctx).expression);
}
}
setState(1474);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1487);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1477);
match(ORDER);
setState(1478);
match(BY);
setState(1479);
sortItem();
setState(1484);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1480);
match(T__3);
setState(1481);
sortItem();
}
}
setState(1486);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1490);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==RANGE || _la==ROWS) {
{
setState(1489);
windowFrame();
}
}
setState(1492);
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, 98, RULE_windowFrame);
try {
setState(1510);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,186,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1494);
((WindowFrameContext)_localctx).frameType = match(RANGE);
setState(1495);
((WindowFrameContext)_localctx).start = frameBound();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1496);
((WindowFrameContext)_localctx).frameType = match(ROWS);
setState(1497);
((WindowFrameContext)_localctx).start = frameBound();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1498);
((WindowFrameContext)_localctx).frameType = match(RANGE);
setState(1499);
match(BETWEEN);
setState(1500);
((WindowFrameContext)_localctx).start = frameBound();
setState(1501);
match(AND);
setState(1502);
((WindowFrameContext)_localctx).end = frameBound();
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(1504);
((WindowFrameContext)_localctx).frameType = match(ROWS);
setState(1505);
match(BETWEEN);
setState(1506);
((WindowFrameContext)_localctx).start = frameBound();
setState(1507);
match(AND);
setState(1508);
((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, 100, RULE_frameBound);
int _la;
try {
setState(1521);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,187,_ctx) ) {
case 1:
_localctx = new UnboundedFrameContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1512);
match(UNBOUNDED);
setState(1513);
((UnboundedFrameContext)_localctx).boundType = match(PRECEDING);
}
break;
case 2:
_localctx = new UnboundedFrameContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1514);
match(UNBOUNDED);
setState(1515);
((UnboundedFrameContext)_localctx).boundType = match(FOLLOWING);
}
break;
case 3:
_localctx = new CurrentRowBoundContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1516);
match(CURRENT);
setState(1517);
match(ROW);
}
break;
case 4:
_localctx = new BoundedFrameContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1518);
expression();
setState(1519);
((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 T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExplainType(this);
else return visitor.visitChildren(this);
}
}
public final ExplainOptionContext explainOption() throws RecognitionException {
ExplainOptionContext _localctx = new ExplainOptionContext(_ctx, getState());
enterRule(_localctx, 102, RULE_explainOption);
int _la;
try {
setState(1527);
_errHandler.sync(this);
switch (_input.LA(1)) {
case FORMAT:
_localctx = new ExplainFormatContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1523);
match(FORMAT);
setState(1524);
((ExplainFormatContext)_localctx).value = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==GRAPHVIZ || _la==JSON || _la==TEXT) ) {
((ExplainFormatContext)_localctx).value = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
break;
case TYPE:
_localctx = new ExplainTypeContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1525);
match(TYPE);
setState(1526);
((ExplainTypeContext)_localctx).value = _input.LT(1);
_la = _input.LA(1);
if ( !(((((_la - 54)) & ~0x3f) == 0 && ((1L << (_la - 54)) & ((1L << (DISTRIBUTED - 54)) | (1L << (IO - 54)) | (1L << (LOGICAL - 54)))) != 0) || _la==VALIDATE) ) {
((ExplainTypeContext)_localctx).value = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TransactionModeContext extends ParserRuleContext {
public TransactionModeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_transactionMode; }
public TransactionModeContext() { }
public void copyFrom(TransactionModeContext ctx) {
super.copyFrom(ctx);
}
}
public static class TransactionAccessModeContext extends TransactionModeContext {
public Token accessMode;
public TerminalNode READ() { return getToken(SqlBaseParser.READ, 0); }
public TerminalNode ONLY() { return getToken(SqlBaseParser.ONLY, 0); }
public TerminalNode WRITE() { return getToken(SqlBaseParser.WRITE, 0); }
public TransactionAccessModeContext(TransactionModeContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTransactionAccessMode(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTransactionAccessMode(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTransactionAccessMode(this);
else return visitor.visitChildren(this);
}
}
public static class IsolationLevelContext extends TransactionModeContext {
public TerminalNode ISOLATION() { return getToken(SqlBaseParser.ISOLATION, 0); }
public TerminalNode LEVEL() { return getToken(SqlBaseParser.LEVEL, 0); }
public LevelOfIsolationContext levelOfIsolation() {
return getRuleContext(LevelOfIsolationContext.class,0);
}
public IsolationLevelContext(TransactionModeContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterIsolationLevel(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitIsolationLevel(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitIsolationLevel(this);
else return visitor.visitChildren(this);
}
}
public final TransactionModeContext transactionMode() throws RecognitionException {
TransactionModeContext _localctx = new TransactionModeContext(_ctx, getState());
enterRule(_localctx, 104, RULE_transactionMode);
int _la;
try {
setState(1534);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ISOLATION:
_localctx = new IsolationLevelContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1529);
match(ISOLATION);
setState(1530);
match(LEVEL);
setState(1531);
levelOfIsolation();
}
break;
case READ:
_localctx = new TransactionAccessModeContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1532);
match(READ);
setState(1533);
((TransactionAccessModeContext)_localctx).accessMode = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==ONLY || _la==WRITE) ) {
((TransactionAccessModeContext)_localctx).accessMode = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LevelOfIsolationContext extends ParserRuleContext {
public LevelOfIsolationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_levelOfIsolation; }
public LevelOfIsolationContext() { }
public void copyFrom(LevelOfIsolationContext ctx) {
super.copyFrom(ctx);
}
}
public static class ReadUncommittedContext extends LevelOfIsolationContext {
public TerminalNode READ() { return getToken(SqlBaseParser.READ, 0); }
public TerminalNode UNCOMMITTED() { return getToken(SqlBaseParser.UNCOMMITTED, 0); }
public ReadUncommittedContext(LevelOfIsolationContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterReadUncommitted(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitReadUncommitted(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitReadUncommitted(this);
else return visitor.visitChildren(this);
}
}
public static class SerializableContext extends LevelOfIsolationContext {
public TerminalNode SERIALIZABLE() { return getToken(SqlBaseParser.SERIALIZABLE, 0); }
public SerializableContext(LevelOfIsolationContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSerializable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSerializable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSerializable(this);
else return visitor.visitChildren(this);
}
}
public static class ReadCommittedContext extends LevelOfIsolationContext {
public TerminalNode READ() { return getToken(SqlBaseParser.READ, 0); }
public TerminalNode COMMITTED() { return getToken(SqlBaseParser.COMMITTED, 0); }
public ReadCommittedContext(LevelOfIsolationContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterReadCommitted(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitReadCommitted(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitReadCommitted(this);
else return visitor.visitChildren(this);
}
}
public static class RepeatableReadContext extends LevelOfIsolationContext {
public TerminalNode REPEATABLE() { return getToken(SqlBaseParser.REPEATABLE, 0); }
public TerminalNode READ() { return getToken(SqlBaseParser.READ, 0); }
public RepeatableReadContext(LevelOfIsolationContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRepeatableRead(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRepeatableRead(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRepeatableRead(this);
else return visitor.visitChildren(this);
}
}
public final LevelOfIsolationContext levelOfIsolation() throws RecognitionException {
LevelOfIsolationContext _localctx = new LevelOfIsolationContext(_ctx, getState());
enterRule(_localctx, 106, RULE_levelOfIsolation);
try {
setState(1543);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,190,_ctx) ) {
case 1:
_localctx = new ReadUncommittedContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1536);
match(READ);
setState(1537);
match(UNCOMMITTED);
}
break;
case 2:
_localctx = new ReadCommittedContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1538);
match(READ);
setState(1539);
match(COMMITTED);
}
break;
case 3:
_localctx = new RepeatableReadContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1540);
match(REPEATABLE);
setState(1541);
match(READ);
}
break;
case 4:
_localctx = new SerializableContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1542);
match(SERIALIZABLE);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CallArgumentContext extends ParserRuleContext {
public CallArgumentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_callArgument; }
public CallArgumentContext() { }
public void copyFrom(CallArgumentContext ctx) {
super.copyFrom(ctx);
}
}
public static class PositionalArgumentContext extends CallArgumentContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public PositionalArgumentContext(CallArgumentContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterPositionalArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitPositionalArgument(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitPositionalArgument(this);
else return visitor.visitChildren(this);
}
}
public static class NamedArgumentContext extends CallArgumentContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public NamedArgumentContext(CallArgumentContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNamedArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNamedArgument(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNamedArgument(this);
else return visitor.visitChildren(this);
}
}
public final CallArgumentContext callArgument() throws RecognitionException {
CallArgumentContext _localctx = new CallArgumentContext(_ctx, getState());
enterRule(_localctx, 108, RULE_callArgument);
try {
setState(1550);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,191,_ctx) ) {
case 1:
_localctx = new PositionalArgumentContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1545);
expression();
}
break;
case 2:
_localctx = new NamedArgumentContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1546);
identifier();
setState(1547);
match(T__8);
setState(1548);
expression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PathElementContext extends ParserRuleContext {
public PathElementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_pathElement; }
public PathElementContext() { }
public void copyFrom(PathElementContext ctx) {
super.copyFrom(ctx);
}
}
public static class QualifiedArgumentContext extends PathElementContext {
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public QualifiedArgumentContext(PathElementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterQualifiedArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitQualifiedArgument(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitQualifiedArgument(this);
else return visitor.visitChildren(this);
}
}
public static class UnqualifiedArgumentContext extends PathElementContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public UnqualifiedArgumentContext(PathElementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterUnqualifiedArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitUnqualifiedArgument(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitUnqualifiedArgument(this);
else return visitor.visitChildren(this);
}
}
public final PathElementContext pathElement() throws RecognitionException {
PathElementContext _localctx = new PathElementContext(_ctx, getState());
enterRule(_localctx, 110, RULE_pathElement);
try {
setState(1557);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,192,_ctx) ) {
case 1:
_localctx = new QualifiedArgumentContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1552);
identifier();
setState(1553);
match(T__0);
setState(1554);
identifier();
}
break;
case 2:
_localctx = new UnqualifiedArgumentContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1556);
identifier();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PathSpecificationContext extends ParserRuleContext {
public List pathElement() {
return getRuleContexts(PathElementContext.class);
}
public PathElementContext pathElement(int i) {
return getRuleContext(PathElementContext.class,i);
}
public PathSpecificationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_pathSpecification; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterPathSpecification(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitPathSpecification(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitPathSpecification(this);
else return visitor.visitChildren(this);
}
}
public final PathSpecificationContext pathSpecification() throws RecognitionException {
PathSpecificationContext _localctx = new PathSpecificationContext(_ctx, getState());
enterRule(_localctx, 112, RULE_pathSpecification);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1559);
pathElement();
setState(1564);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1560);
match(T__3);
setState(1561);
pathElement();
}
}
setState(1566);
_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 PrivilegeContext extends ParserRuleContext {
public TerminalNode SELECT() { return getToken(SqlBaseParser.SELECT, 0); }
public TerminalNode DELETE() { return getToken(SqlBaseParser.DELETE, 0); }
public TerminalNode INSERT() { return getToken(SqlBaseParser.INSERT, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public PrivilegeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_privilege; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterPrivilege(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitPrivilege(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitPrivilege(this);
else return visitor.visitChildren(this);
}
}
public final PrivilegeContext privilege() throws RecognitionException {
PrivilegeContext _localctx = new PrivilegeContext(_ctx, getState());
enterRule(_localctx, 114, RULE_privilege);
try {
setState(1571);
_errHandler.sync(this);
switch (_input.LA(1)) {
case SELECT:
enterOuterAlt(_localctx, 1);
{
setState(1567);
match(SELECT);
}
break;
case DELETE:
enterOuterAlt(_localctx, 2);
{
setState(1568);
match(DELETE);
}
break;
case INSERT:
enterOuterAlt(_localctx, 3);
{
setState(1569);
match(INSERT);
}
break;
case ADD:
case ADMIN:
case ALL:
case ANALYZE:
case ANY:
case ARRAY:
case ASC:
case AT:
case BERNOULLI:
case CALL:
case CASCADE:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DISTRIBUTED:
case EXCLUDING:
case EXPLAIN:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case HOUR:
case IF:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
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 PATH:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESTRICT:
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 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(1570);
identifier();
}
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 QualifiedNameContext extends ParserRuleContext {
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public QualifiedNameContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_qualifiedName; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterQualifiedName(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitQualifiedName(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitQualifiedName(this);
else return visitor.visitChildren(this);
}
}
public final QualifiedNameContext qualifiedName() throws RecognitionException {
QualifiedNameContext _localctx = new QualifiedNameContext(_ctx, getState());
enterRule(_localctx, 116, RULE_qualifiedName);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1573);
identifier();
setState(1578);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,195,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1574);
match(T__0);
setState(1575);
identifier();
}
}
}
setState(1580);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,195,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class GrantorContext extends ParserRuleContext {
public GrantorContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_grantor; }
public GrantorContext() { }
public void copyFrom(GrantorContext ctx) {
super.copyFrom(ctx);
}
}
public static class CurrentUserGrantorContext extends GrantorContext {
public TerminalNode CURRENT_USER() { return getToken(SqlBaseParser.CURRENT_USER, 0); }
public CurrentUserGrantorContext(GrantorContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCurrentUserGrantor(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCurrentUserGrantor(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCurrentUserGrantor(this);
else return visitor.visitChildren(this);
}
}
public static class SpecifiedPrincipalContext extends GrantorContext {
public PrincipalContext principal() {
return getRuleContext(PrincipalContext.class,0);
}
public SpecifiedPrincipalContext(GrantorContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSpecifiedPrincipal(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSpecifiedPrincipal(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSpecifiedPrincipal(this);
else return visitor.visitChildren(this);
}
}
public static class CurrentRoleGrantorContext extends GrantorContext {
public TerminalNode CURRENT_ROLE() { return getToken(SqlBaseParser.CURRENT_ROLE, 0); }
public CurrentRoleGrantorContext(GrantorContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCurrentRoleGrantor(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCurrentRoleGrantor(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCurrentRoleGrantor(this);
else return visitor.visitChildren(this);
}
}
public final GrantorContext grantor() throws RecognitionException {
GrantorContext _localctx = new GrantorContext(_ctx, getState());
enterRule(_localctx, 118, RULE_grantor);
try {
setState(1584);
_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 CASCADE:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CURRENT:
case DATA:
case DATE:
case DAY:
case DEFINER:
case DESC:
case DISTRIBUTED:
case EXCLUDING:
case EXPLAIN:
case FILTER:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case HOUR:
case IF:
case INCLUDING:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case LAST:
case LATERAL:
case LEVEL:
case LIMIT:
case LOGICAL:
case MAP:
case MINUTE:
case MONTH:
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 PATH:
case POSITION:
case PRECEDING:
case PRIVILEGES:
case PROPERTIES:
case RANGE:
case READ:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESTRICT:
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 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:
_localctx = new SpecifiedPrincipalContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1581);
principal();
}
break;
case CURRENT_USER:
_localctx = new CurrentUserGrantorContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1582);
match(CURRENT_USER);
}
break;
case CURRENT_ROLE:
_localctx = new CurrentRoleGrantorContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1583);
match(CURRENT_ROLE);
}
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 PrincipalContext extends ParserRuleContext {
public PrincipalContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_principal; }
public PrincipalContext() { }
public void copyFrom(PrincipalContext ctx) {
super.copyFrom(ctx);
}
}
public static class UnspecifiedPrincipalContext extends PrincipalContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public UnspecifiedPrincipalContext(PrincipalContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterUnspecifiedPrincipal(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitUnspecifiedPrincipal(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitUnspecifiedPrincipal(this);
else return visitor.visitChildren(this);
}
}
public static class UserPrincipalContext extends PrincipalContext {
public TerminalNode USER() { return getToken(SqlBaseParser.USER, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public UserPrincipalContext(PrincipalContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterUserPrincipal(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitUserPrincipal(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitUserPrincipal(this);
else return visitor.visitChildren(this);
}
}
public static class RolePrincipalContext extends PrincipalContext {
public TerminalNode ROLE() { return getToken(SqlBaseParser.ROLE, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public RolePrincipalContext(PrincipalContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRolePrincipal(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRolePrincipal(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRolePrincipal(this);
else return visitor.visitChildren(this);
}
}
public final PrincipalContext principal() throws RecognitionException {
PrincipalContext _localctx = new PrincipalContext(_ctx, getState());
enterRule(_localctx, 120, RULE_principal);
try {
setState(1591);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,197,_ctx) ) {
case 1:
_localctx = new UnspecifiedPrincipalContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1586);
identifier();
}
break;
case 2:
_localctx = new UserPrincipalContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1587);
match(USER);
setState(1588);
identifier();
}
break;
case 3:
_localctx = new RolePrincipalContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1589);
match(ROLE);
setState(1590);
identifier();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RolesContext extends ParserRuleContext {
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public RolesContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_roles; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRoles(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRoles(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRoles(this);
else return visitor.visitChildren(this);
}
}
public final RolesContext roles() throws RecognitionException {
RolesContext _localctx = new RolesContext(_ctx, getState());
enterRule(_localctx, 122, RULE_roles);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1593);
identifier();
setState(1598);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1594);
match(T__3);
setState(1595);
identifier();
}
}
setState(1600);
_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 IdentifierContext extends ParserRuleContext {
public IdentifierContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_identifier; }
public IdentifierContext() { }
public void copyFrom(IdentifierContext ctx) {
super.copyFrom(ctx);
}
}
public static class BackQuotedIdentifierContext extends IdentifierContext {
public TerminalNode BACKQUOTED_IDENTIFIER() { return getToken(SqlBaseParser.BACKQUOTED_IDENTIFIER, 0); }
public BackQuotedIdentifierContext(IdentifierContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterBackQuotedIdentifier(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitBackQuotedIdentifier(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitBackQuotedIdentifier(this);
else return visitor.visitChildren(this);
}
}
public static class QuotedIdentifierContext extends IdentifierContext {
public TerminalNode QUOTED_IDENTIFIER() { return getToken(SqlBaseParser.QUOTED_IDENTIFIER, 0); }
public QuotedIdentifierContext(IdentifierContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterQuotedIdentifier(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitQuotedIdentifier(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitQuotedIdentifier(this);
else return visitor.visitChildren(this);
}
}
public static class DigitIdentifierContext extends IdentifierContext {
public TerminalNode DIGIT_IDENTIFIER() { return getToken(SqlBaseParser.DIGIT_IDENTIFIER, 0); }
public DigitIdentifierContext(IdentifierContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDigitIdentifier(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDigitIdentifier(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDigitIdentifier(this);
else return visitor.visitChildren(this);
}
}
public static class UnquotedIdentifierContext extends IdentifierContext {
public TerminalNode IDENTIFIER() { return getToken(SqlBaseParser.IDENTIFIER, 0); }
public NonReservedContext nonReserved() {
return getRuleContext(NonReservedContext.class,0);
}
public UnquotedIdentifierContext(IdentifierContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterUnquotedIdentifier(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitUnquotedIdentifier(this);
}
@Override
public