io.edurt.datacap.parser.antlr.SqlBaseParser Maven / Gradle / Ivy
The newest version!
// Generated from io/edurt/datacap/parser/antlr/SqlBase.g4 by ANTLR 4.13.2
package io.edurt.datacap.parser.antlr;
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", "CheckReturnValue", "this-escape"})
public class SqlBaseParser extends Parser {
static { RuntimeMetaData.checkVersion("4.13.2", 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,
T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17,
ABSENT=18, ADD=19, ADMIN=20, AFTER=21, ALL=22, ALTER=23, ANALYZE=24, AND=25,
ANY=26, ARRAY=27, AS=28, ASC=29, AT=30, AUTHORIZATION=31, BERNOULLI=32,
BETWEEN=33, BOTH=34, BY=35, CALL=36, CASCADE=37, CASE=38, CAST=39, CATALOGS=40,
COLUMN=41, COLUMNS=42, COMMENT=43, COMMIT=44, COMMITTED=45, CONDITIONAL=46,
CONSTRAINT=47, COUNT=48, COPARTITION=49, CREATE=50, CROSS=51, CUBE=52,
CURRENT=53, CURRENT_CATALOG=54, CURRENT_DATE=55, CURRENT_PATH=56, CURRENT_ROLE=57,
CURRENT_SCHEMA=58, CURRENT_TIME=59, CURRENT_TIMESTAMP=60, CURRENT_USER=61,
DATA=62, DATE=63, DAY=64, DEALLOCATE=65, DEFAULT=66, DEFINER=67, DELETE=68,
DENY=69, DESC=70, DESCRIBE=71, DESCRIPTOR=72, DEFINE=73, DISTINCT=74,
DISTRIBUTED=75, DOUBLE=76, DROP=77, ELSE=78, EMPTY=79, ENCODING=80, END=81,
ERROR=82, ESCAPE=83, EXCEPT=84, EXCLUDING=85, EXECUTE=86, EXISTS=87, EXPLAIN=88,
EXTRACT=89, FALSE=90, FETCH=91, FILTER=92, FINAL=93, FIRST=94, FOLLOWING=95,
FOR=96, FORMAT=97, FROM=98, FULL=99, FUNCTIONS=100, GRANT=101, GRANTED=102,
GRANTS=103, GRAPHVIZ=104, GROUP=105, GROUPING=106, GROUPS=107, HAVING=108,
HOUR=109, IF=110, IGNORE=111, IN=112, INCLUDING=113, INITIAL=114, INNER=115,
INPUT=116, INSERT=117, INTERSECT=118, INTERVAL=119, INTO=120, INVOKER=121,
IO=122, IS=123, ISOLATION=124, JOIN=125, JSON=126, JSON_ARRAY=127, JSON_EXISTS=128,
JSON_OBJECT=129, JSON_QUERY=130, JSON_VALUE=131, KEEP=132, KEY=133, KEYS=134,
LAST=135, LATERAL=136, LEADING=137, LEFT=138, LEVEL=139, LIKE=140, LIMIT=141,
LISTAGG=142, LOCAL=143, LOCALTIME=144, LOCALTIMESTAMP=145, LOGICAL=146,
MAP=147, MATCH=148, MATCHED=149, MATCHES=150, MATCH_RECOGNIZE=151, MATERIALIZED=152,
MEASURES=153, MERGE=154, MINUTE=155, MONTH=156, NATURAL=157, NEXT=158,
NFC=159, NFD=160, NFKC=161, NFKD=162, NO=163, NONE=164, NORMALIZE=165,
NOT=166, NULL=167, NULLIF=168, NULLS=169, OBJECT=170, OFFSET=171, OMIT=172,
OF=173, ON=174, ONE=175, ONLY=176, OPTION=177, OR=178, ORDER=179, ORDINALITY=180,
OUTER=181, OUTPUT=182, OVER=183, OVERFLOW=184, PARTITION=185, PARTITIONS=186,
PASSING=187, PAST=188, PATH=189, PATTERN=190, PER=191, PERMUTE=192, POSITION=193,
PRECEDING=194, PRECISION=195, PREPARE=196, PRIVILEGES=197, PROPERTIES=198,
PRUNE=199, QUOTES=200, RANGE=201, READ=202, RECURSIVE=203, REFRESH=204,
RENAME=205, REPEATABLE=206, REPLACE=207, RESET=208, RESPECT=209, RESTRICT=210,
RETURNING=211, REVOKE=212, RIGHT=213, ROLE=214, ROLES=215, ROLLBACK=216,
ROLLUP=217, ROW=218, ROWS=219, RUNNING=220, SCALAR=221, SCHEMA=222, SCHEMAS=223,
SECOND=224, SECURITY=225, SEEK=226, SELECT=227, SERIALIZABLE=228, SESSION=229,
SET=230, SETS=231, SHOW=232, SOME=233, START=234, STATS=235, SUBSET=236,
SUBSTRING=237, SYSTEM=238, TABLE=239, TABLES=240, TABLESAMPLE=241, TEXT=242,
TEXT_STRING=243, THEN=244, TIES=245, TIME=246, TIMESTAMP=247, TO=248,
TRAILING=249, TRANSACTION=250, TRIM=251, TRUE=252, TRUNCATE=253, TRY_CAST=254,
TYPE=255, UESCAPE=256, UNBOUNDED=257, UNCOMMITTED=258, UNCONDITIONAL=259,
UNION=260, UNIQUE=261, UNKNOWN=262, UNMATCHED=263, UNNEST=264, UPDATE=265,
USE=266, USER=267, USING=268, UTF16=269, UTF32=270, UTF8=271, VALIDATE=272,
VALUE=273, VALUES=274, VERBOSE=275, VERSION=276, VIEW=277, WHEN=278, WHERE=279,
WINDOW=280, WITH=281, WITHIN=282, WITHOUT=283, WORK=284, WRAPPER=285,
WRITE=286, YEAR=287, ZONE=288, EQ=289, NEQ=290, LT=291, LTE=292, GT=293,
GTE=294, PLUS=295, MINUS=296, ASTERISK=297, SLASH=298, PERCENT=299, CONCAT=300,
QUESTION_MARK=301, STRING=302, UNICODE_STRING=303, BINARY_LITERAL=304,
INTEGER_VALUE=305, DECIMAL_VALUE=306, DOUBLE_VALUE=307, IDENTIFIER=308,
DIGIT_IDENTIFIER=309, QUOTED_IDENTIFIER=310, BACKQUOTED_IDENTIFIER=311,
SIMPLE_COMMENT=312, BRACKETED_COMMENT=313, WS=314, UNRECOGNIZED=315, DELIMITER=316;
public static final int
RULE_singleStatement = 0, RULE_standaloneExpression = 1, RULE_standalonePathSpecification = 2,
RULE_standaloneType = 3, RULE_standaloneRowPattern = 4, RULE_statement = 5,
RULE_query = 6, RULE_with = 7, RULE_tableElement = 8, RULE_columnDefinition = 9,
RULE_likeClause = 10, RULE_properties = 11, RULE_propertyAssignments = 12,
RULE_property = 13, RULE_propertyValue = 14, RULE_queryNoWith = 15, RULE_limitRowCount = 16,
RULE_rowCount = 17, RULE_queryTerm = 18, RULE_queryPrimary = 19, RULE_sortItem = 20,
RULE_querySpecification = 21, RULE_groupBy = 22, RULE_groupingElement = 23,
RULE_groupingSet = 24, RULE_windowDefinition = 25, RULE_windowSpecification = 26,
RULE_namedQuery = 27, RULE_setQuantifier = 28, RULE_selectItem = 29, RULE_relation = 30,
RULE_joinType = 31, RULE_joinCriteria = 32, RULE_sampledRelation = 33,
RULE_sampleType = 34, RULE_trimsSpecification = 35, RULE_listAggOverflowBehavior = 36,
RULE_listaggCountIndication = 37, RULE_patternRecognition = 38, RULE_measureDefinition = 39,
RULE_rowsPerMatch = 40, RULE_emptyMatchHandling = 41, RULE_skipTo = 42,
RULE_subsetDefinition = 43, RULE_variableDefinition = 44, RULE_aliasedRelation = 45,
RULE_columnAliases = 46, RULE_relationPrimary = 47, RULE_tableFunctionCall = 48,
RULE_tableFunctionArgument = 49, RULE_tableArgument = 50, RULE_tableArgumentRelation = 51,
RULE_descriptorArgument = 52, RULE_descriptorField = 53, RULE_copartitionTables = 54,
RULE_expression = 55, RULE_booleanExpression = 56, RULE_predicate = 57,
RULE_valueExpression = 58, RULE_primaryExpression = 59, RULE_jsonPathInvocation = 60,
RULE_jsonValueExpression = 61, RULE_jsonRepresentation = 62, RULE_jsonArgument = 63,
RULE_jsonExistsErrorBehavior = 64, RULE_jsonValueBehavior = 65, RULE_jsonQueryWrapperBehavior = 66,
RULE_jsonQueryBehavior = 67, RULE_jsonObjectMember = 68, RULE_processingMode = 69,
RULE_nullTreatment = 70, RULE_string = 71, RULE_timeZoneSpecifier = 72,
RULE_comparisonOperator = 73, RULE_comparisonQuantifier = 74, RULE_booleanValue = 75,
RULE_interval = 76, RULE_intervalField = 77, RULE_normalForm = 78, RULE_type = 79,
RULE_rowField = 80, RULE_typeParameter = 81, RULE_whenClause = 82, RULE_filter = 83,
RULE_mergeCase = 84, RULE_over = 85, RULE_windowFrame = 86, RULE_frameExtent = 87,
RULE_frameBound = 88, RULE_rowPattern = 89, RULE_patternPrimary = 90,
RULE_patternQuantifier = 91, RULE_updateAssignment = 92, RULE_explainOption = 93,
RULE_transactionMode = 94, RULE_levelOfIsolation = 95, RULE_callArgument = 96,
RULE_pathElement = 97, RULE_pathSpecification = 98, RULE_privilege = 99,
RULE_qualifiedName = 100, RULE_queryPeriod = 101, RULE_rangeType = 102,
RULE_grantor = 103, RULE_principal = 104, RULE_roles = 105, RULE_identifier = 106,
RULE_number = 107, RULE_nonReserved = 108;
private static String[] makeRuleNames() {
return new String[] {
"singleStatement", "standaloneExpression", "standalonePathSpecification",
"standaloneType", "standaloneRowPattern", "statement", "query", "with",
"tableElement", "columnDefinition", "likeClause", "properties", "propertyAssignments",
"property", "propertyValue", "queryNoWith", "limitRowCount", "rowCount",
"queryTerm", "queryPrimary", "sortItem", "querySpecification", "groupBy",
"groupingElement", "groupingSet", "windowDefinition", "windowSpecification",
"namedQuery", "setQuantifier", "selectItem", "relation", "joinType",
"joinCriteria", "sampledRelation", "sampleType", "trimsSpecification",
"listAggOverflowBehavior", "listaggCountIndication", "patternRecognition",
"measureDefinition", "rowsPerMatch", "emptyMatchHandling", "skipTo",
"subsetDefinition", "variableDefinition", "aliasedRelation", "columnAliases",
"relationPrimary", "tableFunctionCall", "tableFunctionArgument", "tableArgument",
"tableArgumentRelation", "descriptorArgument", "descriptorField", "copartitionTables",
"expression", "booleanExpression", "predicate", "valueExpression", "primaryExpression",
"jsonPathInvocation", "jsonValueExpression", "jsonRepresentation", "jsonArgument",
"jsonExistsErrorBehavior", "jsonValueBehavior", "jsonQueryWrapperBehavior",
"jsonQueryBehavior", "jsonObjectMember", "processingMode", "nullTreatment",
"string", "timeZoneSpecifier", "comparisonOperator", "comparisonQuantifier",
"booleanValue", "interval", "intervalField", "normalForm", "type", "rowField",
"typeParameter", "whenClause", "filter", "mergeCase", "over", "windowFrame",
"frameExtent", "frameBound", "rowPattern", "patternPrimary", "patternQuantifier",
"updateAssignment", "explainOption", "transactionMode", "levelOfIsolation",
"callArgument", "pathElement", "pathSpecification", "privilege", "qualifiedName",
"queryPeriod", "rangeType", "grantor", "principal", "roles", "identifier",
"number", "nonReserved"
};
}
public static final String[] ruleNames = makeRuleNames();
private static String[] makeLiteralNames() {
return new String[] {
null, "'.'", "'('", "')'", "','", "'SKIP'", "'=>'", "'->'", "'['", "']'",
"':'", "'|'", "'^'", "'$'", "'{-'", "'-}'", "'{'", "'}'", "'ABSENT'",
"'ADD'", "'ADMIN'", "'AFTER'", "'ALL'", "'ALTER'", "'ANALYZE'", "'AND'",
"'ANY'", "'ARRAY'", "'AS'", "'ASC'", "'AT'", "'AUTHORIZATION'", "'BERNOULLI'",
"'BETWEEN'", "'BOTH'", "'BY'", "'CALL'", "'CASCADE'", "'CASE'", "'CAST'",
"'CATALOGS'", "'COLUMN'", "'COLUMNS'", "'COMMENT'", "'COMMIT'", "'COMMITTED'",
"'CONDITIONAL'", "'CONSTRAINT'", "'COUNT'", "'COPARTITION'", "'CREATE'",
"'CROSS'", "'CUBE'", "'CURRENT'", "'CURRENT_CATALOG'", "'CURRENT_DATE'",
"'CURRENT_PATH'", "'CURRENT_ROLE'", "'CURRENT_SCHEMA'", "'CURRENT_TIME'",
"'CURRENT_TIMESTAMP'", "'CURRENT_USER'", "'DATA'", "'DATE'", "'DAY'",
"'DEALLOCATE'", "'DEFAULT'", "'DEFINER'", "'DELETE'", "'DENY'", "'DESC'",
"'DESCRIBE'", "'DESCRIPTOR'", "'DEFINE'", "'DISTINCT'", "'DISTRIBUTED'",
"'DOUBLE'", "'DROP'", "'ELSE'", "'EMPTY'", "'ENCODING'", "'END'", "'ERROR'",
"'ESCAPE'", "'EXCEPT'", "'EXCLUDING'", "'EXECUTE'", "'EXISTS'", "'EXPLAIN'",
"'EXTRACT'", "'FALSE'", "'FETCH'", "'FILTER'", "'FINAL'", "'FIRST'",
"'FOLLOWING'", "'FOR'", "'FORMAT'", "'FROM'", "'FULL'", "'FUNCTIONS'",
"'GRANT'", "'GRANTED'", "'GRANTS'", "'GRAPHVIZ'", "'GROUP'", "'GROUPING'",
"'GROUPS'", "'HAVING'", "'HOUR'", "'IF'", "'IGNORE'", "'IN'", "'INCLUDING'",
"'INITIAL'", "'INNER'", "'INPUT'", "'INSERT'", "'INTERSECT'", "'INTERVAL'",
"'INTO'", "'INVOKER'", "'IO'", "'IS'", "'ISOLATION'", "'JOIN'", "'JSON'",
"'JSON_ARRAY'", "'JSON_EXISTS'", "'JSON_OBJECT'", "'JSON_QUERY'", "'JSON_VALUE'",
"'KEEP'", "'KEY'", "'KEYS'", "'LAST'", "'LATERAL'", "'LEADING'", "'LEFT'",
"'LEVEL'", "'LIKE'", "'LIMIT'", "'LISTAGG'", "'LOCAL'", "'LOCALTIME'",
"'LOCALTIMESTAMP'", "'LOGICAL'", "'MAP'", "'MATCH'", "'MATCHED'", "'MATCHES'",
"'MATCH_RECOGNIZE'", "'MATERIALIZED'", "'MEASURES'", "'MERGE'", "'MINUTE'",
"'MONTH'", "'NATURAL'", "'NEXT'", "'NFC'", "'NFD'", "'NFKC'", "'NFKD'",
"'NO'", "'NONE'", "'NORMALIZE'", "'NOT'", "'NULL'", "'NULLIF'", "'NULLS'",
"'OBJECT'", "'OFFSET'", "'OMIT'", "'OF'", "'ON'", "'ONE'", "'ONLY'",
"'OPTION'", "'OR'", "'ORDER'", "'ORDINALITY'", "'OUTER'", "'OUTPUT'",
"'OVER'", "'OVERFLOW'", "'PARTITION'", "'PARTITIONS'", "'PASSING'", "'PAST'",
"'PATH'", "'PATTERN'", "'PER'", "'PERMUTE'", "'POSITION'", "'PRECEDING'",
"'PRECISION'", "'PREPARE'", "'PRIVILEGES'", "'PROPERTIES'", "'PRUNE'",
"'QUOTES'", "'RANGE'", "'READ'", "'RECURSIVE'", "'REFRESH'", "'RENAME'",
"'REPEATABLE'", "'REPLACE'", "'RESET'", "'RESPECT'", "'RESTRICT'", "'RETURNING'",
"'REVOKE'", "'RIGHT'", "'ROLE'", "'ROLES'", "'ROLLBACK'", "'ROLLUP'",
"'ROW'", "'ROWS'", "'RUNNING'", "'SCALAR'", "'SCHEMA'", "'SCHEMAS'",
"'SECOND'", "'SECURITY'", "'SEEK'", "'SELECT'", "'SERIALIZABLE'", "'SESSION'",
"'SET'", "'SETS'", "'SHOW'", "'SOME'", "'START'", "'STATS'", "'SUBSET'",
"'SUBSTRING'", "'SYSTEM'", "'TABLE'", "'TABLES'", "'TABLESAMPLE'", "'TEXT'",
"'STRING'", "'THEN'", "'TIES'", "'TIME'", "'TIMESTAMP'", "'TO'", "'TRAILING'",
"'TRANSACTION'", "'TRIM'", "'TRUE'", "'TRUNCATE'", "'TRY_CAST'", "'TYPE'",
"'UESCAPE'", "'UNBOUNDED'", "'UNCOMMITTED'", "'UNCONDITIONAL'", "'UNION'",
"'UNIQUE'", "'UNKNOWN'", "'UNMATCHED'", "'UNNEST'", "'UPDATE'", "'USE'",
"'USER'", "'USING'", "'UTF16'", "'UTF32'", "'UTF8'", "'VALIDATE'", "'VALUE'",
"'VALUES'", "'VERBOSE'", "'VERSION'", "'VIEW'", "'WHEN'", "'WHERE'",
"'WINDOW'", "'WITH'", "'WITHIN'", "'WITHOUT'", "'WORK'", "'WRAPPER'",
"'WRITE'", "'YEAR'", "'ZONE'", "'='", null, "'<'", "'<='", "'>'", "'>='",
"'+'", "'-'", "'*'", "'/'", "'%'", "'||'", "'?'"
};
}
private static final String[] _LITERAL_NAMES = makeLiteralNames();
private static String[] makeSymbolicNames() {
return new String[] {
null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, "ABSENT", "ADD", "ADMIN", "AFTER",
"ALL", "ALTER", "ANALYZE", "AND", "ANY", "ARRAY", "AS", "ASC", "AT",
"AUTHORIZATION", "BERNOULLI", "BETWEEN", "BOTH", "BY", "CALL", "CASCADE",
"CASE", "CAST", "CATALOGS", "COLUMN", "COLUMNS", "COMMENT", "COMMIT",
"COMMITTED", "CONDITIONAL", "CONSTRAINT", "COUNT", "COPARTITION", "CREATE",
"CROSS", "CUBE", "CURRENT", "CURRENT_CATALOG", "CURRENT_DATE", "CURRENT_PATH",
"CURRENT_ROLE", "CURRENT_SCHEMA", "CURRENT_TIME", "CURRENT_TIMESTAMP",
"CURRENT_USER", "DATA", "DATE", "DAY", "DEALLOCATE", "DEFAULT", "DEFINER",
"DELETE", "DENY", "DESC", "DESCRIBE", "DESCRIPTOR", "DEFINE", "DISTINCT",
"DISTRIBUTED", "DOUBLE", "DROP", "ELSE", "EMPTY", "ENCODING", "END",
"ERROR", "ESCAPE", "EXCEPT", "EXCLUDING", "EXECUTE", "EXISTS", "EXPLAIN",
"EXTRACT", "FALSE", "FETCH", "FILTER", "FINAL", "FIRST", "FOLLOWING",
"FOR", "FORMAT", "FROM", "FULL", "FUNCTIONS", "GRANT", "GRANTED", "GRANTS",
"GRAPHVIZ", "GROUP", "GROUPING", "GROUPS", "HAVING", "HOUR", "IF", "IGNORE",
"IN", "INCLUDING", "INITIAL", "INNER", "INPUT", "INSERT", "INTERSECT",
"INTERVAL", "INTO", "INVOKER", "IO", "IS", "ISOLATION", "JOIN", "JSON",
"JSON_ARRAY", "JSON_EXISTS", "JSON_OBJECT", "JSON_QUERY", "JSON_VALUE",
"KEEP", "KEY", "KEYS", "LAST", "LATERAL", "LEADING", "LEFT", "LEVEL",
"LIKE", "LIMIT", "LISTAGG", "LOCAL", "LOCALTIME", "LOCALTIMESTAMP", "LOGICAL",
"MAP", "MATCH", "MATCHED", "MATCHES", "MATCH_RECOGNIZE", "MATERIALIZED",
"MEASURES", "MERGE", "MINUTE", "MONTH", "NATURAL", "NEXT", "NFC", "NFD",
"NFKC", "NFKD", "NO", "NONE", "NORMALIZE", "NOT", "NULL", "NULLIF", "NULLS",
"OBJECT", "OFFSET", "OMIT", "OF", "ON", "ONE", "ONLY", "OPTION", "OR",
"ORDER", "ORDINALITY", "OUTER", "OUTPUT", "OVER", "OVERFLOW", "PARTITION",
"PARTITIONS", "PASSING", "PAST", "PATH", "PATTERN", "PER", "PERMUTE",
"POSITION", "PRECEDING", "PRECISION", "PREPARE", "PRIVILEGES", "PROPERTIES",
"PRUNE", "QUOTES", "RANGE", "READ", "RECURSIVE", "REFRESH", "RENAME",
"REPEATABLE", "REPLACE", "RESET", "RESPECT", "RESTRICT", "RETURNING",
"REVOKE", "RIGHT", "ROLE", "ROLES", "ROLLBACK", "ROLLUP", "ROW", "ROWS",
"RUNNING", "SCALAR", "SCHEMA", "SCHEMAS", "SECOND", "SECURITY", "SEEK",
"SELECT", "SERIALIZABLE", "SESSION", "SET", "SETS", "SHOW", "SOME", "START",
"STATS", "SUBSET", "SUBSTRING", "SYSTEM", "TABLE", "TABLES", "TABLESAMPLE",
"TEXT", "TEXT_STRING", "THEN", "TIES", "TIME", "TIMESTAMP", "TO", "TRAILING",
"TRANSACTION", "TRIM", "TRUE", "TRUNCATE", "TRY_CAST", "TYPE", "UESCAPE",
"UNBOUNDED", "UNCOMMITTED", "UNCONDITIONAL", "UNION", "UNIQUE", "UNKNOWN",
"UNMATCHED", "UNNEST", "UPDATE", "USE", "USER", "USING", "UTF16", "UTF32",
"UTF8", "VALIDATE", "VALUE", "VALUES", "VERBOSE", "VERSION", "VIEW",
"WHEN", "WHERE", "WINDOW", "WITH", "WITHIN", "WITHOUT", "WORK", "WRAPPER",
"WRITE", "YEAR", "ZONE", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "PLUS",
"MINUS", "ASTERISK", "SLASH", "PERCENT", "CONCAT", "QUESTION_MARK", "STRING",
"UNICODE_STRING", "BINARY_LITERAL", "INTEGER_VALUE", "DECIMAL_VALUE",
"DOUBLE_VALUE", "IDENTIFIER", "DIGIT_IDENTIFIER", "QUOTED_IDENTIFIER",
"BACKQUOTED_IDENTIFIER", "SIMPLE_COMMENT", "BRACKETED_COMMENT", "WS",
"UNRECOGNIZED", "DELIMITER"
};
}
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
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);
}
@SuppressWarnings("CheckReturnValue")
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(218);
statement();
setState(219);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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(221);
expression();
setState(222);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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(224);
pathSpecification();
setState(225);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class StandaloneTypeContext extends ParserRuleContext {
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode EOF() { return getToken(SqlBaseParser.EOF, 0); }
public StandaloneTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_standaloneType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterStandaloneType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitStandaloneType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitStandaloneType(this);
else return visitor.visitChildren(this);
}
}
public final StandaloneTypeContext standaloneType() throws RecognitionException {
StandaloneTypeContext _localctx = new StandaloneTypeContext(_ctx, getState());
enterRule(_localctx, 6, RULE_standaloneType);
try {
enterOuterAlt(_localctx, 1);
{
setState(227);
type(0);
setState(228);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class StandaloneRowPatternContext extends ParserRuleContext {
public RowPatternContext rowPattern() {
return getRuleContext(RowPatternContext.class,0);
}
public TerminalNode EOF() { return getToken(SqlBaseParser.EOF, 0); }
public StandaloneRowPatternContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_standaloneRowPattern; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterStandaloneRowPattern(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitStandaloneRowPattern(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitStandaloneRowPattern(this);
else return visitor.visitChildren(this);
}
}
public final StandaloneRowPatternContext standaloneRowPattern() throws RecognitionException {
StandaloneRowPatternContext _localctx = new StandaloneRowPatternContext(_ctx, getState());
enterRule(_localctx, 8, RULE_standaloneRowPattern);
try {
enterOuterAlt(_localctx, 1);
{
setState(230);
rowPattern(0);
setState(231);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ExplainContext extends StatementContext {
public TerminalNode EXPLAIN() { return getToken(SqlBaseParser.EXPLAIN, 0); }
public StatementContext statement() {
return getRuleContext(StatementContext.class,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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class DropMaterializedViewContext extends StatementContext {
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode MATERIALIZED() { return getToken(SqlBaseParser.MATERIALIZED, 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 DropMaterializedViewContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropMaterializedView(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropMaterializedView(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropMaterializedView(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class SetMaterializedViewPropertiesContext extends StatementContext {
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode MATERIALIZED() { return getToken(SqlBaseParser.MATERIALIZED, 0); }
public TerminalNode VIEW() { return getToken(SqlBaseParser.VIEW, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode PROPERTIES() { return getToken(SqlBaseParser.PROPERTIES, 0); }
public PropertyAssignmentsContext propertyAssignments() {
return getRuleContext(PropertyAssignmentsContext.class,0);
}
public SetMaterializedViewPropertiesContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetMaterializedViewProperties(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetMaterializedViewProperties(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetMaterializedViewProperties(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class RenameTableContext extends StatementContext {
public QualifiedNameContext from;
public QualifiedNameContext to;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode RENAME() { return getToken(SqlBaseParser.RENAME, 0); }
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public List qualifiedName() {
return getRuleContexts(QualifiedNameContext.class);
}
public QualifiedNameContext qualifiedName(int i) {
return getRuleContext(QualifiedNameContext.class,i);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public RenameTableContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRenameTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRenameTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRenameTable(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class CreateRoleContext extends StatementContext {
public IdentifierContext name;
public IdentifierContext catalog;
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode ROLE() { return getToken(SqlBaseParser.ROLE, 0); }
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
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 TerminalNode IN() { return getToken(SqlBaseParser.IN, 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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class DropColumnContext extends StatementContext {
public QualifiedNameContext tableName;
public QualifiedNameContext column;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode COLUMN() { return getToken(SqlBaseParser.COLUMN, 0); }
public List qualifiedName() {
return getRuleContexts(QualifiedNameContext.class);
}
public QualifiedNameContext qualifiedName(int i) {
return getRuleContext(QualifiedNameContext.class,i);
}
public List IF() { return getTokens(SqlBaseParser.IF); }
public TerminalNode IF(int i) {
return getToken(SqlBaseParser.IF, i);
}
public List EXISTS() { return getTokens(SqlBaseParser.EXISTS); }
public TerminalNode EXISTS(int i) {
return getToken(SqlBaseParser.EXISTS, i);
}
public DropColumnContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropColumn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropColumn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropColumn(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class SetViewAuthorizationContext extends StatementContext {
public QualifiedNameContext from;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode VIEW() { return getToken(SqlBaseParser.VIEW, 0); }
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode AUTHORIZATION() { return getToken(SqlBaseParser.AUTHORIZATION, 0); }
public PrincipalContext principal() {
return getRuleContext(PrincipalContext.class,0);
}
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public SetViewAuthorizationContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetViewAuthorization(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetViewAuthorization(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetViewAuthorization(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ShowCatalogsContext extends StatementContext {
public StringContext pattern;
public StringContext escape;
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 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 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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class MergeContext extends StatementContext {
public TerminalNode MERGE() { return getToken(SqlBaseParser.MERGE, 0); }
public TerminalNode INTO() { return getToken(SqlBaseParser.INTO, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode USING() { return getToken(SqlBaseParser.USING, 0); }
public RelationContext relation() {
return getRuleContext(RelationContext.class,0);
}
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public List mergeCase() {
return getRuleContexts(MergeCaseContext.class);
}
public MergeCaseContext mergeCase(int i) {
return getRuleContext(MergeCaseContext.class,i);
}
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public MergeContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterMerge(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitMerge(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitMerge(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class RenameColumnContext extends StatementContext {
public QualifiedNameContext tableName;
public IdentifierContext from;
public IdentifierContext to;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode RENAME() { return getToken(SqlBaseParser.RENAME, 0); }
public TerminalNode COLUMN() { return getToken(SqlBaseParser.COLUMN, 0); }
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public List IF() { return getTokens(SqlBaseParser.IF); }
public TerminalNode IF(int i) {
return getToken(SqlBaseParser.IF, i);
}
public List EXISTS() { return getTokens(SqlBaseParser.EXISTS); }
public TerminalNode EXISTS(int i) {
return getToken(SqlBaseParser.EXISTS, i);
}
public RenameColumnContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRenameColumn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRenameColumn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRenameColumn(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class CommentColumnContext extends StatementContext {
public TerminalNode COMMENT() { return getToken(SqlBaseParser.COMMENT, 0); }
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public TerminalNode COLUMN() { return getToken(SqlBaseParser.COLUMN, 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 CommentColumnContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCommentColumn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCommentColumn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCommentColumn(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class RevokeRolesContext extends StatementContext {
public IdentifierContext catalog;
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 TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ShowColumnsContext extends StatementContext {
public StringContext pattern;
public StringContext escape;
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode COLUMNS() { return getToken(SqlBaseParser.COLUMNS, 0); }
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode LIKE() { return getToken(SqlBaseParser.LIKE, 0); }
public List string() {
return getRuleContexts(StringContext.class);
}
public StringContext string(int i) {
return getRuleContext(StringContext.class,i);
}
public TerminalNode ESCAPE() { return getToken(SqlBaseParser.ESCAPE, 0); }
public 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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class AddColumnContext extends StatementContext {
public QualifiedNameContext tableName;
public ColumnDefinitionContext column;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode ADD() { return getToken(SqlBaseParser.ADD, 0); }
public TerminalNode COLUMN() { return getToken(SqlBaseParser.COLUMN, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public ColumnDefinitionContext columnDefinition() {
return getRuleContext(ColumnDefinitionContext.class,0);
}
public List IF() { return getTokens(SqlBaseParser.IF); }
public TerminalNode IF(int i) {
return getToken(SqlBaseParser.IF, i);
}
public List EXISTS() { return getTokens(SqlBaseParser.EXISTS); }
public TerminalNode EXISTS(int i) {
return getToken(SqlBaseParser.EXISTS, i);
}
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public AddColumnContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterAddColumn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitAddColumn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitAddColumn(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class DenyContext extends StatementContext {
public PrincipalContext grantee;
public TerminalNode DENY() { return getToken(SqlBaseParser.DENY, 0); }
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 SCHEMA() { return getToken(SqlBaseParser.SCHEMA, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public DenyContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDeny(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDeny(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDeny(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ShowSessionContext extends StatementContext {
public StringContext pattern;
public StringContext escape;
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode SESSION() { return getToken(SqlBaseParser.SESSION, 0); }
public TerminalNode LIKE() { return getToken(SqlBaseParser.LIKE, 0); }
public List string() {
return getRuleContexts(StringContext.class);
}
public StringContext string(int i) {
return getRuleContext(StringContext.class,i);
}
public TerminalNode ESCAPE() { return getToken(SqlBaseParser.ESCAPE, 0); }
public 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);
}
}
@SuppressWarnings("CheckReturnValue")
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 AUTHORIZATION() { return getToken(SqlBaseParser.AUTHORIZATION, 0); }
public PrincipalContext principal() {
return getRuleContext(PrincipalContext.class,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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ExplainAnalyzeContext extends StatementContext {
public TerminalNode EXPLAIN() { return getToken(SqlBaseParser.EXPLAIN, 0); }
public TerminalNode ANALYZE() { return getToken(SqlBaseParser.ANALYZE, 0); }
public StatementContext statement() {
return getRuleContext(StatementContext.class,0);
}
public TerminalNode VERBOSE() { return getToken(SqlBaseParser.VERBOSE, 0); }
public ExplainAnalyzeContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterExplainAnalyze(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExplainAnalyze(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExplainAnalyze(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class DropRoleContext extends StatementContext {
public IdentifierContext name;
public IdentifierContext catalog;
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode ROLE() { return getToken(SqlBaseParser.ROLE, 0); }
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class SetRoleContext extends StatementContext {
public IdentifierContext role;
public IdentifierContext catalog;
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 List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class SetTableAuthorizationContext extends StatementContext {
public QualifiedNameContext tableName;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode AUTHORIZATION() { return getToken(SqlBaseParser.AUTHORIZATION, 0); }
public PrincipalContext principal() {
return getRuleContext(PrincipalContext.class,0);
}
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public SetTableAuthorizationContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetTableAuthorization(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetTableAuthorization(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetTableAuthorization(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class CommentViewContext extends StatementContext {
public TerminalNode COMMENT() { return getToken(SqlBaseParser.COMMENT, 0); }
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public TerminalNode VIEW() { return getToken(SqlBaseParser.VIEW, 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 CommentViewContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCommentView(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCommentView(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCommentView(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ShowCreateSchemaContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
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 ShowCreateSchemaContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowCreateSchema(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowCreateSchema(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowCreateSchema(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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 SCHEMA() { return getToken(SqlBaseParser.SCHEMA, 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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class UpdateContext extends StatementContext {
public BooleanExpressionContext where;
public TerminalNode UPDATE() { return getToken(SqlBaseParser.UPDATE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public List updateAssignment() {
return getRuleContexts(UpdateAssignmentContext.class);
}
public UpdateAssignmentContext updateAssignment(int i) {
return getRuleContext(UpdateAssignmentContext.class,i);
}
public TerminalNode WHERE() { return getToken(SqlBaseParser.WHERE, 0); }
public BooleanExpressionContext booleanExpression() {
return getRuleContext(BooleanExpressionContext.class,0);
}
public UpdateContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterUpdate(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitUpdate(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitUpdate(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class TableExecuteContext extends StatementContext {
public QualifiedNameContext tableName;
public IdentifierContext procedureName;
public BooleanExpressionContext where;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode EXECUTE() { return getToken(SqlBaseParser.EXECUTE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode WHERE() { return getToken(SqlBaseParser.WHERE, 0); }
public BooleanExpressionContext booleanExpression() {
return getRuleContext(BooleanExpressionContext.class,0);
}
public List callArgument() {
return getRuleContexts(CallArgumentContext.class);
}
public CallArgumentContext callArgument(int i) {
return getRuleContext(CallArgumentContext.class,i);
}
public TableExecuteContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTableExecute(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTableExecute(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTableExecute(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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 QueryContext query() {
return getRuleContext(QueryContext.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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class SetTimeZoneContext extends StatementContext {
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode TIME() { return getToken(SqlBaseParser.TIME, 0); }
public TerminalNode ZONE() { return getToken(SqlBaseParser.ZONE, 0); }
public TerminalNode LOCAL() { return getToken(SqlBaseParser.LOCAL, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public SetTimeZoneContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetTimeZone(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetTimeZone(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetTimeZone(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class TruncateTableContext extends StatementContext {
public TerminalNode TRUNCATE() { return getToken(SqlBaseParser.TRUNCATE, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TruncateTableContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTruncateTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTruncateTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTruncateTable(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class CreateMaterializedViewContext extends StatementContext {
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode MATERIALIZED() { return getToken(SqlBaseParser.MATERIALIZED, 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 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 CreateMaterializedViewContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCreateMaterializedView(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCreateMaterializedView(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCreateMaterializedView(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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 COMMENT() { return getToken(SqlBaseParser.COMMENT, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class RenameMaterializedViewContext extends StatementContext {
public QualifiedNameContext from;
public QualifiedNameContext to;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode MATERIALIZED() { return getToken(SqlBaseParser.MATERIALIZED, 0); }
public TerminalNode VIEW() { return getToken(SqlBaseParser.VIEW, 0); }
public TerminalNode RENAME() { return getToken(SqlBaseParser.RENAME, 0); }
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public List qualifiedName() {
return getRuleContexts(QualifiedNameContext.class);
}
public QualifiedNameContext qualifiedName(int i) {
return getRuleContext(QualifiedNameContext.class,i);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public RenameMaterializedViewContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRenameMaterializedView(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRenameMaterializedView(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRenameMaterializedView(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class SetSchemaAuthorizationContext 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 SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode AUTHORIZATION() { return getToken(SqlBaseParser.AUTHORIZATION, 0); }
public PrincipalContext principal() {
return getRuleContext(PrincipalContext.class,0);
}
public SetSchemaAuthorizationContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetSchemaAuthorization(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetSchemaAuthorization(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetSchemaAuthorization(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class RenameViewContext extends StatementContext {
public QualifiedNameContext from;
public QualifiedNameContext to;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode VIEW() { return getToken(SqlBaseParser.VIEW, 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 RenameViewContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRenameView(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRenameView(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRenameView(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class GrantRolesContext extends StatementContext {
public IdentifierContext catalog;
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 TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class RefreshMaterializedViewContext extends StatementContext {
public TerminalNode REFRESH() { return getToken(SqlBaseParser.REFRESH, 0); }
public TerminalNode MATERIALIZED() { return getToken(SqlBaseParser.MATERIALIZED, 0); }
public TerminalNode VIEW() { return getToken(SqlBaseParser.VIEW, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public RefreshMaterializedViewContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRefreshMaterializedView(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRefreshMaterializedView(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRefreshMaterializedView(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ShowCreateMaterializedViewContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode MATERIALIZED() { return getToken(SqlBaseParser.MATERIALIZED, 0); }
public TerminalNode VIEW() { return getToken(SqlBaseParser.VIEW, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public ShowCreateMaterializedViewContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowCreateMaterializedView(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowCreateMaterializedView(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowCreateMaterializedView(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ShowFunctionsContext extends StatementContext {
public StringContext pattern;
public StringContext escape;
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode FUNCTIONS() { return getToken(SqlBaseParser.FUNCTIONS, 0); }
public TerminalNode LIKE() { return getToken(SqlBaseParser.LIKE, 0); }
public List string() {
return getRuleContexts(StringContext.class);
}
public StringContext string(int i) {
return getRuleContext(StringContext.class,i);
}
public TerminalNode ESCAPE() { return getToken(SqlBaseParser.ESCAPE, 0); }
public ShowFunctionsContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowFunctions(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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 WITH() { return getToken(SqlBaseParser.WITH, 0); }
public TerminalNode OPTION() { return getToken(SqlBaseParser.OPTION, 0); }
public TerminalNode SCHEMA() { return getToken(SqlBaseParser.SCHEMA, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class SetTablePropertiesContext extends StatementContext {
public QualifiedNameContext tableName;
public TerminalNode ALTER() { return getToken(SqlBaseParser.ALTER, 0); }
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode PROPERTIES() { return getToken(SqlBaseParser.PROPERTIES, 0); }
public PropertyAssignmentsContext propertyAssignments() {
return getRuleContext(PropertyAssignmentsContext.class,0);
}
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public SetTablePropertiesContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetTableProperties(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetTableProperties(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetTableProperties(this);
else return visitor.visitChildren(this);
}
}
public final StatementContext statement() throws RecognitionException {
StatementContext _localctx = new StatementContext(_ctx, getState());
enterRule(_localctx, 10, RULE_statement);
int _la;
try {
setState(1006);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,105,_ctx) ) {
case 1:
_localctx = new StatementDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(233);
query();
}
break;
case 2:
_localctx = new UseContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(234);
match(USE);
setState(235);
((UseContext)_localctx).schema = identifier();
}
break;
case 3:
_localctx = new UseContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(236);
match(USE);
setState(237);
((UseContext)_localctx).catalog = identifier();
setState(238);
match(T__0);
setState(239);
((UseContext)_localctx).schema = identifier();
}
break;
case 4:
_localctx = new CreateSchemaContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(241);
match(CREATE);
setState(242);
match(SCHEMA);
setState(246);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) {
case 1:
{
setState(243);
match(IF);
setState(244);
match(NOT);
setState(245);
match(EXISTS);
}
break;
}
setState(248);
qualifiedName();
setState(251);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AUTHORIZATION) {
{
setState(249);
match(AUTHORIZATION);
setState(250);
principal();
}
}
setState(255);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(253);
match(WITH);
setState(254);
properties();
}
}
}
break;
case 5:
_localctx = new DropSchemaContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(257);
match(DROP);
setState(258);
match(SCHEMA);
setState(261);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) {
case 1:
{
setState(259);
match(IF);
setState(260);
match(EXISTS);
}
break;
}
setState(263);
qualifiedName();
setState(265);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CASCADE || _la==RESTRICT) {
{
setState(264);
_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(267);
match(ALTER);
setState(268);
match(SCHEMA);
setState(269);
qualifiedName();
setState(270);
match(RENAME);
setState(271);
match(TO);
setState(272);
identifier();
}
break;
case 7:
_localctx = new SetSchemaAuthorizationContext(_localctx);
enterOuterAlt(_localctx, 7);
{
setState(274);
match(ALTER);
setState(275);
match(SCHEMA);
setState(276);
qualifiedName();
setState(277);
match(SET);
setState(278);
match(AUTHORIZATION);
setState(279);
principal();
}
break;
case 8:
_localctx = new CreateTableAsSelectContext(_localctx);
enterOuterAlt(_localctx, 8);
{
setState(281);
match(CREATE);
setState(282);
match(TABLE);
setState(286);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) {
case 1:
{
setState(283);
match(IF);
setState(284);
match(NOT);
setState(285);
match(EXISTS);
}
break;
}
setState(288);
qualifiedName();
setState(290);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(289);
columnAliases();
}
}
setState(294);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(292);
match(COMMENT);
setState(293);
string();
}
}
setState(298);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(296);
match(WITH);
setState(297);
properties();
}
}
setState(300);
match(AS);
setState(306);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,9,_ctx) ) {
case 1:
{
setState(301);
query();
}
break;
case 2:
{
setState(302);
match(T__1);
setState(303);
query();
setState(304);
match(T__2);
}
break;
}
setState(313);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(308);
match(WITH);
setState(310);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NO) {
{
setState(309);
match(NO);
}
}
setState(312);
match(DATA);
}
}
}
break;
case 9:
_localctx = new CreateTableContext(_localctx);
enterOuterAlt(_localctx, 9);
{
setState(315);
match(CREATE);
setState(316);
match(TABLE);
setState(320);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) {
case 1:
{
setState(317);
match(IF);
setState(318);
match(NOT);
setState(319);
match(EXISTS);
}
break;
}
setState(322);
qualifiedName();
setState(323);
match(T__1);
setState(324);
tableElement();
setState(329);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(325);
match(T__3);
setState(326);
tableElement();
}
}
setState(331);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(332);
match(T__2);
setState(335);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(333);
match(COMMENT);
setState(334);
string();
}
}
setState(339);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(337);
match(WITH);
setState(338);
properties();
}
}
}
break;
case 10:
_localctx = new DropTableContext(_localctx);
enterOuterAlt(_localctx, 10);
{
setState(341);
match(DROP);
setState(342);
match(TABLE);
setState(345);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) {
case 1:
{
setState(343);
match(IF);
setState(344);
match(EXISTS);
}
break;
}
setState(347);
qualifiedName();
}
break;
case 11:
_localctx = new InsertIntoContext(_localctx);
enterOuterAlt(_localctx, 11);
{
setState(348);
match(INSERT);
setState(349);
match(INTO);
setState(350);
qualifiedName();
setState(352);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) {
case 1:
{
setState(351);
columnAliases();
}
break;
}
setState(354);
query();
}
break;
case 12:
_localctx = new DeleteContext(_localctx);
enterOuterAlt(_localctx, 12);
{
setState(356);
match(DELETE);
setState(357);
match(FROM);
setState(358);
qualifiedName();
setState(361);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHERE) {
{
setState(359);
match(WHERE);
setState(360);
booleanExpression(0);
}
}
}
break;
case 13:
_localctx = new TruncateTableContext(_localctx);
enterOuterAlt(_localctx, 13);
{
setState(363);
match(TRUNCATE);
setState(364);
match(TABLE);
setState(365);
qualifiedName();
}
break;
case 14:
_localctx = new CommentTableContext(_localctx);
enterOuterAlt(_localctx, 14);
{
setState(366);
match(COMMENT);
setState(367);
match(ON);
setState(368);
match(TABLE);
setState(369);
qualifiedName();
setState(370);
match(IS);
setState(373);
_errHandler.sync(this);
switch (_input.LA(1)) {
case STRING:
case UNICODE_STRING:
{
setState(371);
string();
}
break;
case NULL:
{
setState(372);
match(NULL);
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
case 15:
_localctx = new CommentViewContext(_localctx);
enterOuterAlt(_localctx, 15);
{
setState(375);
match(COMMENT);
setState(376);
match(ON);
setState(377);
match(VIEW);
setState(378);
qualifiedName();
setState(379);
match(IS);
setState(382);
_errHandler.sync(this);
switch (_input.LA(1)) {
case STRING:
case UNICODE_STRING:
{
setState(380);
string();
}
break;
case NULL:
{
setState(381);
match(NULL);
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
case 16:
_localctx = new CommentColumnContext(_localctx);
enterOuterAlt(_localctx, 16);
{
setState(384);
match(COMMENT);
setState(385);
match(ON);
setState(386);
match(COLUMN);
setState(387);
qualifiedName();
setState(388);
match(IS);
setState(391);
_errHandler.sync(this);
switch (_input.LA(1)) {
case STRING:
case UNICODE_STRING:
{
setState(389);
string();
}
break;
case NULL:
{
setState(390);
match(NULL);
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
case 17:
_localctx = new RenameTableContext(_localctx);
enterOuterAlt(_localctx, 17);
{
setState(393);
match(ALTER);
setState(394);
match(TABLE);
setState(397);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) {
case 1:
{
setState(395);
match(IF);
setState(396);
match(EXISTS);
}
break;
}
setState(399);
((RenameTableContext)_localctx).from = qualifiedName();
setState(400);
match(RENAME);
setState(401);
match(TO);
setState(402);
((RenameTableContext)_localctx).to = qualifiedName();
}
break;
case 18:
_localctx = new AddColumnContext(_localctx);
enterOuterAlt(_localctx, 18);
{
setState(404);
match(ALTER);
setState(405);
match(TABLE);
setState(408);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) {
case 1:
{
setState(406);
match(IF);
setState(407);
match(EXISTS);
}
break;
}
setState(410);
((AddColumnContext)_localctx).tableName = qualifiedName();
setState(411);
match(ADD);
setState(412);
match(COLUMN);
setState(416);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
case 1:
{
setState(413);
match(IF);
setState(414);
match(NOT);
setState(415);
match(EXISTS);
}
break;
}
setState(418);
((AddColumnContext)_localctx).column = columnDefinition();
}
break;
case 19:
_localctx = new RenameColumnContext(_localctx);
enterOuterAlt(_localctx, 19);
{
setState(420);
match(ALTER);
setState(421);
match(TABLE);
setState(424);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) {
case 1:
{
setState(422);
match(IF);
setState(423);
match(EXISTS);
}
break;
}
setState(426);
((RenameColumnContext)_localctx).tableName = qualifiedName();
setState(427);
match(RENAME);
setState(428);
match(COLUMN);
setState(431);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) {
case 1:
{
setState(429);
match(IF);
setState(430);
match(EXISTS);
}
break;
}
setState(433);
((RenameColumnContext)_localctx).from = identifier();
setState(434);
match(TO);
setState(435);
((RenameColumnContext)_localctx).to = identifier();
}
break;
case 20:
_localctx = new DropColumnContext(_localctx);
enterOuterAlt(_localctx, 20);
{
setState(437);
match(ALTER);
setState(438);
match(TABLE);
setState(441);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) {
case 1:
{
setState(439);
match(IF);
setState(440);
match(EXISTS);
}
break;
}
setState(443);
((DropColumnContext)_localctx).tableName = qualifiedName();
setState(444);
match(DROP);
setState(445);
match(COLUMN);
setState(448);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) {
case 1:
{
setState(446);
match(IF);
setState(447);
match(EXISTS);
}
break;
}
setState(450);
((DropColumnContext)_localctx).column = qualifiedName();
}
break;
case 21:
_localctx = new SetTableAuthorizationContext(_localctx);
enterOuterAlt(_localctx, 21);
{
setState(452);
match(ALTER);
setState(453);
match(TABLE);
setState(454);
((SetTableAuthorizationContext)_localctx).tableName = qualifiedName();
setState(455);
match(SET);
setState(456);
match(AUTHORIZATION);
setState(457);
principal();
}
break;
case 22:
_localctx = new SetTablePropertiesContext(_localctx);
enterOuterAlt(_localctx, 22);
{
setState(459);
match(ALTER);
setState(460);
match(TABLE);
setState(461);
((SetTablePropertiesContext)_localctx).tableName = qualifiedName();
setState(462);
match(SET);
setState(463);
match(PROPERTIES);
setState(464);
propertyAssignments();
}
break;
case 23:
_localctx = new TableExecuteContext(_localctx);
enterOuterAlt(_localctx, 23);
{
setState(466);
match(ALTER);
setState(467);
match(TABLE);
setState(468);
((TableExecuteContext)_localctx).tableName = qualifiedName();
setState(469);
match(EXECUTE);
setState(470);
((TableExecuteContext)_localctx).procedureName = identifier();
setState(483);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(471);
match(T__1);
setState(480);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -152137268172423164L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -2983936075159463059L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & -12455268256322561L) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & -4644371511117841L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 36012033738405751L) != 0)) {
{
setState(472);
callArgument();
setState(477);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(473);
match(T__3);
setState(474);
callArgument();
}
}
setState(479);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(482);
match(T__2);
}
}
setState(487);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHERE) {
{
setState(485);
match(WHERE);
setState(486);
((TableExecuteContext)_localctx).where = booleanExpression(0);
}
}
}
break;
case 24:
_localctx = new AnalyzeContext(_localctx);
enterOuterAlt(_localctx, 24);
{
setState(489);
match(ANALYZE);
setState(490);
qualifiedName();
setState(493);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(491);
match(WITH);
setState(492);
properties();
}
}
}
break;
case 25:
_localctx = new CreateMaterializedViewContext(_localctx);
enterOuterAlt(_localctx, 25);
{
setState(495);
match(CREATE);
setState(498);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OR) {
{
setState(496);
match(OR);
setState(497);
match(REPLACE);
}
}
setState(500);
match(MATERIALIZED);
setState(501);
match(VIEW);
setState(505);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,35,_ctx) ) {
case 1:
{
setState(502);
match(IF);
setState(503);
match(NOT);
setState(504);
match(EXISTS);
}
break;
}
setState(507);
qualifiedName();
setState(510);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(508);
match(COMMENT);
setState(509);
string();
}
}
setState(514);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(512);
match(WITH);
setState(513);
properties();
}
}
setState(516);
match(AS);
setState(517);
query();
}
break;
case 26:
_localctx = new CreateViewContext(_localctx);
enterOuterAlt(_localctx, 26);
{
setState(519);
match(CREATE);
setState(522);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OR) {
{
setState(520);
match(OR);
setState(521);
match(REPLACE);
}
}
setState(524);
match(VIEW);
setState(525);
qualifiedName();
setState(528);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(526);
match(COMMENT);
setState(527);
string();
}
}
setState(532);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SECURITY) {
{
setState(530);
match(SECURITY);
setState(531);
_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(534);
match(AS);
setState(535);
query();
}
break;
case 27:
_localctx = new RefreshMaterializedViewContext(_localctx);
enterOuterAlt(_localctx, 27);
{
setState(537);
match(REFRESH);
setState(538);
match(MATERIALIZED);
setState(539);
match(VIEW);
setState(540);
qualifiedName();
}
break;
case 28:
_localctx = new DropMaterializedViewContext(_localctx);
enterOuterAlt(_localctx, 28);
{
setState(541);
match(DROP);
setState(542);
match(MATERIALIZED);
setState(543);
match(VIEW);
setState(546);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,41,_ctx) ) {
case 1:
{
setState(544);
match(IF);
setState(545);
match(EXISTS);
}
break;
}
setState(548);
qualifiedName();
}
break;
case 29:
_localctx = new RenameMaterializedViewContext(_localctx);
enterOuterAlt(_localctx, 29);
{
setState(549);
match(ALTER);
setState(550);
match(MATERIALIZED);
setState(551);
match(VIEW);
setState(554);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,42,_ctx) ) {
case 1:
{
setState(552);
match(IF);
setState(553);
match(EXISTS);
}
break;
}
setState(556);
((RenameMaterializedViewContext)_localctx).from = qualifiedName();
setState(557);
match(RENAME);
setState(558);
match(TO);
setState(559);
((RenameMaterializedViewContext)_localctx).to = qualifiedName();
}
break;
case 30:
_localctx = new SetMaterializedViewPropertiesContext(_localctx);
enterOuterAlt(_localctx, 30);
{
setState(561);
match(ALTER);
setState(562);
match(MATERIALIZED);
setState(563);
match(VIEW);
setState(564);
qualifiedName();
setState(565);
match(SET);
setState(566);
match(PROPERTIES);
setState(567);
propertyAssignments();
}
break;
case 31:
_localctx = new DropViewContext(_localctx);
enterOuterAlt(_localctx, 31);
{
setState(569);
match(DROP);
setState(570);
match(VIEW);
setState(573);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,43,_ctx) ) {
case 1:
{
setState(571);
match(IF);
setState(572);
match(EXISTS);
}
break;
}
setState(575);
qualifiedName();
}
break;
case 32:
_localctx = new RenameViewContext(_localctx);
enterOuterAlt(_localctx, 32);
{
setState(576);
match(ALTER);
setState(577);
match(VIEW);
setState(578);
((RenameViewContext)_localctx).from = qualifiedName();
setState(579);
match(RENAME);
setState(580);
match(TO);
setState(581);
((RenameViewContext)_localctx).to = qualifiedName();
}
break;
case 33:
_localctx = new SetViewAuthorizationContext(_localctx);
enterOuterAlt(_localctx, 33);
{
setState(583);
match(ALTER);
setState(584);
match(VIEW);
setState(585);
((SetViewAuthorizationContext)_localctx).from = qualifiedName();
setState(586);
match(SET);
setState(587);
match(AUTHORIZATION);
setState(588);
principal();
}
break;
case 34:
_localctx = new CallContext(_localctx);
enterOuterAlt(_localctx, 34);
{
setState(590);
match(CALL);
setState(591);
qualifiedName();
setState(592);
match(T__1);
setState(601);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -152137268172423164L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -2983936075159463059L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & -12455268256322561L) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & -4644371511117841L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 36012033738405751L) != 0)) {
{
setState(593);
callArgument();
setState(598);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(594);
match(T__3);
setState(595);
callArgument();
}
}
setState(600);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(603);
match(T__2);
}
break;
case 35:
_localctx = new CreateRoleContext(_localctx);
enterOuterAlt(_localctx, 35);
{
setState(605);
match(CREATE);
setState(606);
match(ROLE);
setState(607);
((CreateRoleContext)_localctx).name = identifier();
setState(611);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(608);
match(WITH);
setState(609);
match(ADMIN);
setState(610);
grantor();
}
}
setState(615);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IN) {
{
setState(613);
match(IN);
setState(614);
((CreateRoleContext)_localctx).catalog = identifier();
}
}
}
break;
case 36:
_localctx = new DropRoleContext(_localctx);
enterOuterAlt(_localctx, 36);
{
setState(617);
match(DROP);
setState(618);
match(ROLE);
setState(619);
((DropRoleContext)_localctx).name = identifier();
setState(622);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IN) {
{
setState(620);
match(IN);
setState(621);
((DropRoleContext)_localctx).catalog = identifier();
}
}
}
break;
case 37:
_localctx = new GrantRolesContext(_localctx);
enterOuterAlt(_localctx, 37);
{
setState(624);
match(GRANT);
setState(625);
roles();
setState(626);
match(TO);
setState(627);
principal();
setState(632);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(628);
match(T__3);
setState(629);
principal();
}
}
setState(634);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(638);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(635);
match(WITH);
setState(636);
match(ADMIN);
setState(637);
match(OPTION);
}
}
setState(643);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GRANTED) {
{
setState(640);
match(GRANTED);
setState(641);
match(BY);
setState(642);
grantor();
}
}
setState(647);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IN) {
{
setState(645);
match(IN);
setState(646);
((GrantRolesContext)_localctx).catalog = identifier();
}
}
}
break;
case 38:
_localctx = new RevokeRolesContext(_localctx);
enterOuterAlt(_localctx, 38);
{
setState(649);
match(REVOKE);
setState(653);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,53,_ctx) ) {
case 1:
{
setState(650);
match(ADMIN);
setState(651);
match(OPTION);
setState(652);
match(FOR);
}
break;
}
setState(655);
roles();
setState(656);
match(FROM);
setState(657);
principal();
setState(662);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(658);
match(T__3);
setState(659);
principal();
}
}
setState(664);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(668);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GRANTED) {
{
setState(665);
match(GRANTED);
setState(666);
match(BY);
setState(667);
grantor();
}
}
setState(672);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IN) {
{
setState(670);
match(IN);
setState(671);
((RevokeRolesContext)_localctx).catalog = identifier();
}
}
}
break;
case 39:
_localctx = new SetRoleContext(_localctx);
enterOuterAlt(_localctx, 39);
{
setState(674);
match(SET);
setState(675);
match(ROLE);
setState(679);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,57,_ctx) ) {
case 1:
{
setState(676);
match(ALL);
}
break;
case 2:
{
setState(677);
match(NONE);
}
break;
case 3:
{
setState(678);
((SetRoleContext)_localctx).role = identifier();
}
break;
}
setState(683);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IN) {
{
setState(681);
match(IN);
setState(682);
((SetRoleContext)_localctx).catalog = identifier();
}
}
}
break;
case 40:
_localctx = new GrantContext(_localctx);
enterOuterAlt(_localctx, 40);
{
setState(685);
match(GRANT);
setState(696);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CREATE:
case DELETE:
case INSERT:
case SELECT:
case UPDATE:
{
setState(686);
privilege();
setState(691);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(687);
match(T__3);
setState(688);
privilege();
}
}
setState(693);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case ALL:
{
setState(694);
match(ALL);
setState(695);
match(PRIVILEGES);
}
break;
default:
throw new NoViableAltException(this);
}
setState(698);
match(ON);
setState(700);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,61,_ctx) ) {
case 1:
{
setState(699);
_la = _input.LA(1);
if ( !(_la==SCHEMA || _la==TABLE) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
break;
}
setState(702);
qualifiedName();
setState(703);
match(TO);
setState(704);
((GrantContext)_localctx).grantee = principal();
setState(708);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(705);
match(WITH);
setState(706);
match(GRANT);
setState(707);
match(OPTION);
}
}
}
break;
case 41:
_localctx = new DenyContext(_localctx);
enterOuterAlt(_localctx, 41);
{
setState(710);
match(DENY);
setState(721);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CREATE:
case DELETE:
case INSERT:
case SELECT:
case UPDATE:
{
setState(711);
privilege();
setState(716);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(712);
match(T__3);
setState(713);
privilege();
}
}
setState(718);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case ALL:
{
setState(719);
match(ALL);
setState(720);
match(PRIVILEGES);
}
break;
default:
throw new NoViableAltException(this);
}
setState(723);
match(ON);
setState(725);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,65,_ctx) ) {
case 1:
{
setState(724);
_la = _input.LA(1);
if ( !(_la==SCHEMA || _la==TABLE) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
break;
}
setState(727);
qualifiedName();
setState(728);
match(TO);
setState(729);
((DenyContext)_localctx).grantee = principal();
}
break;
case 42:
_localctx = new RevokeContext(_localctx);
enterOuterAlt(_localctx, 42);
{
setState(731);
match(REVOKE);
setState(735);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GRANT) {
{
setState(732);
match(GRANT);
setState(733);
match(OPTION);
setState(734);
match(FOR);
}
}
setState(747);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CREATE:
case DELETE:
case INSERT:
case SELECT:
case UPDATE:
{
setState(737);
privilege();
setState(742);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(738);
match(T__3);
setState(739);
privilege();
}
}
setState(744);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case ALL:
{
setState(745);
match(ALL);
setState(746);
match(PRIVILEGES);
}
break;
default:
throw new NoViableAltException(this);
}
setState(749);
match(ON);
setState(751);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,69,_ctx) ) {
case 1:
{
setState(750);
_la = _input.LA(1);
if ( !(_la==SCHEMA || _la==TABLE) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
break;
}
setState(753);
qualifiedName();
setState(754);
match(FROM);
setState(755);
((RevokeContext)_localctx).grantee = principal();
}
break;
case 43:
_localctx = new ShowGrantsContext(_localctx);
enterOuterAlt(_localctx, 43);
{
setState(757);
match(SHOW);
setState(758);
match(GRANTS);
setState(764);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ON) {
{
setState(759);
match(ON);
setState(761);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==TABLE) {
{
setState(760);
match(TABLE);
}
}
setState(763);
qualifiedName();
}
}
}
break;
case 44:
_localctx = new ExplainContext(_localctx);
enterOuterAlt(_localctx, 44);
{
setState(766);
match(EXPLAIN);
setState(778);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,73,_ctx) ) {
case 1:
{
setState(767);
match(T__1);
setState(768);
explainOption();
setState(773);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(769);
match(T__3);
setState(770);
explainOption();
}
}
setState(775);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(776);
match(T__2);
}
break;
}
setState(780);
statement();
}
break;
case 45:
_localctx = new ExplainAnalyzeContext(_localctx);
enterOuterAlt(_localctx, 45);
{
setState(781);
match(EXPLAIN);
setState(782);
match(ANALYZE);
setState(784);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==VERBOSE) {
{
setState(783);
match(VERBOSE);
}
}
setState(786);
statement();
}
break;
case 46:
_localctx = new ShowCreateTableContext(_localctx);
enterOuterAlt(_localctx, 46);
{
setState(787);
match(SHOW);
setState(788);
match(CREATE);
setState(789);
match(TABLE);
setState(790);
qualifiedName();
}
break;
case 47:
_localctx = new ShowCreateSchemaContext(_localctx);
enterOuterAlt(_localctx, 47);
{
setState(791);
match(SHOW);
setState(792);
match(CREATE);
setState(793);
match(SCHEMA);
setState(794);
qualifiedName();
}
break;
case 48:
_localctx = new ShowCreateViewContext(_localctx);
enterOuterAlt(_localctx, 48);
{
setState(795);
match(SHOW);
setState(796);
match(CREATE);
setState(797);
match(VIEW);
setState(798);
qualifiedName();
}
break;
case 49:
_localctx = new ShowCreateMaterializedViewContext(_localctx);
enterOuterAlt(_localctx, 49);
{
setState(799);
match(SHOW);
setState(800);
match(CREATE);
setState(801);
match(MATERIALIZED);
setState(802);
match(VIEW);
setState(803);
qualifiedName();
}
break;
case 50:
_localctx = new ShowTablesContext(_localctx);
enterOuterAlt(_localctx, 50);
{
setState(804);
match(SHOW);
setState(805);
match(TABLES);
setState(808);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(806);
_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(807);
qualifiedName();
}
}
setState(816);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(810);
match(LIKE);
setState(811);
((ShowTablesContext)_localctx).pattern = string();
setState(814);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(812);
match(ESCAPE);
setState(813);
((ShowTablesContext)_localctx).escape = string();
}
}
}
}
}
break;
case 51:
_localctx = new ShowSchemasContext(_localctx);
enterOuterAlt(_localctx, 51);
{
setState(818);
match(SHOW);
setState(819);
match(SCHEMAS);
setState(822);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(820);
_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(821);
identifier();
}
}
setState(830);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(824);
match(LIKE);
setState(825);
((ShowSchemasContext)_localctx).pattern = string();
setState(828);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(826);
match(ESCAPE);
setState(827);
((ShowSchemasContext)_localctx).escape = string();
}
}
}
}
}
break;
case 52:
_localctx = new ShowCatalogsContext(_localctx);
enterOuterAlt(_localctx, 52);
{
setState(832);
match(SHOW);
setState(833);
match(CATALOGS);
setState(840);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(834);
match(LIKE);
setState(835);
((ShowCatalogsContext)_localctx).pattern = string();
setState(838);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(836);
match(ESCAPE);
setState(837);
((ShowCatalogsContext)_localctx).escape = string();
}
}
}
}
}
break;
case 53:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 53);
{
setState(842);
match(SHOW);
setState(843);
match(COLUMNS);
setState(844);
_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(846);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -4601694524648194048L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & 6239431563539749741L) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & -778514395575617L) != 0) || ((((_la - 197)) & ~0x3f) == 0 && ((1L << (_la - 197)) & 8592722952413183935L) != 0) || ((((_la - 261)) & ~0x3f) == 0 && ((1L << (_la - 261)) & 2111062592315255L) != 0)) {
{
setState(845);
qualifiedName();
}
}
setState(854);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(848);
match(LIKE);
setState(849);
((ShowColumnsContext)_localctx).pattern = string();
setState(852);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(850);
match(ESCAPE);
setState(851);
((ShowColumnsContext)_localctx).escape = string();
}
}
}
}
}
break;
case 54:
_localctx = new ShowStatsContext(_localctx);
enterOuterAlt(_localctx, 54);
{
setState(856);
match(SHOW);
setState(857);
match(STATS);
setState(858);
match(FOR);
setState(859);
qualifiedName();
}
break;
case 55:
_localctx = new ShowStatsForQueryContext(_localctx);
enterOuterAlt(_localctx, 55);
{
setState(860);
match(SHOW);
setState(861);
match(STATS);
setState(862);
match(FOR);
setState(863);
match(T__1);
setState(864);
query();
setState(865);
match(T__2);
}
break;
case 56:
_localctx = new ShowRolesContext(_localctx);
enterOuterAlt(_localctx, 56);
{
setState(867);
match(SHOW);
setState(869);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CURRENT) {
{
setState(868);
match(CURRENT);
}
}
setState(871);
match(ROLES);
setState(874);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(872);
_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(873);
identifier();
}
}
}
break;
case 57:
_localctx = new ShowRoleGrantsContext(_localctx);
enterOuterAlt(_localctx, 57);
{
setState(876);
match(SHOW);
setState(877);
match(ROLE);
setState(878);
match(GRANTS);
setState(881);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(879);
_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(880);
identifier();
}
}
}
break;
case 58:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 58);
{
setState(883);
match(DESCRIBE);
setState(884);
qualifiedName();
}
break;
case 59:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 59);
{
setState(885);
match(DESC);
setState(886);
qualifiedName();
}
break;
case 60:
_localctx = new ShowFunctionsContext(_localctx);
enterOuterAlt(_localctx, 60);
{
setState(887);
match(SHOW);
setState(888);
match(FUNCTIONS);
setState(895);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(889);
match(LIKE);
setState(890);
((ShowFunctionsContext)_localctx).pattern = string();
setState(893);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(891);
match(ESCAPE);
setState(892);
((ShowFunctionsContext)_localctx).escape = string();
}
}
}
}
}
break;
case 61:
_localctx = new ShowSessionContext(_localctx);
enterOuterAlt(_localctx, 61);
{
setState(897);
match(SHOW);
setState(898);
match(SESSION);
setState(905);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(899);
match(LIKE);
setState(900);
((ShowSessionContext)_localctx).pattern = string();
setState(903);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(901);
match(ESCAPE);
setState(902);
((ShowSessionContext)_localctx).escape = string();
}
}
}
}
}
break;
case 62:
_localctx = new SetSessionContext(_localctx);
enterOuterAlt(_localctx, 62);
{
setState(907);
match(SET);
setState(908);
match(SESSION);
setState(909);
qualifiedName();
setState(910);
match(EQ);
setState(911);
expression();
}
break;
case 63:
_localctx = new ResetSessionContext(_localctx);
enterOuterAlt(_localctx, 63);
{
setState(913);
match(RESET);
setState(914);
match(SESSION);
setState(915);
qualifiedName();
}
break;
case 64:
_localctx = new StartTransactionContext(_localctx);
enterOuterAlt(_localctx, 64);
{
setState(916);
match(START);
setState(917);
match(TRANSACTION);
setState(926);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ISOLATION || _la==READ) {
{
setState(918);
transactionMode();
setState(923);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(919);
match(T__3);
setState(920);
transactionMode();
}
}
setState(925);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
}
break;
case 65:
_localctx = new CommitContext(_localctx);
enterOuterAlt(_localctx, 65);
{
setState(928);
match(COMMIT);
setState(930);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WORK) {
{
setState(929);
match(WORK);
}
}
}
break;
case 66:
_localctx = new RollbackContext(_localctx);
enterOuterAlt(_localctx, 66);
{
setState(932);
match(ROLLBACK);
setState(934);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WORK) {
{
setState(933);
match(WORK);
}
}
}
break;
case 67:
_localctx = new PrepareContext(_localctx);
enterOuterAlt(_localctx, 67);
{
setState(936);
match(PREPARE);
setState(937);
identifier();
setState(938);
match(FROM);
setState(939);
statement();
}
break;
case 68:
_localctx = new DeallocateContext(_localctx);
enterOuterAlt(_localctx, 68);
{
setState(941);
match(DEALLOCATE);
setState(942);
match(PREPARE);
setState(943);
identifier();
}
break;
case 69:
_localctx = new ExecuteContext(_localctx);
enterOuterAlt(_localctx, 69);
{
setState(944);
match(EXECUTE);
setState(945);
identifier();
setState(955);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==USING) {
{
setState(946);
match(USING);
setState(947);
expression();
setState(952);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(948);
match(T__3);
setState(949);
expression();
}
}
setState(954);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
}
break;
case 70:
_localctx = new DescribeInputContext(_localctx);
enterOuterAlt(_localctx, 70);
{
setState(957);
match(DESCRIBE);
setState(958);
match(INPUT);
setState(959);
identifier();
}
break;
case 71:
_localctx = new DescribeOutputContext(_localctx);
enterOuterAlt(_localctx, 71);
{
setState(960);
match(DESCRIBE);
setState(961);
match(OUTPUT);
setState(962);
identifier();
}
break;
case 72:
_localctx = new SetPathContext(_localctx);
enterOuterAlt(_localctx, 72);
{
setState(963);
match(SET);
setState(964);
match(PATH);
setState(965);
pathSpecification();
}
break;
case 73:
_localctx = new SetTimeZoneContext(_localctx);
enterOuterAlt(_localctx, 73);
{
setState(966);
match(SET);
setState(967);
match(TIME);
setState(968);
match(ZONE);
setState(971);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,99,_ctx) ) {
case 1:
{
setState(969);
match(LOCAL);
}
break;
case 2:
{
setState(970);
expression();
}
break;
}
}
break;
case 74:
_localctx = new UpdateContext(_localctx);
enterOuterAlt(_localctx, 74);
{
setState(973);
match(UPDATE);
setState(974);
qualifiedName();
setState(975);
match(SET);
setState(976);
updateAssignment();
setState(981);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(977);
match(T__3);
setState(978);
updateAssignment();
}
}
setState(983);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(986);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHERE) {
{
setState(984);
match(WHERE);
setState(985);
((UpdateContext)_localctx).where = booleanExpression(0);
}
}
}
break;
case 75:
_localctx = new MergeContext(_localctx);
enterOuterAlt(_localctx, 75);
{
setState(988);
match(MERGE);
setState(989);
match(INTO);
setState(990);
qualifiedName();
setState(995);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -4601694524379758592L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & 6239431563539749741L) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & -778514395575617L) != 0) || ((((_la - 197)) & ~0x3f) == 0 && ((1L << (_la - 197)) & 8592722952413183935L) != 0) || ((((_la - 261)) & ~0x3f) == 0 && ((1L << (_la - 261)) & 2111062592315255L) != 0)) {
{
setState(992);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(991);
match(AS);
}
}
setState(994);
identifier();
}
}
setState(997);
match(USING);
setState(998);
relation(0);
setState(999);
match(ON);
setState(1000);
expression();
setState(1002);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(1001);
mergeCase();
}
}
setState(1004);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==WHEN );
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 12, RULE_query);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1009);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(1008);
with();
}
}
setState(1011);
queryNoWith();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 14, RULE_with);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1013);
match(WITH);
setState(1015);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==RECURSIVE) {
{
setState(1014);
match(RECURSIVE);
}
}
setState(1017);
namedQuery();
setState(1022);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1018);
match(T__3);
setState(1019);
namedQuery();
}
}
setState(1024);
_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;
}
@SuppressWarnings("CheckReturnValue")
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, 16, RULE_tableElement);
try {
setState(1027);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ABSENT:
case ADD:
case ADMIN:
case AFTER:
case ALL:
case ANALYZE:
case ANY:
case ARRAY:
case ASC:
case AT:
case AUTHORIZATION:
case BERNOULLI:
case BOTH:
case CALL:
case CASCADE:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CONDITIONAL:
case COUNT:
case COPARTITION:
case CURRENT:
case DATA:
case DATE:
case DAY:
case DEFAULT:
case DEFINER:
case DENY:
case DESC:
case DESCRIPTOR:
case DEFINE:
case DISTRIBUTED:
case DOUBLE:
case EMPTY:
case ENCODING:
case ERROR:
case EXCLUDING:
case EXPLAIN:
case FETCH:
case FILTER:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case GROUPS:
case HOUR:
case IF:
case IGNORE:
case INCLUDING:
case INITIAL:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case KEEP:
case KEY:
case KEYS:
case LAST:
case LATERAL:
case LEADING:
case LEVEL:
case LIMIT:
case LOCAL:
case LOGICAL:
case MAP:
case MATCH:
case MATCHED:
case MATCHES:
case MATCH_RECOGNIZE:
case MATERIALIZED:
case MEASURES:
case MERGE:
case MINUTE:
case MONTH:
case NEXT:
case NFC:
case NFD:
case NFKC:
case NFKD:
case NO:
case NONE:
case NULLIF:
case NULLS:
case OBJECT:
case OFFSET:
case OMIT:
case OF:
case ONE:
case ONLY:
case OPTION:
case ORDINALITY:
case OUTPUT:
case OVER:
case OVERFLOW:
case PARTITION:
case PARTITIONS:
case PASSING:
case PAST:
case PATH:
case PATTERN:
case PER:
case PERMUTE:
case POSITION:
case PRECEDING:
case PRECISION:
case PRIVILEGES:
case PROPERTIES:
case PRUNE:
case QUOTES:
case RANGE:
case READ:
case REFRESH:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESPECT:
case RESTRICT:
case RETURNING:
case REVOKE:
case ROLE:
case ROLES:
case ROLLBACK:
case ROW:
case ROWS:
case RUNNING:
case SCALAR:
case SCHEMA:
case SCHEMAS:
case SECOND:
case SECURITY:
case SEEK:
case SERIALIZABLE:
case SESSION:
case SET:
case SETS:
case SHOW:
case SOME:
case START:
case STATS:
case SUBSET:
case SUBSTRING:
case SYSTEM:
case TABLES:
case TABLESAMPLE:
case TEXT:
case TEXT_STRING:
case TIES:
case TIME:
case TIMESTAMP:
case TO:
case TRAILING:
case TRANSACTION:
case TRUNCATE:
case TRY_CAST:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNIQUE:
case UNKNOWN:
case UNMATCHED:
case UPDATE:
case USE:
case USER:
case UTF16:
case UTF32:
case UTF8:
case VALIDATE:
case VALUE:
case VERBOSE:
case VERSION:
case VIEW:
case WINDOW:
case WITHIN:
case WITHOUT:
case WORK:
case WRAPPER:
case WRITE:
case YEAR:
case ZONE:
case IDENTIFIER:
case DIGIT_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACKQUOTED_IDENTIFIER:
enterOuterAlt(_localctx, 1);
{
setState(1025);
columnDefinition();
}
break;
case LIKE:
enterOuterAlt(_localctx, 2);
{
setState(1026);
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;
}
@SuppressWarnings("CheckReturnValue")
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, 18, RULE_columnDefinition);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1029);
identifier();
setState(1030);
type(0);
setState(1033);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1031);
match(NOT);
setState(1032);
match(NULL);
}
}
setState(1037);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(1035);
match(COMMENT);
setState(1036);
string();
}
}
setState(1041);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(1039);
match(WITH);
setState(1040);
properties();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 20, RULE_likeClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1043);
match(LIKE);
setState(1044);
qualifiedName();
setState(1047);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==EXCLUDING || _la==INCLUDING) {
{
setState(1045);
((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(1046);
match(PROPERTIES);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class PropertiesContext extends ParserRuleContext {
public PropertyAssignmentsContext propertyAssignments() {
return getRuleContext(PropertyAssignmentsContext.class,0);
}
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, 22, RULE_properties);
try {
enterOuterAlt(_localctx, 1);
{
setState(1049);
match(T__1);
setState(1050);
propertyAssignments();
setState(1051);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class PropertyAssignmentsContext extends ParserRuleContext {
public List property() {
return getRuleContexts(PropertyContext.class);
}
public PropertyContext property(int i) {
return getRuleContext(PropertyContext.class,i);
}
public PropertyAssignmentsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_propertyAssignments; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterPropertyAssignments(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitPropertyAssignments(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitPropertyAssignments(this);
else return visitor.visitChildren(this);
}
}
public final PropertyAssignmentsContext propertyAssignments() throws RecognitionException {
PropertyAssignmentsContext _localctx = new PropertyAssignmentsContext(_ctx, getState());
enterRule(_localctx, 24, RULE_propertyAssignments);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1053);
property();
setState(1058);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1054);
match(T__3);
setState(1055);
property();
}
}
setState(1060);
_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;
}
@SuppressWarnings("CheckReturnValue")
public static class PropertyContext extends ParserRuleContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode EQ() { return getToken(SqlBaseParser.EQ, 0); }
public PropertyValueContext propertyValue() {
return getRuleContext(PropertyValueContext.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, 26, RULE_property);
try {
enterOuterAlt(_localctx, 1);
{
setState(1061);
identifier();
setState(1062);
match(EQ);
setState(1063);
propertyValue();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class PropertyValueContext extends ParserRuleContext {
public PropertyValueContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_propertyValue; }
public PropertyValueContext() { }
public void copyFrom(PropertyValueContext ctx) {
super.copyFrom(ctx);
}
}
@SuppressWarnings("CheckReturnValue")
public static class DefaultPropertyValueContext extends PropertyValueContext {
public TerminalNode DEFAULT() { return getToken(SqlBaseParser.DEFAULT, 0); }
public DefaultPropertyValueContext(PropertyValueContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDefaultPropertyValue(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDefaultPropertyValue(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDefaultPropertyValue(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class NonDefaultPropertyValueContext extends PropertyValueContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public NonDefaultPropertyValueContext(PropertyValueContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNonDefaultPropertyValue(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNonDefaultPropertyValue(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNonDefaultPropertyValue(this);
else return visitor.visitChildren(this);
}
}
public final PropertyValueContext propertyValue() throws RecognitionException {
PropertyValueContext _localctx = new PropertyValueContext(_ctx, getState());
enterRule(_localctx, 28, RULE_propertyValue);
try {
setState(1067);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,115,_ctx) ) {
case 1:
_localctx = new DefaultPropertyValueContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1065);
match(DEFAULT);
}
break;
case 2:
_localctx = new NonDefaultPropertyValueContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1066);
expression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class QueryNoWithContext extends ParserRuleContext {
public RowCountContext offset;
public LimitRowCountContext limit;
public RowCountContext fetchFirst;
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 OFFSET() { return getToken(SqlBaseParser.OFFSET, 0); }
public List rowCount() {
return getRuleContexts(RowCountContext.class);
}
public RowCountContext rowCount(int i) {
return getRuleContext(RowCountContext.class,i);
}
public TerminalNode LIMIT() { return getToken(SqlBaseParser.LIMIT, 0); }
public TerminalNode FETCH() { return getToken(SqlBaseParser.FETCH, 0); }
public LimitRowCountContext limitRowCount() {
return getRuleContext(LimitRowCountContext.class,0);
}
public TerminalNode FIRST() { return getToken(SqlBaseParser.FIRST, 0); }
public TerminalNode NEXT() { return getToken(SqlBaseParser.NEXT, 0); }
public List ROW() { return getTokens(SqlBaseParser.ROW); }
public TerminalNode ROW(int i) {
return getToken(SqlBaseParser.ROW, i);
}
public List ROWS() { return getTokens(SqlBaseParser.ROWS); }
public TerminalNode ROWS(int i) {
return getToken(SqlBaseParser.ROWS, i);
}
public TerminalNode ONLY() { return getToken(SqlBaseParser.ONLY, 0); }
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public TerminalNode TIES() { return getToken(SqlBaseParser.TIES, 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, 30, RULE_queryNoWith);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1069);
queryTerm(0);
setState(1080);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1070);
match(ORDER);
setState(1071);
match(BY);
setState(1072);
sortItem();
setState(1077);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1073);
match(T__3);
setState(1074);
sortItem();
}
}
setState(1079);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1087);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OFFSET) {
{
setState(1082);
match(OFFSET);
setState(1083);
((QueryNoWithContext)_localctx).offset = rowCount();
setState(1085);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ROW || _la==ROWS) {
{
setState(1084);
_la = _input.LA(1);
if ( !(_la==ROW || _la==ROWS) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
}
}
setState(1102);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LIMIT:
{
{
setState(1089);
match(LIMIT);
setState(1090);
((QueryNoWithContext)_localctx).limit = limitRowCount();
}
}
break;
case FETCH:
{
{
setState(1091);
match(FETCH);
setState(1092);
_la = _input.LA(1);
if ( !(_la==FIRST || _la==NEXT) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1094);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==QUESTION_MARK || _la==INTEGER_VALUE) {
{
setState(1093);
((QueryNoWithContext)_localctx).fetchFirst = rowCount();
}
}
setState(1096);
_la = _input.LA(1);
if ( !(_la==ROW || _la==ROWS) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1100);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ONLY:
{
setState(1097);
match(ONLY);
}
break;
case WITH:
{
setState(1098);
match(WITH);
setState(1099);
match(TIES);
}
break;
default:
throw new NoViableAltException(this);
}
}
}
break;
case EOF:
case T__2:
case WITH:
break;
default:
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class LimitRowCountContext extends ParserRuleContext {
public TerminalNode ALL() { return getToken(SqlBaseParser.ALL, 0); }
public RowCountContext rowCount() {
return getRuleContext(RowCountContext.class,0);
}
public LimitRowCountContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_limitRowCount; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterLimitRowCount(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitLimitRowCount(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitLimitRowCount(this);
else return visitor.visitChildren(this);
}
}
public final LimitRowCountContext limitRowCount() throws RecognitionException {
LimitRowCountContext _localctx = new LimitRowCountContext(_ctx, getState());
enterRule(_localctx, 32, RULE_limitRowCount);
try {
setState(1106);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ALL:
enterOuterAlt(_localctx, 1);
{
setState(1104);
match(ALL);
}
break;
case QUESTION_MARK:
case INTEGER_VALUE:
enterOuterAlt(_localctx, 2);
{
setState(1105);
rowCount();
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class RowCountContext extends ParserRuleContext {
public TerminalNode INTEGER_VALUE() { return getToken(SqlBaseParser.INTEGER_VALUE, 0); }
public TerminalNode QUESTION_MARK() { return getToken(SqlBaseParser.QUESTION_MARK, 0); }
public RowCountContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rowCount; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRowCount(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRowCount(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRowCount(this);
else return visitor.visitChildren(this);
}
}
public final RowCountContext rowCount() throws RecognitionException {
RowCountContext _localctx = new RowCountContext(_ctx, getState());
enterRule(_localctx, 34, RULE_rowCount);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1108);
_la = _input.LA(1);
if ( !(_la==QUESTION_MARK || _la==INTEGER_VALUE) ) {
_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;
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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 = 36;
enterRecursionRule(_localctx, 36, RULE_queryTerm, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
{
_localctx = new QueryTermDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1111);
queryPrimary();
}
_ctx.stop = _input.LT(-1);
setState(1127);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,127,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(1125);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,126,_ctx) ) {
case 1:
{
_localctx = new SetOperationContext(new QueryTermContext(_parentctx, _parentState));
((SetOperationContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_queryTerm);
setState(1113);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1114);
((SetOperationContext)_localctx).operator = match(INTERSECT);
setState(1116);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==DISTINCT) {
{
setState(1115);
setQuantifier();
}
}
setState(1118);
((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(1119);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
setState(1120);
((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(1122);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==DISTINCT) {
{
setState(1121);
setQuantifier();
}
}
setState(1124);
((SetOperationContext)_localctx).right = queryTerm(2);
}
break;
}
}
}
setState(1129);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,127,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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, 38, RULE_queryPrimary);
try {
int _alt;
setState(1146);
_errHandler.sync(this);
switch (_input.LA(1)) {
case SELECT:
_localctx = new QueryPrimaryDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1130);
querySpecification();
}
break;
case TABLE:
_localctx = new TableContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1131);
match(TABLE);
setState(1132);
qualifiedName();
}
break;
case VALUES:
_localctx = new InlineTableContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1133);
match(VALUES);
setState(1134);
expression();
setState(1139);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,128,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1135);
match(T__3);
setState(1136);
expression();
}
}
}
setState(1141);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,128,_ctx);
}
}
break;
case T__1:
_localctx = new SubqueryContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1142);
match(T__1);
setState(1143);
queryNoWith();
setState(1144);
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;
}
@SuppressWarnings("CheckReturnValue")
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, 40, RULE_sortItem);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1148);
expression();
setState(1150);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASC || _la==DESC) {
{
setState(1149);
((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(1154);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NULLS) {
{
setState(1152);
match(NULLS);
setState(1153);
((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;
}
@SuppressWarnings("CheckReturnValue")
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 TerminalNode WINDOW() { return getToken(SqlBaseParser.WINDOW, 0); }
public List windowDefinition() {
return getRuleContexts(WindowDefinitionContext.class);
}
public WindowDefinitionContext windowDefinition(int i) {
return getRuleContext(WindowDefinitionContext.class,i);
}
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, 42, RULE_querySpecification);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1156);
match(SELECT);
setState(1158);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,132,_ctx) ) {
case 1:
{
setState(1157);
setQuantifier();
}
break;
}
setState(1160);
selectItem();
setState(1165);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,133,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1161);
match(T__3);
setState(1162);
selectItem();
}
}
}
setState(1167);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,133,_ctx);
}
setState(1177);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,135,_ctx) ) {
case 1:
{
setState(1168);
match(FROM);
setState(1169);
relation(0);
setState(1174);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,134,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1170);
match(T__3);
setState(1171);
relation(0);
}
}
}
setState(1176);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,134,_ctx);
}
}
break;
}
setState(1181);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,136,_ctx) ) {
case 1:
{
setState(1179);
match(WHERE);
setState(1180);
((QuerySpecificationContext)_localctx).where = booleanExpression(0);
}
break;
}
setState(1186);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,137,_ctx) ) {
case 1:
{
setState(1183);
match(GROUP);
setState(1184);
match(BY);
setState(1185);
groupBy();
}
break;
}
setState(1190);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,138,_ctx) ) {
case 1:
{
setState(1188);
match(HAVING);
setState(1189);
((QuerySpecificationContext)_localctx).having = booleanExpression(0);
}
break;
}
setState(1201);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,140,_ctx) ) {
case 1:
{
setState(1192);
match(WINDOW);
setState(1193);
windowDefinition();
setState(1198);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,139,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1194);
match(T__3);
setState(1195);
windowDefinition();
}
}
}
setState(1200);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,139,_ctx);
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 44, RULE_groupBy);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1204);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,141,_ctx) ) {
case 1:
{
setState(1203);
setQuantifier();
}
break;
}
setState(1206);
groupingElement();
setState(1211);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,142,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1207);
match(T__3);
setState(1208);
groupingElement();
}
}
}
setState(1213);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,142,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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, 46, RULE_groupingElement);
int _la;
try {
setState(1254);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,148,_ctx) ) {
case 1:
_localctx = new SingleGroupingSetContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1214);
groupingSet();
}
break;
case 2:
_localctx = new RollupContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1215);
match(ROLLUP);
setState(1216);
match(T__1);
setState(1225);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -152137268172423164L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -2983936075159463059L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & -12455268256322561L) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & -4644371511117841L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 36012033738405751L) != 0)) {
{
setState(1217);
expression();
setState(1222);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1218);
match(T__3);
setState(1219);
expression();
}
}
setState(1224);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1227);
match(T__2);
}
break;
case 3:
_localctx = new CubeContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1228);
match(CUBE);
setState(1229);
match(T__1);
setState(1238);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -152137268172423164L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -2983936075159463059L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & -12455268256322561L) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & -4644371511117841L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 36012033738405751L) != 0)) {
{
setState(1230);
expression();
setState(1235);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1231);
match(T__3);
setState(1232);
expression();
}
}
setState(1237);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1240);
match(T__2);
}
break;
case 4:
_localctx = new MultipleGroupingSetsContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1241);
match(GROUPING);
setState(1242);
match(SETS);
setState(1243);
match(T__1);
setState(1244);
groupingSet();
setState(1249);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1245);
match(T__3);
setState(1246);
groupingSet();
}
}
setState(1251);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1252);
match(T__2);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 48, RULE_groupingSet);
int _la;
try {
setState(1269);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,151,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1256);
match(T__1);
setState(1265);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -152137268172423164L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -2983936075159463059L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & -12455268256322561L) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & -4644371511117841L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 36012033738405751L) != 0)) {
{
setState(1257);
expression();
setState(1262);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1258);
match(T__3);
setState(1259);
expression();
}
}
setState(1264);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1267);
match(T__2);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1268);
expression();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class WindowDefinitionContext extends ParserRuleContext {
public IdentifierContext name;
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public WindowSpecificationContext windowSpecification() {
return getRuleContext(WindowSpecificationContext.class,0);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public WindowDefinitionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_windowDefinition; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterWindowDefinition(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitWindowDefinition(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitWindowDefinition(this);
else return visitor.visitChildren(this);
}
}
public final WindowDefinitionContext windowDefinition() throws RecognitionException {
WindowDefinitionContext _localctx = new WindowDefinitionContext(_ctx, getState());
enterRule(_localctx, 50, RULE_windowDefinition);
try {
enterOuterAlt(_localctx, 1);
{
setState(1271);
((WindowDefinitionContext)_localctx).name = identifier();
setState(1272);
match(AS);
setState(1273);
match(T__1);
setState(1274);
windowSpecification();
setState(1275);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class WindowSpecificationContext extends ParserRuleContext {
public IdentifierContext existingWindowName;
public ExpressionContext expression;
public List partition = new ArrayList();
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 IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public WindowSpecificationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_windowSpecification; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterWindowSpecification(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitWindowSpecification(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitWindowSpecification(this);
else return visitor.visitChildren(this);
}
}
public final WindowSpecificationContext windowSpecification() throws RecognitionException {
WindowSpecificationContext _localctx = new WindowSpecificationContext(_ctx, getState());
enterRule(_localctx, 52, RULE_windowSpecification);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1278);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,152,_ctx) ) {
case 1:
{
setState(1277);
((WindowSpecificationContext)_localctx).existingWindowName = identifier();
}
break;
}
setState(1290);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PARTITION) {
{
setState(1280);
match(PARTITION);
setState(1281);
match(BY);
setState(1282);
((WindowSpecificationContext)_localctx).expression = expression();
((WindowSpecificationContext)_localctx).partition.add(((WindowSpecificationContext)_localctx).expression);
setState(1287);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1283);
match(T__3);
setState(1284);
((WindowSpecificationContext)_localctx).expression = expression();
((WindowSpecificationContext)_localctx).partition.add(((WindowSpecificationContext)_localctx).expression);
}
}
setState(1289);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1302);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1292);
match(ORDER);
setState(1293);
match(BY);
setState(1294);
sortItem();
setState(1299);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1295);
match(T__3);
setState(1296);
sortItem();
}
}
setState(1301);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1305);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GROUPS || _la==MEASURES || _la==RANGE || _la==ROWS) {
{
setState(1304);
windowFrame();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 54, RULE_namedQuery);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1307);
((NamedQueryContext)_localctx).name = identifier();
setState(1309);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(1308);
columnAliases();
}
}
setState(1311);
match(AS);
setState(1312);
match(T__1);
setState(1313);
query();
setState(1314);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 56, RULE_setQuantifier);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1316);
_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;
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class SelectAllContext extends SelectItemContext {
public PrimaryExpressionContext primaryExpression() {
return getRuleContext(PrimaryExpressionContext.class,0);
}
public TerminalNode ASTERISK() { return getToken(SqlBaseParser.ASTERISK, 0); }
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public ColumnAliasesContext columnAliases() {
return getRuleContext(ColumnAliasesContext.class,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);
}
}
@SuppressWarnings("CheckReturnValue")
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, 58, RULE_selectItem);
int _la;
try {
setState(1333);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,162,_ctx) ) {
case 1:
_localctx = new SelectSingleContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1318);
expression();
setState(1323);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,160,_ctx) ) {
case 1:
{
setState(1320);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1319);
match(AS);
}
}
setState(1322);
identifier();
}
break;
}
}
break;
case 2:
_localctx = new SelectAllContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1325);
primaryExpression(0);
setState(1326);
match(T__0);
setState(1327);
match(ASTERISK);
setState(1330);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,161,_ctx) ) {
case 1:
{
setState(1328);
match(AS);
setState(1329);
columnAliases();
}
break;
}
}
break;
case 3:
_localctx = new SelectAllContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1332);
match(ASTERISK);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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 = 60;
enterRecursionRule(_localctx, 60, RULE_relation, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
{
_localctx = new RelationDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1336);
sampledRelation();
}
_ctx.stop = _input.LT(-1);
setState(1356);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,164,_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(1338);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1352);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CROSS:
{
setState(1339);
match(CROSS);
setState(1340);
match(JOIN);
setState(1341);
((JoinRelationContext)_localctx).right = sampledRelation();
}
break;
case FULL:
case INNER:
case JOIN:
case LEFT:
case RIGHT:
{
setState(1342);
joinType();
setState(1343);
match(JOIN);
setState(1344);
((JoinRelationContext)_localctx).rightRelation = relation(0);
setState(1345);
joinCriteria();
}
break;
case NATURAL:
{
setState(1347);
match(NATURAL);
setState(1348);
joinType();
setState(1349);
match(JOIN);
setState(1350);
((JoinRelationContext)_localctx).right = sampledRelation();
}
break;
default:
throw new NoViableAltException(this);
}
}
}
}
setState(1358);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,164,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 62, RULE_joinType);
int _la;
try {
setState(1374);
_errHandler.sync(this);
switch (_input.LA(1)) {
case INNER:
case JOIN:
enterOuterAlt(_localctx, 1);
{
setState(1360);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==INNER) {
{
setState(1359);
match(INNER);
}
}
}
break;
case LEFT:
enterOuterAlt(_localctx, 2);
{
setState(1362);
match(LEFT);
setState(1364);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(1363);
match(OUTER);
}
}
}
break;
case RIGHT:
enterOuterAlt(_localctx, 3);
{
setState(1366);
match(RIGHT);
setState(1368);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(1367);
match(OUTER);
}
}
}
break;
case FULL:
enterOuterAlt(_localctx, 4);
{
setState(1370);
match(FULL);
setState(1372);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(1371);
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;
}
@SuppressWarnings("CheckReturnValue")
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, 64, RULE_joinCriteria);
int _la;
try {
setState(1390);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ON:
enterOuterAlt(_localctx, 1);
{
setState(1376);
match(ON);
setState(1377);
booleanExpression(0);
}
break;
case USING:
enterOuterAlt(_localctx, 2);
{
setState(1378);
match(USING);
setState(1379);
match(T__1);
setState(1380);
identifier();
setState(1385);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1381);
match(T__3);
setState(1382);
identifier();
}
}
setState(1387);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1388);
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;
}
@SuppressWarnings("CheckReturnValue")
public static class SampledRelationContext extends ParserRuleContext {
public ExpressionContext percentage;
public PatternRecognitionContext patternRecognition() {
return getRuleContext(PatternRecognitionContext.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, 66, RULE_sampledRelation);
try {
enterOuterAlt(_localctx, 1);
{
setState(1392);
patternRecognition();
setState(1399);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,172,_ctx) ) {
case 1:
{
setState(1393);
match(TABLESAMPLE);
setState(1394);
sampleType();
setState(1395);
match(T__1);
setState(1396);
((SampledRelationContext)_localctx).percentage = expression();
setState(1397);
match(T__2);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 68, RULE_sampleType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1401);
_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;
}
@SuppressWarnings("CheckReturnValue")
public static class TrimsSpecificationContext extends ParserRuleContext {
public TerminalNode LEADING() { return getToken(SqlBaseParser.LEADING, 0); }
public TerminalNode TRAILING() { return getToken(SqlBaseParser.TRAILING, 0); }
public TerminalNode BOTH() { return getToken(SqlBaseParser.BOTH, 0); }
public TrimsSpecificationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_trimsSpecification; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTrimsSpecification(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTrimsSpecification(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTrimsSpecification(this);
else return visitor.visitChildren(this);
}
}
public final TrimsSpecificationContext trimsSpecification() throws RecognitionException {
TrimsSpecificationContext _localctx = new TrimsSpecificationContext(_ctx, getState());
enterRule(_localctx, 70, RULE_trimsSpecification);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1403);
_la = _input.LA(1);
if ( !(_la==BOTH || _la==LEADING || _la==TRAILING) ) {
_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;
}
@SuppressWarnings("CheckReturnValue")
public static class ListAggOverflowBehaviorContext extends ParserRuleContext {
public TerminalNode ERROR() { return getToken(SqlBaseParser.ERROR, 0); }
public TerminalNode TRUNCATE() { return getToken(SqlBaseParser.TRUNCATE, 0); }
public ListaggCountIndicationContext listaggCountIndication() {
return getRuleContext(ListaggCountIndicationContext.class,0);
}
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public ListAggOverflowBehaviorContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_listAggOverflowBehavior; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterListAggOverflowBehavior(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitListAggOverflowBehavior(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitListAggOverflowBehavior(this);
else return visitor.visitChildren(this);
}
}
public final ListAggOverflowBehaviorContext listAggOverflowBehavior() throws RecognitionException {
ListAggOverflowBehaviorContext _localctx = new ListAggOverflowBehaviorContext(_ctx, getState());
enterRule(_localctx, 72, RULE_listAggOverflowBehavior);
int _la;
try {
setState(1411);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ERROR:
enterOuterAlt(_localctx, 1);
{
setState(1405);
match(ERROR);
}
break;
case TRUNCATE:
enterOuterAlt(_localctx, 2);
{
setState(1406);
match(TRUNCATE);
setState(1408);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==STRING || _la==UNICODE_STRING) {
{
setState(1407);
string();
}
}
setState(1410);
listaggCountIndication();
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class ListaggCountIndicationContext extends ParserRuleContext {
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public TerminalNode COUNT() { return getToken(SqlBaseParser.COUNT, 0); }
public TerminalNode WITHOUT() { return getToken(SqlBaseParser.WITHOUT, 0); }
public ListaggCountIndicationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_listaggCountIndication; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterListaggCountIndication(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitListaggCountIndication(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitListaggCountIndication(this);
else return visitor.visitChildren(this);
}
}
public final ListaggCountIndicationContext listaggCountIndication() throws RecognitionException {
ListaggCountIndicationContext _localctx = new ListaggCountIndicationContext(_ctx, getState());
enterRule(_localctx, 74, RULE_listaggCountIndication);
try {
setState(1417);
_errHandler.sync(this);
switch (_input.LA(1)) {
case WITH:
enterOuterAlt(_localctx, 1);
{
setState(1413);
match(WITH);
setState(1414);
match(COUNT);
}
break;
case WITHOUT:
enterOuterAlt(_localctx, 2);
{
setState(1415);
match(WITHOUT);
setState(1416);
match(COUNT);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class PatternRecognitionContext extends ParserRuleContext {
public ExpressionContext expression;
public List partition = new ArrayList();
public AliasedRelationContext aliasedRelation() {
return getRuleContext(AliasedRelationContext.class,0);
}
public TerminalNode MATCH_RECOGNIZE() { return getToken(SqlBaseParser.MATCH_RECOGNIZE, 0); }
public TerminalNode PATTERN() { return getToken(SqlBaseParser.PATTERN, 0); }
public RowPatternContext rowPattern() {
return getRuleContext(RowPatternContext.class,0);
}
public TerminalNode DEFINE() { return getToken(SqlBaseParser.DEFINE, 0); }
public List variableDefinition() {
return getRuleContexts(VariableDefinitionContext.class);
}
public VariableDefinitionContext variableDefinition(int i) {
return getRuleContext(VariableDefinitionContext.class,i);
}
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 TerminalNode MEASURES() { return getToken(SqlBaseParser.MEASURES, 0); }
public List measureDefinition() {
return getRuleContexts(MeasureDefinitionContext.class);
}
public MeasureDefinitionContext measureDefinition(int i) {
return getRuleContext(MeasureDefinitionContext.class,i);
}
public RowsPerMatchContext rowsPerMatch() {
return getRuleContext(RowsPerMatchContext.class,0);
}
public TerminalNode AFTER() { return getToken(SqlBaseParser.AFTER, 0); }
public TerminalNode MATCH() { return getToken(SqlBaseParser.MATCH, 0); }
public SkipToContext skipTo() {
return getRuleContext(SkipToContext.class,0);
}
public TerminalNode SUBSET() { return getToken(SqlBaseParser.SUBSET, 0); }
public List subsetDefinition() {
return getRuleContexts(SubsetDefinitionContext.class);
}
public SubsetDefinitionContext subsetDefinition(int i) {
return getRuleContext(SubsetDefinitionContext.class,i);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public TerminalNode INITIAL() { return getToken(SqlBaseParser.INITIAL, 0); }
public TerminalNode SEEK() { return getToken(SqlBaseParser.SEEK, 0); }
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public ColumnAliasesContext columnAliases() {
return getRuleContext(ColumnAliasesContext.class,0);
}
public PatternRecognitionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_patternRecognition; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterPatternRecognition(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitPatternRecognition(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitPatternRecognition(this);
else return visitor.visitChildren(this);
}
}
public final PatternRecognitionContext patternRecognition() throws RecognitionException {
PatternRecognitionContext _localctx = new PatternRecognitionContext(_ctx, getState());
enterRule(_localctx, 76, RULE_patternRecognition);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1419);
aliasedRelation();
setState(1502);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,191,_ctx) ) {
case 1:
{
setState(1420);
match(MATCH_RECOGNIZE);
setState(1421);
match(T__1);
setState(1432);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PARTITION) {
{
setState(1422);
match(PARTITION);
setState(1423);
match(BY);
setState(1424);
((PatternRecognitionContext)_localctx).expression = expression();
((PatternRecognitionContext)_localctx).partition.add(((PatternRecognitionContext)_localctx).expression);
setState(1429);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1425);
match(T__3);
setState(1426);
((PatternRecognitionContext)_localctx).expression = expression();
((PatternRecognitionContext)_localctx).partition.add(((PatternRecognitionContext)_localctx).expression);
}
}
setState(1431);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1444);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1434);
match(ORDER);
setState(1435);
match(BY);
setState(1436);
sortItem();
setState(1441);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1437);
match(T__3);
setState(1438);
sortItem();
}
}
setState(1443);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1455);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==MEASURES) {
{
setState(1446);
match(MEASURES);
setState(1447);
measureDefinition();
setState(1452);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1448);
match(T__3);
setState(1449);
measureDefinition();
}
}
setState(1454);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1458);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==ONE) {
{
setState(1457);
rowsPerMatch();
}
}
setState(1463);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AFTER) {
{
setState(1460);
match(AFTER);
setState(1461);
match(MATCH);
setState(1462);
skipTo();
}
}
setState(1466);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==INITIAL || _la==SEEK) {
{
setState(1465);
_la = _input.LA(1);
if ( !(_la==INITIAL || _la==SEEK) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(1468);
match(PATTERN);
setState(1469);
match(T__1);
setState(1470);
rowPattern(0);
setState(1471);
match(T__2);
setState(1481);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SUBSET) {
{
setState(1472);
match(SUBSET);
setState(1473);
subsetDefinition();
setState(1478);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1474);
match(T__3);
setState(1475);
subsetDefinition();
}
}
setState(1480);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1483);
match(DEFINE);
setState(1484);
variableDefinition();
setState(1489);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1485);
match(T__3);
setState(1486);
variableDefinition();
}
}
setState(1491);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1492);
match(T__2);
setState(1500);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,190,_ctx) ) {
case 1:
{
setState(1494);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1493);
match(AS);
}
}
setState(1496);
identifier();
setState(1498);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,189,_ctx) ) {
case 1:
{
setState(1497);
columnAliases();
}
break;
}
}
break;
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class MeasureDefinitionContext extends ParserRuleContext {
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public MeasureDefinitionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_measureDefinition; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterMeasureDefinition(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitMeasureDefinition(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitMeasureDefinition(this);
else return visitor.visitChildren(this);
}
}
public final MeasureDefinitionContext measureDefinition() throws RecognitionException {
MeasureDefinitionContext _localctx = new MeasureDefinitionContext(_ctx, getState());
enterRule(_localctx, 78, RULE_measureDefinition);
try {
enterOuterAlt(_localctx, 1);
{
setState(1504);
expression();
setState(1505);
match(AS);
setState(1506);
identifier();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class RowsPerMatchContext extends ParserRuleContext {
public TerminalNode ONE() { return getToken(SqlBaseParser.ONE, 0); }
public TerminalNode ROW() { return getToken(SqlBaseParser.ROW, 0); }
public TerminalNode PER() { return getToken(SqlBaseParser.PER, 0); }
public TerminalNode MATCH() { return getToken(SqlBaseParser.MATCH, 0); }
public TerminalNode ALL() { return getToken(SqlBaseParser.ALL, 0); }
public TerminalNode ROWS() { return getToken(SqlBaseParser.ROWS, 0); }
public EmptyMatchHandlingContext emptyMatchHandling() {
return getRuleContext(EmptyMatchHandlingContext.class,0);
}
public RowsPerMatchContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rowsPerMatch; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRowsPerMatch(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRowsPerMatch(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRowsPerMatch(this);
else return visitor.visitChildren(this);
}
}
public final RowsPerMatchContext rowsPerMatch() throws RecognitionException {
RowsPerMatchContext _localctx = new RowsPerMatchContext(_ctx, getState());
enterRule(_localctx, 80, RULE_rowsPerMatch);
int _la;
try {
setState(1519);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ONE:
enterOuterAlt(_localctx, 1);
{
setState(1508);
match(ONE);
setState(1509);
match(ROW);
setState(1510);
match(PER);
setState(1511);
match(MATCH);
}
break;
case ALL:
enterOuterAlt(_localctx, 2);
{
setState(1512);
match(ALL);
setState(1513);
match(ROWS);
setState(1514);
match(PER);
setState(1515);
match(MATCH);
setState(1517);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OMIT || _la==SHOW || _la==WITH) {
{
setState(1516);
emptyMatchHandling();
}
}
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class EmptyMatchHandlingContext extends ParserRuleContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode EMPTY() { return getToken(SqlBaseParser.EMPTY, 0); }
public TerminalNode MATCHES() { return getToken(SqlBaseParser.MATCHES, 0); }
public TerminalNode OMIT() { return getToken(SqlBaseParser.OMIT, 0); }
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public TerminalNode UNMATCHED() { return getToken(SqlBaseParser.UNMATCHED, 0); }
public TerminalNode ROWS() { return getToken(SqlBaseParser.ROWS, 0); }
public EmptyMatchHandlingContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_emptyMatchHandling; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterEmptyMatchHandling(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitEmptyMatchHandling(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitEmptyMatchHandling(this);
else return visitor.visitChildren(this);
}
}
public final EmptyMatchHandlingContext emptyMatchHandling() throws RecognitionException {
EmptyMatchHandlingContext _localctx = new EmptyMatchHandlingContext(_ctx, getState());
enterRule(_localctx, 82, RULE_emptyMatchHandling);
try {
setState(1530);
_errHandler.sync(this);
switch (_input.LA(1)) {
case SHOW:
enterOuterAlt(_localctx, 1);
{
setState(1521);
match(SHOW);
setState(1522);
match(EMPTY);
setState(1523);
match(MATCHES);
}
break;
case OMIT:
enterOuterAlt(_localctx, 2);
{
setState(1524);
match(OMIT);
setState(1525);
match(EMPTY);
setState(1526);
match(MATCHES);
}
break;
case WITH:
enterOuterAlt(_localctx, 3);
{
setState(1527);
match(WITH);
setState(1528);
match(UNMATCHED);
setState(1529);
match(ROWS);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class SkipToContext extends ParserRuleContext {
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public TerminalNode NEXT() { return getToken(SqlBaseParser.NEXT, 0); }
public TerminalNode ROW() { return getToken(SqlBaseParser.ROW, 0); }
public TerminalNode PAST() { return getToken(SqlBaseParser.PAST, 0); }
public TerminalNode LAST() { return getToken(SqlBaseParser.LAST, 0); }
public TerminalNode FIRST() { return getToken(SqlBaseParser.FIRST, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public SkipToContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_skipTo; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSkipTo(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSkipTo(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSkipTo(this);
else return visitor.visitChildren(this);
}
}
public final SkipToContext skipTo() throws RecognitionException {
SkipToContext _localctx = new SkipToContext(_ctx, getState());
enterRule(_localctx, 84, RULE_skipTo);
try {
setState(1551);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,195,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1532);
match(T__4);
setState(1533);
match(TO);
setState(1534);
match(NEXT);
setState(1535);
match(ROW);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1536);
match(T__4);
setState(1537);
match(PAST);
setState(1538);
match(LAST);
setState(1539);
match(ROW);
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1540);
match(T__4);
setState(1541);
match(TO);
setState(1542);
match(FIRST);
setState(1543);
identifier();
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(1544);
match(T__4);
setState(1545);
match(TO);
setState(1546);
match(LAST);
setState(1547);
identifier();
}
break;
case 5:
enterOuterAlt(_localctx, 5);
{
setState(1548);
match(T__4);
setState(1549);
match(TO);
setState(1550);
identifier();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class SubsetDefinitionContext extends ParserRuleContext {
public IdentifierContext name;
public IdentifierContext identifier;
public List union = new ArrayList();
public TerminalNode EQ() { return getToken(SqlBaseParser.EQ, 0); }
public List identifier() {
return getRuleContexts(IdentifierContext.class);
}
public IdentifierContext identifier(int i) {
return getRuleContext(IdentifierContext.class,i);
}
public SubsetDefinitionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_subsetDefinition; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSubsetDefinition(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSubsetDefinition(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSubsetDefinition(this);
else return visitor.visitChildren(this);
}
}
public final SubsetDefinitionContext subsetDefinition() throws RecognitionException {
SubsetDefinitionContext _localctx = new SubsetDefinitionContext(_ctx, getState());
enterRule(_localctx, 86, RULE_subsetDefinition);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1553);
((SubsetDefinitionContext)_localctx).name = identifier();
setState(1554);
match(EQ);
setState(1555);
match(T__1);
setState(1556);
((SubsetDefinitionContext)_localctx).identifier = identifier();
((SubsetDefinitionContext)_localctx).union.add(((SubsetDefinitionContext)_localctx).identifier);
setState(1561);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1557);
match(T__3);
setState(1558);
((SubsetDefinitionContext)_localctx).identifier = identifier();
((SubsetDefinitionContext)_localctx).union.add(((SubsetDefinitionContext)_localctx).identifier);
}
}
setState(1563);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1564);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class VariableDefinitionContext extends ParserRuleContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public VariableDefinitionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_variableDefinition; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterVariableDefinition(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitVariableDefinition(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitVariableDefinition(this);
else return visitor.visitChildren(this);
}
}
public final VariableDefinitionContext variableDefinition() throws RecognitionException {
VariableDefinitionContext _localctx = new VariableDefinitionContext(_ctx, getState());
enterRule(_localctx, 88, RULE_variableDefinition);
try {
enterOuterAlt(_localctx, 1);
{
setState(1566);
identifier();
setState(1567);
match(AS);
setState(1568);
expression();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 90, RULE_aliasedRelation);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1570);
relationPrimary();
setState(1578);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,199,_ctx) ) {
case 1:
{
setState(1572);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1571);
match(AS);
}
}
setState(1574);
identifier();
setState(1576);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,198,_ctx) ) {
case 1:
{
setState(1575);
columnAliases();
}
break;
}
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 92, RULE_columnAliases);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1580);
match(T__1);
setState(1581);
identifier();
setState(1586);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1582);
match(T__3);
setState(1583);
identifier();
}
}
setState(1588);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1589);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class TableFunctionInvocationContext extends RelationPrimaryContext {
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TableFunctionCallContext tableFunctionCall() {
return getRuleContext(TableFunctionCallContext.class,0);
}
public TableFunctionInvocationContext(RelationPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTableFunctionInvocation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTableFunctionInvocation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTableFunctionInvocation(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class TableNameContext extends RelationPrimaryContext {
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public QueryPeriodContext queryPeriod() {
return getRuleContext(QueryPeriodContext.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, 94, RULE_relationPrimary);
int _la;
try {
setState(1628);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,204,_ctx) ) {
case 1:
_localctx = new TableNameContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1591);
qualifiedName();
setState(1593);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,201,_ctx) ) {
case 1:
{
setState(1592);
queryPeriod();
}
break;
}
}
break;
case 2:
_localctx = new SubqueryRelationContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1595);
match(T__1);
setState(1596);
query();
setState(1597);
match(T__2);
}
break;
case 3:
_localctx = new UnnestContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1599);
match(UNNEST);
setState(1600);
match(T__1);
setState(1601);
expression();
setState(1606);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1602);
match(T__3);
setState(1603);
expression();
}
}
setState(1608);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1609);
match(T__2);
setState(1612);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,203,_ctx) ) {
case 1:
{
setState(1610);
match(WITH);
setState(1611);
match(ORDINALITY);
}
break;
}
}
break;
case 4:
_localctx = new LateralContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1614);
match(LATERAL);
setState(1615);
match(T__1);
setState(1616);
query();
setState(1617);
match(T__2);
}
break;
case 5:
_localctx = new TableFunctionInvocationContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(1619);
match(TABLE);
setState(1620);
match(T__1);
setState(1621);
tableFunctionCall();
setState(1622);
match(T__2);
}
break;
case 6:
_localctx = new ParenthesizedRelationContext(_localctx);
enterOuterAlt(_localctx, 6);
{
setState(1624);
match(T__1);
setState(1625);
relation(0);
setState(1626);
match(T__2);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TableFunctionCallContext extends ParserRuleContext {
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public List tableFunctionArgument() {
return getRuleContexts(TableFunctionArgumentContext.class);
}
public TableFunctionArgumentContext tableFunctionArgument(int i) {
return getRuleContext(TableFunctionArgumentContext.class,i);
}
public TerminalNode COPARTITION() { return getToken(SqlBaseParser.COPARTITION, 0); }
public List copartitionTables() {
return getRuleContexts(CopartitionTablesContext.class);
}
public CopartitionTablesContext copartitionTables(int i) {
return getRuleContext(CopartitionTablesContext.class,i);
}
public TableFunctionCallContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_tableFunctionCall; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTableFunctionCall(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTableFunctionCall(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTableFunctionCall(this);
else return visitor.visitChildren(this);
}
}
public final TableFunctionCallContext tableFunctionCall() throws RecognitionException {
TableFunctionCallContext _localctx = new TableFunctionCallContext(_ctx, getState());
enterRule(_localctx, 96, RULE_tableFunctionCall);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1630);
qualifiedName();
setState(1631);
match(T__1);
setState(1640);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,206,_ctx) ) {
case 1:
{
setState(1632);
tableFunctionArgument();
setState(1637);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1633);
match(T__3);
setState(1634);
tableFunctionArgument();
}
}
setState(1639);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
}
setState(1651);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COPARTITION) {
{
setState(1642);
match(COPARTITION);
setState(1643);
copartitionTables();
setState(1648);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1644);
match(T__3);
setState(1645);
copartitionTables();
}
}
setState(1650);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1653);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TableFunctionArgumentContext extends ParserRuleContext {
public TableArgumentContext tableArgument() {
return getRuleContext(TableArgumentContext.class,0);
}
public DescriptorArgumentContext descriptorArgument() {
return getRuleContext(DescriptorArgumentContext.class,0);
}
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TableFunctionArgumentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_tableFunctionArgument; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTableFunctionArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTableFunctionArgument(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTableFunctionArgument(this);
else return visitor.visitChildren(this);
}
}
public final TableFunctionArgumentContext tableFunctionArgument() throws RecognitionException {
TableFunctionArgumentContext _localctx = new TableFunctionArgumentContext(_ctx, getState());
enterRule(_localctx, 98, RULE_tableFunctionArgument);
try {
enterOuterAlt(_localctx, 1);
{
setState(1658);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,209,_ctx) ) {
case 1:
{
setState(1655);
identifier();
setState(1656);
match(T__5);
}
break;
}
setState(1663);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,210,_ctx) ) {
case 1:
{
setState(1660);
tableArgument();
}
break;
case 2:
{
setState(1661);
descriptorArgument();
}
break;
case 3:
{
setState(1662);
expression();
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TableArgumentContext extends ParserRuleContext {
public TableArgumentRelationContext tableArgumentRelation() {
return getRuleContext(TableArgumentRelationContext.class,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 PRUNE() { return getToken(SqlBaseParser.PRUNE, 0); }
public TerminalNode WHEN() { return getToken(SqlBaseParser.WHEN, 0); }
public TerminalNode EMPTY() { return getToken(SqlBaseParser.EMPTY, 0); }
public TerminalNode KEEP() { return getToken(SqlBaseParser.KEEP, 0); }
public TerminalNode ORDER() { return getToken(SqlBaseParser.ORDER, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
public ExpressionContext expression(int i) {
return getRuleContext(ExpressionContext.class,i);
}
public List sortItem() {
return getRuleContexts(SortItemContext.class);
}
public SortItemContext sortItem(int i) {
return getRuleContext(SortItemContext.class,i);
}
public TableArgumentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_tableArgument; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTableArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTableArgument(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTableArgument(this);
else return visitor.visitChildren(this);
}
}
public final TableArgumentContext tableArgument() throws RecognitionException {
TableArgumentContext _localctx = new TableArgumentContext(_ctx, getState());
enterRule(_localctx, 100, RULE_tableArgument);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1665);
tableArgumentRelation();
setState(1683);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PARTITION) {
{
setState(1666);
match(PARTITION);
setState(1667);
match(BY);
setState(1681);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,213,_ctx) ) {
case 1:
{
setState(1668);
match(T__1);
setState(1677);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -152137268172423164L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & -2983936075159463059L) != 0) || ((((_la - 128)) & ~0x3f) == 0 && ((1L << (_la - 128)) & -12455268256322561L) != 0) || ((((_la - 192)) & ~0x3f) == 0 && ((1L << (_la - 192)) & -4644371511117841L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 36012033738405751L) != 0)) {
{
setState(1669);
expression();
setState(1674);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1670);
match(T__3);
setState(1671);
expression();
}
}
setState(1676);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1679);
match(T__2);
}
break;
case 2:
{
setState(1680);
expression();
}
break;
}
}
}
setState(1691);
_errHandler.sync(this);
switch (_input.LA(1)) {
case PRUNE:
{
setState(1685);
match(PRUNE);
setState(1686);
match(WHEN);
setState(1687);
match(EMPTY);
}
break;
case KEEP:
{
setState(1688);
match(KEEP);
setState(1689);
match(WHEN);
setState(1690);
match(EMPTY);
}
break;
case T__2:
case T__3:
case COPARTITION:
case ORDER:
break;
default:
break;
}
setState(1709);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1693);
match(ORDER);
setState(1694);
match(BY);
setState(1707);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,217,_ctx) ) {
case 1:
{
setState(1695);
match(T__1);
setState(1696);
sortItem();
setState(1701);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1697);
match(T__3);
setState(1698);
sortItem();
}
}
setState(1703);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1704);
match(T__2);
}
break;
case 2:
{
setState(1706);
sortItem();
}
break;
}
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class TableArgumentRelationContext extends ParserRuleContext {
public TableArgumentRelationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_tableArgumentRelation; }
public TableArgumentRelationContext() { }
public void copyFrom(TableArgumentRelationContext ctx) {
super.copyFrom(ctx);
}
}
@SuppressWarnings("CheckReturnValue")
public static class TableArgumentQueryContext extends TableArgumentRelationContext {
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public QueryContext query() {
return getRuleContext(QueryContext.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 TableArgumentQueryContext(TableArgumentRelationContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTableArgumentQuery(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTableArgumentQuery(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTableArgumentQuery(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class TableArgumentTableContext extends TableArgumentRelationContext {
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.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 TableArgumentTableContext(TableArgumentRelationContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterTableArgumentTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitTableArgumentTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitTableArgumentTable(this);
else return visitor.visitChildren(this);
}
}
public final TableArgumentRelationContext tableArgumentRelation() throws RecognitionException {
TableArgumentRelationContext _localctx = new TableArgumentRelationContext(_ctx, getState());
enterRule(_localctx, 102, RULE_tableArgumentRelation);
int _la;
try {
setState(1737);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,225,_ctx) ) {
case 1:
_localctx = new TableArgumentTableContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1711);
match(TABLE);
setState(1712);
match(T__1);
setState(1713);
qualifiedName();
setState(1714);
match(T__2);
setState(1722);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,221,_ctx) ) {
case 1:
{
setState(1716);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1715);
match(AS);
}
}
setState(1718);
identifier();
setState(1720);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(1719);
columnAliases();
}
}
}
break;
}
}
break;
case 2:
_localctx = new TableArgumentQueryContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1724);
match(TABLE);
setState(1725);
match(T__1);
setState(1726);
query();
setState(1727);
match(T__2);
setState(1735);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,224,_ctx) ) {
case 1:
{
setState(1729);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1728);
match(AS);
}
}
setState(1731);
identifier();
setState(1733);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(1732);
columnAliases();
}
}
}
break;
}
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class DescriptorArgumentContext extends ParserRuleContext {
public TerminalNode DESCRIPTOR() { return getToken(SqlBaseParser.DESCRIPTOR, 0); }
public List descriptorField() {
return getRuleContexts(DescriptorFieldContext.class);
}
public DescriptorFieldContext descriptorField(int i) {
return getRuleContext(DescriptorFieldContext.class,i);
}
public TerminalNode CAST() { return getToken(SqlBaseParser.CAST, 0); }
public TerminalNode NULL() { return getToken(SqlBaseParser.NULL, 0); }
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public DescriptorArgumentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_descriptorArgument; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDescriptorArgument(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDescriptorArgument(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDescriptorArgument(this);
else return visitor.visitChildren(this);
}
}
public final DescriptorArgumentContext descriptorArgument() throws RecognitionException {
DescriptorArgumentContext _localctx = new DescriptorArgumentContext(_ctx, getState());
enterRule(_localctx, 104, RULE_descriptorArgument);
int _la;
try {
setState(1757);
_errHandler.sync(this);
switch (_input.LA(1)) {
case DESCRIPTOR:
enterOuterAlt(_localctx, 1);
{
setState(1739);
match(DESCRIPTOR);
setState(1740);
match(T__1);
setState(1741);
descriptorField();
setState(1746);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1742);
match(T__3);
setState(1743);
descriptorField();
}
}
setState(1748);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1749);
match(T__2);
}
break;
case CAST:
enterOuterAlt(_localctx, 2);
{
setState(1751);
match(CAST);
setState(1752);
match(T__1);
setState(1753);
match(NULL);
setState(1754);
match(AS);
setState(1755);
match(DESCRIPTOR);
setState(1756);
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;
}
@SuppressWarnings("CheckReturnValue")
public static class DescriptorFieldContext extends ParserRuleContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public DescriptorFieldContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_descriptorField; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDescriptorField(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDescriptorField(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDescriptorField(this);
else return visitor.visitChildren(this);
}
}
public final DescriptorFieldContext descriptorField() throws RecognitionException {
DescriptorFieldContext _localctx = new DescriptorFieldContext(_ctx, getState());
enterRule(_localctx, 106, RULE_descriptorField);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1759);
identifier();
setState(1761);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -4601694524648194048L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & 6239431563539749741L) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & -778514395575617L) != 0) || ((((_la - 197)) & ~0x3f) == 0 && ((1L << (_la - 197)) & 8592722952413183935L) != 0) || ((((_la - 261)) & ~0x3f) == 0 && ((1L << (_la - 261)) & 2111062592315255L) != 0)) {
{
setState(1760);
type(0);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class CopartitionTablesContext extends ParserRuleContext {
public List qualifiedName() {
return getRuleContexts(QualifiedNameContext.class);
}
public QualifiedNameContext qualifiedName(int i) {
return getRuleContext(QualifiedNameContext.class,i);
}
public CopartitionTablesContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_copartitionTables; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCopartitionTables(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCopartitionTables(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCopartitionTables(this);
else return visitor.visitChildren(this);
}
}
public final CopartitionTablesContext copartitionTables() throws RecognitionException {
CopartitionTablesContext _localctx = new CopartitionTablesContext(_ctx, getState());
enterRule(_localctx, 108, RULE_copartitionTables);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1763);
match(T__1);
setState(1764);
qualifiedName();
setState(1765);
match(T__3);
setState(1766);
qualifiedName();
setState(1771);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1767);
match(T__3);
setState(1768);
qualifiedName();
}
}
setState(1773);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1774);
match(T__2);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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, 110, RULE_expression);
try {
enterOuterAlt(_localctx, 1);
{
setState(1776);
booleanExpression(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class OrContext extends BooleanExpressionContext {
public List booleanExpression() {
return getRuleContexts(BooleanExpressionContext.class);
}
public BooleanExpressionContext booleanExpression(int i) {
return getRuleContext(BooleanExpressionContext.class,i);
}
public TerminalNode OR() { return getToken(SqlBaseParser.OR, 0); }
public OrContext(BooleanExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterOr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitOr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitOr(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class AndContext extends BooleanExpressionContext {
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 AndContext(BooleanExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterAnd(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitAnd(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitAnd(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 = 112;
enterRecursionRule(_localctx, 112, RULE_booleanExpression, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1785);
_errHandler.sync(this);
switch (_input.LA(1)) {
case T__1:
case ABSENT:
case ADD:
case ADMIN:
case AFTER:
case ALL:
case ANALYZE:
case ANY:
case ARRAY:
case ASC:
case AT:
case AUTHORIZATION:
case BERNOULLI:
case BOTH:
case CALL:
case CASCADE:
case CASE:
case CAST:
case CATALOGS:
case COLUMN:
case COLUMNS:
case COMMENT:
case COMMIT:
case COMMITTED:
case CONDITIONAL:
case COUNT:
case COPARTITION:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_PATH:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case DATA:
case DATE:
case DAY:
case DEFAULT:
case DEFINER:
case DENY:
case DESC:
case DESCRIPTOR:
case DEFINE:
case DISTRIBUTED:
case DOUBLE:
case EMPTY:
case ENCODING:
case ERROR:
case EXCLUDING:
case EXISTS:
case EXPLAIN:
case EXTRACT:
case FALSE:
case FETCH:
case FILTER:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTIONS:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case GROUPING:
case GROUPS:
case HOUR:
case IF:
case IGNORE:
case INCLUDING:
case INITIAL:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case JSON:
case JSON_ARRAY:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_QUERY:
case JSON_VALUE:
case KEEP:
case KEY:
case KEYS:
case LAST:
case LATERAL:
case LEADING:
case LEVEL:
case LIMIT:
case LISTAGG:
case LOCAL:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOGICAL:
case MAP:
case MATCH:
case MATCHED:
case MATCHES:
case MATCH_RECOGNIZE:
case MATERIALIZED:
case MEASURES:
case MERGE:
case MINUTE:
case MONTH:
case NEXT:
case NFC:
case NFD:
case NFKC:
case NFKD:
case NO:
case NONE:
case NORMALIZE:
case NULL:
case NULLIF:
case NULLS:
case OBJECT:
case OFFSET:
case OMIT:
case OF:
case ONE:
case ONLY:
case OPTION:
case ORDINALITY:
case OUTPUT:
case OVER:
case OVERFLOW:
case PARTITION:
case PARTITIONS:
case PASSING:
case PAST:
case PATH:
case PATTERN:
case PER:
case PERMUTE:
case POSITION:
case PRECEDING:
case PRECISION:
case PRIVILEGES:
case PROPERTIES:
case PRUNE:
case QUOTES:
case RANGE:
case READ:
case REFRESH:
case RENAME:
case REPEATABLE:
case REPLACE:
case RESET:
case RESPECT:
case RESTRICT:
case RETURNING:
case REVOKE:
case ROLE:
case ROLES:
case ROLLBACK:
case ROW:
case ROWS:
case RUNNING:
case SCALAR:
case SCHEMA:
case SCHEMAS:
case SECOND:
case SECURITY:
case SEEK:
case SERIALIZABLE:
case SESSION:
case SET:
case SETS:
case SHOW:
case SOME:
case START:
case STATS:
case SUBSET:
case SUBSTRING:
case SYSTEM:
case TABLES:
case TABLESAMPLE:
case TEXT:
case TEXT_STRING:
case TIES:
case TIME:
case TIMESTAMP:
case TO:
case TRAILING:
case TRANSACTION:
case TRIM:
case TRUE:
case TRUNCATE:
case TRY_CAST:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNIQUE:
case UNKNOWN:
case UNMATCHED:
case UPDATE:
case USE:
case USER:
case UTF16:
case UTF32:
case UTF8:
case VALIDATE:
case VALUE:
case VERBOSE:
case VERSION:
case VIEW:
case WINDOW:
case WITHIN:
case WITHOUT:
case WORK:
case WRAPPER:
case WRITE:
case YEAR:
case ZONE:
case PLUS:
case MINUS:
case QUESTION_MARK:
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:
{
_localctx = new PredicatedContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1779);
((PredicatedContext)_localctx).valueExpression = valueExpression(0);
setState(1781);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,230,_ctx) ) {
case 1:
{
setState(1780);
predicate(((PredicatedContext)_localctx).valueExpression);
}
break;
}
}
break;
case NOT:
{
_localctx = new LogicalNotContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1783);
match(NOT);
setState(1784);
booleanExpression(3);
}
break;
default:
throw new NoViableAltException(this);
}
_ctx.stop = _input.LT(-1);
setState(1795);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,233,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(1793);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,232,_ctx) ) {
case 1:
{
_localctx = new AndContext(new BooleanExpressionContext(_parentctx, _parentState));
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
setState(1787);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1788);
match(AND);
setState(1789);
booleanExpression(3);
}
break;
case 2:
{
_localctx = new OrContext(new BooleanExpressionContext(_parentctx, _parentState));
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
setState(1790);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
setState(1791);
match(OR);
setState(1792);
booleanExpression(2);
}
break;
}
}
}
setState(1797);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,233,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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;
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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, 114, RULE_predicate);
int _la;
try {
setState(1859);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,242,_ctx) ) {
case 1:
_localctx = new ComparisonContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1798);
comparisonOperator();
setState(1799);
((ComparisonContext)_localctx).right = valueExpression(0);
}
break;
case 2:
_localctx = new QuantifiedComparisonContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1801);
comparisonOperator();
setState(1802);
comparisonQuantifier();
setState(1803);
match(T__1);
setState(1804);
query();
setState(1805);
match(T__2);
}
break;
case 3:
_localctx = new BetweenContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1808);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1807);
match(NOT);
}
}
setState(1810);
match(BETWEEN);
setState(1811);
((BetweenContext)_localctx).lower = valueExpression(0);
setState(1812);
match(AND);
setState(1813);
((BetweenContext)_localctx).upper = valueExpression(0);
}
break;
case 4:
_localctx = new InListContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1816);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1815);
match(NOT);
}
}
setState(1818);
match(IN);
setState(1819);
match(T__1);
setState(1820);
expression();
setState(1825);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1821);
match(T__3);
setState(1822);
expression();
}
}
setState(1827);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1828);
match(T__2);
}
break;
case 5:
_localctx = new InSubqueryContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(1831);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1830);
match(NOT);
}
}
setState(1833);
match(IN);
setState(1834);
match(T__1);
setState(1835);
query();
setState(1836);
match(T__2);
}
break;
case 6:
_localctx = new LikeContext(_localctx);
enterOuterAlt(_localctx, 6);
{
setState(1839);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1838);
match(NOT);
}
}
setState(1841);
match(LIKE);
setState(1842);
((LikeContext)_localctx).pattern = valueExpression(0);
setState(1845);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,239,_ctx) ) {
case 1:
{
setState(1843);
match(ESCAPE);
setState(1844);
((LikeContext)_localctx).escape = valueExpression(0);
}
break;
}
}
break;
case 7:
_localctx = new NullPredicateContext(_localctx);
enterOuterAlt(_localctx, 7);
{
setState(1847);
match(IS);
setState(1849);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1848);
match(NOT);
}
}
setState(1851);
match(NULL);
}
break;
case 8:
_localctx = new DistinctFromContext(_localctx);
enterOuterAlt(_localctx, 8);
{
setState(1852);
match(IS);
setState(1854);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1853);
match(NOT);
}
}
setState(1856);
match(DISTINCT);
setState(1857);
match(FROM);
setState(1858);
((DistinctFromContext)_localctx).right = valueExpression(0);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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 = 116;
enterRecursionRule(_localctx, 116, RULE_valueExpression, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1865);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,243,_ctx) ) {
case 1:
{
_localctx = new ValueExpressionDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1862);
primaryExpression(0);
}
break;
case 2:
{
_localctx = new ArithmeticUnaryContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1863);
((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(1864);
valueExpression(4);
}
break;
}
_ctx.stop = _input.LT(-1);
setState(1881);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,245,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(1879);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,244,_ctx) ) {
case 1:
{
_localctx = new ArithmeticBinaryContext(new ValueExpressionContext(_parentctx, _parentState));
((ArithmeticBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
setState(1867);
if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)");
setState(1868);
((ArithmeticBinaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(((((_la - 297)) & ~0x3f) == 0 && ((1L << (_la - 297)) & 7L) != 0)) ) {
((ArithmeticBinaryContext)_localctx).operator = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1869);
((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(1870);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1871);
((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(1872);
((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(1873);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
setState(1874);
match(CONCAT);
setState(1875);
((ConcatenationContext)_localctx).right = valueExpression(2);
}
break;
case 4:
{
_localctx = new AtTimeZoneContext(new ValueExpressionContext(_parentctx, _parentState));
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
setState(1876);
if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)");
setState(1877);
match(AT);
setState(1878);
timeZoneSpecifier();
}
break;
}
}
}
setState(1883);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,245,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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);
}
}
@SuppressWarnings("CheckReturnValue")
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() { return getToken(SqlBaseParser.DOUBLE, 0); }
public TerminalNode PRECISION() { return getToken(SqlBaseParser.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);
}
}
@SuppressWarnings("CheckReturnValue")
public static class JsonValueContext extends PrimaryExpressionContext {
public JsonValueBehaviorContext emptyBehavior;
public JsonValueBehaviorContext errorBehavior;
public TerminalNode JSON_VALUE() { return getToken(SqlBaseParser.JSON_VALUE, 0); }
public JsonPathInvocationContext jsonPathInvocation() {
return getRuleContext(JsonPathInvocationContext.class,0);
}
public TerminalNode RETURNING() { return getToken(SqlBaseParser.RETURNING, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public List