io.trino.grammar.sql.SqlBaseParser Maven / Gradle / Ivy
The newest version!
// Generated from io/trino/grammar/sql/SqlBase.g4 by ANTLR 4.13.2
package io.trino.grammar.sql;
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, BEGIN=32, BERNOULLI=33,
BETWEEN=34, BOTH=35, BY=36, CALL=37, CALLED=38, CASCADE=39, CASE=40, CAST=41,
CATALOG=42, CATALOGS=43, COLUMN=44, COLUMNS=45, COMMENT=46, COMMIT=47,
COMMITTED=48, CONDITIONAL=49, CONSTRAINT=50, COUNT=51, COPARTITION=52,
CREATE=53, CROSS=54, CUBE=55, CURRENT=56, CURRENT_CATALOG=57, CURRENT_DATE=58,
CURRENT_PATH=59, CURRENT_ROLE=60, CURRENT_SCHEMA=61, CURRENT_TIME=62,
CURRENT_TIMESTAMP=63, CURRENT_USER=64, DATA=65, DATE=66, DAY=67, DEALLOCATE=68,
DECLARE=69, DEFAULT=70, DEFINE=71, DEFINER=72, DELETE=73, DENY=74, DESC=75,
DESCRIBE=76, DESCRIPTOR=77, DETERMINISTIC=78, DISTINCT=79, DISTRIBUTED=80,
DO=81, DOUBLE=82, DROP=83, ELSE=84, EMPTY=85, ELSEIF=86, ENCODING=87,
END=88, ERROR=89, ESCAPE=90, EXCEPT=91, EXCLUDING=92, EXECUTE=93, EXISTS=94,
EXPLAIN=95, EXTRACT=96, FALSE=97, FETCH=98, FILTER=99, FINAL=100, FIRST=101,
FOLLOWING=102, FOR=103, FORMAT=104, FROM=105, FULL=106, FUNCTION=107,
FUNCTIONS=108, GRACE=109, GRANT=110, GRANTED=111, GRANTS=112, GRAPHVIZ=113,
GROUP=114, GROUPING=115, GROUPS=116, HAVING=117, HOUR=118, IF=119, IGNORE=120,
IMMEDIATE=121, IN=122, INCLUDING=123, INITIAL=124, INNER=125, INPUT=126,
INSERT=127, INTERSECT=128, INTERVAL=129, INTO=130, INVOKER=131, IO=132,
IS=133, ISOLATION=134, ITERATE=135, JOIN=136, JSON=137, JSON_ARRAY=138,
JSON_EXISTS=139, JSON_OBJECT=140, JSON_QUERY=141, JSON_TABLE=142, JSON_VALUE=143,
KEEP=144, KEY=145, KEYS=146, LANGUAGE=147, LAST=148, LATERAL=149, LEADING=150,
LEAVE=151, LEFT=152, LEVEL=153, LIKE=154, LIMIT=155, LISTAGG=156, LOCAL=157,
LOCALTIME=158, LOCALTIMESTAMP=159, LOGICAL=160, LOOP=161, MAP=162, MATCH=163,
MATCHED=164, MATCHES=165, MATCH_RECOGNIZE=166, MATERIALIZED=167, MEASURES=168,
MERGE=169, MINUTE=170, MONTH=171, NATURAL=172, NESTED=173, NEXT=174, NFC=175,
NFD=176, NFKC=177, NFKD=178, NO=179, NONE=180, NORMALIZE=181, NOT=182,
NULL=183, NULLIF=184, NULLS=185, OBJECT=186, OF=187, OFFSET=188, OMIT=189,
ON=190, ONE=191, ONLY=192, OPTION=193, OR=194, ORDER=195, ORDINALITY=196,
OUTER=197, OUTPUT=198, OVER=199, OVERFLOW=200, PARTITION=201, PARTITIONS=202,
PASSING=203, PAST=204, PATH=205, PATTERN=206, PER=207, PERIOD=208, PERMUTE=209,
PLAN=210, POSITION=211, PRECEDING=212, PRECISION=213, PREPARE=214, PRIVILEGES=215,
PROPERTIES=216, PRUNE=217, QUOTES=218, RANGE=219, READ=220, RECURSIVE=221,
REFRESH=222, RENAME=223, REPEAT=224, REPEATABLE=225, REPLACE=226, RESET=227,
RESPECT=228, RESTRICT=229, RETURN=230, RETURNING=231, RETURNS=232, REVOKE=233,
RIGHT=234, ROLE=235, ROLES=236, ROLLBACK=237, ROLLUP=238, ROW=239, ROWS=240,
RUNNING=241, SCALAR=242, SCHEMA=243, SCHEMAS=244, SECOND=245, SECURITY=246,
SEEK=247, SELECT=248, SERIALIZABLE=249, SESSION=250, SET=251, SETS=252,
SHOW=253, SOME=254, START=255, STATS=256, SUBSET=257, SUBSTRING=258, SYSTEM=259,
TABLE=260, TABLES=261, TABLESAMPLE=262, TEXT=263, TEXT_STRING=264, THEN=265,
TIES=266, TIME=267, TIMESTAMP=268, TO=269, TRAILING=270, TRANSACTION=271,
TRIM=272, TRUE=273, TRUNCATE=274, TRY_CAST=275, TYPE=276, UESCAPE=277,
UNBOUNDED=278, UNCOMMITTED=279, UNCONDITIONAL=280, UNION=281, UNIQUE=282,
UNKNOWN=283, UNMATCHED=284, UNNEST=285, UNTIL=286, UPDATE=287, USE=288,
USER=289, USING=290, UTF16=291, UTF32=292, UTF8=293, VALIDATE=294, VALUE=295,
VALUES=296, VERBOSE=297, VERSION=298, VIEW=299, WHEN=300, WHERE=301, WHILE=302,
WINDOW=303, WITH=304, WITHIN=305, WITHOUT=306, WORK=307, WRAPPER=308,
WRITE=309, YEAR=310, ZONE=311, EQ=312, NEQ=313, LT=314, LTE=315, GT=316,
GTE=317, PLUS=318, MINUS=319, ASTERISK=320, SLASH=321, PERCENT=322, CONCAT=323,
QUESTION_MARK=324, SEMICOLON=325, STRING=326, UNICODE_STRING=327, BINARY_LITERAL=328,
INTEGER_VALUE=329, DECIMAL_VALUE=330, DOUBLE_VALUE=331, IDENTIFIER=332,
DIGIT_IDENTIFIER=333, QUOTED_IDENTIFIER=334, BACKQUOTED_IDENTIFIER=335,
SIMPLE_COMMENT=336, BRACKETED_COMMENT=337, WS=338, UNRECOGNIZED=339, DELIMITER=340;
public static final int
RULE_singleStatement = 0, RULE_standaloneExpression = 1, RULE_standalonePathSpecification = 2,
RULE_standaloneType = 3, RULE_standaloneRowPattern = 4, RULE_standaloneFunctionSpecification = 5,
RULE_statement = 6, RULE_rootQuery = 7, RULE_withFunction = 8, RULE_query = 9,
RULE_with = 10, RULE_tableElement = 11, RULE_columnDefinition = 12, RULE_likeClause = 13,
RULE_properties = 14, RULE_propertyAssignments = 15, RULE_property = 16,
RULE_propertyValue = 17, RULE_queryNoWith = 18, RULE_limitRowCount = 19,
RULE_rowCount = 20, RULE_queryTerm = 21, RULE_queryPrimary = 22, RULE_sortItem = 23,
RULE_querySpecification = 24, RULE_groupBy = 25, RULE_groupingElement = 26,
RULE_groupingSet = 27, RULE_windowDefinition = 28, RULE_windowSpecification = 29,
RULE_namedQuery = 30, RULE_setQuantifier = 31, RULE_selectItem = 32, RULE_relation = 33,
RULE_joinType = 34, RULE_joinCriteria = 35, RULE_sampledRelation = 36,
RULE_sampleType = 37, RULE_trimsSpecification = 38, RULE_listAggOverflowBehavior = 39,
RULE_listaggCountIndication = 40, RULE_patternRecognition = 41, RULE_measureDefinition = 42,
RULE_rowsPerMatch = 43, RULE_emptyMatchHandling = 44, RULE_skipTo = 45,
RULE_subsetDefinition = 46, RULE_variableDefinition = 47, RULE_aliasedRelation = 48,
RULE_columnAliases = 49, RULE_relationPrimary = 50, RULE_jsonTableColumn = 51,
RULE_jsonTableSpecificPlan = 52, RULE_jsonTablePathName = 53, RULE_planPrimary = 54,
RULE_jsonTableDefaultPlan = 55, RULE_tableFunctionCall = 56, RULE_tableFunctionArgument = 57,
RULE_tableArgument = 58, RULE_tableArgumentRelation = 59, RULE_descriptorArgument = 60,
RULE_descriptorField = 61, RULE_copartitionTables = 62, RULE_expression = 63,
RULE_booleanExpression = 64, RULE_predicate = 65, RULE_valueExpression = 66,
RULE_primaryExpression = 67, RULE_jsonPathInvocation = 68, RULE_jsonValueExpression = 69,
RULE_jsonRepresentation = 70, RULE_jsonArgument = 71, RULE_jsonExistsErrorBehavior = 72,
RULE_jsonValueBehavior = 73, RULE_jsonQueryWrapperBehavior = 74, RULE_jsonQueryBehavior = 75,
RULE_jsonObjectMember = 76, RULE_processingMode = 77, RULE_nullTreatment = 78,
RULE_string = 79, RULE_timeZoneSpecifier = 80, RULE_comparisonOperator = 81,
RULE_comparisonQuantifier = 82, RULE_booleanValue = 83, RULE_interval = 84,
RULE_intervalField = 85, RULE_normalForm = 86, RULE_type = 87, RULE_rowField = 88,
RULE_typeParameter = 89, RULE_whenClause = 90, RULE_filter = 91, RULE_mergeCase = 92,
RULE_over = 93, RULE_windowFrame = 94, RULE_frameExtent = 95, RULE_frameBound = 96,
RULE_rowPattern = 97, RULE_patternPrimary = 98, RULE_patternQuantifier = 99,
RULE_updateAssignment = 100, RULE_explainOption = 101, RULE_transactionMode = 102,
RULE_levelOfIsolation = 103, RULE_callArgument = 104, RULE_pathElement = 105,
RULE_pathSpecification = 106, RULE_functionSpecification = 107, RULE_functionDeclaration = 108,
RULE_parameterDeclaration = 109, RULE_returnsClause = 110, RULE_routineCharacteristic = 111,
RULE_controlStatement = 112, RULE_caseStatementWhenClause = 113, RULE_elseIfClause = 114,
RULE_elseClause = 115, RULE_variableDeclaration = 116, RULE_sqlStatementList = 117,
RULE_privilege = 118, RULE_entityKind = 119, RULE_grantObject = 120, RULE_qualifiedName = 121,
RULE_queryPeriod = 122, RULE_rangeType = 123, RULE_grantor = 124, RULE_principal = 125,
RULE_roles = 126, RULE_privilegeOrRole = 127, RULE_identifier = 128, RULE_number = 129,
RULE_authorizationUser = 130, RULE_nonReserved = 131;
private static String[] makeRuleNames() {
return new String[] {
"singleStatement", "standaloneExpression", "standalonePathSpecification",
"standaloneType", "standaloneRowPattern", "standaloneFunctionSpecification",
"statement", "rootQuery", "withFunction", "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", "jsonTableColumn", "jsonTableSpecificPlan", "jsonTablePathName",
"planPrimary", "jsonTableDefaultPlan", "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", "functionSpecification", "functionDeclaration",
"parameterDeclaration", "returnsClause", "routineCharacteristic", "controlStatement",
"caseStatementWhenClause", "elseIfClause", "elseClause", "variableDeclaration",
"sqlStatementList", "privilege", "entityKind", "grantObject", "qualifiedName",
"queryPeriod", "rangeType", "grantor", "principal", "roles", "privilegeOrRole",
"identifier", "number", "authorizationUser", "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'", "'BEGIN'",
"'BERNOULLI'", "'BETWEEN'", "'BOTH'", "'BY'", "'CALL'", "'CALLED'", "'CASCADE'",
"'CASE'", "'CAST'", "'CATALOG'", "'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'", "'DECLARE'", "'DEFAULT'",
"'DEFINE'", "'DEFINER'", "'DELETE'", "'DENY'", "'DESC'", "'DESCRIBE'",
"'DESCRIPTOR'", "'DETERMINISTIC'", "'DISTINCT'", "'DISTRIBUTED'", "'DO'",
"'DOUBLE'", "'DROP'", "'ELSE'", "'EMPTY'", "'ELSEIF'", "'ENCODING'",
"'END'", "'ERROR'", "'ESCAPE'", "'EXCEPT'", "'EXCLUDING'", "'EXECUTE'",
"'EXISTS'", "'EXPLAIN'", "'EXTRACT'", "'FALSE'", "'FETCH'", "'FILTER'",
"'FINAL'", "'FIRST'", "'FOLLOWING'", "'FOR'", "'FORMAT'", "'FROM'", "'FULL'",
"'FUNCTION'", "'FUNCTIONS'", "'GRACE'", "'GRANT'", "'GRANTED'", "'GRANTS'",
"'GRAPHVIZ'", "'GROUP'", "'GROUPING'", "'GROUPS'", "'HAVING'", "'HOUR'",
"'IF'", "'IGNORE'", "'IMMEDIATE'", "'IN'", "'INCLUDING'", "'INITIAL'",
"'INNER'", "'INPUT'", "'INSERT'", "'INTERSECT'", "'INTERVAL'", "'INTO'",
"'INVOKER'", "'IO'", "'IS'", "'ISOLATION'", "'ITERATE'", "'JOIN'", "'JSON'",
"'JSON_ARRAY'", "'JSON_EXISTS'", "'JSON_OBJECT'", "'JSON_QUERY'", "'JSON_TABLE'",
"'JSON_VALUE'", "'KEEP'", "'KEY'", "'KEYS'", "'LANGUAGE'", "'LAST'",
"'LATERAL'", "'LEADING'", "'LEAVE'", "'LEFT'", "'LEVEL'", "'LIKE'", "'LIMIT'",
"'LISTAGG'", "'LOCAL'", "'LOCALTIME'", "'LOCALTIMESTAMP'", "'LOGICAL'",
"'LOOP'", "'MAP'", "'MATCH'", "'MATCHED'", "'MATCHES'", "'MATCH_RECOGNIZE'",
"'MATERIALIZED'", "'MEASURES'", "'MERGE'", "'MINUTE'", "'MONTH'", "'NATURAL'",
"'NESTED'", "'NEXT'", "'NFC'", "'NFD'", "'NFKC'", "'NFKD'", "'NO'", "'NONE'",
"'NORMALIZE'", "'NOT'", "'NULL'", "'NULLIF'", "'NULLS'", "'OBJECT'",
"'OF'", "'OFFSET'", "'OMIT'", "'ON'", "'ONE'", "'ONLY'", "'OPTION'",
"'OR'", "'ORDER'", "'ORDINALITY'", "'OUTER'", "'OUTPUT'", "'OVER'", "'OVERFLOW'",
"'PARTITION'", "'PARTITIONS'", "'PASSING'", "'PAST'", "'PATH'", "'PATTERN'",
"'PER'", "'PERIOD'", "'PERMUTE'", "'PLAN'", "'POSITION'", "'PRECEDING'",
"'PRECISION'", "'PREPARE'", "'PRIVILEGES'", "'PROPERTIES'", "'PRUNE'",
"'QUOTES'", "'RANGE'", "'READ'", "'RECURSIVE'", "'REFRESH'", "'RENAME'",
"'REPEAT'", "'REPEATABLE'", "'REPLACE'", "'RESET'", "'RESPECT'", "'RESTRICT'",
"'RETURN'", "'RETURNING'", "'RETURNS'", "'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'", "'UNTIL'", "'UPDATE'", "'USE'",
"'USER'", "'USING'", "'UTF16'", "'UTF32'", "'UTF8'", "'VALIDATE'", "'VALUE'",
"'VALUES'", "'VERBOSE'", "'VERSION'", "'VIEW'", "'WHEN'", "'WHERE'",
"'WHILE'", "'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", "BEGIN", "BERNOULLI", "BETWEEN", "BOTH", "BY", "CALL",
"CALLED", "CASCADE", "CASE", "CAST", "CATALOG", "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",
"DECLARE", "DEFAULT", "DEFINE", "DEFINER", "DELETE", "DENY", "DESC",
"DESCRIBE", "DESCRIPTOR", "DETERMINISTIC", "DISTINCT", "DISTRIBUTED",
"DO", "DOUBLE", "DROP", "ELSE", "EMPTY", "ELSEIF", "ENCODING", "END",
"ERROR", "ESCAPE", "EXCEPT", "EXCLUDING", "EXECUTE", "EXISTS", "EXPLAIN",
"EXTRACT", "FALSE", "FETCH", "FILTER", "FINAL", "FIRST", "FOLLOWING",
"FOR", "FORMAT", "FROM", "FULL", "FUNCTION", "FUNCTIONS", "GRACE", "GRANT",
"GRANTED", "GRANTS", "GRAPHVIZ", "GROUP", "GROUPING", "GROUPS", "HAVING",
"HOUR", "IF", "IGNORE", "IMMEDIATE", "IN", "INCLUDING", "INITIAL", "INNER",
"INPUT", "INSERT", "INTERSECT", "INTERVAL", "INTO", "INVOKER", "IO",
"IS", "ISOLATION", "ITERATE", "JOIN", "JSON", "JSON_ARRAY", "JSON_EXISTS",
"JSON_OBJECT", "JSON_QUERY", "JSON_TABLE", "JSON_VALUE", "KEEP", "KEY",
"KEYS", "LANGUAGE", "LAST", "LATERAL", "LEADING", "LEAVE", "LEFT", "LEVEL",
"LIKE", "LIMIT", "LISTAGG", "LOCAL", "LOCALTIME", "LOCALTIMESTAMP", "LOGICAL",
"LOOP", "MAP", "MATCH", "MATCHED", "MATCHES", "MATCH_RECOGNIZE", "MATERIALIZED",
"MEASURES", "MERGE", "MINUTE", "MONTH", "NATURAL", "NESTED", "NEXT",
"NFC", "NFD", "NFKC", "NFKD", "NO", "NONE", "NORMALIZE", "NOT", "NULL",
"NULLIF", "NULLS", "OBJECT", "OF", "OFFSET", "OMIT", "ON", "ONE", "ONLY",
"OPTION", "OR", "ORDER", "ORDINALITY", "OUTER", "OUTPUT", "OVER", "OVERFLOW",
"PARTITION", "PARTITIONS", "PASSING", "PAST", "PATH", "PATTERN", "PER",
"PERIOD", "PERMUTE", "PLAN", "POSITION", "PRECEDING", "PRECISION", "PREPARE",
"PRIVILEGES", "PROPERTIES", "PRUNE", "QUOTES", "RANGE", "READ", "RECURSIVE",
"REFRESH", "RENAME", "REPEAT", "REPEATABLE", "REPLACE", "RESET", "RESPECT",
"RESTRICT", "RETURN", "RETURNING", "RETURNS", "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",
"UNTIL", "UPDATE", "USE", "USER", "USING", "UTF16", "UTF32", "UTF8",
"VALIDATE", "VALUE", "VALUES", "VERBOSE", "VERSION", "VIEW", "WHEN",
"WHERE", "WHILE", "WINDOW", "WITH", "WITHIN", "WITHOUT", "WORK", "WRAPPER",
"WRITE", "YEAR", "ZONE", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "PLUS",
"MINUS", "ASTERISK", "SLASH", "PERCENT", "CONCAT", "QUESTION_MARK", "SEMICOLON",
"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(264);
statement();
setState(265);
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(267);
expression();
setState(268);
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(270);
pathSpecification();
setState(271);
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(273);
type(0);
setState(274);
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(276);
rowPattern(0);
setState(277);
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 StandaloneFunctionSpecificationContext extends ParserRuleContext {
public FunctionSpecificationContext functionSpecification() {
return getRuleContext(FunctionSpecificationContext.class,0);
}
public TerminalNode EOF() { return getToken(SqlBaseParser.EOF, 0); }
public StandaloneFunctionSpecificationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_standaloneFunctionSpecification; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterStandaloneFunctionSpecification(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitStandaloneFunctionSpecification(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitStandaloneFunctionSpecification(this);
else return visitor.visitChildren(this);
}
}
public final StandaloneFunctionSpecificationContext standaloneFunctionSpecification() throws RecognitionException {
StandaloneFunctionSpecificationContext _localctx = new StandaloneFunctionSpecificationContext(_ctx, getState());
enterRule(_localctx, 10, RULE_standaloneFunctionSpecification);
try {
enterOuterAlt(_localctx, 1);
{
setState(279);
functionSpecification();
setState(280);
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 DropNotNullConstraintContext extends StatementContext {
public QualifiedNameContext tableName;
public IdentifierContext columnName;
public List ALTER() { return getTokens(SqlBaseParser.ALTER); }
public TerminalNode ALTER(int i) {
return getToken(SqlBaseParser.ALTER, i);
}
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode COLUMN() { return getToken(SqlBaseParser.COLUMN, 0); }
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode NOT() { return getToken(SqlBaseParser.NOT, 0); }
public TerminalNode NULL() { return getToken(SqlBaseParser.NULL, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public DropNotNullConstraintContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropNotNullConstraint(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropNotNullConstraint(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropNotNullConstraint(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 ShowCreateFunctionContext extends StatementContext {
public TerminalNode SHOW() { return getToken(SqlBaseParser.SHOW, 0); }
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode FUNCTION() { return getToken(SqlBaseParser.FUNCTION, 0); }
public QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public ShowCreateFunctionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterShowCreateFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitShowCreateFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitShowCreateFunction(this);
else return visitor.visitChildren(this);
}
}
@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 QualifiedNameContext 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 List qualifiedName() {
return getRuleContexts(QualifiedNameContext.class);
}
public QualifiedNameContext qualifiedName(int i) {
return getRuleContext(QualifiedNameContext.class,i);
}
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.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 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 List privilegeOrRole() {
return getRuleContexts(PrivilegeOrRoleContext.class);
}
public PrivilegeOrRoleContext privilegeOrRole(int i) {
return getRuleContext(PrivilegeOrRoleContext.class,i);
}
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 QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.class,0);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public TerminalNode IN() { return getToken(SqlBaseParser.IN, 0); }
public TerminalNode 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 GrantObjectContext grantObject() {
return getRuleContext(GrantObjectContext.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 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 RootQueryContext rootQuery() {
return getRuleContext(RootQueryContext.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 SetSessionAuthorizationContext extends StatementContext {
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode SESSION() { return getToken(SqlBaseParser.SESSION, 0); }
public TerminalNode AUTHORIZATION() { return getToken(SqlBaseParser.AUTHORIZATION, 0); }
public AuthorizationUserContext authorizationUser() {
return getRuleContext(AuthorizationUserContext.class,0);
}
public SetSessionAuthorizationContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetSessionAuthorization(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetSessionAuthorization(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetSessionAuthorization(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 IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
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 CreateFunctionContext extends StatementContext {
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public FunctionSpecificationContext functionSpecification() {
return getRuleContext(FunctionSpecificationContext.class,0);
}
public TerminalNode OR() { return getToken(SqlBaseParser.OR, 0); }
public TerminalNode REPLACE() { return getToken(SqlBaseParser.REPLACE, 0); }
public CreateFunctionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCreateFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCreateFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCreateFunction(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class DropCatalogContext extends StatementContext {
public IdentifierContext catalog;
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode CATALOG() { return getToken(SqlBaseParser.CATALOG, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.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 DropCatalogContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropCatalog(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropCatalog(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropCatalog(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 GrantObjectContext grantObject() {
return getRuleContext(GrantObjectContext.class,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 ResetSessionAuthorizationContext extends StatementContext {
public TerminalNode RESET() { return getToken(SqlBaseParser.RESET, 0); }
public TerminalNode SESSION() { return getToken(SqlBaseParser.SESSION, 0); }
public TerminalNode AUTHORIZATION() { return getToken(SqlBaseParser.AUTHORIZATION, 0); }
public ResetSessionAuthorizationContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterResetSessionAuthorization(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitResetSessionAuthorization(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitResetSessionAuthorization(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 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 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 GrantPrivilegesContext extends StatementContext {
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 GrantObjectContext grantObject() {
return getRuleContext(GrantObjectContext.class,0);
}
public TerminalNode TO() { return getToken(SqlBaseParser.TO, 0); }
public PrincipalContext principal() {
return getRuleContext(PrincipalContext.class,0);
}
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 List privilegeOrRole() {
return getRuleContexts(PrivilegeOrRoleContext.class);
}
public PrivilegeOrRoleContext privilegeOrRole(int i) {
return getRuleContext(PrivilegeOrRoleContext.class,i);
}
public GrantPrivilegesContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterGrantPrivileges(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitGrantPrivileges(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitGrantPrivileges(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 RootQueryContext rootQuery() {
return getRuleContext(RootQueryContext.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 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 RevokePrivilegesContext extends StatementContext {
public PrincipalContext grantee;
public TerminalNode REVOKE() { return getToken(SqlBaseParser.REVOKE, 0); }
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public GrantObjectContext grantObject() {
return getRuleContext(GrantObjectContext.class,0);
}
public TerminalNode FROM() { return getToken(SqlBaseParser.FROM, 0); }
public PrincipalContext principal() {
return getRuleContext(PrincipalContext.class,0);
}
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 List privilegeOrRole() {
return getRuleContexts(PrivilegeOrRoleContext.class);
}
public PrivilegeOrRoleContext privilegeOrRole(int i) {
return getRuleContext(PrivilegeOrRoleContext.class,i);
}
public RevokePrivilegesContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRevokePrivileges(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRevokePrivileges(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRevokePrivileges(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class DropFunctionContext extends StatementContext {
public TerminalNode DROP() { return getToken(SqlBaseParser.DROP, 0); }
public TerminalNode FUNCTION() { return getToken(SqlBaseParser.FUNCTION, 0); }
public FunctionDeclarationContext functionDeclaration() {
return getRuleContext(FunctionDeclarationContext.class,0);
}
public TerminalNode IF() { return getToken(SqlBaseParser.IF, 0); }
public TerminalNode EXISTS() { return getToken(SqlBaseParser.EXISTS, 0); }
public DropFunctionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterDropFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitDropFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitDropFunction(this);
else return visitor.visitChildren(this);
}
}
@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 RootQueryContext rootQuery() {
return getRuleContext(RootQueryContext.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 SetColumnTypeContext extends StatementContext {
public QualifiedNameContext tableName;
public QualifiedNameContext columnName;
public List ALTER() { return getTokens(SqlBaseParser.ALTER); }
public TerminalNode ALTER(int i) {
return getToken(SqlBaseParser.ALTER, i);
}
public TerminalNode TABLE() { return getToken(SqlBaseParser.TABLE, 0); }
public TerminalNode COLUMN() { return getToken(SqlBaseParser.COLUMN, 0); }
public TerminalNode SET() { return getToken(SqlBaseParser.SET, 0); }
public TerminalNode DATA() { return getToken(SqlBaseParser.DATA, 0); }
public TerminalNode TYPE() { return getToken(SqlBaseParser.TYPE, 0); }
public TypeContext type() {
return getRuleContext(TypeContext.class,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 SetColumnTypeContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterSetColumnType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitSetColumnType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitSetColumnType(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class StatementDefaultContext extends StatementContext {
public RootQueryContext rootQuery() {
return getRuleContext(RootQueryContext.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 RootQueryContext rootQuery() {
return getRuleContext(RootQueryContext.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 GRACE() { return getToken(SqlBaseParser.GRACE, 0); }
public TerminalNode PERIOD() { return getToken(SqlBaseParser.PERIOD, 0); }
public IntervalContext interval() {
return getRuleContext(IntervalContext.class,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 RootQueryContext rootQuery() {
return getRuleContext(RootQueryContext.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 WITH() { return getToken(SqlBaseParser.WITH, 0); }
public PropertiesContext properties() {
return getRuleContext(PropertiesContext.class,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 ExecuteImmediateContext extends StatementContext {
public TerminalNode EXECUTE() { return getToken(SqlBaseParser.EXECUTE, 0); }
public TerminalNode IMMEDIATE() { return getToken(SqlBaseParser.IMMEDIATE, 0); }
public StringContext string() {
return getRuleContext(StringContext.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 ExecuteImmediateContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterExecuteImmediate(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitExecuteImmediate(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitExecuteImmediate(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 List privilegeOrRole() {
return getRuleContexts(PrivilegeOrRoleContext.class);
}
public PrivilegeOrRoleContext privilegeOrRole(int i) {
return getRuleContext(PrivilegeOrRoleContext.class,i);
}
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 CreateCatalogContext extends StatementContext {
public IdentifierContext catalog;
public IdentifierContext connectorName;
public TerminalNode CREATE() { return getToken(SqlBaseParser.CREATE, 0); }
public TerminalNode CATALOG() { return getToken(SqlBaseParser.CATALOG, 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 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 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 CreateCatalogContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCreateCatalog(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCreateCatalog(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCreateCatalog(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 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 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 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, 12, RULE_statement);
int _la;
try {
setState(1179);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,120,_ctx) ) {
case 1:
_localctx = new StatementDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(282);
rootQuery();
}
break;
case 2:
_localctx = new UseContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(283);
match(USE);
setState(284);
((UseContext)_localctx).schema = identifier();
}
break;
case 3:
_localctx = new UseContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(285);
match(USE);
setState(286);
((UseContext)_localctx).catalog = identifier();
setState(287);
match(T__0);
setState(288);
((UseContext)_localctx).schema = identifier();
}
break;
case 4:
_localctx = new CreateCatalogContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(290);
match(CREATE);
setState(291);
match(CATALOG);
setState(295);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) {
case 1:
{
setState(292);
match(IF);
setState(293);
match(NOT);
setState(294);
match(EXISTS);
}
break;
}
setState(297);
((CreateCatalogContext)_localctx).catalog = identifier();
setState(298);
match(USING);
setState(299);
((CreateCatalogContext)_localctx).connectorName = identifier();
setState(302);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(300);
match(COMMENT);
setState(301);
string();
}
}
setState(306);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AUTHORIZATION) {
{
setState(304);
match(AUTHORIZATION);
setState(305);
principal();
}
}
setState(310);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(308);
match(WITH);
setState(309);
properties();
}
}
}
break;
case 5:
_localctx = new DropCatalogContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(312);
match(DROP);
setState(313);
match(CATALOG);
setState(316);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
case 1:
{
setState(314);
match(IF);
setState(315);
match(EXISTS);
}
break;
}
setState(318);
((DropCatalogContext)_localctx).catalog = identifier();
setState(320);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CASCADE || _la==RESTRICT) {
{
setState(319);
_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 CreateSchemaContext(_localctx);
enterOuterAlt(_localctx, 6);
{
setState(322);
match(CREATE);
setState(323);
match(SCHEMA);
setState(327);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) {
case 1:
{
setState(324);
match(IF);
setState(325);
match(NOT);
setState(326);
match(EXISTS);
}
break;
}
setState(329);
qualifiedName();
setState(332);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AUTHORIZATION) {
{
setState(330);
match(AUTHORIZATION);
setState(331);
principal();
}
}
setState(336);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(334);
match(WITH);
setState(335);
properties();
}
}
}
break;
case 7:
_localctx = new DropSchemaContext(_localctx);
enterOuterAlt(_localctx, 7);
{
setState(338);
match(DROP);
setState(339);
match(SCHEMA);
setState(342);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,9,_ctx) ) {
case 1:
{
setState(340);
match(IF);
setState(341);
match(EXISTS);
}
break;
}
setState(344);
qualifiedName();
setState(346);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CASCADE || _la==RESTRICT) {
{
setState(345);
_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 8:
_localctx = new RenameSchemaContext(_localctx);
enterOuterAlt(_localctx, 8);
{
setState(348);
match(ALTER);
setState(349);
match(SCHEMA);
setState(350);
qualifiedName();
setState(351);
match(RENAME);
setState(352);
match(TO);
setState(353);
identifier();
}
break;
case 9:
_localctx = new SetSchemaAuthorizationContext(_localctx);
enterOuterAlt(_localctx, 9);
{
setState(355);
match(ALTER);
setState(356);
match(SCHEMA);
setState(357);
qualifiedName();
setState(358);
match(SET);
setState(359);
match(AUTHORIZATION);
setState(360);
principal();
}
break;
case 10:
_localctx = new CreateTableAsSelectContext(_localctx);
enterOuterAlt(_localctx, 10);
{
setState(362);
match(CREATE);
setState(365);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OR) {
{
setState(363);
match(OR);
setState(364);
match(REPLACE);
}
}
setState(367);
match(TABLE);
setState(371);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) {
case 1:
{
setState(368);
match(IF);
setState(369);
match(NOT);
setState(370);
match(EXISTS);
}
break;
}
setState(373);
qualifiedName();
setState(375);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(374);
columnAliases();
}
}
setState(379);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(377);
match(COMMENT);
setState(378);
string();
}
}
setState(383);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(381);
match(WITH);
setState(382);
properties();
}
}
setState(385);
match(AS);
setState(391);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) {
case 1:
{
setState(386);
rootQuery();
}
break;
case 2:
{
setState(387);
match(T__1);
setState(388);
rootQuery();
setState(389);
match(T__2);
}
break;
}
setState(398);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(393);
match(WITH);
setState(395);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NO) {
{
setState(394);
match(NO);
}
}
setState(397);
match(DATA);
}
}
}
break;
case 11:
_localctx = new CreateTableContext(_localctx);
enterOuterAlt(_localctx, 11);
{
setState(400);
match(CREATE);
setState(403);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OR) {
{
setState(401);
match(OR);
setState(402);
match(REPLACE);
}
}
setState(405);
match(TABLE);
setState(409);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) {
case 1:
{
setState(406);
match(IF);
setState(407);
match(NOT);
setState(408);
match(EXISTS);
}
break;
}
setState(411);
qualifiedName();
setState(412);
match(T__1);
setState(413);
tableElement();
setState(418);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(414);
match(T__3);
setState(415);
tableElement();
}
}
setState(420);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(421);
match(T__2);
setState(424);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(422);
match(COMMENT);
setState(423);
string();
}
}
setState(428);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(426);
match(WITH);
setState(427);
properties();
}
}
}
break;
case 12:
_localctx = new DropTableContext(_localctx);
enterOuterAlt(_localctx, 12);
{
setState(430);
match(DROP);
setState(431);
match(TABLE);
setState(434);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
case 1:
{
setState(432);
match(IF);
setState(433);
match(EXISTS);
}
break;
}
setState(436);
qualifiedName();
}
break;
case 13:
_localctx = new InsertIntoContext(_localctx);
enterOuterAlt(_localctx, 13);
{
setState(437);
match(INSERT);
setState(438);
match(INTO);
setState(439);
qualifiedName();
setState(441);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) {
case 1:
{
setState(440);
columnAliases();
}
break;
}
setState(443);
rootQuery();
}
break;
case 14:
_localctx = new DeleteContext(_localctx);
enterOuterAlt(_localctx, 14);
{
setState(445);
match(DELETE);
setState(446);
match(FROM);
setState(447);
qualifiedName();
setState(450);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHERE) {
{
setState(448);
match(WHERE);
setState(449);
booleanExpression(0);
}
}
}
break;
case 15:
_localctx = new TruncateTableContext(_localctx);
enterOuterAlt(_localctx, 15);
{
setState(452);
match(TRUNCATE);
setState(453);
match(TABLE);
setState(454);
qualifiedName();
}
break;
case 16:
_localctx = new CommentTableContext(_localctx);
enterOuterAlt(_localctx, 16);
{
setState(455);
match(COMMENT);
setState(456);
match(ON);
setState(457);
match(TABLE);
setState(458);
qualifiedName();
setState(459);
match(IS);
setState(462);
_errHandler.sync(this);
switch (_input.LA(1)) {
case STRING:
case UNICODE_STRING:
{
setState(460);
string();
}
break;
case NULL:
{
setState(461);
match(NULL);
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
case 17:
_localctx = new CommentViewContext(_localctx);
enterOuterAlt(_localctx, 17);
{
setState(464);
match(COMMENT);
setState(465);
match(ON);
setState(466);
match(VIEW);
setState(467);
qualifiedName();
setState(468);
match(IS);
setState(471);
_errHandler.sync(this);
switch (_input.LA(1)) {
case STRING:
case UNICODE_STRING:
{
setState(469);
string();
}
break;
case NULL:
{
setState(470);
match(NULL);
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
case 18:
_localctx = new CommentColumnContext(_localctx);
enterOuterAlt(_localctx, 18);
{
setState(473);
match(COMMENT);
setState(474);
match(ON);
setState(475);
match(COLUMN);
setState(476);
qualifiedName();
setState(477);
match(IS);
setState(480);
_errHandler.sync(this);
switch (_input.LA(1)) {
case STRING:
case UNICODE_STRING:
{
setState(478);
string();
}
break;
case NULL:
{
setState(479);
match(NULL);
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
case 19:
_localctx = new RenameTableContext(_localctx);
enterOuterAlt(_localctx, 19);
{
setState(482);
match(ALTER);
setState(483);
match(TABLE);
setState(486);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,30,_ctx) ) {
case 1:
{
setState(484);
match(IF);
setState(485);
match(EXISTS);
}
break;
}
setState(488);
((RenameTableContext)_localctx).from = qualifiedName();
setState(489);
match(RENAME);
setState(490);
match(TO);
setState(491);
((RenameTableContext)_localctx).to = qualifiedName();
}
break;
case 20:
_localctx = new AddColumnContext(_localctx);
enterOuterAlt(_localctx, 20);
{
setState(493);
match(ALTER);
setState(494);
match(TABLE);
setState(497);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,31,_ctx) ) {
case 1:
{
setState(495);
match(IF);
setState(496);
match(EXISTS);
}
break;
}
setState(499);
((AddColumnContext)_localctx).tableName = qualifiedName();
setState(500);
match(ADD);
setState(501);
match(COLUMN);
setState(505);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,32,_ctx) ) {
case 1:
{
setState(502);
match(IF);
setState(503);
match(NOT);
setState(504);
match(EXISTS);
}
break;
}
setState(507);
((AddColumnContext)_localctx).column = columnDefinition();
}
break;
case 21:
_localctx = new RenameColumnContext(_localctx);
enterOuterAlt(_localctx, 21);
{
setState(509);
match(ALTER);
setState(510);
match(TABLE);
setState(513);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,33,_ctx) ) {
case 1:
{
setState(511);
match(IF);
setState(512);
match(EXISTS);
}
break;
}
setState(515);
((RenameColumnContext)_localctx).tableName = qualifiedName();
setState(516);
match(RENAME);
setState(517);
match(COLUMN);
setState(520);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) {
case 1:
{
setState(518);
match(IF);
setState(519);
match(EXISTS);
}
break;
}
setState(522);
((RenameColumnContext)_localctx).from = qualifiedName();
setState(523);
match(TO);
setState(524);
((RenameColumnContext)_localctx).to = identifier();
}
break;
case 22:
_localctx = new DropColumnContext(_localctx);
enterOuterAlt(_localctx, 22);
{
setState(526);
match(ALTER);
setState(527);
match(TABLE);
setState(530);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,35,_ctx) ) {
case 1:
{
setState(528);
match(IF);
setState(529);
match(EXISTS);
}
break;
}
setState(532);
((DropColumnContext)_localctx).tableName = qualifiedName();
setState(533);
match(DROP);
setState(534);
match(COLUMN);
setState(537);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) {
case 1:
{
setState(535);
match(IF);
setState(536);
match(EXISTS);
}
break;
}
setState(539);
((DropColumnContext)_localctx).column = qualifiedName();
}
break;
case 23:
_localctx = new SetColumnTypeContext(_localctx);
enterOuterAlt(_localctx, 23);
{
setState(541);
match(ALTER);
setState(542);
match(TABLE);
setState(545);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) {
case 1:
{
setState(543);
match(IF);
setState(544);
match(EXISTS);
}
break;
}
setState(547);
((SetColumnTypeContext)_localctx).tableName = qualifiedName();
setState(548);
match(ALTER);
setState(549);
match(COLUMN);
setState(550);
((SetColumnTypeContext)_localctx).columnName = qualifiedName();
setState(551);
match(SET);
setState(552);
match(DATA);
setState(553);
match(TYPE);
setState(554);
type(0);
}
break;
case 24:
_localctx = new DropNotNullConstraintContext(_localctx);
enterOuterAlt(_localctx, 24);
{
setState(556);
match(ALTER);
setState(557);
match(TABLE);
setState(560);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,38,_ctx) ) {
case 1:
{
setState(558);
match(IF);
setState(559);
match(EXISTS);
}
break;
}
setState(562);
((DropNotNullConstraintContext)_localctx).tableName = qualifiedName();
setState(563);
match(ALTER);
setState(564);
match(COLUMN);
setState(565);
((DropNotNullConstraintContext)_localctx).columnName = identifier();
setState(566);
match(DROP);
setState(567);
match(NOT);
setState(568);
match(NULL);
}
break;
case 25:
_localctx = new SetTableAuthorizationContext(_localctx);
enterOuterAlt(_localctx, 25);
{
setState(570);
match(ALTER);
setState(571);
match(TABLE);
setState(572);
((SetTableAuthorizationContext)_localctx).tableName = qualifiedName();
setState(573);
match(SET);
setState(574);
match(AUTHORIZATION);
setState(575);
principal();
}
break;
case 26:
_localctx = new SetTablePropertiesContext(_localctx);
enterOuterAlt(_localctx, 26);
{
setState(577);
match(ALTER);
setState(578);
match(TABLE);
setState(579);
((SetTablePropertiesContext)_localctx).tableName = qualifiedName();
setState(580);
match(SET);
setState(581);
match(PROPERTIES);
setState(582);
propertyAssignments();
}
break;
case 27:
_localctx = new TableExecuteContext(_localctx);
enterOuterAlt(_localctx, 27);
{
setState(584);
match(ALTER);
setState(585);
match(TABLE);
setState(586);
((TableExecuteContext)_localctx).tableName = qualifiedName();
setState(587);
match(EXECUTE);
setState(588);
((TableExecuteContext)_localctx).procedureName = identifier();
setState(601);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(589);
match(T__1);
setState(598);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -1217097885506863100L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & 6619158405282491887L) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & -2305851805348667539L) != 0) || ((((_la - 193)) & ~0x3f) == 0 && ((1L << (_la - 193)) & -36066180684840983L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 6953390140260613879L) != 0) || ((((_la - 324)) & ~0x3f) == 0 && ((1L << (_la - 324)) & 4093L) != 0)) {
{
setState(590);
callArgument();
setState(595);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(591);
match(T__3);
setState(592);
callArgument();
}
}
setState(597);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(600);
match(T__2);
}
}
setState(605);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHERE) {
{
setState(603);
match(WHERE);
setState(604);
((TableExecuteContext)_localctx).where = booleanExpression(0);
}
}
}
break;
case 28:
_localctx = new AnalyzeContext(_localctx);
enterOuterAlt(_localctx, 28);
{
setState(607);
match(ANALYZE);
setState(608);
qualifiedName();
setState(611);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(609);
match(WITH);
setState(610);
properties();
}
}
}
break;
case 29:
_localctx = new CreateMaterializedViewContext(_localctx);
enterOuterAlt(_localctx, 29);
{
setState(613);
match(CREATE);
setState(616);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OR) {
{
setState(614);
match(OR);
setState(615);
match(REPLACE);
}
}
setState(618);
match(MATERIALIZED);
setState(619);
match(VIEW);
setState(623);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,45,_ctx) ) {
case 1:
{
setState(620);
match(IF);
setState(621);
match(NOT);
setState(622);
match(EXISTS);
}
break;
}
setState(625);
qualifiedName();
setState(629);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GRACE) {
{
setState(626);
match(GRACE);
setState(627);
match(PERIOD);
setState(628);
interval();
}
}
setState(633);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(631);
match(COMMENT);
setState(632);
string();
}
}
setState(637);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(635);
match(WITH);
setState(636);
properties();
}
}
setState(639);
match(AS);
setState(640);
rootQuery();
}
break;
case 30:
_localctx = new CreateViewContext(_localctx);
enterOuterAlt(_localctx, 30);
{
setState(642);
match(CREATE);
setState(645);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OR) {
{
setState(643);
match(OR);
setState(644);
match(REPLACE);
}
}
setState(647);
match(VIEW);
setState(648);
qualifiedName();
setState(651);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(649);
match(COMMENT);
setState(650);
string();
}
}
setState(655);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SECURITY) {
{
setState(653);
match(SECURITY);
setState(654);
_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(659);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(657);
match(WITH);
setState(658);
properties();
}
}
setState(661);
match(AS);
setState(662);
rootQuery();
}
break;
case 31:
_localctx = new RefreshMaterializedViewContext(_localctx);
enterOuterAlt(_localctx, 31);
{
setState(664);
match(REFRESH);
setState(665);
match(MATERIALIZED);
setState(666);
match(VIEW);
setState(667);
qualifiedName();
}
break;
case 32:
_localctx = new DropMaterializedViewContext(_localctx);
enterOuterAlt(_localctx, 32);
{
setState(668);
match(DROP);
setState(669);
match(MATERIALIZED);
setState(670);
match(VIEW);
setState(673);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,53,_ctx) ) {
case 1:
{
setState(671);
match(IF);
setState(672);
match(EXISTS);
}
break;
}
setState(675);
qualifiedName();
}
break;
case 33:
_localctx = new RenameMaterializedViewContext(_localctx);
enterOuterAlt(_localctx, 33);
{
setState(676);
match(ALTER);
setState(677);
match(MATERIALIZED);
setState(678);
match(VIEW);
setState(681);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,54,_ctx) ) {
case 1:
{
setState(679);
match(IF);
setState(680);
match(EXISTS);
}
break;
}
setState(683);
((RenameMaterializedViewContext)_localctx).from = qualifiedName();
setState(684);
match(RENAME);
setState(685);
match(TO);
setState(686);
((RenameMaterializedViewContext)_localctx).to = qualifiedName();
}
break;
case 34:
_localctx = new SetMaterializedViewPropertiesContext(_localctx);
enterOuterAlt(_localctx, 34);
{
setState(688);
match(ALTER);
setState(689);
match(MATERIALIZED);
setState(690);
match(VIEW);
setState(691);
qualifiedName();
setState(692);
match(SET);
setState(693);
match(PROPERTIES);
setState(694);
propertyAssignments();
}
break;
case 35:
_localctx = new DropViewContext(_localctx);
enterOuterAlt(_localctx, 35);
{
setState(696);
match(DROP);
setState(697);
match(VIEW);
setState(700);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,55,_ctx) ) {
case 1:
{
setState(698);
match(IF);
setState(699);
match(EXISTS);
}
break;
}
setState(702);
qualifiedName();
}
break;
case 36:
_localctx = new RenameViewContext(_localctx);
enterOuterAlt(_localctx, 36);
{
setState(703);
match(ALTER);
setState(704);
match(VIEW);
setState(705);
((RenameViewContext)_localctx).from = qualifiedName();
setState(706);
match(RENAME);
setState(707);
match(TO);
setState(708);
((RenameViewContext)_localctx).to = qualifiedName();
}
break;
case 37:
_localctx = new SetViewAuthorizationContext(_localctx);
enterOuterAlt(_localctx, 37);
{
setState(710);
match(ALTER);
setState(711);
match(VIEW);
setState(712);
((SetViewAuthorizationContext)_localctx).from = qualifiedName();
setState(713);
match(SET);
setState(714);
match(AUTHORIZATION);
setState(715);
principal();
}
break;
case 38:
_localctx = new CallContext(_localctx);
enterOuterAlt(_localctx, 38);
{
setState(717);
match(CALL);
setState(718);
qualifiedName();
setState(719);
match(T__1);
setState(728);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -1217097885506863100L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & 6619158405282491887L) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & -2305851805348667539L) != 0) || ((((_la - 193)) & ~0x3f) == 0 && ((1L << (_la - 193)) & -36066180684840983L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 6953390140260613879L) != 0) || ((((_la - 324)) & ~0x3f) == 0 && ((1L << (_la - 324)) & 4093L) != 0)) {
{
setState(720);
callArgument();
setState(725);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(721);
match(T__3);
setState(722);
callArgument();
}
}
setState(727);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(730);
match(T__2);
}
break;
case 39:
_localctx = new CreateFunctionContext(_localctx);
enterOuterAlt(_localctx, 39);
{
setState(732);
match(CREATE);
setState(735);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OR) {
{
setState(733);
match(OR);
setState(734);
match(REPLACE);
}
}
setState(737);
functionSpecification();
}
break;
case 40:
_localctx = new DropFunctionContext(_localctx);
enterOuterAlt(_localctx, 40);
{
setState(738);
match(DROP);
setState(739);
match(FUNCTION);
setState(742);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,59,_ctx) ) {
case 1:
{
setState(740);
match(IF);
setState(741);
match(EXISTS);
}
break;
}
setState(744);
functionDeclaration();
}
break;
case 41:
_localctx = new CreateRoleContext(_localctx);
enterOuterAlt(_localctx, 41);
{
setState(745);
match(CREATE);
setState(746);
match(ROLE);
setState(747);
((CreateRoleContext)_localctx).name = identifier();
setState(751);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(748);
match(WITH);
setState(749);
match(ADMIN);
setState(750);
grantor();
}
}
setState(755);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IN) {
{
setState(753);
match(IN);
setState(754);
((CreateRoleContext)_localctx).catalog = identifier();
}
}
}
break;
case 42:
_localctx = new DropRoleContext(_localctx);
enterOuterAlt(_localctx, 42);
{
setState(757);
match(DROP);
setState(758);
match(ROLE);
setState(761);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,62,_ctx) ) {
case 1:
{
setState(759);
match(IF);
setState(760);
match(EXISTS);
}
break;
}
setState(763);
((DropRoleContext)_localctx).name = identifier();
setState(766);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IN) {
{
setState(764);
match(IN);
setState(765);
((DropRoleContext)_localctx).catalog = identifier();
}
}
}
break;
case 43:
_localctx = new GrantRolesContext(_localctx);
enterOuterAlt(_localctx, 43);
{
setState(768);
match(GRANT);
setState(769);
privilegeOrRole();
setState(774);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(770);
match(T__3);
setState(771);
privilegeOrRole();
}
}
setState(776);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(777);
match(TO);
setState(778);
principal();
setState(783);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(779);
match(T__3);
setState(780);
principal();
}
}
setState(785);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(789);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(786);
match(WITH);
setState(787);
match(ADMIN);
setState(788);
match(OPTION);
}
}
setState(794);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GRANTED) {
{
setState(791);
match(GRANTED);
setState(792);
match(BY);
setState(793);
grantor();
}
}
setState(798);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IN) {
{
setState(796);
match(IN);
setState(797);
((GrantRolesContext)_localctx).catalog = identifier();
}
}
}
break;
case 44:
_localctx = new GrantPrivilegesContext(_localctx);
enterOuterAlt(_localctx, 44);
{
setState(800);
match(GRANT);
setState(811);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,70,_ctx) ) {
case 1:
{
{
setState(801);
privilegeOrRole();
setState(806);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(802);
match(T__3);
setState(803);
privilegeOrRole();
}
}
setState(808);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
break;
case 2:
{
setState(809);
match(ALL);
setState(810);
match(PRIVILEGES);
}
break;
}
setState(813);
match(ON);
setState(814);
grantObject();
setState(815);
match(TO);
setState(816);
principal();
setState(820);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(817);
match(WITH);
setState(818);
match(GRANT);
setState(819);
match(OPTION);
}
}
}
break;
case 45:
_localctx = new RevokeRolesContext(_localctx);
enterOuterAlt(_localctx, 45);
{
setState(822);
match(REVOKE);
setState(826);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,72,_ctx) ) {
case 1:
{
setState(823);
match(ADMIN);
setState(824);
match(OPTION);
setState(825);
match(FOR);
}
break;
}
setState(828);
privilegeOrRole();
setState(833);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(829);
match(T__3);
setState(830);
privilegeOrRole();
}
}
setState(835);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(836);
match(FROM);
setState(837);
principal();
setState(842);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(838);
match(T__3);
setState(839);
principal();
}
}
setState(844);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(848);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GRANTED) {
{
setState(845);
match(GRANTED);
setState(846);
match(BY);
setState(847);
grantor();
}
}
setState(852);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IN) {
{
setState(850);
match(IN);
setState(851);
((RevokeRolesContext)_localctx).catalog = identifier();
}
}
}
break;
case 46:
_localctx = new RevokePrivilegesContext(_localctx);
enterOuterAlt(_localctx, 46);
{
setState(854);
match(REVOKE);
setState(858);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,77,_ctx) ) {
case 1:
{
setState(855);
match(GRANT);
setState(856);
match(OPTION);
setState(857);
match(FOR);
}
break;
}
setState(870);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,79,_ctx) ) {
case 1:
{
{
setState(860);
privilegeOrRole();
setState(865);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(861);
match(T__3);
setState(862);
privilegeOrRole();
}
}
setState(867);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
break;
case 2:
{
setState(868);
match(ALL);
setState(869);
match(PRIVILEGES);
}
break;
}
setState(872);
match(ON);
setState(873);
grantObject();
setState(874);
match(FROM);
setState(875);
((RevokePrivilegesContext)_localctx).grantee = principal();
}
break;
case 47:
_localctx = new DenyContext(_localctx);
enterOuterAlt(_localctx, 47);
{
setState(877);
match(DENY);
setState(888);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,81,_ctx) ) {
case 1:
{
setState(878);
privilege();
setState(883);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(879);
match(T__3);
setState(880);
privilege();
}
}
setState(885);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case 2:
{
setState(886);
match(ALL);
setState(887);
match(PRIVILEGES);
}
break;
}
setState(890);
match(ON);
setState(891);
grantObject();
setState(892);
match(TO);
setState(893);
((DenyContext)_localctx).grantee = principal();
}
break;
case 48:
_localctx = new SetRoleContext(_localctx);
enterOuterAlt(_localctx, 48);
{
setState(895);
match(SET);
setState(896);
match(ROLE);
setState(900);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,82,_ctx) ) {
case 1:
{
setState(897);
match(ALL);
}
break;
case 2:
{
setState(898);
match(NONE);
}
break;
case 3:
{
setState(899);
((SetRoleContext)_localctx).role = identifier();
}
break;
}
setState(904);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IN) {
{
setState(902);
match(IN);
setState(903);
((SetRoleContext)_localctx).catalog = identifier();
}
}
}
break;
case 49:
_localctx = new ShowGrantsContext(_localctx);
enterOuterAlt(_localctx, 49);
{
setState(906);
match(SHOW);
setState(907);
match(GRANTS);
setState(910);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ON) {
{
setState(908);
match(ON);
setState(909);
grantObject();
}
}
}
break;
case 50:
_localctx = new ExplainContext(_localctx);
enterOuterAlt(_localctx, 50);
{
setState(912);
match(EXPLAIN);
setState(924);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,86,_ctx) ) {
case 1:
{
setState(913);
match(T__1);
setState(914);
explainOption();
setState(919);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(915);
match(T__3);
setState(916);
explainOption();
}
}
setState(921);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(922);
match(T__2);
}
break;
}
setState(926);
statement();
}
break;
case 51:
_localctx = new ExplainAnalyzeContext(_localctx);
enterOuterAlt(_localctx, 51);
{
setState(927);
match(EXPLAIN);
setState(928);
match(ANALYZE);
setState(930);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==VERBOSE) {
{
setState(929);
match(VERBOSE);
}
}
setState(932);
statement();
}
break;
case 52:
_localctx = new ShowCreateTableContext(_localctx);
enterOuterAlt(_localctx, 52);
{
setState(933);
match(SHOW);
setState(934);
match(CREATE);
setState(935);
match(TABLE);
setState(936);
qualifiedName();
}
break;
case 53:
_localctx = new ShowCreateSchemaContext(_localctx);
enterOuterAlt(_localctx, 53);
{
setState(937);
match(SHOW);
setState(938);
match(CREATE);
setState(939);
match(SCHEMA);
setState(940);
qualifiedName();
}
break;
case 54:
_localctx = new ShowCreateViewContext(_localctx);
enterOuterAlt(_localctx, 54);
{
setState(941);
match(SHOW);
setState(942);
match(CREATE);
setState(943);
match(VIEW);
setState(944);
qualifiedName();
}
break;
case 55:
_localctx = new ShowCreateMaterializedViewContext(_localctx);
enterOuterAlt(_localctx, 55);
{
setState(945);
match(SHOW);
setState(946);
match(CREATE);
setState(947);
match(MATERIALIZED);
setState(948);
match(VIEW);
setState(949);
qualifiedName();
}
break;
case 56:
_localctx = new ShowCreateFunctionContext(_localctx);
enterOuterAlt(_localctx, 56);
{
setState(950);
match(SHOW);
setState(951);
match(CREATE);
setState(952);
match(FUNCTION);
setState(953);
qualifiedName();
}
break;
case 57:
_localctx = new ShowTablesContext(_localctx);
enterOuterAlt(_localctx, 57);
{
setState(954);
match(SHOW);
setState(955);
match(TABLES);
setState(958);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(956);
_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(957);
qualifiedName();
}
}
setState(966);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(960);
match(LIKE);
setState(961);
((ShowTablesContext)_localctx).pattern = string();
setState(964);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(962);
match(ESCAPE);
setState(963);
((ShowTablesContext)_localctx).escape = string();
}
}
}
}
}
break;
case 58:
_localctx = new ShowSchemasContext(_localctx);
enterOuterAlt(_localctx, 58);
{
setState(968);
match(SHOW);
setState(969);
match(SCHEMAS);
setState(972);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(970);
_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(971);
identifier();
}
}
setState(980);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(974);
match(LIKE);
setState(975);
((ShowSchemasContext)_localctx).pattern = string();
setState(978);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(976);
match(ESCAPE);
setState(977);
((ShowSchemasContext)_localctx).escape = string();
}
}
}
}
}
break;
case 59:
_localctx = new ShowCatalogsContext(_localctx);
enterOuterAlt(_localctx, 59);
{
setState(982);
match(SHOW);
setState(983);
match(CATALOGS);
setState(990);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(984);
match(LIKE);
setState(985);
((ShowCatalogsContext)_localctx).pattern = string();
setState(988);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(986);
match(ESCAPE);
setState(987);
((ShowCatalogsContext)_localctx).escape = string();
}
}
}
}
}
break;
case 60:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 60);
{
setState(992);
match(SHOW);
setState(993);
match(COLUMNS);
setState(994);
_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(995);
qualifiedName();
setState(1002);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(996);
match(LIKE);
setState(997);
((ShowColumnsContext)_localctx).pattern = string();
setState(1000);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(998);
match(ESCAPE);
setState(999);
((ShowColumnsContext)_localctx).escape = string();
}
}
}
}
}
break;
case 61:
_localctx = new ShowStatsContext(_localctx);
enterOuterAlt(_localctx, 61);
{
setState(1004);
match(SHOW);
setState(1005);
match(STATS);
setState(1006);
match(FOR);
setState(1007);
qualifiedName();
}
break;
case 62:
_localctx = new ShowStatsForQueryContext(_localctx);
enterOuterAlt(_localctx, 62);
{
setState(1008);
match(SHOW);
setState(1009);
match(STATS);
setState(1010);
match(FOR);
setState(1011);
match(T__1);
setState(1012);
rootQuery();
setState(1013);
match(T__2);
}
break;
case 63:
_localctx = new ShowRolesContext(_localctx);
enterOuterAlt(_localctx, 63);
{
setState(1015);
match(SHOW);
setState(1017);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CURRENT) {
{
setState(1016);
match(CURRENT);
}
}
setState(1019);
match(ROLES);
setState(1022);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(1020);
_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(1021);
identifier();
}
}
}
break;
case 64:
_localctx = new ShowRoleGrantsContext(_localctx);
enterOuterAlt(_localctx, 64);
{
setState(1024);
match(SHOW);
setState(1025);
match(ROLE);
setState(1026);
match(GRANTS);
setState(1029);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(1027);
_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(1028);
identifier();
}
}
}
break;
case 65:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 65);
{
setState(1031);
match(DESCRIBE);
setState(1032);
qualifiedName();
}
break;
case 66:
_localctx = new ShowColumnsContext(_localctx);
enterOuterAlt(_localctx, 66);
{
setState(1033);
match(DESC);
setState(1034);
qualifiedName();
}
break;
case 67:
_localctx = new ShowFunctionsContext(_localctx);
enterOuterAlt(_localctx, 67);
{
setState(1035);
match(SHOW);
setState(1036);
match(FUNCTIONS);
setState(1039);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FROM || _la==IN) {
{
setState(1037);
_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(1038);
qualifiedName();
}
}
setState(1047);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(1041);
match(LIKE);
setState(1042);
((ShowFunctionsContext)_localctx).pattern = string();
setState(1045);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(1043);
match(ESCAPE);
setState(1044);
((ShowFunctionsContext)_localctx).escape = string();
}
}
}
}
}
break;
case 68:
_localctx = new ShowSessionContext(_localctx);
enterOuterAlt(_localctx, 68);
{
setState(1049);
match(SHOW);
setState(1050);
match(SESSION);
setState(1057);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LIKE) {
{
setState(1051);
match(LIKE);
setState(1052);
((ShowSessionContext)_localctx).pattern = string();
setState(1055);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ESCAPE) {
{
setState(1053);
match(ESCAPE);
setState(1054);
((ShowSessionContext)_localctx).escape = string();
}
}
}
}
}
break;
case 69:
_localctx = new SetSessionAuthorizationContext(_localctx);
enterOuterAlt(_localctx, 69);
{
setState(1059);
match(SET);
setState(1060);
match(SESSION);
setState(1061);
match(AUTHORIZATION);
setState(1062);
authorizationUser();
}
break;
case 70:
_localctx = new ResetSessionAuthorizationContext(_localctx);
enterOuterAlt(_localctx, 70);
{
setState(1063);
match(RESET);
setState(1064);
match(SESSION);
setState(1065);
match(AUTHORIZATION);
}
break;
case 71:
_localctx = new SetSessionContext(_localctx);
enterOuterAlt(_localctx, 71);
{
setState(1066);
match(SET);
setState(1067);
match(SESSION);
setState(1068);
qualifiedName();
setState(1069);
match(EQ);
setState(1070);
expression();
}
break;
case 72:
_localctx = new ResetSessionContext(_localctx);
enterOuterAlt(_localctx, 72);
{
setState(1072);
match(RESET);
setState(1073);
match(SESSION);
setState(1074);
qualifiedName();
}
break;
case 73:
_localctx = new StartTransactionContext(_localctx);
enterOuterAlt(_localctx, 73);
{
setState(1075);
match(START);
setState(1076);
match(TRANSACTION);
setState(1085);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ISOLATION || _la==READ) {
{
setState(1077);
transactionMode();
setState(1082);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1078);
match(T__3);
setState(1079);
transactionMode();
}
}
setState(1084);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
}
break;
case 74:
_localctx = new CommitContext(_localctx);
enterOuterAlt(_localctx, 74);
{
setState(1087);
match(COMMIT);
setState(1089);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WORK) {
{
setState(1088);
match(WORK);
}
}
}
break;
case 75:
_localctx = new RollbackContext(_localctx);
enterOuterAlt(_localctx, 75);
{
setState(1091);
match(ROLLBACK);
setState(1093);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WORK) {
{
setState(1092);
match(WORK);
}
}
}
break;
case 76:
_localctx = new PrepareContext(_localctx);
enterOuterAlt(_localctx, 76);
{
setState(1095);
match(PREPARE);
setState(1096);
identifier();
setState(1097);
match(FROM);
setState(1098);
statement();
}
break;
case 77:
_localctx = new DeallocateContext(_localctx);
enterOuterAlt(_localctx, 77);
{
setState(1100);
match(DEALLOCATE);
setState(1101);
match(PREPARE);
setState(1102);
identifier();
}
break;
case 78:
_localctx = new ExecuteContext(_localctx);
enterOuterAlt(_localctx, 78);
{
setState(1103);
match(EXECUTE);
setState(1104);
identifier();
setState(1114);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==USING) {
{
setState(1105);
match(USING);
setState(1106);
expression();
setState(1111);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1107);
match(T__3);
setState(1108);
expression();
}
}
setState(1113);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
}
break;
case 79:
_localctx = new ExecuteImmediateContext(_localctx);
enterOuterAlt(_localctx, 79);
{
setState(1116);
match(EXECUTE);
setState(1117);
match(IMMEDIATE);
setState(1118);
string();
setState(1128);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==USING) {
{
setState(1119);
match(USING);
setState(1120);
expression();
setState(1125);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1121);
match(T__3);
setState(1122);
expression();
}
}
setState(1127);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
}
break;
case 80:
_localctx = new DescribeInputContext(_localctx);
enterOuterAlt(_localctx, 80);
{
setState(1130);
match(DESCRIBE);
setState(1131);
match(INPUT);
setState(1132);
identifier();
}
break;
case 81:
_localctx = new DescribeOutputContext(_localctx);
enterOuterAlt(_localctx, 81);
{
setState(1133);
match(DESCRIBE);
setState(1134);
match(OUTPUT);
setState(1135);
identifier();
}
break;
case 82:
_localctx = new SetPathContext(_localctx);
enterOuterAlt(_localctx, 82);
{
setState(1136);
match(SET);
setState(1137);
match(PATH);
setState(1138);
pathSpecification();
}
break;
case 83:
_localctx = new SetTimeZoneContext(_localctx);
enterOuterAlt(_localctx, 83);
{
setState(1139);
match(SET);
setState(1140);
match(TIME);
setState(1141);
match(ZONE);
setState(1144);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,114,_ctx) ) {
case 1:
{
setState(1142);
match(LOCAL);
}
break;
case 2:
{
setState(1143);
expression();
}
break;
}
}
break;
case 84:
_localctx = new UpdateContext(_localctx);
enterOuterAlt(_localctx, 84);
{
setState(1146);
match(UPDATE);
setState(1147);
qualifiedName();
setState(1148);
match(SET);
setState(1149);
updateAssignment();
setState(1154);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1150);
match(T__3);
setState(1151);
updateAssignment();
}
}
setState(1156);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1159);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHERE) {
{
setState(1157);
match(WHERE);
setState(1158);
((UpdateContext)_localctx).where = booleanExpression(0);
}
}
}
break;
case 85:
_localctx = new MergeContext(_localctx);
enterOuterAlt(_localctx, 85);
{
setState(1161);
match(MERGE);
setState(1162);
match(INTO);
setState(1163);
qualifiedName();
setState(1168);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 18)) & ~0x3f) == 0 && ((1L << (_la - 18)) & -2631368514849800353L) != 0) || ((((_la - 82)) & ~0x3f) == 0 && ((1L << (_la - 82)) & -4560291593682211655L) != 0) || ((((_la - 146)) & ~0x3f) == 0 && ((1L << (_la - 146)) & -3114057515152705L) != 0) || ((((_la - 210)) & ~0x3f) == 0 && ((1L << (_la - 210)) & 4574531046338459631L) != 0) || ((((_la - 274)) & ~0x3f) == 0 && ((1L << (_la - 274)) & 4323455915874252663L) != 0)) {
{
setState(1165);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1164);
match(AS);
}
}
setState(1167);
identifier();
}
}
setState(1170);
match(USING);
setState(1171);
relation(0);
setState(1172);
match(ON);
setState(1173);
expression();
setState(1175);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(1174);
mergeCase();
}
}
setState(1177);
_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 RootQueryContext extends ParserRuleContext {
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
public WithFunctionContext withFunction() {
return getRuleContext(WithFunctionContext.class,0);
}
public RootQueryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rootQuery; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterRootQuery(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitRootQuery(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitRootQuery(this);
else return visitor.visitChildren(this);
}
}
public final RootQueryContext rootQuery() throws RecognitionException {
RootQueryContext _localctx = new RootQueryContext(_ctx, getState());
enterRule(_localctx, 14, RULE_rootQuery);
try {
enterOuterAlt(_localctx, 1);
{
setState(1182);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,121,_ctx) ) {
case 1:
{
setState(1181);
withFunction();
}
break;
}
setState(1184);
query();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class WithFunctionContext extends ParserRuleContext {
public TerminalNode WITH() { return getToken(SqlBaseParser.WITH, 0); }
public List functionSpecification() {
return getRuleContexts(FunctionSpecificationContext.class);
}
public FunctionSpecificationContext functionSpecification(int i) {
return getRuleContext(FunctionSpecificationContext.class,i);
}
public WithFunctionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_withFunction; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterWithFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitWithFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitWithFunction(this);
else return visitor.visitChildren(this);
}
}
public final WithFunctionContext withFunction() throws RecognitionException {
WithFunctionContext _localctx = new WithFunctionContext(_ctx, getState());
enterRule(_localctx, 16, RULE_withFunction);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1186);
match(WITH);
setState(1187);
functionSpecification();
setState(1192);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1188);
match(T__3);
setState(1189);
functionSpecification();
}
}
setState(1194);
_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 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, 18, RULE_query);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1196);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(1195);
with();
}
}
setState(1198);
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, 20, RULE_with);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1200);
match(WITH);
setState(1202);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==RECURSIVE) {
{
setState(1201);
match(RECURSIVE);
}
}
setState(1204);
namedQuery();
setState(1209);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1205);
match(T__3);
setState(1206);
namedQuery();
}
}
setState(1211);
_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, 22, RULE_tableElement);
try {
setState(1214);
_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 BEGIN:
case BERNOULLI:
case BOTH:
case CALL:
case CALLED:
case CASCADE:
case CATALOG:
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 DECLARE:
case DEFAULT:
case DEFINE:
case DEFINER:
case DENY:
case DESC:
case DESCRIPTOR:
case DETERMINISTIC:
case DISTRIBUTED:
case DO:
case DOUBLE:
case EMPTY:
case ELSEIF:
case ENCODING:
case ERROR:
case EXCLUDING:
case EXECUTE:
case EXPLAIN:
case FETCH:
case FILTER:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FUNCTION:
case FUNCTIONS:
case GRACE:
case GRANT:
case GRANTED:
case GRANTS:
case GRAPHVIZ:
case GROUPS:
case HOUR:
case IF:
case IGNORE:
case IMMEDIATE:
case INCLUDING:
case INITIAL:
case INPUT:
case INTERVAL:
case INVOKER:
case IO:
case ISOLATION:
case ITERATE:
case JSON:
case KEEP:
case KEY:
case KEYS:
case LANGUAGE:
case LAST:
case LATERAL:
case LEADING:
case LEAVE:
case LEVEL:
case LIMIT:
case LOCAL:
case LOGICAL:
case LOOP:
case MAP:
case MATCH:
case MATCHED:
case MATCHES:
case MATCH_RECOGNIZE:
case MATERIALIZED:
case MEASURES:
case MERGE:
case MINUTE:
case MONTH:
case NESTED:
case NEXT:
case NFC:
case NFD:
case NFKC:
case NFKD:
case NO:
case NONE:
case NULLIF:
case NULLS:
case OBJECT:
case OF:
case OFFSET:
case OMIT:
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 PERIOD:
case PERMUTE:
case PLAN:
case POSITION:
case PRECEDING:
case PRECISION:
case PRIVILEGES:
case PROPERTIES:
case PRUNE:
case QUOTES:
case RANGE:
case READ:
case REFRESH:
case RENAME:
case REPEAT:
case REPEATABLE:
case REPLACE:
case RESET:
case RESPECT:
case RESTRICT:
case RETURN:
case RETURNING:
case RETURNS:
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 UNTIL:
case UPDATE:
case USE:
case USER:
case UTF16:
case UTF32:
case UTF8:
case VALIDATE:
case VALUE:
case VERBOSE:
case VERSION:
case VIEW:
case WHILE:
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(1212);
columnDefinition();
}
break;
case LIKE:
enterOuterAlt(_localctx, 2);
{
setState(1213);
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 QualifiedNameContext qualifiedName() {
return getRuleContext(QualifiedNameContext.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, 24, RULE_columnDefinition);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1216);
qualifiedName();
setState(1217);
type(0);
setState(1220);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1218);
match(NOT);
setState(1219);
match(NULL);
}
}
setState(1224);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMENT) {
{
setState(1222);
match(COMMENT);
setState(1223);
string();
}
}
setState(1228);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH) {
{
setState(1226);
match(WITH);
setState(1227);
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, 26, RULE_likeClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1230);
match(LIKE);
setState(1231);
qualifiedName();
setState(1234);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==EXCLUDING || _la==INCLUDING) {
{
setState(1232);
((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(1233);
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, 28, RULE_properties);
try {
enterOuterAlt(_localctx, 1);
{
setState(1236);
match(T__1);
setState(1237);
propertyAssignments();
setState(1238);
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, 30, RULE_propertyAssignments);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1240);
property();
setState(1245);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1241);
match(T__3);
setState(1242);
property();
}
}
setState(1247);
_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, 32, RULE_property);
try {
enterOuterAlt(_localctx, 1);
{
setState(1248);
identifier();
setState(1249);
match(EQ);
setState(1250);
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, 34, RULE_propertyValue);
try {
setState(1254);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,132,_ctx) ) {
case 1:
_localctx = new DefaultPropertyValueContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1252);
match(DEFAULT);
}
break;
case 2:
_localctx = new NonDefaultPropertyValueContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1253);
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, 36, RULE_queryNoWith);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1256);
queryTerm(0);
setState(1267);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1257);
match(ORDER);
setState(1258);
match(BY);
setState(1259);
sortItem();
setState(1264);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1260);
match(T__3);
setState(1261);
sortItem();
}
}
setState(1266);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1274);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OFFSET) {
{
setState(1269);
match(OFFSET);
setState(1270);
((QueryNoWithContext)_localctx).offset = rowCount();
setState(1272);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ROW || _la==ROWS) {
{
setState(1271);
_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(1289);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LIMIT:
{
{
setState(1276);
match(LIMIT);
setState(1277);
((QueryNoWithContext)_localctx).limit = limitRowCount();
}
}
break;
case FETCH:
{
{
setState(1278);
match(FETCH);
setState(1279);
_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(1281);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==QUESTION_MARK || _la==INTEGER_VALUE) {
{
setState(1280);
((QueryNoWithContext)_localctx).fetchFirst = rowCount();
}
}
setState(1283);
_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(1287);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ONLY:
{
setState(1284);
match(ONLY);
}
break;
case WITH:
{
setState(1285);
match(WITH);
setState(1286);
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, 38, RULE_limitRowCount);
try {
setState(1293);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ALL:
enterOuterAlt(_localctx, 1);
{
setState(1291);
match(ALL);
}
break;
case QUESTION_MARK:
case INTEGER_VALUE:
enterOuterAlt(_localctx, 2);
{
setState(1292);
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, 40, RULE_rowCount);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1295);
_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 = 42;
enterRecursionRule(_localctx, 42, RULE_queryTerm, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
{
_localctx = new QueryTermDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1298);
queryPrimary();
}
_ctx.stop = _input.LT(-1);
setState(1314);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,144,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(1312);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,143,_ctx) ) {
case 1:
{
_localctx = new SetOperationContext(new QueryTermContext(_parentctx, _parentState));
((SetOperationContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_queryTerm);
setState(1300);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1301);
((SetOperationContext)_localctx).operator = match(INTERSECT);
setState(1303);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==DISTINCT) {
{
setState(1302);
setQuantifier();
}
}
setState(1305);
((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(1306);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
setState(1307);
((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(1309);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==DISTINCT) {
{
setState(1308);
setQuantifier();
}
}
setState(1311);
((SetOperationContext)_localctx).right = queryTerm(2);
}
break;
}
}
}
setState(1316);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,144,_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, 44, RULE_queryPrimary);
try {
int _alt;
setState(1333);
_errHandler.sync(this);
switch (_input.LA(1)) {
case SELECT:
_localctx = new QueryPrimaryDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1317);
querySpecification();
}
break;
case TABLE:
_localctx = new TableContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1318);
match(TABLE);
setState(1319);
qualifiedName();
}
break;
case VALUES:
_localctx = new InlineTableContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1320);
match(VALUES);
setState(1321);
expression();
setState(1326);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,145,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1322);
match(T__3);
setState(1323);
expression();
}
}
}
setState(1328);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,145,_ctx);
}
}
break;
case T__1:
_localctx = new SubqueryContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1329);
match(T__1);
setState(1330);
queryNoWith();
setState(1331);
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, 46, RULE_sortItem);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1335);
expression();
setState(1337);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASC || _la==DESC) {
{
setState(1336);
((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(1341);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NULLS) {
{
setState(1339);
match(NULLS);
setState(1340);
((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, 48, RULE_querySpecification);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1343);
match(SELECT);
setState(1345);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,149,_ctx) ) {
case 1:
{
setState(1344);
setQuantifier();
}
break;
}
setState(1347);
selectItem();
setState(1352);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,150,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1348);
match(T__3);
setState(1349);
selectItem();
}
}
}
setState(1354);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,150,_ctx);
}
setState(1364);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,152,_ctx) ) {
case 1:
{
setState(1355);
match(FROM);
setState(1356);
relation(0);
setState(1361);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,151,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1357);
match(T__3);
setState(1358);
relation(0);
}
}
}
setState(1363);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,151,_ctx);
}
}
break;
}
setState(1368);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,153,_ctx) ) {
case 1:
{
setState(1366);
match(WHERE);
setState(1367);
((QuerySpecificationContext)_localctx).where = booleanExpression(0);
}
break;
}
setState(1373);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,154,_ctx) ) {
case 1:
{
setState(1370);
match(GROUP);
setState(1371);
match(BY);
setState(1372);
groupBy();
}
break;
}
setState(1377);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,155,_ctx) ) {
case 1:
{
setState(1375);
match(HAVING);
setState(1376);
((QuerySpecificationContext)_localctx).having = booleanExpression(0);
}
break;
}
setState(1388);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,157,_ctx) ) {
case 1:
{
setState(1379);
match(WINDOW);
setState(1380);
windowDefinition();
setState(1385);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,156,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1381);
match(T__3);
setState(1382);
windowDefinition();
}
}
}
setState(1387);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,156,_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, 50, RULE_groupBy);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(1391);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,158,_ctx) ) {
case 1:
{
setState(1390);
setQuantifier();
}
break;
}
setState(1393);
groupingElement();
setState(1398);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,159,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
setState(1394);
match(T__3);
setState(1395);
groupingElement();
}
}
}
setState(1400);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,159,_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 groupingSet() {
return getRuleContexts(GroupingSetContext.class);
}
public GroupingSetContext groupingSet(int i) {
return getRuleContext(GroupingSetContext.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 groupingSet() {
return getRuleContexts(GroupingSetContext.class);
}
public GroupingSetContext groupingSet(int i) {
return getRuleContext(GroupingSetContext.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, 52, RULE_groupingElement);
int _la;
try {
setState(1441);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,165,_ctx) ) {
case 1:
_localctx = new SingleGroupingSetContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1401);
groupingSet();
}
break;
case 2:
_localctx = new RollupContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1402);
match(ROLLUP);
setState(1403);
match(T__1);
setState(1412);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -1217097885506863100L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & 6619158405282491887L) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & -2305851805348667539L) != 0) || ((((_la - 193)) & ~0x3f) == 0 && ((1L << (_la - 193)) & -36066180684840983L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 6953390140260613879L) != 0) || ((((_la - 324)) & ~0x3f) == 0 && ((1L << (_la - 324)) & 4093L) != 0)) {
{
setState(1404);
groupingSet();
setState(1409);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1405);
match(T__3);
setState(1406);
groupingSet();
}
}
setState(1411);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1414);
match(T__2);
}
break;
case 3:
_localctx = new CubeContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1415);
match(CUBE);
setState(1416);
match(T__1);
setState(1425);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -1217097885506863100L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & 6619158405282491887L) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & -2305851805348667539L) != 0) || ((((_la - 193)) & ~0x3f) == 0 && ((1L << (_la - 193)) & -36066180684840983L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 6953390140260613879L) != 0) || ((((_la - 324)) & ~0x3f) == 0 && ((1L << (_la - 324)) & 4093L) != 0)) {
{
setState(1417);
groupingSet();
setState(1422);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1418);
match(T__3);
setState(1419);
groupingSet();
}
}
setState(1424);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1427);
match(T__2);
}
break;
case 4:
_localctx = new MultipleGroupingSetsContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1428);
match(GROUPING);
setState(1429);
match(SETS);
setState(1430);
match(T__1);
setState(1431);
groupingSet();
setState(1436);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1432);
match(T__3);
setState(1433);
groupingSet();
}
}
setState(1438);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1439);
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, 54, RULE_groupingSet);
int _la;
try {
setState(1456);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,168,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1443);
match(T__1);
setState(1452);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & -1217097885506863100L) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & 6619158405282491887L) != 0) || ((((_la - 129)) & ~0x3f) == 0 && ((1L << (_la - 129)) & -2305851805348667539L) != 0) || ((((_la - 193)) & ~0x3f) == 0 && ((1L << (_la - 193)) & -36066180684840983L) != 0) || ((((_la - 257)) & ~0x3f) == 0 && ((1L << (_la - 257)) & 6953390140260613879L) != 0) || ((((_la - 324)) & ~0x3f) == 0 && ((1L << (_la - 324)) & 4093L) != 0)) {
{
setState(1444);
expression();
setState(1449);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1445);
match(T__3);
setState(1446);
expression();
}
}
setState(1451);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1454);
match(T__2);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1455);
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, 56, RULE_windowDefinition);
try {
enterOuterAlt(_localctx, 1);
{
setState(1458);
((WindowDefinitionContext)_localctx).name = identifier();
setState(1459);
match(AS);
setState(1460);
match(T__1);
setState(1461);
windowSpecification();
setState(1462);
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, 58, RULE_windowSpecification);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1465);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,169,_ctx) ) {
case 1:
{
setState(1464);
((WindowSpecificationContext)_localctx).existingWindowName = identifier();
}
break;
}
setState(1477);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PARTITION) {
{
setState(1467);
match(PARTITION);
setState(1468);
match(BY);
setState(1469);
((WindowSpecificationContext)_localctx).expression = expression();
((WindowSpecificationContext)_localctx).partition.add(((WindowSpecificationContext)_localctx).expression);
setState(1474);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1470);
match(T__3);
setState(1471);
((WindowSpecificationContext)_localctx).expression = expression();
((WindowSpecificationContext)_localctx).partition.add(((WindowSpecificationContext)_localctx).expression);
}
}
setState(1476);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1489);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1479);
match(ORDER);
setState(1480);
match(BY);
setState(1481);
sortItem();
setState(1486);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1482);
match(T__3);
setState(1483);
sortItem();
}
}
setState(1488);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1492);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GROUPS || _la==MEASURES || _la==RANGE || _la==ROWS) {
{
setState(1491);
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, 60, RULE_namedQuery);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1494);
((NamedQueryContext)_localctx).name = identifier();
setState(1496);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==T__1) {
{
setState(1495);
columnAliases();
}
}
setState(1498);
match(AS);
setState(1499);
match(T__1);
setState(1500);
query();
setState(1501);
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, 62, RULE_setQuantifier);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1503);
_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, 64, RULE_selectItem);
int _la;
try {
setState(1520);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,179,_ctx) ) {
case 1:
_localctx = new SelectSingleContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1505);
expression();
setState(1510);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,177,_ctx) ) {
case 1:
{
setState(1507);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1506);
match(AS);
}
}
setState(1509);
identifier();
}
break;
}
}
break;
case 2:
_localctx = new SelectAllContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1512);
primaryExpression(0);
setState(1513);
match(T__0);
setState(1514);
match(ASTERISK);
setState(1517);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,178,_ctx) ) {
case 1:
{
setState(1515);
match(AS);
setState(1516);
columnAliases();
}
break;
}
}
break;
case 3:
_localctx = new SelectAllContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1519);
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 = 66;
enterRecursionRule(_localctx, 66, RULE_relation, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
{
_localctx = new RelationDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(1523);
sampledRelation();
}
_ctx.stop = _input.LT(-1);
setState(1543);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,181,_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(1525);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
setState(1539);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CROSS:
{
setState(1526);
match(CROSS);
setState(1527);
match(JOIN);
setState(1528);
((JoinRelationContext)_localctx).right = sampledRelation();
}
break;
case FULL:
case INNER:
case JOIN:
case LEFT:
case RIGHT:
{
setState(1529);
joinType();
setState(1530);
match(JOIN);
setState(1531);
((JoinRelationContext)_localctx).rightRelation = relation(0);
setState(1532);
joinCriteria();
}
break;
case NATURAL:
{
setState(1534);
match(NATURAL);
setState(1535);
joinType();
setState(1536);
match(JOIN);
setState(1537);
((JoinRelationContext)_localctx).right = sampledRelation();
}
break;
default:
throw new NoViableAltException(this);
}
}
}
}
setState(1545);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,181,_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, 68, RULE_joinType);
int _la;
try {
setState(1561);
_errHandler.sync(this);
switch (_input.LA(1)) {
case INNER:
case JOIN:
enterOuterAlt(_localctx, 1);
{
setState(1547);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==INNER) {
{
setState(1546);
match(INNER);
}
}
}
break;
case LEFT:
enterOuterAlt(_localctx, 2);
{
setState(1549);
match(LEFT);
setState(1551);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(1550);
match(OUTER);
}
}
}
break;
case RIGHT:
enterOuterAlt(_localctx, 3);
{
setState(1553);
match(RIGHT);
setState(1555);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(1554);
match(OUTER);
}
}
}
break;
case FULL:
enterOuterAlt(_localctx, 4);
{
setState(1557);
match(FULL);
setState(1559);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OUTER) {
{
setState(1558);
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, 70, RULE_joinCriteria);
int _la;
try {
setState(1577);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ON:
enterOuterAlt(_localctx, 1);
{
setState(1563);
match(ON);
setState(1564);
booleanExpression(0);
}
break;
case USING:
enterOuterAlt(_localctx, 2);
{
setState(1565);
match(USING);
setState(1566);
match(T__1);
setState(1567);
identifier();
setState(1572);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1568);
match(T__3);
setState(1569);
identifier();
}
}
setState(1574);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1575);
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, 72, RULE_sampledRelation);
try {
enterOuterAlt(_localctx, 1);
{
setState(1579);
patternRecognition();
setState(1586);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,189,_ctx) ) {
case 1:
{
setState(1580);
match(TABLESAMPLE);
setState(1581);
sampleType();
setState(1582);
match(T__1);
setState(1583);
((SampledRelationContext)_localctx).percentage = expression();
setState(1584);
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, 74, RULE_sampleType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1588);
_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, 76, RULE_trimsSpecification);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1590);
_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, 78, RULE_listAggOverflowBehavior);
int _la;
try {
setState(1598);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ERROR:
enterOuterAlt(_localctx, 1);
{
setState(1592);
match(ERROR);
}
break;
case TRUNCATE:
enterOuterAlt(_localctx, 2);
{
setState(1593);
match(TRUNCATE);
setState(1595);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==STRING || _la==UNICODE_STRING) {
{
setState(1594);
string();
}
}
setState(1597);
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, 80, RULE_listaggCountIndication);
try {
setState(1604);
_errHandler.sync(this);
switch (_input.LA(1)) {
case WITH:
enterOuterAlt(_localctx, 1);
{
setState(1600);
match(WITH);
setState(1601);
match(COUNT);
}
break;
case WITHOUT:
enterOuterAlt(_localctx, 2);
{
setState(1602);
match(WITHOUT);
setState(1603);
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, 82, RULE_patternRecognition);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1606);
aliasedRelation();
setState(1689);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,208,_ctx) ) {
case 1:
{
setState(1607);
match(MATCH_RECOGNIZE);
setState(1608);
match(T__1);
setState(1619);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PARTITION) {
{
setState(1609);
match(PARTITION);
setState(1610);
match(BY);
setState(1611);
((PatternRecognitionContext)_localctx).expression = expression();
((PatternRecognitionContext)_localctx).partition.add(((PatternRecognitionContext)_localctx).expression);
setState(1616);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1612);
match(T__3);
setState(1613);
((PatternRecognitionContext)_localctx).expression = expression();
((PatternRecognitionContext)_localctx).partition.add(((PatternRecognitionContext)_localctx).expression);
}
}
setState(1618);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1631);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(1621);
match(ORDER);
setState(1622);
match(BY);
setState(1623);
sortItem();
setState(1628);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1624);
match(T__3);
setState(1625);
sortItem();
}
}
setState(1630);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1642);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==MEASURES) {
{
setState(1633);
match(MEASURES);
setState(1634);
measureDefinition();
setState(1639);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1635);
match(T__3);
setState(1636);
measureDefinition();
}
}
setState(1641);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1645);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==ONE) {
{
setState(1644);
rowsPerMatch();
}
}
setState(1650);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AFTER) {
{
setState(1647);
match(AFTER);
setState(1648);
match(MATCH);
setState(1649);
skipTo();
}
}
setState(1653);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==INITIAL || _la==SEEK) {
{
setState(1652);
_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(1655);
match(PATTERN);
setState(1656);
match(T__1);
setState(1657);
rowPattern(0);
setState(1658);
match(T__2);
setState(1668);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==SUBSET) {
{
setState(1659);
match(SUBSET);
setState(1660);
subsetDefinition();
setState(1665);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1661);
match(T__3);
setState(1662);
subsetDefinition();
}
}
setState(1667);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(1670);
match(DEFINE);
setState(1671);
variableDefinition();
setState(1676);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1672);
match(T__3);
setState(1673);
variableDefinition();
}
}
setState(1678);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1679);
match(T__2);
setState(1687);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,207,_ctx) ) {
case 1:
{
setState(1681);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1680);
match(AS);
}
}
setState(1683);
identifier();
setState(1685);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,206,_ctx) ) {
case 1:
{
setState(1684);
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, 84, RULE_measureDefinition);
try {
enterOuterAlt(_localctx, 1);
{
setState(1691);
expression();
setState(1692);
match(AS);
setState(1693);
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, 86, RULE_rowsPerMatch);
int _la;
try {
setState(1706);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ONE:
enterOuterAlt(_localctx, 1);
{
setState(1695);
match(ONE);
setState(1696);
match(ROW);
setState(1697);
match(PER);
setState(1698);
match(MATCH);
}
break;
case ALL:
enterOuterAlt(_localctx, 2);
{
setState(1699);
match(ALL);
setState(1700);
match(ROWS);
setState(1701);
match(PER);
setState(1702);
match(MATCH);
setState(1704);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==OMIT || _la==SHOW || _la==WITH) {
{
setState(1703);
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, 88, RULE_emptyMatchHandling);
try {
setState(1717);
_errHandler.sync(this);
switch (_input.LA(1)) {
case SHOW:
enterOuterAlt(_localctx, 1);
{
setState(1708);
match(SHOW);
setState(1709);
match(EMPTY);
setState(1710);
match(MATCHES);
}
break;
case OMIT:
enterOuterAlt(_localctx, 2);
{
setState(1711);
match(OMIT);
setState(1712);
match(EMPTY);
setState(1713);
match(MATCHES);
}
break;
case WITH:
enterOuterAlt(_localctx, 3);
{
setState(1714);
match(WITH);
setState(1715);
match(UNMATCHED);
setState(1716);
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, 90, RULE_skipTo);
try {
setState(1738);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,212,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1719);
match(T__4);
setState(1720);
match(TO);
setState(1721);
match(NEXT);
setState(1722);
match(ROW);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1723);
match(T__4);
setState(1724);
match(PAST);
setState(1725);
match(LAST);
setState(1726);
match(ROW);
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1727);
match(T__4);
setState(1728);
match(TO);
setState(1729);
match(FIRST);
setState(1730);
identifier();
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(1731);
match(T__4);
setState(1732);
match(TO);
setState(1733);
match(LAST);
setState(1734);
identifier();
}
break;
case 5:
enterOuterAlt(_localctx, 5);
{
setState(1735);
match(T__4);
setState(1736);
match(TO);
setState(1737);
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, 92, RULE_subsetDefinition);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1740);
((SubsetDefinitionContext)_localctx).name = identifier();
setState(1741);
match(EQ);
setState(1742);
match(T__1);
setState(1743);
((SubsetDefinitionContext)_localctx).identifier = identifier();
((SubsetDefinitionContext)_localctx).union.add(((SubsetDefinitionContext)_localctx).identifier);
setState(1748);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1744);
match(T__3);
setState(1745);
((SubsetDefinitionContext)_localctx).identifier = identifier();
((SubsetDefinitionContext)_localctx).union.add(((SubsetDefinitionContext)_localctx).identifier);
}
}
setState(1750);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1751);
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, 94, RULE_variableDefinition);
try {
enterOuterAlt(_localctx, 1);
{
setState(1753);
identifier();
setState(1754);
match(AS);
setState(1755);
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, 96, RULE_aliasedRelation);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1757);
relationPrimary();
setState(1765);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,216,_ctx) ) {
case 1:
{
setState(1759);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1758);
match(AS);
}
}
setState(1761);
identifier();
setState(1763);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,215,_ctx) ) {
case 1:
{
setState(1762);
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, 98, RULE_columnAliases);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1767);
match(T__1);
setState(1768);
identifier();
setState(1773);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1769);
match(T__3);
setState(1770);
identifier();
}
}
setState(1775);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1776);
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 JsonTableContext extends RelationPrimaryContext {
public TerminalNode JSON_TABLE() { return getToken(SqlBaseParser.JSON_TABLE, 0); }
public JsonPathInvocationContext jsonPathInvocation() {
return getRuleContext(JsonPathInvocationContext.class,0);
}
public TerminalNode COLUMNS() { return getToken(SqlBaseParser.COLUMNS, 0); }
public List jsonTableColumn() {
return getRuleContexts(JsonTableColumnContext.class);
}
public JsonTableColumnContext jsonTableColumn(int i) {
return getRuleContext(JsonTableColumnContext.class,i);
}
public TerminalNode PLAN() { return getToken(SqlBaseParser.PLAN, 0); }
public JsonTableSpecificPlanContext jsonTableSpecificPlan() {
return getRuleContext(JsonTableSpecificPlanContext.class,0);
}
public TerminalNode DEFAULT() { return getToken(SqlBaseParser.DEFAULT, 0); }
public JsonTableDefaultPlanContext jsonTableDefaultPlan() {
return getRuleContext(JsonTableDefaultPlanContext.class,0);
}
public TerminalNode ON() { return getToken(SqlBaseParser.ON, 0); }
public List ERROR() { return getTokens(SqlBaseParser.ERROR); }
public TerminalNode ERROR(int i) {
return getToken(SqlBaseParser.ERROR, i);
}
public TerminalNode EMPTY() { return getToken(SqlBaseParser.EMPTY, 0); }
public JsonTableContext(RelationPrimaryContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterJsonTable(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitJsonTable(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitJsonTable(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, 100, RULE_relationPrimary);
int _la;
try {
setState(1849);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,224,_ctx) ) {
case 1:
_localctx = new TableNameContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1778);
qualifiedName();
setState(1780);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,218,_ctx) ) {
case 1:
{
setState(1779);
queryPeriod();
}
break;
}
}
break;
case 2:
_localctx = new SubqueryRelationContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1782);
match(T__1);
setState(1783);
query();
setState(1784);
match(T__2);
}
break;
case 3:
_localctx = new UnnestContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1786);
match(UNNEST);
setState(1787);
match(T__1);
setState(1788);
expression();
setState(1793);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1789);
match(T__3);
setState(1790);
expression();
}
}
setState(1795);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1796);
match(T__2);
setState(1799);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,220,_ctx) ) {
case 1:
{
setState(1797);
match(WITH);
setState(1798);
match(ORDINALITY);
}
break;
}
}
break;
case 4:
_localctx = new LateralContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1801);
match(LATERAL);
setState(1802);
match(T__1);
setState(1803);
query();
setState(1804);
match(T__2);
}
break;
case 5:
_localctx = new TableFunctionInvocationContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(1806);
match(TABLE);
setState(1807);
match(T__1);
setState(1808);
tableFunctionCall();
setState(1809);
match(T__2);
}
break;
case 6:
_localctx = new ParenthesizedRelationContext(_localctx);
enterOuterAlt(_localctx, 6);
{
setState(1811);
match(T__1);
setState(1812);
relation(0);
setState(1813);
match(T__2);
}
break;
case 7:
_localctx = new JsonTableContext(_localctx);
enterOuterAlt(_localctx, 7);
{
setState(1815);
match(JSON_TABLE);
setState(1816);
match(T__1);
setState(1817);
jsonPathInvocation();
setState(1818);
match(COLUMNS);
setState(1819);
match(T__1);
setState(1820);
jsonTableColumn();
setState(1825);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1821);
match(T__3);
setState(1822);
jsonTableColumn();
}
}
setState(1827);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1828);
match(T__2);
setState(1840);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,222,_ctx) ) {
case 1:
{
setState(1829);
match(PLAN);
setState(1830);
match(T__1);
setState(1831);
jsonTableSpecificPlan();
setState(1832);
match(T__2);
}
break;
case 2:
{
setState(1834);
match(PLAN);
setState(1835);
match(DEFAULT);
setState(1836);
match(T__1);
setState(1837);
jsonTableDefaultPlan();
setState(1838);
match(T__2);
}
break;
}
setState(1845);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==EMPTY || _la==ERROR) {
{
setState(1842);
_la = _input.LA(1);
if ( !(_la==EMPTY || _la==ERROR) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1843);
match(ON);
setState(1844);
match(ERROR);
}
}
setState(1847);
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 JsonTableColumnContext extends ParserRuleContext {
public JsonTableColumnContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_jsonTableColumn; }
public JsonTableColumnContext() { }
public void copyFrom(JsonTableColumnContext ctx) {
super.copyFrom(ctx);
}
}
@SuppressWarnings("CheckReturnValue")
public static class QueryColumnContext extends JsonTableColumnContext {
public JsonQueryBehaviorContext emptyBehavior;
public JsonQueryBehaviorContext errorBehavior;
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode FORMAT() { return getToken(SqlBaseParser.FORMAT, 0); }
public JsonRepresentationContext jsonRepresentation() {
return getRuleContext(JsonRepresentationContext.class,0);
}
public TerminalNode PATH() { return getToken(SqlBaseParser.PATH, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public JsonQueryWrapperBehaviorContext jsonQueryWrapperBehavior() {
return getRuleContext(JsonQueryWrapperBehaviorContext.class,0);
}
public TerminalNode WRAPPER() { return getToken(SqlBaseParser.WRAPPER, 0); }
public TerminalNode QUOTES() { return getToken(SqlBaseParser.QUOTES, 0); }
public List ON() { return getTokens(SqlBaseParser.ON); }
public TerminalNode ON(int i) {
return getToken(SqlBaseParser.ON, i);
}
public TerminalNode EMPTY() { return getToken(SqlBaseParser.EMPTY, 0); }
public TerminalNode ERROR() { return getToken(SqlBaseParser.ERROR, 0); }
public TerminalNode KEEP() { return getToken(SqlBaseParser.KEEP, 0); }
public TerminalNode OMIT() { return getToken(SqlBaseParser.OMIT, 0); }
public List jsonQueryBehavior() {
return getRuleContexts(JsonQueryBehaviorContext.class);
}
public JsonQueryBehaviorContext jsonQueryBehavior(int i) {
return getRuleContext(JsonQueryBehaviorContext.class,i);
}
public TerminalNode SCALAR() { return getToken(SqlBaseParser.SCALAR, 0); }
public TerminalNode TEXT_STRING() { return getToken(SqlBaseParser.TEXT_STRING, 0); }
public QueryColumnContext(JsonTableColumnContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterQueryColumn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitQueryColumn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitQueryColumn(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class NestedColumnsContext extends JsonTableColumnContext {
public TerminalNode NESTED() { return getToken(SqlBaseParser.NESTED, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public TerminalNode COLUMNS() { return getToken(SqlBaseParser.COLUMNS, 0); }
public List jsonTableColumn() {
return getRuleContexts(JsonTableColumnContext.class);
}
public JsonTableColumnContext jsonTableColumn(int i) {
return getRuleContext(JsonTableColumnContext.class,i);
}
public TerminalNode PATH() { return getToken(SqlBaseParser.PATH, 0); }
public TerminalNode AS() { return getToken(SqlBaseParser.AS, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public NestedColumnsContext(JsonTableColumnContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterNestedColumns(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitNestedColumns(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitNestedColumns(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class ValueColumnContext extends JsonTableColumnContext {
public JsonValueBehaviorContext emptyBehavior;
public JsonValueBehaviorContext errorBehavior;
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TypeContext type() {
return getRuleContext(TypeContext.class,0);
}
public TerminalNode PATH() { return getToken(SqlBaseParser.PATH, 0); }
public StringContext string() {
return getRuleContext(StringContext.class,0);
}
public List ON() { return getTokens(SqlBaseParser.ON); }
public TerminalNode ON(int i) {
return getToken(SqlBaseParser.ON, i);
}
public TerminalNode EMPTY() { return getToken(SqlBaseParser.EMPTY, 0); }
public TerminalNode ERROR() { return getToken(SqlBaseParser.ERROR, 0); }
public List jsonValueBehavior() {
return getRuleContexts(JsonValueBehaviorContext.class);
}
public JsonValueBehaviorContext jsonValueBehavior(int i) {
return getRuleContext(JsonValueBehaviorContext.class,i);
}
public ValueColumnContext(JsonTableColumnContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterValueColumn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitValueColumn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitValueColumn(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class OrdinalityColumnContext extends JsonTableColumnContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public TerminalNode FOR() { return getToken(SqlBaseParser.FOR, 0); }
public TerminalNode ORDINALITY() { return getToken(SqlBaseParser.ORDINALITY, 0); }
public OrdinalityColumnContext(JsonTableColumnContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterOrdinalityColumn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitOrdinalityColumn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitOrdinalityColumn(this);
else return visitor.visitChildren(this);
}
}
public final JsonTableColumnContext jsonTableColumn() throws RecognitionException {
JsonTableColumnContext _localctx = new JsonTableColumnContext(_ctx, getState());
enterRule(_localctx, 102, RULE_jsonTableColumn);
int _la;
try {
setState(1928);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,237,_ctx) ) {
case 1:
_localctx = new OrdinalityColumnContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1851);
identifier();
setState(1852);
match(FOR);
setState(1853);
match(ORDINALITY);
}
break;
case 2:
_localctx = new ValueColumnContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1855);
identifier();
setState(1856);
type(0);
setState(1859);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PATH) {
{
setState(1857);
match(PATH);
setState(1858);
string();
}
}
setState(1865);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,226,_ctx) ) {
case 1:
{
setState(1861);
((ValueColumnContext)_localctx).emptyBehavior = jsonValueBehavior();
setState(1862);
match(ON);
setState(1863);
match(EMPTY);
}
break;
}
setState(1871);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==DEFAULT || _la==ERROR || _la==NULL) {
{
setState(1867);
((ValueColumnContext)_localctx).errorBehavior = jsonValueBehavior();
setState(1868);
match(ON);
setState(1869);
match(ERROR);
}
}
}
break;
case 3:
_localctx = new QueryColumnContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1873);
identifier();
setState(1874);
type(0);
setState(1875);
match(FORMAT);
setState(1876);
jsonRepresentation();
setState(1879);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PATH) {
{
setState(1877);
match(PATH);
setState(1878);
string();
}
}
setState(1884);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WITH || _la==WITHOUT) {
{
setState(1881);
jsonQueryWrapperBehavior();
setState(1882);
match(WRAPPER);
}
}
setState(1893);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==KEEP || _la==OMIT) {
{
setState(1886);
_la = _input.LA(1);
if ( !(_la==KEEP || _la==OMIT) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1887);
match(QUOTES);
setState(1891);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ON) {
{
setState(1888);
match(ON);
setState(1889);
match(SCALAR);
setState(1890);
match(TEXT_STRING);
}
}
}
}
setState(1899);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,232,_ctx) ) {
case 1:
{
setState(1895);
((QueryColumnContext)_localctx).emptyBehavior = jsonQueryBehavior();
setState(1896);
match(ON);
setState(1897);
match(EMPTY);
}
break;
}
setState(1905);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==EMPTY || _la==ERROR || _la==NULL) {
{
setState(1901);
((QueryColumnContext)_localctx).errorBehavior = jsonQueryBehavior();
setState(1902);
match(ON);
setState(1903);
match(ERROR);
}
}
}
break;
case 4:
_localctx = new NestedColumnsContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1907);
match(NESTED);
setState(1909);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PATH) {
{
setState(1908);
match(PATH);
}
}
setState(1911);
string();
setState(1914);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1912);
match(AS);
setState(1913);
identifier();
}
}
setState(1916);
match(COLUMNS);
setState(1917);
match(T__1);
setState(1918);
jsonTableColumn();
setState(1923);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==T__3) {
{
{
setState(1919);
match(T__3);
setState(1920);
jsonTableColumn();
}
}
setState(1925);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1926);
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 JsonTableSpecificPlanContext extends ParserRuleContext {
public JsonTableSpecificPlanContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_jsonTableSpecificPlan; }
public JsonTableSpecificPlanContext() { }
public void copyFrom(JsonTableSpecificPlanContext ctx) {
super.copyFrom(ctx);
}
}
@SuppressWarnings("CheckReturnValue")
public static class CrossPlanContext extends JsonTableSpecificPlanContext {
public List planPrimary() {
return getRuleContexts(PlanPrimaryContext.class);
}
public PlanPrimaryContext planPrimary(int i) {
return getRuleContext(PlanPrimaryContext.class,i);
}
public List CROSS() { return getTokens(SqlBaseParser.CROSS); }
public TerminalNode CROSS(int i) {
return getToken(SqlBaseParser.CROSS, i);
}
public CrossPlanContext(JsonTableSpecificPlanContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterCrossPlan(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitCrossPlan(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitCrossPlan(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class JoinPlanContext extends JsonTableSpecificPlanContext {
public JsonTablePathNameContext jsonTablePathName() {
return getRuleContext(JsonTablePathNameContext.class,0);
}
public PlanPrimaryContext planPrimary() {
return getRuleContext(PlanPrimaryContext.class,0);
}
public TerminalNode OUTER() { return getToken(SqlBaseParser.OUTER, 0); }
public TerminalNode INNER() { return getToken(SqlBaseParser.INNER, 0); }
public JoinPlanContext(JsonTableSpecificPlanContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterJoinPlan(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitJoinPlan(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitJoinPlan(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class LeafPlanContext extends JsonTableSpecificPlanContext {
public JsonTablePathNameContext jsonTablePathName() {
return getRuleContext(JsonTablePathNameContext.class,0);
}
public LeafPlanContext(JsonTableSpecificPlanContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterLeafPlan(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitLeafPlan(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitLeafPlan(this);
else return visitor.visitChildren(this);
}
}
@SuppressWarnings("CheckReturnValue")
public static class UnionPlanContext extends JsonTableSpecificPlanContext {
public List planPrimary() {
return getRuleContexts(PlanPrimaryContext.class);
}
public PlanPrimaryContext planPrimary(int i) {
return getRuleContext(PlanPrimaryContext.class,i);
}
public List UNION() { return getTokens(SqlBaseParser.UNION); }
public TerminalNode UNION(int i) {
return getToken(SqlBaseParser.UNION, i);
}
public UnionPlanContext(JsonTableSpecificPlanContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterUnionPlan(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitUnionPlan(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitUnionPlan(this);
else return visitor.visitChildren(this);
}
}
public final JsonTableSpecificPlanContext jsonTableSpecificPlan() throws RecognitionException {
JsonTableSpecificPlanContext _localctx = new JsonTableSpecificPlanContext(_ctx, getState());
enterRule(_localctx, 104, RULE_jsonTableSpecificPlan);
int _la;
try {
setState(1955);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,240,_ctx) ) {
case 1:
_localctx = new LeafPlanContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1930);
jsonTablePathName();
}
break;
case 2:
_localctx = new JoinPlanContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1931);
jsonTablePathName();
setState(1932);
_la = _input.LA(1);
if ( !(_la==INNER || _la==OUTER) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1933);
planPrimary();
}
break;
case 3:
_localctx = new UnionPlanContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1935);
planPrimary();
setState(1936);
match(UNION);
setState(1937);
planPrimary();
setState(1942);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==UNION) {
{
{
setState(1938);
match(UNION);
setState(1939);
planPrimary();
}
}
setState(1944);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
case 4:
_localctx = new CrossPlanContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(1945);
planPrimary();
setState(1946);
match(CROSS);
setState(1947);
planPrimary();
setState(1952);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==CROSS) {
{
{
setState(1948);
match(CROSS);
setState(1949);
planPrimary();
}
}
setState(1954);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class JsonTablePathNameContext extends ParserRuleContext {
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
public JsonTablePathNameContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_jsonTablePathName; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterJsonTablePathName(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitJsonTablePathName(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof SqlBaseVisitor ) return ((SqlBaseVisitor extends T>)visitor).visitJsonTablePathName(this);
else return visitor.visitChildren(this);
}
}
public final JsonTablePathNameContext jsonTablePathName() throws RecognitionException {
JsonTablePathNameContext _localctx = new JsonTablePathNameContext(_ctx, getState());
enterRule(_localctx, 106, RULE_jsonTablePathName);
try {
enterOuterAlt(_localctx, 1);
{
setState(1957);
identifier();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
@SuppressWarnings("CheckReturnValue")
public static class PlanPrimaryContext extends ParserRuleContext {
public JsonTablePathNameContext jsonTablePathName() {
return getRuleContext(JsonTablePathNameContext.class,0);
}
public JsonTableSpecificPlanContext jsonTableSpecificPlan() {
return getRuleContext(JsonTableSpecificPlanContext.class,0);
}
public PlanPrimaryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_planPrimary; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).enterPlanPrimary(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof SqlBaseListener ) ((SqlBaseListener)listener).exitPlanPrimary(this);
}
@Override
public