From 64d4ec7c2aec1837648b06a6f274e91317b091a7 Mon Sep 17 00:00:00 2001 From: h3n4l Date: Mon, 3 Nov 2025 17:47:11 +0800 Subject: [PATCH] feat: add PartiQL parser to monorepo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds the PartiQL parser from the standalone partiql-parser repository into the unified parser monorepo. Changes: - Added PartiQL grammar files (PartiQLLexer.g4, PartiQLParser.g4) - Added test infrastructure with 1 simple.sql example - Created Makefile for building and testing the parser - Updated package names from 'parser' to 'partiql' - Updated import paths to github.com/bytebase/parser/partiql - Updated CI workflow to include partiql in the test matrix - Generated parser files using ANTLR 4 with Go target - All tests passing successfully 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/tests.yml | 2 +- partiql/Makefile | 7 + partiql/PartiQLLexer.g4 | 543 + partiql/PartiQLParser.g4 | 686 + partiql/README.md | 19 + partiql/parser_test.go | 120 + partiql/partiql_lexer.go | 1938 ++ partiql/partiqlparser_base_listener.go | 1127 + partiql/partiqlparser_base_visitor.go | 740 + partiql/partiqlparser_listener.go | 1107 + partiql/partiqlparser_parser.go | 32752 +++++++++++++++++++++++ partiql/partiqlparser_visitor.go | 558 + partiql/simple.sql | 5 + 13 files changed, 39603 insertions(+), 1 deletion(-) create mode 100644 partiql/Makefile create mode 100644 partiql/PartiQLLexer.g4 create mode 100644 partiql/PartiQLParser.g4 create mode 100644 partiql/README.md create mode 100644 partiql/parser_test.go create mode 100644 partiql/partiql_lexer.go create mode 100644 partiql/partiqlparser_base_listener.go create mode 100644 partiql/partiqlparser_base_visitor.go create mode 100644 partiql/partiqlparser_listener.go create mode 100644 partiql/partiqlparser_parser.go create mode 100644 partiql/partiqlparser_visitor.go create mode 100644 partiql/simple.sql diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d07ed28..96dd1cd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,7 +34,7 @@ jobs: id: set-matrix run: | # List of all available parsers - ALL_PARSERS="redshift postgresql cql snowflake tsql doris trino plsql googlesql" + ALL_PARSERS="redshift postgresql cql snowflake tsql doris trino plsql googlesql mysql partiql" # Add more parsers here as they are added to the repository # ALL_PARSERS="redshift mysql postgresql" diff --git a/partiql/Makefile b/partiql/Makefile new file mode 100644 index 0000000..a095d71 --- /dev/null +++ b/partiql/Makefile @@ -0,0 +1,7 @@ +all: build test + +build: + antlr -Dlanguage=Go -package partiql -visitor -o . PartiQLLexer.g4 PartiQLParser.g4 + +test: + go test -v -run TestSimpleParse diff --git a/partiql/PartiQLLexer.g4 b/partiql/PartiQLLexer.g4 new file mode 100644 index 0000000..49a7dce --- /dev/null +++ b/partiql/PartiQLLexer.g4 @@ -0,0 +1,543 @@ +lexer grammar PartiQLLexer; + +options { + caseInsensitive = true; +} + +/** + * + * KEYWORDS + * + */ + +ABSOLUTE: 'ABSOLUTE'; +ACTION: 'ACTION'; +ADD: 'ADD'; +ALL: 'ALL'; +ALLOCATE: 'ALLOCATE'; +ALTER: 'ALTER'; +AND: 'AND'; +ANY: 'ANY'; +ARE: 'ARE'; +AS: 'AS'; +ASC: 'ASC'; +ASSERTION: 'ASSERTION'; +AT: 'AT'; +AUTHORIZATION: 'AUTHORIZATION'; +AVG: 'AVG'; +BEGIN: 'BEGIN'; +BETWEEN: 'BETWEEN'; +BIT: 'BIT'; +BIT_LENGTH: 'BIT_LENGTH'; +BY: 'BY'; +CASCADE: 'CASCADE'; +CASCADED: 'CASCADED'; +CASE: 'CASE'; +CAST: 'CAST'; +CATALOG: 'CATALOG'; +CHAR: 'CHAR'; +CHARACTER: 'CHARACTER'; +CHARACTER_LENGTH: 'CHARACTER_LENGTH'; +CHAR_LENGTH: 'CHAR_LENGTH'; +CHECK: 'CHECK'; +CLOSE: 'CLOSE'; +COALESCE: 'COALESCE'; +COLLATE: 'COLLATE'; +COLLATION: 'COLLATION'; +COLUMN: 'COLUMN'; +COMMIT: 'COMMIT'; +CONNECT: 'CONNECT'; +CONNECTION: 'CONNECTION'; +CONSTRAINT: 'CONSTRAINT'; +CONSTRAINTS: 'CONSTRAINTS'; +CONTINUE: 'CONTINUE'; +CONVERT: 'CONVERT'; +CORRESPONDING: 'CORRESPONDING'; +COUNT: 'COUNT'; +CREATE: 'CREATE'; +CROSS: 'CROSS'; +CURRENT: 'CURRENT'; +CURRENT_DATE: 'CURRENT_DATE'; +CURRENT_TIME: 'CURRENT_TIME'; +CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; +CURRENT_USER: 'CURRENT_USER'; +CURSOR: 'CURSOR'; +DATE: 'DATE'; +DEALLOCATE: 'DEALLOCATE'; +DEC: 'DEC'; +DECIMAL: 'DECIMAL'; +DECLARE: 'DECLARE'; +DEFAULT: 'DEFAULT'; +DEFERRABLE: 'DEFERRABLE'; +DEFERRED: 'DEFERRED'; +DELETE: 'DELETE'; +DESC: 'DESC'; +DESCRIBE: 'DESCRIBE'; +DESCRIPTOR: 'DESCRIPTOR'; +DIAGNOSTICS: 'DIAGNOSTICS'; +DISCONNECT: 'DISCONNECT'; +DISTINCT: 'DISTINCT'; +DOMAIN: 'DOMAIN'; +DOUBLE: 'DOUBLE'; +DROP: 'DROP'; +ELSE: 'ELSE'; +END: 'END'; +END_EXEC: 'END-EXEC'; +ESCAPE: 'ESCAPE'; +EXCEPT: 'EXCEPT'; +EXCEPTION: 'EXCEPTION'; +EXCLUDED: 'EXCLUDED'; +EXEC: 'EXEC'; +EXECUTE: 'EXECUTE'; +EXISTS: 'EXISTS'; +EXPLAIN: 'EXPLAIN'; +EXTERNAL: 'EXTERNAL'; +EXTRACT: 'EXTRACT'; +DATE_ADD: 'DATE_ADD'; +DATE_DIFF: 'DATE_DIFF'; +FALSE: 'FALSE'; +FETCH: 'FETCH'; +FIRST: 'FIRST'; +FLOAT: 'FLOAT'; +FOR: 'FOR'; +FOREIGN: 'FOREIGN'; +FOUND: 'FOUND'; +FROM: 'FROM'; +FULL: 'FULL'; +GET: 'GET'; +GLOBAL: 'GLOBAL'; +GO: 'GO'; +GOTO: 'GOTO'; +GRANT: 'GRANT'; +GROUP: 'GROUP'; +HAVING: 'HAVING'; +IDENTITY: 'IDENTITY'; +IMMEDIATE: 'IMMEDIATE'; +IN: 'IN'; +INDICATOR: 'INDICATOR'; +INITIALLY: 'INITIALLY'; +INNER: 'INNER'; +INPUT: 'INPUT'; +INSENSITIVE: 'INSENSITIVE'; +INSERT: 'INSERT'; +INT: 'INT'; +INTEGER: 'INTEGER'; +INTERSECT: 'INTERSECT'; +INTERVAL: 'INTERVAL'; +INTO: 'INTO'; +IS: 'IS'; +ISOLATION: 'ISOLATION'; +JOIN: 'JOIN'; +KEY: 'KEY'; +LANGUAGE: 'LANGUAGE'; +LAST: 'LAST'; +LATERAL: 'LATERAL'; +LEFT: 'LEFT'; +LEVEL: 'LEVEL'; +LIKE: 'LIKE'; +LOCAL: 'LOCAL'; +LOWER: 'LOWER'; +MATCH: 'MATCH'; +MAX: 'MAX'; +MIN: 'MIN'; +MODULE: 'MODULE'; +NAMES: 'NAMES'; +NATIONAL: 'NATIONAL'; +NATURAL: 'NATURAL'; +NCHAR: 'NCHAR'; +NEXT: 'NEXT'; +NO: 'NO'; +NOT: 'NOT'; +NULL: 'NULL'; +NULLS: 'NULLS'; +NULLIF: 'NULLIF'; +NUMERIC: 'NUMERIC'; +OCTET_LENGTH: 'OCTET_LENGTH'; +OF: 'OF'; +ON: 'ON'; +ONLY: 'ONLY'; +OPEN: 'OPEN'; +OPTION: 'OPTION'; +OR: 'OR'; +ORDER: 'ORDER'; +OUTER: 'OUTER'; +OUTPUT: 'OUTPUT'; +OVERLAPS: 'OVERLAPS'; +OVERLAY: 'OVERLAY'; +PAD: 'PAD'; +PARTIAL: 'PARTIAL'; +PLACING: 'PLACING'; +POSITION: 'POSITION'; +PRECISION: 'PRECISION'; +PREPARE: 'PREPARE'; +PRESERVE: 'PRESERVE'; +PRIMARY: 'PRIMARY'; +PRIOR: 'PRIOR'; +PRIVILEGES: 'PRIVILEGES'; +PROCEDURE: 'PROCEDURE'; +PUBLIC: 'PUBLIC'; +READ: 'READ'; +REAL: 'REAL'; +REFERENCES: 'REFERENCES'; +RELATIVE: 'RELATIVE'; +REPLACE: 'REPLACE'; +RESTRICT: 'RESTRICT'; +REVOKE: 'REVOKE'; +RIGHT: 'RIGHT'; +ROLLBACK: 'ROLLBACK'; +ROWS: 'ROWS'; +SCHEMA: 'SCHEMA'; +SCROLL: 'SCROLL'; +SECTION: 'SECTION'; +SELECT: 'SELECT'; +SESSION: 'SESSION'; +SESSION_USER: 'SESSION_USER'; +SET: 'SET'; +SHORTEST: 'SHORTEST'; +SIZE: 'SIZE'; +SMALLINT: 'SMALLINT'; +SOME: 'SOME'; +SPACE: 'SPACE'; +SQL: 'SQL'; +SQLCODE: 'SQLCODE'; +SQLERROR: 'SQLERROR'; +SQLSTATE: 'SQLSTATE'; +SUBSTRING: 'SUBSTRING'; +SUM: 'SUM'; +SYSTEM_USER: 'SYSTEM_USER'; +TABLE: 'TABLE'; +TEMPORARY: 'TEMPORARY'; +THEN: 'THEN'; +TIME: 'TIME'; +TIMESTAMP: 'TIMESTAMP'; +TO: 'TO'; +TRANSACTION: 'TRANSACTION'; +TRANSLATE: 'TRANSLATE'; +TRANSLATION: 'TRANSLATION'; +TRIM: 'TRIM'; +TRUE: 'TRUE'; +UNION: 'UNION'; +UNIQUE: 'UNIQUE'; +UNKNOWN: 'UNKNOWN'; +UPDATE: 'UPDATE'; +UPPER: 'UPPER'; +UPSERT: 'UPSERT'; +USAGE: 'USAGE'; +USER: 'USER'; +USING: 'USING'; +VALUE: 'VALUE'; +VALUES: 'VALUES'; +VARCHAR: 'VARCHAR'; +VARYING: 'VARYING'; +VIEW: 'VIEW'; +WHEN: 'WHEN'; +WHENEVER: 'WHENEVER'; +WHERE: 'WHERE'; +WITH: 'WITH'; +WORK: 'WORK'; +WRITE: 'WRITE'; +ZONE: 'ZONE'; + + +/** + * window related + */ +LAG: 'LAG'; +LEAD: 'LEAD'; +OVER: 'OVER'; +PARTITION: 'PARTITION'; + + +/** + * OTHER + */ +CAN_CAST: 'CAN_CAST'; +CAN_LOSSLESS_CAST: 'CAN_LOSSLESS_CAST'; +MISSING: 'MISSING'; +PIVOT: 'PIVOT'; +UNPIVOT: 'UNPIVOT'; +LIMIT: 'LIMIT'; +OFFSET: 'OFFSET'; +REMOVE: 'REMOVE'; +INDEX: 'INDEX'; +LET: 'LET'; +CONFLICT: 'CONFLICT'; +DO: 'DO'; +RETURNING: 'RETURNING'; +MODIFIED: 'MODIFIED'; +NEW: 'NEW'; +OLD: 'OLD'; +NOTHING: 'NOTHING'; + +/** + * + * DATA TYPES + * + */ + +TUPLE: 'TUPLE'; +INTEGER2: 'INTEGER2'; +INT2: 'INT2'; +INTEGER4: 'INTEGER4'; +INT4: 'INT4'; +INTEGER8: 'INTEGER8'; +INT8: 'INT8'; +BIGINT: 'BIGINT'; +BOOL: 'BOOL'; +BOOLEAN: 'BOOLEAN'; +STRING: 'STRING'; +SYMBOL: 'SYMBOL'; +CLOB: 'CLOB'; +BLOB: 'BLOB'; +STRUCT: 'STRUCT'; +LIST: 'LIST'; +SEXP: 'SEXP'; +BAG: 'BAG'; + +/** + * + * OPERATORS AND LITERALS + * + */ + +CARET: '^'; +COMMA: ','; +PLUS: '+'; +MINUS: '-'; +SLASH_FORWARD: '/'; +PERCENT: '%'; +AT_SIGN: '@'; +TILDE: '~'; +ASTERISK: '*'; +LT_EQ: '<='; +GT_EQ: '>='; +EQ: '='; +NEQ: '<>' | '!='; +CONCAT: '||'; +ANGLE_LEFT: '<'; +ANGLE_RIGHT: '>'; +ANGLE_DOUBLE_LEFT: '<<'; +ANGLE_DOUBLE_RIGHT: '>>'; +BRACKET_LEFT: '['; +BRACKET_RIGHT: ']'; +BRACE_LEFT: '{'; +BRACE_RIGHT: '}'; +PAREN_LEFT: '('; +PAREN_RIGHT: ')'; +BACKTICK: '`' -> more, pushMode(ION); +COLON: ':'; +COLON_SEMI: ';'; +QUESTION_MARK: '?'; +PERIOD: '.'; + +/** + * + * LITERALS & IDENTIFIERS + * + */ + +LITERAL_STRING + : '\'' ( ('\'\'') | ~('\'') )* '\''; + +LITERAL_INTEGER + : DIGIT DIGIT*; + +LITERAL_DECIMAL: + DIGIT+ '.' DIGIT* ([e] [+-]? DIGIT+)? + | '.' DIGIT DIGIT* ([e] [+-]? DIGIT+)? + | DIGIT DIGIT* ([e] [+-]? DIGIT+)? + ; + +IDENTIFIER + : [A-Z$_][A-Z0-9$_]*; + +IDENTIFIER_QUOTED + : '"' ( ('""') | ~('"') )* '"'; + +/** + * + * TO IGNORE + * + */ + +WS + : WHITESPACE -> channel(HIDDEN); + +COMMENT_SINGLE + : '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN); + +COMMENT_BLOCK + : '/*' .*? '*/' -> channel(HIDDEN); + +UNRECOGNIZED + : . ; + +/** + * + * FRAGMENTS + * + */ + +fragment DIGIT + : [0-9]; + +fragment LETTER + : [A-Z]; + +fragment LETTER_NOT + : ~[A-Z]; + +fragment WHITESPACE + : [ \r\n\t]; + +/** + * + * ION MODE + * Note: This is largely copied from Ion's public ANTLR grammar, but this is used in a very specific manner in PartiQL's + * grammar. We use a Lexer Grammar because it allows multiple modes (languages), and whenever we find a straggling + * backtick, we use pushMode() to enter Ion's grammar/mode. From there, since we don't necessarily care about the semantics of + * Ion, we need to capture *everything* until we see a standalone backtick. So, the only tokens we need to watch out for + * are tokens that *may* include a backtick in its contents (such as comments, strings, and quoted symbols). We use the + * `-> more` annotation to accumulate all of the received Ion tokens into a single PartiQL token (ION_CLOSURE). That + * indicates when we've received a standalone backtick and can pop out from Ion's grammar. + * + */ + +mode ION; + +ION_INLINE_COMMENT + : '//' .*? (ION_NEWLINE | EOF) -> more; + +ION_BLOCK_COMMENT + : '/*' .*? '*/' -> more; + +ION_BLOB + : LOB_START (BASE_64_QUARTET | WS)* BASE_64_PAD? WS* LOB_END -> more; + +SHORT_QUOTED_STRING + : SHORT_QUOTE STRING_SHORT_TEXT SHORT_QUOTE -> more + ; + +LONG_QUOTED_STRING + : LONG_QUOTE STRING_LONG_TEXT LONG_QUOTE -> more + ; + +QUOTED_SYMBOL + : SYMBOL_QUOTE SYMBOL_TEXT SYMBOL_QUOTE -> more; + +ION_CLOSURE: '`' -> popMode; + +ION_ANY: . -> more; + +fragment ION_NEWLINE + : '\u000D\u000A' + | '\u000D' + | '\u000A' + ; + +fragment SHORT_QUOTE + : '"'; + +fragment LONG_QUOTE + : '\'\'\''; + +fragment STRING_SHORT_TEXT + : (TEXT_ESCAPE | STRING_SHORT_TEXT_ALLOWED)*; + +fragment STRING_LONG_TEXT + : (TEXT_ESCAPE | STRING_LONG_TEXT_ALLOWED)*?; + +// non-control Unicode and not double quote or backslash +fragment STRING_SHORT_TEXT_ALLOWED + : '\u0020'..'\u0021' // no C1 control characters and no U+0022 double quote + | '\u0023'..'\u005B' // no U+005C backslash + | '\u005D'..'\uFFFF' // FIXME should be up to U+10FFFF + | WS_NOT_NL + ; + +// non-control Unicode (newlines are OK) +fragment STRING_LONG_TEXT_ALLOWED + : '\u0020'..'\u005B' // no C1 control characters and no U+005C blackslash + | '\u005D'..'\uFFFF' // FIXME should be up to U+10FFFF + | WS + ; + +fragment TEXT_ESCAPE + : COMMON_ESCAPE | HEX_ESCAPE | UNICODE_ESCAPE; + +fragment LOB_START + : '{{'; + +fragment LOB_END + : '}}'; + +fragment BASE_64_PAD + : BASE_64_PAD1 + | BASE_64_PAD2 + ; + +fragment BASE_64_QUARTET + : BASE_64_CHAR WS* BASE_64_CHAR WS* BASE_64_CHAR WS* BASE_64_CHAR; + +fragment BASE_64_PAD1 + : BASE_64_CHAR WS* BASE_64_CHAR WS* BASE_64_CHAR WS* '='; + +fragment BASE_64_PAD2 + : BASE_64_CHAR WS* BASE_64_CHAR WS* '=' WS* '='; + +fragment BASE_64_CHAR + : [0-9A-Z+/]; + +fragment SYMBOL_TEXT + : (TEXT_ESCAPE | SYMBOL_TEXT_ALLOWED)*; + +fragment SYMBOL_TEXT_ALLOWED + : '\u0020'..'\u0026' // no C1 control characters and no U+0027 single quote + | '\u0028'..'\u005B' // no U+005C backslash + | '\u005D'..'\uFFFF' // should be up to U+10FFFF + | WS_NOT_NL + ; + +fragment COMMON_ESCAPE + : '\\' COMMON_ESCAPE_CODE; + +fragment COMMON_ESCAPE_CODE + : 'a' + | 'b' + | 't' + | 'n' + | 'f' + | 'r' + | 'v' + | '?' + | '0' + | '\'' + | '"' + | '/' + | '\\' + | ION_NEWLINE + ; + +fragment HEX_ESCAPE + : '\\x' HEX_DIGIT HEX_DIGIT; + +fragment UNICODE_ESCAPE + : '\\u' HEX_DIGIT_QUARTET + | '\\U000' HEX_DIGIT_QUARTET HEX_DIGIT + | '\\U0010' HEX_DIGIT_QUARTET + ; + +fragment HEX_DIGIT_QUARTET + : HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT; + +fragment HEX_DIGIT + : [0-9A-F]; + +fragment WS_NOT_NL + : '\u0009' // tab + | '\u000B' // vertical tab + | '\u000C' // form feed + | '\u0020' // space + ; + +fragment SYMBOL_QUOTE : '\''; \ No newline at end of file diff --git a/partiql/PartiQLParser.g4 b/partiql/PartiQLParser.g4 new file mode 100644 index 0000000..2362f4d --- /dev/null +++ b/partiql/PartiQLParser.g4 @@ -0,0 +1,686 @@ +grammar PartiQLParser; + +options { + tokenVocab=PartiQLLexer; + caseInsensitive = true; +} + +/** + * + * TOP LEVEL + * + */ + +script: + root (COLON_SEMI root)* COLON_SEMI? EOF; + +root + : (EXPLAIN (PAREN_LEFT explainOption (COMMA explainOption)* PAREN_RIGHT)? )? statement; + +statement + : dql # QueryDql + | dml # QueryDml + | ddl # QueryDdl + | execCommand # QueryExec + ; + +/** + * + * COMMON STRUCTURES + * + */ + +explainOption + : param=IDENTIFIER value=IDENTIFIER; + +asIdent + : AS symbolPrimitive; + +atIdent + : AT symbolPrimitive; + +byIdent + : BY symbolPrimitive; + +symbolPrimitive + : ident=( IDENTIFIER | IDENTIFIER_QUOTED ) + ; + +/** + * + * DATA QUERY LANGUAGE (DQL) + * + */ + +dql + : expr; + +/** + * + * EXECUTE + * + */ + +execCommand + : EXEC name=expr ( args+=expr ( COMMA args+=expr )* )?; + +/** + * + * DATA DEFINITION LANGUAGE (DDL) + * + */ + +ddl + : createCommand + | dropCommand + ; + +createCommand + : CREATE TABLE symbolPrimitive # CreateTable + | CREATE INDEX ON symbolPrimitive PAREN_LEFT pathSimple ( COMMA pathSimple )* PAREN_RIGHT # CreateIndex + ; + +dropCommand + : DROP TABLE target=symbolPrimitive # DropTable + | DROP INDEX target=symbolPrimitive ON on=symbolPrimitive # DropIndex + ; + +/** + * + * DATA MANIPULATION LANGUAGE (DML) + * + */ + +dml + : updateClause dmlBaseCommand+ whereClause? returningClause? # DmlBaseWrapper + | fromClause whereClause? dmlBaseCommand+ returningClause? # DmlBaseWrapper + | deleteCommand # DmlDelete + | insertCommandReturning # DmlInsertReturning + | dmlBaseCommand # DmlBase + ; + +dmlBaseCommand + : insertCommand + | setCommand + | replaceCommand + | removeCommand + | upsertCommand + ; + +pathSimple + : symbolPrimitive pathSimpleSteps*; + +pathSimpleSteps + : BRACKET_LEFT key=literal BRACKET_RIGHT # PathSimpleLiteral + | BRACKET_LEFT key=symbolPrimitive BRACKET_RIGHT # PathSimpleSymbol + | PERIOD key=symbolPrimitive # PathSimpleDotSymbol + ; + +// Based on https://github.com/partiql/partiql-lang/blob/main/RFCs/0011-partiql-insert.md +replaceCommand + : REPLACE INTO symbolPrimitive asIdent? value=expr; + +// Based on https://github.com/partiql/partiql-lang/blob/main/RFCs/0011-partiql-insert.md +upsertCommand + : UPSERT INTO symbolPrimitive asIdent? value=expr; + +removeCommand + : REMOVE pathSimple; + +insertCommandReturning + : INSERT INTO pathSimple VALUE value=expr ( AT pos=expr )? onConflictClause? returningClause?; + +insertCommand + : INSERT INTO pathSimple VALUE value=expr ( AT pos=expr )? onConflictClause? # InsertLegacy + // See the Grammar at https://github.com/partiql/partiql-lang/blob/main/RFCs/0011-partiql-insert.md#2-proposed-grammar-and-semantics + | INSERT INTO symbolPrimitive asIdent? value=expr onConflictClause? # Insert + ; + +onConflictClause + : ON CONFLICT WHERE expr DO NOTHING # OnConflictLegacy + | ON CONFLICT conflictTarget? conflictAction # OnConflict + ; + +/** + ::= + ( [, ]... ) + | ( { | } ) + | ON CONSTRAINT +*/ +conflictTarget + : PAREN_LEFT symbolPrimitive (COMMA symbolPrimitive)* PAREN_RIGHT + | ON CONSTRAINT constraintName; + +constraintName + : symbolPrimitive; + +conflictAction + : DO NOTHING + | DO REPLACE doReplace + | DO UPDATE doUpdate; + +/* + ::= EXCLUDED + | SET [, ]... + | VALUE + [ WHERE ] +*/ +doReplace + : EXCLUDED; + // :TODO add the rest of the grammar + +/* + ::= EXCLUDED + | SET [, ]... + | VALUE + [ WHERE ] +*/ +doUpdate + : EXCLUDED; + // :TODO add the rest of the grammar + +updateClause + : UPDATE tableBaseReference; + +setCommand + : SET setAssignment ( COMMA setAssignment )*; + +setAssignment + : pathSimple EQ expr; + +deleteCommand + : DELETE fromClauseSimple whereClause? returningClause?; + +returningClause + : RETURNING returningColumn ( COMMA returningColumn )*; + +returningColumn + : status=(MODIFIED|ALL) age=(OLD|NEW) ASTERISK + | status=(MODIFIED|ALL) age=(OLD|NEW) col=expr + ; + +fromClauseSimple + : FROM pathSimple asIdent? atIdent? byIdent? # FromClauseSimpleExplicit + | FROM pathSimple symbolPrimitive # FromClauseSimpleImplicit + ; + +whereClause + : WHERE arg=expr; + +/** + * + * SELECT AND PROJECTION + * + */ + +selectClause + : SELECT setQuantifierStrategy? ASTERISK # SelectAll + | SELECT setQuantifierStrategy? projectionItems # SelectItems + | SELECT setQuantifierStrategy? VALUE expr # SelectValue + | PIVOT pivot=expr AT at=expr # SelectPivot + ; + +projectionItems + : projectionItem ( COMMA projectionItem )* ; + +projectionItem + : expr ( AS? symbolPrimitive )? ; + +setQuantifierStrategy + : DISTINCT + | ALL + ; + +/** + * LET CLAUSE + */ + +letClause + : LET letBinding ( COMMA letBinding )*; + +letBinding + : expr AS symbolPrimitive; + +/** + * + * ORDER BY CLAUSE + * + */ + +orderByClause + : ORDER BY orderSortSpec ( COMMA orderSortSpec )*; + +orderSortSpec + : expr dir=(ASC|DESC)? (NULLS nulls=(FIRST|LAST))?; + +/** + * + * GROUP CLAUSE + * + */ + +groupClause + : GROUP PARTIAL? BY groupKey ( COMMA groupKey )* groupAlias?; + +groupAlias + : GROUP AS symbolPrimitive; + +groupKey + : key=exprSelect (AS symbolPrimitive)?; + +/** + * + * Window Function + */ + +over + : OVER PAREN_LEFT windowPartitionList? windowSortSpecList? PAREN_RIGHT + ; + +windowPartitionList + : PARTITION BY expr (COMMA expr)* + ; + +windowSortSpecList + : ORDER BY orderSortSpec (COMMA orderSortSpec)* + ; + +/** + * + * SIMPLE CLAUSES + * + */ + +havingClause + : HAVING arg=exprSelect; + +fromClause + : FROM tableReference; + +whereClauseSelect + : WHERE arg=exprSelect; + +offsetByClause + : OFFSET arg=exprSelect; + +limitClause + : LIMIT arg=exprSelect; + +/** + * + * GRAPH PATTERN MATCHING LANGUAGE (GPML) + * + */ + +gpmlPattern + : selector=matchSelector? matchPattern; + +gpmlPatternList + : selector=matchSelector? matchPattern ( COMMA matchPattern )*; + +matchPattern + : restrictor=patternRestrictor? variable=patternPathVariable? graphPart*; + +graphPart + : node + | edge + | pattern + ; + +matchSelector + : mod=(ANY|ALL) SHORTEST # SelectorBasic + | ANY k=LITERAL_INTEGER? # SelectorAny + | SHORTEST k=LITERAL_INTEGER GROUP? # SelectorShortest + ; + +patternPathVariable + : symbolPrimitive EQ; + +patternRestrictor // Should be TRAIL / ACYCLIC / SIMPLE + : restrictor=IDENTIFIER; + +node + : PAREN_LEFT symbolPrimitive? patternPartLabel? whereClause? PAREN_RIGHT; + +edge + : edgeWSpec quantifier=patternQuantifier? # EdgeWithSpec + | edgeAbbrev quantifier=patternQuantifier? # EdgeAbbreviated + ; + +pattern + : PAREN_LEFT restrictor=patternRestrictor? variable=patternPathVariable? graphPart+ where=whereClause? PAREN_RIGHT quantifier=patternQuantifier? + | BRACKET_LEFT restrictor=patternRestrictor? variable=patternPathVariable? graphPart+ where=whereClause? BRACKET_RIGHT quantifier=patternQuantifier? + ; + +patternQuantifier + : quant=( PLUS | ASTERISK ) + | BRACE_LEFT lower=LITERAL_INTEGER COMMA upper=LITERAL_INTEGER? BRACE_RIGHT + ; + +edgeWSpec + : MINUS edgeSpec MINUS ANGLE_RIGHT # EdgeSpecRight + | TILDE edgeSpec TILDE # EdgeSpecUndirected + | ANGLE_LEFT MINUS edgeSpec MINUS # EdgeSpecLeft + | TILDE edgeSpec TILDE ANGLE_RIGHT # EdgeSpecUndirectedRight + | ANGLE_LEFT TILDE edgeSpec TILDE # EdgeSpecUndirectedLeft + | ANGLE_LEFT MINUS edgeSpec MINUS ANGLE_RIGHT # EdgeSpecBidirectional + | MINUS edgeSpec MINUS # EdgeSpecUndirectedBidirectional + ; + +edgeSpec + : BRACKET_LEFT symbolPrimitive? patternPartLabel? whereClause? BRACKET_RIGHT; + +patternPartLabel + : COLON symbolPrimitive; + +edgeAbbrev + : TILDE + | TILDE ANGLE_RIGHT + | ANGLE_LEFT TILDE + | ANGLE_LEFT? MINUS ANGLE_RIGHT? + ; + +/** + * + * TABLES & JOINS + * + */ + +tableReference + : lhs=tableReference joinType? CROSS JOIN rhs=joinRhs # TableCrossJoin + | lhs=tableReference COMMA rhs=joinRhs # TableCrossJoin + | lhs=tableReference joinType? JOIN rhs=joinRhs joinSpec # TableQualifiedJoin + | tableNonJoin # TableRefBase + | PAREN_LEFT tableReference PAREN_RIGHT # TableWrapped + ; + +tableNonJoin + : tableBaseReference + | tableUnpivot + ; + +tableBaseReference + : source=exprSelect symbolPrimitive # TableBaseRefSymbol + | source=exprSelect asIdent? atIdent? byIdent? # TableBaseRefClauses + | source=exprGraphMatchOne asIdent? atIdent? byIdent? # TableBaseRefMatch + ; + +tableUnpivot + : UNPIVOT expr asIdent? atIdent? byIdent?; + +joinRhs + : tableNonJoin # JoinRhsBase + | PAREN_LEFT tableReference PAREN_RIGHT # JoinRhsTableJoined + ; + +joinSpec + : ON expr; + +joinType + : mod=INNER + | mod=LEFT OUTER? + | mod=RIGHT OUTER? + | mod=FULL OUTER? + | mod=OUTER + ; + +/** + * + * EXPRESSIONS & PRECEDENCE + * + * Precedence Table: + * 1. Primary Expressions: Functions, Literals, Paths, Identifiers, etc (ex: a, f(a), 1, a.b, "a") + * 2. Unary plus, minus (ex: -a, +a) + * 3. Multiplication, Division, Modulo (ex: a * b) + * 4. Addition, Subtraction (ex: a + b) + * 5. Other operators (ex: a || b) + * 6. Predicates (ex: a LIKE b, a < b, a IN b, a = b) + * 7. IS true/false. Not yet implemented in PartiQL, but defined in SQL-92. (ex: a IS TRUE) + * 8. NOT (ex: NOT a) + * 8. AND (ex: a AND b) + * 9. OR (ex: a OR b) + * + */ + +expr + : exprBagOp + ; + +exprBagOp + : lhs=exprBagOp OUTER? EXCEPT (DISTINCT|ALL)? rhs=exprSelect # Except + | lhs=exprBagOp OUTER? UNION (DISTINCT|ALL)? rhs=exprSelect # Union + | lhs=exprBagOp OUTER? INTERSECT (DISTINCT|ALL)? rhs=exprSelect # Intersect + | exprSelect # QueryBase + ; + +exprSelect + : select=selectClause + from=fromClause + let=letClause? + where=whereClauseSelect? + group=groupClause? + having=havingClause? + order=orderByClause? + limit=limitClause? + offset=offsetByClause? # SfwQuery + | exprOr # SfwBase + ; + +exprOr + : lhs=exprOr OR rhs=exprAnd # Or + | parent_=exprAnd # ExprOrBase + ; + +exprAnd + : lhs=exprAnd op=AND rhs=exprNot # And + | parent_=exprNot # ExprAndBase + ; + +exprNot + : op=NOT rhs=exprNot # Not + | parent_=exprPredicate # ExprNotBase + ; + +exprPredicate + : lhs=exprPredicate op=(LT_EQ|GT_EQ|ANGLE_LEFT|ANGLE_RIGHT|NEQ|EQ) rhs=mathOp00 # PredicateComparison + | lhs=exprPredicate IS NOT? type # PredicateIs + | lhs=exprPredicate NOT? IN PAREN_LEFT expr PAREN_RIGHT # PredicateIn + | lhs=exprPredicate NOT? IN rhs=mathOp00 # PredicateIn + | lhs=exprPredicate NOT? LIKE rhs=mathOp00 ( ESCAPE escape=expr )? # PredicateLike + | lhs=exprPredicate NOT? BETWEEN lower=mathOp00 AND upper=mathOp00 # PredicateBetween + | parent_=mathOp00 # PredicateBase + ; + +mathOp00 + : lhs=mathOp00 op=CONCAT rhs=mathOp01 + | parent_=mathOp01 + ; + +mathOp01 + : lhs=mathOp01 op=(PLUS|MINUS) rhs=mathOp02 + | parent_=mathOp02 + ; + +mathOp02 + : lhs=mathOp02 op=(PERCENT|ASTERISK|SLASH_FORWARD) rhs=valueExpr + | parent_=valueExpr + ; + +valueExpr + : sign=(PLUS|MINUS) rhs=valueExpr + | parent_=exprPrimary + ; + +exprPrimary + : exprTerm # ExprPrimaryBase + | cast # ExprPrimaryBase + | sequenceConstructor # ExprPrimaryBase + | substring # ExprPrimaryBase + | canCast # ExprPrimaryBase + | canLosslessCast # ExprPrimaryBase + | extract # ExprPrimaryBase + | coalesce # ExprPrimaryBase + | dateFunction # ExprPrimaryBase + | aggregate # ExprPrimaryBase + | trimFunction # ExprPrimaryBase + | functionCall # ExprPrimaryBase + | nullIf # ExprPrimaryBase + | exprPrimary pathStep+ # ExprPrimaryPath + | exprGraphMatchMany # ExprPrimaryBase + | caseExpr # ExprPrimaryBase + | valueList # ExprPrimaryBase + | values # ExprPrimaryBase + | windowFunction # ExprPrimaryBase + ; + +/** + * + * PRIMARY EXPRESSIONS + * + */ + +exprTerm + : PAREN_LEFT expr PAREN_RIGHT # ExprTermWrappedQuery + | parameter # ExprTermBase + | varRefExpr # ExprTermBase + | literal # ExprTermBase + | collection # ExprTermBase + | tuple # ExprTermBase + ; + +nullIf + : NULLIF PAREN_LEFT expr COMMA expr PAREN_RIGHT; + +coalesce + : COALESCE PAREN_LEFT expr ( COMMA expr )* PAREN_RIGHT; + +caseExpr + : CASE case=expr? (WHEN whens+=expr THEN thens+=expr)+ (ELSE else=expr)? END; + +values + : VALUES valueRow ( COMMA valueRow )*; + +valueRow + : PAREN_LEFT expr ( COMMA expr )* PAREN_RIGHT; + +valueList + : PAREN_LEFT expr ( COMMA expr )+ PAREN_RIGHT; + +sequenceConstructor + : datatype=(LIST|SEXP) PAREN_LEFT (expr ( COMMA expr )* )? PAREN_RIGHT; + +substring + : SUBSTRING PAREN_LEFT expr ( COMMA expr ( COMMA expr )? )? PAREN_RIGHT + | SUBSTRING PAREN_LEFT expr ( FROM expr ( FOR expr )? )? PAREN_RIGHT + ; + +aggregate + : func=COUNT PAREN_LEFT ASTERISK PAREN_RIGHT # CountAll + | func=(COUNT|MAX|MIN|SUM|AVG) PAREN_LEFT setQuantifierStrategy? expr PAREN_RIGHT # AggregateBase + ; + +/** +* +* Supported Window Functions: +* 1. LAG(expr, [offset [, default]]) OVER([window_partition] window_ordering) +* 2. LEAD(expr, [offset [, default]]) OVER([window_partition] window_ordering) +* +*/ +windowFunction + : func=(LAG|LEAD) PAREN_LEFT expr ( COMMA expr (COMMA expr)?)? PAREN_RIGHT over #LagLeadFunction + ; + +cast + : CAST PAREN_LEFT expr AS type PAREN_RIGHT; + +canLosslessCast + : CAN_LOSSLESS_CAST PAREN_LEFT expr AS type PAREN_RIGHT; + +canCast + : CAN_CAST PAREN_LEFT expr AS type PAREN_RIGHT; + +extract + : EXTRACT PAREN_LEFT IDENTIFIER FROM rhs=expr PAREN_RIGHT; + +trimFunction + : func=TRIM PAREN_LEFT ( mod=IDENTIFIER? sub=expr? FROM )? target=expr PAREN_RIGHT; + +dateFunction + : func=(DATE_ADD|DATE_DIFF) PAREN_LEFT dt=IDENTIFIER COMMA expr COMMA expr PAREN_RIGHT; + +functionCall + : name=( CHAR_LENGTH | CHARACTER_LENGTH | OCTET_LENGTH | + BIT_LENGTH | UPPER | LOWER | SIZE | EXISTS | COUNT ) + PAREN_LEFT ( expr ( COMMA expr )* )? PAREN_RIGHT # FunctionCallReserved + | name=symbolPrimitive PAREN_LEFT ( expr ( COMMA expr )* )? PAREN_RIGHT # FunctionCallIdent + ; + +pathStep + : BRACKET_LEFT key=expr BRACKET_RIGHT # PathStepIndexExpr + | BRACKET_LEFT all=ASTERISK BRACKET_RIGHT # PathStepIndexAll + | PERIOD key=symbolPrimitive # PathStepDotExpr + | PERIOD all=ASTERISK # PathStepDotAll + ; + +exprGraphMatchMany + : PAREN_LEFT exprPrimary MATCH gpmlPatternList PAREN_RIGHT ; + +exprGraphMatchOne + : exprPrimary MATCH gpmlPattern ; + + +parameter + : QUESTION_MARK; + +varRefExpr + : qualifier=AT_SIGN? ident=(IDENTIFIER|IDENTIFIER_QUOTED); + +/** + * + * LITERALS & TYPES + * + */ + +collection + : array + | bag + ; + +array + : BRACKET_LEFT ( expr ( COMMA expr )* )? BRACKET_RIGHT; + +bag + : ANGLE_DOUBLE_LEFT ( expr ( COMMA expr )* )? ANGLE_DOUBLE_RIGHT; + +tuple + : BRACE_LEFT ( pair ( COMMA pair )* )? BRACE_RIGHT; + +pair + : lhs=expr COLON rhs=expr; + +literal + : NULL # LiteralNull + | MISSING # LiteralMissing + | TRUE # LiteralTrue + | FALSE # LiteralFalse + | LITERAL_STRING # LiteralString + | LITERAL_INTEGER # LiteralInteger + | LITERAL_DECIMAL # LiteralDecimal + | ION_CLOSURE # LiteralIon + | DATE LITERAL_STRING # LiteralDate + | TIME ( PAREN_LEFT LITERAL_INTEGER PAREN_RIGHT )? (WITH TIME ZONE)? LITERAL_STRING # LiteralTime + ; + +type + : datatype=( + NULL | BOOL | BOOLEAN | SMALLINT | INTEGER2 | INT2 | INTEGER | INT | INTEGER4 | INT4 + | INTEGER8 | INT8 | BIGINT | REAL | TIMESTAMP | CHAR | CHARACTER | MISSING + | STRING | SYMBOL | BLOB | CLOB | DATE | STRUCT | TUPLE | LIST | SEXP | BAG | ANY + ) # TypeAtomic + | datatype=DOUBLE PRECISION # TypeAtomic + | datatype=(CHARACTER|CHAR|FLOAT|VARCHAR) ( PAREN_LEFT arg0=LITERAL_INTEGER PAREN_RIGHT )? # TypeArgSingle + | CHARACTER VARYING ( PAREN_LEFT arg0=LITERAL_INTEGER PAREN_RIGHT )? # TypeVarChar + | datatype=(DECIMAL|DEC|NUMERIC) ( PAREN_LEFT arg0=LITERAL_INTEGER ( COMMA arg1=LITERAL_INTEGER )? PAREN_RIGHT )? # TypeArgDouble + | TIME ( PAREN_LEFT precision=LITERAL_INTEGER PAREN_RIGHT )? (WITH TIME ZONE)? # TypeTimeZone + | symbolPrimitive # TypeCustom + ; \ No newline at end of file diff --git a/partiql/README.md b/partiql/README.md new file mode 100644 index 0000000..3cd4ac5 --- /dev/null +++ b/partiql/README.md @@ -0,0 +1,19 @@ +# partiql-parser + +The repository of PartiQL parser based on ANTLR. + +# Clone the repository + +The repository contains the test data from [partiql-tests](https://github.com/partiql/partiql-tests) repository as a submodule. To clone the repository with the submodule, use the following command: + +```bash +git clone --recursive git@github.com:bytebase/partiql-parser.git +``` + +# Update the partiql-tests submodule + +To update the submodule, use the following command: + +```bash +git submodule update --remote +``` diff --git a/partiql/parser_test.go b/partiql/parser_test.go new file mode 100644 index 0000000..eed14f4 --- /dev/null +++ b/partiql/parser_test.go @@ -0,0 +1,120 @@ +package partiql_test + +import ( + "os" + "strings" + "testing" + + "github.com/antlr4-go/antlr/v4" + partiql "github.com/bytebase/parser/partiql" + "github.com/stretchr/testify/require" +) + +type CustomErrorListener struct { + errors int +} + +func NewCustomErrorListener() *CustomErrorListener { + return new(CustomErrorListener) +} + +func (l *CustomErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException) { + l.errors += 1 + antlr.ConsoleErrorListenerINSTANCE.SyntaxError(recognizer, offendingSymbol, line, column, msg, e) +} + +func (l *CustomErrorListener) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs *antlr.ATNConfigSet) { + antlr.ConsoleErrorListenerINSTANCE.ReportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) +} + +func (l *CustomErrorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs *antlr.ATNConfigSet) { + antlr.ConsoleErrorListenerINSTANCE.ReportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) +} + +func (l *CustomErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs *antlr.ATNConfigSet) { + antlr.ConsoleErrorListenerINSTANCE.ReportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs) +} + +func TestSimpleParse(t *testing.T) { + filepath := "simple.sql" + content, err := os.ReadFile(filepath) + require.NoError(t, err) + dataString := strings.TrimRight(string(content), " \t\r\n;") + "\n;" + + input := antlr.NewInputStream(string(dataString)) + lexer := partiql.NewPartiQLLexer(input) + stream := antlr.NewCommonTokenStream(lexer, antlr.TokenDefaultChannel) + p := partiql.NewPartiQLParserParser(stream) + lexerErrors := &CustomErrorListener{} + lexer.RemoveErrorListeners() + lexer.AddErrorListener(lexerErrors) + + parserErrors := &CustomErrorListener{} + p.RemoveErrorListeners() + p.AddErrorListener(parserErrors) + + p.BuildParseTrees = true + tree := p.Script() + require.Equal(t, 0, lexerErrors.errors) + require.Equal(t, 0, parserErrors.errors) + + require.Equal(t, dataString, stream.GetTextFromRuleContext(tree)) +} + +// func TestParsePartiQL(t *testing.T) { +// type lookupRootDirectory struct { +// rootDirectory string +// success bool +// } +// // Reference the [README](https://github.com/partiql/partiql-tests/tree/main) to figure out how to use the test data. +// lookupRootDirectories := []*lookupRootDirectory{ +// {"partiql-tests/partiql-tests-data/fail/syntax", false}, +// {"partiql-tests/partiql-tests-data/success/syntax", true}, +// } +// for _, rootDirectory := range lookupRootDirectories { +// runTestParsePartiQLInDirectory(t, rootDirectory.rootDirectory, rootDirectory.success) +// } +// } + +// type IonData struct { +// Tests []TestCase `ion:""` +// } + +// type TestCase struct { +// Name string `ion:"name"` +// Statement string `ion:"statement"` +// } + +// func runTestParsePartiQLInDirectory(t *testing.T, directory string, success bool) { +// // Recurse through the directory and parse all the filepaths. +// filepaths, err := GetIonFilesInDirectory(directory) +// require.NoError(t, err) +// for _, fp := range filepaths { +// content, err := os.ReadFile(fp) +// require.NoErrorf(t, err, "Failed to read file %s", fp) +// ionData := IonData{} +// err = ion.Unmarshal(content, &ionData) +// require.NoErrorf(t, err, "Failed to unmarshal ion data from file %s", fp) +// t.Logf("Parsed %d test cases from file %s", len(ionData.Tests), fp) +// } + +// } + +// func GetIonFilesInDirectory(directory string) ([]string, error) { +// var files []string +// err := filepath.Walk(directory, func(path string, info os.FileInfo, err error) error { +// if info.IsDir() { +// return nil +// } +// if filepath.Ext(path) != ".ion" { +// return nil +// } +// files = append(files, path) +// return nil +// }) +// if err != nil { +// return nil, err +// } + +// return files, nil +// } diff --git a/partiql/partiql_lexer.go b/partiql/partiql_lexer.go new file mode 100644 index 0000000..319066f --- /dev/null +++ b/partiql/partiql_lexer.go @@ -0,0 +1,1938 @@ +// Code generated from PartiQLLexer.g4 by ANTLR 4.13.2. DO NOT EDIT. + +package partiql + +import ( + "fmt" + "github.com/antlr4-go/antlr/v4" + "sync" + "unicode" +) + +// Suppress unused import error +var _ = fmt.Printf +var _ = sync.Once{} +var _ = unicode.IsLetter + +type PartiQLLexer struct { + *antlr.BaseLexer + channelNames []string + modeNames []string + // TODO: EOF string +} + +var PartiQLLexerLexerStaticData struct { + once sync.Once + serializedATN []int32 + ChannelNames []string + ModeNames []string + LiteralNames []string + SymbolicNames []string + RuleNames []string + PredictionContextCache *antlr.PredictionContextCache + atn *antlr.ATN + decisionToDFA []*antlr.DFA +} + +func partiqllexerLexerInit() { + staticData := &PartiQLLexerLexerStaticData + staticData.ChannelNames = []string{ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", + } + staticData.ModeNames = []string{ + "DEFAULT_MODE", "ION", + } + staticData.LiteralNames = []string{ + "", "'ABSOLUTE'", "'ACTION'", "'ADD'", "'ALL'", "'ALLOCATE'", "'ALTER'", + "'AND'", "'ANY'", "'ARE'", "'AS'", "'ASC'", "'ASSERTION'", "'AT'", "'AUTHORIZATION'", + "'AVG'", "'BEGIN'", "'BETWEEN'", "'BIT'", "'BIT_LENGTH'", "'BY'", "'CASCADE'", + "'CASCADED'", "'CASE'", "'CAST'", "'CATALOG'", "'CHAR'", "'CHARACTER'", + "'CHARACTER_LENGTH'", "'CHAR_LENGTH'", "'CHECK'", "'CLOSE'", "'COALESCE'", + "'COLLATE'", "'COLLATION'", "'COLUMN'", "'COMMIT'", "'CONNECT'", "'CONNECTION'", + "'CONSTRAINT'", "'CONSTRAINTS'", "'CONTINUE'", "'CONVERT'", "'CORRESPONDING'", + "'COUNT'", "'CREATE'", "'CROSS'", "'CURRENT'", "'CURRENT_DATE'", "'CURRENT_TIME'", + "'CURRENT_TIMESTAMP'", "'CURRENT_USER'", "'CURSOR'", "'DATE'", "'DEALLOCATE'", + "'DEC'", "'DECIMAL'", "'DECLARE'", "'DEFAULT'", "'DEFERRABLE'", "'DEFERRED'", + "'DELETE'", "'DESC'", "'DESCRIBE'", "'DESCRIPTOR'", "'DIAGNOSTICS'", + "'DISCONNECT'", "'DISTINCT'", "'DOMAIN'", "'DOUBLE'", "'DROP'", "'ELSE'", + "'END'", "'END-EXEC'", "'ESCAPE'", "'EXCEPT'", "'EXCEPTION'", "'EXCLUDED'", + "'EXEC'", "'EXECUTE'", "'EXISTS'", "'EXPLAIN'", "'EXTERNAL'", "'EXTRACT'", + "'DATE_ADD'", "'DATE_DIFF'", "'FALSE'", "'FETCH'", "'FIRST'", "'FLOAT'", + "'FOR'", "'FOREIGN'", "'FOUND'", "'FROM'", "'FULL'", "'GET'", "'GLOBAL'", + "'GO'", "'GOTO'", "'GRANT'", "'GROUP'", "'HAVING'", "'IDENTITY'", "'IMMEDIATE'", + "'IN'", "'INDICATOR'", "'INITIALLY'", "'INNER'", "'INPUT'", "'INSENSITIVE'", + "'INSERT'", "'INT'", "'INTEGER'", "'INTERSECT'", "'INTERVAL'", "'INTO'", + "'IS'", "'ISOLATION'", "'JOIN'", "'KEY'", "'LANGUAGE'", "'LAST'", "'LATERAL'", + "'LEFT'", "'LEVEL'", "'LIKE'", "'LOCAL'", "'LOWER'", "'MATCH'", "'MAX'", + "'MIN'", "'MODULE'", "'NAMES'", "'NATIONAL'", "'NATURAL'", "'NCHAR'", + "'NEXT'", "'NO'", "'NOT'", "'NULL'", "'NULLS'", "'NULLIF'", "'NUMERIC'", + "'OCTET_LENGTH'", "'OF'", "'ON'", "'ONLY'", "'OPEN'", "'OPTION'", "'OR'", + "'ORDER'", "'OUTER'", "'OUTPUT'", "'OVERLAPS'", "'OVERLAY'", "'PAD'", + "'PARTIAL'", "'PLACING'", "'POSITION'", "'PRECISION'", "'PREPARE'", + "'PRESERVE'", "'PRIMARY'", "'PRIOR'", "'PRIVILEGES'", "'PROCEDURE'", + "'PUBLIC'", "'READ'", "'REAL'", "'REFERENCES'", "'RELATIVE'", "'REPLACE'", + "'RESTRICT'", "'REVOKE'", "'RIGHT'", "'ROLLBACK'", "'ROWS'", "'SCHEMA'", + "'SCROLL'", "'SECTION'", "'SELECT'", "'SESSION'", "'SESSION_USER'", + "'SET'", "'SHORTEST'", "'SIZE'", "'SMALLINT'", "'SOME'", "'SPACE'", + "'SQL'", "'SQLCODE'", "'SQLERROR'", "'SQLSTATE'", "'SUBSTRING'", "'SUM'", + "'SYSTEM_USER'", "'TABLE'", "'TEMPORARY'", "'THEN'", "'TIME'", "'TIMESTAMP'", + "'TO'", "'TRANSACTION'", "'TRANSLATE'", "'TRANSLATION'", "'TRIM'", "'TRUE'", + "'UNION'", "'UNIQUE'", "'UNKNOWN'", "'UPDATE'", "'UPPER'", "'UPSERT'", + "'USAGE'", "'USER'", "'USING'", "'VALUE'", "'VALUES'", "'VARCHAR'", + "'VARYING'", "'VIEW'", "'WHEN'", "'WHENEVER'", "'WHERE'", "'WITH'", + "'WORK'", "'WRITE'", "'ZONE'", "'LAG'", "'LEAD'", "'OVER'", "'PARTITION'", + "'CAN_CAST'", "'CAN_LOSSLESS_CAST'", "'MISSING'", "'PIVOT'", "'UNPIVOT'", + "'LIMIT'", "'OFFSET'", "'REMOVE'", "'INDEX'", "'LET'", "'CONFLICT'", + "'DO'", "'RETURNING'", "'MODIFIED'", "'NEW'", "'OLD'", "'NOTHING'", + "'TUPLE'", "'INTEGER2'", "'INT2'", "'INTEGER4'", "'INT4'", "'INTEGER8'", + "'INT8'", "'BIGINT'", "'BOOL'", "'BOOLEAN'", "'STRING'", "'SYMBOL'", + "'CLOB'", "'BLOB'", "'STRUCT'", "'LIST'", "'SEXP'", "'BAG'", "'^'", + "','", "'+'", "'-'", "'/'", "'%'", "'@'", "'~'", "'*'", "'<='", "'>='", + "'='", "", "'||'", "'<'", "'>'", "'<<'", "'>>'", "'['", "']'", "'{'", + "'}'", "'('", "')'", "':'", "';'", "'?'", "'.'", + } + staticData.SymbolicNames = []string{ + "", "ABSOLUTE", "ACTION", "ADD", "ALL", "ALLOCATE", "ALTER", "AND", + "ANY", "ARE", "AS", "ASC", "ASSERTION", "AT", "AUTHORIZATION", "AVG", + "BEGIN", "BETWEEN", "BIT", "BIT_LENGTH", "BY", "CASCADE", "CASCADED", + "CASE", "CAST", "CATALOG", "CHAR", "CHARACTER", "CHARACTER_LENGTH", + "CHAR_LENGTH", "CHECK", "CLOSE", "COALESCE", "COLLATE", "COLLATION", + "COLUMN", "COMMIT", "CONNECT", "CONNECTION", "CONSTRAINT", "CONSTRAINTS", + "CONTINUE", "CONVERT", "CORRESPONDING", "COUNT", "CREATE", "CROSS", + "CURRENT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", + "CURSOR", "DATE", "DEALLOCATE", "DEC", "DECIMAL", "DECLARE", "DEFAULT", + "DEFERRABLE", "DEFERRED", "DELETE", "DESC", "DESCRIBE", "DESCRIPTOR", + "DIAGNOSTICS", "DISCONNECT", "DISTINCT", "DOMAIN", "DOUBLE", "DROP", + "ELSE", "END", "END_EXEC", "ESCAPE", "EXCEPT", "EXCEPTION", "EXCLUDED", + "EXEC", "EXECUTE", "EXISTS", "EXPLAIN", "EXTERNAL", "EXTRACT", "DATE_ADD", + "DATE_DIFF", "FALSE", "FETCH", "FIRST", "FLOAT", "FOR", "FOREIGN", "FOUND", + "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO", "GRANT", "GROUP", "HAVING", + "IDENTITY", "IMMEDIATE", "IN", "INDICATOR", "INITIALLY", "INNER", "INPUT", + "INSENSITIVE", "INSERT", "INT", "INTEGER", "INTERSECT", "INTERVAL", + "INTO", "IS", "ISOLATION", "JOIN", "KEY", "LANGUAGE", "LAST", "LATERAL", + "LEFT", "LEVEL", "LIKE", "LOCAL", "LOWER", "MATCH", "MAX", "MIN", "MODULE", + "NAMES", "NATIONAL", "NATURAL", "NCHAR", "NEXT", "NO", "NOT", "NULL", + "NULLS", "NULLIF", "NUMERIC", "OCTET_LENGTH", "OF", "ON", "ONLY", "OPEN", + "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "OVERLAY", "PAD", + "PARTIAL", "PLACING", "POSITION", "PRECISION", "PREPARE", "PRESERVE", + "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURE", "PUBLIC", "READ", "REAL", + "REFERENCES", "RELATIVE", "REPLACE", "RESTRICT", "REVOKE", "RIGHT", + "ROLLBACK", "ROWS", "SCHEMA", "SCROLL", "SECTION", "SELECT", "SESSION", + "SESSION_USER", "SET", "SHORTEST", "SIZE", "SMALLINT", "SOME", "SPACE", + "SQL", "SQLCODE", "SQLERROR", "SQLSTATE", "SUBSTRING", "SUM", "SYSTEM_USER", + "TABLE", "TEMPORARY", "THEN", "TIME", "TIMESTAMP", "TO", "TRANSACTION", + "TRANSLATE", "TRANSLATION", "TRIM", "TRUE", "UNION", "UNIQUE", "UNKNOWN", + "UPDATE", "UPPER", "UPSERT", "USAGE", "USER", "USING", "VALUE", "VALUES", + "VARCHAR", "VARYING", "VIEW", "WHEN", "WHENEVER", "WHERE", "WITH", "WORK", + "WRITE", "ZONE", "LAG", "LEAD", "OVER", "PARTITION", "CAN_CAST", "CAN_LOSSLESS_CAST", + "MISSING", "PIVOT", "UNPIVOT", "LIMIT", "OFFSET", "REMOVE", "INDEX", + "LET", "CONFLICT", "DO", "RETURNING", "MODIFIED", "NEW", "OLD", "NOTHING", + "TUPLE", "INTEGER2", "INT2", "INTEGER4", "INT4", "INTEGER8", "INT8", + "BIGINT", "BOOL", "BOOLEAN", "STRING", "SYMBOL", "CLOB", "BLOB", "STRUCT", + "LIST", "SEXP", "BAG", "CARET", "COMMA", "PLUS", "MINUS", "SLASH_FORWARD", + "PERCENT", "AT_SIGN", "TILDE", "ASTERISK", "LT_EQ", "GT_EQ", "EQ", "NEQ", + "CONCAT", "ANGLE_LEFT", "ANGLE_RIGHT", "ANGLE_DOUBLE_LEFT", "ANGLE_DOUBLE_RIGHT", + "BRACKET_LEFT", "BRACKET_RIGHT", "BRACE_LEFT", "BRACE_RIGHT", "PAREN_LEFT", + "PAREN_RIGHT", "COLON", "COLON_SEMI", "QUESTION_MARK", "PERIOD", "LITERAL_STRING", + "LITERAL_INTEGER", "LITERAL_DECIMAL", "IDENTIFIER", "IDENTIFIER_QUOTED", + "WS", "COMMENT_SINGLE", "COMMENT_BLOCK", "UNRECOGNIZED", "ION_CLOSURE", + "BACKTICK", + } + staticData.RuleNames = []string{ + "ABSOLUTE", "ACTION", "ADD", "ALL", "ALLOCATE", "ALTER", "AND", "ANY", + "ARE", "AS", "ASC", "ASSERTION", "AT", "AUTHORIZATION", "AVG", "BEGIN", + "BETWEEN", "BIT", "BIT_LENGTH", "BY", "CASCADE", "CASCADED", "CASE", + "CAST", "CATALOG", "CHAR", "CHARACTER", "CHARACTER_LENGTH", "CHAR_LENGTH", + "CHECK", "CLOSE", "COALESCE", "COLLATE", "COLLATION", "COLUMN", "COMMIT", + "CONNECT", "CONNECTION", "CONSTRAINT", "CONSTRAINTS", "CONTINUE", "CONVERT", + "CORRESPONDING", "COUNT", "CREATE", "CROSS", "CURRENT", "CURRENT_DATE", + "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", "CURSOR", "DATE", + "DEALLOCATE", "DEC", "DECIMAL", "DECLARE", "DEFAULT", "DEFERRABLE", + "DEFERRED", "DELETE", "DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", + "DISCONNECT", "DISTINCT", "DOMAIN", "DOUBLE", "DROP", "ELSE", "END", + "END_EXEC", "ESCAPE", "EXCEPT", "EXCEPTION", "EXCLUDED", "EXEC", "EXECUTE", + "EXISTS", "EXPLAIN", "EXTERNAL", "EXTRACT", "DATE_ADD", "DATE_DIFF", + "FALSE", "FETCH", "FIRST", "FLOAT", "FOR", "FOREIGN", "FOUND", "FROM", + "FULL", "GET", "GLOBAL", "GO", "GOTO", "GRANT", "GROUP", "HAVING", "IDENTITY", + "IMMEDIATE", "IN", "INDICATOR", "INITIALLY", "INNER", "INPUT", "INSENSITIVE", + "INSERT", "INT", "INTEGER", "INTERSECT", "INTERVAL", "INTO", "IS", "ISOLATION", + "JOIN", "KEY", "LANGUAGE", "LAST", "LATERAL", "LEFT", "LEVEL", "LIKE", + "LOCAL", "LOWER", "MATCH", "MAX", "MIN", "MODULE", "NAMES", "NATIONAL", + "NATURAL", "NCHAR", "NEXT", "NO", "NOT", "NULL", "NULLS", "NULLIF", + "NUMERIC", "OCTET_LENGTH", "OF", "ON", "ONLY", "OPEN", "OPTION", "OR", + "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "OVERLAY", "PAD", "PARTIAL", + "PLACING", "POSITION", "PRECISION", "PREPARE", "PRESERVE", "PRIMARY", + "PRIOR", "PRIVILEGES", "PROCEDURE", "PUBLIC", "READ", "REAL", "REFERENCES", + "RELATIVE", "REPLACE", "RESTRICT", "REVOKE", "RIGHT", "ROLLBACK", "ROWS", + "SCHEMA", "SCROLL", "SECTION", "SELECT", "SESSION", "SESSION_USER", + "SET", "SHORTEST", "SIZE", "SMALLINT", "SOME", "SPACE", "SQL", "SQLCODE", + "SQLERROR", "SQLSTATE", "SUBSTRING", "SUM", "SYSTEM_USER", "TABLE", + "TEMPORARY", "THEN", "TIME", "TIMESTAMP", "TO", "TRANSACTION", "TRANSLATE", + "TRANSLATION", "TRIM", "TRUE", "UNION", "UNIQUE", "UNKNOWN", "UPDATE", + "UPPER", "UPSERT", "USAGE", "USER", "USING", "VALUE", "VALUES", "VARCHAR", + "VARYING", "VIEW", "WHEN", "WHENEVER", "WHERE", "WITH", "WORK", "WRITE", + "ZONE", "LAG", "LEAD", "OVER", "PARTITION", "CAN_CAST", "CAN_LOSSLESS_CAST", + "MISSING", "PIVOT", "UNPIVOT", "LIMIT", "OFFSET", "REMOVE", "INDEX", + "LET", "CONFLICT", "DO", "RETURNING", "MODIFIED", "NEW", "OLD", "NOTHING", + "TUPLE", "INTEGER2", "INT2", "INTEGER4", "INT4", "INTEGER8", "INT8", + "BIGINT", "BOOL", "BOOLEAN", "STRING", "SYMBOL", "CLOB", "BLOB", "STRUCT", + "LIST", "SEXP", "BAG", "CARET", "COMMA", "PLUS", "MINUS", "SLASH_FORWARD", + "PERCENT", "AT_SIGN", "TILDE", "ASTERISK", "LT_EQ", "GT_EQ", "EQ", "NEQ", + "CONCAT", "ANGLE_LEFT", "ANGLE_RIGHT", "ANGLE_DOUBLE_LEFT", "ANGLE_DOUBLE_RIGHT", + "BRACKET_LEFT", "BRACKET_RIGHT", "BRACE_LEFT", "BRACE_RIGHT", "PAREN_LEFT", + "PAREN_RIGHT", "BACKTICK", "COLON", "COLON_SEMI", "QUESTION_MARK", "PERIOD", + "LITERAL_STRING", "LITERAL_INTEGER", "LITERAL_DECIMAL", "IDENTIFIER", + "IDENTIFIER_QUOTED", "WS", "COMMENT_SINGLE", "COMMENT_BLOCK", "UNRECOGNIZED", + "DIGIT", "LETTER", "LETTER_NOT", "WHITESPACE", "ION_INLINE_COMMENT", + "ION_BLOCK_COMMENT", "ION_BLOB", "SHORT_QUOTED_STRING", "LONG_QUOTED_STRING", + "QUOTED_SYMBOL", "ION_CLOSURE", "ION_ANY", "ION_NEWLINE", "SHORT_QUOTE", + "LONG_QUOTE", "STRING_SHORT_TEXT", "STRING_LONG_TEXT", "STRING_SHORT_TEXT_ALLOWED", + "STRING_LONG_TEXT_ALLOWED", "TEXT_ESCAPE", "LOB_START", "LOB_END", "BASE_64_PAD", + "BASE_64_QUARTET", "BASE_64_PAD1", "BASE_64_PAD2", "BASE_64_CHAR", "SYMBOL_TEXT", + "SYMBOL_TEXT_ALLOWED", "COMMON_ESCAPE", "COMMON_ESCAPE_CODE", "HEX_ESCAPE", + "UNICODE_ESCAPE", "HEX_DIGIT_QUARTET", "HEX_DIGIT", "WS_NOT_NL", "SYMBOL_QUOTE", + } + staticData.PredictionContextCache = antlr.NewPredictionContextCache() + staticData.serializedATN = []int32{ + 4, 0, 305, 3058, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, + 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, + 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, + 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, + 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, + 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, + 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, + 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, + 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, + 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, + 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, + 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, + 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, + 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, + 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, + 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, + 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, + 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, + 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, + 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, + 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, + 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, + 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, + 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, + 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, + 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, + 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, + 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, + 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, + 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, + 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, + 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, + 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, + 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, + 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, + 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, + 7, 175, 2, 176, 7, 176, 2, 177, 7, 177, 2, 178, 7, 178, 2, 179, 7, 179, + 2, 180, 7, 180, 2, 181, 7, 181, 2, 182, 7, 182, 2, 183, 7, 183, 2, 184, + 7, 184, 2, 185, 7, 185, 2, 186, 7, 186, 2, 187, 7, 187, 2, 188, 7, 188, + 2, 189, 7, 189, 2, 190, 7, 190, 2, 191, 7, 191, 2, 192, 7, 192, 2, 193, + 7, 193, 2, 194, 7, 194, 2, 195, 7, 195, 2, 196, 7, 196, 2, 197, 7, 197, + 2, 198, 7, 198, 2, 199, 7, 199, 2, 200, 7, 200, 2, 201, 7, 201, 2, 202, + 7, 202, 2, 203, 7, 203, 2, 204, 7, 204, 2, 205, 7, 205, 2, 206, 7, 206, + 2, 207, 7, 207, 2, 208, 7, 208, 2, 209, 7, 209, 2, 210, 7, 210, 2, 211, + 7, 211, 2, 212, 7, 212, 2, 213, 7, 213, 2, 214, 7, 214, 2, 215, 7, 215, + 2, 216, 7, 216, 2, 217, 7, 217, 2, 218, 7, 218, 2, 219, 7, 219, 2, 220, + 7, 220, 2, 221, 7, 221, 2, 222, 7, 222, 2, 223, 7, 223, 2, 224, 7, 224, + 2, 225, 7, 225, 2, 226, 7, 226, 2, 227, 7, 227, 2, 228, 7, 228, 2, 229, + 7, 229, 2, 230, 7, 230, 2, 231, 7, 231, 2, 232, 7, 232, 2, 233, 7, 233, + 2, 234, 7, 234, 2, 235, 7, 235, 2, 236, 7, 236, 2, 237, 7, 237, 2, 238, + 7, 238, 2, 239, 7, 239, 2, 240, 7, 240, 2, 241, 7, 241, 2, 242, 7, 242, + 2, 243, 7, 243, 2, 244, 7, 244, 2, 245, 7, 245, 2, 246, 7, 246, 2, 247, + 7, 247, 2, 248, 7, 248, 2, 249, 7, 249, 2, 250, 7, 250, 2, 251, 7, 251, + 2, 252, 7, 252, 2, 253, 7, 253, 2, 254, 7, 254, 2, 255, 7, 255, 2, 256, + 7, 256, 2, 257, 7, 257, 2, 258, 7, 258, 2, 259, 7, 259, 2, 260, 7, 260, + 2, 261, 7, 261, 2, 262, 7, 262, 2, 263, 7, 263, 2, 264, 7, 264, 2, 265, + 7, 265, 2, 266, 7, 266, 2, 267, 7, 267, 2, 268, 7, 268, 2, 269, 7, 269, + 2, 270, 7, 270, 2, 271, 7, 271, 2, 272, 7, 272, 2, 273, 7, 273, 2, 274, + 7, 274, 2, 275, 7, 275, 2, 276, 7, 276, 2, 277, 7, 277, 2, 278, 7, 278, + 2, 279, 7, 279, 2, 280, 7, 280, 2, 281, 7, 281, 2, 282, 7, 282, 2, 283, + 7, 283, 2, 284, 7, 284, 2, 285, 7, 285, 2, 286, 7, 286, 2, 287, 7, 287, + 2, 288, 7, 288, 2, 289, 7, 289, 2, 290, 7, 290, 2, 291, 7, 291, 2, 292, + 7, 292, 2, 293, 7, 293, 2, 294, 7, 294, 2, 295, 7, 295, 2, 296, 7, 296, + 2, 297, 7, 297, 2, 298, 7, 298, 2, 299, 7, 299, 2, 300, 7, 300, 2, 301, + 7, 301, 2, 302, 7, 302, 2, 303, 7, 303, 2, 304, 7, 304, 2, 305, 7, 305, + 2, 306, 7, 306, 2, 307, 7, 307, 2, 308, 7, 308, 2, 309, 7, 309, 2, 310, + 7, 310, 2, 311, 7, 311, 2, 312, 7, 312, 2, 313, 7, 313, 2, 314, 7, 314, + 2, 315, 7, 315, 2, 316, 7, 316, 2, 317, 7, 317, 2, 318, 7, 318, 2, 319, + 7, 319, 2, 320, 7, 320, 2, 321, 7, 321, 2, 322, 7, 322, 2, 323, 7, 323, + 2, 324, 7, 324, 2, 325, 7, 325, 2, 326, 7, 326, 2, 327, 7, 327, 2, 328, + 7, 328, 2, 329, 7, 329, 2, 330, 7, 330, 2, 331, 7, 331, 2, 332, 7, 332, + 2, 333, 7, 333, 2, 334, 7, 334, 2, 335, 7, 335, 2, 336, 7, 336, 2, 337, + 7, 337, 2, 338, 7, 338, 2, 339, 7, 339, 2, 340, 7, 340, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, + 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, + 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, + 8, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, + 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, + 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, + 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, + 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, + 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, + 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, + 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, + 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, + 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, + 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, + 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, + 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, + 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, + 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, + 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, + 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, + 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, + 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, + 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, + 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, + 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, + 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, + 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, + 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, + 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, + 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, + 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, + 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, + 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, + 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, + 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, + 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, + 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, + 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, + 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, + 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, + 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, + 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, + 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, + 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, + 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, + 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, + 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, + 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, + 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, + 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, + 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, + 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, + 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, + 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, + 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, + 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, + 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, + 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, + 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, + 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, + 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, + 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, + 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, + 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, + 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, + 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, + 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, + 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, + 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, + 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, + 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, + 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, + 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, + 104, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, + 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, + 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, + 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, + 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, + 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, + 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, + 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, + 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, + 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, 116, 1, + 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, + 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, + 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, + 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, + 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 124, 1, 124, 1, + 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, + 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, + 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, + 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, + 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 132, 1, 132, 1, 132, 1, + 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 133, 1, 133, 1, 133, 1, + 133, 1, 133, 1, 133, 1, 133, 1, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, + 134, 1, 134, 1, 135, 1, 135, 1, 135, 1, 135, 1, 135, 1, 136, 1, 136, 1, + 136, 1, 137, 1, 137, 1, 137, 1, 137, 1, 138, 1, 138, 1, 138, 1, 138, 1, + 138, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 140, 1, 140, 1, + 140, 1, 140, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, 1, 141, 1, + 141, 1, 141, 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, + 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 143, 1, + 143, 1, 143, 1, 144, 1, 144, 1, 144, 1, 145, 1, 145, 1, 145, 1, 145, 1, + 145, 1, 146, 1, 146, 1, 146, 1, 146, 1, 146, 1, 147, 1, 147, 1, 147, 1, + 147, 1, 147, 1, 147, 1, 147, 1, 148, 1, 148, 1, 148, 1, 149, 1, 149, 1, + 149, 1, 149, 1, 149, 1, 149, 1, 150, 1, 150, 1, 150, 1, 150, 1, 150, 1, + 150, 1, 151, 1, 151, 1, 151, 1, 151, 1, 151, 1, 151, 1, 151, 1, 152, 1, + 152, 1, 152, 1, 152, 1, 152, 1, 152, 1, 152, 1, 152, 1, 152, 1, 153, 1, + 153, 1, 153, 1, 153, 1, 153, 1, 153, 1, 153, 1, 153, 1, 154, 1, 154, 1, + 154, 1, 154, 1, 155, 1, 155, 1, 155, 1, 155, 1, 155, 1, 155, 1, 155, 1, + 155, 1, 156, 1, 156, 1, 156, 1, 156, 1, 156, 1, 156, 1, 156, 1, 156, 1, + 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, 157, 1, + 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, + 158, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, 159, 1, + 160, 1, 160, 1, 160, 1, 160, 1, 160, 1, 160, 1, 160, 1, 160, 1, 160, 1, + 161, 1, 161, 1, 161, 1, 161, 1, 161, 1, 161, 1, 161, 1, 161, 1, 162, 1, + 162, 1, 162, 1, 162, 1, 162, 1, 162, 1, 163, 1, 163, 1, 163, 1, 163, 1, + 163, 1, 163, 1, 163, 1, 163, 1, 163, 1, 163, 1, 163, 1, 164, 1, 164, 1, + 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 165, 1, + 165, 1, 165, 1, 165, 1, 165, 1, 165, 1, 165, 1, 166, 1, 166, 1, 166, 1, + 166, 1, 166, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 168, 1, 168, 1, + 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, + 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, + 170, 1, 170, 1, 170, 1, 170, 1, 170, 1, 170, 1, 170, 1, 170, 1, 171, 1, + 171, 1, 171, 1, 171, 1, 171, 1, 171, 1, 171, 1, 171, 1, 171, 1, 172, 1, + 172, 1, 172, 1, 172, 1, 172, 1, 172, 1, 172, 1, 173, 1, 173, 1, 173, 1, + 173, 1, 173, 1, 173, 1, 174, 1, 174, 1, 174, 1, 174, 1, 174, 1, 174, 1, + 174, 1, 174, 1, 174, 1, 175, 1, 175, 1, 175, 1, 175, 1, 175, 1, 176, 1, + 176, 1, 176, 1, 176, 1, 176, 1, 176, 1, 176, 1, 177, 1, 177, 1, 177, 1, + 177, 1, 177, 1, 177, 1, 177, 1, 178, 1, 178, 1, 178, 1, 178, 1, 178, 1, + 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 179, 1, 179, 1, 179, 1, 179, 1, + 179, 1, 180, 1, 180, 1, 180, 1, 180, 1, 180, 1, 180, 1, 180, 1, 180, 1, + 181, 1, 181, 1, 181, 1, 181, 1, 181, 1, 181, 1, 181, 1, 181, 1, 181, 1, + 181, 1, 181, 1, 181, 1, 181, 1, 182, 1, 182, 1, 182, 1, 182, 1, 183, 1, + 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 183, 1, 184, 1, + 184, 1, 184, 1, 184, 1, 184, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, + 185, 1, 185, 1, 185, 1, 185, 1, 186, 1, 186, 1, 186, 1, 186, 1, 186, 1, + 187, 1, 187, 1, 187, 1, 187, 1, 187, 1, 187, 1, 188, 1, 188, 1, 188, 1, + 188, 1, 189, 1, 189, 1, 189, 1, 189, 1, 189, 1, 189, 1, 189, 1, 189, 1, + 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, + 191, 1, 191, 1, 191, 1, 191, 1, 191, 1, 191, 1, 191, 1, 191, 1, 191, 1, + 192, 1, 192, 1, 192, 1, 192, 1, 192, 1, 192, 1, 192, 1, 192, 1, 192, 1, + 192, 1, 193, 1, 193, 1, 193, 1, 193, 1, 194, 1, 194, 1, 194, 1, 194, 1, + 194, 1, 194, 1, 194, 1, 194, 1, 194, 1, 194, 1, 194, 1, 194, 1, 195, 1, + 195, 1, 195, 1, 195, 1, 195, 1, 195, 1, 196, 1, 196, 1, 196, 1, 196, 1, + 196, 1, 196, 1, 196, 1, 196, 1, 196, 1, 196, 1, 197, 1, 197, 1, 197, 1, + 197, 1, 197, 1, 198, 1, 198, 1, 198, 1, 198, 1, 198, 1, 199, 1, 199, 1, + 199, 1, 199, 1, 199, 1, 199, 1, 199, 1, 199, 1, 199, 1, 199, 1, 200, 1, + 200, 1, 200, 1, 201, 1, 201, 1, 201, 1, 201, 1, 201, 1, 201, 1, 201, 1, + 201, 1, 201, 1, 201, 1, 201, 1, 201, 1, 202, 1, 202, 1, 202, 1, 202, 1, + 202, 1, 202, 1, 202, 1, 202, 1, 202, 1, 202, 1, 203, 1, 203, 1, 203, 1, + 203, 1, 203, 1, 203, 1, 203, 1, 203, 1, 203, 1, 203, 1, 203, 1, 203, 1, + 204, 1, 204, 1, 204, 1, 204, 1, 204, 1, 205, 1, 205, 1, 205, 1, 205, 1, + 205, 1, 206, 1, 206, 1, 206, 1, 206, 1, 206, 1, 206, 1, 207, 1, 207, 1, + 207, 1, 207, 1, 207, 1, 207, 1, 207, 1, 208, 1, 208, 1, 208, 1, 208, 1, + 208, 1, 208, 1, 208, 1, 208, 1, 209, 1, 209, 1, 209, 1, 209, 1, 209, 1, + 209, 1, 209, 1, 210, 1, 210, 1, 210, 1, 210, 1, 210, 1, 210, 1, 211, 1, + 211, 1, 211, 1, 211, 1, 211, 1, 211, 1, 211, 1, 212, 1, 212, 1, 212, 1, + 212, 1, 212, 1, 212, 1, 213, 1, 213, 1, 213, 1, 213, 1, 213, 1, 214, 1, + 214, 1, 214, 1, 214, 1, 214, 1, 214, 1, 215, 1, 215, 1, 215, 1, 215, 1, + 215, 1, 215, 1, 216, 1, 216, 1, 216, 1, 216, 1, 216, 1, 216, 1, 216, 1, + 217, 1, 217, 1, 217, 1, 217, 1, 217, 1, 217, 1, 217, 1, 217, 1, 218, 1, + 218, 1, 218, 1, 218, 1, 218, 1, 218, 1, 218, 1, 218, 1, 219, 1, 219, 1, + 219, 1, 219, 1, 219, 1, 220, 1, 220, 1, 220, 1, 220, 1, 220, 1, 221, 1, + 221, 1, 221, 1, 221, 1, 221, 1, 221, 1, 221, 1, 221, 1, 221, 1, 222, 1, + 222, 1, 222, 1, 222, 1, 222, 1, 222, 1, 223, 1, 223, 1, 223, 1, 223, 1, + 223, 1, 224, 1, 224, 1, 224, 1, 224, 1, 224, 1, 225, 1, 225, 1, 225, 1, + 225, 1, 225, 1, 225, 1, 226, 1, 226, 1, 226, 1, 226, 1, 226, 1, 227, 1, + 227, 1, 227, 1, 227, 1, 228, 1, 228, 1, 228, 1, 228, 1, 228, 1, 229, 1, + 229, 1, 229, 1, 229, 1, 229, 1, 230, 1, 230, 1, 230, 1, 230, 1, 230, 1, + 230, 1, 230, 1, 230, 1, 230, 1, 230, 1, 231, 1, 231, 1, 231, 1, 231, 1, + 231, 1, 231, 1, 231, 1, 231, 1, 231, 1, 232, 1, 232, 1, 232, 1, 232, 1, + 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, + 232, 1, 232, 1, 232, 1, 232, 1, 232, 1, 233, 1, 233, 1, 233, 1, 233, 1, + 233, 1, 233, 1, 233, 1, 233, 1, 234, 1, 234, 1, 234, 1, 234, 1, 234, 1, + 234, 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 1, 235, 1, + 236, 1, 236, 1, 236, 1, 236, 1, 236, 1, 236, 1, 237, 1, 237, 1, 237, 1, + 237, 1, 237, 1, 237, 1, 237, 1, 238, 1, 238, 1, 238, 1, 238, 1, 238, 1, + 238, 1, 238, 1, 239, 1, 239, 1, 239, 1, 239, 1, 239, 1, 239, 1, 240, 1, + 240, 1, 240, 1, 240, 1, 241, 1, 241, 1, 241, 1, 241, 1, 241, 1, 241, 1, + 241, 1, 241, 1, 241, 1, 242, 1, 242, 1, 242, 1, 243, 1, 243, 1, 243, 1, + 243, 1, 243, 1, 243, 1, 243, 1, 243, 1, 243, 1, 243, 1, 244, 1, 244, 1, + 244, 1, 244, 1, 244, 1, 244, 1, 244, 1, 244, 1, 244, 1, 245, 1, 245, 1, + 245, 1, 245, 1, 246, 1, 246, 1, 246, 1, 246, 1, 247, 1, 247, 1, 247, 1, + 247, 1, 247, 1, 247, 1, 247, 1, 247, 1, 248, 1, 248, 1, 248, 1, 248, 1, + 248, 1, 248, 1, 249, 1, 249, 1, 249, 1, 249, 1, 249, 1, 249, 1, 249, 1, + 249, 1, 249, 1, 250, 1, 250, 1, 250, 1, 250, 1, 250, 1, 251, 1, 251, 1, + 251, 1, 251, 1, 251, 1, 251, 1, 251, 1, 251, 1, 251, 1, 252, 1, 252, 1, + 252, 1, 252, 1, 252, 1, 253, 1, 253, 1, 253, 1, 253, 1, 253, 1, 253, 1, + 253, 1, 253, 1, 253, 1, 254, 1, 254, 1, 254, 1, 254, 1, 254, 1, 255, 1, + 255, 1, 255, 1, 255, 1, 255, 1, 255, 1, 255, 1, 256, 1, 256, 1, 256, 1, + 256, 1, 256, 1, 257, 1, 257, 1, 257, 1, 257, 1, 257, 1, 257, 1, 257, 1, + 257, 1, 258, 1, 258, 1, 258, 1, 258, 1, 258, 1, 258, 1, 258, 1, 259, 1, + 259, 1, 259, 1, 259, 1, 259, 1, 259, 1, 259, 1, 260, 1, 260, 1, 260, 1, + 260, 1, 260, 1, 261, 1, 261, 1, 261, 1, 261, 1, 261, 1, 262, 1, 262, 1, + 262, 1, 262, 1, 262, 1, 262, 1, 262, 1, 263, 1, 263, 1, 263, 1, 263, 1, + 263, 1, 264, 1, 264, 1, 264, 1, 264, 1, 264, 1, 265, 1, 265, 1, 265, 1, + 265, 1, 266, 1, 266, 1, 267, 1, 267, 1, 268, 1, 268, 1, 269, 1, 269, 1, + 270, 1, 270, 1, 271, 1, 271, 1, 272, 1, 272, 1, 273, 1, 273, 1, 274, 1, + 274, 1, 275, 1, 275, 1, 275, 1, 276, 1, 276, 1, 276, 1, 277, 1, 277, 1, + 278, 1, 278, 1, 278, 1, 278, 3, 278, 2623, 8, 278, 1, 279, 1, 279, 1, 279, + 1, 280, 1, 280, 1, 281, 1, 281, 1, 282, 1, 282, 1, 282, 1, 283, 1, 283, + 1, 283, 1, 284, 1, 284, 1, 285, 1, 285, 1, 286, 1, 286, 1, 287, 1, 287, + 1, 288, 1, 288, 1, 289, 1, 289, 1, 290, 1, 290, 1, 290, 1, 290, 1, 290, + 1, 291, 1, 291, 1, 292, 1, 292, 1, 293, 1, 293, 1, 294, 1, 294, 1, 295, + 1, 295, 1, 295, 1, 295, 5, 295, 2667, 8, 295, 10, 295, 12, 295, 2670, 9, + 295, 1, 295, 1, 295, 1, 296, 1, 296, 5, 296, 2676, 8, 296, 10, 296, 12, + 296, 2679, 9, 296, 1, 297, 4, 297, 2682, 8, 297, 11, 297, 12, 297, 2683, + 1, 297, 1, 297, 5, 297, 2688, 8, 297, 10, 297, 12, 297, 2691, 9, 297, 1, + 297, 1, 297, 3, 297, 2695, 8, 297, 1, 297, 4, 297, 2698, 8, 297, 11, 297, + 12, 297, 2699, 3, 297, 2702, 8, 297, 1, 297, 1, 297, 1, 297, 5, 297, 2707, + 8, 297, 10, 297, 12, 297, 2710, 9, 297, 1, 297, 1, 297, 3, 297, 2714, 8, + 297, 1, 297, 4, 297, 2717, 8, 297, 11, 297, 12, 297, 2718, 3, 297, 2721, + 8, 297, 1, 297, 1, 297, 5, 297, 2725, 8, 297, 10, 297, 12, 297, 2728, 9, + 297, 1, 297, 1, 297, 3, 297, 2732, 8, 297, 1, 297, 4, 297, 2735, 8, 297, + 11, 297, 12, 297, 2736, 3, 297, 2739, 8, 297, 3, 297, 2741, 8, 297, 1, + 298, 1, 298, 5, 298, 2745, 8, 298, 10, 298, 12, 298, 2748, 9, 298, 1, 299, + 1, 299, 1, 299, 1, 299, 5, 299, 2754, 8, 299, 10, 299, 12, 299, 2757, 9, + 299, 1, 299, 1, 299, 1, 300, 1, 300, 1, 300, 1, 300, 1, 301, 1, 301, 1, + 301, 1, 301, 5, 301, 2769, 8, 301, 10, 301, 12, 301, 2772, 9, 301, 1, 301, + 3, 301, 2775, 8, 301, 1, 301, 3, 301, 2778, 8, 301, 1, 301, 1, 301, 1, + 302, 1, 302, 1, 302, 1, 302, 5, 302, 2786, 8, 302, 10, 302, 12, 302, 2789, + 9, 302, 1, 302, 1, 302, 1, 302, 1, 302, 1, 302, 1, 303, 1, 303, 1, 304, + 1, 304, 1, 305, 1, 305, 1, 306, 1, 306, 1, 307, 1, 307, 1, 308, 1, 308, + 1, 308, 1, 308, 5, 308, 2810, 8, 308, 10, 308, 12, 308, 2813, 9, 308, 1, + 308, 1, 308, 3, 308, 2817, 8, 308, 1, 308, 1, 308, 1, 309, 1, 309, 1, 309, + 1, 309, 5, 309, 2825, 8, 309, 10, 309, 12, 309, 2828, 9, 309, 1, 309, 1, + 309, 1, 309, 1, 309, 1, 309, 1, 310, 1, 310, 1, 310, 5, 310, 2838, 8, 310, + 10, 310, 12, 310, 2841, 9, 310, 1, 310, 3, 310, 2844, 8, 310, 1, 310, 5, + 310, 2847, 8, 310, 10, 310, 12, 310, 2850, 9, 310, 1, 310, 1, 310, 1, 310, + 1, 310, 1, 311, 1, 311, 1, 311, 1, 311, 1, 311, 1, 311, 1, 312, 1, 312, + 1, 312, 1, 312, 1, 312, 1, 312, 1, 313, 1, 313, 1, 313, 1, 313, 1, 313, + 1, 313, 1, 314, 1, 314, 1, 314, 1, 314, 1, 315, 1, 315, 1, 315, 1, 315, + 1, 316, 1, 316, 1, 316, 3, 316, 2885, 8, 316, 1, 317, 1, 317, 1, 318, 1, + 318, 1, 318, 1, 318, 1, 319, 1, 319, 5, 319, 2895, 8, 319, 10, 319, 12, + 319, 2898, 9, 319, 1, 320, 1, 320, 5, 320, 2902, 8, 320, 10, 320, 12, 320, + 2905, 9, 320, 1, 321, 1, 321, 3, 321, 2909, 8, 321, 1, 322, 1, 322, 3, + 322, 2913, 8, 322, 1, 323, 1, 323, 1, 323, 3, 323, 2918, 8, 323, 1, 324, + 1, 324, 1, 324, 1, 325, 1, 325, 1, 325, 1, 326, 1, 326, 3, 326, 2928, 8, + 326, 1, 327, 1, 327, 5, 327, 2932, 8, 327, 10, 327, 12, 327, 2935, 9, 327, + 1, 327, 1, 327, 5, 327, 2939, 8, 327, 10, 327, 12, 327, 2942, 9, 327, 1, + 327, 1, 327, 5, 327, 2946, 8, 327, 10, 327, 12, 327, 2949, 9, 327, 1, 327, + 1, 327, 1, 328, 1, 328, 5, 328, 2955, 8, 328, 10, 328, 12, 328, 2958, 9, + 328, 1, 328, 1, 328, 5, 328, 2962, 8, 328, 10, 328, 12, 328, 2965, 9, 328, + 1, 328, 1, 328, 5, 328, 2969, 8, 328, 10, 328, 12, 328, 2972, 9, 328, 1, + 328, 1, 328, 1, 329, 1, 329, 5, 329, 2978, 8, 329, 10, 329, 12, 329, 2981, + 9, 329, 1, 329, 1, 329, 5, 329, 2985, 8, 329, 10, 329, 12, 329, 2988, 9, + 329, 1, 329, 1, 329, 5, 329, 2992, 8, 329, 10, 329, 12, 329, 2995, 9, 329, + 1, 329, 1, 329, 1, 330, 1, 330, 1, 331, 1, 331, 5, 331, 3003, 8, 331, 10, + 331, 12, 331, 3006, 9, 331, 1, 332, 1, 332, 3, 332, 3010, 8, 332, 1, 333, + 1, 333, 1, 333, 1, 334, 1, 334, 3, 334, 3017, 8, 334, 1, 335, 1, 335, 1, + 335, 1, 335, 1, 335, 1, 335, 1, 336, 1, 336, 1, 336, 1, 336, 1, 336, 1, + 336, 1, 336, 1, 336, 1, 336, 1, 336, 1, 336, 1, 336, 1, 336, 1, 336, 1, + 336, 1, 336, 1, 336, 1, 336, 1, 336, 1, 336, 1, 336, 3, 336, 3046, 8, 336, + 1, 337, 1, 337, 1, 337, 1, 337, 1, 337, 1, 338, 1, 338, 1, 339, 1, 339, + 1, 340, 1, 340, 4, 2787, 2811, 2826, 2903, 0, 341, 2, 1, 4, 2, 6, 3, 8, + 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, + 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, + 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, + 32, 66, 33, 68, 34, 70, 35, 72, 36, 74, 37, 76, 38, 78, 39, 80, 40, 82, + 41, 84, 42, 86, 43, 88, 44, 90, 45, 92, 46, 94, 47, 96, 48, 98, 49, 100, + 50, 102, 51, 104, 52, 106, 53, 108, 54, 110, 55, 112, 56, 114, 57, 116, + 58, 118, 59, 120, 60, 122, 61, 124, 62, 126, 63, 128, 64, 130, 65, 132, + 66, 134, 67, 136, 68, 138, 69, 140, 70, 142, 71, 144, 72, 146, 73, 148, + 74, 150, 75, 152, 76, 154, 77, 156, 78, 158, 79, 160, 80, 162, 81, 164, + 82, 166, 83, 168, 84, 170, 85, 172, 86, 174, 87, 176, 88, 178, 89, 180, + 90, 182, 91, 184, 92, 186, 93, 188, 94, 190, 95, 192, 96, 194, 97, 196, + 98, 198, 99, 200, 100, 202, 101, 204, 102, 206, 103, 208, 104, 210, 105, + 212, 106, 214, 107, 216, 108, 218, 109, 220, 110, 222, 111, 224, 112, 226, + 113, 228, 114, 230, 115, 232, 116, 234, 117, 236, 118, 238, 119, 240, 120, + 242, 121, 244, 122, 246, 123, 248, 124, 250, 125, 252, 126, 254, 127, 256, + 128, 258, 129, 260, 130, 262, 131, 264, 132, 266, 133, 268, 134, 270, 135, + 272, 136, 274, 137, 276, 138, 278, 139, 280, 140, 282, 141, 284, 142, 286, + 143, 288, 144, 290, 145, 292, 146, 294, 147, 296, 148, 298, 149, 300, 150, + 302, 151, 304, 152, 306, 153, 308, 154, 310, 155, 312, 156, 314, 157, 316, + 158, 318, 159, 320, 160, 322, 161, 324, 162, 326, 163, 328, 164, 330, 165, + 332, 166, 334, 167, 336, 168, 338, 169, 340, 170, 342, 171, 344, 172, 346, + 173, 348, 174, 350, 175, 352, 176, 354, 177, 356, 178, 358, 179, 360, 180, + 362, 181, 364, 182, 366, 183, 368, 184, 370, 185, 372, 186, 374, 187, 376, + 188, 378, 189, 380, 190, 382, 191, 384, 192, 386, 193, 388, 194, 390, 195, + 392, 196, 394, 197, 396, 198, 398, 199, 400, 200, 402, 201, 404, 202, 406, + 203, 408, 204, 410, 205, 412, 206, 414, 207, 416, 208, 418, 209, 420, 210, + 422, 211, 424, 212, 426, 213, 428, 214, 430, 215, 432, 216, 434, 217, 436, + 218, 438, 219, 440, 220, 442, 221, 444, 222, 446, 223, 448, 224, 450, 225, + 452, 226, 454, 227, 456, 228, 458, 229, 460, 230, 462, 231, 464, 232, 466, + 233, 468, 234, 470, 235, 472, 236, 474, 237, 476, 238, 478, 239, 480, 240, + 482, 241, 484, 242, 486, 243, 488, 244, 490, 245, 492, 246, 494, 247, 496, + 248, 498, 249, 500, 250, 502, 251, 504, 252, 506, 253, 508, 254, 510, 255, + 512, 256, 514, 257, 516, 258, 518, 259, 520, 260, 522, 261, 524, 262, 526, + 263, 528, 264, 530, 265, 532, 266, 534, 267, 536, 268, 538, 269, 540, 270, + 542, 271, 544, 272, 546, 273, 548, 274, 550, 275, 552, 276, 554, 277, 556, + 278, 558, 279, 560, 280, 562, 281, 564, 282, 566, 283, 568, 284, 570, 285, + 572, 286, 574, 287, 576, 288, 578, 289, 580, 290, 582, 305, 584, 291, 586, + 292, 588, 293, 590, 294, 592, 295, 594, 296, 596, 297, 598, 298, 600, 299, + 602, 300, 604, 301, 606, 302, 608, 303, 610, 0, 612, 0, 614, 0, 616, 0, + 618, 0, 620, 0, 622, 0, 624, 0, 626, 0, 628, 0, 630, 304, 632, 0, 634, + 0, 636, 0, 638, 0, 640, 0, 642, 0, 644, 0, 646, 0, 648, 0, 650, 0, 652, + 0, 654, 0, 656, 0, 658, 0, 660, 0, 662, 0, 664, 0, 666, 0, 668, 0, 670, + 0, 672, 0, 674, 0, 676, 0, 678, 0, 680, 0, 682, 0, 2, 0, 1, 42, 2, 0, 65, + 65, 97, 97, 2, 0, 66, 66, 98, 98, 2, 0, 83, 83, 115, 115, 2, 0, 79, 79, + 111, 111, 2, 0, 76, 76, 108, 108, 2, 0, 85, 85, 117, 117, 2, 0, 84, 84, + 116, 116, 2, 0, 69, 69, 101, 101, 2, 0, 67, 67, 99, 99, 2, 0, 73, 73, 105, + 105, 2, 0, 78, 78, 110, 110, 2, 0, 68, 68, 100, 100, 2, 0, 82, 82, 114, + 114, 2, 0, 89, 89, 121, 121, 2, 0, 72, 72, 104, 104, 2, 0, 90, 90, 122, + 122, 2, 0, 86, 86, 118, 118, 2, 0, 71, 71, 103, 103, 2, 0, 87, 87, 119, + 119, 2, 0, 75, 75, 107, 107, 2, 0, 77, 77, 109, 109, 2, 0, 80, 80, 112, + 112, 2, 0, 70, 70, 102, 102, 2, 0, 88, 88, 120, 120, 2, 0, 74, 74, 106, + 106, 2, 0, 81, 81, 113, 113, 1, 0, 39, 39, 2, 0, 43, 43, 45, 45, 4, 0, + 36, 36, 65, 90, 95, 95, 97, 122, 5, 0, 36, 36, 48, 57, 65, 90, 95, 95, + 97, 122, 1, 0, 34, 34, 2, 0, 10, 10, 13, 13, 1, 0, 48, 57, 2, 0, 65, 90, + 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 3, 0, 32, 33, 35, 91, 93, 65535, + 2, 0, 32, 91, 93, 65535, 4, 0, 43, 43, 47, 57, 65, 90, 97, 122, 3, 0, 32, + 38, 40, 91, 93, 65535, 17, 0, 34, 34, 39, 39, 47, 48, 63, 63, 65, 66, 70, + 70, 78, 78, 82, 82, 84, 84, 86, 86, 92, 92, 97, 98, 102, 102, 110, 110, + 114, 114, 116, 116, 118, 118, 3, 0, 48, 57, 65, 70, 97, 102, 3, 0, 9, 9, + 11, 12, 32, 32, 3085, 0, 2, 1, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 6, 1, 0, 0, + 0, 0, 8, 1, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 14, 1, 0, + 0, 0, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, + 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, + 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, + 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, + 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, + 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, + 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 68, 1, + 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, 0, 0, 74, 1, 0, 0, 0, 0, 76, + 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, + 84, 1, 0, 0, 0, 0, 86, 1, 0, 0, 0, 0, 88, 1, 0, 0, 0, 0, 90, 1, 0, 0, 0, + 0, 92, 1, 0, 0, 0, 0, 94, 1, 0, 0, 0, 0, 96, 1, 0, 0, 0, 0, 98, 1, 0, 0, + 0, 0, 100, 1, 0, 0, 0, 0, 102, 1, 0, 0, 0, 0, 104, 1, 0, 0, 0, 0, 106, + 1, 0, 0, 0, 0, 108, 1, 0, 0, 0, 0, 110, 1, 0, 0, 0, 0, 112, 1, 0, 0, 0, + 0, 114, 1, 0, 0, 0, 0, 116, 1, 0, 0, 0, 0, 118, 1, 0, 0, 0, 0, 120, 1, + 0, 0, 0, 0, 122, 1, 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 126, 1, 0, 0, 0, 0, + 128, 1, 0, 0, 0, 0, 130, 1, 0, 0, 0, 0, 132, 1, 0, 0, 0, 0, 134, 1, 0, + 0, 0, 0, 136, 1, 0, 0, 0, 0, 138, 1, 0, 0, 0, 0, 140, 1, 0, 0, 0, 0, 142, + 1, 0, 0, 0, 0, 144, 1, 0, 0, 0, 0, 146, 1, 0, 0, 0, 0, 148, 1, 0, 0, 0, + 0, 150, 1, 0, 0, 0, 0, 152, 1, 0, 0, 0, 0, 154, 1, 0, 0, 0, 0, 156, 1, + 0, 0, 0, 0, 158, 1, 0, 0, 0, 0, 160, 1, 0, 0, 0, 0, 162, 1, 0, 0, 0, 0, + 164, 1, 0, 0, 0, 0, 166, 1, 0, 0, 0, 0, 168, 1, 0, 0, 0, 0, 170, 1, 0, + 0, 0, 0, 172, 1, 0, 0, 0, 0, 174, 1, 0, 0, 0, 0, 176, 1, 0, 0, 0, 0, 178, + 1, 0, 0, 0, 0, 180, 1, 0, 0, 0, 0, 182, 1, 0, 0, 0, 0, 184, 1, 0, 0, 0, + 0, 186, 1, 0, 0, 0, 0, 188, 1, 0, 0, 0, 0, 190, 1, 0, 0, 0, 0, 192, 1, + 0, 0, 0, 0, 194, 1, 0, 0, 0, 0, 196, 1, 0, 0, 0, 0, 198, 1, 0, 0, 0, 0, + 200, 1, 0, 0, 0, 0, 202, 1, 0, 0, 0, 0, 204, 1, 0, 0, 0, 0, 206, 1, 0, + 0, 0, 0, 208, 1, 0, 0, 0, 0, 210, 1, 0, 0, 0, 0, 212, 1, 0, 0, 0, 0, 214, + 1, 0, 0, 0, 0, 216, 1, 0, 0, 0, 0, 218, 1, 0, 0, 0, 0, 220, 1, 0, 0, 0, + 0, 222, 1, 0, 0, 0, 0, 224, 1, 0, 0, 0, 0, 226, 1, 0, 0, 0, 0, 228, 1, + 0, 0, 0, 0, 230, 1, 0, 0, 0, 0, 232, 1, 0, 0, 0, 0, 234, 1, 0, 0, 0, 0, + 236, 1, 0, 0, 0, 0, 238, 1, 0, 0, 0, 0, 240, 1, 0, 0, 0, 0, 242, 1, 0, + 0, 0, 0, 244, 1, 0, 0, 0, 0, 246, 1, 0, 0, 0, 0, 248, 1, 0, 0, 0, 0, 250, + 1, 0, 0, 0, 0, 252, 1, 0, 0, 0, 0, 254, 1, 0, 0, 0, 0, 256, 1, 0, 0, 0, + 0, 258, 1, 0, 0, 0, 0, 260, 1, 0, 0, 0, 0, 262, 1, 0, 0, 0, 0, 264, 1, + 0, 0, 0, 0, 266, 1, 0, 0, 0, 0, 268, 1, 0, 0, 0, 0, 270, 1, 0, 0, 0, 0, + 272, 1, 0, 0, 0, 0, 274, 1, 0, 0, 0, 0, 276, 1, 0, 0, 0, 0, 278, 1, 0, + 0, 0, 0, 280, 1, 0, 0, 0, 0, 282, 1, 0, 0, 0, 0, 284, 1, 0, 0, 0, 0, 286, + 1, 0, 0, 0, 0, 288, 1, 0, 0, 0, 0, 290, 1, 0, 0, 0, 0, 292, 1, 0, 0, 0, + 0, 294, 1, 0, 0, 0, 0, 296, 1, 0, 0, 0, 0, 298, 1, 0, 0, 0, 0, 300, 1, + 0, 0, 0, 0, 302, 1, 0, 0, 0, 0, 304, 1, 0, 0, 0, 0, 306, 1, 0, 0, 0, 0, + 308, 1, 0, 0, 0, 0, 310, 1, 0, 0, 0, 0, 312, 1, 0, 0, 0, 0, 314, 1, 0, + 0, 0, 0, 316, 1, 0, 0, 0, 0, 318, 1, 0, 0, 0, 0, 320, 1, 0, 0, 0, 0, 322, + 1, 0, 0, 0, 0, 324, 1, 0, 0, 0, 0, 326, 1, 0, 0, 0, 0, 328, 1, 0, 0, 0, + 0, 330, 1, 0, 0, 0, 0, 332, 1, 0, 0, 0, 0, 334, 1, 0, 0, 0, 0, 336, 1, + 0, 0, 0, 0, 338, 1, 0, 0, 0, 0, 340, 1, 0, 0, 0, 0, 342, 1, 0, 0, 0, 0, + 344, 1, 0, 0, 0, 0, 346, 1, 0, 0, 0, 0, 348, 1, 0, 0, 0, 0, 350, 1, 0, + 0, 0, 0, 352, 1, 0, 0, 0, 0, 354, 1, 0, 0, 0, 0, 356, 1, 0, 0, 0, 0, 358, + 1, 0, 0, 0, 0, 360, 1, 0, 0, 0, 0, 362, 1, 0, 0, 0, 0, 364, 1, 0, 0, 0, + 0, 366, 1, 0, 0, 0, 0, 368, 1, 0, 0, 0, 0, 370, 1, 0, 0, 0, 0, 372, 1, + 0, 0, 0, 0, 374, 1, 0, 0, 0, 0, 376, 1, 0, 0, 0, 0, 378, 1, 0, 0, 0, 0, + 380, 1, 0, 0, 0, 0, 382, 1, 0, 0, 0, 0, 384, 1, 0, 0, 0, 0, 386, 1, 0, + 0, 0, 0, 388, 1, 0, 0, 0, 0, 390, 1, 0, 0, 0, 0, 392, 1, 0, 0, 0, 0, 394, + 1, 0, 0, 0, 0, 396, 1, 0, 0, 0, 0, 398, 1, 0, 0, 0, 0, 400, 1, 0, 0, 0, + 0, 402, 1, 0, 0, 0, 0, 404, 1, 0, 0, 0, 0, 406, 1, 0, 0, 0, 0, 408, 1, + 0, 0, 0, 0, 410, 1, 0, 0, 0, 0, 412, 1, 0, 0, 0, 0, 414, 1, 0, 0, 0, 0, + 416, 1, 0, 0, 0, 0, 418, 1, 0, 0, 0, 0, 420, 1, 0, 0, 0, 0, 422, 1, 0, + 0, 0, 0, 424, 1, 0, 0, 0, 0, 426, 1, 0, 0, 0, 0, 428, 1, 0, 0, 0, 0, 430, + 1, 0, 0, 0, 0, 432, 1, 0, 0, 0, 0, 434, 1, 0, 0, 0, 0, 436, 1, 0, 0, 0, + 0, 438, 1, 0, 0, 0, 0, 440, 1, 0, 0, 0, 0, 442, 1, 0, 0, 0, 0, 444, 1, + 0, 0, 0, 0, 446, 1, 0, 0, 0, 0, 448, 1, 0, 0, 0, 0, 450, 1, 0, 0, 0, 0, + 452, 1, 0, 0, 0, 0, 454, 1, 0, 0, 0, 0, 456, 1, 0, 0, 0, 0, 458, 1, 0, + 0, 0, 0, 460, 1, 0, 0, 0, 0, 462, 1, 0, 0, 0, 0, 464, 1, 0, 0, 0, 0, 466, + 1, 0, 0, 0, 0, 468, 1, 0, 0, 0, 0, 470, 1, 0, 0, 0, 0, 472, 1, 0, 0, 0, + 0, 474, 1, 0, 0, 0, 0, 476, 1, 0, 0, 0, 0, 478, 1, 0, 0, 0, 0, 480, 1, + 0, 0, 0, 0, 482, 1, 0, 0, 0, 0, 484, 1, 0, 0, 0, 0, 486, 1, 0, 0, 0, 0, + 488, 1, 0, 0, 0, 0, 490, 1, 0, 0, 0, 0, 492, 1, 0, 0, 0, 0, 494, 1, 0, + 0, 0, 0, 496, 1, 0, 0, 0, 0, 498, 1, 0, 0, 0, 0, 500, 1, 0, 0, 0, 0, 502, + 1, 0, 0, 0, 0, 504, 1, 0, 0, 0, 0, 506, 1, 0, 0, 0, 0, 508, 1, 0, 0, 0, + 0, 510, 1, 0, 0, 0, 0, 512, 1, 0, 0, 0, 0, 514, 1, 0, 0, 0, 0, 516, 1, + 0, 0, 0, 0, 518, 1, 0, 0, 0, 0, 520, 1, 0, 0, 0, 0, 522, 1, 0, 0, 0, 0, + 524, 1, 0, 0, 0, 0, 526, 1, 0, 0, 0, 0, 528, 1, 0, 0, 0, 0, 530, 1, 0, + 0, 0, 0, 532, 1, 0, 0, 0, 0, 534, 1, 0, 0, 0, 0, 536, 1, 0, 0, 0, 0, 538, + 1, 0, 0, 0, 0, 540, 1, 0, 0, 0, 0, 542, 1, 0, 0, 0, 0, 544, 1, 0, 0, 0, + 0, 546, 1, 0, 0, 0, 0, 548, 1, 0, 0, 0, 0, 550, 1, 0, 0, 0, 0, 552, 1, + 0, 0, 0, 0, 554, 1, 0, 0, 0, 0, 556, 1, 0, 0, 0, 0, 558, 1, 0, 0, 0, 0, + 560, 1, 0, 0, 0, 0, 562, 1, 0, 0, 0, 0, 564, 1, 0, 0, 0, 0, 566, 1, 0, + 0, 0, 0, 568, 1, 0, 0, 0, 0, 570, 1, 0, 0, 0, 0, 572, 1, 0, 0, 0, 0, 574, + 1, 0, 0, 0, 0, 576, 1, 0, 0, 0, 0, 578, 1, 0, 0, 0, 0, 580, 1, 0, 0, 0, + 0, 582, 1, 0, 0, 0, 0, 584, 1, 0, 0, 0, 0, 586, 1, 0, 0, 0, 0, 588, 1, + 0, 0, 0, 0, 590, 1, 0, 0, 0, 0, 592, 1, 0, 0, 0, 0, 594, 1, 0, 0, 0, 0, + 596, 1, 0, 0, 0, 0, 598, 1, 0, 0, 0, 0, 600, 1, 0, 0, 0, 0, 602, 1, 0, + 0, 0, 0, 604, 1, 0, 0, 0, 0, 606, 1, 0, 0, 0, 0, 608, 1, 0, 0, 0, 1, 618, + 1, 0, 0, 0, 1, 620, 1, 0, 0, 0, 1, 622, 1, 0, 0, 0, 1, 624, 1, 0, 0, 0, + 1, 626, 1, 0, 0, 0, 1, 628, 1, 0, 0, 0, 1, 630, 1, 0, 0, 0, 1, 632, 1, + 0, 0, 0, 2, 684, 1, 0, 0, 0, 4, 693, 1, 0, 0, 0, 6, 700, 1, 0, 0, 0, 8, + 704, 1, 0, 0, 0, 10, 708, 1, 0, 0, 0, 12, 717, 1, 0, 0, 0, 14, 723, 1, + 0, 0, 0, 16, 727, 1, 0, 0, 0, 18, 731, 1, 0, 0, 0, 20, 735, 1, 0, 0, 0, + 22, 738, 1, 0, 0, 0, 24, 742, 1, 0, 0, 0, 26, 752, 1, 0, 0, 0, 28, 755, + 1, 0, 0, 0, 30, 769, 1, 0, 0, 0, 32, 773, 1, 0, 0, 0, 34, 779, 1, 0, 0, + 0, 36, 787, 1, 0, 0, 0, 38, 791, 1, 0, 0, 0, 40, 802, 1, 0, 0, 0, 42, 805, + 1, 0, 0, 0, 44, 813, 1, 0, 0, 0, 46, 822, 1, 0, 0, 0, 48, 827, 1, 0, 0, + 0, 50, 832, 1, 0, 0, 0, 52, 840, 1, 0, 0, 0, 54, 845, 1, 0, 0, 0, 56, 855, + 1, 0, 0, 0, 58, 872, 1, 0, 0, 0, 60, 884, 1, 0, 0, 0, 62, 890, 1, 0, 0, + 0, 64, 896, 1, 0, 0, 0, 66, 905, 1, 0, 0, 0, 68, 913, 1, 0, 0, 0, 70, 923, + 1, 0, 0, 0, 72, 930, 1, 0, 0, 0, 74, 937, 1, 0, 0, 0, 76, 945, 1, 0, 0, + 0, 78, 956, 1, 0, 0, 0, 80, 967, 1, 0, 0, 0, 82, 979, 1, 0, 0, 0, 84, 988, + 1, 0, 0, 0, 86, 996, 1, 0, 0, 0, 88, 1010, 1, 0, 0, 0, 90, 1016, 1, 0, + 0, 0, 92, 1023, 1, 0, 0, 0, 94, 1029, 1, 0, 0, 0, 96, 1037, 1, 0, 0, 0, + 98, 1050, 1, 0, 0, 0, 100, 1063, 1, 0, 0, 0, 102, 1081, 1, 0, 0, 0, 104, + 1094, 1, 0, 0, 0, 106, 1101, 1, 0, 0, 0, 108, 1106, 1, 0, 0, 0, 110, 1117, + 1, 0, 0, 0, 112, 1121, 1, 0, 0, 0, 114, 1129, 1, 0, 0, 0, 116, 1137, 1, + 0, 0, 0, 118, 1145, 1, 0, 0, 0, 120, 1156, 1, 0, 0, 0, 122, 1165, 1, 0, + 0, 0, 124, 1172, 1, 0, 0, 0, 126, 1177, 1, 0, 0, 0, 128, 1186, 1, 0, 0, + 0, 130, 1197, 1, 0, 0, 0, 132, 1209, 1, 0, 0, 0, 134, 1220, 1, 0, 0, 0, + 136, 1229, 1, 0, 0, 0, 138, 1236, 1, 0, 0, 0, 140, 1243, 1, 0, 0, 0, 142, + 1248, 1, 0, 0, 0, 144, 1253, 1, 0, 0, 0, 146, 1257, 1, 0, 0, 0, 148, 1266, + 1, 0, 0, 0, 150, 1273, 1, 0, 0, 0, 152, 1280, 1, 0, 0, 0, 154, 1290, 1, + 0, 0, 0, 156, 1299, 1, 0, 0, 0, 158, 1304, 1, 0, 0, 0, 160, 1312, 1, 0, + 0, 0, 162, 1319, 1, 0, 0, 0, 164, 1327, 1, 0, 0, 0, 166, 1336, 1, 0, 0, + 0, 168, 1344, 1, 0, 0, 0, 170, 1353, 1, 0, 0, 0, 172, 1363, 1, 0, 0, 0, + 174, 1369, 1, 0, 0, 0, 176, 1375, 1, 0, 0, 0, 178, 1381, 1, 0, 0, 0, 180, + 1387, 1, 0, 0, 0, 182, 1391, 1, 0, 0, 0, 184, 1399, 1, 0, 0, 0, 186, 1405, + 1, 0, 0, 0, 188, 1410, 1, 0, 0, 0, 190, 1415, 1, 0, 0, 0, 192, 1419, 1, + 0, 0, 0, 194, 1426, 1, 0, 0, 0, 196, 1429, 1, 0, 0, 0, 198, 1434, 1, 0, + 0, 0, 200, 1440, 1, 0, 0, 0, 202, 1446, 1, 0, 0, 0, 204, 1453, 1, 0, 0, + 0, 206, 1462, 1, 0, 0, 0, 208, 1472, 1, 0, 0, 0, 210, 1475, 1, 0, 0, 0, + 212, 1485, 1, 0, 0, 0, 214, 1495, 1, 0, 0, 0, 216, 1501, 1, 0, 0, 0, 218, + 1507, 1, 0, 0, 0, 220, 1519, 1, 0, 0, 0, 222, 1526, 1, 0, 0, 0, 224, 1530, + 1, 0, 0, 0, 226, 1538, 1, 0, 0, 0, 228, 1548, 1, 0, 0, 0, 230, 1557, 1, + 0, 0, 0, 232, 1562, 1, 0, 0, 0, 234, 1565, 1, 0, 0, 0, 236, 1575, 1, 0, + 0, 0, 238, 1580, 1, 0, 0, 0, 240, 1584, 1, 0, 0, 0, 242, 1593, 1, 0, 0, + 0, 244, 1598, 1, 0, 0, 0, 246, 1606, 1, 0, 0, 0, 248, 1611, 1, 0, 0, 0, + 250, 1617, 1, 0, 0, 0, 252, 1622, 1, 0, 0, 0, 254, 1628, 1, 0, 0, 0, 256, + 1634, 1, 0, 0, 0, 258, 1640, 1, 0, 0, 0, 260, 1644, 1, 0, 0, 0, 262, 1648, + 1, 0, 0, 0, 264, 1655, 1, 0, 0, 0, 266, 1661, 1, 0, 0, 0, 268, 1670, 1, + 0, 0, 0, 270, 1678, 1, 0, 0, 0, 272, 1684, 1, 0, 0, 0, 274, 1689, 1, 0, + 0, 0, 276, 1692, 1, 0, 0, 0, 278, 1696, 1, 0, 0, 0, 280, 1701, 1, 0, 0, + 0, 282, 1707, 1, 0, 0, 0, 284, 1714, 1, 0, 0, 0, 286, 1722, 1, 0, 0, 0, + 288, 1735, 1, 0, 0, 0, 290, 1738, 1, 0, 0, 0, 292, 1741, 1, 0, 0, 0, 294, + 1746, 1, 0, 0, 0, 296, 1751, 1, 0, 0, 0, 298, 1758, 1, 0, 0, 0, 300, 1761, + 1, 0, 0, 0, 302, 1767, 1, 0, 0, 0, 304, 1773, 1, 0, 0, 0, 306, 1780, 1, + 0, 0, 0, 308, 1789, 1, 0, 0, 0, 310, 1797, 1, 0, 0, 0, 312, 1801, 1, 0, + 0, 0, 314, 1809, 1, 0, 0, 0, 316, 1817, 1, 0, 0, 0, 318, 1826, 1, 0, 0, + 0, 320, 1836, 1, 0, 0, 0, 322, 1844, 1, 0, 0, 0, 324, 1853, 1, 0, 0, 0, + 326, 1861, 1, 0, 0, 0, 328, 1867, 1, 0, 0, 0, 330, 1878, 1, 0, 0, 0, 332, + 1888, 1, 0, 0, 0, 334, 1895, 1, 0, 0, 0, 336, 1900, 1, 0, 0, 0, 338, 1905, + 1, 0, 0, 0, 340, 1916, 1, 0, 0, 0, 342, 1925, 1, 0, 0, 0, 344, 1933, 1, + 0, 0, 0, 346, 1942, 1, 0, 0, 0, 348, 1949, 1, 0, 0, 0, 350, 1955, 1, 0, + 0, 0, 352, 1964, 1, 0, 0, 0, 354, 1969, 1, 0, 0, 0, 356, 1976, 1, 0, 0, + 0, 358, 1983, 1, 0, 0, 0, 360, 1991, 1, 0, 0, 0, 362, 1998, 1, 0, 0, 0, + 364, 2006, 1, 0, 0, 0, 366, 2019, 1, 0, 0, 0, 368, 2023, 1, 0, 0, 0, 370, + 2032, 1, 0, 0, 0, 372, 2037, 1, 0, 0, 0, 374, 2046, 1, 0, 0, 0, 376, 2051, + 1, 0, 0, 0, 378, 2057, 1, 0, 0, 0, 380, 2061, 1, 0, 0, 0, 382, 2069, 1, + 0, 0, 0, 384, 2078, 1, 0, 0, 0, 386, 2087, 1, 0, 0, 0, 388, 2097, 1, 0, + 0, 0, 390, 2101, 1, 0, 0, 0, 392, 2113, 1, 0, 0, 0, 394, 2119, 1, 0, 0, + 0, 396, 2129, 1, 0, 0, 0, 398, 2134, 1, 0, 0, 0, 400, 2139, 1, 0, 0, 0, + 402, 2149, 1, 0, 0, 0, 404, 2152, 1, 0, 0, 0, 406, 2164, 1, 0, 0, 0, 408, + 2174, 1, 0, 0, 0, 410, 2186, 1, 0, 0, 0, 412, 2191, 1, 0, 0, 0, 414, 2196, + 1, 0, 0, 0, 416, 2202, 1, 0, 0, 0, 418, 2209, 1, 0, 0, 0, 420, 2217, 1, + 0, 0, 0, 422, 2224, 1, 0, 0, 0, 424, 2230, 1, 0, 0, 0, 426, 2237, 1, 0, + 0, 0, 428, 2243, 1, 0, 0, 0, 430, 2248, 1, 0, 0, 0, 432, 2254, 1, 0, 0, + 0, 434, 2260, 1, 0, 0, 0, 436, 2267, 1, 0, 0, 0, 438, 2275, 1, 0, 0, 0, + 440, 2283, 1, 0, 0, 0, 442, 2288, 1, 0, 0, 0, 444, 2293, 1, 0, 0, 0, 446, + 2302, 1, 0, 0, 0, 448, 2308, 1, 0, 0, 0, 450, 2313, 1, 0, 0, 0, 452, 2318, + 1, 0, 0, 0, 454, 2324, 1, 0, 0, 0, 456, 2329, 1, 0, 0, 0, 458, 2333, 1, + 0, 0, 0, 460, 2338, 1, 0, 0, 0, 462, 2343, 1, 0, 0, 0, 464, 2353, 1, 0, + 0, 0, 466, 2362, 1, 0, 0, 0, 468, 2380, 1, 0, 0, 0, 470, 2388, 1, 0, 0, + 0, 472, 2394, 1, 0, 0, 0, 474, 2402, 1, 0, 0, 0, 476, 2408, 1, 0, 0, 0, + 478, 2415, 1, 0, 0, 0, 480, 2422, 1, 0, 0, 0, 482, 2428, 1, 0, 0, 0, 484, + 2432, 1, 0, 0, 0, 486, 2441, 1, 0, 0, 0, 488, 2444, 1, 0, 0, 0, 490, 2454, + 1, 0, 0, 0, 492, 2463, 1, 0, 0, 0, 494, 2467, 1, 0, 0, 0, 496, 2471, 1, + 0, 0, 0, 498, 2479, 1, 0, 0, 0, 500, 2485, 1, 0, 0, 0, 502, 2494, 1, 0, + 0, 0, 504, 2499, 1, 0, 0, 0, 506, 2508, 1, 0, 0, 0, 508, 2513, 1, 0, 0, + 0, 510, 2522, 1, 0, 0, 0, 512, 2527, 1, 0, 0, 0, 514, 2534, 1, 0, 0, 0, + 516, 2539, 1, 0, 0, 0, 518, 2547, 1, 0, 0, 0, 520, 2554, 1, 0, 0, 0, 522, + 2561, 1, 0, 0, 0, 524, 2566, 1, 0, 0, 0, 526, 2571, 1, 0, 0, 0, 528, 2578, + 1, 0, 0, 0, 530, 2583, 1, 0, 0, 0, 532, 2588, 1, 0, 0, 0, 534, 2592, 1, + 0, 0, 0, 536, 2594, 1, 0, 0, 0, 538, 2596, 1, 0, 0, 0, 540, 2598, 1, 0, + 0, 0, 542, 2600, 1, 0, 0, 0, 544, 2602, 1, 0, 0, 0, 546, 2604, 1, 0, 0, + 0, 548, 2606, 1, 0, 0, 0, 550, 2608, 1, 0, 0, 0, 552, 2610, 1, 0, 0, 0, + 554, 2613, 1, 0, 0, 0, 556, 2616, 1, 0, 0, 0, 558, 2622, 1, 0, 0, 0, 560, + 2624, 1, 0, 0, 0, 562, 2627, 1, 0, 0, 0, 564, 2629, 1, 0, 0, 0, 566, 2631, + 1, 0, 0, 0, 568, 2634, 1, 0, 0, 0, 570, 2637, 1, 0, 0, 0, 572, 2639, 1, + 0, 0, 0, 574, 2641, 1, 0, 0, 0, 576, 2643, 1, 0, 0, 0, 578, 2645, 1, 0, + 0, 0, 580, 2647, 1, 0, 0, 0, 582, 2649, 1, 0, 0, 0, 584, 2654, 1, 0, 0, + 0, 586, 2656, 1, 0, 0, 0, 588, 2658, 1, 0, 0, 0, 590, 2660, 1, 0, 0, 0, + 592, 2662, 1, 0, 0, 0, 594, 2673, 1, 0, 0, 0, 596, 2740, 1, 0, 0, 0, 598, + 2742, 1, 0, 0, 0, 600, 2749, 1, 0, 0, 0, 602, 2760, 1, 0, 0, 0, 604, 2764, + 1, 0, 0, 0, 606, 2781, 1, 0, 0, 0, 608, 2795, 1, 0, 0, 0, 610, 2797, 1, + 0, 0, 0, 612, 2799, 1, 0, 0, 0, 614, 2801, 1, 0, 0, 0, 616, 2803, 1, 0, + 0, 0, 618, 2805, 1, 0, 0, 0, 620, 2820, 1, 0, 0, 0, 622, 2834, 1, 0, 0, + 0, 624, 2855, 1, 0, 0, 0, 626, 2861, 1, 0, 0, 0, 628, 2867, 1, 0, 0, 0, + 630, 2873, 1, 0, 0, 0, 632, 2877, 1, 0, 0, 0, 634, 2884, 1, 0, 0, 0, 636, + 2886, 1, 0, 0, 0, 638, 2888, 1, 0, 0, 0, 640, 2896, 1, 0, 0, 0, 642, 2903, + 1, 0, 0, 0, 644, 2908, 1, 0, 0, 0, 646, 2912, 1, 0, 0, 0, 648, 2917, 1, + 0, 0, 0, 650, 2919, 1, 0, 0, 0, 652, 2922, 1, 0, 0, 0, 654, 2927, 1, 0, + 0, 0, 656, 2929, 1, 0, 0, 0, 658, 2952, 1, 0, 0, 0, 660, 2975, 1, 0, 0, + 0, 662, 2998, 1, 0, 0, 0, 664, 3004, 1, 0, 0, 0, 666, 3009, 1, 0, 0, 0, + 668, 3011, 1, 0, 0, 0, 670, 3016, 1, 0, 0, 0, 672, 3018, 1, 0, 0, 0, 674, + 3045, 1, 0, 0, 0, 676, 3047, 1, 0, 0, 0, 678, 3052, 1, 0, 0, 0, 680, 3054, + 1, 0, 0, 0, 682, 3056, 1, 0, 0, 0, 684, 685, 7, 0, 0, 0, 685, 686, 7, 1, + 0, 0, 686, 687, 7, 2, 0, 0, 687, 688, 7, 3, 0, 0, 688, 689, 7, 4, 0, 0, + 689, 690, 7, 5, 0, 0, 690, 691, 7, 6, 0, 0, 691, 692, 7, 7, 0, 0, 692, + 3, 1, 0, 0, 0, 693, 694, 7, 0, 0, 0, 694, 695, 7, 8, 0, 0, 695, 696, 7, + 6, 0, 0, 696, 697, 7, 9, 0, 0, 697, 698, 7, 3, 0, 0, 698, 699, 7, 10, 0, + 0, 699, 5, 1, 0, 0, 0, 700, 701, 7, 0, 0, 0, 701, 702, 7, 11, 0, 0, 702, + 703, 7, 11, 0, 0, 703, 7, 1, 0, 0, 0, 704, 705, 7, 0, 0, 0, 705, 706, 7, + 4, 0, 0, 706, 707, 7, 4, 0, 0, 707, 9, 1, 0, 0, 0, 708, 709, 7, 0, 0, 0, + 709, 710, 7, 4, 0, 0, 710, 711, 7, 4, 0, 0, 711, 712, 7, 3, 0, 0, 712, + 713, 7, 8, 0, 0, 713, 714, 7, 0, 0, 0, 714, 715, 7, 6, 0, 0, 715, 716, + 7, 7, 0, 0, 716, 11, 1, 0, 0, 0, 717, 718, 7, 0, 0, 0, 718, 719, 7, 4, + 0, 0, 719, 720, 7, 6, 0, 0, 720, 721, 7, 7, 0, 0, 721, 722, 7, 12, 0, 0, + 722, 13, 1, 0, 0, 0, 723, 724, 7, 0, 0, 0, 724, 725, 7, 10, 0, 0, 725, + 726, 7, 11, 0, 0, 726, 15, 1, 0, 0, 0, 727, 728, 7, 0, 0, 0, 728, 729, + 7, 10, 0, 0, 729, 730, 7, 13, 0, 0, 730, 17, 1, 0, 0, 0, 731, 732, 7, 0, + 0, 0, 732, 733, 7, 12, 0, 0, 733, 734, 7, 7, 0, 0, 734, 19, 1, 0, 0, 0, + 735, 736, 7, 0, 0, 0, 736, 737, 7, 2, 0, 0, 737, 21, 1, 0, 0, 0, 738, 739, + 7, 0, 0, 0, 739, 740, 7, 2, 0, 0, 740, 741, 7, 8, 0, 0, 741, 23, 1, 0, + 0, 0, 742, 743, 7, 0, 0, 0, 743, 744, 7, 2, 0, 0, 744, 745, 7, 2, 0, 0, + 745, 746, 7, 7, 0, 0, 746, 747, 7, 12, 0, 0, 747, 748, 7, 6, 0, 0, 748, + 749, 7, 9, 0, 0, 749, 750, 7, 3, 0, 0, 750, 751, 7, 10, 0, 0, 751, 25, + 1, 0, 0, 0, 752, 753, 7, 0, 0, 0, 753, 754, 7, 6, 0, 0, 754, 27, 1, 0, + 0, 0, 755, 756, 7, 0, 0, 0, 756, 757, 7, 5, 0, 0, 757, 758, 7, 6, 0, 0, + 758, 759, 7, 14, 0, 0, 759, 760, 7, 3, 0, 0, 760, 761, 7, 12, 0, 0, 761, + 762, 7, 9, 0, 0, 762, 763, 7, 15, 0, 0, 763, 764, 7, 0, 0, 0, 764, 765, + 7, 6, 0, 0, 765, 766, 7, 9, 0, 0, 766, 767, 7, 3, 0, 0, 767, 768, 7, 10, + 0, 0, 768, 29, 1, 0, 0, 0, 769, 770, 7, 0, 0, 0, 770, 771, 7, 16, 0, 0, + 771, 772, 7, 17, 0, 0, 772, 31, 1, 0, 0, 0, 773, 774, 7, 1, 0, 0, 774, + 775, 7, 7, 0, 0, 775, 776, 7, 17, 0, 0, 776, 777, 7, 9, 0, 0, 777, 778, + 7, 10, 0, 0, 778, 33, 1, 0, 0, 0, 779, 780, 7, 1, 0, 0, 780, 781, 7, 7, + 0, 0, 781, 782, 7, 6, 0, 0, 782, 783, 7, 18, 0, 0, 783, 784, 7, 7, 0, 0, + 784, 785, 7, 7, 0, 0, 785, 786, 7, 10, 0, 0, 786, 35, 1, 0, 0, 0, 787, + 788, 7, 1, 0, 0, 788, 789, 7, 9, 0, 0, 789, 790, 7, 6, 0, 0, 790, 37, 1, + 0, 0, 0, 791, 792, 7, 1, 0, 0, 792, 793, 7, 9, 0, 0, 793, 794, 7, 6, 0, + 0, 794, 795, 5, 95, 0, 0, 795, 796, 7, 4, 0, 0, 796, 797, 7, 7, 0, 0, 797, + 798, 7, 10, 0, 0, 798, 799, 7, 17, 0, 0, 799, 800, 7, 6, 0, 0, 800, 801, + 7, 14, 0, 0, 801, 39, 1, 0, 0, 0, 802, 803, 7, 1, 0, 0, 803, 804, 7, 13, + 0, 0, 804, 41, 1, 0, 0, 0, 805, 806, 7, 8, 0, 0, 806, 807, 7, 0, 0, 0, + 807, 808, 7, 2, 0, 0, 808, 809, 7, 8, 0, 0, 809, 810, 7, 0, 0, 0, 810, + 811, 7, 11, 0, 0, 811, 812, 7, 7, 0, 0, 812, 43, 1, 0, 0, 0, 813, 814, + 7, 8, 0, 0, 814, 815, 7, 0, 0, 0, 815, 816, 7, 2, 0, 0, 816, 817, 7, 8, + 0, 0, 817, 818, 7, 0, 0, 0, 818, 819, 7, 11, 0, 0, 819, 820, 7, 7, 0, 0, + 820, 821, 7, 11, 0, 0, 821, 45, 1, 0, 0, 0, 822, 823, 7, 8, 0, 0, 823, + 824, 7, 0, 0, 0, 824, 825, 7, 2, 0, 0, 825, 826, 7, 7, 0, 0, 826, 47, 1, + 0, 0, 0, 827, 828, 7, 8, 0, 0, 828, 829, 7, 0, 0, 0, 829, 830, 7, 2, 0, + 0, 830, 831, 7, 6, 0, 0, 831, 49, 1, 0, 0, 0, 832, 833, 7, 8, 0, 0, 833, + 834, 7, 0, 0, 0, 834, 835, 7, 6, 0, 0, 835, 836, 7, 0, 0, 0, 836, 837, + 7, 4, 0, 0, 837, 838, 7, 3, 0, 0, 838, 839, 7, 17, 0, 0, 839, 51, 1, 0, + 0, 0, 840, 841, 7, 8, 0, 0, 841, 842, 7, 14, 0, 0, 842, 843, 7, 0, 0, 0, + 843, 844, 7, 12, 0, 0, 844, 53, 1, 0, 0, 0, 845, 846, 7, 8, 0, 0, 846, + 847, 7, 14, 0, 0, 847, 848, 7, 0, 0, 0, 848, 849, 7, 12, 0, 0, 849, 850, + 7, 0, 0, 0, 850, 851, 7, 8, 0, 0, 851, 852, 7, 6, 0, 0, 852, 853, 7, 7, + 0, 0, 853, 854, 7, 12, 0, 0, 854, 55, 1, 0, 0, 0, 855, 856, 7, 8, 0, 0, + 856, 857, 7, 14, 0, 0, 857, 858, 7, 0, 0, 0, 858, 859, 7, 12, 0, 0, 859, + 860, 7, 0, 0, 0, 860, 861, 7, 8, 0, 0, 861, 862, 7, 6, 0, 0, 862, 863, + 7, 7, 0, 0, 863, 864, 7, 12, 0, 0, 864, 865, 5, 95, 0, 0, 865, 866, 7, + 4, 0, 0, 866, 867, 7, 7, 0, 0, 867, 868, 7, 10, 0, 0, 868, 869, 7, 17, + 0, 0, 869, 870, 7, 6, 0, 0, 870, 871, 7, 14, 0, 0, 871, 57, 1, 0, 0, 0, + 872, 873, 7, 8, 0, 0, 873, 874, 7, 14, 0, 0, 874, 875, 7, 0, 0, 0, 875, + 876, 7, 12, 0, 0, 876, 877, 5, 95, 0, 0, 877, 878, 7, 4, 0, 0, 878, 879, + 7, 7, 0, 0, 879, 880, 7, 10, 0, 0, 880, 881, 7, 17, 0, 0, 881, 882, 7, + 6, 0, 0, 882, 883, 7, 14, 0, 0, 883, 59, 1, 0, 0, 0, 884, 885, 7, 8, 0, + 0, 885, 886, 7, 14, 0, 0, 886, 887, 7, 7, 0, 0, 887, 888, 7, 8, 0, 0, 888, + 889, 7, 19, 0, 0, 889, 61, 1, 0, 0, 0, 890, 891, 7, 8, 0, 0, 891, 892, + 7, 4, 0, 0, 892, 893, 7, 3, 0, 0, 893, 894, 7, 2, 0, 0, 894, 895, 7, 7, + 0, 0, 895, 63, 1, 0, 0, 0, 896, 897, 7, 8, 0, 0, 897, 898, 7, 3, 0, 0, + 898, 899, 7, 0, 0, 0, 899, 900, 7, 4, 0, 0, 900, 901, 7, 7, 0, 0, 901, + 902, 7, 2, 0, 0, 902, 903, 7, 8, 0, 0, 903, 904, 7, 7, 0, 0, 904, 65, 1, + 0, 0, 0, 905, 906, 7, 8, 0, 0, 906, 907, 7, 3, 0, 0, 907, 908, 7, 4, 0, + 0, 908, 909, 7, 4, 0, 0, 909, 910, 7, 0, 0, 0, 910, 911, 7, 6, 0, 0, 911, + 912, 7, 7, 0, 0, 912, 67, 1, 0, 0, 0, 913, 914, 7, 8, 0, 0, 914, 915, 7, + 3, 0, 0, 915, 916, 7, 4, 0, 0, 916, 917, 7, 4, 0, 0, 917, 918, 7, 0, 0, + 0, 918, 919, 7, 6, 0, 0, 919, 920, 7, 9, 0, 0, 920, 921, 7, 3, 0, 0, 921, + 922, 7, 10, 0, 0, 922, 69, 1, 0, 0, 0, 923, 924, 7, 8, 0, 0, 924, 925, + 7, 3, 0, 0, 925, 926, 7, 4, 0, 0, 926, 927, 7, 5, 0, 0, 927, 928, 7, 20, + 0, 0, 928, 929, 7, 10, 0, 0, 929, 71, 1, 0, 0, 0, 930, 931, 7, 8, 0, 0, + 931, 932, 7, 3, 0, 0, 932, 933, 7, 20, 0, 0, 933, 934, 7, 20, 0, 0, 934, + 935, 7, 9, 0, 0, 935, 936, 7, 6, 0, 0, 936, 73, 1, 0, 0, 0, 937, 938, 7, + 8, 0, 0, 938, 939, 7, 3, 0, 0, 939, 940, 7, 10, 0, 0, 940, 941, 7, 10, + 0, 0, 941, 942, 7, 7, 0, 0, 942, 943, 7, 8, 0, 0, 943, 944, 7, 6, 0, 0, + 944, 75, 1, 0, 0, 0, 945, 946, 7, 8, 0, 0, 946, 947, 7, 3, 0, 0, 947, 948, + 7, 10, 0, 0, 948, 949, 7, 10, 0, 0, 949, 950, 7, 7, 0, 0, 950, 951, 7, + 8, 0, 0, 951, 952, 7, 6, 0, 0, 952, 953, 7, 9, 0, 0, 953, 954, 7, 3, 0, + 0, 954, 955, 7, 10, 0, 0, 955, 77, 1, 0, 0, 0, 956, 957, 7, 8, 0, 0, 957, + 958, 7, 3, 0, 0, 958, 959, 7, 10, 0, 0, 959, 960, 7, 2, 0, 0, 960, 961, + 7, 6, 0, 0, 961, 962, 7, 12, 0, 0, 962, 963, 7, 0, 0, 0, 963, 964, 7, 9, + 0, 0, 964, 965, 7, 10, 0, 0, 965, 966, 7, 6, 0, 0, 966, 79, 1, 0, 0, 0, + 967, 968, 7, 8, 0, 0, 968, 969, 7, 3, 0, 0, 969, 970, 7, 10, 0, 0, 970, + 971, 7, 2, 0, 0, 971, 972, 7, 6, 0, 0, 972, 973, 7, 12, 0, 0, 973, 974, + 7, 0, 0, 0, 974, 975, 7, 9, 0, 0, 975, 976, 7, 10, 0, 0, 976, 977, 7, 6, + 0, 0, 977, 978, 7, 2, 0, 0, 978, 81, 1, 0, 0, 0, 979, 980, 7, 8, 0, 0, + 980, 981, 7, 3, 0, 0, 981, 982, 7, 10, 0, 0, 982, 983, 7, 6, 0, 0, 983, + 984, 7, 9, 0, 0, 984, 985, 7, 10, 0, 0, 985, 986, 7, 5, 0, 0, 986, 987, + 7, 7, 0, 0, 987, 83, 1, 0, 0, 0, 988, 989, 7, 8, 0, 0, 989, 990, 7, 3, + 0, 0, 990, 991, 7, 10, 0, 0, 991, 992, 7, 16, 0, 0, 992, 993, 7, 7, 0, + 0, 993, 994, 7, 12, 0, 0, 994, 995, 7, 6, 0, 0, 995, 85, 1, 0, 0, 0, 996, + 997, 7, 8, 0, 0, 997, 998, 7, 3, 0, 0, 998, 999, 7, 12, 0, 0, 999, 1000, + 7, 12, 0, 0, 1000, 1001, 7, 7, 0, 0, 1001, 1002, 7, 2, 0, 0, 1002, 1003, + 7, 21, 0, 0, 1003, 1004, 7, 3, 0, 0, 1004, 1005, 7, 10, 0, 0, 1005, 1006, + 7, 11, 0, 0, 1006, 1007, 7, 9, 0, 0, 1007, 1008, 7, 10, 0, 0, 1008, 1009, + 7, 17, 0, 0, 1009, 87, 1, 0, 0, 0, 1010, 1011, 7, 8, 0, 0, 1011, 1012, + 7, 3, 0, 0, 1012, 1013, 7, 5, 0, 0, 1013, 1014, 7, 10, 0, 0, 1014, 1015, + 7, 6, 0, 0, 1015, 89, 1, 0, 0, 0, 1016, 1017, 7, 8, 0, 0, 1017, 1018, 7, + 12, 0, 0, 1018, 1019, 7, 7, 0, 0, 1019, 1020, 7, 0, 0, 0, 1020, 1021, 7, + 6, 0, 0, 1021, 1022, 7, 7, 0, 0, 1022, 91, 1, 0, 0, 0, 1023, 1024, 7, 8, + 0, 0, 1024, 1025, 7, 12, 0, 0, 1025, 1026, 7, 3, 0, 0, 1026, 1027, 7, 2, + 0, 0, 1027, 1028, 7, 2, 0, 0, 1028, 93, 1, 0, 0, 0, 1029, 1030, 7, 8, 0, + 0, 1030, 1031, 7, 5, 0, 0, 1031, 1032, 7, 12, 0, 0, 1032, 1033, 7, 12, + 0, 0, 1033, 1034, 7, 7, 0, 0, 1034, 1035, 7, 10, 0, 0, 1035, 1036, 7, 6, + 0, 0, 1036, 95, 1, 0, 0, 0, 1037, 1038, 7, 8, 0, 0, 1038, 1039, 7, 5, 0, + 0, 1039, 1040, 7, 12, 0, 0, 1040, 1041, 7, 12, 0, 0, 1041, 1042, 7, 7, + 0, 0, 1042, 1043, 7, 10, 0, 0, 1043, 1044, 7, 6, 0, 0, 1044, 1045, 5, 95, + 0, 0, 1045, 1046, 7, 11, 0, 0, 1046, 1047, 7, 0, 0, 0, 1047, 1048, 7, 6, + 0, 0, 1048, 1049, 7, 7, 0, 0, 1049, 97, 1, 0, 0, 0, 1050, 1051, 7, 8, 0, + 0, 1051, 1052, 7, 5, 0, 0, 1052, 1053, 7, 12, 0, 0, 1053, 1054, 7, 12, + 0, 0, 1054, 1055, 7, 7, 0, 0, 1055, 1056, 7, 10, 0, 0, 1056, 1057, 7, 6, + 0, 0, 1057, 1058, 5, 95, 0, 0, 1058, 1059, 7, 6, 0, 0, 1059, 1060, 7, 9, + 0, 0, 1060, 1061, 7, 20, 0, 0, 1061, 1062, 7, 7, 0, 0, 1062, 99, 1, 0, + 0, 0, 1063, 1064, 7, 8, 0, 0, 1064, 1065, 7, 5, 0, 0, 1065, 1066, 7, 12, + 0, 0, 1066, 1067, 7, 12, 0, 0, 1067, 1068, 7, 7, 0, 0, 1068, 1069, 7, 10, + 0, 0, 1069, 1070, 7, 6, 0, 0, 1070, 1071, 5, 95, 0, 0, 1071, 1072, 7, 6, + 0, 0, 1072, 1073, 7, 9, 0, 0, 1073, 1074, 7, 20, 0, 0, 1074, 1075, 7, 7, + 0, 0, 1075, 1076, 7, 2, 0, 0, 1076, 1077, 7, 6, 0, 0, 1077, 1078, 7, 0, + 0, 0, 1078, 1079, 7, 20, 0, 0, 1079, 1080, 7, 21, 0, 0, 1080, 101, 1, 0, + 0, 0, 1081, 1082, 7, 8, 0, 0, 1082, 1083, 7, 5, 0, 0, 1083, 1084, 7, 12, + 0, 0, 1084, 1085, 7, 12, 0, 0, 1085, 1086, 7, 7, 0, 0, 1086, 1087, 7, 10, + 0, 0, 1087, 1088, 7, 6, 0, 0, 1088, 1089, 5, 95, 0, 0, 1089, 1090, 7, 5, + 0, 0, 1090, 1091, 7, 2, 0, 0, 1091, 1092, 7, 7, 0, 0, 1092, 1093, 7, 12, + 0, 0, 1093, 103, 1, 0, 0, 0, 1094, 1095, 7, 8, 0, 0, 1095, 1096, 7, 5, + 0, 0, 1096, 1097, 7, 12, 0, 0, 1097, 1098, 7, 2, 0, 0, 1098, 1099, 7, 3, + 0, 0, 1099, 1100, 7, 12, 0, 0, 1100, 105, 1, 0, 0, 0, 1101, 1102, 7, 11, + 0, 0, 1102, 1103, 7, 0, 0, 0, 1103, 1104, 7, 6, 0, 0, 1104, 1105, 7, 7, + 0, 0, 1105, 107, 1, 0, 0, 0, 1106, 1107, 7, 11, 0, 0, 1107, 1108, 7, 7, + 0, 0, 1108, 1109, 7, 0, 0, 0, 1109, 1110, 7, 4, 0, 0, 1110, 1111, 7, 4, + 0, 0, 1111, 1112, 7, 3, 0, 0, 1112, 1113, 7, 8, 0, 0, 1113, 1114, 7, 0, + 0, 0, 1114, 1115, 7, 6, 0, 0, 1115, 1116, 7, 7, 0, 0, 1116, 109, 1, 0, + 0, 0, 1117, 1118, 7, 11, 0, 0, 1118, 1119, 7, 7, 0, 0, 1119, 1120, 7, 8, + 0, 0, 1120, 111, 1, 0, 0, 0, 1121, 1122, 7, 11, 0, 0, 1122, 1123, 7, 7, + 0, 0, 1123, 1124, 7, 8, 0, 0, 1124, 1125, 7, 9, 0, 0, 1125, 1126, 7, 20, + 0, 0, 1126, 1127, 7, 0, 0, 0, 1127, 1128, 7, 4, 0, 0, 1128, 113, 1, 0, + 0, 0, 1129, 1130, 7, 11, 0, 0, 1130, 1131, 7, 7, 0, 0, 1131, 1132, 7, 8, + 0, 0, 1132, 1133, 7, 4, 0, 0, 1133, 1134, 7, 0, 0, 0, 1134, 1135, 7, 12, + 0, 0, 1135, 1136, 7, 7, 0, 0, 1136, 115, 1, 0, 0, 0, 1137, 1138, 7, 11, + 0, 0, 1138, 1139, 7, 7, 0, 0, 1139, 1140, 7, 22, 0, 0, 1140, 1141, 7, 0, + 0, 0, 1141, 1142, 7, 5, 0, 0, 1142, 1143, 7, 4, 0, 0, 1143, 1144, 7, 6, + 0, 0, 1144, 117, 1, 0, 0, 0, 1145, 1146, 7, 11, 0, 0, 1146, 1147, 7, 7, + 0, 0, 1147, 1148, 7, 22, 0, 0, 1148, 1149, 7, 7, 0, 0, 1149, 1150, 7, 12, + 0, 0, 1150, 1151, 7, 12, 0, 0, 1151, 1152, 7, 0, 0, 0, 1152, 1153, 7, 1, + 0, 0, 1153, 1154, 7, 4, 0, 0, 1154, 1155, 7, 7, 0, 0, 1155, 119, 1, 0, + 0, 0, 1156, 1157, 7, 11, 0, 0, 1157, 1158, 7, 7, 0, 0, 1158, 1159, 7, 22, + 0, 0, 1159, 1160, 7, 7, 0, 0, 1160, 1161, 7, 12, 0, 0, 1161, 1162, 7, 12, + 0, 0, 1162, 1163, 7, 7, 0, 0, 1163, 1164, 7, 11, 0, 0, 1164, 121, 1, 0, + 0, 0, 1165, 1166, 7, 11, 0, 0, 1166, 1167, 7, 7, 0, 0, 1167, 1168, 7, 4, + 0, 0, 1168, 1169, 7, 7, 0, 0, 1169, 1170, 7, 6, 0, 0, 1170, 1171, 7, 7, + 0, 0, 1171, 123, 1, 0, 0, 0, 1172, 1173, 7, 11, 0, 0, 1173, 1174, 7, 7, + 0, 0, 1174, 1175, 7, 2, 0, 0, 1175, 1176, 7, 8, 0, 0, 1176, 125, 1, 0, + 0, 0, 1177, 1178, 7, 11, 0, 0, 1178, 1179, 7, 7, 0, 0, 1179, 1180, 7, 2, + 0, 0, 1180, 1181, 7, 8, 0, 0, 1181, 1182, 7, 12, 0, 0, 1182, 1183, 7, 9, + 0, 0, 1183, 1184, 7, 1, 0, 0, 1184, 1185, 7, 7, 0, 0, 1185, 127, 1, 0, + 0, 0, 1186, 1187, 7, 11, 0, 0, 1187, 1188, 7, 7, 0, 0, 1188, 1189, 7, 2, + 0, 0, 1189, 1190, 7, 8, 0, 0, 1190, 1191, 7, 12, 0, 0, 1191, 1192, 7, 9, + 0, 0, 1192, 1193, 7, 21, 0, 0, 1193, 1194, 7, 6, 0, 0, 1194, 1195, 7, 3, + 0, 0, 1195, 1196, 7, 12, 0, 0, 1196, 129, 1, 0, 0, 0, 1197, 1198, 7, 11, + 0, 0, 1198, 1199, 7, 9, 0, 0, 1199, 1200, 7, 0, 0, 0, 1200, 1201, 7, 17, + 0, 0, 1201, 1202, 7, 10, 0, 0, 1202, 1203, 7, 3, 0, 0, 1203, 1204, 7, 2, + 0, 0, 1204, 1205, 7, 6, 0, 0, 1205, 1206, 7, 9, 0, 0, 1206, 1207, 7, 8, + 0, 0, 1207, 1208, 7, 2, 0, 0, 1208, 131, 1, 0, 0, 0, 1209, 1210, 7, 11, + 0, 0, 1210, 1211, 7, 9, 0, 0, 1211, 1212, 7, 2, 0, 0, 1212, 1213, 7, 8, + 0, 0, 1213, 1214, 7, 3, 0, 0, 1214, 1215, 7, 10, 0, 0, 1215, 1216, 7, 10, + 0, 0, 1216, 1217, 7, 7, 0, 0, 1217, 1218, 7, 8, 0, 0, 1218, 1219, 7, 6, + 0, 0, 1219, 133, 1, 0, 0, 0, 1220, 1221, 7, 11, 0, 0, 1221, 1222, 7, 9, + 0, 0, 1222, 1223, 7, 2, 0, 0, 1223, 1224, 7, 6, 0, 0, 1224, 1225, 7, 9, + 0, 0, 1225, 1226, 7, 10, 0, 0, 1226, 1227, 7, 8, 0, 0, 1227, 1228, 7, 6, + 0, 0, 1228, 135, 1, 0, 0, 0, 1229, 1230, 7, 11, 0, 0, 1230, 1231, 7, 3, + 0, 0, 1231, 1232, 7, 20, 0, 0, 1232, 1233, 7, 0, 0, 0, 1233, 1234, 7, 9, + 0, 0, 1234, 1235, 7, 10, 0, 0, 1235, 137, 1, 0, 0, 0, 1236, 1237, 7, 11, + 0, 0, 1237, 1238, 7, 3, 0, 0, 1238, 1239, 7, 5, 0, 0, 1239, 1240, 7, 1, + 0, 0, 1240, 1241, 7, 4, 0, 0, 1241, 1242, 7, 7, 0, 0, 1242, 139, 1, 0, + 0, 0, 1243, 1244, 7, 11, 0, 0, 1244, 1245, 7, 12, 0, 0, 1245, 1246, 7, + 3, 0, 0, 1246, 1247, 7, 21, 0, 0, 1247, 141, 1, 0, 0, 0, 1248, 1249, 7, + 7, 0, 0, 1249, 1250, 7, 4, 0, 0, 1250, 1251, 7, 2, 0, 0, 1251, 1252, 7, + 7, 0, 0, 1252, 143, 1, 0, 0, 0, 1253, 1254, 7, 7, 0, 0, 1254, 1255, 7, + 10, 0, 0, 1255, 1256, 7, 11, 0, 0, 1256, 145, 1, 0, 0, 0, 1257, 1258, 7, + 7, 0, 0, 1258, 1259, 7, 10, 0, 0, 1259, 1260, 7, 11, 0, 0, 1260, 1261, + 5, 45, 0, 0, 1261, 1262, 7, 7, 0, 0, 1262, 1263, 7, 23, 0, 0, 1263, 1264, + 7, 7, 0, 0, 1264, 1265, 7, 8, 0, 0, 1265, 147, 1, 0, 0, 0, 1266, 1267, + 7, 7, 0, 0, 1267, 1268, 7, 2, 0, 0, 1268, 1269, 7, 8, 0, 0, 1269, 1270, + 7, 0, 0, 0, 1270, 1271, 7, 21, 0, 0, 1271, 1272, 7, 7, 0, 0, 1272, 149, + 1, 0, 0, 0, 1273, 1274, 7, 7, 0, 0, 1274, 1275, 7, 23, 0, 0, 1275, 1276, + 7, 8, 0, 0, 1276, 1277, 7, 7, 0, 0, 1277, 1278, 7, 21, 0, 0, 1278, 1279, + 7, 6, 0, 0, 1279, 151, 1, 0, 0, 0, 1280, 1281, 7, 7, 0, 0, 1281, 1282, + 7, 23, 0, 0, 1282, 1283, 7, 8, 0, 0, 1283, 1284, 7, 7, 0, 0, 1284, 1285, + 7, 21, 0, 0, 1285, 1286, 7, 6, 0, 0, 1286, 1287, 7, 9, 0, 0, 1287, 1288, + 7, 3, 0, 0, 1288, 1289, 7, 10, 0, 0, 1289, 153, 1, 0, 0, 0, 1290, 1291, + 7, 7, 0, 0, 1291, 1292, 7, 23, 0, 0, 1292, 1293, 7, 8, 0, 0, 1293, 1294, + 7, 4, 0, 0, 1294, 1295, 7, 5, 0, 0, 1295, 1296, 7, 11, 0, 0, 1296, 1297, + 7, 7, 0, 0, 1297, 1298, 7, 11, 0, 0, 1298, 155, 1, 0, 0, 0, 1299, 1300, + 7, 7, 0, 0, 1300, 1301, 7, 23, 0, 0, 1301, 1302, 7, 7, 0, 0, 1302, 1303, + 7, 8, 0, 0, 1303, 157, 1, 0, 0, 0, 1304, 1305, 7, 7, 0, 0, 1305, 1306, + 7, 23, 0, 0, 1306, 1307, 7, 7, 0, 0, 1307, 1308, 7, 8, 0, 0, 1308, 1309, + 7, 5, 0, 0, 1309, 1310, 7, 6, 0, 0, 1310, 1311, 7, 7, 0, 0, 1311, 159, + 1, 0, 0, 0, 1312, 1313, 7, 7, 0, 0, 1313, 1314, 7, 23, 0, 0, 1314, 1315, + 7, 9, 0, 0, 1315, 1316, 7, 2, 0, 0, 1316, 1317, 7, 6, 0, 0, 1317, 1318, + 7, 2, 0, 0, 1318, 161, 1, 0, 0, 0, 1319, 1320, 7, 7, 0, 0, 1320, 1321, + 7, 23, 0, 0, 1321, 1322, 7, 21, 0, 0, 1322, 1323, 7, 4, 0, 0, 1323, 1324, + 7, 0, 0, 0, 1324, 1325, 7, 9, 0, 0, 1325, 1326, 7, 10, 0, 0, 1326, 163, + 1, 0, 0, 0, 1327, 1328, 7, 7, 0, 0, 1328, 1329, 7, 23, 0, 0, 1329, 1330, + 7, 6, 0, 0, 1330, 1331, 7, 7, 0, 0, 1331, 1332, 7, 12, 0, 0, 1332, 1333, + 7, 10, 0, 0, 1333, 1334, 7, 0, 0, 0, 1334, 1335, 7, 4, 0, 0, 1335, 165, + 1, 0, 0, 0, 1336, 1337, 7, 7, 0, 0, 1337, 1338, 7, 23, 0, 0, 1338, 1339, + 7, 6, 0, 0, 1339, 1340, 7, 12, 0, 0, 1340, 1341, 7, 0, 0, 0, 1341, 1342, + 7, 8, 0, 0, 1342, 1343, 7, 6, 0, 0, 1343, 167, 1, 0, 0, 0, 1344, 1345, + 7, 11, 0, 0, 1345, 1346, 7, 0, 0, 0, 1346, 1347, 7, 6, 0, 0, 1347, 1348, + 7, 7, 0, 0, 1348, 1349, 5, 95, 0, 0, 1349, 1350, 7, 0, 0, 0, 1350, 1351, + 7, 11, 0, 0, 1351, 1352, 7, 11, 0, 0, 1352, 169, 1, 0, 0, 0, 1353, 1354, + 7, 11, 0, 0, 1354, 1355, 7, 0, 0, 0, 1355, 1356, 7, 6, 0, 0, 1356, 1357, + 7, 7, 0, 0, 1357, 1358, 5, 95, 0, 0, 1358, 1359, 7, 11, 0, 0, 1359, 1360, + 7, 9, 0, 0, 1360, 1361, 7, 22, 0, 0, 1361, 1362, 7, 22, 0, 0, 1362, 171, + 1, 0, 0, 0, 1363, 1364, 7, 22, 0, 0, 1364, 1365, 7, 0, 0, 0, 1365, 1366, + 7, 4, 0, 0, 1366, 1367, 7, 2, 0, 0, 1367, 1368, 7, 7, 0, 0, 1368, 173, + 1, 0, 0, 0, 1369, 1370, 7, 22, 0, 0, 1370, 1371, 7, 7, 0, 0, 1371, 1372, + 7, 6, 0, 0, 1372, 1373, 7, 8, 0, 0, 1373, 1374, 7, 14, 0, 0, 1374, 175, + 1, 0, 0, 0, 1375, 1376, 7, 22, 0, 0, 1376, 1377, 7, 9, 0, 0, 1377, 1378, + 7, 12, 0, 0, 1378, 1379, 7, 2, 0, 0, 1379, 1380, 7, 6, 0, 0, 1380, 177, + 1, 0, 0, 0, 1381, 1382, 7, 22, 0, 0, 1382, 1383, 7, 4, 0, 0, 1383, 1384, + 7, 3, 0, 0, 1384, 1385, 7, 0, 0, 0, 1385, 1386, 7, 6, 0, 0, 1386, 179, + 1, 0, 0, 0, 1387, 1388, 7, 22, 0, 0, 1388, 1389, 7, 3, 0, 0, 1389, 1390, + 7, 12, 0, 0, 1390, 181, 1, 0, 0, 0, 1391, 1392, 7, 22, 0, 0, 1392, 1393, + 7, 3, 0, 0, 1393, 1394, 7, 12, 0, 0, 1394, 1395, 7, 7, 0, 0, 1395, 1396, + 7, 9, 0, 0, 1396, 1397, 7, 17, 0, 0, 1397, 1398, 7, 10, 0, 0, 1398, 183, + 1, 0, 0, 0, 1399, 1400, 7, 22, 0, 0, 1400, 1401, 7, 3, 0, 0, 1401, 1402, + 7, 5, 0, 0, 1402, 1403, 7, 10, 0, 0, 1403, 1404, 7, 11, 0, 0, 1404, 185, + 1, 0, 0, 0, 1405, 1406, 7, 22, 0, 0, 1406, 1407, 7, 12, 0, 0, 1407, 1408, + 7, 3, 0, 0, 1408, 1409, 7, 20, 0, 0, 1409, 187, 1, 0, 0, 0, 1410, 1411, + 7, 22, 0, 0, 1411, 1412, 7, 5, 0, 0, 1412, 1413, 7, 4, 0, 0, 1413, 1414, + 7, 4, 0, 0, 1414, 189, 1, 0, 0, 0, 1415, 1416, 7, 17, 0, 0, 1416, 1417, + 7, 7, 0, 0, 1417, 1418, 7, 6, 0, 0, 1418, 191, 1, 0, 0, 0, 1419, 1420, + 7, 17, 0, 0, 1420, 1421, 7, 4, 0, 0, 1421, 1422, 7, 3, 0, 0, 1422, 1423, + 7, 1, 0, 0, 1423, 1424, 7, 0, 0, 0, 1424, 1425, 7, 4, 0, 0, 1425, 193, + 1, 0, 0, 0, 1426, 1427, 7, 17, 0, 0, 1427, 1428, 7, 3, 0, 0, 1428, 195, + 1, 0, 0, 0, 1429, 1430, 7, 17, 0, 0, 1430, 1431, 7, 3, 0, 0, 1431, 1432, + 7, 6, 0, 0, 1432, 1433, 7, 3, 0, 0, 1433, 197, 1, 0, 0, 0, 1434, 1435, + 7, 17, 0, 0, 1435, 1436, 7, 12, 0, 0, 1436, 1437, 7, 0, 0, 0, 1437, 1438, + 7, 10, 0, 0, 1438, 1439, 7, 6, 0, 0, 1439, 199, 1, 0, 0, 0, 1440, 1441, + 7, 17, 0, 0, 1441, 1442, 7, 12, 0, 0, 1442, 1443, 7, 3, 0, 0, 1443, 1444, + 7, 5, 0, 0, 1444, 1445, 7, 21, 0, 0, 1445, 201, 1, 0, 0, 0, 1446, 1447, + 7, 14, 0, 0, 1447, 1448, 7, 0, 0, 0, 1448, 1449, 7, 16, 0, 0, 1449, 1450, + 7, 9, 0, 0, 1450, 1451, 7, 10, 0, 0, 1451, 1452, 7, 17, 0, 0, 1452, 203, + 1, 0, 0, 0, 1453, 1454, 7, 9, 0, 0, 1454, 1455, 7, 11, 0, 0, 1455, 1456, + 7, 7, 0, 0, 1456, 1457, 7, 10, 0, 0, 1457, 1458, 7, 6, 0, 0, 1458, 1459, + 7, 9, 0, 0, 1459, 1460, 7, 6, 0, 0, 1460, 1461, 7, 13, 0, 0, 1461, 205, + 1, 0, 0, 0, 1462, 1463, 7, 9, 0, 0, 1463, 1464, 7, 20, 0, 0, 1464, 1465, + 7, 20, 0, 0, 1465, 1466, 7, 7, 0, 0, 1466, 1467, 7, 11, 0, 0, 1467, 1468, + 7, 9, 0, 0, 1468, 1469, 7, 0, 0, 0, 1469, 1470, 7, 6, 0, 0, 1470, 1471, + 7, 7, 0, 0, 1471, 207, 1, 0, 0, 0, 1472, 1473, 7, 9, 0, 0, 1473, 1474, + 7, 10, 0, 0, 1474, 209, 1, 0, 0, 0, 1475, 1476, 7, 9, 0, 0, 1476, 1477, + 7, 10, 0, 0, 1477, 1478, 7, 11, 0, 0, 1478, 1479, 7, 9, 0, 0, 1479, 1480, + 7, 8, 0, 0, 1480, 1481, 7, 0, 0, 0, 1481, 1482, 7, 6, 0, 0, 1482, 1483, + 7, 3, 0, 0, 1483, 1484, 7, 12, 0, 0, 1484, 211, 1, 0, 0, 0, 1485, 1486, + 7, 9, 0, 0, 1486, 1487, 7, 10, 0, 0, 1487, 1488, 7, 9, 0, 0, 1488, 1489, + 7, 6, 0, 0, 1489, 1490, 7, 9, 0, 0, 1490, 1491, 7, 0, 0, 0, 1491, 1492, + 7, 4, 0, 0, 1492, 1493, 7, 4, 0, 0, 1493, 1494, 7, 13, 0, 0, 1494, 213, + 1, 0, 0, 0, 1495, 1496, 7, 9, 0, 0, 1496, 1497, 7, 10, 0, 0, 1497, 1498, + 7, 10, 0, 0, 1498, 1499, 7, 7, 0, 0, 1499, 1500, 7, 12, 0, 0, 1500, 215, + 1, 0, 0, 0, 1501, 1502, 7, 9, 0, 0, 1502, 1503, 7, 10, 0, 0, 1503, 1504, + 7, 21, 0, 0, 1504, 1505, 7, 5, 0, 0, 1505, 1506, 7, 6, 0, 0, 1506, 217, + 1, 0, 0, 0, 1507, 1508, 7, 9, 0, 0, 1508, 1509, 7, 10, 0, 0, 1509, 1510, + 7, 2, 0, 0, 1510, 1511, 7, 7, 0, 0, 1511, 1512, 7, 10, 0, 0, 1512, 1513, + 7, 2, 0, 0, 1513, 1514, 7, 9, 0, 0, 1514, 1515, 7, 6, 0, 0, 1515, 1516, + 7, 9, 0, 0, 1516, 1517, 7, 16, 0, 0, 1517, 1518, 7, 7, 0, 0, 1518, 219, + 1, 0, 0, 0, 1519, 1520, 7, 9, 0, 0, 1520, 1521, 7, 10, 0, 0, 1521, 1522, + 7, 2, 0, 0, 1522, 1523, 7, 7, 0, 0, 1523, 1524, 7, 12, 0, 0, 1524, 1525, + 7, 6, 0, 0, 1525, 221, 1, 0, 0, 0, 1526, 1527, 7, 9, 0, 0, 1527, 1528, + 7, 10, 0, 0, 1528, 1529, 7, 6, 0, 0, 1529, 223, 1, 0, 0, 0, 1530, 1531, + 7, 9, 0, 0, 1531, 1532, 7, 10, 0, 0, 1532, 1533, 7, 6, 0, 0, 1533, 1534, + 7, 7, 0, 0, 1534, 1535, 7, 17, 0, 0, 1535, 1536, 7, 7, 0, 0, 1536, 1537, + 7, 12, 0, 0, 1537, 225, 1, 0, 0, 0, 1538, 1539, 7, 9, 0, 0, 1539, 1540, + 7, 10, 0, 0, 1540, 1541, 7, 6, 0, 0, 1541, 1542, 7, 7, 0, 0, 1542, 1543, + 7, 12, 0, 0, 1543, 1544, 7, 2, 0, 0, 1544, 1545, 7, 7, 0, 0, 1545, 1546, + 7, 8, 0, 0, 1546, 1547, 7, 6, 0, 0, 1547, 227, 1, 0, 0, 0, 1548, 1549, + 7, 9, 0, 0, 1549, 1550, 7, 10, 0, 0, 1550, 1551, 7, 6, 0, 0, 1551, 1552, + 7, 7, 0, 0, 1552, 1553, 7, 12, 0, 0, 1553, 1554, 7, 16, 0, 0, 1554, 1555, + 7, 0, 0, 0, 1555, 1556, 7, 4, 0, 0, 1556, 229, 1, 0, 0, 0, 1557, 1558, + 7, 9, 0, 0, 1558, 1559, 7, 10, 0, 0, 1559, 1560, 7, 6, 0, 0, 1560, 1561, + 7, 3, 0, 0, 1561, 231, 1, 0, 0, 0, 1562, 1563, 7, 9, 0, 0, 1563, 1564, + 7, 2, 0, 0, 1564, 233, 1, 0, 0, 0, 1565, 1566, 7, 9, 0, 0, 1566, 1567, + 7, 2, 0, 0, 1567, 1568, 7, 3, 0, 0, 1568, 1569, 7, 4, 0, 0, 1569, 1570, + 7, 0, 0, 0, 1570, 1571, 7, 6, 0, 0, 1571, 1572, 7, 9, 0, 0, 1572, 1573, + 7, 3, 0, 0, 1573, 1574, 7, 10, 0, 0, 1574, 235, 1, 0, 0, 0, 1575, 1576, + 7, 24, 0, 0, 1576, 1577, 7, 3, 0, 0, 1577, 1578, 7, 9, 0, 0, 1578, 1579, + 7, 10, 0, 0, 1579, 237, 1, 0, 0, 0, 1580, 1581, 7, 19, 0, 0, 1581, 1582, + 7, 7, 0, 0, 1582, 1583, 7, 13, 0, 0, 1583, 239, 1, 0, 0, 0, 1584, 1585, + 7, 4, 0, 0, 1585, 1586, 7, 0, 0, 0, 1586, 1587, 7, 10, 0, 0, 1587, 1588, + 7, 17, 0, 0, 1588, 1589, 7, 5, 0, 0, 1589, 1590, 7, 0, 0, 0, 1590, 1591, + 7, 17, 0, 0, 1591, 1592, 7, 7, 0, 0, 1592, 241, 1, 0, 0, 0, 1593, 1594, + 7, 4, 0, 0, 1594, 1595, 7, 0, 0, 0, 1595, 1596, 7, 2, 0, 0, 1596, 1597, + 7, 6, 0, 0, 1597, 243, 1, 0, 0, 0, 1598, 1599, 7, 4, 0, 0, 1599, 1600, + 7, 0, 0, 0, 1600, 1601, 7, 6, 0, 0, 1601, 1602, 7, 7, 0, 0, 1602, 1603, + 7, 12, 0, 0, 1603, 1604, 7, 0, 0, 0, 1604, 1605, 7, 4, 0, 0, 1605, 245, + 1, 0, 0, 0, 1606, 1607, 7, 4, 0, 0, 1607, 1608, 7, 7, 0, 0, 1608, 1609, + 7, 22, 0, 0, 1609, 1610, 7, 6, 0, 0, 1610, 247, 1, 0, 0, 0, 1611, 1612, + 7, 4, 0, 0, 1612, 1613, 7, 7, 0, 0, 1613, 1614, 7, 16, 0, 0, 1614, 1615, + 7, 7, 0, 0, 1615, 1616, 7, 4, 0, 0, 1616, 249, 1, 0, 0, 0, 1617, 1618, + 7, 4, 0, 0, 1618, 1619, 7, 9, 0, 0, 1619, 1620, 7, 19, 0, 0, 1620, 1621, + 7, 7, 0, 0, 1621, 251, 1, 0, 0, 0, 1622, 1623, 7, 4, 0, 0, 1623, 1624, + 7, 3, 0, 0, 1624, 1625, 7, 8, 0, 0, 1625, 1626, 7, 0, 0, 0, 1626, 1627, + 7, 4, 0, 0, 1627, 253, 1, 0, 0, 0, 1628, 1629, 7, 4, 0, 0, 1629, 1630, + 7, 3, 0, 0, 1630, 1631, 7, 18, 0, 0, 1631, 1632, 7, 7, 0, 0, 1632, 1633, + 7, 12, 0, 0, 1633, 255, 1, 0, 0, 0, 1634, 1635, 7, 20, 0, 0, 1635, 1636, + 7, 0, 0, 0, 1636, 1637, 7, 6, 0, 0, 1637, 1638, 7, 8, 0, 0, 1638, 1639, + 7, 14, 0, 0, 1639, 257, 1, 0, 0, 0, 1640, 1641, 7, 20, 0, 0, 1641, 1642, + 7, 0, 0, 0, 1642, 1643, 7, 23, 0, 0, 1643, 259, 1, 0, 0, 0, 1644, 1645, + 7, 20, 0, 0, 1645, 1646, 7, 9, 0, 0, 1646, 1647, 7, 10, 0, 0, 1647, 261, + 1, 0, 0, 0, 1648, 1649, 7, 20, 0, 0, 1649, 1650, 7, 3, 0, 0, 1650, 1651, + 7, 11, 0, 0, 1651, 1652, 7, 5, 0, 0, 1652, 1653, 7, 4, 0, 0, 1653, 1654, + 7, 7, 0, 0, 1654, 263, 1, 0, 0, 0, 1655, 1656, 7, 10, 0, 0, 1656, 1657, + 7, 0, 0, 0, 1657, 1658, 7, 20, 0, 0, 1658, 1659, 7, 7, 0, 0, 1659, 1660, + 7, 2, 0, 0, 1660, 265, 1, 0, 0, 0, 1661, 1662, 7, 10, 0, 0, 1662, 1663, + 7, 0, 0, 0, 1663, 1664, 7, 6, 0, 0, 1664, 1665, 7, 9, 0, 0, 1665, 1666, + 7, 3, 0, 0, 1666, 1667, 7, 10, 0, 0, 1667, 1668, 7, 0, 0, 0, 1668, 1669, + 7, 4, 0, 0, 1669, 267, 1, 0, 0, 0, 1670, 1671, 7, 10, 0, 0, 1671, 1672, + 7, 0, 0, 0, 1672, 1673, 7, 6, 0, 0, 1673, 1674, 7, 5, 0, 0, 1674, 1675, + 7, 12, 0, 0, 1675, 1676, 7, 0, 0, 0, 1676, 1677, 7, 4, 0, 0, 1677, 269, + 1, 0, 0, 0, 1678, 1679, 7, 10, 0, 0, 1679, 1680, 7, 8, 0, 0, 1680, 1681, + 7, 14, 0, 0, 1681, 1682, 7, 0, 0, 0, 1682, 1683, 7, 12, 0, 0, 1683, 271, + 1, 0, 0, 0, 1684, 1685, 7, 10, 0, 0, 1685, 1686, 7, 7, 0, 0, 1686, 1687, + 7, 23, 0, 0, 1687, 1688, 7, 6, 0, 0, 1688, 273, 1, 0, 0, 0, 1689, 1690, + 7, 10, 0, 0, 1690, 1691, 7, 3, 0, 0, 1691, 275, 1, 0, 0, 0, 1692, 1693, + 7, 10, 0, 0, 1693, 1694, 7, 3, 0, 0, 1694, 1695, 7, 6, 0, 0, 1695, 277, + 1, 0, 0, 0, 1696, 1697, 7, 10, 0, 0, 1697, 1698, 7, 5, 0, 0, 1698, 1699, + 7, 4, 0, 0, 1699, 1700, 7, 4, 0, 0, 1700, 279, 1, 0, 0, 0, 1701, 1702, + 7, 10, 0, 0, 1702, 1703, 7, 5, 0, 0, 1703, 1704, 7, 4, 0, 0, 1704, 1705, + 7, 4, 0, 0, 1705, 1706, 7, 2, 0, 0, 1706, 281, 1, 0, 0, 0, 1707, 1708, + 7, 10, 0, 0, 1708, 1709, 7, 5, 0, 0, 1709, 1710, 7, 4, 0, 0, 1710, 1711, + 7, 4, 0, 0, 1711, 1712, 7, 9, 0, 0, 1712, 1713, 7, 22, 0, 0, 1713, 283, + 1, 0, 0, 0, 1714, 1715, 7, 10, 0, 0, 1715, 1716, 7, 5, 0, 0, 1716, 1717, + 7, 20, 0, 0, 1717, 1718, 7, 7, 0, 0, 1718, 1719, 7, 12, 0, 0, 1719, 1720, + 7, 9, 0, 0, 1720, 1721, 7, 8, 0, 0, 1721, 285, 1, 0, 0, 0, 1722, 1723, + 7, 3, 0, 0, 1723, 1724, 7, 8, 0, 0, 1724, 1725, 7, 6, 0, 0, 1725, 1726, + 7, 7, 0, 0, 1726, 1727, 7, 6, 0, 0, 1727, 1728, 5, 95, 0, 0, 1728, 1729, + 7, 4, 0, 0, 1729, 1730, 7, 7, 0, 0, 1730, 1731, 7, 10, 0, 0, 1731, 1732, + 7, 17, 0, 0, 1732, 1733, 7, 6, 0, 0, 1733, 1734, 7, 14, 0, 0, 1734, 287, + 1, 0, 0, 0, 1735, 1736, 7, 3, 0, 0, 1736, 1737, 7, 22, 0, 0, 1737, 289, + 1, 0, 0, 0, 1738, 1739, 7, 3, 0, 0, 1739, 1740, 7, 10, 0, 0, 1740, 291, + 1, 0, 0, 0, 1741, 1742, 7, 3, 0, 0, 1742, 1743, 7, 10, 0, 0, 1743, 1744, + 7, 4, 0, 0, 1744, 1745, 7, 13, 0, 0, 1745, 293, 1, 0, 0, 0, 1746, 1747, + 7, 3, 0, 0, 1747, 1748, 7, 21, 0, 0, 1748, 1749, 7, 7, 0, 0, 1749, 1750, + 7, 10, 0, 0, 1750, 295, 1, 0, 0, 0, 1751, 1752, 7, 3, 0, 0, 1752, 1753, + 7, 21, 0, 0, 1753, 1754, 7, 6, 0, 0, 1754, 1755, 7, 9, 0, 0, 1755, 1756, + 7, 3, 0, 0, 1756, 1757, 7, 10, 0, 0, 1757, 297, 1, 0, 0, 0, 1758, 1759, + 7, 3, 0, 0, 1759, 1760, 7, 12, 0, 0, 1760, 299, 1, 0, 0, 0, 1761, 1762, + 7, 3, 0, 0, 1762, 1763, 7, 12, 0, 0, 1763, 1764, 7, 11, 0, 0, 1764, 1765, + 7, 7, 0, 0, 1765, 1766, 7, 12, 0, 0, 1766, 301, 1, 0, 0, 0, 1767, 1768, + 7, 3, 0, 0, 1768, 1769, 7, 5, 0, 0, 1769, 1770, 7, 6, 0, 0, 1770, 1771, + 7, 7, 0, 0, 1771, 1772, 7, 12, 0, 0, 1772, 303, 1, 0, 0, 0, 1773, 1774, + 7, 3, 0, 0, 1774, 1775, 7, 5, 0, 0, 1775, 1776, 7, 6, 0, 0, 1776, 1777, + 7, 21, 0, 0, 1777, 1778, 7, 5, 0, 0, 1778, 1779, 7, 6, 0, 0, 1779, 305, + 1, 0, 0, 0, 1780, 1781, 7, 3, 0, 0, 1781, 1782, 7, 16, 0, 0, 1782, 1783, + 7, 7, 0, 0, 1783, 1784, 7, 12, 0, 0, 1784, 1785, 7, 4, 0, 0, 1785, 1786, + 7, 0, 0, 0, 1786, 1787, 7, 21, 0, 0, 1787, 1788, 7, 2, 0, 0, 1788, 307, + 1, 0, 0, 0, 1789, 1790, 7, 3, 0, 0, 1790, 1791, 7, 16, 0, 0, 1791, 1792, + 7, 7, 0, 0, 1792, 1793, 7, 12, 0, 0, 1793, 1794, 7, 4, 0, 0, 1794, 1795, + 7, 0, 0, 0, 1795, 1796, 7, 13, 0, 0, 1796, 309, 1, 0, 0, 0, 1797, 1798, + 7, 21, 0, 0, 1798, 1799, 7, 0, 0, 0, 1799, 1800, 7, 11, 0, 0, 1800, 311, + 1, 0, 0, 0, 1801, 1802, 7, 21, 0, 0, 1802, 1803, 7, 0, 0, 0, 1803, 1804, + 7, 12, 0, 0, 1804, 1805, 7, 6, 0, 0, 1805, 1806, 7, 9, 0, 0, 1806, 1807, + 7, 0, 0, 0, 1807, 1808, 7, 4, 0, 0, 1808, 313, 1, 0, 0, 0, 1809, 1810, + 7, 21, 0, 0, 1810, 1811, 7, 4, 0, 0, 1811, 1812, 7, 0, 0, 0, 1812, 1813, + 7, 8, 0, 0, 1813, 1814, 7, 9, 0, 0, 1814, 1815, 7, 10, 0, 0, 1815, 1816, + 7, 17, 0, 0, 1816, 315, 1, 0, 0, 0, 1817, 1818, 7, 21, 0, 0, 1818, 1819, + 7, 3, 0, 0, 1819, 1820, 7, 2, 0, 0, 1820, 1821, 7, 9, 0, 0, 1821, 1822, + 7, 6, 0, 0, 1822, 1823, 7, 9, 0, 0, 1823, 1824, 7, 3, 0, 0, 1824, 1825, + 7, 10, 0, 0, 1825, 317, 1, 0, 0, 0, 1826, 1827, 7, 21, 0, 0, 1827, 1828, + 7, 12, 0, 0, 1828, 1829, 7, 7, 0, 0, 1829, 1830, 7, 8, 0, 0, 1830, 1831, + 7, 9, 0, 0, 1831, 1832, 7, 2, 0, 0, 1832, 1833, 7, 9, 0, 0, 1833, 1834, + 7, 3, 0, 0, 1834, 1835, 7, 10, 0, 0, 1835, 319, 1, 0, 0, 0, 1836, 1837, + 7, 21, 0, 0, 1837, 1838, 7, 12, 0, 0, 1838, 1839, 7, 7, 0, 0, 1839, 1840, + 7, 21, 0, 0, 1840, 1841, 7, 0, 0, 0, 1841, 1842, 7, 12, 0, 0, 1842, 1843, + 7, 7, 0, 0, 1843, 321, 1, 0, 0, 0, 1844, 1845, 7, 21, 0, 0, 1845, 1846, + 7, 12, 0, 0, 1846, 1847, 7, 7, 0, 0, 1847, 1848, 7, 2, 0, 0, 1848, 1849, + 7, 7, 0, 0, 1849, 1850, 7, 12, 0, 0, 1850, 1851, 7, 16, 0, 0, 1851, 1852, + 7, 7, 0, 0, 1852, 323, 1, 0, 0, 0, 1853, 1854, 7, 21, 0, 0, 1854, 1855, + 7, 12, 0, 0, 1855, 1856, 7, 9, 0, 0, 1856, 1857, 7, 20, 0, 0, 1857, 1858, + 7, 0, 0, 0, 1858, 1859, 7, 12, 0, 0, 1859, 1860, 7, 13, 0, 0, 1860, 325, + 1, 0, 0, 0, 1861, 1862, 7, 21, 0, 0, 1862, 1863, 7, 12, 0, 0, 1863, 1864, + 7, 9, 0, 0, 1864, 1865, 7, 3, 0, 0, 1865, 1866, 7, 12, 0, 0, 1866, 327, + 1, 0, 0, 0, 1867, 1868, 7, 21, 0, 0, 1868, 1869, 7, 12, 0, 0, 1869, 1870, + 7, 9, 0, 0, 1870, 1871, 7, 16, 0, 0, 1871, 1872, 7, 9, 0, 0, 1872, 1873, + 7, 4, 0, 0, 1873, 1874, 7, 7, 0, 0, 1874, 1875, 7, 17, 0, 0, 1875, 1876, + 7, 7, 0, 0, 1876, 1877, 7, 2, 0, 0, 1877, 329, 1, 0, 0, 0, 1878, 1879, + 7, 21, 0, 0, 1879, 1880, 7, 12, 0, 0, 1880, 1881, 7, 3, 0, 0, 1881, 1882, + 7, 8, 0, 0, 1882, 1883, 7, 7, 0, 0, 1883, 1884, 7, 11, 0, 0, 1884, 1885, + 7, 5, 0, 0, 1885, 1886, 7, 12, 0, 0, 1886, 1887, 7, 7, 0, 0, 1887, 331, + 1, 0, 0, 0, 1888, 1889, 7, 21, 0, 0, 1889, 1890, 7, 5, 0, 0, 1890, 1891, + 7, 1, 0, 0, 1891, 1892, 7, 4, 0, 0, 1892, 1893, 7, 9, 0, 0, 1893, 1894, + 7, 8, 0, 0, 1894, 333, 1, 0, 0, 0, 1895, 1896, 7, 12, 0, 0, 1896, 1897, + 7, 7, 0, 0, 1897, 1898, 7, 0, 0, 0, 1898, 1899, 7, 11, 0, 0, 1899, 335, + 1, 0, 0, 0, 1900, 1901, 7, 12, 0, 0, 1901, 1902, 7, 7, 0, 0, 1902, 1903, + 7, 0, 0, 0, 1903, 1904, 7, 4, 0, 0, 1904, 337, 1, 0, 0, 0, 1905, 1906, + 7, 12, 0, 0, 1906, 1907, 7, 7, 0, 0, 1907, 1908, 7, 22, 0, 0, 1908, 1909, + 7, 7, 0, 0, 1909, 1910, 7, 12, 0, 0, 1910, 1911, 7, 7, 0, 0, 1911, 1912, + 7, 10, 0, 0, 1912, 1913, 7, 8, 0, 0, 1913, 1914, 7, 7, 0, 0, 1914, 1915, + 7, 2, 0, 0, 1915, 339, 1, 0, 0, 0, 1916, 1917, 7, 12, 0, 0, 1917, 1918, + 7, 7, 0, 0, 1918, 1919, 7, 4, 0, 0, 1919, 1920, 7, 0, 0, 0, 1920, 1921, + 7, 6, 0, 0, 1921, 1922, 7, 9, 0, 0, 1922, 1923, 7, 16, 0, 0, 1923, 1924, + 7, 7, 0, 0, 1924, 341, 1, 0, 0, 0, 1925, 1926, 7, 12, 0, 0, 1926, 1927, + 7, 7, 0, 0, 1927, 1928, 7, 21, 0, 0, 1928, 1929, 7, 4, 0, 0, 1929, 1930, + 7, 0, 0, 0, 1930, 1931, 7, 8, 0, 0, 1931, 1932, 7, 7, 0, 0, 1932, 343, + 1, 0, 0, 0, 1933, 1934, 7, 12, 0, 0, 1934, 1935, 7, 7, 0, 0, 1935, 1936, + 7, 2, 0, 0, 1936, 1937, 7, 6, 0, 0, 1937, 1938, 7, 12, 0, 0, 1938, 1939, + 7, 9, 0, 0, 1939, 1940, 7, 8, 0, 0, 1940, 1941, 7, 6, 0, 0, 1941, 345, + 1, 0, 0, 0, 1942, 1943, 7, 12, 0, 0, 1943, 1944, 7, 7, 0, 0, 1944, 1945, + 7, 16, 0, 0, 1945, 1946, 7, 3, 0, 0, 1946, 1947, 7, 19, 0, 0, 1947, 1948, + 7, 7, 0, 0, 1948, 347, 1, 0, 0, 0, 1949, 1950, 7, 12, 0, 0, 1950, 1951, + 7, 9, 0, 0, 1951, 1952, 7, 17, 0, 0, 1952, 1953, 7, 14, 0, 0, 1953, 1954, + 7, 6, 0, 0, 1954, 349, 1, 0, 0, 0, 1955, 1956, 7, 12, 0, 0, 1956, 1957, + 7, 3, 0, 0, 1957, 1958, 7, 4, 0, 0, 1958, 1959, 7, 4, 0, 0, 1959, 1960, + 7, 1, 0, 0, 1960, 1961, 7, 0, 0, 0, 1961, 1962, 7, 8, 0, 0, 1962, 1963, + 7, 19, 0, 0, 1963, 351, 1, 0, 0, 0, 1964, 1965, 7, 12, 0, 0, 1965, 1966, + 7, 3, 0, 0, 1966, 1967, 7, 18, 0, 0, 1967, 1968, 7, 2, 0, 0, 1968, 353, + 1, 0, 0, 0, 1969, 1970, 7, 2, 0, 0, 1970, 1971, 7, 8, 0, 0, 1971, 1972, + 7, 14, 0, 0, 1972, 1973, 7, 7, 0, 0, 1973, 1974, 7, 20, 0, 0, 1974, 1975, + 7, 0, 0, 0, 1975, 355, 1, 0, 0, 0, 1976, 1977, 7, 2, 0, 0, 1977, 1978, + 7, 8, 0, 0, 1978, 1979, 7, 12, 0, 0, 1979, 1980, 7, 3, 0, 0, 1980, 1981, + 7, 4, 0, 0, 1981, 1982, 7, 4, 0, 0, 1982, 357, 1, 0, 0, 0, 1983, 1984, + 7, 2, 0, 0, 1984, 1985, 7, 7, 0, 0, 1985, 1986, 7, 8, 0, 0, 1986, 1987, + 7, 6, 0, 0, 1987, 1988, 7, 9, 0, 0, 1988, 1989, 7, 3, 0, 0, 1989, 1990, + 7, 10, 0, 0, 1990, 359, 1, 0, 0, 0, 1991, 1992, 7, 2, 0, 0, 1992, 1993, + 7, 7, 0, 0, 1993, 1994, 7, 4, 0, 0, 1994, 1995, 7, 7, 0, 0, 1995, 1996, + 7, 8, 0, 0, 1996, 1997, 7, 6, 0, 0, 1997, 361, 1, 0, 0, 0, 1998, 1999, + 7, 2, 0, 0, 1999, 2000, 7, 7, 0, 0, 2000, 2001, 7, 2, 0, 0, 2001, 2002, + 7, 2, 0, 0, 2002, 2003, 7, 9, 0, 0, 2003, 2004, 7, 3, 0, 0, 2004, 2005, + 7, 10, 0, 0, 2005, 363, 1, 0, 0, 0, 2006, 2007, 7, 2, 0, 0, 2007, 2008, + 7, 7, 0, 0, 2008, 2009, 7, 2, 0, 0, 2009, 2010, 7, 2, 0, 0, 2010, 2011, + 7, 9, 0, 0, 2011, 2012, 7, 3, 0, 0, 2012, 2013, 7, 10, 0, 0, 2013, 2014, + 5, 95, 0, 0, 2014, 2015, 7, 5, 0, 0, 2015, 2016, 7, 2, 0, 0, 2016, 2017, + 7, 7, 0, 0, 2017, 2018, 7, 12, 0, 0, 2018, 365, 1, 0, 0, 0, 2019, 2020, + 7, 2, 0, 0, 2020, 2021, 7, 7, 0, 0, 2021, 2022, 7, 6, 0, 0, 2022, 367, + 1, 0, 0, 0, 2023, 2024, 7, 2, 0, 0, 2024, 2025, 7, 14, 0, 0, 2025, 2026, + 7, 3, 0, 0, 2026, 2027, 7, 12, 0, 0, 2027, 2028, 7, 6, 0, 0, 2028, 2029, + 7, 7, 0, 0, 2029, 2030, 7, 2, 0, 0, 2030, 2031, 7, 6, 0, 0, 2031, 369, + 1, 0, 0, 0, 2032, 2033, 7, 2, 0, 0, 2033, 2034, 7, 9, 0, 0, 2034, 2035, + 7, 15, 0, 0, 2035, 2036, 7, 7, 0, 0, 2036, 371, 1, 0, 0, 0, 2037, 2038, + 7, 2, 0, 0, 2038, 2039, 7, 20, 0, 0, 2039, 2040, 7, 0, 0, 0, 2040, 2041, + 7, 4, 0, 0, 2041, 2042, 7, 4, 0, 0, 2042, 2043, 7, 9, 0, 0, 2043, 2044, + 7, 10, 0, 0, 2044, 2045, 7, 6, 0, 0, 2045, 373, 1, 0, 0, 0, 2046, 2047, + 7, 2, 0, 0, 2047, 2048, 7, 3, 0, 0, 2048, 2049, 7, 20, 0, 0, 2049, 2050, + 7, 7, 0, 0, 2050, 375, 1, 0, 0, 0, 2051, 2052, 7, 2, 0, 0, 2052, 2053, + 7, 21, 0, 0, 2053, 2054, 7, 0, 0, 0, 2054, 2055, 7, 8, 0, 0, 2055, 2056, + 7, 7, 0, 0, 2056, 377, 1, 0, 0, 0, 2057, 2058, 7, 2, 0, 0, 2058, 2059, + 7, 25, 0, 0, 2059, 2060, 7, 4, 0, 0, 2060, 379, 1, 0, 0, 0, 2061, 2062, + 7, 2, 0, 0, 2062, 2063, 7, 25, 0, 0, 2063, 2064, 7, 4, 0, 0, 2064, 2065, + 7, 8, 0, 0, 2065, 2066, 7, 3, 0, 0, 2066, 2067, 7, 11, 0, 0, 2067, 2068, + 7, 7, 0, 0, 2068, 381, 1, 0, 0, 0, 2069, 2070, 7, 2, 0, 0, 2070, 2071, + 7, 25, 0, 0, 2071, 2072, 7, 4, 0, 0, 2072, 2073, 7, 7, 0, 0, 2073, 2074, + 7, 12, 0, 0, 2074, 2075, 7, 12, 0, 0, 2075, 2076, 7, 3, 0, 0, 2076, 2077, + 7, 12, 0, 0, 2077, 383, 1, 0, 0, 0, 2078, 2079, 7, 2, 0, 0, 2079, 2080, + 7, 25, 0, 0, 2080, 2081, 7, 4, 0, 0, 2081, 2082, 7, 2, 0, 0, 2082, 2083, + 7, 6, 0, 0, 2083, 2084, 7, 0, 0, 0, 2084, 2085, 7, 6, 0, 0, 2085, 2086, + 7, 7, 0, 0, 2086, 385, 1, 0, 0, 0, 2087, 2088, 7, 2, 0, 0, 2088, 2089, + 7, 5, 0, 0, 2089, 2090, 7, 1, 0, 0, 2090, 2091, 7, 2, 0, 0, 2091, 2092, + 7, 6, 0, 0, 2092, 2093, 7, 12, 0, 0, 2093, 2094, 7, 9, 0, 0, 2094, 2095, + 7, 10, 0, 0, 2095, 2096, 7, 17, 0, 0, 2096, 387, 1, 0, 0, 0, 2097, 2098, + 7, 2, 0, 0, 2098, 2099, 7, 5, 0, 0, 2099, 2100, 7, 20, 0, 0, 2100, 389, + 1, 0, 0, 0, 2101, 2102, 7, 2, 0, 0, 2102, 2103, 7, 13, 0, 0, 2103, 2104, + 7, 2, 0, 0, 2104, 2105, 7, 6, 0, 0, 2105, 2106, 7, 7, 0, 0, 2106, 2107, + 7, 20, 0, 0, 2107, 2108, 5, 95, 0, 0, 2108, 2109, 7, 5, 0, 0, 2109, 2110, + 7, 2, 0, 0, 2110, 2111, 7, 7, 0, 0, 2111, 2112, 7, 12, 0, 0, 2112, 391, + 1, 0, 0, 0, 2113, 2114, 7, 6, 0, 0, 2114, 2115, 7, 0, 0, 0, 2115, 2116, + 7, 1, 0, 0, 2116, 2117, 7, 4, 0, 0, 2117, 2118, 7, 7, 0, 0, 2118, 393, + 1, 0, 0, 0, 2119, 2120, 7, 6, 0, 0, 2120, 2121, 7, 7, 0, 0, 2121, 2122, + 7, 20, 0, 0, 2122, 2123, 7, 21, 0, 0, 2123, 2124, 7, 3, 0, 0, 2124, 2125, + 7, 12, 0, 0, 2125, 2126, 7, 0, 0, 0, 2126, 2127, 7, 12, 0, 0, 2127, 2128, + 7, 13, 0, 0, 2128, 395, 1, 0, 0, 0, 2129, 2130, 7, 6, 0, 0, 2130, 2131, + 7, 14, 0, 0, 2131, 2132, 7, 7, 0, 0, 2132, 2133, 7, 10, 0, 0, 2133, 397, + 1, 0, 0, 0, 2134, 2135, 7, 6, 0, 0, 2135, 2136, 7, 9, 0, 0, 2136, 2137, + 7, 20, 0, 0, 2137, 2138, 7, 7, 0, 0, 2138, 399, 1, 0, 0, 0, 2139, 2140, + 7, 6, 0, 0, 2140, 2141, 7, 9, 0, 0, 2141, 2142, 7, 20, 0, 0, 2142, 2143, + 7, 7, 0, 0, 2143, 2144, 7, 2, 0, 0, 2144, 2145, 7, 6, 0, 0, 2145, 2146, + 7, 0, 0, 0, 2146, 2147, 7, 20, 0, 0, 2147, 2148, 7, 21, 0, 0, 2148, 401, + 1, 0, 0, 0, 2149, 2150, 7, 6, 0, 0, 2150, 2151, 7, 3, 0, 0, 2151, 403, + 1, 0, 0, 0, 2152, 2153, 7, 6, 0, 0, 2153, 2154, 7, 12, 0, 0, 2154, 2155, + 7, 0, 0, 0, 2155, 2156, 7, 10, 0, 0, 2156, 2157, 7, 2, 0, 0, 2157, 2158, + 7, 0, 0, 0, 2158, 2159, 7, 8, 0, 0, 2159, 2160, 7, 6, 0, 0, 2160, 2161, + 7, 9, 0, 0, 2161, 2162, 7, 3, 0, 0, 2162, 2163, 7, 10, 0, 0, 2163, 405, + 1, 0, 0, 0, 2164, 2165, 7, 6, 0, 0, 2165, 2166, 7, 12, 0, 0, 2166, 2167, + 7, 0, 0, 0, 2167, 2168, 7, 10, 0, 0, 2168, 2169, 7, 2, 0, 0, 2169, 2170, + 7, 4, 0, 0, 2170, 2171, 7, 0, 0, 0, 2171, 2172, 7, 6, 0, 0, 2172, 2173, + 7, 7, 0, 0, 2173, 407, 1, 0, 0, 0, 2174, 2175, 7, 6, 0, 0, 2175, 2176, + 7, 12, 0, 0, 2176, 2177, 7, 0, 0, 0, 2177, 2178, 7, 10, 0, 0, 2178, 2179, + 7, 2, 0, 0, 2179, 2180, 7, 4, 0, 0, 2180, 2181, 7, 0, 0, 0, 2181, 2182, + 7, 6, 0, 0, 2182, 2183, 7, 9, 0, 0, 2183, 2184, 7, 3, 0, 0, 2184, 2185, + 7, 10, 0, 0, 2185, 409, 1, 0, 0, 0, 2186, 2187, 7, 6, 0, 0, 2187, 2188, + 7, 12, 0, 0, 2188, 2189, 7, 9, 0, 0, 2189, 2190, 7, 20, 0, 0, 2190, 411, + 1, 0, 0, 0, 2191, 2192, 7, 6, 0, 0, 2192, 2193, 7, 12, 0, 0, 2193, 2194, + 7, 5, 0, 0, 2194, 2195, 7, 7, 0, 0, 2195, 413, 1, 0, 0, 0, 2196, 2197, + 7, 5, 0, 0, 2197, 2198, 7, 10, 0, 0, 2198, 2199, 7, 9, 0, 0, 2199, 2200, + 7, 3, 0, 0, 2200, 2201, 7, 10, 0, 0, 2201, 415, 1, 0, 0, 0, 2202, 2203, + 7, 5, 0, 0, 2203, 2204, 7, 10, 0, 0, 2204, 2205, 7, 9, 0, 0, 2205, 2206, + 7, 25, 0, 0, 2206, 2207, 7, 5, 0, 0, 2207, 2208, 7, 7, 0, 0, 2208, 417, + 1, 0, 0, 0, 2209, 2210, 7, 5, 0, 0, 2210, 2211, 7, 10, 0, 0, 2211, 2212, + 7, 19, 0, 0, 2212, 2213, 7, 10, 0, 0, 2213, 2214, 7, 3, 0, 0, 2214, 2215, + 7, 18, 0, 0, 2215, 2216, 7, 10, 0, 0, 2216, 419, 1, 0, 0, 0, 2217, 2218, + 7, 5, 0, 0, 2218, 2219, 7, 21, 0, 0, 2219, 2220, 7, 11, 0, 0, 2220, 2221, + 7, 0, 0, 0, 2221, 2222, 7, 6, 0, 0, 2222, 2223, 7, 7, 0, 0, 2223, 421, + 1, 0, 0, 0, 2224, 2225, 7, 5, 0, 0, 2225, 2226, 7, 21, 0, 0, 2226, 2227, + 7, 21, 0, 0, 2227, 2228, 7, 7, 0, 0, 2228, 2229, 7, 12, 0, 0, 2229, 423, + 1, 0, 0, 0, 2230, 2231, 7, 5, 0, 0, 2231, 2232, 7, 21, 0, 0, 2232, 2233, + 7, 2, 0, 0, 2233, 2234, 7, 7, 0, 0, 2234, 2235, 7, 12, 0, 0, 2235, 2236, + 7, 6, 0, 0, 2236, 425, 1, 0, 0, 0, 2237, 2238, 7, 5, 0, 0, 2238, 2239, + 7, 2, 0, 0, 2239, 2240, 7, 0, 0, 0, 2240, 2241, 7, 17, 0, 0, 2241, 2242, + 7, 7, 0, 0, 2242, 427, 1, 0, 0, 0, 2243, 2244, 7, 5, 0, 0, 2244, 2245, + 7, 2, 0, 0, 2245, 2246, 7, 7, 0, 0, 2246, 2247, 7, 12, 0, 0, 2247, 429, + 1, 0, 0, 0, 2248, 2249, 7, 5, 0, 0, 2249, 2250, 7, 2, 0, 0, 2250, 2251, + 7, 9, 0, 0, 2251, 2252, 7, 10, 0, 0, 2252, 2253, 7, 17, 0, 0, 2253, 431, + 1, 0, 0, 0, 2254, 2255, 7, 16, 0, 0, 2255, 2256, 7, 0, 0, 0, 2256, 2257, + 7, 4, 0, 0, 2257, 2258, 7, 5, 0, 0, 2258, 2259, 7, 7, 0, 0, 2259, 433, + 1, 0, 0, 0, 2260, 2261, 7, 16, 0, 0, 2261, 2262, 7, 0, 0, 0, 2262, 2263, + 7, 4, 0, 0, 2263, 2264, 7, 5, 0, 0, 2264, 2265, 7, 7, 0, 0, 2265, 2266, + 7, 2, 0, 0, 2266, 435, 1, 0, 0, 0, 2267, 2268, 7, 16, 0, 0, 2268, 2269, + 7, 0, 0, 0, 2269, 2270, 7, 12, 0, 0, 2270, 2271, 7, 8, 0, 0, 2271, 2272, + 7, 14, 0, 0, 2272, 2273, 7, 0, 0, 0, 2273, 2274, 7, 12, 0, 0, 2274, 437, + 1, 0, 0, 0, 2275, 2276, 7, 16, 0, 0, 2276, 2277, 7, 0, 0, 0, 2277, 2278, + 7, 12, 0, 0, 2278, 2279, 7, 13, 0, 0, 2279, 2280, 7, 9, 0, 0, 2280, 2281, + 7, 10, 0, 0, 2281, 2282, 7, 17, 0, 0, 2282, 439, 1, 0, 0, 0, 2283, 2284, + 7, 16, 0, 0, 2284, 2285, 7, 9, 0, 0, 2285, 2286, 7, 7, 0, 0, 2286, 2287, + 7, 18, 0, 0, 2287, 441, 1, 0, 0, 0, 2288, 2289, 7, 18, 0, 0, 2289, 2290, + 7, 14, 0, 0, 2290, 2291, 7, 7, 0, 0, 2291, 2292, 7, 10, 0, 0, 2292, 443, + 1, 0, 0, 0, 2293, 2294, 7, 18, 0, 0, 2294, 2295, 7, 14, 0, 0, 2295, 2296, + 7, 7, 0, 0, 2296, 2297, 7, 10, 0, 0, 2297, 2298, 7, 7, 0, 0, 2298, 2299, + 7, 16, 0, 0, 2299, 2300, 7, 7, 0, 0, 2300, 2301, 7, 12, 0, 0, 2301, 445, + 1, 0, 0, 0, 2302, 2303, 7, 18, 0, 0, 2303, 2304, 7, 14, 0, 0, 2304, 2305, + 7, 7, 0, 0, 2305, 2306, 7, 12, 0, 0, 2306, 2307, 7, 7, 0, 0, 2307, 447, + 1, 0, 0, 0, 2308, 2309, 7, 18, 0, 0, 2309, 2310, 7, 9, 0, 0, 2310, 2311, + 7, 6, 0, 0, 2311, 2312, 7, 14, 0, 0, 2312, 449, 1, 0, 0, 0, 2313, 2314, + 7, 18, 0, 0, 2314, 2315, 7, 3, 0, 0, 2315, 2316, 7, 12, 0, 0, 2316, 2317, + 7, 19, 0, 0, 2317, 451, 1, 0, 0, 0, 2318, 2319, 7, 18, 0, 0, 2319, 2320, + 7, 12, 0, 0, 2320, 2321, 7, 9, 0, 0, 2321, 2322, 7, 6, 0, 0, 2322, 2323, + 7, 7, 0, 0, 2323, 453, 1, 0, 0, 0, 2324, 2325, 7, 15, 0, 0, 2325, 2326, + 7, 3, 0, 0, 2326, 2327, 7, 10, 0, 0, 2327, 2328, 7, 7, 0, 0, 2328, 455, + 1, 0, 0, 0, 2329, 2330, 7, 4, 0, 0, 2330, 2331, 7, 0, 0, 0, 2331, 2332, + 7, 17, 0, 0, 2332, 457, 1, 0, 0, 0, 2333, 2334, 7, 4, 0, 0, 2334, 2335, + 7, 7, 0, 0, 2335, 2336, 7, 0, 0, 0, 2336, 2337, 7, 11, 0, 0, 2337, 459, + 1, 0, 0, 0, 2338, 2339, 7, 3, 0, 0, 2339, 2340, 7, 16, 0, 0, 2340, 2341, + 7, 7, 0, 0, 2341, 2342, 7, 12, 0, 0, 2342, 461, 1, 0, 0, 0, 2343, 2344, + 7, 21, 0, 0, 2344, 2345, 7, 0, 0, 0, 2345, 2346, 7, 12, 0, 0, 2346, 2347, + 7, 6, 0, 0, 2347, 2348, 7, 9, 0, 0, 2348, 2349, 7, 6, 0, 0, 2349, 2350, + 7, 9, 0, 0, 2350, 2351, 7, 3, 0, 0, 2351, 2352, 7, 10, 0, 0, 2352, 463, + 1, 0, 0, 0, 2353, 2354, 7, 8, 0, 0, 2354, 2355, 7, 0, 0, 0, 2355, 2356, + 7, 10, 0, 0, 2356, 2357, 5, 95, 0, 0, 2357, 2358, 7, 8, 0, 0, 2358, 2359, + 7, 0, 0, 0, 2359, 2360, 7, 2, 0, 0, 2360, 2361, 7, 6, 0, 0, 2361, 465, + 1, 0, 0, 0, 2362, 2363, 7, 8, 0, 0, 2363, 2364, 7, 0, 0, 0, 2364, 2365, + 7, 10, 0, 0, 2365, 2366, 5, 95, 0, 0, 2366, 2367, 7, 4, 0, 0, 2367, 2368, + 7, 3, 0, 0, 2368, 2369, 7, 2, 0, 0, 2369, 2370, 7, 2, 0, 0, 2370, 2371, + 7, 4, 0, 0, 2371, 2372, 7, 7, 0, 0, 2372, 2373, 7, 2, 0, 0, 2373, 2374, + 7, 2, 0, 0, 2374, 2375, 5, 95, 0, 0, 2375, 2376, 7, 8, 0, 0, 2376, 2377, + 7, 0, 0, 0, 2377, 2378, 7, 2, 0, 0, 2378, 2379, 7, 6, 0, 0, 2379, 467, + 1, 0, 0, 0, 2380, 2381, 7, 20, 0, 0, 2381, 2382, 7, 9, 0, 0, 2382, 2383, + 7, 2, 0, 0, 2383, 2384, 7, 2, 0, 0, 2384, 2385, 7, 9, 0, 0, 2385, 2386, + 7, 10, 0, 0, 2386, 2387, 7, 17, 0, 0, 2387, 469, 1, 0, 0, 0, 2388, 2389, + 7, 21, 0, 0, 2389, 2390, 7, 9, 0, 0, 2390, 2391, 7, 16, 0, 0, 2391, 2392, + 7, 3, 0, 0, 2392, 2393, 7, 6, 0, 0, 2393, 471, 1, 0, 0, 0, 2394, 2395, + 7, 5, 0, 0, 2395, 2396, 7, 10, 0, 0, 2396, 2397, 7, 21, 0, 0, 2397, 2398, + 7, 9, 0, 0, 2398, 2399, 7, 16, 0, 0, 2399, 2400, 7, 3, 0, 0, 2400, 2401, + 7, 6, 0, 0, 2401, 473, 1, 0, 0, 0, 2402, 2403, 7, 4, 0, 0, 2403, 2404, + 7, 9, 0, 0, 2404, 2405, 7, 20, 0, 0, 2405, 2406, 7, 9, 0, 0, 2406, 2407, + 7, 6, 0, 0, 2407, 475, 1, 0, 0, 0, 2408, 2409, 7, 3, 0, 0, 2409, 2410, + 7, 22, 0, 0, 2410, 2411, 7, 22, 0, 0, 2411, 2412, 7, 2, 0, 0, 2412, 2413, + 7, 7, 0, 0, 2413, 2414, 7, 6, 0, 0, 2414, 477, 1, 0, 0, 0, 2415, 2416, + 7, 12, 0, 0, 2416, 2417, 7, 7, 0, 0, 2417, 2418, 7, 20, 0, 0, 2418, 2419, + 7, 3, 0, 0, 2419, 2420, 7, 16, 0, 0, 2420, 2421, 7, 7, 0, 0, 2421, 479, + 1, 0, 0, 0, 2422, 2423, 7, 9, 0, 0, 2423, 2424, 7, 10, 0, 0, 2424, 2425, + 7, 11, 0, 0, 2425, 2426, 7, 7, 0, 0, 2426, 2427, 7, 23, 0, 0, 2427, 481, + 1, 0, 0, 0, 2428, 2429, 7, 4, 0, 0, 2429, 2430, 7, 7, 0, 0, 2430, 2431, + 7, 6, 0, 0, 2431, 483, 1, 0, 0, 0, 2432, 2433, 7, 8, 0, 0, 2433, 2434, + 7, 3, 0, 0, 2434, 2435, 7, 10, 0, 0, 2435, 2436, 7, 22, 0, 0, 2436, 2437, + 7, 4, 0, 0, 2437, 2438, 7, 9, 0, 0, 2438, 2439, 7, 8, 0, 0, 2439, 2440, + 7, 6, 0, 0, 2440, 485, 1, 0, 0, 0, 2441, 2442, 7, 11, 0, 0, 2442, 2443, + 7, 3, 0, 0, 2443, 487, 1, 0, 0, 0, 2444, 2445, 7, 12, 0, 0, 2445, 2446, + 7, 7, 0, 0, 2446, 2447, 7, 6, 0, 0, 2447, 2448, 7, 5, 0, 0, 2448, 2449, + 7, 12, 0, 0, 2449, 2450, 7, 10, 0, 0, 2450, 2451, 7, 9, 0, 0, 2451, 2452, + 7, 10, 0, 0, 2452, 2453, 7, 17, 0, 0, 2453, 489, 1, 0, 0, 0, 2454, 2455, + 7, 20, 0, 0, 2455, 2456, 7, 3, 0, 0, 2456, 2457, 7, 11, 0, 0, 2457, 2458, + 7, 9, 0, 0, 2458, 2459, 7, 22, 0, 0, 2459, 2460, 7, 9, 0, 0, 2460, 2461, + 7, 7, 0, 0, 2461, 2462, 7, 11, 0, 0, 2462, 491, 1, 0, 0, 0, 2463, 2464, + 7, 10, 0, 0, 2464, 2465, 7, 7, 0, 0, 2465, 2466, 7, 18, 0, 0, 2466, 493, + 1, 0, 0, 0, 2467, 2468, 7, 3, 0, 0, 2468, 2469, 7, 4, 0, 0, 2469, 2470, + 7, 11, 0, 0, 2470, 495, 1, 0, 0, 0, 2471, 2472, 7, 10, 0, 0, 2472, 2473, + 7, 3, 0, 0, 2473, 2474, 7, 6, 0, 0, 2474, 2475, 7, 14, 0, 0, 2475, 2476, + 7, 9, 0, 0, 2476, 2477, 7, 10, 0, 0, 2477, 2478, 7, 17, 0, 0, 2478, 497, + 1, 0, 0, 0, 2479, 2480, 7, 6, 0, 0, 2480, 2481, 7, 5, 0, 0, 2481, 2482, + 7, 21, 0, 0, 2482, 2483, 7, 4, 0, 0, 2483, 2484, 7, 7, 0, 0, 2484, 499, + 1, 0, 0, 0, 2485, 2486, 7, 9, 0, 0, 2486, 2487, 7, 10, 0, 0, 2487, 2488, + 7, 6, 0, 0, 2488, 2489, 7, 7, 0, 0, 2489, 2490, 7, 17, 0, 0, 2490, 2491, + 7, 7, 0, 0, 2491, 2492, 7, 12, 0, 0, 2492, 2493, 5, 50, 0, 0, 2493, 501, + 1, 0, 0, 0, 2494, 2495, 7, 9, 0, 0, 2495, 2496, 7, 10, 0, 0, 2496, 2497, + 7, 6, 0, 0, 2497, 2498, 5, 50, 0, 0, 2498, 503, 1, 0, 0, 0, 2499, 2500, + 7, 9, 0, 0, 2500, 2501, 7, 10, 0, 0, 2501, 2502, 7, 6, 0, 0, 2502, 2503, + 7, 7, 0, 0, 2503, 2504, 7, 17, 0, 0, 2504, 2505, 7, 7, 0, 0, 2505, 2506, + 7, 12, 0, 0, 2506, 2507, 5, 52, 0, 0, 2507, 505, 1, 0, 0, 0, 2508, 2509, + 7, 9, 0, 0, 2509, 2510, 7, 10, 0, 0, 2510, 2511, 7, 6, 0, 0, 2511, 2512, + 5, 52, 0, 0, 2512, 507, 1, 0, 0, 0, 2513, 2514, 7, 9, 0, 0, 2514, 2515, + 7, 10, 0, 0, 2515, 2516, 7, 6, 0, 0, 2516, 2517, 7, 7, 0, 0, 2517, 2518, + 7, 17, 0, 0, 2518, 2519, 7, 7, 0, 0, 2519, 2520, 7, 12, 0, 0, 2520, 2521, + 5, 56, 0, 0, 2521, 509, 1, 0, 0, 0, 2522, 2523, 7, 9, 0, 0, 2523, 2524, + 7, 10, 0, 0, 2524, 2525, 7, 6, 0, 0, 2525, 2526, 5, 56, 0, 0, 2526, 511, + 1, 0, 0, 0, 2527, 2528, 7, 1, 0, 0, 2528, 2529, 7, 9, 0, 0, 2529, 2530, + 7, 17, 0, 0, 2530, 2531, 7, 9, 0, 0, 2531, 2532, 7, 10, 0, 0, 2532, 2533, + 7, 6, 0, 0, 2533, 513, 1, 0, 0, 0, 2534, 2535, 7, 1, 0, 0, 2535, 2536, + 7, 3, 0, 0, 2536, 2537, 7, 3, 0, 0, 2537, 2538, 7, 4, 0, 0, 2538, 515, + 1, 0, 0, 0, 2539, 2540, 7, 1, 0, 0, 2540, 2541, 7, 3, 0, 0, 2541, 2542, + 7, 3, 0, 0, 2542, 2543, 7, 4, 0, 0, 2543, 2544, 7, 7, 0, 0, 2544, 2545, + 7, 0, 0, 0, 2545, 2546, 7, 10, 0, 0, 2546, 517, 1, 0, 0, 0, 2547, 2548, + 7, 2, 0, 0, 2548, 2549, 7, 6, 0, 0, 2549, 2550, 7, 12, 0, 0, 2550, 2551, + 7, 9, 0, 0, 2551, 2552, 7, 10, 0, 0, 2552, 2553, 7, 17, 0, 0, 2553, 519, + 1, 0, 0, 0, 2554, 2555, 7, 2, 0, 0, 2555, 2556, 7, 13, 0, 0, 2556, 2557, + 7, 20, 0, 0, 2557, 2558, 7, 1, 0, 0, 2558, 2559, 7, 3, 0, 0, 2559, 2560, + 7, 4, 0, 0, 2560, 521, 1, 0, 0, 0, 2561, 2562, 7, 8, 0, 0, 2562, 2563, + 7, 4, 0, 0, 2563, 2564, 7, 3, 0, 0, 2564, 2565, 7, 1, 0, 0, 2565, 523, + 1, 0, 0, 0, 2566, 2567, 7, 1, 0, 0, 2567, 2568, 7, 4, 0, 0, 2568, 2569, + 7, 3, 0, 0, 2569, 2570, 7, 1, 0, 0, 2570, 525, 1, 0, 0, 0, 2571, 2572, + 7, 2, 0, 0, 2572, 2573, 7, 6, 0, 0, 2573, 2574, 7, 12, 0, 0, 2574, 2575, + 7, 5, 0, 0, 2575, 2576, 7, 8, 0, 0, 2576, 2577, 7, 6, 0, 0, 2577, 527, + 1, 0, 0, 0, 2578, 2579, 7, 4, 0, 0, 2579, 2580, 7, 9, 0, 0, 2580, 2581, + 7, 2, 0, 0, 2581, 2582, 7, 6, 0, 0, 2582, 529, 1, 0, 0, 0, 2583, 2584, + 7, 2, 0, 0, 2584, 2585, 7, 7, 0, 0, 2585, 2586, 7, 23, 0, 0, 2586, 2587, + 7, 21, 0, 0, 2587, 531, 1, 0, 0, 0, 2588, 2589, 7, 1, 0, 0, 2589, 2590, + 7, 0, 0, 0, 2590, 2591, 7, 17, 0, 0, 2591, 533, 1, 0, 0, 0, 2592, 2593, + 5, 94, 0, 0, 2593, 535, 1, 0, 0, 0, 2594, 2595, 5, 44, 0, 0, 2595, 537, + 1, 0, 0, 0, 2596, 2597, 5, 43, 0, 0, 2597, 539, 1, 0, 0, 0, 2598, 2599, + 5, 45, 0, 0, 2599, 541, 1, 0, 0, 0, 2600, 2601, 5, 47, 0, 0, 2601, 543, + 1, 0, 0, 0, 2602, 2603, 5, 37, 0, 0, 2603, 545, 1, 0, 0, 0, 2604, 2605, + 5, 64, 0, 0, 2605, 547, 1, 0, 0, 0, 2606, 2607, 5, 126, 0, 0, 2607, 549, + 1, 0, 0, 0, 2608, 2609, 5, 42, 0, 0, 2609, 551, 1, 0, 0, 0, 2610, 2611, + 5, 60, 0, 0, 2611, 2612, 5, 61, 0, 0, 2612, 553, 1, 0, 0, 0, 2613, 2614, + 5, 62, 0, 0, 2614, 2615, 5, 61, 0, 0, 2615, 555, 1, 0, 0, 0, 2616, 2617, + 5, 61, 0, 0, 2617, 557, 1, 0, 0, 0, 2618, 2619, 5, 60, 0, 0, 2619, 2623, + 5, 62, 0, 0, 2620, 2621, 5, 33, 0, 0, 2621, 2623, 5, 61, 0, 0, 2622, 2618, + 1, 0, 0, 0, 2622, 2620, 1, 0, 0, 0, 2623, 559, 1, 0, 0, 0, 2624, 2625, + 5, 124, 0, 0, 2625, 2626, 5, 124, 0, 0, 2626, 561, 1, 0, 0, 0, 2627, 2628, + 5, 60, 0, 0, 2628, 563, 1, 0, 0, 0, 2629, 2630, 5, 62, 0, 0, 2630, 565, + 1, 0, 0, 0, 2631, 2632, 5, 60, 0, 0, 2632, 2633, 5, 60, 0, 0, 2633, 567, + 1, 0, 0, 0, 2634, 2635, 5, 62, 0, 0, 2635, 2636, 5, 62, 0, 0, 2636, 569, + 1, 0, 0, 0, 2637, 2638, 5, 91, 0, 0, 2638, 571, 1, 0, 0, 0, 2639, 2640, + 5, 93, 0, 0, 2640, 573, 1, 0, 0, 0, 2641, 2642, 5, 123, 0, 0, 2642, 575, + 1, 0, 0, 0, 2643, 2644, 5, 125, 0, 0, 2644, 577, 1, 0, 0, 0, 2645, 2646, + 5, 40, 0, 0, 2646, 579, 1, 0, 0, 0, 2647, 2648, 5, 41, 0, 0, 2648, 581, + 1, 0, 0, 0, 2649, 2650, 5, 96, 0, 0, 2650, 2651, 1, 0, 0, 0, 2651, 2652, + 6, 290, 0, 0, 2652, 2653, 6, 290, 1, 0, 2653, 583, 1, 0, 0, 0, 2654, 2655, + 5, 58, 0, 0, 2655, 585, 1, 0, 0, 0, 2656, 2657, 5, 59, 0, 0, 2657, 587, + 1, 0, 0, 0, 2658, 2659, 5, 63, 0, 0, 2659, 589, 1, 0, 0, 0, 2660, 2661, + 5, 46, 0, 0, 2661, 591, 1, 0, 0, 0, 2662, 2668, 5, 39, 0, 0, 2663, 2664, + 5, 39, 0, 0, 2664, 2667, 5, 39, 0, 0, 2665, 2667, 8, 26, 0, 0, 2666, 2663, + 1, 0, 0, 0, 2666, 2665, 1, 0, 0, 0, 2667, 2670, 1, 0, 0, 0, 2668, 2666, + 1, 0, 0, 0, 2668, 2669, 1, 0, 0, 0, 2669, 2671, 1, 0, 0, 0, 2670, 2668, + 1, 0, 0, 0, 2671, 2672, 5, 39, 0, 0, 2672, 593, 1, 0, 0, 0, 2673, 2677, + 3, 610, 304, 0, 2674, 2676, 3, 610, 304, 0, 2675, 2674, 1, 0, 0, 0, 2676, + 2679, 1, 0, 0, 0, 2677, 2675, 1, 0, 0, 0, 2677, 2678, 1, 0, 0, 0, 2678, + 595, 1, 0, 0, 0, 2679, 2677, 1, 0, 0, 0, 2680, 2682, 3, 610, 304, 0, 2681, + 2680, 1, 0, 0, 0, 2682, 2683, 1, 0, 0, 0, 2683, 2681, 1, 0, 0, 0, 2683, + 2684, 1, 0, 0, 0, 2684, 2685, 1, 0, 0, 0, 2685, 2689, 5, 46, 0, 0, 2686, + 2688, 3, 610, 304, 0, 2687, 2686, 1, 0, 0, 0, 2688, 2691, 1, 0, 0, 0, 2689, + 2687, 1, 0, 0, 0, 2689, 2690, 1, 0, 0, 0, 2690, 2701, 1, 0, 0, 0, 2691, + 2689, 1, 0, 0, 0, 2692, 2694, 7, 7, 0, 0, 2693, 2695, 7, 27, 0, 0, 2694, + 2693, 1, 0, 0, 0, 2694, 2695, 1, 0, 0, 0, 2695, 2697, 1, 0, 0, 0, 2696, + 2698, 3, 610, 304, 0, 2697, 2696, 1, 0, 0, 0, 2698, 2699, 1, 0, 0, 0, 2699, + 2697, 1, 0, 0, 0, 2699, 2700, 1, 0, 0, 0, 2700, 2702, 1, 0, 0, 0, 2701, + 2692, 1, 0, 0, 0, 2701, 2702, 1, 0, 0, 0, 2702, 2741, 1, 0, 0, 0, 2703, + 2704, 5, 46, 0, 0, 2704, 2708, 3, 610, 304, 0, 2705, 2707, 3, 610, 304, + 0, 2706, 2705, 1, 0, 0, 0, 2707, 2710, 1, 0, 0, 0, 2708, 2706, 1, 0, 0, + 0, 2708, 2709, 1, 0, 0, 0, 2709, 2720, 1, 0, 0, 0, 2710, 2708, 1, 0, 0, + 0, 2711, 2713, 7, 7, 0, 0, 2712, 2714, 7, 27, 0, 0, 2713, 2712, 1, 0, 0, + 0, 2713, 2714, 1, 0, 0, 0, 2714, 2716, 1, 0, 0, 0, 2715, 2717, 3, 610, + 304, 0, 2716, 2715, 1, 0, 0, 0, 2717, 2718, 1, 0, 0, 0, 2718, 2716, 1, + 0, 0, 0, 2718, 2719, 1, 0, 0, 0, 2719, 2721, 1, 0, 0, 0, 2720, 2711, 1, + 0, 0, 0, 2720, 2721, 1, 0, 0, 0, 2721, 2741, 1, 0, 0, 0, 2722, 2726, 3, + 610, 304, 0, 2723, 2725, 3, 610, 304, 0, 2724, 2723, 1, 0, 0, 0, 2725, + 2728, 1, 0, 0, 0, 2726, 2724, 1, 0, 0, 0, 2726, 2727, 1, 0, 0, 0, 2727, + 2738, 1, 0, 0, 0, 2728, 2726, 1, 0, 0, 0, 2729, 2731, 7, 7, 0, 0, 2730, + 2732, 7, 27, 0, 0, 2731, 2730, 1, 0, 0, 0, 2731, 2732, 1, 0, 0, 0, 2732, + 2734, 1, 0, 0, 0, 2733, 2735, 3, 610, 304, 0, 2734, 2733, 1, 0, 0, 0, 2735, + 2736, 1, 0, 0, 0, 2736, 2734, 1, 0, 0, 0, 2736, 2737, 1, 0, 0, 0, 2737, + 2739, 1, 0, 0, 0, 2738, 2729, 1, 0, 0, 0, 2738, 2739, 1, 0, 0, 0, 2739, + 2741, 1, 0, 0, 0, 2740, 2681, 1, 0, 0, 0, 2740, 2703, 1, 0, 0, 0, 2740, + 2722, 1, 0, 0, 0, 2741, 597, 1, 0, 0, 0, 2742, 2746, 7, 28, 0, 0, 2743, + 2745, 7, 29, 0, 0, 2744, 2743, 1, 0, 0, 0, 2745, 2748, 1, 0, 0, 0, 2746, + 2744, 1, 0, 0, 0, 2746, 2747, 1, 0, 0, 0, 2747, 599, 1, 0, 0, 0, 2748, + 2746, 1, 0, 0, 0, 2749, 2755, 5, 34, 0, 0, 2750, 2751, 5, 34, 0, 0, 2751, + 2754, 5, 34, 0, 0, 2752, 2754, 8, 30, 0, 0, 2753, 2750, 1, 0, 0, 0, 2753, + 2752, 1, 0, 0, 0, 2754, 2757, 1, 0, 0, 0, 2755, 2753, 1, 0, 0, 0, 2755, + 2756, 1, 0, 0, 0, 2756, 2758, 1, 0, 0, 0, 2757, 2755, 1, 0, 0, 0, 2758, + 2759, 5, 34, 0, 0, 2759, 601, 1, 0, 0, 0, 2760, 2761, 3, 616, 307, 0, 2761, + 2762, 1, 0, 0, 0, 2762, 2763, 6, 300, 2, 0, 2763, 603, 1, 0, 0, 0, 2764, + 2765, 5, 45, 0, 0, 2765, 2766, 5, 45, 0, 0, 2766, 2770, 1, 0, 0, 0, 2767, + 2769, 8, 31, 0, 0, 2768, 2767, 1, 0, 0, 0, 2769, 2772, 1, 0, 0, 0, 2770, + 2768, 1, 0, 0, 0, 2770, 2771, 1, 0, 0, 0, 2771, 2774, 1, 0, 0, 0, 2772, + 2770, 1, 0, 0, 0, 2773, 2775, 5, 13, 0, 0, 2774, 2773, 1, 0, 0, 0, 2774, + 2775, 1, 0, 0, 0, 2775, 2777, 1, 0, 0, 0, 2776, 2778, 5, 10, 0, 0, 2777, + 2776, 1, 0, 0, 0, 2777, 2778, 1, 0, 0, 0, 2778, 2779, 1, 0, 0, 0, 2779, + 2780, 6, 301, 2, 0, 2780, 605, 1, 0, 0, 0, 2781, 2782, 5, 47, 0, 0, 2782, + 2783, 5, 42, 0, 0, 2783, 2787, 1, 0, 0, 0, 2784, 2786, 9, 0, 0, 0, 2785, + 2784, 1, 0, 0, 0, 2786, 2789, 1, 0, 0, 0, 2787, 2788, 1, 0, 0, 0, 2787, + 2785, 1, 0, 0, 0, 2788, 2790, 1, 0, 0, 0, 2789, 2787, 1, 0, 0, 0, 2790, + 2791, 5, 42, 0, 0, 2791, 2792, 5, 47, 0, 0, 2792, 2793, 1, 0, 0, 0, 2793, + 2794, 6, 302, 2, 0, 2794, 607, 1, 0, 0, 0, 2795, 2796, 9, 0, 0, 0, 2796, + 609, 1, 0, 0, 0, 2797, 2798, 7, 32, 0, 0, 2798, 611, 1, 0, 0, 0, 2799, + 2800, 7, 33, 0, 0, 2800, 613, 1, 0, 0, 0, 2801, 2802, 8, 33, 0, 0, 2802, + 615, 1, 0, 0, 0, 2803, 2804, 7, 34, 0, 0, 2804, 617, 1, 0, 0, 0, 2805, + 2806, 5, 47, 0, 0, 2806, 2807, 5, 47, 0, 0, 2807, 2811, 1, 0, 0, 0, 2808, + 2810, 9, 0, 0, 0, 2809, 2808, 1, 0, 0, 0, 2810, 2813, 1, 0, 0, 0, 2811, + 2812, 1, 0, 0, 0, 2811, 2809, 1, 0, 0, 0, 2812, 2816, 1, 0, 0, 0, 2813, + 2811, 1, 0, 0, 0, 2814, 2817, 3, 634, 316, 0, 2815, 2817, 5, 0, 0, 1, 2816, + 2814, 1, 0, 0, 0, 2816, 2815, 1, 0, 0, 0, 2817, 2818, 1, 0, 0, 0, 2818, + 2819, 6, 308, 0, 0, 2819, 619, 1, 0, 0, 0, 2820, 2821, 5, 47, 0, 0, 2821, + 2822, 5, 42, 0, 0, 2822, 2826, 1, 0, 0, 0, 2823, 2825, 9, 0, 0, 0, 2824, + 2823, 1, 0, 0, 0, 2825, 2828, 1, 0, 0, 0, 2826, 2827, 1, 0, 0, 0, 2826, + 2824, 1, 0, 0, 0, 2827, 2829, 1, 0, 0, 0, 2828, 2826, 1, 0, 0, 0, 2829, + 2830, 5, 42, 0, 0, 2830, 2831, 5, 47, 0, 0, 2831, 2832, 1, 0, 0, 0, 2832, + 2833, 6, 309, 0, 0, 2833, 621, 1, 0, 0, 0, 2834, 2839, 3, 650, 324, 0, + 2835, 2838, 3, 656, 327, 0, 2836, 2838, 3, 602, 300, 0, 2837, 2835, 1, + 0, 0, 0, 2837, 2836, 1, 0, 0, 0, 2838, 2841, 1, 0, 0, 0, 2839, 2837, 1, + 0, 0, 0, 2839, 2840, 1, 0, 0, 0, 2840, 2843, 1, 0, 0, 0, 2841, 2839, 1, + 0, 0, 0, 2842, 2844, 3, 654, 326, 0, 2843, 2842, 1, 0, 0, 0, 2843, 2844, + 1, 0, 0, 0, 2844, 2848, 1, 0, 0, 0, 2845, 2847, 3, 602, 300, 0, 2846, 2845, + 1, 0, 0, 0, 2847, 2850, 1, 0, 0, 0, 2848, 2846, 1, 0, 0, 0, 2848, 2849, + 1, 0, 0, 0, 2849, 2851, 1, 0, 0, 0, 2850, 2848, 1, 0, 0, 0, 2851, 2852, + 3, 652, 325, 0, 2852, 2853, 1, 0, 0, 0, 2853, 2854, 6, 310, 0, 0, 2854, + 623, 1, 0, 0, 0, 2855, 2856, 3, 636, 317, 0, 2856, 2857, 3, 640, 319, 0, + 2857, 2858, 3, 636, 317, 0, 2858, 2859, 1, 0, 0, 0, 2859, 2860, 6, 311, + 0, 0, 2860, 625, 1, 0, 0, 0, 2861, 2862, 3, 638, 318, 0, 2862, 2863, 3, + 642, 320, 0, 2863, 2864, 3, 638, 318, 0, 2864, 2865, 1, 0, 0, 0, 2865, + 2866, 6, 312, 0, 0, 2866, 627, 1, 0, 0, 0, 2867, 2868, 3, 682, 340, 0, + 2868, 2869, 3, 664, 331, 0, 2869, 2870, 3, 682, 340, 0, 2870, 2871, 1, + 0, 0, 0, 2871, 2872, 6, 313, 0, 0, 2872, 629, 1, 0, 0, 0, 2873, 2874, 5, + 96, 0, 0, 2874, 2875, 1, 0, 0, 0, 2875, 2876, 6, 314, 3, 0, 2876, 631, + 1, 0, 0, 0, 2877, 2878, 9, 0, 0, 0, 2878, 2879, 1, 0, 0, 0, 2879, 2880, + 6, 315, 0, 0, 2880, 633, 1, 0, 0, 0, 2881, 2882, 5, 13, 0, 0, 2882, 2885, + 5, 10, 0, 0, 2883, 2885, 7, 31, 0, 0, 2884, 2881, 1, 0, 0, 0, 2884, 2883, + 1, 0, 0, 0, 2885, 635, 1, 0, 0, 0, 2886, 2887, 5, 34, 0, 0, 2887, 637, + 1, 0, 0, 0, 2888, 2889, 5, 39, 0, 0, 2889, 2890, 5, 39, 0, 0, 2890, 2891, + 5, 39, 0, 0, 2891, 639, 1, 0, 0, 0, 2892, 2895, 3, 648, 323, 0, 2893, 2895, + 3, 644, 321, 0, 2894, 2892, 1, 0, 0, 0, 2894, 2893, 1, 0, 0, 0, 2895, 2898, + 1, 0, 0, 0, 2896, 2894, 1, 0, 0, 0, 2896, 2897, 1, 0, 0, 0, 2897, 641, + 1, 0, 0, 0, 2898, 2896, 1, 0, 0, 0, 2899, 2902, 3, 648, 323, 0, 2900, 2902, + 3, 646, 322, 0, 2901, 2899, 1, 0, 0, 0, 2901, 2900, 1, 0, 0, 0, 2902, 2905, + 1, 0, 0, 0, 2903, 2904, 1, 0, 0, 0, 2903, 2901, 1, 0, 0, 0, 2904, 643, + 1, 0, 0, 0, 2905, 2903, 1, 0, 0, 0, 2906, 2909, 7, 35, 0, 0, 2907, 2909, + 3, 680, 339, 0, 2908, 2906, 1, 0, 0, 0, 2908, 2907, 1, 0, 0, 0, 2909, 645, + 1, 0, 0, 0, 2910, 2913, 7, 36, 0, 0, 2911, 2913, 3, 602, 300, 0, 2912, + 2910, 1, 0, 0, 0, 2912, 2911, 1, 0, 0, 0, 2913, 647, 1, 0, 0, 0, 2914, + 2918, 3, 668, 333, 0, 2915, 2918, 3, 672, 335, 0, 2916, 2918, 3, 674, 336, + 0, 2917, 2914, 1, 0, 0, 0, 2917, 2915, 1, 0, 0, 0, 2917, 2916, 1, 0, 0, + 0, 2918, 649, 1, 0, 0, 0, 2919, 2920, 5, 123, 0, 0, 2920, 2921, 5, 123, + 0, 0, 2921, 651, 1, 0, 0, 0, 2922, 2923, 5, 125, 0, 0, 2923, 2924, 5, 125, + 0, 0, 2924, 653, 1, 0, 0, 0, 2925, 2928, 3, 658, 328, 0, 2926, 2928, 3, + 660, 329, 0, 2927, 2925, 1, 0, 0, 0, 2927, 2926, 1, 0, 0, 0, 2928, 655, + 1, 0, 0, 0, 2929, 2933, 3, 662, 330, 0, 2930, 2932, 3, 602, 300, 0, 2931, + 2930, 1, 0, 0, 0, 2932, 2935, 1, 0, 0, 0, 2933, 2931, 1, 0, 0, 0, 2933, + 2934, 1, 0, 0, 0, 2934, 2936, 1, 0, 0, 0, 2935, 2933, 1, 0, 0, 0, 2936, + 2940, 3, 662, 330, 0, 2937, 2939, 3, 602, 300, 0, 2938, 2937, 1, 0, 0, + 0, 2939, 2942, 1, 0, 0, 0, 2940, 2938, 1, 0, 0, 0, 2940, 2941, 1, 0, 0, + 0, 2941, 2943, 1, 0, 0, 0, 2942, 2940, 1, 0, 0, 0, 2943, 2947, 3, 662, + 330, 0, 2944, 2946, 3, 602, 300, 0, 2945, 2944, 1, 0, 0, 0, 2946, 2949, + 1, 0, 0, 0, 2947, 2945, 1, 0, 0, 0, 2947, 2948, 1, 0, 0, 0, 2948, 2950, + 1, 0, 0, 0, 2949, 2947, 1, 0, 0, 0, 2950, 2951, 3, 662, 330, 0, 2951, 657, + 1, 0, 0, 0, 2952, 2956, 3, 662, 330, 0, 2953, 2955, 3, 602, 300, 0, 2954, + 2953, 1, 0, 0, 0, 2955, 2958, 1, 0, 0, 0, 2956, 2954, 1, 0, 0, 0, 2956, + 2957, 1, 0, 0, 0, 2957, 2959, 1, 0, 0, 0, 2958, 2956, 1, 0, 0, 0, 2959, + 2963, 3, 662, 330, 0, 2960, 2962, 3, 602, 300, 0, 2961, 2960, 1, 0, 0, + 0, 2962, 2965, 1, 0, 0, 0, 2963, 2961, 1, 0, 0, 0, 2963, 2964, 1, 0, 0, + 0, 2964, 2966, 1, 0, 0, 0, 2965, 2963, 1, 0, 0, 0, 2966, 2970, 3, 662, + 330, 0, 2967, 2969, 3, 602, 300, 0, 2968, 2967, 1, 0, 0, 0, 2969, 2972, + 1, 0, 0, 0, 2970, 2968, 1, 0, 0, 0, 2970, 2971, 1, 0, 0, 0, 2971, 2973, + 1, 0, 0, 0, 2972, 2970, 1, 0, 0, 0, 2973, 2974, 5, 61, 0, 0, 2974, 659, + 1, 0, 0, 0, 2975, 2979, 3, 662, 330, 0, 2976, 2978, 3, 602, 300, 0, 2977, + 2976, 1, 0, 0, 0, 2978, 2981, 1, 0, 0, 0, 2979, 2977, 1, 0, 0, 0, 2979, + 2980, 1, 0, 0, 0, 2980, 2982, 1, 0, 0, 0, 2981, 2979, 1, 0, 0, 0, 2982, + 2986, 3, 662, 330, 0, 2983, 2985, 3, 602, 300, 0, 2984, 2983, 1, 0, 0, + 0, 2985, 2988, 1, 0, 0, 0, 2986, 2984, 1, 0, 0, 0, 2986, 2987, 1, 0, 0, + 0, 2987, 2989, 1, 0, 0, 0, 2988, 2986, 1, 0, 0, 0, 2989, 2993, 5, 61, 0, + 0, 2990, 2992, 3, 602, 300, 0, 2991, 2990, 1, 0, 0, 0, 2992, 2995, 1, 0, + 0, 0, 2993, 2991, 1, 0, 0, 0, 2993, 2994, 1, 0, 0, 0, 2994, 2996, 1, 0, + 0, 0, 2995, 2993, 1, 0, 0, 0, 2996, 2997, 5, 61, 0, 0, 2997, 661, 1, 0, + 0, 0, 2998, 2999, 7, 37, 0, 0, 2999, 663, 1, 0, 0, 0, 3000, 3003, 3, 648, + 323, 0, 3001, 3003, 3, 666, 332, 0, 3002, 3000, 1, 0, 0, 0, 3002, 3001, + 1, 0, 0, 0, 3003, 3006, 1, 0, 0, 0, 3004, 3002, 1, 0, 0, 0, 3004, 3005, + 1, 0, 0, 0, 3005, 665, 1, 0, 0, 0, 3006, 3004, 1, 0, 0, 0, 3007, 3010, + 7, 38, 0, 0, 3008, 3010, 3, 680, 339, 0, 3009, 3007, 1, 0, 0, 0, 3009, + 3008, 1, 0, 0, 0, 3010, 667, 1, 0, 0, 0, 3011, 3012, 5, 92, 0, 0, 3012, + 3013, 3, 670, 334, 0, 3013, 669, 1, 0, 0, 0, 3014, 3017, 7, 39, 0, 0, 3015, + 3017, 3, 634, 316, 0, 3016, 3014, 1, 0, 0, 0, 3016, 3015, 1, 0, 0, 0, 3017, + 671, 1, 0, 0, 0, 3018, 3019, 5, 92, 0, 0, 3019, 3020, 7, 23, 0, 0, 3020, + 3021, 1, 0, 0, 0, 3021, 3022, 3, 678, 338, 0, 3022, 3023, 3, 678, 338, + 0, 3023, 673, 1, 0, 0, 0, 3024, 3025, 5, 92, 0, 0, 3025, 3026, 7, 5, 0, + 0, 3026, 3027, 1, 0, 0, 0, 3027, 3046, 3, 676, 337, 0, 3028, 3029, 5, 92, + 0, 0, 3029, 3030, 7, 5, 0, 0, 3030, 3031, 5, 48, 0, 0, 3031, 3032, 5, 48, + 0, 0, 3032, 3033, 5, 48, 0, 0, 3033, 3034, 1, 0, 0, 0, 3034, 3035, 3, 676, + 337, 0, 3035, 3036, 3, 678, 338, 0, 3036, 3046, 1, 0, 0, 0, 3037, 3038, + 5, 92, 0, 0, 3038, 3039, 7, 5, 0, 0, 3039, 3040, 5, 48, 0, 0, 3040, 3041, + 5, 48, 0, 0, 3041, 3042, 5, 49, 0, 0, 3042, 3043, 5, 48, 0, 0, 3043, 3044, + 1, 0, 0, 0, 3044, 3046, 3, 676, 337, 0, 3045, 3024, 1, 0, 0, 0, 3045, 3028, + 1, 0, 0, 0, 3045, 3037, 1, 0, 0, 0, 3046, 675, 1, 0, 0, 0, 3047, 3048, + 3, 678, 338, 0, 3048, 3049, 3, 678, 338, 0, 3049, 3050, 3, 678, 338, 0, + 3050, 3051, 3, 678, 338, 0, 3051, 677, 1, 0, 0, 0, 3052, 3053, 7, 40, 0, + 0, 3053, 679, 1, 0, 0, 0, 3054, 3055, 7, 41, 0, 0, 3055, 681, 1, 0, 0, + 0, 3056, 3057, 5, 39, 0, 0, 3057, 683, 1, 0, 0, 0, 57, 0, 1, 2622, 2666, + 2668, 2677, 2683, 2689, 2694, 2699, 2701, 2708, 2713, 2718, 2720, 2726, + 2731, 2736, 2738, 2740, 2746, 2753, 2755, 2770, 2774, 2777, 2787, 2811, + 2816, 2826, 2837, 2839, 2843, 2848, 2884, 2894, 2896, 2901, 2903, 2908, + 2912, 2917, 2927, 2933, 2940, 2947, 2956, 2963, 2970, 2979, 2986, 2993, + 3002, 3004, 3009, 3016, 3045, 4, 3, 0, 0, 5, 1, 0, 0, 1, 0, 4, 0, 0, + } + deserializer := antlr.NewATNDeserializer(nil) + staticData.atn = deserializer.Deserialize(staticData.serializedATN) + atn := staticData.atn + staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) + decisionToDFA := staticData.decisionToDFA + for index, state := range atn.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(state, index) + } +} + +// PartiQLLexerInit initializes any static state used to implement PartiQLLexer. By default the +// static state used to implement the lexer is lazily initialized during the first call to +// NewPartiQLLexer(). You can call this function if you wish to initialize the static state ahead +// of time. +func PartiQLLexerInit() { + staticData := &PartiQLLexerLexerStaticData + staticData.once.Do(partiqllexerLexerInit) +} + +// NewPartiQLLexer produces a new lexer instance for the optional input antlr.CharStream. +func NewPartiQLLexer(input antlr.CharStream) *PartiQLLexer { + PartiQLLexerInit() + l := new(PartiQLLexer) + l.BaseLexer = antlr.NewBaseLexer(input) + staticData := &PartiQLLexerLexerStaticData + l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) + l.channelNames = staticData.ChannelNames + l.modeNames = staticData.ModeNames + l.RuleNames = staticData.RuleNames + l.LiteralNames = staticData.LiteralNames + l.SymbolicNames = staticData.SymbolicNames + l.GrammarFileName = "PartiQLLexer.g4" + // TODO: l.EOF = antlr.TokenEOF + + return l +} + +// PartiQLLexer tokens. +const ( + PartiQLLexerABSOLUTE = 1 + PartiQLLexerACTION = 2 + PartiQLLexerADD = 3 + PartiQLLexerALL = 4 + PartiQLLexerALLOCATE = 5 + PartiQLLexerALTER = 6 + PartiQLLexerAND = 7 + PartiQLLexerANY = 8 + PartiQLLexerARE = 9 + PartiQLLexerAS = 10 + PartiQLLexerASC = 11 + PartiQLLexerASSERTION = 12 + PartiQLLexerAT = 13 + PartiQLLexerAUTHORIZATION = 14 + PartiQLLexerAVG = 15 + PartiQLLexerBEGIN = 16 + PartiQLLexerBETWEEN = 17 + PartiQLLexerBIT = 18 + PartiQLLexerBIT_LENGTH = 19 + PartiQLLexerBY = 20 + PartiQLLexerCASCADE = 21 + PartiQLLexerCASCADED = 22 + PartiQLLexerCASE = 23 + PartiQLLexerCAST = 24 + PartiQLLexerCATALOG = 25 + PartiQLLexerCHAR = 26 + PartiQLLexerCHARACTER = 27 + PartiQLLexerCHARACTER_LENGTH = 28 + PartiQLLexerCHAR_LENGTH = 29 + PartiQLLexerCHECK = 30 + PartiQLLexerCLOSE = 31 + PartiQLLexerCOALESCE = 32 + PartiQLLexerCOLLATE = 33 + PartiQLLexerCOLLATION = 34 + PartiQLLexerCOLUMN = 35 + PartiQLLexerCOMMIT = 36 + PartiQLLexerCONNECT = 37 + PartiQLLexerCONNECTION = 38 + PartiQLLexerCONSTRAINT = 39 + PartiQLLexerCONSTRAINTS = 40 + PartiQLLexerCONTINUE = 41 + PartiQLLexerCONVERT = 42 + PartiQLLexerCORRESPONDING = 43 + PartiQLLexerCOUNT = 44 + PartiQLLexerCREATE = 45 + PartiQLLexerCROSS = 46 + PartiQLLexerCURRENT = 47 + PartiQLLexerCURRENT_DATE = 48 + PartiQLLexerCURRENT_TIME = 49 + PartiQLLexerCURRENT_TIMESTAMP = 50 + PartiQLLexerCURRENT_USER = 51 + PartiQLLexerCURSOR = 52 + PartiQLLexerDATE = 53 + PartiQLLexerDEALLOCATE = 54 + PartiQLLexerDEC = 55 + PartiQLLexerDECIMAL = 56 + PartiQLLexerDECLARE = 57 + PartiQLLexerDEFAULT = 58 + PartiQLLexerDEFERRABLE = 59 + PartiQLLexerDEFERRED = 60 + PartiQLLexerDELETE = 61 + PartiQLLexerDESC = 62 + PartiQLLexerDESCRIBE = 63 + PartiQLLexerDESCRIPTOR = 64 + PartiQLLexerDIAGNOSTICS = 65 + PartiQLLexerDISCONNECT = 66 + PartiQLLexerDISTINCT = 67 + PartiQLLexerDOMAIN = 68 + PartiQLLexerDOUBLE = 69 + PartiQLLexerDROP = 70 + PartiQLLexerELSE = 71 + PartiQLLexerEND = 72 + PartiQLLexerEND_EXEC = 73 + PartiQLLexerESCAPE = 74 + PartiQLLexerEXCEPT = 75 + PartiQLLexerEXCEPTION = 76 + PartiQLLexerEXCLUDED = 77 + PartiQLLexerEXEC = 78 + PartiQLLexerEXECUTE = 79 + PartiQLLexerEXISTS = 80 + PartiQLLexerEXPLAIN = 81 + PartiQLLexerEXTERNAL = 82 + PartiQLLexerEXTRACT = 83 + PartiQLLexerDATE_ADD = 84 + PartiQLLexerDATE_DIFF = 85 + PartiQLLexerFALSE = 86 + PartiQLLexerFETCH = 87 + PartiQLLexerFIRST = 88 + PartiQLLexerFLOAT = 89 + PartiQLLexerFOR = 90 + PartiQLLexerFOREIGN = 91 + PartiQLLexerFOUND = 92 + PartiQLLexerFROM = 93 + PartiQLLexerFULL = 94 + PartiQLLexerGET = 95 + PartiQLLexerGLOBAL = 96 + PartiQLLexerGO = 97 + PartiQLLexerGOTO = 98 + PartiQLLexerGRANT = 99 + PartiQLLexerGROUP = 100 + PartiQLLexerHAVING = 101 + PartiQLLexerIDENTITY = 102 + PartiQLLexerIMMEDIATE = 103 + PartiQLLexerIN = 104 + PartiQLLexerINDICATOR = 105 + PartiQLLexerINITIALLY = 106 + PartiQLLexerINNER = 107 + PartiQLLexerINPUT = 108 + PartiQLLexerINSENSITIVE = 109 + PartiQLLexerINSERT = 110 + PartiQLLexerINT = 111 + PartiQLLexerINTEGER = 112 + PartiQLLexerINTERSECT = 113 + PartiQLLexerINTERVAL = 114 + PartiQLLexerINTO = 115 + PartiQLLexerIS = 116 + PartiQLLexerISOLATION = 117 + PartiQLLexerJOIN = 118 + PartiQLLexerKEY = 119 + PartiQLLexerLANGUAGE = 120 + PartiQLLexerLAST = 121 + PartiQLLexerLATERAL = 122 + PartiQLLexerLEFT = 123 + PartiQLLexerLEVEL = 124 + PartiQLLexerLIKE = 125 + PartiQLLexerLOCAL = 126 + PartiQLLexerLOWER = 127 + PartiQLLexerMATCH = 128 + PartiQLLexerMAX = 129 + PartiQLLexerMIN = 130 + PartiQLLexerMODULE = 131 + PartiQLLexerNAMES = 132 + PartiQLLexerNATIONAL = 133 + PartiQLLexerNATURAL = 134 + PartiQLLexerNCHAR = 135 + PartiQLLexerNEXT = 136 + PartiQLLexerNO = 137 + PartiQLLexerNOT = 138 + PartiQLLexerNULL = 139 + PartiQLLexerNULLS = 140 + PartiQLLexerNULLIF = 141 + PartiQLLexerNUMERIC = 142 + PartiQLLexerOCTET_LENGTH = 143 + PartiQLLexerOF = 144 + PartiQLLexerON = 145 + PartiQLLexerONLY = 146 + PartiQLLexerOPEN = 147 + PartiQLLexerOPTION = 148 + PartiQLLexerOR = 149 + PartiQLLexerORDER = 150 + PartiQLLexerOUTER = 151 + PartiQLLexerOUTPUT = 152 + PartiQLLexerOVERLAPS = 153 + PartiQLLexerOVERLAY = 154 + PartiQLLexerPAD = 155 + PartiQLLexerPARTIAL = 156 + PartiQLLexerPLACING = 157 + PartiQLLexerPOSITION = 158 + PartiQLLexerPRECISION = 159 + PartiQLLexerPREPARE = 160 + PartiQLLexerPRESERVE = 161 + PartiQLLexerPRIMARY = 162 + PartiQLLexerPRIOR = 163 + PartiQLLexerPRIVILEGES = 164 + PartiQLLexerPROCEDURE = 165 + PartiQLLexerPUBLIC = 166 + PartiQLLexerREAD = 167 + PartiQLLexerREAL = 168 + PartiQLLexerREFERENCES = 169 + PartiQLLexerRELATIVE = 170 + PartiQLLexerREPLACE = 171 + PartiQLLexerRESTRICT = 172 + PartiQLLexerREVOKE = 173 + PartiQLLexerRIGHT = 174 + PartiQLLexerROLLBACK = 175 + PartiQLLexerROWS = 176 + PartiQLLexerSCHEMA = 177 + PartiQLLexerSCROLL = 178 + PartiQLLexerSECTION = 179 + PartiQLLexerSELECT = 180 + PartiQLLexerSESSION = 181 + PartiQLLexerSESSION_USER = 182 + PartiQLLexerSET = 183 + PartiQLLexerSHORTEST = 184 + PartiQLLexerSIZE = 185 + PartiQLLexerSMALLINT = 186 + PartiQLLexerSOME = 187 + PartiQLLexerSPACE = 188 + PartiQLLexerSQL = 189 + PartiQLLexerSQLCODE = 190 + PartiQLLexerSQLERROR = 191 + PartiQLLexerSQLSTATE = 192 + PartiQLLexerSUBSTRING = 193 + PartiQLLexerSUM = 194 + PartiQLLexerSYSTEM_USER = 195 + PartiQLLexerTABLE = 196 + PartiQLLexerTEMPORARY = 197 + PartiQLLexerTHEN = 198 + PartiQLLexerTIME = 199 + PartiQLLexerTIMESTAMP = 200 + PartiQLLexerTO = 201 + PartiQLLexerTRANSACTION = 202 + PartiQLLexerTRANSLATE = 203 + PartiQLLexerTRANSLATION = 204 + PartiQLLexerTRIM = 205 + PartiQLLexerTRUE = 206 + PartiQLLexerUNION = 207 + PartiQLLexerUNIQUE = 208 + PartiQLLexerUNKNOWN = 209 + PartiQLLexerUPDATE = 210 + PartiQLLexerUPPER = 211 + PartiQLLexerUPSERT = 212 + PartiQLLexerUSAGE = 213 + PartiQLLexerUSER = 214 + PartiQLLexerUSING = 215 + PartiQLLexerVALUE = 216 + PartiQLLexerVALUES = 217 + PartiQLLexerVARCHAR = 218 + PartiQLLexerVARYING = 219 + PartiQLLexerVIEW = 220 + PartiQLLexerWHEN = 221 + PartiQLLexerWHENEVER = 222 + PartiQLLexerWHERE = 223 + PartiQLLexerWITH = 224 + PartiQLLexerWORK = 225 + PartiQLLexerWRITE = 226 + PartiQLLexerZONE = 227 + PartiQLLexerLAG = 228 + PartiQLLexerLEAD = 229 + PartiQLLexerOVER = 230 + PartiQLLexerPARTITION = 231 + PartiQLLexerCAN_CAST = 232 + PartiQLLexerCAN_LOSSLESS_CAST = 233 + PartiQLLexerMISSING = 234 + PartiQLLexerPIVOT = 235 + PartiQLLexerUNPIVOT = 236 + PartiQLLexerLIMIT = 237 + PartiQLLexerOFFSET = 238 + PartiQLLexerREMOVE = 239 + PartiQLLexerINDEX = 240 + PartiQLLexerLET = 241 + PartiQLLexerCONFLICT = 242 + PartiQLLexerDO = 243 + PartiQLLexerRETURNING = 244 + PartiQLLexerMODIFIED = 245 + PartiQLLexerNEW = 246 + PartiQLLexerOLD = 247 + PartiQLLexerNOTHING = 248 + PartiQLLexerTUPLE = 249 + PartiQLLexerINTEGER2 = 250 + PartiQLLexerINT2 = 251 + PartiQLLexerINTEGER4 = 252 + PartiQLLexerINT4 = 253 + PartiQLLexerINTEGER8 = 254 + PartiQLLexerINT8 = 255 + PartiQLLexerBIGINT = 256 + PartiQLLexerBOOL = 257 + PartiQLLexerBOOLEAN = 258 + PartiQLLexerSTRING = 259 + PartiQLLexerSYMBOL = 260 + PartiQLLexerCLOB = 261 + PartiQLLexerBLOB = 262 + PartiQLLexerSTRUCT = 263 + PartiQLLexerLIST = 264 + PartiQLLexerSEXP = 265 + PartiQLLexerBAG = 266 + PartiQLLexerCARET = 267 + PartiQLLexerCOMMA = 268 + PartiQLLexerPLUS = 269 + PartiQLLexerMINUS = 270 + PartiQLLexerSLASH_FORWARD = 271 + PartiQLLexerPERCENT = 272 + PartiQLLexerAT_SIGN = 273 + PartiQLLexerTILDE = 274 + PartiQLLexerASTERISK = 275 + PartiQLLexerLT_EQ = 276 + PartiQLLexerGT_EQ = 277 + PartiQLLexerEQ = 278 + PartiQLLexerNEQ = 279 + PartiQLLexerCONCAT = 280 + PartiQLLexerANGLE_LEFT = 281 + PartiQLLexerANGLE_RIGHT = 282 + PartiQLLexerANGLE_DOUBLE_LEFT = 283 + PartiQLLexerANGLE_DOUBLE_RIGHT = 284 + PartiQLLexerBRACKET_LEFT = 285 + PartiQLLexerBRACKET_RIGHT = 286 + PartiQLLexerBRACE_LEFT = 287 + PartiQLLexerBRACE_RIGHT = 288 + PartiQLLexerPAREN_LEFT = 289 + PartiQLLexerPAREN_RIGHT = 290 + PartiQLLexerCOLON = 291 + PartiQLLexerCOLON_SEMI = 292 + PartiQLLexerQUESTION_MARK = 293 + PartiQLLexerPERIOD = 294 + PartiQLLexerLITERAL_STRING = 295 + PartiQLLexerLITERAL_INTEGER = 296 + PartiQLLexerLITERAL_DECIMAL = 297 + PartiQLLexerIDENTIFIER = 298 + PartiQLLexerIDENTIFIER_QUOTED = 299 + PartiQLLexerWS = 300 + PartiQLLexerCOMMENT_SINGLE = 301 + PartiQLLexerCOMMENT_BLOCK = 302 + PartiQLLexerUNRECOGNIZED = 303 + PartiQLLexerION_CLOSURE = 304 + PartiQLLexerBACKTICK = 305 +) + +// PartiQLLexerION is the PartiQLLexer mode. +const PartiQLLexerION = 1 diff --git a/partiql/partiqlparser_base_listener.go b/partiql/partiqlparser_base_listener.go new file mode 100644 index 0000000..6f428a6 --- /dev/null +++ b/partiql/partiqlparser_base_listener.go @@ -0,0 +1,1127 @@ +// Code generated from PartiQLParser.g4 by ANTLR 4.13.2. DO NOT EDIT. + +package partiql // PartiQLParser +import "github.com/antlr4-go/antlr/v4" + +// BasePartiQLParserListener is a complete listener for a parse tree produced by PartiQLParserParser. +type BasePartiQLParserListener struct{} + +var _ PartiQLParserListener = &BasePartiQLParserListener{} + +// VisitTerminal is called when a terminal node is visited. +func (s *BasePartiQLParserListener) VisitTerminal(node antlr.TerminalNode) {} + +// VisitErrorNode is called when an error node is visited. +func (s *BasePartiQLParserListener) VisitErrorNode(node antlr.ErrorNode) {} + +// EnterEveryRule is called when any rule is entered. +func (s *BasePartiQLParserListener) EnterEveryRule(ctx antlr.ParserRuleContext) {} + +// ExitEveryRule is called when any rule is exited. +func (s *BasePartiQLParserListener) ExitEveryRule(ctx antlr.ParserRuleContext) {} + +// EnterScript is called when production script is entered. +func (s *BasePartiQLParserListener) EnterScript(ctx *ScriptContext) {} + +// ExitScript is called when production script is exited. +func (s *BasePartiQLParserListener) ExitScript(ctx *ScriptContext) {} + +// EnterRoot is called when production root is entered. +func (s *BasePartiQLParserListener) EnterRoot(ctx *RootContext) {} + +// ExitRoot is called when production root is exited. +func (s *BasePartiQLParserListener) ExitRoot(ctx *RootContext) {} + +// EnterQueryDql is called when production QueryDql is entered. +func (s *BasePartiQLParserListener) EnterQueryDql(ctx *QueryDqlContext) {} + +// ExitQueryDql is called when production QueryDql is exited. +func (s *BasePartiQLParserListener) ExitQueryDql(ctx *QueryDqlContext) {} + +// EnterQueryDml is called when production QueryDml is entered. +func (s *BasePartiQLParserListener) EnterQueryDml(ctx *QueryDmlContext) {} + +// ExitQueryDml is called when production QueryDml is exited. +func (s *BasePartiQLParserListener) ExitQueryDml(ctx *QueryDmlContext) {} + +// EnterQueryDdl is called when production QueryDdl is entered. +func (s *BasePartiQLParserListener) EnterQueryDdl(ctx *QueryDdlContext) {} + +// ExitQueryDdl is called when production QueryDdl is exited. +func (s *BasePartiQLParserListener) ExitQueryDdl(ctx *QueryDdlContext) {} + +// EnterQueryExec is called when production QueryExec is entered. +func (s *BasePartiQLParserListener) EnterQueryExec(ctx *QueryExecContext) {} + +// ExitQueryExec is called when production QueryExec is exited. +func (s *BasePartiQLParserListener) ExitQueryExec(ctx *QueryExecContext) {} + +// EnterExplainOption is called when production explainOption is entered. +func (s *BasePartiQLParserListener) EnterExplainOption(ctx *ExplainOptionContext) {} + +// ExitExplainOption is called when production explainOption is exited. +func (s *BasePartiQLParserListener) ExitExplainOption(ctx *ExplainOptionContext) {} + +// EnterAsIdent is called when production asIdent is entered. +func (s *BasePartiQLParserListener) EnterAsIdent(ctx *AsIdentContext) {} + +// ExitAsIdent is called when production asIdent is exited. +func (s *BasePartiQLParserListener) ExitAsIdent(ctx *AsIdentContext) {} + +// EnterAtIdent is called when production atIdent is entered. +func (s *BasePartiQLParserListener) EnterAtIdent(ctx *AtIdentContext) {} + +// ExitAtIdent is called when production atIdent is exited. +func (s *BasePartiQLParserListener) ExitAtIdent(ctx *AtIdentContext) {} + +// EnterByIdent is called when production byIdent is entered. +func (s *BasePartiQLParserListener) EnterByIdent(ctx *ByIdentContext) {} + +// ExitByIdent is called when production byIdent is exited. +func (s *BasePartiQLParserListener) ExitByIdent(ctx *ByIdentContext) {} + +// EnterSymbolPrimitive is called when production symbolPrimitive is entered. +func (s *BasePartiQLParserListener) EnterSymbolPrimitive(ctx *SymbolPrimitiveContext) {} + +// ExitSymbolPrimitive is called when production symbolPrimitive is exited. +func (s *BasePartiQLParserListener) ExitSymbolPrimitive(ctx *SymbolPrimitiveContext) {} + +// EnterDql is called when production dql is entered. +func (s *BasePartiQLParserListener) EnterDql(ctx *DqlContext) {} + +// ExitDql is called when production dql is exited. +func (s *BasePartiQLParserListener) ExitDql(ctx *DqlContext) {} + +// EnterExecCommand is called when production execCommand is entered. +func (s *BasePartiQLParserListener) EnterExecCommand(ctx *ExecCommandContext) {} + +// ExitExecCommand is called when production execCommand is exited. +func (s *BasePartiQLParserListener) ExitExecCommand(ctx *ExecCommandContext) {} + +// EnterDdl is called when production ddl is entered. +func (s *BasePartiQLParserListener) EnterDdl(ctx *DdlContext) {} + +// ExitDdl is called when production ddl is exited. +func (s *BasePartiQLParserListener) ExitDdl(ctx *DdlContext) {} + +// EnterCreateTable is called when production CreateTable is entered. +func (s *BasePartiQLParserListener) EnterCreateTable(ctx *CreateTableContext) {} + +// ExitCreateTable is called when production CreateTable is exited. +func (s *BasePartiQLParserListener) ExitCreateTable(ctx *CreateTableContext) {} + +// EnterCreateIndex is called when production CreateIndex is entered. +func (s *BasePartiQLParserListener) EnterCreateIndex(ctx *CreateIndexContext) {} + +// ExitCreateIndex is called when production CreateIndex is exited. +func (s *BasePartiQLParserListener) ExitCreateIndex(ctx *CreateIndexContext) {} + +// EnterDropTable is called when production DropTable is entered. +func (s *BasePartiQLParserListener) EnterDropTable(ctx *DropTableContext) {} + +// ExitDropTable is called when production DropTable is exited. +func (s *BasePartiQLParserListener) ExitDropTable(ctx *DropTableContext) {} + +// EnterDropIndex is called when production DropIndex is entered. +func (s *BasePartiQLParserListener) EnterDropIndex(ctx *DropIndexContext) {} + +// ExitDropIndex is called when production DropIndex is exited. +func (s *BasePartiQLParserListener) ExitDropIndex(ctx *DropIndexContext) {} + +// EnterDmlBaseWrapper is called when production DmlBaseWrapper is entered. +func (s *BasePartiQLParserListener) EnterDmlBaseWrapper(ctx *DmlBaseWrapperContext) {} + +// ExitDmlBaseWrapper is called when production DmlBaseWrapper is exited. +func (s *BasePartiQLParserListener) ExitDmlBaseWrapper(ctx *DmlBaseWrapperContext) {} + +// EnterDmlDelete is called when production DmlDelete is entered. +func (s *BasePartiQLParserListener) EnterDmlDelete(ctx *DmlDeleteContext) {} + +// ExitDmlDelete is called when production DmlDelete is exited. +func (s *BasePartiQLParserListener) ExitDmlDelete(ctx *DmlDeleteContext) {} + +// EnterDmlInsertReturning is called when production DmlInsertReturning is entered. +func (s *BasePartiQLParserListener) EnterDmlInsertReturning(ctx *DmlInsertReturningContext) {} + +// ExitDmlInsertReturning is called when production DmlInsertReturning is exited. +func (s *BasePartiQLParserListener) ExitDmlInsertReturning(ctx *DmlInsertReturningContext) {} + +// EnterDmlBase is called when production DmlBase is entered. +func (s *BasePartiQLParserListener) EnterDmlBase(ctx *DmlBaseContext) {} + +// ExitDmlBase is called when production DmlBase is exited. +func (s *BasePartiQLParserListener) ExitDmlBase(ctx *DmlBaseContext) {} + +// EnterDmlBaseCommand is called when production dmlBaseCommand is entered. +func (s *BasePartiQLParserListener) EnterDmlBaseCommand(ctx *DmlBaseCommandContext) {} + +// ExitDmlBaseCommand is called when production dmlBaseCommand is exited. +func (s *BasePartiQLParserListener) ExitDmlBaseCommand(ctx *DmlBaseCommandContext) {} + +// EnterPathSimple is called when production pathSimple is entered. +func (s *BasePartiQLParserListener) EnterPathSimple(ctx *PathSimpleContext) {} + +// ExitPathSimple is called when production pathSimple is exited. +func (s *BasePartiQLParserListener) ExitPathSimple(ctx *PathSimpleContext) {} + +// EnterPathSimpleLiteral is called when production PathSimpleLiteral is entered. +func (s *BasePartiQLParserListener) EnterPathSimpleLiteral(ctx *PathSimpleLiteralContext) {} + +// ExitPathSimpleLiteral is called when production PathSimpleLiteral is exited. +func (s *BasePartiQLParserListener) ExitPathSimpleLiteral(ctx *PathSimpleLiteralContext) {} + +// EnterPathSimpleSymbol is called when production PathSimpleSymbol is entered. +func (s *BasePartiQLParserListener) EnterPathSimpleSymbol(ctx *PathSimpleSymbolContext) {} + +// ExitPathSimpleSymbol is called when production PathSimpleSymbol is exited. +func (s *BasePartiQLParserListener) ExitPathSimpleSymbol(ctx *PathSimpleSymbolContext) {} + +// EnterPathSimpleDotSymbol is called when production PathSimpleDotSymbol is entered. +func (s *BasePartiQLParserListener) EnterPathSimpleDotSymbol(ctx *PathSimpleDotSymbolContext) {} + +// ExitPathSimpleDotSymbol is called when production PathSimpleDotSymbol is exited. +func (s *BasePartiQLParserListener) ExitPathSimpleDotSymbol(ctx *PathSimpleDotSymbolContext) {} + +// EnterReplaceCommand is called when production replaceCommand is entered. +func (s *BasePartiQLParserListener) EnterReplaceCommand(ctx *ReplaceCommandContext) {} + +// ExitReplaceCommand is called when production replaceCommand is exited. +func (s *BasePartiQLParserListener) ExitReplaceCommand(ctx *ReplaceCommandContext) {} + +// EnterUpsertCommand is called when production upsertCommand is entered. +func (s *BasePartiQLParserListener) EnterUpsertCommand(ctx *UpsertCommandContext) {} + +// ExitUpsertCommand is called when production upsertCommand is exited. +func (s *BasePartiQLParserListener) ExitUpsertCommand(ctx *UpsertCommandContext) {} + +// EnterRemoveCommand is called when production removeCommand is entered. +func (s *BasePartiQLParserListener) EnterRemoveCommand(ctx *RemoveCommandContext) {} + +// ExitRemoveCommand is called when production removeCommand is exited. +func (s *BasePartiQLParserListener) ExitRemoveCommand(ctx *RemoveCommandContext) {} + +// EnterInsertCommandReturning is called when production insertCommandReturning is entered. +func (s *BasePartiQLParserListener) EnterInsertCommandReturning(ctx *InsertCommandReturningContext) {} + +// ExitInsertCommandReturning is called when production insertCommandReturning is exited. +func (s *BasePartiQLParserListener) ExitInsertCommandReturning(ctx *InsertCommandReturningContext) {} + +// EnterInsertLegacy is called when production InsertLegacy is entered. +func (s *BasePartiQLParserListener) EnterInsertLegacy(ctx *InsertLegacyContext) {} + +// ExitInsertLegacy is called when production InsertLegacy is exited. +func (s *BasePartiQLParserListener) ExitInsertLegacy(ctx *InsertLegacyContext) {} + +// EnterInsert is called when production Insert is entered. +func (s *BasePartiQLParserListener) EnterInsert(ctx *InsertContext) {} + +// ExitInsert is called when production Insert is exited. +func (s *BasePartiQLParserListener) ExitInsert(ctx *InsertContext) {} + +// EnterOnConflictLegacy is called when production OnConflictLegacy is entered. +func (s *BasePartiQLParserListener) EnterOnConflictLegacy(ctx *OnConflictLegacyContext) {} + +// ExitOnConflictLegacy is called when production OnConflictLegacy is exited. +func (s *BasePartiQLParserListener) ExitOnConflictLegacy(ctx *OnConflictLegacyContext) {} + +// EnterOnConflict is called when production OnConflict is entered. +func (s *BasePartiQLParserListener) EnterOnConflict(ctx *OnConflictContext) {} + +// ExitOnConflict is called when production OnConflict is exited. +func (s *BasePartiQLParserListener) ExitOnConflict(ctx *OnConflictContext) {} + +// EnterConflictTarget is called when production conflictTarget is entered. +func (s *BasePartiQLParserListener) EnterConflictTarget(ctx *ConflictTargetContext) {} + +// ExitConflictTarget is called when production conflictTarget is exited. +func (s *BasePartiQLParserListener) ExitConflictTarget(ctx *ConflictTargetContext) {} + +// EnterConstraintName is called when production constraintName is entered. +func (s *BasePartiQLParserListener) EnterConstraintName(ctx *ConstraintNameContext) {} + +// ExitConstraintName is called when production constraintName is exited. +func (s *BasePartiQLParserListener) ExitConstraintName(ctx *ConstraintNameContext) {} + +// EnterConflictAction is called when production conflictAction is entered. +func (s *BasePartiQLParserListener) EnterConflictAction(ctx *ConflictActionContext) {} + +// ExitConflictAction is called when production conflictAction is exited. +func (s *BasePartiQLParserListener) ExitConflictAction(ctx *ConflictActionContext) {} + +// EnterDoReplace is called when production doReplace is entered. +func (s *BasePartiQLParserListener) EnterDoReplace(ctx *DoReplaceContext) {} + +// ExitDoReplace is called when production doReplace is exited. +func (s *BasePartiQLParserListener) ExitDoReplace(ctx *DoReplaceContext) {} + +// EnterDoUpdate is called when production doUpdate is entered. +func (s *BasePartiQLParserListener) EnterDoUpdate(ctx *DoUpdateContext) {} + +// ExitDoUpdate is called when production doUpdate is exited. +func (s *BasePartiQLParserListener) ExitDoUpdate(ctx *DoUpdateContext) {} + +// EnterUpdateClause is called when production updateClause is entered. +func (s *BasePartiQLParserListener) EnterUpdateClause(ctx *UpdateClauseContext) {} + +// ExitUpdateClause is called when production updateClause is exited. +func (s *BasePartiQLParserListener) ExitUpdateClause(ctx *UpdateClauseContext) {} + +// EnterSetCommand is called when production setCommand is entered. +func (s *BasePartiQLParserListener) EnterSetCommand(ctx *SetCommandContext) {} + +// ExitSetCommand is called when production setCommand is exited. +func (s *BasePartiQLParserListener) ExitSetCommand(ctx *SetCommandContext) {} + +// EnterSetAssignment is called when production setAssignment is entered. +func (s *BasePartiQLParserListener) EnterSetAssignment(ctx *SetAssignmentContext) {} + +// ExitSetAssignment is called when production setAssignment is exited. +func (s *BasePartiQLParserListener) ExitSetAssignment(ctx *SetAssignmentContext) {} + +// EnterDeleteCommand is called when production deleteCommand is entered. +func (s *BasePartiQLParserListener) EnterDeleteCommand(ctx *DeleteCommandContext) {} + +// ExitDeleteCommand is called when production deleteCommand is exited. +func (s *BasePartiQLParserListener) ExitDeleteCommand(ctx *DeleteCommandContext) {} + +// EnterReturningClause is called when production returningClause is entered. +func (s *BasePartiQLParserListener) EnterReturningClause(ctx *ReturningClauseContext) {} + +// ExitReturningClause is called when production returningClause is exited. +func (s *BasePartiQLParserListener) ExitReturningClause(ctx *ReturningClauseContext) {} + +// EnterReturningColumn is called when production returningColumn is entered. +func (s *BasePartiQLParserListener) EnterReturningColumn(ctx *ReturningColumnContext) {} + +// ExitReturningColumn is called when production returningColumn is exited. +func (s *BasePartiQLParserListener) ExitReturningColumn(ctx *ReturningColumnContext) {} + +// EnterFromClauseSimpleExplicit is called when production FromClauseSimpleExplicit is entered. +func (s *BasePartiQLParserListener) EnterFromClauseSimpleExplicit(ctx *FromClauseSimpleExplicitContext) { +} + +// ExitFromClauseSimpleExplicit is called when production FromClauseSimpleExplicit is exited. +func (s *BasePartiQLParserListener) ExitFromClauseSimpleExplicit(ctx *FromClauseSimpleExplicitContext) { +} + +// EnterFromClauseSimpleImplicit is called when production FromClauseSimpleImplicit is entered. +func (s *BasePartiQLParserListener) EnterFromClauseSimpleImplicit(ctx *FromClauseSimpleImplicitContext) { +} + +// ExitFromClauseSimpleImplicit is called when production FromClauseSimpleImplicit is exited. +func (s *BasePartiQLParserListener) ExitFromClauseSimpleImplicit(ctx *FromClauseSimpleImplicitContext) { +} + +// EnterWhereClause is called when production whereClause is entered. +func (s *BasePartiQLParserListener) EnterWhereClause(ctx *WhereClauseContext) {} + +// ExitWhereClause is called when production whereClause is exited. +func (s *BasePartiQLParserListener) ExitWhereClause(ctx *WhereClauseContext) {} + +// EnterSelectAll is called when production SelectAll is entered. +func (s *BasePartiQLParserListener) EnterSelectAll(ctx *SelectAllContext) {} + +// ExitSelectAll is called when production SelectAll is exited. +func (s *BasePartiQLParserListener) ExitSelectAll(ctx *SelectAllContext) {} + +// EnterSelectItems is called when production SelectItems is entered. +func (s *BasePartiQLParserListener) EnterSelectItems(ctx *SelectItemsContext) {} + +// ExitSelectItems is called when production SelectItems is exited. +func (s *BasePartiQLParserListener) ExitSelectItems(ctx *SelectItemsContext) {} + +// EnterSelectValue is called when production SelectValue is entered. +func (s *BasePartiQLParserListener) EnterSelectValue(ctx *SelectValueContext) {} + +// ExitSelectValue is called when production SelectValue is exited. +func (s *BasePartiQLParserListener) ExitSelectValue(ctx *SelectValueContext) {} + +// EnterSelectPivot is called when production SelectPivot is entered. +func (s *BasePartiQLParserListener) EnterSelectPivot(ctx *SelectPivotContext) {} + +// ExitSelectPivot is called when production SelectPivot is exited. +func (s *BasePartiQLParserListener) ExitSelectPivot(ctx *SelectPivotContext) {} + +// EnterProjectionItems is called when production projectionItems is entered. +func (s *BasePartiQLParserListener) EnterProjectionItems(ctx *ProjectionItemsContext) {} + +// ExitProjectionItems is called when production projectionItems is exited. +func (s *BasePartiQLParserListener) ExitProjectionItems(ctx *ProjectionItemsContext) {} + +// EnterProjectionItem is called when production projectionItem is entered. +func (s *BasePartiQLParserListener) EnterProjectionItem(ctx *ProjectionItemContext) {} + +// ExitProjectionItem is called when production projectionItem is exited. +func (s *BasePartiQLParserListener) ExitProjectionItem(ctx *ProjectionItemContext) {} + +// EnterSetQuantifierStrategy is called when production setQuantifierStrategy is entered. +func (s *BasePartiQLParserListener) EnterSetQuantifierStrategy(ctx *SetQuantifierStrategyContext) {} + +// ExitSetQuantifierStrategy is called when production setQuantifierStrategy is exited. +func (s *BasePartiQLParserListener) ExitSetQuantifierStrategy(ctx *SetQuantifierStrategyContext) {} + +// EnterLetClause is called when production letClause is entered. +func (s *BasePartiQLParserListener) EnterLetClause(ctx *LetClauseContext) {} + +// ExitLetClause is called when production letClause is exited. +func (s *BasePartiQLParserListener) ExitLetClause(ctx *LetClauseContext) {} + +// EnterLetBinding is called when production letBinding is entered. +func (s *BasePartiQLParserListener) EnterLetBinding(ctx *LetBindingContext) {} + +// ExitLetBinding is called when production letBinding is exited. +func (s *BasePartiQLParserListener) ExitLetBinding(ctx *LetBindingContext) {} + +// EnterOrderByClause is called when production orderByClause is entered. +func (s *BasePartiQLParserListener) EnterOrderByClause(ctx *OrderByClauseContext) {} + +// ExitOrderByClause is called when production orderByClause is exited. +func (s *BasePartiQLParserListener) ExitOrderByClause(ctx *OrderByClauseContext) {} + +// EnterOrderSortSpec is called when production orderSortSpec is entered. +func (s *BasePartiQLParserListener) EnterOrderSortSpec(ctx *OrderSortSpecContext) {} + +// ExitOrderSortSpec is called when production orderSortSpec is exited. +func (s *BasePartiQLParserListener) ExitOrderSortSpec(ctx *OrderSortSpecContext) {} + +// EnterGroupClause is called when production groupClause is entered. +func (s *BasePartiQLParserListener) EnterGroupClause(ctx *GroupClauseContext) {} + +// ExitGroupClause is called when production groupClause is exited. +func (s *BasePartiQLParserListener) ExitGroupClause(ctx *GroupClauseContext) {} + +// EnterGroupAlias is called when production groupAlias is entered. +func (s *BasePartiQLParserListener) EnterGroupAlias(ctx *GroupAliasContext) {} + +// ExitGroupAlias is called when production groupAlias is exited. +func (s *BasePartiQLParserListener) ExitGroupAlias(ctx *GroupAliasContext) {} + +// EnterGroupKey is called when production groupKey is entered. +func (s *BasePartiQLParserListener) EnterGroupKey(ctx *GroupKeyContext) {} + +// ExitGroupKey is called when production groupKey is exited. +func (s *BasePartiQLParserListener) ExitGroupKey(ctx *GroupKeyContext) {} + +// EnterOver is called when production over is entered. +func (s *BasePartiQLParserListener) EnterOver(ctx *OverContext) {} + +// ExitOver is called when production over is exited. +func (s *BasePartiQLParserListener) ExitOver(ctx *OverContext) {} + +// EnterWindowPartitionList is called when production windowPartitionList is entered. +func (s *BasePartiQLParserListener) EnterWindowPartitionList(ctx *WindowPartitionListContext) {} + +// ExitWindowPartitionList is called when production windowPartitionList is exited. +func (s *BasePartiQLParserListener) ExitWindowPartitionList(ctx *WindowPartitionListContext) {} + +// EnterWindowSortSpecList is called when production windowSortSpecList is entered. +func (s *BasePartiQLParserListener) EnterWindowSortSpecList(ctx *WindowSortSpecListContext) {} + +// ExitWindowSortSpecList is called when production windowSortSpecList is exited. +func (s *BasePartiQLParserListener) ExitWindowSortSpecList(ctx *WindowSortSpecListContext) {} + +// EnterHavingClause is called when production havingClause is entered. +func (s *BasePartiQLParserListener) EnterHavingClause(ctx *HavingClauseContext) {} + +// ExitHavingClause is called when production havingClause is exited. +func (s *BasePartiQLParserListener) ExitHavingClause(ctx *HavingClauseContext) {} + +// EnterFromClause is called when production fromClause is entered. +func (s *BasePartiQLParserListener) EnterFromClause(ctx *FromClauseContext) {} + +// ExitFromClause is called when production fromClause is exited. +func (s *BasePartiQLParserListener) ExitFromClause(ctx *FromClauseContext) {} + +// EnterWhereClauseSelect is called when production whereClauseSelect is entered. +func (s *BasePartiQLParserListener) EnterWhereClauseSelect(ctx *WhereClauseSelectContext) {} + +// ExitWhereClauseSelect is called when production whereClauseSelect is exited. +func (s *BasePartiQLParserListener) ExitWhereClauseSelect(ctx *WhereClauseSelectContext) {} + +// EnterOffsetByClause is called when production offsetByClause is entered. +func (s *BasePartiQLParserListener) EnterOffsetByClause(ctx *OffsetByClauseContext) {} + +// ExitOffsetByClause is called when production offsetByClause is exited. +func (s *BasePartiQLParserListener) ExitOffsetByClause(ctx *OffsetByClauseContext) {} + +// EnterLimitClause is called when production limitClause is entered. +func (s *BasePartiQLParserListener) EnterLimitClause(ctx *LimitClauseContext) {} + +// ExitLimitClause is called when production limitClause is exited. +func (s *BasePartiQLParserListener) ExitLimitClause(ctx *LimitClauseContext) {} + +// EnterGpmlPattern is called when production gpmlPattern is entered. +func (s *BasePartiQLParserListener) EnterGpmlPattern(ctx *GpmlPatternContext) {} + +// ExitGpmlPattern is called when production gpmlPattern is exited. +func (s *BasePartiQLParserListener) ExitGpmlPattern(ctx *GpmlPatternContext) {} + +// EnterGpmlPatternList is called when production gpmlPatternList is entered. +func (s *BasePartiQLParserListener) EnterGpmlPatternList(ctx *GpmlPatternListContext) {} + +// ExitGpmlPatternList is called when production gpmlPatternList is exited. +func (s *BasePartiQLParserListener) ExitGpmlPatternList(ctx *GpmlPatternListContext) {} + +// EnterMatchPattern is called when production matchPattern is entered. +func (s *BasePartiQLParserListener) EnterMatchPattern(ctx *MatchPatternContext) {} + +// ExitMatchPattern is called when production matchPattern is exited. +func (s *BasePartiQLParserListener) ExitMatchPattern(ctx *MatchPatternContext) {} + +// EnterGraphPart is called when production graphPart is entered. +func (s *BasePartiQLParserListener) EnterGraphPart(ctx *GraphPartContext) {} + +// ExitGraphPart is called when production graphPart is exited. +func (s *BasePartiQLParserListener) ExitGraphPart(ctx *GraphPartContext) {} + +// EnterSelectorBasic is called when production SelectorBasic is entered. +func (s *BasePartiQLParserListener) EnterSelectorBasic(ctx *SelectorBasicContext) {} + +// ExitSelectorBasic is called when production SelectorBasic is exited. +func (s *BasePartiQLParserListener) ExitSelectorBasic(ctx *SelectorBasicContext) {} + +// EnterSelectorAny is called when production SelectorAny is entered. +func (s *BasePartiQLParserListener) EnterSelectorAny(ctx *SelectorAnyContext) {} + +// ExitSelectorAny is called when production SelectorAny is exited. +func (s *BasePartiQLParserListener) ExitSelectorAny(ctx *SelectorAnyContext) {} + +// EnterSelectorShortest is called when production SelectorShortest is entered. +func (s *BasePartiQLParserListener) EnterSelectorShortest(ctx *SelectorShortestContext) {} + +// ExitSelectorShortest is called when production SelectorShortest is exited. +func (s *BasePartiQLParserListener) ExitSelectorShortest(ctx *SelectorShortestContext) {} + +// EnterPatternPathVariable is called when production patternPathVariable is entered. +func (s *BasePartiQLParserListener) EnterPatternPathVariable(ctx *PatternPathVariableContext) {} + +// ExitPatternPathVariable is called when production patternPathVariable is exited. +func (s *BasePartiQLParserListener) ExitPatternPathVariable(ctx *PatternPathVariableContext) {} + +// EnterPatternRestrictor is called when production patternRestrictor is entered. +func (s *BasePartiQLParserListener) EnterPatternRestrictor(ctx *PatternRestrictorContext) {} + +// ExitPatternRestrictor is called when production patternRestrictor is exited. +func (s *BasePartiQLParserListener) ExitPatternRestrictor(ctx *PatternRestrictorContext) {} + +// EnterNode is called when production node is entered. +func (s *BasePartiQLParserListener) EnterNode(ctx *NodeContext) {} + +// ExitNode is called when production node is exited. +func (s *BasePartiQLParserListener) ExitNode(ctx *NodeContext) {} + +// EnterEdgeWithSpec is called when production EdgeWithSpec is entered. +func (s *BasePartiQLParserListener) EnterEdgeWithSpec(ctx *EdgeWithSpecContext) {} + +// ExitEdgeWithSpec is called when production EdgeWithSpec is exited. +func (s *BasePartiQLParserListener) ExitEdgeWithSpec(ctx *EdgeWithSpecContext) {} + +// EnterEdgeAbbreviated is called when production EdgeAbbreviated is entered. +func (s *BasePartiQLParserListener) EnterEdgeAbbreviated(ctx *EdgeAbbreviatedContext) {} + +// ExitEdgeAbbreviated is called when production EdgeAbbreviated is exited. +func (s *BasePartiQLParserListener) ExitEdgeAbbreviated(ctx *EdgeAbbreviatedContext) {} + +// EnterPattern is called when production pattern is entered. +func (s *BasePartiQLParserListener) EnterPattern(ctx *PatternContext) {} + +// ExitPattern is called when production pattern is exited. +func (s *BasePartiQLParserListener) ExitPattern(ctx *PatternContext) {} + +// EnterPatternQuantifier is called when production patternQuantifier is entered. +func (s *BasePartiQLParserListener) EnterPatternQuantifier(ctx *PatternQuantifierContext) {} + +// ExitPatternQuantifier is called when production patternQuantifier is exited. +func (s *BasePartiQLParserListener) ExitPatternQuantifier(ctx *PatternQuantifierContext) {} + +// EnterEdgeSpecRight is called when production EdgeSpecRight is entered. +func (s *BasePartiQLParserListener) EnterEdgeSpecRight(ctx *EdgeSpecRightContext) {} + +// ExitEdgeSpecRight is called when production EdgeSpecRight is exited. +func (s *BasePartiQLParserListener) ExitEdgeSpecRight(ctx *EdgeSpecRightContext) {} + +// EnterEdgeSpecUndirected is called when production EdgeSpecUndirected is entered. +func (s *BasePartiQLParserListener) EnterEdgeSpecUndirected(ctx *EdgeSpecUndirectedContext) {} + +// ExitEdgeSpecUndirected is called when production EdgeSpecUndirected is exited. +func (s *BasePartiQLParserListener) ExitEdgeSpecUndirected(ctx *EdgeSpecUndirectedContext) {} + +// EnterEdgeSpecLeft is called when production EdgeSpecLeft is entered. +func (s *BasePartiQLParserListener) EnterEdgeSpecLeft(ctx *EdgeSpecLeftContext) {} + +// ExitEdgeSpecLeft is called when production EdgeSpecLeft is exited. +func (s *BasePartiQLParserListener) ExitEdgeSpecLeft(ctx *EdgeSpecLeftContext) {} + +// EnterEdgeSpecUndirectedRight is called when production EdgeSpecUndirectedRight is entered. +func (s *BasePartiQLParserListener) EnterEdgeSpecUndirectedRight(ctx *EdgeSpecUndirectedRightContext) { +} + +// ExitEdgeSpecUndirectedRight is called when production EdgeSpecUndirectedRight is exited. +func (s *BasePartiQLParserListener) ExitEdgeSpecUndirectedRight(ctx *EdgeSpecUndirectedRightContext) { +} + +// EnterEdgeSpecUndirectedLeft is called when production EdgeSpecUndirectedLeft is entered. +func (s *BasePartiQLParserListener) EnterEdgeSpecUndirectedLeft(ctx *EdgeSpecUndirectedLeftContext) {} + +// ExitEdgeSpecUndirectedLeft is called when production EdgeSpecUndirectedLeft is exited. +func (s *BasePartiQLParserListener) ExitEdgeSpecUndirectedLeft(ctx *EdgeSpecUndirectedLeftContext) {} + +// EnterEdgeSpecBidirectional is called when production EdgeSpecBidirectional is entered. +func (s *BasePartiQLParserListener) EnterEdgeSpecBidirectional(ctx *EdgeSpecBidirectionalContext) {} + +// ExitEdgeSpecBidirectional is called when production EdgeSpecBidirectional is exited. +func (s *BasePartiQLParserListener) ExitEdgeSpecBidirectional(ctx *EdgeSpecBidirectionalContext) {} + +// EnterEdgeSpecUndirectedBidirectional is called when production EdgeSpecUndirectedBidirectional is entered. +func (s *BasePartiQLParserListener) EnterEdgeSpecUndirectedBidirectional(ctx *EdgeSpecUndirectedBidirectionalContext) { +} + +// ExitEdgeSpecUndirectedBidirectional is called when production EdgeSpecUndirectedBidirectional is exited. +func (s *BasePartiQLParserListener) ExitEdgeSpecUndirectedBidirectional(ctx *EdgeSpecUndirectedBidirectionalContext) { +} + +// EnterEdgeSpec is called when production edgeSpec is entered. +func (s *BasePartiQLParserListener) EnterEdgeSpec(ctx *EdgeSpecContext) {} + +// ExitEdgeSpec is called when production edgeSpec is exited. +func (s *BasePartiQLParserListener) ExitEdgeSpec(ctx *EdgeSpecContext) {} + +// EnterPatternPartLabel is called when production patternPartLabel is entered. +func (s *BasePartiQLParserListener) EnterPatternPartLabel(ctx *PatternPartLabelContext) {} + +// ExitPatternPartLabel is called when production patternPartLabel is exited. +func (s *BasePartiQLParserListener) ExitPatternPartLabel(ctx *PatternPartLabelContext) {} + +// EnterEdgeAbbrev is called when production edgeAbbrev is entered. +func (s *BasePartiQLParserListener) EnterEdgeAbbrev(ctx *EdgeAbbrevContext) {} + +// ExitEdgeAbbrev is called when production edgeAbbrev is exited. +func (s *BasePartiQLParserListener) ExitEdgeAbbrev(ctx *EdgeAbbrevContext) {} + +// EnterTableWrapped is called when production TableWrapped is entered. +func (s *BasePartiQLParserListener) EnterTableWrapped(ctx *TableWrappedContext) {} + +// ExitTableWrapped is called when production TableWrapped is exited. +func (s *BasePartiQLParserListener) ExitTableWrapped(ctx *TableWrappedContext) {} + +// EnterTableCrossJoin is called when production TableCrossJoin is entered. +func (s *BasePartiQLParserListener) EnterTableCrossJoin(ctx *TableCrossJoinContext) {} + +// ExitTableCrossJoin is called when production TableCrossJoin is exited. +func (s *BasePartiQLParserListener) ExitTableCrossJoin(ctx *TableCrossJoinContext) {} + +// EnterTableQualifiedJoin is called when production TableQualifiedJoin is entered. +func (s *BasePartiQLParserListener) EnterTableQualifiedJoin(ctx *TableQualifiedJoinContext) {} + +// ExitTableQualifiedJoin is called when production TableQualifiedJoin is exited. +func (s *BasePartiQLParserListener) ExitTableQualifiedJoin(ctx *TableQualifiedJoinContext) {} + +// EnterTableRefBase is called when production TableRefBase is entered. +func (s *BasePartiQLParserListener) EnterTableRefBase(ctx *TableRefBaseContext) {} + +// ExitTableRefBase is called when production TableRefBase is exited. +func (s *BasePartiQLParserListener) ExitTableRefBase(ctx *TableRefBaseContext) {} + +// EnterTableNonJoin is called when production tableNonJoin is entered. +func (s *BasePartiQLParserListener) EnterTableNonJoin(ctx *TableNonJoinContext) {} + +// ExitTableNonJoin is called when production tableNonJoin is exited. +func (s *BasePartiQLParserListener) ExitTableNonJoin(ctx *TableNonJoinContext) {} + +// EnterTableBaseRefSymbol is called when production TableBaseRefSymbol is entered. +func (s *BasePartiQLParserListener) EnterTableBaseRefSymbol(ctx *TableBaseRefSymbolContext) {} + +// ExitTableBaseRefSymbol is called when production TableBaseRefSymbol is exited. +func (s *BasePartiQLParserListener) ExitTableBaseRefSymbol(ctx *TableBaseRefSymbolContext) {} + +// EnterTableBaseRefClauses is called when production TableBaseRefClauses is entered. +func (s *BasePartiQLParserListener) EnterTableBaseRefClauses(ctx *TableBaseRefClausesContext) {} + +// ExitTableBaseRefClauses is called when production TableBaseRefClauses is exited. +func (s *BasePartiQLParserListener) ExitTableBaseRefClauses(ctx *TableBaseRefClausesContext) {} + +// EnterTableBaseRefMatch is called when production TableBaseRefMatch is entered. +func (s *BasePartiQLParserListener) EnterTableBaseRefMatch(ctx *TableBaseRefMatchContext) {} + +// ExitTableBaseRefMatch is called when production TableBaseRefMatch is exited. +func (s *BasePartiQLParserListener) ExitTableBaseRefMatch(ctx *TableBaseRefMatchContext) {} + +// EnterTableUnpivot is called when production tableUnpivot is entered. +func (s *BasePartiQLParserListener) EnterTableUnpivot(ctx *TableUnpivotContext) {} + +// ExitTableUnpivot is called when production tableUnpivot is exited. +func (s *BasePartiQLParserListener) ExitTableUnpivot(ctx *TableUnpivotContext) {} + +// EnterJoinRhsBase is called when production JoinRhsBase is entered. +func (s *BasePartiQLParserListener) EnterJoinRhsBase(ctx *JoinRhsBaseContext) {} + +// ExitJoinRhsBase is called when production JoinRhsBase is exited. +func (s *BasePartiQLParserListener) ExitJoinRhsBase(ctx *JoinRhsBaseContext) {} + +// EnterJoinRhsTableJoined is called when production JoinRhsTableJoined is entered. +func (s *BasePartiQLParserListener) EnterJoinRhsTableJoined(ctx *JoinRhsTableJoinedContext) {} + +// ExitJoinRhsTableJoined is called when production JoinRhsTableJoined is exited. +func (s *BasePartiQLParserListener) ExitJoinRhsTableJoined(ctx *JoinRhsTableJoinedContext) {} + +// EnterJoinSpec is called when production joinSpec is entered. +func (s *BasePartiQLParserListener) EnterJoinSpec(ctx *JoinSpecContext) {} + +// ExitJoinSpec is called when production joinSpec is exited. +func (s *BasePartiQLParserListener) ExitJoinSpec(ctx *JoinSpecContext) {} + +// EnterJoinType is called when production joinType is entered. +func (s *BasePartiQLParserListener) EnterJoinType(ctx *JoinTypeContext) {} + +// ExitJoinType is called when production joinType is exited. +func (s *BasePartiQLParserListener) ExitJoinType(ctx *JoinTypeContext) {} + +// EnterExpr is called when production expr is entered. +func (s *BasePartiQLParserListener) EnterExpr(ctx *ExprContext) {} + +// ExitExpr is called when production expr is exited. +func (s *BasePartiQLParserListener) ExitExpr(ctx *ExprContext) {} + +// EnterIntersect is called when production Intersect is entered. +func (s *BasePartiQLParserListener) EnterIntersect(ctx *IntersectContext) {} + +// ExitIntersect is called when production Intersect is exited. +func (s *BasePartiQLParserListener) ExitIntersect(ctx *IntersectContext) {} + +// EnterQueryBase is called when production QueryBase is entered. +func (s *BasePartiQLParserListener) EnterQueryBase(ctx *QueryBaseContext) {} + +// ExitQueryBase is called when production QueryBase is exited. +func (s *BasePartiQLParserListener) ExitQueryBase(ctx *QueryBaseContext) {} + +// EnterExcept is called when production Except is entered. +func (s *BasePartiQLParserListener) EnterExcept(ctx *ExceptContext) {} + +// ExitExcept is called when production Except is exited. +func (s *BasePartiQLParserListener) ExitExcept(ctx *ExceptContext) {} + +// EnterUnion is called when production Union is entered. +func (s *BasePartiQLParserListener) EnterUnion(ctx *UnionContext) {} + +// ExitUnion is called when production Union is exited. +func (s *BasePartiQLParserListener) ExitUnion(ctx *UnionContext) {} + +// EnterSfwQuery is called when production SfwQuery is entered. +func (s *BasePartiQLParserListener) EnterSfwQuery(ctx *SfwQueryContext) {} + +// ExitSfwQuery is called when production SfwQuery is exited. +func (s *BasePartiQLParserListener) ExitSfwQuery(ctx *SfwQueryContext) {} + +// EnterSfwBase is called when production SfwBase is entered. +func (s *BasePartiQLParserListener) EnterSfwBase(ctx *SfwBaseContext) {} + +// ExitSfwBase is called when production SfwBase is exited. +func (s *BasePartiQLParserListener) ExitSfwBase(ctx *SfwBaseContext) {} + +// EnterOr is called when production Or is entered. +func (s *BasePartiQLParserListener) EnterOr(ctx *OrContext) {} + +// ExitOr is called when production Or is exited. +func (s *BasePartiQLParserListener) ExitOr(ctx *OrContext) {} + +// EnterExprOrBase is called when production ExprOrBase is entered. +func (s *BasePartiQLParserListener) EnterExprOrBase(ctx *ExprOrBaseContext) {} + +// ExitExprOrBase is called when production ExprOrBase is exited. +func (s *BasePartiQLParserListener) ExitExprOrBase(ctx *ExprOrBaseContext) {} + +// EnterExprAndBase is called when production ExprAndBase is entered. +func (s *BasePartiQLParserListener) EnterExprAndBase(ctx *ExprAndBaseContext) {} + +// ExitExprAndBase is called when production ExprAndBase is exited. +func (s *BasePartiQLParserListener) ExitExprAndBase(ctx *ExprAndBaseContext) {} + +// EnterAnd is called when production And is entered. +func (s *BasePartiQLParserListener) EnterAnd(ctx *AndContext) {} + +// ExitAnd is called when production And is exited. +func (s *BasePartiQLParserListener) ExitAnd(ctx *AndContext) {} + +// EnterNot is called when production Not is entered. +func (s *BasePartiQLParserListener) EnterNot(ctx *NotContext) {} + +// ExitNot is called when production Not is exited. +func (s *BasePartiQLParserListener) ExitNot(ctx *NotContext) {} + +// EnterExprNotBase is called when production ExprNotBase is entered. +func (s *BasePartiQLParserListener) EnterExprNotBase(ctx *ExprNotBaseContext) {} + +// ExitExprNotBase is called when production ExprNotBase is exited. +func (s *BasePartiQLParserListener) ExitExprNotBase(ctx *ExprNotBaseContext) {} + +// EnterPredicateIn is called when production PredicateIn is entered. +func (s *BasePartiQLParserListener) EnterPredicateIn(ctx *PredicateInContext) {} + +// ExitPredicateIn is called when production PredicateIn is exited. +func (s *BasePartiQLParserListener) ExitPredicateIn(ctx *PredicateInContext) {} + +// EnterPredicateBetween is called when production PredicateBetween is entered. +func (s *BasePartiQLParserListener) EnterPredicateBetween(ctx *PredicateBetweenContext) {} + +// ExitPredicateBetween is called when production PredicateBetween is exited. +func (s *BasePartiQLParserListener) ExitPredicateBetween(ctx *PredicateBetweenContext) {} + +// EnterPredicateBase is called when production PredicateBase is entered. +func (s *BasePartiQLParserListener) EnterPredicateBase(ctx *PredicateBaseContext) {} + +// ExitPredicateBase is called when production PredicateBase is exited. +func (s *BasePartiQLParserListener) ExitPredicateBase(ctx *PredicateBaseContext) {} + +// EnterPredicateComparison is called when production PredicateComparison is entered. +func (s *BasePartiQLParserListener) EnterPredicateComparison(ctx *PredicateComparisonContext) {} + +// ExitPredicateComparison is called when production PredicateComparison is exited. +func (s *BasePartiQLParserListener) ExitPredicateComparison(ctx *PredicateComparisonContext) {} + +// EnterPredicateIs is called when production PredicateIs is entered. +func (s *BasePartiQLParserListener) EnterPredicateIs(ctx *PredicateIsContext) {} + +// ExitPredicateIs is called when production PredicateIs is exited. +func (s *BasePartiQLParserListener) ExitPredicateIs(ctx *PredicateIsContext) {} + +// EnterPredicateLike is called when production PredicateLike is entered. +func (s *BasePartiQLParserListener) EnterPredicateLike(ctx *PredicateLikeContext) {} + +// ExitPredicateLike is called when production PredicateLike is exited. +func (s *BasePartiQLParserListener) ExitPredicateLike(ctx *PredicateLikeContext) {} + +// EnterMathOp00 is called when production mathOp00 is entered. +func (s *BasePartiQLParserListener) EnterMathOp00(ctx *MathOp00Context) {} + +// ExitMathOp00 is called when production mathOp00 is exited. +func (s *BasePartiQLParserListener) ExitMathOp00(ctx *MathOp00Context) {} + +// EnterMathOp01 is called when production mathOp01 is entered. +func (s *BasePartiQLParserListener) EnterMathOp01(ctx *MathOp01Context) {} + +// ExitMathOp01 is called when production mathOp01 is exited. +func (s *BasePartiQLParserListener) ExitMathOp01(ctx *MathOp01Context) {} + +// EnterMathOp02 is called when production mathOp02 is entered. +func (s *BasePartiQLParserListener) EnterMathOp02(ctx *MathOp02Context) {} + +// ExitMathOp02 is called when production mathOp02 is exited. +func (s *BasePartiQLParserListener) ExitMathOp02(ctx *MathOp02Context) {} + +// EnterValueExpr is called when production valueExpr is entered. +func (s *BasePartiQLParserListener) EnterValueExpr(ctx *ValueExprContext) {} + +// ExitValueExpr is called when production valueExpr is exited. +func (s *BasePartiQLParserListener) ExitValueExpr(ctx *ValueExprContext) {} + +// EnterExprPrimaryPath is called when production ExprPrimaryPath is entered. +func (s *BasePartiQLParserListener) EnterExprPrimaryPath(ctx *ExprPrimaryPathContext) {} + +// ExitExprPrimaryPath is called when production ExprPrimaryPath is exited. +func (s *BasePartiQLParserListener) ExitExprPrimaryPath(ctx *ExprPrimaryPathContext) {} + +// EnterExprPrimaryBase is called when production ExprPrimaryBase is entered. +func (s *BasePartiQLParserListener) EnterExprPrimaryBase(ctx *ExprPrimaryBaseContext) {} + +// ExitExprPrimaryBase is called when production ExprPrimaryBase is exited. +func (s *BasePartiQLParserListener) ExitExprPrimaryBase(ctx *ExprPrimaryBaseContext) {} + +// EnterExprTermWrappedQuery is called when production ExprTermWrappedQuery is entered. +func (s *BasePartiQLParserListener) EnterExprTermWrappedQuery(ctx *ExprTermWrappedQueryContext) {} + +// ExitExprTermWrappedQuery is called when production ExprTermWrappedQuery is exited. +func (s *BasePartiQLParserListener) ExitExprTermWrappedQuery(ctx *ExprTermWrappedQueryContext) {} + +// EnterExprTermBase is called when production ExprTermBase is entered. +func (s *BasePartiQLParserListener) EnterExprTermBase(ctx *ExprTermBaseContext) {} + +// ExitExprTermBase is called when production ExprTermBase is exited. +func (s *BasePartiQLParserListener) ExitExprTermBase(ctx *ExprTermBaseContext) {} + +// EnterNullIf is called when production nullIf is entered. +func (s *BasePartiQLParserListener) EnterNullIf(ctx *NullIfContext) {} + +// ExitNullIf is called when production nullIf is exited. +func (s *BasePartiQLParserListener) ExitNullIf(ctx *NullIfContext) {} + +// EnterCoalesce is called when production coalesce is entered. +func (s *BasePartiQLParserListener) EnterCoalesce(ctx *CoalesceContext) {} + +// ExitCoalesce is called when production coalesce is exited. +func (s *BasePartiQLParserListener) ExitCoalesce(ctx *CoalesceContext) {} + +// EnterCaseExpr is called when production caseExpr is entered. +func (s *BasePartiQLParserListener) EnterCaseExpr(ctx *CaseExprContext) {} + +// ExitCaseExpr is called when production caseExpr is exited. +func (s *BasePartiQLParserListener) ExitCaseExpr(ctx *CaseExprContext) {} + +// EnterValues is called when production values is entered. +func (s *BasePartiQLParserListener) EnterValues(ctx *ValuesContext) {} + +// ExitValues is called when production values is exited. +func (s *BasePartiQLParserListener) ExitValues(ctx *ValuesContext) {} + +// EnterValueRow is called when production valueRow is entered. +func (s *BasePartiQLParserListener) EnterValueRow(ctx *ValueRowContext) {} + +// ExitValueRow is called when production valueRow is exited. +func (s *BasePartiQLParserListener) ExitValueRow(ctx *ValueRowContext) {} + +// EnterValueList is called when production valueList is entered. +func (s *BasePartiQLParserListener) EnterValueList(ctx *ValueListContext) {} + +// ExitValueList is called when production valueList is exited. +func (s *BasePartiQLParserListener) ExitValueList(ctx *ValueListContext) {} + +// EnterSequenceConstructor is called when production sequenceConstructor is entered. +func (s *BasePartiQLParserListener) EnterSequenceConstructor(ctx *SequenceConstructorContext) {} + +// ExitSequenceConstructor is called when production sequenceConstructor is exited. +func (s *BasePartiQLParserListener) ExitSequenceConstructor(ctx *SequenceConstructorContext) {} + +// EnterSubstring is called when production substring is entered. +func (s *BasePartiQLParserListener) EnterSubstring(ctx *SubstringContext) {} + +// ExitSubstring is called when production substring is exited. +func (s *BasePartiQLParserListener) ExitSubstring(ctx *SubstringContext) {} + +// EnterCountAll is called when production CountAll is entered. +func (s *BasePartiQLParserListener) EnterCountAll(ctx *CountAllContext) {} + +// ExitCountAll is called when production CountAll is exited. +func (s *BasePartiQLParserListener) ExitCountAll(ctx *CountAllContext) {} + +// EnterAggregateBase is called when production AggregateBase is entered. +func (s *BasePartiQLParserListener) EnterAggregateBase(ctx *AggregateBaseContext) {} + +// ExitAggregateBase is called when production AggregateBase is exited. +func (s *BasePartiQLParserListener) ExitAggregateBase(ctx *AggregateBaseContext) {} + +// EnterLagLeadFunction is called when production LagLeadFunction is entered. +func (s *BasePartiQLParserListener) EnterLagLeadFunction(ctx *LagLeadFunctionContext) {} + +// ExitLagLeadFunction is called when production LagLeadFunction is exited. +func (s *BasePartiQLParserListener) ExitLagLeadFunction(ctx *LagLeadFunctionContext) {} + +// EnterCast is called when production cast is entered. +func (s *BasePartiQLParserListener) EnterCast(ctx *CastContext) {} + +// ExitCast is called when production cast is exited. +func (s *BasePartiQLParserListener) ExitCast(ctx *CastContext) {} + +// EnterCanLosslessCast is called when production canLosslessCast is entered. +func (s *BasePartiQLParserListener) EnterCanLosslessCast(ctx *CanLosslessCastContext) {} + +// ExitCanLosslessCast is called when production canLosslessCast is exited. +func (s *BasePartiQLParserListener) ExitCanLosslessCast(ctx *CanLosslessCastContext) {} + +// EnterCanCast is called when production canCast is entered. +func (s *BasePartiQLParserListener) EnterCanCast(ctx *CanCastContext) {} + +// ExitCanCast is called when production canCast is exited. +func (s *BasePartiQLParserListener) ExitCanCast(ctx *CanCastContext) {} + +// EnterExtract is called when production extract is entered. +func (s *BasePartiQLParserListener) EnterExtract(ctx *ExtractContext) {} + +// ExitExtract is called when production extract is exited. +func (s *BasePartiQLParserListener) ExitExtract(ctx *ExtractContext) {} + +// EnterTrimFunction is called when production trimFunction is entered. +func (s *BasePartiQLParserListener) EnterTrimFunction(ctx *TrimFunctionContext) {} + +// ExitTrimFunction is called when production trimFunction is exited. +func (s *BasePartiQLParserListener) ExitTrimFunction(ctx *TrimFunctionContext) {} + +// EnterDateFunction is called when production dateFunction is entered. +func (s *BasePartiQLParserListener) EnterDateFunction(ctx *DateFunctionContext) {} + +// ExitDateFunction is called when production dateFunction is exited. +func (s *BasePartiQLParserListener) ExitDateFunction(ctx *DateFunctionContext) {} + +// EnterFunctionCallReserved is called when production FunctionCallReserved is entered. +func (s *BasePartiQLParserListener) EnterFunctionCallReserved(ctx *FunctionCallReservedContext) {} + +// ExitFunctionCallReserved is called when production FunctionCallReserved is exited. +func (s *BasePartiQLParserListener) ExitFunctionCallReserved(ctx *FunctionCallReservedContext) {} + +// EnterFunctionCallIdent is called when production FunctionCallIdent is entered. +func (s *BasePartiQLParserListener) EnterFunctionCallIdent(ctx *FunctionCallIdentContext) {} + +// ExitFunctionCallIdent is called when production FunctionCallIdent is exited. +func (s *BasePartiQLParserListener) ExitFunctionCallIdent(ctx *FunctionCallIdentContext) {} + +// EnterPathStepIndexExpr is called when production PathStepIndexExpr is entered. +func (s *BasePartiQLParserListener) EnterPathStepIndexExpr(ctx *PathStepIndexExprContext) {} + +// ExitPathStepIndexExpr is called when production PathStepIndexExpr is exited. +func (s *BasePartiQLParserListener) ExitPathStepIndexExpr(ctx *PathStepIndexExprContext) {} + +// EnterPathStepIndexAll is called when production PathStepIndexAll is entered. +func (s *BasePartiQLParserListener) EnterPathStepIndexAll(ctx *PathStepIndexAllContext) {} + +// ExitPathStepIndexAll is called when production PathStepIndexAll is exited. +func (s *BasePartiQLParserListener) ExitPathStepIndexAll(ctx *PathStepIndexAllContext) {} + +// EnterPathStepDotExpr is called when production PathStepDotExpr is entered. +func (s *BasePartiQLParserListener) EnterPathStepDotExpr(ctx *PathStepDotExprContext) {} + +// ExitPathStepDotExpr is called when production PathStepDotExpr is exited. +func (s *BasePartiQLParserListener) ExitPathStepDotExpr(ctx *PathStepDotExprContext) {} + +// EnterPathStepDotAll is called when production PathStepDotAll is entered. +func (s *BasePartiQLParserListener) EnterPathStepDotAll(ctx *PathStepDotAllContext) {} + +// ExitPathStepDotAll is called when production PathStepDotAll is exited. +func (s *BasePartiQLParserListener) ExitPathStepDotAll(ctx *PathStepDotAllContext) {} + +// EnterExprGraphMatchMany is called when production exprGraphMatchMany is entered. +func (s *BasePartiQLParserListener) EnterExprGraphMatchMany(ctx *ExprGraphMatchManyContext) {} + +// ExitExprGraphMatchMany is called when production exprGraphMatchMany is exited. +func (s *BasePartiQLParserListener) ExitExprGraphMatchMany(ctx *ExprGraphMatchManyContext) {} + +// EnterExprGraphMatchOne is called when production exprGraphMatchOne is entered. +func (s *BasePartiQLParserListener) EnterExprGraphMatchOne(ctx *ExprGraphMatchOneContext) {} + +// ExitExprGraphMatchOne is called when production exprGraphMatchOne is exited. +func (s *BasePartiQLParserListener) ExitExprGraphMatchOne(ctx *ExprGraphMatchOneContext) {} + +// EnterParameter is called when production parameter is entered. +func (s *BasePartiQLParserListener) EnterParameter(ctx *ParameterContext) {} + +// ExitParameter is called when production parameter is exited. +func (s *BasePartiQLParserListener) ExitParameter(ctx *ParameterContext) {} + +// EnterVarRefExpr is called when production varRefExpr is entered. +func (s *BasePartiQLParserListener) EnterVarRefExpr(ctx *VarRefExprContext) {} + +// ExitVarRefExpr is called when production varRefExpr is exited. +func (s *BasePartiQLParserListener) ExitVarRefExpr(ctx *VarRefExprContext) {} + +// EnterCollection is called when production collection is entered. +func (s *BasePartiQLParserListener) EnterCollection(ctx *CollectionContext) {} + +// ExitCollection is called when production collection is exited. +func (s *BasePartiQLParserListener) ExitCollection(ctx *CollectionContext) {} + +// EnterArray is called when production array is entered. +func (s *BasePartiQLParserListener) EnterArray(ctx *ArrayContext) {} + +// ExitArray is called when production array is exited. +func (s *BasePartiQLParserListener) ExitArray(ctx *ArrayContext) {} + +// EnterBag is called when production bag is entered. +func (s *BasePartiQLParserListener) EnterBag(ctx *BagContext) {} + +// ExitBag is called when production bag is exited. +func (s *BasePartiQLParserListener) ExitBag(ctx *BagContext) {} + +// EnterTuple is called when production tuple is entered. +func (s *BasePartiQLParserListener) EnterTuple(ctx *TupleContext) {} + +// ExitTuple is called when production tuple is exited. +func (s *BasePartiQLParserListener) ExitTuple(ctx *TupleContext) {} + +// EnterPair is called when production pair is entered. +func (s *BasePartiQLParserListener) EnterPair(ctx *PairContext) {} + +// ExitPair is called when production pair is exited. +func (s *BasePartiQLParserListener) ExitPair(ctx *PairContext) {} + +// EnterLiteralNull is called when production LiteralNull is entered. +func (s *BasePartiQLParserListener) EnterLiteralNull(ctx *LiteralNullContext) {} + +// ExitLiteralNull is called when production LiteralNull is exited. +func (s *BasePartiQLParserListener) ExitLiteralNull(ctx *LiteralNullContext) {} + +// EnterLiteralMissing is called when production LiteralMissing is entered. +func (s *BasePartiQLParserListener) EnterLiteralMissing(ctx *LiteralMissingContext) {} + +// ExitLiteralMissing is called when production LiteralMissing is exited. +func (s *BasePartiQLParserListener) ExitLiteralMissing(ctx *LiteralMissingContext) {} + +// EnterLiteralTrue is called when production LiteralTrue is entered. +func (s *BasePartiQLParserListener) EnterLiteralTrue(ctx *LiteralTrueContext) {} + +// ExitLiteralTrue is called when production LiteralTrue is exited. +func (s *BasePartiQLParserListener) ExitLiteralTrue(ctx *LiteralTrueContext) {} + +// EnterLiteralFalse is called when production LiteralFalse is entered. +func (s *BasePartiQLParserListener) EnterLiteralFalse(ctx *LiteralFalseContext) {} + +// ExitLiteralFalse is called when production LiteralFalse is exited. +func (s *BasePartiQLParserListener) ExitLiteralFalse(ctx *LiteralFalseContext) {} + +// EnterLiteralString is called when production LiteralString is entered. +func (s *BasePartiQLParserListener) EnterLiteralString(ctx *LiteralStringContext) {} + +// ExitLiteralString is called when production LiteralString is exited. +func (s *BasePartiQLParserListener) ExitLiteralString(ctx *LiteralStringContext) {} + +// EnterLiteralInteger is called when production LiteralInteger is entered. +func (s *BasePartiQLParserListener) EnterLiteralInteger(ctx *LiteralIntegerContext) {} + +// ExitLiteralInteger is called when production LiteralInteger is exited. +func (s *BasePartiQLParserListener) ExitLiteralInteger(ctx *LiteralIntegerContext) {} + +// EnterLiteralDecimal is called when production LiteralDecimal is entered. +func (s *BasePartiQLParserListener) EnterLiteralDecimal(ctx *LiteralDecimalContext) {} + +// ExitLiteralDecimal is called when production LiteralDecimal is exited. +func (s *BasePartiQLParserListener) ExitLiteralDecimal(ctx *LiteralDecimalContext) {} + +// EnterLiteralIon is called when production LiteralIon is entered. +func (s *BasePartiQLParserListener) EnterLiteralIon(ctx *LiteralIonContext) {} + +// ExitLiteralIon is called when production LiteralIon is exited. +func (s *BasePartiQLParserListener) ExitLiteralIon(ctx *LiteralIonContext) {} + +// EnterLiteralDate is called when production LiteralDate is entered. +func (s *BasePartiQLParserListener) EnterLiteralDate(ctx *LiteralDateContext) {} + +// ExitLiteralDate is called when production LiteralDate is exited. +func (s *BasePartiQLParserListener) ExitLiteralDate(ctx *LiteralDateContext) {} + +// EnterLiteralTime is called when production LiteralTime is entered. +func (s *BasePartiQLParserListener) EnterLiteralTime(ctx *LiteralTimeContext) {} + +// ExitLiteralTime is called when production LiteralTime is exited. +func (s *BasePartiQLParserListener) ExitLiteralTime(ctx *LiteralTimeContext) {} + +// EnterTypeAtomic is called when production TypeAtomic is entered. +func (s *BasePartiQLParserListener) EnterTypeAtomic(ctx *TypeAtomicContext) {} + +// ExitTypeAtomic is called when production TypeAtomic is exited. +func (s *BasePartiQLParserListener) ExitTypeAtomic(ctx *TypeAtomicContext) {} + +// EnterTypeArgSingle is called when production TypeArgSingle is entered. +func (s *BasePartiQLParserListener) EnterTypeArgSingle(ctx *TypeArgSingleContext) {} + +// ExitTypeArgSingle is called when production TypeArgSingle is exited. +func (s *BasePartiQLParserListener) ExitTypeArgSingle(ctx *TypeArgSingleContext) {} + +// EnterTypeVarChar is called when production TypeVarChar is entered. +func (s *BasePartiQLParserListener) EnterTypeVarChar(ctx *TypeVarCharContext) {} + +// ExitTypeVarChar is called when production TypeVarChar is exited. +func (s *BasePartiQLParserListener) ExitTypeVarChar(ctx *TypeVarCharContext) {} + +// EnterTypeArgDouble is called when production TypeArgDouble is entered. +func (s *BasePartiQLParserListener) EnterTypeArgDouble(ctx *TypeArgDoubleContext) {} + +// ExitTypeArgDouble is called when production TypeArgDouble is exited. +func (s *BasePartiQLParserListener) ExitTypeArgDouble(ctx *TypeArgDoubleContext) {} + +// EnterTypeTimeZone is called when production TypeTimeZone is entered. +func (s *BasePartiQLParserListener) EnterTypeTimeZone(ctx *TypeTimeZoneContext) {} + +// ExitTypeTimeZone is called when production TypeTimeZone is exited. +func (s *BasePartiQLParserListener) ExitTypeTimeZone(ctx *TypeTimeZoneContext) {} + +// EnterTypeCustom is called when production TypeCustom is entered. +func (s *BasePartiQLParserListener) EnterTypeCustom(ctx *TypeCustomContext) {} + +// ExitTypeCustom is called when production TypeCustom is exited. +func (s *BasePartiQLParserListener) ExitTypeCustom(ctx *TypeCustomContext) {} diff --git a/partiql/partiqlparser_base_visitor.go b/partiql/partiqlparser_base_visitor.go new file mode 100644 index 0000000..f242685 --- /dev/null +++ b/partiql/partiqlparser_base_visitor.go @@ -0,0 +1,740 @@ +// Code generated from PartiQLParser.g4 by ANTLR 4.13.2. DO NOT EDIT. + +package partiql // PartiQLParser +import "github.com/antlr4-go/antlr/v4" + +type BasePartiQLParserVisitor struct { + *antlr.BaseParseTreeVisitor +} + +func (v *BasePartiQLParserVisitor) VisitScript(ctx *ScriptContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitRoot(ctx *RootContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitQueryDql(ctx *QueryDqlContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitQueryDml(ctx *QueryDmlContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitQueryDdl(ctx *QueryDdlContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitQueryExec(ctx *QueryExecContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExplainOption(ctx *ExplainOptionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitAsIdent(ctx *AsIdentContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitAtIdent(ctx *AtIdentContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitByIdent(ctx *ByIdentContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSymbolPrimitive(ctx *SymbolPrimitiveContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDql(ctx *DqlContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExecCommand(ctx *ExecCommandContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDdl(ctx *DdlContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitCreateTable(ctx *CreateTableContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitCreateIndex(ctx *CreateIndexContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDropTable(ctx *DropTableContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDropIndex(ctx *DropIndexContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDmlBaseWrapper(ctx *DmlBaseWrapperContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDmlDelete(ctx *DmlDeleteContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDmlInsertReturning(ctx *DmlInsertReturningContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDmlBase(ctx *DmlBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDmlBaseCommand(ctx *DmlBaseCommandContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPathSimple(ctx *PathSimpleContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPathSimpleLiteral(ctx *PathSimpleLiteralContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPathSimpleSymbol(ctx *PathSimpleSymbolContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPathSimpleDotSymbol(ctx *PathSimpleDotSymbolContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitReplaceCommand(ctx *ReplaceCommandContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitUpsertCommand(ctx *UpsertCommandContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitRemoveCommand(ctx *RemoveCommandContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitInsertCommandReturning(ctx *InsertCommandReturningContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitInsertLegacy(ctx *InsertLegacyContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitInsert(ctx *InsertContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitOnConflictLegacy(ctx *OnConflictLegacyContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitOnConflict(ctx *OnConflictContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitConflictTarget(ctx *ConflictTargetContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitConstraintName(ctx *ConstraintNameContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitConflictAction(ctx *ConflictActionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDoReplace(ctx *DoReplaceContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDoUpdate(ctx *DoUpdateContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitUpdateClause(ctx *UpdateClauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSetCommand(ctx *SetCommandContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSetAssignment(ctx *SetAssignmentContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDeleteCommand(ctx *DeleteCommandContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitReturningClause(ctx *ReturningClauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitReturningColumn(ctx *ReturningColumnContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitFromClauseSimpleExplicit(ctx *FromClauseSimpleExplicitContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitFromClauseSimpleImplicit(ctx *FromClauseSimpleImplicitContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitWhereClause(ctx *WhereClauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSelectAll(ctx *SelectAllContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSelectItems(ctx *SelectItemsContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSelectValue(ctx *SelectValueContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSelectPivot(ctx *SelectPivotContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitProjectionItems(ctx *ProjectionItemsContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitProjectionItem(ctx *ProjectionItemContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSetQuantifierStrategy(ctx *SetQuantifierStrategyContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLetClause(ctx *LetClauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLetBinding(ctx *LetBindingContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitOrderByClause(ctx *OrderByClauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitOrderSortSpec(ctx *OrderSortSpecContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitGroupClause(ctx *GroupClauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitGroupAlias(ctx *GroupAliasContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitGroupKey(ctx *GroupKeyContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitOver(ctx *OverContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitWindowPartitionList(ctx *WindowPartitionListContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitWindowSortSpecList(ctx *WindowSortSpecListContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitHavingClause(ctx *HavingClauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitFromClause(ctx *FromClauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitWhereClauseSelect(ctx *WhereClauseSelectContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitOffsetByClause(ctx *OffsetByClauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLimitClause(ctx *LimitClauseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitGpmlPattern(ctx *GpmlPatternContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitGpmlPatternList(ctx *GpmlPatternListContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitMatchPattern(ctx *MatchPatternContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitGraphPart(ctx *GraphPartContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSelectorBasic(ctx *SelectorBasicContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSelectorAny(ctx *SelectorAnyContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSelectorShortest(ctx *SelectorShortestContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPatternPathVariable(ctx *PatternPathVariableContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPatternRestrictor(ctx *PatternRestrictorContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitNode(ctx *NodeContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeWithSpec(ctx *EdgeWithSpecContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeAbbreviated(ctx *EdgeAbbreviatedContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPattern(ctx *PatternContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPatternQuantifier(ctx *PatternQuantifierContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeSpecRight(ctx *EdgeSpecRightContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeSpecUndirected(ctx *EdgeSpecUndirectedContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeSpecLeft(ctx *EdgeSpecLeftContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeSpecUndirectedRight(ctx *EdgeSpecUndirectedRightContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeSpecUndirectedLeft(ctx *EdgeSpecUndirectedLeftContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeSpecBidirectional(ctx *EdgeSpecBidirectionalContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeSpecUndirectedBidirectional(ctx *EdgeSpecUndirectedBidirectionalContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeSpec(ctx *EdgeSpecContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPatternPartLabel(ctx *PatternPartLabelContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitEdgeAbbrev(ctx *EdgeAbbrevContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTableWrapped(ctx *TableWrappedContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTableCrossJoin(ctx *TableCrossJoinContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTableQualifiedJoin(ctx *TableQualifiedJoinContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTableRefBase(ctx *TableRefBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTableNonJoin(ctx *TableNonJoinContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTableBaseRefSymbol(ctx *TableBaseRefSymbolContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTableBaseRefClauses(ctx *TableBaseRefClausesContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTableBaseRefMatch(ctx *TableBaseRefMatchContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTableUnpivot(ctx *TableUnpivotContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitJoinRhsBase(ctx *JoinRhsBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitJoinRhsTableJoined(ctx *JoinRhsTableJoinedContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitJoinSpec(ctx *JoinSpecContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitJoinType(ctx *JoinTypeContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExpr(ctx *ExprContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitIntersect(ctx *IntersectContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitQueryBase(ctx *QueryBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExcept(ctx *ExceptContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitUnion(ctx *UnionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSfwQuery(ctx *SfwQueryContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSfwBase(ctx *SfwBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitOr(ctx *OrContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExprOrBase(ctx *ExprOrBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExprAndBase(ctx *ExprAndBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitAnd(ctx *AndContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitNot(ctx *NotContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExprNotBase(ctx *ExprNotBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPredicateIn(ctx *PredicateInContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPredicateBetween(ctx *PredicateBetweenContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPredicateBase(ctx *PredicateBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPredicateComparison(ctx *PredicateComparisonContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPredicateIs(ctx *PredicateIsContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPredicateLike(ctx *PredicateLikeContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitMathOp00(ctx *MathOp00Context) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitMathOp01(ctx *MathOp01Context) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitMathOp02(ctx *MathOp02Context) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitValueExpr(ctx *ValueExprContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExprPrimaryPath(ctx *ExprPrimaryPathContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExprPrimaryBase(ctx *ExprPrimaryBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExprTermWrappedQuery(ctx *ExprTermWrappedQueryContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExprTermBase(ctx *ExprTermBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitNullIf(ctx *NullIfContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitCoalesce(ctx *CoalesceContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitCaseExpr(ctx *CaseExprContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitValues(ctx *ValuesContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitValueRow(ctx *ValueRowContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitValueList(ctx *ValueListContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSequenceConstructor(ctx *SequenceConstructorContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitSubstring(ctx *SubstringContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitCountAll(ctx *CountAllContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitAggregateBase(ctx *AggregateBaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLagLeadFunction(ctx *LagLeadFunctionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitCast(ctx *CastContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitCanLosslessCast(ctx *CanLosslessCastContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitCanCast(ctx *CanCastContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExtract(ctx *ExtractContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTrimFunction(ctx *TrimFunctionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitDateFunction(ctx *DateFunctionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitFunctionCallReserved(ctx *FunctionCallReservedContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitFunctionCallIdent(ctx *FunctionCallIdentContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPathStepIndexExpr(ctx *PathStepIndexExprContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPathStepIndexAll(ctx *PathStepIndexAllContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPathStepDotExpr(ctx *PathStepDotExprContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPathStepDotAll(ctx *PathStepDotAllContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExprGraphMatchMany(ctx *ExprGraphMatchManyContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitExprGraphMatchOne(ctx *ExprGraphMatchOneContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitParameter(ctx *ParameterContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitVarRefExpr(ctx *VarRefExprContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitCollection(ctx *CollectionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitArray(ctx *ArrayContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitBag(ctx *BagContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTuple(ctx *TupleContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitPair(ctx *PairContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLiteralNull(ctx *LiteralNullContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLiteralMissing(ctx *LiteralMissingContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLiteralTrue(ctx *LiteralTrueContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLiteralFalse(ctx *LiteralFalseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLiteralString(ctx *LiteralStringContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLiteralInteger(ctx *LiteralIntegerContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLiteralDecimal(ctx *LiteralDecimalContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLiteralIon(ctx *LiteralIonContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLiteralDate(ctx *LiteralDateContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitLiteralTime(ctx *LiteralTimeContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTypeAtomic(ctx *TypeAtomicContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTypeArgSingle(ctx *TypeArgSingleContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTypeVarChar(ctx *TypeVarCharContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTypeArgDouble(ctx *TypeArgDoubleContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTypeTimeZone(ctx *TypeTimeZoneContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BasePartiQLParserVisitor) VisitTypeCustom(ctx *TypeCustomContext) interface{} { + return v.VisitChildren(ctx) +} diff --git a/partiql/partiqlparser_listener.go b/partiql/partiqlparser_listener.go new file mode 100644 index 0000000..0dfcc0b --- /dev/null +++ b/partiql/partiqlparser_listener.go @@ -0,0 +1,1107 @@ +// Code generated from PartiQLParser.g4 by ANTLR 4.13.2. DO NOT EDIT. + +package partiql // PartiQLParser +import "github.com/antlr4-go/antlr/v4" + +// PartiQLParserListener is a complete listener for a parse tree produced by PartiQLParserParser. +type PartiQLParserListener interface { + antlr.ParseTreeListener + + // EnterScript is called when entering the script production. + EnterScript(c *ScriptContext) + + // EnterRoot is called when entering the root production. + EnterRoot(c *RootContext) + + // EnterQueryDql is called when entering the QueryDql production. + EnterQueryDql(c *QueryDqlContext) + + // EnterQueryDml is called when entering the QueryDml production. + EnterQueryDml(c *QueryDmlContext) + + // EnterQueryDdl is called when entering the QueryDdl production. + EnterQueryDdl(c *QueryDdlContext) + + // EnterQueryExec is called when entering the QueryExec production. + EnterQueryExec(c *QueryExecContext) + + // EnterExplainOption is called when entering the explainOption production. + EnterExplainOption(c *ExplainOptionContext) + + // EnterAsIdent is called when entering the asIdent production. + EnterAsIdent(c *AsIdentContext) + + // EnterAtIdent is called when entering the atIdent production. + EnterAtIdent(c *AtIdentContext) + + // EnterByIdent is called when entering the byIdent production. + EnterByIdent(c *ByIdentContext) + + // EnterSymbolPrimitive is called when entering the symbolPrimitive production. + EnterSymbolPrimitive(c *SymbolPrimitiveContext) + + // EnterDql is called when entering the dql production. + EnterDql(c *DqlContext) + + // EnterExecCommand is called when entering the execCommand production. + EnterExecCommand(c *ExecCommandContext) + + // EnterDdl is called when entering the ddl production. + EnterDdl(c *DdlContext) + + // EnterCreateTable is called when entering the CreateTable production. + EnterCreateTable(c *CreateTableContext) + + // EnterCreateIndex is called when entering the CreateIndex production. + EnterCreateIndex(c *CreateIndexContext) + + // EnterDropTable is called when entering the DropTable production. + EnterDropTable(c *DropTableContext) + + // EnterDropIndex is called when entering the DropIndex production. + EnterDropIndex(c *DropIndexContext) + + // EnterDmlBaseWrapper is called when entering the DmlBaseWrapper production. + EnterDmlBaseWrapper(c *DmlBaseWrapperContext) + + // EnterDmlDelete is called when entering the DmlDelete production. + EnterDmlDelete(c *DmlDeleteContext) + + // EnterDmlInsertReturning is called when entering the DmlInsertReturning production. + EnterDmlInsertReturning(c *DmlInsertReturningContext) + + // EnterDmlBase is called when entering the DmlBase production. + EnterDmlBase(c *DmlBaseContext) + + // EnterDmlBaseCommand is called when entering the dmlBaseCommand production. + EnterDmlBaseCommand(c *DmlBaseCommandContext) + + // EnterPathSimple is called when entering the pathSimple production. + EnterPathSimple(c *PathSimpleContext) + + // EnterPathSimpleLiteral is called when entering the PathSimpleLiteral production. + EnterPathSimpleLiteral(c *PathSimpleLiteralContext) + + // EnterPathSimpleSymbol is called when entering the PathSimpleSymbol production. + EnterPathSimpleSymbol(c *PathSimpleSymbolContext) + + // EnterPathSimpleDotSymbol is called when entering the PathSimpleDotSymbol production. + EnterPathSimpleDotSymbol(c *PathSimpleDotSymbolContext) + + // EnterReplaceCommand is called when entering the replaceCommand production. + EnterReplaceCommand(c *ReplaceCommandContext) + + // EnterUpsertCommand is called when entering the upsertCommand production. + EnterUpsertCommand(c *UpsertCommandContext) + + // EnterRemoveCommand is called when entering the removeCommand production. + EnterRemoveCommand(c *RemoveCommandContext) + + // EnterInsertCommandReturning is called when entering the insertCommandReturning production. + EnterInsertCommandReturning(c *InsertCommandReturningContext) + + // EnterInsertLegacy is called when entering the InsertLegacy production. + EnterInsertLegacy(c *InsertLegacyContext) + + // EnterInsert is called when entering the Insert production. + EnterInsert(c *InsertContext) + + // EnterOnConflictLegacy is called when entering the OnConflictLegacy production. + EnterOnConflictLegacy(c *OnConflictLegacyContext) + + // EnterOnConflict is called when entering the OnConflict production. + EnterOnConflict(c *OnConflictContext) + + // EnterConflictTarget is called when entering the conflictTarget production. + EnterConflictTarget(c *ConflictTargetContext) + + // EnterConstraintName is called when entering the constraintName production. + EnterConstraintName(c *ConstraintNameContext) + + // EnterConflictAction is called when entering the conflictAction production. + EnterConflictAction(c *ConflictActionContext) + + // EnterDoReplace is called when entering the doReplace production. + EnterDoReplace(c *DoReplaceContext) + + // EnterDoUpdate is called when entering the doUpdate production. + EnterDoUpdate(c *DoUpdateContext) + + // EnterUpdateClause is called when entering the updateClause production. + EnterUpdateClause(c *UpdateClauseContext) + + // EnterSetCommand is called when entering the setCommand production. + EnterSetCommand(c *SetCommandContext) + + // EnterSetAssignment is called when entering the setAssignment production. + EnterSetAssignment(c *SetAssignmentContext) + + // EnterDeleteCommand is called when entering the deleteCommand production. + EnterDeleteCommand(c *DeleteCommandContext) + + // EnterReturningClause is called when entering the returningClause production. + EnterReturningClause(c *ReturningClauseContext) + + // EnterReturningColumn is called when entering the returningColumn production. + EnterReturningColumn(c *ReturningColumnContext) + + // EnterFromClauseSimpleExplicit is called when entering the FromClauseSimpleExplicit production. + EnterFromClauseSimpleExplicit(c *FromClauseSimpleExplicitContext) + + // EnterFromClauseSimpleImplicit is called when entering the FromClauseSimpleImplicit production. + EnterFromClauseSimpleImplicit(c *FromClauseSimpleImplicitContext) + + // EnterWhereClause is called when entering the whereClause production. + EnterWhereClause(c *WhereClauseContext) + + // EnterSelectAll is called when entering the SelectAll production. + EnterSelectAll(c *SelectAllContext) + + // EnterSelectItems is called when entering the SelectItems production. + EnterSelectItems(c *SelectItemsContext) + + // EnterSelectValue is called when entering the SelectValue production. + EnterSelectValue(c *SelectValueContext) + + // EnterSelectPivot is called when entering the SelectPivot production. + EnterSelectPivot(c *SelectPivotContext) + + // EnterProjectionItems is called when entering the projectionItems production. + EnterProjectionItems(c *ProjectionItemsContext) + + // EnterProjectionItem is called when entering the projectionItem production. + EnterProjectionItem(c *ProjectionItemContext) + + // EnterSetQuantifierStrategy is called when entering the setQuantifierStrategy production. + EnterSetQuantifierStrategy(c *SetQuantifierStrategyContext) + + // EnterLetClause is called when entering the letClause production. + EnterLetClause(c *LetClauseContext) + + // EnterLetBinding is called when entering the letBinding production. + EnterLetBinding(c *LetBindingContext) + + // EnterOrderByClause is called when entering the orderByClause production. + EnterOrderByClause(c *OrderByClauseContext) + + // EnterOrderSortSpec is called when entering the orderSortSpec production. + EnterOrderSortSpec(c *OrderSortSpecContext) + + // EnterGroupClause is called when entering the groupClause production. + EnterGroupClause(c *GroupClauseContext) + + // EnterGroupAlias is called when entering the groupAlias production. + EnterGroupAlias(c *GroupAliasContext) + + // EnterGroupKey is called when entering the groupKey production. + EnterGroupKey(c *GroupKeyContext) + + // EnterOver is called when entering the over production. + EnterOver(c *OverContext) + + // EnterWindowPartitionList is called when entering the windowPartitionList production. + EnterWindowPartitionList(c *WindowPartitionListContext) + + // EnterWindowSortSpecList is called when entering the windowSortSpecList production. + EnterWindowSortSpecList(c *WindowSortSpecListContext) + + // EnterHavingClause is called when entering the havingClause production. + EnterHavingClause(c *HavingClauseContext) + + // EnterFromClause is called when entering the fromClause production. + EnterFromClause(c *FromClauseContext) + + // EnterWhereClauseSelect is called when entering the whereClauseSelect production. + EnterWhereClauseSelect(c *WhereClauseSelectContext) + + // EnterOffsetByClause is called when entering the offsetByClause production. + EnterOffsetByClause(c *OffsetByClauseContext) + + // EnterLimitClause is called when entering the limitClause production. + EnterLimitClause(c *LimitClauseContext) + + // EnterGpmlPattern is called when entering the gpmlPattern production. + EnterGpmlPattern(c *GpmlPatternContext) + + // EnterGpmlPatternList is called when entering the gpmlPatternList production. + EnterGpmlPatternList(c *GpmlPatternListContext) + + // EnterMatchPattern is called when entering the matchPattern production. + EnterMatchPattern(c *MatchPatternContext) + + // EnterGraphPart is called when entering the graphPart production. + EnterGraphPart(c *GraphPartContext) + + // EnterSelectorBasic is called when entering the SelectorBasic production. + EnterSelectorBasic(c *SelectorBasicContext) + + // EnterSelectorAny is called when entering the SelectorAny production. + EnterSelectorAny(c *SelectorAnyContext) + + // EnterSelectorShortest is called when entering the SelectorShortest production. + EnterSelectorShortest(c *SelectorShortestContext) + + // EnterPatternPathVariable is called when entering the patternPathVariable production. + EnterPatternPathVariable(c *PatternPathVariableContext) + + // EnterPatternRestrictor is called when entering the patternRestrictor production. + EnterPatternRestrictor(c *PatternRestrictorContext) + + // EnterNode is called when entering the node production. + EnterNode(c *NodeContext) + + // EnterEdgeWithSpec is called when entering the EdgeWithSpec production. + EnterEdgeWithSpec(c *EdgeWithSpecContext) + + // EnterEdgeAbbreviated is called when entering the EdgeAbbreviated production. + EnterEdgeAbbreviated(c *EdgeAbbreviatedContext) + + // EnterPattern is called when entering the pattern production. + EnterPattern(c *PatternContext) + + // EnterPatternQuantifier is called when entering the patternQuantifier production. + EnterPatternQuantifier(c *PatternQuantifierContext) + + // EnterEdgeSpecRight is called when entering the EdgeSpecRight production. + EnterEdgeSpecRight(c *EdgeSpecRightContext) + + // EnterEdgeSpecUndirected is called when entering the EdgeSpecUndirected production. + EnterEdgeSpecUndirected(c *EdgeSpecUndirectedContext) + + // EnterEdgeSpecLeft is called when entering the EdgeSpecLeft production. + EnterEdgeSpecLeft(c *EdgeSpecLeftContext) + + // EnterEdgeSpecUndirectedRight is called when entering the EdgeSpecUndirectedRight production. + EnterEdgeSpecUndirectedRight(c *EdgeSpecUndirectedRightContext) + + // EnterEdgeSpecUndirectedLeft is called when entering the EdgeSpecUndirectedLeft production. + EnterEdgeSpecUndirectedLeft(c *EdgeSpecUndirectedLeftContext) + + // EnterEdgeSpecBidirectional is called when entering the EdgeSpecBidirectional production. + EnterEdgeSpecBidirectional(c *EdgeSpecBidirectionalContext) + + // EnterEdgeSpecUndirectedBidirectional is called when entering the EdgeSpecUndirectedBidirectional production. + EnterEdgeSpecUndirectedBidirectional(c *EdgeSpecUndirectedBidirectionalContext) + + // EnterEdgeSpec is called when entering the edgeSpec production. + EnterEdgeSpec(c *EdgeSpecContext) + + // EnterPatternPartLabel is called when entering the patternPartLabel production. + EnterPatternPartLabel(c *PatternPartLabelContext) + + // EnterEdgeAbbrev is called when entering the edgeAbbrev production. + EnterEdgeAbbrev(c *EdgeAbbrevContext) + + // EnterTableWrapped is called when entering the TableWrapped production. + EnterTableWrapped(c *TableWrappedContext) + + // EnterTableCrossJoin is called when entering the TableCrossJoin production. + EnterTableCrossJoin(c *TableCrossJoinContext) + + // EnterTableQualifiedJoin is called when entering the TableQualifiedJoin production. + EnterTableQualifiedJoin(c *TableQualifiedJoinContext) + + // EnterTableRefBase is called when entering the TableRefBase production. + EnterTableRefBase(c *TableRefBaseContext) + + // EnterTableNonJoin is called when entering the tableNonJoin production. + EnterTableNonJoin(c *TableNonJoinContext) + + // EnterTableBaseRefSymbol is called when entering the TableBaseRefSymbol production. + EnterTableBaseRefSymbol(c *TableBaseRefSymbolContext) + + // EnterTableBaseRefClauses is called when entering the TableBaseRefClauses production. + EnterTableBaseRefClauses(c *TableBaseRefClausesContext) + + // EnterTableBaseRefMatch is called when entering the TableBaseRefMatch production. + EnterTableBaseRefMatch(c *TableBaseRefMatchContext) + + // EnterTableUnpivot is called when entering the tableUnpivot production. + EnterTableUnpivot(c *TableUnpivotContext) + + // EnterJoinRhsBase is called when entering the JoinRhsBase production. + EnterJoinRhsBase(c *JoinRhsBaseContext) + + // EnterJoinRhsTableJoined is called when entering the JoinRhsTableJoined production. + EnterJoinRhsTableJoined(c *JoinRhsTableJoinedContext) + + // EnterJoinSpec is called when entering the joinSpec production. + EnterJoinSpec(c *JoinSpecContext) + + // EnterJoinType is called when entering the joinType production. + EnterJoinType(c *JoinTypeContext) + + // EnterExpr is called when entering the expr production. + EnterExpr(c *ExprContext) + + // EnterIntersect is called when entering the Intersect production. + EnterIntersect(c *IntersectContext) + + // EnterQueryBase is called when entering the QueryBase production. + EnterQueryBase(c *QueryBaseContext) + + // EnterExcept is called when entering the Except production. + EnterExcept(c *ExceptContext) + + // EnterUnion is called when entering the Union production. + EnterUnion(c *UnionContext) + + // EnterSfwQuery is called when entering the SfwQuery production. + EnterSfwQuery(c *SfwQueryContext) + + // EnterSfwBase is called when entering the SfwBase production. + EnterSfwBase(c *SfwBaseContext) + + // EnterOr is called when entering the Or production. + EnterOr(c *OrContext) + + // EnterExprOrBase is called when entering the ExprOrBase production. + EnterExprOrBase(c *ExprOrBaseContext) + + // EnterExprAndBase is called when entering the ExprAndBase production. + EnterExprAndBase(c *ExprAndBaseContext) + + // EnterAnd is called when entering the And production. + EnterAnd(c *AndContext) + + // EnterNot is called when entering the Not production. + EnterNot(c *NotContext) + + // EnterExprNotBase is called when entering the ExprNotBase production. + EnterExprNotBase(c *ExprNotBaseContext) + + // EnterPredicateIn is called when entering the PredicateIn production. + EnterPredicateIn(c *PredicateInContext) + + // EnterPredicateBetween is called when entering the PredicateBetween production. + EnterPredicateBetween(c *PredicateBetweenContext) + + // EnterPredicateBase is called when entering the PredicateBase production. + EnterPredicateBase(c *PredicateBaseContext) + + // EnterPredicateComparison is called when entering the PredicateComparison production. + EnterPredicateComparison(c *PredicateComparisonContext) + + // EnterPredicateIs is called when entering the PredicateIs production. + EnterPredicateIs(c *PredicateIsContext) + + // EnterPredicateLike is called when entering the PredicateLike production. + EnterPredicateLike(c *PredicateLikeContext) + + // EnterMathOp00 is called when entering the mathOp00 production. + EnterMathOp00(c *MathOp00Context) + + // EnterMathOp01 is called when entering the mathOp01 production. + EnterMathOp01(c *MathOp01Context) + + // EnterMathOp02 is called when entering the mathOp02 production. + EnterMathOp02(c *MathOp02Context) + + // EnterValueExpr is called when entering the valueExpr production. + EnterValueExpr(c *ValueExprContext) + + // EnterExprPrimaryPath is called when entering the ExprPrimaryPath production. + EnterExprPrimaryPath(c *ExprPrimaryPathContext) + + // EnterExprPrimaryBase is called when entering the ExprPrimaryBase production. + EnterExprPrimaryBase(c *ExprPrimaryBaseContext) + + // EnterExprTermWrappedQuery is called when entering the ExprTermWrappedQuery production. + EnterExprTermWrappedQuery(c *ExprTermWrappedQueryContext) + + // EnterExprTermBase is called when entering the ExprTermBase production. + EnterExprTermBase(c *ExprTermBaseContext) + + // EnterNullIf is called when entering the nullIf production. + EnterNullIf(c *NullIfContext) + + // EnterCoalesce is called when entering the coalesce production. + EnterCoalesce(c *CoalesceContext) + + // EnterCaseExpr is called when entering the caseExpr production. + EnterCaseExpr(c *CaseExprContext) + + // EnterValues is called when entering the values production. + EnterValues(c *ValuesContext) + + // EnterValueRow is called when entering the valueRow production. + EnterValueRow(c *ValueRowContext) + + // EnterValueList is called when entering the valueList production. + EnterValueList(c *ValueListContext) + + // EnterSequenceConstructor is called when entering the sequenceConstructor production. + EnterSequenceConstructor(c *SequenceConstructorContext) + + // EnterSubstring is called when entering the substring production. + EnterSubstring(c *SubstringContext) + + // EnterCountAll is called when entering the CountAll production. + EnterCountAll(c *CountAllContext) + + // EnterAggregateBase is called when entering the AggregateBase production. + EnterAggregateBase(c *AggregateBaseContext) + + // EnterLagLeadFunction is called when entering the LagLeadFunction production. + EnterLagLeadFunction(c *LagLeadFunctionContext) + + // EnterCast is called when entering the cast production. + EnterCast(c *CastContext) + + // EnterCanLosslessCast is called when entering the canLosslessCast production. + EnterCanLosslessCast(c *CanLosslessCastContext) + + // EnterCanCast is called when entering the canCast production. + EnterCanCast(c *CanCastContext) + + // EnterExtract is called when entering the extract production. + EnterExtract(c *ExtractContext) + + // EnterTrimFunction is called when entering the trimFunction production. + EnterTrimFunction(c *TrimFunctionContext) + + // EnterDateFunction is called when entering the dateFunction production. + EnterDateFunction(c *DateFunctionContext) + + // EnterFunctionCallReserved is called when entering the FunctionCallReserved production. + EnterFunctionCallReserved(c *FunctionCallReservedContext) + + // EnterFunctionCallIdent is called when entering the FunctionCallIdent production. + EnterFunctionCallIdent(c *FunctionCallIdentContext) + + // EnterPathStepIndexExpr is called when entering the PathStepIndexExpr production. + EnterPathStepIndexExpr(c *PathStepIndexExprContext) + + // EnterPathStepIndexAll is called when entering the PathStepIndexAll production. + EnterPathStepIndexAll(c *PathStepIndexAllContext) + + // EnterPathStepDotExpr is called when entering the PathStepDotExpr production. + EnterPathStepDotExpr(c *PathStepDotExprContext) + + // EnterPathStepDotAll is called when entering the PathStepDotAll production. + EnterPathStepDotAll(c *PathStepDotAllContext) + + // EnterExprGraphMatchMany is called when entering the exprGraphMatchMany production. + EnterExprGraphMatchMany(c *ExprGraphMatchManyContext) + + // EnterExprGraphMatchOne is called when entering the exprGraphMatchOne production. + EnterExprGraphMatchOne(c *ExprGraphMatchOneContext) + + // EnterParameter is called when entering the parameter production. + EnterParameter(c *ParameterContext) + + // EnterVarRefExpr is called when entering the varRefExpr production. + EnterVarRefExpr(c *VarRefExprContext) + + // EnterCollection is called when entering the collection production. + EnterCollection(c *CollectionContext) + + // EnterArray is called when entering the array production. + EnterArray(c *ArrayContext) + + // EnterBag is called when entering the bag production. + EnterBag(c *BagContext) + + // EnterTuple is called when entering the tuple production. + EnterTuple(c *TupleContext) + + // EnterPair is called when entering the pair production. + EnterPair(c *PairContext) + + // EnterLiteralNull is called when entering the LiteralNull production. + EnterLiteralNull(c *LiteralNullContext) + + // EnterLiteralMissing is called when entering the LiteralMissing production. + EnterLiteralMissing(c *LiteralMissingContext) + + // EnterLiteralTrue is called when entering the LiteralTrue production. + EnterLiteralTrue(c *LiteralTrueContext) + + // EnterLiteralFalse is called when entering the LiteralFalse production. + EnterLiteralFalse(c *LiteralFalseContext) + + // EnterLiteralString is called when entering the LiteralString production. + EnterLiteralString(c *LiteralStringContext) + + // EnterLiteralInteger is called when entering the LiteralInteger production. + EnterLiteralInteger(c *LiteralIntegerContext) + + // EnterLiteralDecimal is called when entering the LiteralDecimal production. + EnterLiteralDecimal(c *LiteralDecimalContext) + + // EnterLiteralIon is called when entering the LiteralIon production. + EnterLiteralIon(c *LiteralIonContext) + + // EnterLiteralDate is called when entering the LiteralDate production. + EnterLiteralDate(c *LiteralDateContext) + + // EnterLiteralTime is called when entering the LiteralTime production. + EnterLiteralTime(c *LiteralTimeContext) + + // EnterTypeAtomic is called when entering the TypeAtomic production. + EnterTypeAtomic(c *TypeAtomicContext) + + // EnterTypeArgSingle is called when entering the TypeArgSingle production. + EnterTypeArgSingle(c *TypeArgSingleContext) + + // EnterTypeVarChar is called when entering the TypeVarChar production. + EnterTypeVarChar(c *TypeVarCharContext) + + // EnterTypeArgDouble is called when entering the TypeArgDouble production. + EnterTypeArgDouble(c *TypeArgDoubleContext) + + // EnterTypeTimeZone is called when entering the TypeTimeZone production. + EnterTypeTimeZone(c *TypeTimeZoneContext) + + // EnterTypeCustom is called when entering the TypeCustom production. + EnterTypeCustom(c *TypeCustomContext) + + // ExitScript is called when exiting the script production. + ExitScript(c *ScriptContext) + + // ExitRoot is called when exiting the root production. + ExitRoot(c *RootContext) + + // ExitQueryDql is called when exiting the QueryDql production. + ExitQueryDql(c *QueryDqlContext) + + // ExitQueryDml is called when exiting the QueryDml production. + ExitQueryDml(c *QueryDmlContext) + + // ExitQueryDdl is called when exiting the QueryDdl production. + ExitQueryDdl(c *QueryDdlContext) + + // ExitQueryExec is called when exiting the QueryExec production. + ExitQueryExec(c *QueryExecContext) + + // ExitExplainOption is called when exiting the explainOption production. + ExitExplainOption(c *ExplainOptionContext) + + // ExitAsIdent is called when exiting the asIdent production. + ExitAsIdent(c *AsIdentContext) + + // ExitAtIdent is called when exiting the atIdent production. + ExitAtIdent(c *AtIdentContext) + + // ExitByIdent is called when exiting the byIdent production. + ExitByIdent(c *ByIdentContext) + + // ExitSymbolPrimitive is called when exiting the symbolPrimitive production. + ExitSymbolPrimitive(c *SymbolPrimitiveContext) + + // ExitDql is called when exiting the dql production. + ExitDql(c *DqlContext) + + // ExitExecCommand is called when exiting the execCommand production. + ExitExecCommand(c *ExecCommandContext) + + // ExitDdl is called when exiting the ddl production. + ExitDdl(c *DdlContext) + + // ExitCreateTable is called when exiting the CreateTable production. + ExitCreateTable(c *CreateTableContext) + + // ExitCreateIndex is called when exiting the CreateIndex production. + ExitCreateIndex(c *CreateIndexContext) + + // ExitDropTable is called when exiting the DropTable production. + ExitDropTable(c *DropTableContext) + + // ExitDropIndex is called when exiting the DropIndex production. + ExitDropIndex(c *DropIndexContext) + + // ExitDmlBaseWrapper is called when exiting the DmlBaseWrapper production. + ExitDmlBaseWrapper(c *DmlBaseWrapperContext) + + // ExitDmlDelete is called when exiting the DmlDelete production. + ExitDmlDelete(c *DmlDeleteContext) + + // ExitDmlInsertReturning is called when exiting the DmlInsertReturning production. + ExitDmlInsertReturning(c *DmlInsertReturningContext) + + // ExitDmlBase is called when exiting the DmlBase production. + ExitDmlBase(c *DmlBaseContext) + + // ExitDmlBaseCommand is called when exiting the dmlBaseCommand production. + ExitDmlBaseCommand(c *DmlBaseCommandContext) + + // ExitPathSimple is called when exiting the pathSimple production. + ExitPathSimple(c *PathSimpleContext) + + // ExitPathSimpleLiteral is called when exiting the PathSimpleLiteral production. + ExitPathSimpleLiteral(c *PathSimpleLiteralContext) + + // ExitPathSimpleSymbol is called when exiting the PathSimpleSymbol production. + ExitPathSimpleSymbol(c *PathSimpleSymbolContext) + + // ExitPathSimpleDotSymbol is called when exiting the PathSimpleDotSymbol production. + ExitPathSimpleDotSymbol(c *PathSimpleDotSymbolContext) + + // ExitReplaceCommand is called when exiting the replaceCommand production. + ExitReplaceCommand(c *ReplaceCommandContext) + + // ExitUpsertCommand is called when exiting the upsertCommand production. + ExitUpsertCommand(c *UpsertCommandContext) + + // ExitRemoveCommand is called when exiting the removeCommand production. + ExitRemoveCommand(c *RemoveCommandContext) + + // ExitInsertCommandReturning is called when exiting the insertCommandReturning production. + ExitInsertCommandReturning(c *InsertCommandReturningContext) + + // ExitInsertLegacy is called when exiting the InsertLegacy production. + ExitInsertLegacy(c *InsertLegacyContext) + + // ExitInsert is called when exiting the Insert production. + ExitInsert(c *InsertContext) + + // ExitOnConflictLegacy is called when exiting the OnConflictLegacy production. + ExitOnConflictLegacy(c *OnConflictLegacyContext) + + // ExitOnConflict is called when exiting the OnConflict production. + ExitOnConflict(c *OnConflictContext) + + // ExitConflictTarget is called when exiting the conflictTarget production. + ExitConflictTarget(c *ConflictTargetContext) + + // ExitConstraintName is called when exiting the constraintName production. + ExitConstraintName(c *ConstraintNameContext) + + // ExitConflictAction is called when exiting the conflictAction production. + ExitConflictAction(c *ConflictActionContext) + + // ExitDoReplace is called when exiting the doReplace production. + ExitDoReplace(c *DoReplaceContext) + + // ExitDoUpdate is called when exiting the doUpdate production. + ExitDoUpdate(c *DoUpdateContext) + + // ExitUpdateClause is called when exiting the updateClause production. + ExitUpdateClause(c *UpdateClauseContext) + + // ExitSetCommand is called when exiting the setCommand production. + ExitSetCommand(c *SetCommandContext) + + // ExitSetAssignment is called when exiting the setAssignment production. + ExitSetAssignment(c *SetAssignmentContext) + + // ExitDeleteCommand is called when exiting the deleteCommand production. + ExitDeleteCommand(c *DeleteCommandContext) + + // ExitReturningClause is called when exiting the returningClause production. + ExitReturningClause(c *ReturningClauseContext) + + // ExitReturningColumn is called when exiting the returningColumn production. + ExitReturningColumn(c *ReturningColumnContext) + + // ExitFromClauseSimpleExplicit is called when exiting the FromClauseSimpleExplicit production. + ExitFromClauseSimpleExplicit(c *FromClauseSimpleExplicitContext) + + // ExitFromClauseSimpleImplicit is called when exiting the FromClauseSimpleImplicit production. + ExitFromClauseSimpleImplicit(c *FromClauseSimpleImplicitContext) + + // ExitWhereClause is called when exiting the whereClause production. + ExitWhereClause(c *WhereClauseContext) + + // ExitSelectAll is called when exiting the SelectAll production. + ExitSelectAll(c *SelectAllContext) + + // ExitSelectItems is called when exiting the SelectItems production. + ExitSelectItems(c *SelectItemsContext) + + // ExitSelectValue is called when exiting the SelectValue production. + ExitSelectValue(c *SelectValueContext) + + // ExitSelectPivot is called when exiting the SelectPivot production. + ExitSelectPivot(c *SelectPivotContext) + + // ExitProjectionItems is called when exiting the projectionItems production. + ExitProjectionItems(c *ProjectionItemsContext) + + // ExitProjectionItem is called when exiting the projectionItem production. + ExitProjectionItem(c *ProjectionItemContext) + + // ExitSetQuantifierStrategy is called when exiting the setQuantifierStrategy production. + ExitSetQuantifierStrategy(c *SetQuantifierStrategyContext) + + // ExitLetClause is called when exiting the letClause production. + ExitLetClause(c *LetClauseContext) + + // ExitLetBinding is called when exiting the letBinding production. + ExitLetBinding(c *LetBindingContext) + + // ExitOrderByClause is called when exiting the orderByClause production. + ExitOrderByClause(c *OrderByClauseContext) + + // ExitOrderSortSpec is called when exiting the orderSortSpec production. + ExitOrderSortSpec(c *OrderSortSpecContext) + + // ExitGroupClause is called when exiting the groupClause production. + ExitGroupClause(c *GroupClauseContext) + + // ExitGroupAlias is called when exiting the groupAlias production. + ExitGroupAlias(c *GroupAliasContext) + + // ExitGroupKey is called when exiting the groupKey production. + ExitGroupKey(c *GroupKeyContext) + + // ExitOver is called when exiting the over production. + ExitOver(c *OverContext) + + // ExitWindowPartitionList is called when exiting the windowPartitionList production. + ExitWindowPartitionList(c *WindowPartitionListContext) + + // ExitWindowSortSpecList is called when exiting the windowSortSpecList production. + ExitWindowSortSpecList(c *WindowSortSpecListContext) + + // ExitHavingClause is called when exiting the havingClause production. + ExitHavingClause(c *HavingClauseContext) + + // ExitFromClause is called when exiting the fromClause production. + ExitFromClause(c *FromClauseContext) + + // ExitWhereClauseSelect is called when exiting the whereClauseSelect production. + ExitWhereClauseSelect(c *WhereClauseSelectContext) + + // ExitOffsetByClause is called when exiting the offsetByClause production. + ExitOffsetByClause(c *OffsetByClauseContext) + + // ExitLimitClause is called when exiting the limitClause production. + ExitLimitClause(c *LimitClauseContext) + + // ExitGpmlPattern is called when exiting the gpmlPattern production. + ExitGpmlPattern(c *GpmlPatternContext) + + // ExitGpmlPatternList is called when exiting the gpmlPatternList production. + ExitGpmlPatternList(c *GpmlPatternListContext) + + // ExitMatchPattern is called when exiting the matchPattern production. + ExitMatchPattern(c *MatchPatternContext) + + // ExitGraphPart is called when exiting the graphPart production. + ExitGraphPart(c *GraphPartContext) + + // ExitSelectorBasic is called when exiting the SelectorBasic production. + ExitSelectorBasic(c *SelectorBasicContext) + + // ExitSelectorAny is called when exiting the SelectorAny production. + ExitSelectorAny(c *SelectorAnyContext) + + // ExitSelectorShortest is called when exiting the SelectorShortest production. + ExitSelectorShortest(c *SelectorShortestContext) + + // ExitPatternPathVariable is called when exiting the patternPathVariable production. + ExitPatternPathVariable(c *PatternPathVariableContext) + + // ExitPatternRestrictor is called when exiting the patternRestrictor production. + ExitPatternRestrictor(c *PatternRestrictorContext) + + // ExitNode is called when exiting the node production. + ExitNode(c *NodeContext) + + // ExitEdgeWithSpec is called when exiting the EdgeWithSpec production. + ExitEdgeWithSpec(c *EdgeWithSpecContext) + + // ExitEdgeAbbreviated is called when exiting the EdgeAbbreviated production. + ExitEdgeAbbreviated(c *EdgeAbbreviatedContext) + + // ExitPattern is called when exiting the pattern production. + ExitPattern(c *PatternContext) + + // ExitPatternQuantifier is called when exiting the patternQuantifier production. + ExitPatternQuantifier(c *PatternQuantifierContext) + + // ExitEdgeSpecRight is called when exiting the EdgeSpecRight production. + ExitEdgeSpecRight(c *EdgeSpecRightContext) + + // ExitEdgeSpecUndirected is called when exiting the EdgeSpecUndirected production. + ExitEdgeSpecUndirected(c *EdgeSpecUndirectedContext) + + // ExitEdgeSpecLeft is called when exiting the EdgeSpecLeft production. + ExitEdgeSpecLeft(c *EdgeSpecLeftContext) + + // ExitEdgeSpecUndirectedRight is called when exiting the EdgeSpecUndirectedRight production. + ExitEdgeSpecUndirectedRight(c *EdgeSpecUndirectedRightContext) + + // ExitEdgeSpecUndirectedLeft is called when exiting the EdgeSpecUndirectedLeft production. + ExitEdgeSpecUndirectedLeft(c *EdgeSpecUndirectedLeftContext) + + // ExitEdgeSpecBidirectional is called when exiting the EdgeSpecBidirectional production. + ExitEdgeSpecBidirectional(c *EdgeSpecBidirectionalContext) + + // ExitEdgeSpecUndirectedBidirectional is called when exiting the EdgeSpecUndirectedBidirectional production. + ExitEdgeSpecUndirectedBidirectional(c *EdgeSpecUndirectedBidirectionalContext) + + // ExitEdgeSpec is called when exiting the edgeSpec production. + ExitEdgeSpec(c *EdgeSpecContext) + + // ExitPatternPartLabel is called when exiting the patternPartLabel production. + ExitPatternPartLabel(c *PatternPartLabelContext) + + // ExitEdgeAbbrev is called when exiting the edgeAbbrev production. + ExitEdgeAbbrev(c *EdgeAbbrevContext) + + // ExitTableWrapped is called when exiting the TableWrapped production. + ExitTableWrapped(c *TableWrappedContext) + + // ExitTableCrossJoin is called when exiting the TableCrossJoin production. + ExitTableCrossJoin(c *TableCrossJoinContext) + + // ExitTableQualifiedJoin is called when exiting the TableQualifiedJoin production. + ExitTableQualifiedJoin(c *TableQualifiedJoinContext) + + // ExitTableRefBase is called when exiting the TableRefBase production. + ExitTableRefBase(c *TableRefBaseContext) + + // ExitTableNonJoin is called when exiting the tableNonJoin production. + ExitTableNonJoin(c *TableNonJoinContext) + + // ExitTableBaseRefSymbol is called when exiting the TableBaseRefSymbol production. + ExitTableBaseRefSymbol(c *TableBaseRefSymbolContext) + + // ExitTableBaseRefClauses is called when exiting the TableBaseRefClauses production. + ExitTableBaseRefClauses(c *TableBaseRefClausesContext) + + // ExitTableBaseRefMatch is called when exiting the TableBaseRefMatch production. + ExitTableBaseRefMatch(c *TableBaseRefMatchContext) + + // ExitTableUnpivot is called when exiting the tableUnpivot production. + ExitTableUnpivot(c *TableUnpivotContext) + + // ExitJoinRhsBase is called when exiting the JoinRhsBase production. + ExitJoinRhsBase(c *JoinRhsBaseContext) + + // ExitJoinRhsTableJoined is called when exiting the JoinRhsTableJoined production. + ExitJoinRhsTableJoined(c *JoinRhsTableJoinedContext) + + // ExitJoinSpec is called when exiting the joinSpec production. + ExitJoinSpec(c *JoinSpecContext) + + // ExitJoinType is called when exiting the joinType production. + ExitJoinType(c *JoinTypeContext) + + // ExitExpr is called when exiting the expr production. + ExitExpr(c *ExprContext) + + // ExitIntersect is called when exiting the Intersect production. + ExitIntersect(c *IntersectContext) + + // ExitQueryBase is called when exiting the QueryBase production. + ExitQueryBase(c *QueryBaseContext) + + // ExitExcept is called when exiting the Except production. + ExitExcept(c *ExceptContext) + + // ExitUnion is called when exiting the Union production. + ExitUnion(c *UnionContext) + + // ExitSfwQuery is called when exiting the SfwQuery production. + ExitSfwQuery(c *SfwQueryContext) + + // ExitSfwBase is called when exiting the SfwBase production. + ExitSfwBase(c *SfwBaseContext) + + // ExitOr is called when exiting the Or production. + ExitOr(c *OrContext) + + // ExitExprOrBase is called when exiting the ExprOrBase production. + ExitExprOrBase(c *ExprOrBaseContext) + + // ExitExprAndBase is called when exiting the ExprAndBase production. + ExitExprAndBase(c *ExprAndBaseContext) + + // ExitAnd is called when exiting the And production. + ExitAnd(c *AndContext) + + // ExitNot is called when exiting the Not production. + ExitNot(c *NotContext) + + // ExitExprNotBase is called when exiting the ExprNotBase production. + ExitExprNotBase(c *ExprNotBaseContext) + + // ExitPredicateIn is called when exiting the PredicateIn production. + ExitPredicateIn(c *PredicateInContext) + + // ExitPredicateBetween is called when exiting the PredicateBetween production. + ExitPredicateBetween(c *PredicateBetweenContext) + + // ExitPredicateBase is called when exiting the PredicateBase production. + ExitPredicateBase(c *PredicateBaseContext) + + // ExitPredicateComparison is called when exiting the PredicateComparison production. + ExitPredicateComparison(c *PredicateComparisonContext) + + // ExitPredicateIs is called when exiting the PredicateIs production. + ExitPredicateIs(c *PredicateIsContext) + + // ExitPredicateLike is called when exiting the PredicateLike production. + ExitPredicateLike(c *PredicateLikeContext) + + // ExitMathOp00 is called when exiting the mathOp00 production. + ExitMathOp00(c *MathOp00Context) + + // ExitMathOp01 is called when exiting the mathOp01 production. + ExitMathOp01(c *MathOp01Context) + + // ExitMathOp02 is called when exiting the mathOp02 production. + ExitMathOp02(c *MathOp02Context) + + // ExitValueExpr is called when exiting the valueExpr production. + ExitValueExpr(c *ValueExprContext) + + // ExitExprPrimaryPath is called when exiting the ExprPrimaryPath production. + ExitExprPrimaryPath(c *ExprPrimaryPathContext) + + // ExitExprPrimaryBase is called when exiting the ExprPrimaryBase production. + ExitExprPrimaryBase(c *ExprPrimaryBaseContext) + + // ExitExprTermWrappedQuery is called when exiting the ExprTermWrappedQuery production. + ExitExprTermWrappedQuery(c *ExprTermWrappedQueryContext) + + // ExitExprTermBase is called when exiting the ExprTermBase production. + ExitExprTermBase(c *ExprTermBaseContext) + + // ExitNullIf is called when exiting the nullIf production. + ExitNullIf(c *NullIfContext) + + // ExitCoalesce is called when exiting the coalesce production. + ExitCoalesce(c *CoalesceContext) + + // ExitCaseExpr is called when exiting the caseExpr production. + ExitCaseExpr(c *CaseExprContext) + + // ExitValues is called when exiting the values production. + ExitValues(c *ValuesContext) + + // ExitValueRow is called when exiting the valueRow production. + ExitValueRow(c *ValueRowContext) + + // ExitValueList is called when exiting the valueList production. + ExitValueList(c *ValueListContext) + + // ExitSequenceConstructor is called when exiting the sequenceConstructor production. + ExitSequenceConstructor(c *SequenceConstructorContext) + + // ExitSubstring is called when exiting the substring production. + ExitSubstring(c *SubstringContext) + + // ExitCountAll is called when exiting the CountAll production. + ExitCountAll(c *CountAllContext) + + // ExitAggregateBase is called when exiting the AggregateBase production. + ExitAggregateBase(c *AggregateBaseContext) + + // ExitLagLeadFunction is called when exiting the LagLeadFunction production. + ExitLagLeadFunction(c *LagLeadFunctionContext) + + // ExitCast is called when exiting the cast production. + ExitCast(c *CastContext) + + // ExitCanLosslessCast is called when exiting the canLosslessCast production. + ExitCanLosslessCast(c *CanLosslessCastContext) + + // ExitCanCast is called when exiting the canCast production. + ExitCanCast(c *CanCastContext) + + // ExitExtract is called when exiting the extract production. + ExitExtract(c *ExtractContext) + + // ExitTrimFunction is called when exiting the trimFunction production. + ExitTrimFunction(c *TrimFunctionContext) + + // ExitDateFunction is called when exiting the dateFunction production. + ExitDateFunction(c *DateFunctionContext) + + // ExitFunctionCallReserved is called when exiting the FunctionCallReserved production. + ExitFunctionCallReserved(c *FunctionCallReservedContext) + + // ExitFunctionCallIdent is called when exiting the FunctionCallIdent production. + ExitFunctionCallIdent(c *FunctionCallIdentContext) + + // ExitPathStepIndexExpr is called when exiting the PathStepIndexExpr production. + ExitPathStepIndexExpr(c *PathStepIndexExprContext) + + // ExitPathStepIndexAll is called when exiting the PathStepIndexAll production. + ExitPathStepIndexAll(c *PathStepIndexAllContext) + + // ExitPathStepDotExpr is called when exiting the PathStepDotExpr production. + ExitPathStepDotExpr(c *PathStepDotExprContext) + + // ExitPathStepDotAll is called when exiting the PathStepDotAll production. + ExitPathStepDotAll(c *PathStepDotAllContext) + + // ExitExprGraphMatchMany is called when exiting the exprGraphMatchMany production. + ExitExprGraphMatchMany(c *ExprGraphMatchManyContext) + + // ExitExprGraphMatchOne is called when exiting the exprGraphMatchOne production. + ExitExprGraphMatchOne(c *ExprGraphMatchOneContext) + + // ExitParameter is called when exiting the parameter production. + ExitParameter(c *ParameterContext) + + // ExitVarRefExpr is called when exiting the varRefExpr production. + ExitVarRefExpr(c *VarRefExprContext) + + // ExitCollection is called when exiting the collection production. + ExitCollection(c *CollectionContext) + + // ExitArray is called when exiting the array production. + ExitArray(c *ArrayContext) + + // ExitBag is called when exiting the bag production. + ExitBag(c *BagContext) + + // ExitTuple is called when exiting the tuple production. + ExitTuple(c *TupleContext) + + // ExitPair is called when exiting the pair production. + ExitPair(c *PairContext) + + // ExitLiteralNull is called when exiting the LiteralNull production. + ExitLiteralNull(c *LiteralNullContext) + + // ExitLiteralMissing is called when exiting the LiteralMissing production. + ExitLiteralMissing(c *LiteralMissingContext) + + // ExitLiteralTrue is called when exiting the LiteralTrue production. + ExitLiteralTrue(c *LiteralTrueContext) + + // ExitLiteralFalse is called when exiting the LiteralFalse production. + ExitLiteralFalse(c *LiteralFalseContext) + + // ExitLiteralString is called when exiting the LiteralString production. + ExitLiteralString(c *LiteralStringContext) + + // ExitLiteralInteger is called when exiting the LiteralInteger production. + ExitLiteralInteger(c *LiteralIntegerContext) + + // ExitLiteralDecimal is called when exiting the LiteralDecimal production. + ExitLiteralDecimal(c *LiteralDecimalContext) + + // ExitLiteralIon is called when exiting the LiteralIon production. + ExitLiteralIon(c *LiteralIonContext) + + // ExitLiteralDate is called when exiting the LiteralDate production. + ExitLiteralDate(c *LiteralDateContext) + + // ExitLiteralTime is called when exiting the LiteralTime production. + ExitLiteralTime(c *LiteralTimeContext) + + // ExitTypeAtomic is called when exiting the TypeAtomic production. + ExitTypeAtomic(c *TypeAtomicContext) + + // ExitTypeArgSingle is called when exiting the TypeArgSingle production. + ExitTypeArgSingle(c *TypeArgSingleContext) + + // ExitTypeVarChar is called when exiting the TypeVarChar production. + ExitTypeVarChar(c *TypeVarCharContext) + + // ExitTypeArgDouble is called when exiting the TypeArgDouble production. + ExitTypeArgDouble(c *TypeArgDoubleContext) + + // ExitTypeTimeZone is called when exiting the TypeTimeZone production. + ExitTypeTimeZone(c *TypeTimeZoneContext) + + // ExitTypeCustom is called when exiting the TypeCustom production. + ExitTypeCustom(c *TypeCustomContext) +} diff --git a/partiql/partiqlparser_parser.go b/partiql/partiqlparser_parser.go new file mode 100644 index 0000000..4895eb9 --- /dev/null +++ b/partiql/partiqlparser_parser.go @@ -0,0 +1,32752 @@ +// Code generated from PartiQLParser.g4 by ANTLR 4.13.2. DO NOT EDIT. + +package partiql // PartiQLParser +import ( + "fmt" + "strconv" + "sync" + + "github.com/antlr4-go/antlr/v4" +) + +// Suppress unused import errors +var _ = fmt.Printf +var _ = strconv.Itoa +var _ = sync.Once{} + +type PartiQLParserParser struct { + *antlr.BaseParser +} + +var PartiQLParserParserStaticData struct { + once sync.Once + serializedATN []int32 + LiteralNames []string + SymbolicNames []string + RuleNames []string + PredictionContextCache *antlr.PredictionContextCache + atn *antlr.ATN + decisionToDFA []*antlr.DFA +} + +func partiqlparserParserInit() { + staticData := &PartiQLParserParserStaticData + staticData.LiteralNames = []string{ + "", "'ABSOLUTE'", "'ACTION'", "'ADD'", "'ALL'", "'ALLOCATE'", "'ALTER'", + "'AND'", "'ANY'", "'ARE'", "'AS'", "'ASC'", "'ASSERTION'", "'AT'", "'AUTHORIZATION'", + "'AVG'", "'BEGIN'", "'BETWEEN'", "'BIT'", "'BIT_LENGTH'", "'BY'", "'CASCADE'", + "'CASCADED'", "'CASE'", "'CAST'", "'CATALOG'", "'CHAR'", "'CHARACTER'", + "'CHARACTER_LENGTH'", "'CHAR_LENGTH'", "'CHECK'", "'CLOSE'", "'COALESCE'", + "'COLLATE'", "'COLLATION'", "'COLUMN'", "'COMMIT'", "'CONNECT'", "'CONNECTION'", + "'CONSTRAINT'", "'CONSTRAINTS'", "'CONTINUE'", "'CONVERT'", "'CORRESPONDING'", + "'COUNT'", "'CREATE'", "'CROSS'", "'CURRENT'", "'CURRENT_DATE'", "'CURRENT_TIME'", + "'CURRENT_TIMESTAMP'", "'CURRENT_USER'", "'CURSOR'", "'DATE'", "'DEALLOCATE'", + "'DEC'", "'DECIMAL'", "'DECLARE'", "'DEFAULT'", "'DEFERRABLE'", "'DEFERRED'", + "'DELETE'", "'DESC'", "'DESCRIBE'", "'DESCRIPTOR'", "'DIAGNOSTICS'", + "'DISCONNECT'", "'DISTINCT'", "'DOMAIN'", "'DOUBLE'", "'DROP'", "'ELSE'", + "'END'", "'END-EXEC'", "'ESCAPE'", "'EXCEPT'", "'EXCEPTION'", "'EXCLUDED'", + "'EXEC'", "'EXECUTE'", "'EXISTS'", "'EXPLAIN'", "'EXTERNAL'", "'EXTRACT'", + "'DATE_ADD'", "'DATE_DIFF'", "'FALSE'", "'FETCH'", "'FIRST'", "'FLOAT'", + "'FOR'", "'FOREIGN'", "'FOUND'", "'FROM'", "'FULL'", "'GET'", "'GLOBAL'", + "'GO'", "'GOTO'", "'GRANT'", "'GROUP'", "'HAVING'", "'IDENTITY'", "'IMMEDIATE'", + "'IN'", "'INDICATOR'", "'INITIALLY'", "'INNER'", "'INPUT'", "'INSENSITIVE'", + "'INSERT'", "'INT'", "'INTEGER'", "'INTERSECT'", "'INTERVAL'", "'INTO'", + "'IS'", "'ISOLATION'", "'JOIN'", "'KEY'", "'LANGUAGE'", "'LAST'", "'LATERAL'", + "'LEFT'", "'LEVEL'", "'LIKE'", "'LOCAL'", "'LOWER'", "'MATCH'", "'MAX'", + "'MIN'", "'MODULE'", "'NAMES'", "'NATIONAL'", "'NATURAL'", "'NCHAR'", + "'NEXT'", "'NO'", "'NOT'", "'NULL'", "'NULLS'", "'NULLIF'", "'NUMERIC'", + "'OCTET_LENGTH'", "'OF'", "'ON'", "'ONLY'", "'OPEN'", "'OPTION'", "'OR'", + "'ORDER'", "'OUTER'", "'OUTPUT'", "'OVERLAPS'", "'OVERLAY'", "'PAD'", + "'PARTIAL'", "'PLACING'", "'POSITION'", "'PRECISION'", "'PREPARE'", + "'PRESERVE'", "'PRIMARY'", "'PRIOR'", "'PRIVILEGES'", "'PROCEDURE'", + "'PUBLIC'", "'READ'", "'REAL'", "'REFERENCES'", "'RELATIVE'", "'REPLACE'", + "'RESTRICT'", "'REVOKE'", "'RIGHT'", "'ROLLBACK'", "'ROWS'", "'SCHEMA'", + "'SCROLL'", "'SECTION'", "'SELECT'", "'SESSION'", "'SESSION_USER'", + "'SET'", "'SHORTEST'", "'SIZE'", "'SMALLINT'", "'SOME'", "'SPACE'", + "'SQL'", "'SQLCODE'", "'SQLERROR'", "'SQLSTATE'", "'SUBSTRING'", "'SUM'", + "'SYSTEM_USER'", "'TABLE'", "'TEMPORARY'", "'THEN'", "'TIME'", "'TIMESTAMP'", + "'TO'", "'TRANSACTION'", "'TRANSLATE'", "'TRANSLATION'", "'TRIM'", "'TRUE'", + "'UNION'", "'UNIQUE'", "'UNKNOWN'", "'UPDATE'", "'UPPER'", "'UPSERT'", + "'USAGE'", "'USER'", "'USING'", "'VALUE'", "'VALUES'", "'VARCHAR'", + "'VARYING'", "'VIEW'", "'WHEN'", "'WHENEVER'", "'WHERE'", "'WITH'", + "'WORK'", "'WRITE'", "'ZONE'", "'LAG'", "'LEAD'", "'OVER'", "'PARTITION'", + "'CAN_CAST'", "'CAN_LOSSLESS_CAST'", "'MISSING'", "'PIVOT'", "'UNPIVOT'", + "'LIMIT'", "'OFFSET'", "'REMOVE'", "'INDEX'", "'LET'", "'CONFLICT'", + "'DO'", "'RETURNING'", "'MODIFIED'", "'NEW'", "'OLD'", "'NOTHING'", + "'TUPLE'", "'INTEGER2'", "'INT2'", "'INTEGER4'", "'INT4'", "'INTEGER8'", + "'INT8'", "'BIGINT'", "'BOOL'", "'BOOLEAN'", "'STRING'", "'SYMBOL'", + "'CLOB'", "'BLOB'", "'STRUCT'", "'LIST'", "'SEXP'", "'BAG'", "'^'", + "','", "'+'", "'-'", "'/'", "'%'", "'@'", "'~'", "'*'", "'<='", "'>='", + "'='", "", "'||'", "'<'", "'>'", "'<<'", "'>>'", "'['", "']'", "'{'", + "'}'", "'('", "')'", "':'", "';'", "'?'", "'.'", + } + staticData.SymbolicNames = []string{ + "", "ABSOLUTE", "ACTION", "ADD", "ALL", "ALLOCATE", "ALTER", "AND", + "ANY", "ARE", "AS", "ASC", "ASSERTION", "AT", "AUTHORIZATION", "AVG", + "BEGIN", "BETWEEN", "BIT", "BIT_LENGTH", "BY", "CASCADE", "CASCADED", + "CASE", "CAST", "CATALOG", "CHAR", "CHARACTER", "CHARACTER_LENGTH", + "CHAR_LENGTH", "CHECK", "CLOSE", "COALESCE", "COLLATE", "COLLATION", + "COLUMN", "COMMIT", "CONNECT", "CONNECTION", "CONSTRAINT", "CONSTRAINTS", + "CONTINUE", "CONVERT", "CORRESPONDING", "COUNT", "CREATE", "CROSS", + "CURRENT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", + "CURSOR", "DATE", "DEALLOCATE", "DEC", "DECIMAL", "DECLARE", "DEFAULT", + "DEFERRABLE", "DEFERRED", "DELETE", "DESC", "DESCRIBE", "DESCRIPTOR", + "DIAGNOSTICS", "DISCONNECT", "DISTINCT", "DOMAIN", "DOUBLE", "DROP", + "ELSE", "END", "END_EXEC", "ESCAPE", "EXCEPT", "EXCEPTION", "EXCLUDED", + "EXEC", "EXECUTE", "EXISTS", "EXPLAIN", "EXTERNAL", "EXTRACT", "DATE_ADD", + "DATE_DIFF", "FALSE", "FETCH", "FIRST", "FLOAT", "FOR", "FOREIGN", "FOUND", + "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO", "GRANT", "GROUP", "HAVING", + "IDENTITY", "IMMEDIATE", "IN", "INDICATOR", "INITIALLY", "INNER", "INPUT", + "INSENSITIVE", "INSERT", "INT", "INTEGER", "INTERSECT", "INTERVAL", + "INTO", "IS", "ISOLATION", "JOIN", "KEY", "LANGUAGE", "LAST", "LATERAL", + "LEFT", "LEVEL", "LIKE", "LOCAL", "LOWER", "MATCH", "MAX", "MIN", "MODULE", + "NAMES", "NATIONAL", "NATURAL", "NCHAR", "NEXT", "NO", "NOT", "NULL", + "NULLS", "NULLIF", "NUMERIC", "OCTET_LENGTH", "OF", "ON", "ONLY", "OPEN", + "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "OVERLAY", "PAD", + "PARTIAL", "PLACING", "POSITION", "PRECISION", "PREPARE", "PRESERVE", + "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURE", "PUBLIC", "READ", "REAL", + "REFERENCES", "RELATIVE", "REPLACE", "RESTRICT", "REVOKE", "RIGHT", + "ROLLBACK", "ROWS", "SCHEMA", "SCROLL", "SECTION", "SELECT", "SESSION", + "SESSION_USER", "SET", "SHORTEST", "SIZE", "SMALLINT", "SOME", "SPACE", + "SQL", "SQLCODE", "SQLERROR", "SQLSTATE", "SUBSTRING", "SUM", "SYSTEM_USER", + "TABLE", "TEMPORARY", "THEN", "TIME", "TIMESTAMP", "TO", "TRANSACTION", + "TRANSLATE", "TRANSLATION", "TRIM", "TRUE", "UNION", "UNIQUE", "UNKNOWN", + "UPDATE", "UPPER", "UPSERT", "USAGE", "USER", "USING", "VALUE", "VALUES", + "VARCHAR", "VARYING", "VIEW", "WHEN", "WHENEVER", "WHERE", "WITH", "WORK", + "WRITE", "ZONE", "LAG", "LEAD", "OVER", "PARTITION", "CAN_CAST", "CAN_LOSSLESS_CAST", + "MISSING", "PIVOT", "UNPIVOT", "LIMIT", "OFFSET", "REMOVE", "INDEX", + "LET", "CONFLICT", "DO", "RETURNING", "MODIFIED", "NEW", "OLD", "NOTHING", + "TUPLE", "INTEGER2", "INT2", "INTEGER4", "INT4", "INTEGER8", "INT8", + "BIGINT", "BOOL", "BOOLEAN", "STRING", "SYMBOL", "CLOB", "BLOB", "STRUCT", + "LIST", "SEXP", "BAG", "CARET", "COMMA", "PLUS", "MINUS", "SLASH_FORWARD", + "PERCENT", "AT_SIGN", "TILDE", "ASTERISK", "LT_EQ", "GT_EQ", "EQ", "NEQ", + "CONCAT", "ANGLE_LEFT", "ANGLE_RIGHT", "ANGLE_DOUBLE_LEFT", "ANGLE_DOUBLE_RIGHT", + "BRACKET_LEFT", "BRACKET_RIGHT", "BRACE_LEFT", "BRACE_RIGHT", "PAREN_LEFT", + "PAREN_RIGHT", "COLON", "COLON_SEMI", "QUESTION_MARK", "PERIOD", "LITERAL_STRING", + "LITERAL_INTEGER", "LITERAL_DECIMAL", "IDENTIFIER", "IDENTIFIER_QUOTED", + "WS", "COMMENT_SINGLE", "COMMENT_BLOCK", "UNRECOGNIZED", "ION_CLOSURE", + "BACKTICK", + } + staticData.RuleNames = []string{ + "script", "root", "statement", "explainOption", "asIdent", "atIdent", + "byIdent", "symbolPrimitive", "dql", "execCommand", "ddl", "createCommand", + "dropCommand", "dml", "dmlBaseCommand", "pathSimple", "pathSimpleSteps", + "replaceCommand", "upsertCommand", "removeCommand", "insertCommandReturning", + "insertCommand", "onConflictClause", "conflictTarget", "constraintName", + "conflictAction", "doReplace", "doUpdate", "updateClause", "setCommand", + "setAssignment", "deleteCommand", "returningClause", "returningColumn", + "fromClauseSimple", "whereClause", "selectClause", "projectionItems", + "projectionItem", "setQuantifierStrategy", "letClause", "letBinding", + "orderByClause", "orderSortSpec", "groupClause", "groupAlias", "groupKey", + "over", "windowPartitionList", "windowSortSpecList", "havingClause", + "fromClause", "whereClauseSelect", "offsetByClause", "limitClause", + "gpmlPattern", "gpmlPatternList", "matchPattern", "graphPart", "matchSelector", + "patternPathVariable", "patternRestrictor", "node", "edge", "pattern", + "patternQuantifier", "edgeWSpec", "edgeSpec", "patternPartLabel", "edgeAbbrev", + "tableReference", "tableNonJoin", "tableBaseReference", "tableUnpivot", + "joinRhs", "joinSpec", "joinType", "expr", "exprBagOp", "exprSelect", + "exprOr", "exprAnd", "exprNot", "exprPredicate", "mathOp00", "mathOp01", + "mathOp02", "valueExpr", "exprPrimary", "exprTerm", "nullIf", "coalesce", + "caseExpr", "values", "valueRow", "valueList", "sequenceConstructor", + "substring", "aggregate", "windowFunction", "cast", "canLosslessCast", + "canCast", "extract", "trimFunction", "dateFunction", "functionCall", + "pathStep", "exprGraphMatchMany", "exprGraphMatchOne", "parameter", + "varRefExpr", "collection", "array", "bag", "tuple", "pair", "literal", + "type", + } + staticData.PredictionContextCache = antlr.NewPredictionContextCache() + staticData.serializedATN = []int32{ + 4, 1, 305, 1567, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, + 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, + 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, + 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, + 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, + 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, + 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, + 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, + 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, + 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, + 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, + 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, + 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, + 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, + 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, + 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, + 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, + 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, + 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, + 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, + 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, + 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, + 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, + 117, 2, 118, 7, 118, 1, 0, 1, 0, 1, 0, 5, 0, 242, 8, 0, 10, 0, 12, 0, 245, + 9, 0, 1, 0, 3, 0, 248, 8, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 5, 1, 257, 8, 1, 10, 1, 12, 1, 260, 9, 1, 1, 1, 1, 1, 3, 1, 264, 8, 1, + 3, 1, 266, 8, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 274, 8, 2, 1, + 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, + 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 5, 9, 297, 8, 9, 10, + 9, 12, 9, 300, 9, 9, 3, 9, 302, 8, 9, 1, 10, 1, 10, 3, 10, 306, 8, 10, + 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, + 11, 5, 11, 319, 8, 11, 10, 11, 12, 11, 322, 9, 11, 1, 11, 1, 11, 3, 11, + 326, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, + 12, 3, 12, 337, 8, 12, 1, 13, 1, 13, 4, 13, 341, 8, 13, 11, 13, 12, 13, + 342, 1, 13, 3, 13, 346, 8, 13, 1, 13, 3, 13, 349, 8, 13, 1, 13, 1, 13, + 3, 13, 353, 8, 13, 1, 13, 4, 13, 356, 8, 13, 11, 13, 12, 13, 357, 1, 13, + 3, 13, 361, 8, 13, 1, 13, 1, 13, 1, 13, 3, 13, 366, 8, 13, 1, 14, 1, 14, + 1, 14, 1, 14, 1, 14, 3, 14, 373, 8, 14, 1, 15, 1, 15, 5, 15, 377, 8, 15, + 10, 15, 12, 15, 380, 9, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, + 16, 1, 16, 1, 16, 1, 16, 3, 16, 392, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, + 3, 17, 398, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 406, + 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 3, 20, 420, 8, 20, 1, 20, 3, 20, 423, 8, 20, 1, 20, 3, + 20, 426, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 3, 21, + 435, 8, 21, 1, 21, 3, 21, 438, 8, 21, 1, 21, 1, 21, 1, 21, 1, 21, 3, 21, + 444, 8, 21, 1, 21, 1, 21, 3, 21, 448, 8, 21, 3, 21, 450, 8, 21, 1, 22, + 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 462, + 8, 22, 1, 22, 3, 22, 465, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 5, 23, 471, + 8, 23, 10, 23, 12, 23, 474, 9, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, + 23, 481, 8, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, + 1, 25, 1, 25, 3, 25, 493, 8, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, + 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 506, 8, 29, 10, 29, 12, 29, + 509, 9, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 3, 31, 518, + 8, 31, 1, 31, 3, 31, 521, 8, 31, 1, 32, 1, 32, 1, 32, 1, 32, 5, 32, 527, + 8, 32, 10, 32, 12, 32, 530, 9, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, + 33, 3, 33, 538, 8, 33, 1, 34, 1, 34, 1, 34, 3, 34, 543, 8, 34, 1, 34, 3, + 34, 546, 8, 34, 1, 34, 3, 34, 549, 8, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, + 34, 555, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 3, 36, 562, 8, 36, 1, + 36, 1, 36, 1, 36, 3, 36, 567, 8, 36, 1, 36, 1, 36, 1, 36, 3, 36, 572, 8, + 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 3, 36, 581, 8, 36, + 1, 37, 1, 37, 1, 37, 5, 37, 586, 8, 37, 10, 37, 12, 37, 589, 9, 37, 1, + 38, 1, 38, 3, 38, 593, 8, 38, 1, 38, 3, 38, 596, 8, 38, 1, 39, 1, 39, 1, + 40, 1, 40, 1, 40, 1, 40, 5, 40, 604, 8, 40, 10, 40, 12, 40, 607, 9, 40, + 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 618, + 8, 42, 10, 42, 12, 42, 621, 9, 42, 1, 43, 1, 43, 3, 43, 625, 8, 43, 1, + 43, 1, 43, 3, 43, 629, 8, 43, 1, 44, 1, 44, 3, 44, 633, 8, 44, 1, 44, 1, + 44, 1, 44, 1, 44, 5, 44, 639, 8, 44, 10, 44, 12, 44, 642, 9, 44, 1, 44, + 3, 44, 645, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 3, + 46, 654, 8, 46, 1, 47, 1, 47, 1, 47, 3, 47, 659, 8, 47, 1, 47, 3, 47, 662, + 8, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 671, 8, + 48, 10, 48, 12, 48, 674, 9, 48, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 5, 49, + 681, 8, 49, 10, 49, 12, 49, 684, 9, 49, 1, 50, 1, 50, 1, 50, 1, 51, 1, + 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, + 1, 55, 3, 55, 702, 8, 55, 1, 55, 1, 55, 1, 56, 3, 56, 707, 8, 56, 1, 56, + 1, 56, 1, 56, 5, 56, 712, 8, 56, 10, 56, 12, 56, 715, 9, 56, 1, 57, 3, + 57, 718, 8, 57, 1, 57, 3, 57, 721, 8, 57, 1, 57, 5, 57, 724, 8, 57, 10, + 57, 12, 57, 727, 9, 57, 1, 58, 1, 58, 1, 58, 3, 58, 732, 8, 58, 1, 59, + 1, 59, 1, 59, 1, 59, 3, 59, 738, 8, 59, 1, 59, 1, 59, 1, 59, 3, 59, 743, + 8, 59, 3, 59, 745, 8, 59, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 62, 1, + 62, 3, 62, 754, 8, 62, 1, 62, 3, 62, 757, 8, 62, 1, 62, 3, 62, 760, 8, + 62, 1, 62, 1, 62, 1, 63, 1, 63, 3, 63, 766, 8, 63, 1, 63, 1, 63, 3, 63, + 770, 8, 63, 3, 63, 772, 8, 63, 1, 64, 1, 64, 3, 64, 776, 8, 64, 1, 64, + 3, 64, 779, 8, 64, 1, 64, 4, 64, 782, 8, 64, 11, 64, 12, 64, 783, 1, 64, + 3, 64, 787, 8, 64, 1, 64, 1, 64, 3, 64, 791, 8, 64, 1, 64, 1, 64, 3, 64, + 795, 8, 64, 1, 64, 3, 64, 798, 8, 64, 1, 64, 4, 64, 801, 8, 64, 11, 64, + 12, 64, 802, 1, 64, 3, 64, 806, 8, 64, 1, 64, 1, 64, 3, 64, 810, 8, 64, + 3, 64, 812, 8, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 3, 65, 819, 8, 65, + 1, 65, 3, 65, 822, 8, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, + 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, + 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, + 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 858, 8, 66, 1, 67, + 1, 67, 3, 67, 862, 8, 67, 1, 67, 3, 67, 865, 8, 67, 1, 67, 3, 67, 868, + 8, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, + 69, 1, 69, 3, 69, 881, 8, 69, 1, 69, 1, 69, 3, 69, 885, 8, 69, 3, 69, 887, + 8, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 895, 8, 70, 1, + 70, 1, 70, 3, 70, 899, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, + 1, 70, 1, 70, 3, 70, 909, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 5, 70, 915, + 8, 70, 10, 70, 12, 70, 918, 9, 70, 1, 71, 1, 71, 3, 71, 922, 8, 71, 1, + 72, 1, 72, 1, 72, 1, 72, 1, 72, 3, 72, 929, 8, 72, 1, 72, 3, 72, 932, 8, + 72, 1, 72, 3, 72, 935, 8, 72, 1, 72, 1, 72, 3, 72, 939, 8, 72, 1, 72, 3, + 72, 942, 8, 72, 1, 72, 3, 72, 945, 8, 72, 3, 72, 947, 8, 72, 1, 73, 1, + 73, 1, 73, 3, 73, 952, 8, 73, 1, 73, 3, 73, 955, 8, 73, 1, 73, 3, 73, 958, + 8, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 3, 74, 965, 8, 74, 1, 75, 1, + 75, 1, 75, 1, 76, 1, 76, 1, 76, 3, 76, 973, 8, 76, 1, 76, 1, 76, 3, 76, + 977, 8, 76, 1, 76, 1, 76, 3, 76, 981, 8, 76, 1, 76, 3, 76, 984, 8, 76, + 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 3, 78, 993, 8, 78, 1, + 78, 1, 78, 3, 78, 997, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1002, 8, 78, + 1, 78, 1, 78, 3, 78, 1006, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1011, 8, + 78, 1, 78, 1, 78, 3, 78, 1015, 8, 78, 1, 78, 5, 78, 1018, 8, 78, 10, 78, + 12, 78, 1021, 9, 78, 1, 79, 1, 79, 1, 79, 3, 79, 1026, 8, 79, 1, 79, 3, + 79, 1029, 8, 79, 1, 79, 3, 79, 1032, 8, 79, 1, 79, 3, 79, 1035, 8, 79, + 1, 79, 3, 79, 1038, 8, 79, 1, 79, 3, 79, 1041, 8, 79, 1, 79, 3, 79, 1044, + 8, 79, 1, 79, 3, 79, 1047, 8, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, + 80, 5, 80, 1055, 8, 80, 10, 80, 12, 80, 1058, 9, 80, 1, 81, 1, 81, 1, 81, + 1, 81, 1, 81, 1, 81, 5, 81, 1066, 8, 81, 10, 81, 12, 81, 1069, 9, 81, 1, + 82, 1, 82, 1, 82, 3, 82, 1074, 8, 82, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, + 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1085, 8, 83, 1, 83, 1, 83, 1, 83, 3, + 83, 1090, 8, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, + 1099, 8, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1105, 8, 83, 1, 83, 1, + 83, 1, 83, 1, 83, 3, 83, 1111, 8, 83, 1, 83, 1, 83, 3, 83, 1115, 8, 83, + 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 5, 83, 1122, 8, 83, 10, 83, 12, 83, + 1125, 9, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 5, 84, 1133, 8, + 84, 10, 84, 12, 84, 1136, 9, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, + 85, 5, 85, 1144, 8, 85, 10, 85, 12, 85, 1147, 9, 85, 1, 86, 1, 86, 1, 86, + 1, 86, 1, 86, 1, 86, 5, 86, 1155, 8, 86, 10, 86, 12, 86, 1158, 9, 86, 1, + 87, 1, 87, 1, 87, 3, 87, 1163, 8, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, + 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, + 88, 1, 88, 1, 88, 1, 88, 3, 88, 1184, 8, 88, 1, 88, 1, 88, 4, 88, 1188, + 8, 88, 11, 88, 12, 88, 1189, 5, 88, 1192, 8, 88, 10, 88, 12, 88, 1195, + 9, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 3, + 89, 1206, 8, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, + 1, 91, 1, 91, 1, 91, 1, 91, 5, 91, 1220, 8, 91, 10, 91, 12, 91, 1223, 9, + 91, 1, 91, 1, 91, 1, 92, 1, 92, 3, 92, 1229, 8, 92, 1, 92, 1, 92, 1, 92, + 1, 92, 1, 92, 4, 92, 1236, 8, 92, 11, 92, 12, 92, 1237, 1, 92, 1, 92, 3, + 92, 1242, 8, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 5, 93, 1250, + 8, 93, 10, 93, 12, 93, 1253, 9, 93, 1, 94, 1, 94, 1, 94, 1, 94, 5, 94, + 1259, 8, 94, 10, 94, 12, 94, 1262, 9, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, + 95, 1, 95, 4, 95, 1270, 8, 95, 11, 95, 12, 95, 1271, 1, 95, 1, 95, 1, 96, + 1, 96, 1, 96, 1, 96, 1, 96, 5, 96, 1281, 8, 96, 10, 96, 12, 96, 1284, 9, + 96, 3, 96, 1286, 8, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, + 1, 97, 1, 97, 3, 97, 1297, 8, 97, 3, 97, 1299, 8, 97, 1, 97, 1, 97, 1, + 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 3, 97, 1310, 8, 97, 3, 97, + 1312, 8, 97, 1, 97, 1, 97, 3, 97, 1316, 8, 97, 1, 98, 1, 98, 1, 98, 1, + 98, 1, 98, 1, 98, 1, 98, 3, 98, 1325, 8, 98, 1, 98, 1, 98, 1, 98, 3, 98, + 1330, 8, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 3, 99, 1339, + 8, 99, 3, 99, 1341, 8, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, + 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, + 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, + 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, + 1, 104, 3, 104, 1377, 8, 104, 1, 104, 3, 104, 1380, 8, 104, 1, 104, 3, + 104, 1383, 8, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, + 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, 1, 106, + 1, 106, 5, 106, 1402, 8, 106, 10, 106, 12, 106, 1405, 9, 106, 3, 106, 1407, + 8, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 5, 106, 1415, 8, + 106, 10, 106, 12, 106, 1418, 9, 106, 3, 106, 1420, 8, 106, 1, 106, 1, 106, + 3, 106, 1424, 8, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, + 107, 1, 107, 1, 107, 1, 107, 1, 107, 3, 107, 1437, 8, 107, 1, 108, 1, 108, + 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, + 1, 110, 1, 111, 3, 111, 1452, 8, 111, 1, 111, 1, 111, 1, 112, 1, 112, 3, + 112, 1458, 8, 112, 1, 113, 1, 113, 1, 113, 1, 113, 5, 113, 1464, 8, 113, + 10, 113, 12, 113, 1467, 9, 113, 3, 113, 1469, 8, 113, 1, 113, 1, 113, 1, + 114, 1, 114, 1, 114, 1, 114, 5, 114, 1477, 8, 114, 10, 114, 12, 114, 1480, + 9, 114, 3, 114, 1482, 8, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, + 115, 5, 115, 1490, 8, 115, 10, 115, 12, 115, 1493, 9, 115, 3, 115, 1495, + 8, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, + 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, + 1, 117, 1, 117, 1, 117, 3, 117, 1517, 8, 117, 1, 117, 1, 117, 1, 117, 3, + 117, 1522, 8, 117, 1, 117, 3, 117, 1525, 8, 117, 1, 118, 1, 118, 1, 118, + 1, 118, 1, 118, 1, 118, 1, 118, 3, 118, 1534, 8, 118, 1, 118, 1, 118, 1, + 118, 1, 118, 1, 118, 3, 118, 1541, 8, 118, 1, 118, 1, 118, 1, 118, 1, 118, + 1, 118, 3, 118, 1548, 8, 118, 1, 118, 3, 118, 1551, 8, 118, 1, 118, 1, + 118, 1, 118, 1, 118, 3, 118, 1557, 8, 118, 1, 118, 1, 118, 1, 118, 3, 118, + 1562, 8, 118, 1, 118, 3, 118, 1565, 8, 118, 1, 118, 0, 9, 140, 156, 160, + 162, 166, 168, 170, 172, 176, 119, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, + 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, + 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, + 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, + 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, + 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, + 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, + 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 0, 19, 1, 0, + 298, 299, 2, 0, 4, 4, 245, 245, 1, 0, 246, 247, 2, 0, 4, 4, 67, 67, 2, + 0, 11, 11, 62, 62, 2, 0, 88, 88, 121, 121, 2, 0, 4, 4, 8, 8, 2, 0, 269, + 269, 275, 275, 2, 0, 276, 279, 281, 282, 1, 0, 269, 270, 2, 0, 271, 272, + 275, 275, 1, 0, 264, 265, 4, 0, 15, 15, 44, 44, 129, 130, 194, 194, 1, + 0, 228, 229, 1, 0, 84, 85, 8, 0, 19, 19, 28, 29, 44, 44, 80, 80, 127, 127, + 143, 143, 185, 185, 211, 211, 10, 0, 8, 8, 26, 27, 53, 53, 111, 112, 139, + 139, 168, 168, 186, 186, 200, 200, 234, 234, 249, 266, 3, 0, 26, 27, 89, + 89, 218, 218, 2, 0, 55, 56, 142, 142, 1715, 0, 238, 1, 0, 0, 0, 2, 265, + 1, 0, 0, 0, 4, 273, 1, 0, 0, 0, 6, 275, 1, 0, 0, 0, 8, 278, 1, 0, 0, 0, + 10, 281, 1, 0, 0, 0, 12, 284, 1, 0, 0, 0, 14, 287, 1, 0, 0, 0, 16, 289, + 1, 0, 0, 0, 18, 291, 1, 0, 0, 0, 20, 305, 1, 0, 0, 0, 22, 325, 1, 0, 0, + 0, 24, 336, 1, 0, 0, 0, 26, 365, 1, 0, 0, 0, 28, 372, 1, 0, 0, 0, 30, 374, + 1, 0, 0, 0, 32, 391, 1, 0, 0, 0, 34, 393, 1, 0, 0, 0, 36, 401, 1, 0, 0, + 0, 38, 409, 1, 0, 0, 0, 40, 412, 1, 0, 0, 0, 42, 449, 1, 0, 0, 0, 44, 464, + 1, 0, 0, 0, 46, 480, 1, 0, 0, 0, 48, 482, 1, 0, 0, 0, 50, 492, 1, 0, 0, + 0, 52, 494, 1, 0, 0, 0, 54, 496, 1, 0, 0, 0, 56, 498, 1, 0, 0, 0, 58, 501, + 1, 0, 0, 0, 60, 510, 1, 0, 0, 0, 62, 514, 1, 0, 0, 0, 64, 522, 1, 0, 0, + 0, 66, 537, 1, 0, 0, 0, 68, 554, 1, 0, 0, 0, 70, 556, 1, 0, 0, 0, 72, 580, + 1, 0, 0, 0, 74, 582, 1, 0, 0, 0, 76, 590, 1, 0, 0, 0, 78, 597, 1, 0, 0, + 0, 80, 599, 1, 0, 0, 0, 82, 608, 1, 0, 0, 0, 84, 612, 1, 0, 0, 0, 86, 622, + 1, 0, 0, 0, 88, 630, 1, 0, 0, 0, 90, 646, 1, 0, 0, 0, 92, 650, 1, 0, 0, + 0, 94, 655, 1, 0, 0, 0, 96, 665, 1, 0, 0, 0, 98, 675, 1, 0, 0, 0, 100, + 685, 1, 0, 0, 0, 102, 688, 1, 0, 0, 0, 104, 691, 1, 0, 0, 0, 106, 694, + 1, 0, 0, 0, 108, 697, 1, 0, 0, 0, 110, 701, 1, 0, 0, 0, 112, 706, 1, 0, + 0, 0, 114, 717, 1, 0, 0, 0, 116, 731, 1, 0, 0, 0, 118, 744, 1, 0, 0, 0, + 120, 746, 1, 0, 0, 0, 122, 749, 1, 0, 0, 0, 124, 751, 1, 0, 0, 0, 126, + 771, 1, 0, 0, 0, 128, 811, 1, 0, 0, 0, 130, 821, 1, 0, 0, 0, 132, 857, + 1, 0, 0, 0, 134, 859, 1, 0, 0, 0, 136, 871, 1, 0, 0, 0, 138, 886, 1, 0, + 0, 0, 140, 894, 1, 0, 0, 0, 142, 921, 1, 0, 0, 0, 144, 946, 1, 0, 0, 0, + 146, 948, 1, 0, 0, 0, 148, 964, 1, 0, 0, 0, 150, 966, 1, 0, 0, 0, 152, + 983, 1, 0, 0, 0, 154, 985, 1, 0, 0, 0, 156, 987, 1, 0, 0, 0, 158, 1046, + 1, 0, 0, 0, 160, 1048, 1, 0, 0, 0, 162, 1059, 1, 0, 0, 0, 164, 1073, 1, + 0, 0, 0, 166, 1075, 1, 0, 0, 0, 168, 1126, 1, 0, 0, 0, 170, 1137, 1, 0, + 0, 0, 172, 1148, 1, 0, 0, 0, 174, 1162, 1, 0, 0, 0, 176, 1183, 1, 0, 0, + 0, 178, 1205, 1, 0, 0, 0, 180, 1207, 1, 0, 0, 0, 182, 1214, 1, 0, 0, 0, + 184, 1226, 1, 0, 0, 0, 186, 1245, 1, 0, 0, 0, 188, 1254, 1, 0, 0, 0, 190, + 1265, 1, 0, 0, 0, 192, 1275, 1, 0, 0, 0, 194, 1315, 1, 0, 0, 0, 196, 1329, + 1, 0, 0, 0, 198, 1331, 1, 0, 0, 0, 200, 1345, 1, 0, 0, 0, 202, 1352, 1, + 0, 0, 0, 204, 1359, 1, 0, 0, 0, 206, 1366, 1, 0, 0, 0, 208, 1373, 1, 0, + 0, 0, 210, 1387, 1, 0, 0, 0, 212, 1423, 1, 0, 0, 0, 214, 1436, 1, 0, 0, + 0, 216, 1438, 1, 0, 0, 0, 218, 1444, 1, 0, 0, 0, 220, 1448, 1, 0, 0, 0, + 222, 1451, 1, 0, 0, 0, 224, 1457, 1, 0, 0, 0, 226, 1459, 1, 0, 0, 0, 228, + 1472, 1, 0, 0, 0, 230, 1485, 1, 0, 0, 0, 232, 1498, 1, 0, 0, 0, 234, 1524, + 1, 0, 0, 0, 236, 1564, 1, 0, 0, 0, 238, 243, 3, 2, 1, 0, 239, 240, 5, 292, + 0, 0, 240, 242, 3, 2, 1, 0, 241, 239, 1, 0, 0, 0, 242, 245, 1, 0, 0, 0, + 243, 241, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 247, 1, 0, 0, 0, 245, + 243, 1, 0, 0, 0, 246, 248, 5, 292, 0, 0, 247, 246, 1, 0, 0, 0, 247, 248, + 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 250, 5, 0, 0, 1, 250, 1, 1, 0, 0, + 0, 251, 263, 5, 81, 0, 0, 252, 253, 5, 289, 0, 0, 253, 258, 3, 6, 3, 0, + 254, 255, 5, 268, 0, 0, 255, 257, 3, 6, 3, 0, 256, 254, 1, 0, 0, 0, 257, + 260, 1, 0, 0, 0, 258, 256, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 261, + 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 261, 262, 5, 290, 0, 0, 262, 264, 1, + 0, 0, 0, 263, 252, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 266, 1, 0, 0, + 0, 265, 251, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, + 268, 3, 4, 2, 0, 268, 3, 1, 0, 0, 0, 269, 274, 3, 16, 8, 0, 270, 274, 3, + 26, 13, 0, 271, 274, 3, 20, 10, 0, 272, 274, 3, 18, 9, 0, 273, 269, 1, + 0, 0, 0, 273, 270, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 273, 272, 1, 0, 0, + 0, 274, 5, 1, 0, 0, 0, 275, 276, 5, 298, 0, 0, 276, 277, 5, 298, 0, 0, + 277, 7, 1, 0, 0, 0, 278, 279, 5, 10, 0, 0, 279, 280, 3, 14, 7, 0, 280, + 9, 1, 0, 0, 0, 281, 282, 5, 13, 0, 0, 282, 283, 3, 14, 7, 0, 283, 11, 1, + 0, 0, 0, 284, 285, 5, 20, 0, 0, 285, 286, 3, 14, 7, 0, 286, 13, 1, 0, 0, + 0, 287, 288, 7, 0, 0, 0, 288, 15, 1, 0, 0, 0, 289, 290, 3, 154, 77, 0, + 290, 17, 1, 0, 0, 0, 291, 292, 5, 78, 0, 0, 292, 301, 3, 154, 77, 0, 293, + 298, 3, 154, 77, 0, 294, 295, 5, 268, 0, 0, 295, 297, 3, 154, 77, 0, 296, + 294, 1, 0, 0, 0, 297, 300, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 298, 299, + 1, 0, 0, 0, 299, 302, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 301, 293, 1, 0, + 0, 0, 301, 302, 1, 0, 0, 0, 302, 19, 1, 0, 0, 0, 303, 306, 3, 22, 11, 0, + 304, 306, 3, 24, 12, 0, 305, 303, 1, 0, 0, 0, 305, 304, 1, 0, 0, 0, 306, + 21, 1, 0, 0, 0, 307, 308, 5, 45, 0, 0, 308, 309, 5, 196, 0, 0, 309, 326, + 3, 14, 7, 0, 310, 311, 5, 45, 0, 0, 311, 312, 5, 240, 0, 0, 312, 313, 5, + 145, 0, 0, 313, 314, 3, 14, 7, 0, 314, 315, 5, 289, 0, 0, 315, 320, 3, + 30, 15, 0, 316, 317, 5, 268, 0, 0, 317, 319, 3, 30, 15, 0, 318, 316, 1, + 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, + 0, 321, 323, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 324, 5, 290, 0, 0, + 324, 326, 1, 0, 0, 0, 325, 307, 1, 0, 0, 0, 325, 310, 1, 0, 0, 0, 326, + 23, 1, 0, 0, 0, 327, 328, 5, 70, 0, 0, 328, 329, 5, 196, 0, 0, 329, 337, + 3, 14, 7, 0, 330, 331, 5, 70, 0, 0, 331, 332, 5, 240, 0, 0, 332, 333, 3, + 14, 7, 0, 333, 334, 5, 145, 0, 0, 334, 335, 3, 14, 7, 0, 335, 337, 1, 0, + 0, 0, 336, 327, 1, 0, 0, 0, 336, 330, 1, 0, 0, 0, 337, 25, 1, 0, 0, 0, + 338, 340, 3, 56, 28, 0, 339, 341, 3, 28, 14, 0, 340, 339, 1, 0, 0, 0, 341, + 342, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 345, + 1, 0, 0, 0, 344, 346, 3, 70, 35, 0, 345, 344, 1, 0, 0, 0, 345, 346, 1, + 0, 0, 0, 346, 348, 1, 0, 0, 0, 347, 349, 3, 64, 32, 0, 348, 347, 1, 0, + 0, 0, 348, 349, 1, 0, 0, 0, 349, 366, 1, 0, 0, 0, 350, 352, 3, 102, 51, + 0, 351, 353, 3, 70, 35, 0, 352, 351, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, + 353, 355, 1, 0, 0, 0, 354, 356, 3, 28, 14, 0, 355, 354, 1, 0, 0, 0, 356, + 357, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 357, 358, 1, 0, 0, 0, 358, 360, + 1, 0, 0, 0, 359, 361, 3, 64, 32, 0, 360, 359, 1, 0, 0, 0, 360, 361, 1, + 0, 0, 0, 361, 366, 1, 0, 0, 0, 362, 366, 3, 62, 31, 0, 363, 366, 3, 40, + 20, 0, 364, 366, 3, 28, 14, 0, 365, 338, 1, 0, 0, 0, 365, 350, 1, 0, 0, + 0, 365, 362, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 365, 364, 1, 0, 0, 0, 366, + 27, 1, 0, 0, 0, 367, 373, 3, 42, 21, 0, 368, 373, 3, 58, 29, 0, 369, 373, + 3, 34, 17, 0, 370, 373, 3, 38, 19, 0, 371, 373, 3, 36, 18, 0, 372, 367, + 1, 0, 0, 0, 372, 368, 1, 0, 0, 0, 372, 369, 1, 0, 0, 0, 372, 370, 1, 0, + 0, 0, 372, 371, 1, 0, 0, 0, 373, 29, 1, 0, 0, 0, 374, 378, 3, 14, 7, 0, + 375, 377, 3, 32, 16, 0, 376, 375, 1, 0, 0, 0, 377, 380, 1, 0, 0, 0, 378, + 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 31, 1, 0, 0, 0, 380, 378, 1, + 0, 0, 0, 381, 382, 5, 285, 0, 0, 382, 383, 3, 234, 117, 0, 383, 384, 5, + 286, 0, 0, 384, 392, 1, 0, 0, 0, 385, 386, 5, 285, 0, 0, 386, 387, 3, 14, + 7, 0, 387, 388, 5, 286, 0, 0, 388, 392, 1, 0, 0, 0, 389, 390, 5, 294, 0, + 0, 390, 392, 3, 14, 7, 0, 391, 381, 1, 0, 0, 0, 391, 385, 1, 0, 0, 0, 391, + 389, 1, 0, 0, 0, 392, 33, 1, 0, 0, 0, 393, 394, 5, 171, 0, 0, 394, 395, + 5, 115, 0, 0, 395, 397, 3, 14, 7, 0, 396, 398, 3, 8, 4, 0, 397, 396, 1, + 0, 0, 0, 397, 398, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 400, 3, 154, + 77, 0, 400, 35, 1, 0, 0, 0, 401, 402, 5, 212, 0, 0, 402, 403, 5, 115, 0, + 0, 403, 405, 3, 14, 7, 0, 404, 406, 3, 8, 4, 0, 405, 404, 1, 0, 0, 0, 405, + 406, 1, 0, 0, 0, 406, 407, 1, 0, 0, 0, 407, 408, 3, 154, 77, 0, 408, 37, + 1, 0, 0, 0, 409, 410, 5, 239, 0, 0, 410, 411, 3, 30, 15, 0, 411, 39, 1, + 0, 0, 0, 412, 413, 5, 110, 0, 0, 413, 414, 5, 115, 0, 0, 414, 415, 3, 30, + 15, 0, 415, 416, 5, 216, 0, 0, 416, 419, 3, 154, 77, 0, 417, 418, 5, 13, + 0, 0, 418, 420, 3, 154, 77, 0, 419, 417, 1, 0, 0, 0, 419, 420, 1, 0, 0, + 0, 420, 422, 1, 0, 0, 0, 421, 423, 3, 44, 22, 0, 422, 421, 1, 0, 0, 0, + 422, 423, 1, 0, 0, 0, 423, 425, 1, 0, 0, 0, 424, 426, 3, 64, 32, 0, 425, + 424, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 41, 1, 0, 0, 0, 427, 428, 5, + 110, 0, 0, 428, 429, 5, 115, 0, 0, 429, 430, 3, 30, 15, 0, 430, 431, 5, + 216, 0, 0, 431, 434, 3, 154, 77, 0, 432, 433, 5, 13, 0, 0, 433, 435, 3, + 154, 77, 0, 434, 432, 1, 0, 0, 0, 434, 435, 1, 0, 0, 0, 435, 437, 1, 0, + 0, 0, 436, 438, 3, 44, 22, 0, 437, 436, 1, 0, 0, 0, 437, 438, 1, 0, 0, + 0, 438, 450, 1, 0, 0, 0, 439, 440, 5, 110, 0, 0, 440, 441, 5, 115, 0, 0, + 441, 443, 3, 14, 7, 0, 442, 444, 3, 8, 4, 0, 443, 442, 1, 0, 0, 0, 443, + 444, 1, 0, 0, 0, 444, 445, 1, 0, 0, 0, 445, 447, 3, 154, 77, 0, 446, 448, + 3, 44, 22, 0, 447, 446, 1, 0, 0, 0, 447, 448, 1, 0, 0, 0, 448, 450, 1, + 0, 0, 0, 449, 427, 1, 0, 0, 0, 449, 439, 1, 0, 0, 0, 450, 43, 1, 0, 0, + 0, 451, 452, 5, 145, 0, 0, 452, 453, 5, 242, 0, 0, 453, 454, 5, 223, 0, + 0, 454, 455, 3, 154, 77, 0, 455, 456, 5, 243, 0, 0, 456, 457, 5, 248, 0, + 0, 457, 465, 1, 0, 0, 0, 458, 459, 5, 145, 0, 0, 459, 461, 5, 242, 0, 0, + 460, 462, 3, 46, 23, 0, 461, 460, 1, 0, 0, 0, 461, 462, 1, 0, 0, 0, 462, + 463, 1, 0, 0, 0, 463, 465, 3, 50, 25, 0, 464, 451, 1, 0, 0, 0, 464, 458, + 1, 0, 0, 0, 465, 45, 1, 0, 0, 0, 466, 467, 5, 289, 0, 0, 467, 472, 3, 14, + 7, 0, 468, 469, 5, 268, 0, 0, 469, 471, 3, 14, 7, 0, 470, 468, 1, 0, 0, + 0, 471, 474, 1, 0, 0, 0, 472, 470, 1, 0, 0, 0, 472, 473, 1, 0, 0, 0, 473, + 475, 1, 0, 0, 0, 474, 472, 1, 0, 0, 0, 475, 476, 5, 290, 0, 0, 476, 481, + 1, 0, 0, 0, 477, 478, 5, 145, 0, 0, 478, 479, 5, 39, 0, 0, 479, 481, 3, + 48, 24, 0, 480, 466, 1, 0, 0, 0, 480, 477, 1, 0, 0, 0, 481, 47, 1, 0, 0, + 0, 482, 483, 3, 14, 7, 0, 483, 49, 1, 0, 0, 0, 484, 485, 5, 243, 0, 0, + 485, 493, 5, 248, 0, 0, 486, 487, 5, 243, 0, 0, 487, 488, 5, 171, 0, 0, + 488, 493, 3, 52, 26, 0, 489, 490, 5, 243, 0, 0, 490, 491, 5, 210, 0, 0, + 491, 493, 3, 54, 27, 0, 492, 484, 1, 0, 0, 0, 492, 486, 1, 0, 0, 0, 492, + 489, 1, 0, 0, 0, 493, 51, 1, 0, 0, 0, 494, 495, 5, 77, 0, 0, 495, 53, 1, + 0, 0, 0, 496, 497, 5, 77, 0, 0, 497, 55, 1, 0, 0, 0, 498, 499, 5, 210, + 0, 0, 499, 500, 3, 144, 72, 0, 500, 57, 1, 0, 0, 0, 501, 502, 5, 183, 0, + 0, 502, 507, 3, 60, 30, 0, 503, 504, 5, 268, 0, 0, 504, 506, 3, 60, 30, + 0, 505, 503, 1, 0, 0, 0, 506, 509, 1, 0, 0, 0, 507, 505, 1, 0, 0, 0, 507, + 508, 1, 0, 0, 0, 508, 59, 1, 0, 0, 0, 509, 507, 1, 0, 0, 0, 510, 511, 3, + 30, 15, 0, 511, 512, 5, 278, 0, 0, 512, 513, 3, 154, 77, 0, 513, 61, 1, + 0, 0, 0, 514, 515, 5, 61, 0, 0, 515, 517, 3, 68, 34, 0, 516, 518, 3, 70, + 35, 0, 517, 516, 1, 0, 0, 0, 517, 518, 1, 0, 0, 0, 518, 520, 1, 0, 0, 0, + 519, 521, 3, 64, 32, 0, 520, 519, 1, 0, 0, 0, 520, 521, 1, 0, 0, 0, 521, + 63, 1, 0, 0, 0, 522, 523, 5, 244, 0, 0, 523, 528, 3, 66, 33, 0, 524, 525, + 5, 268, 0, 0, 525, 527, 3, 66, 33, 0, 526, 524, 1, 0, 0, 0, 527, 530, 1, + 0, 0, 0, 528, 526, 1, 0, 0, 0, 528, 529, 1, 0, 0, 0, 529, 65, 1, 0, 0, + 0, 530, 528, 1, 0, 0, 0, 531, 532, 7, 1, 0, 0, 532, 533, 7, 2, 0, 0, 533, + 538, 5, 275, 0, 0, 534, 535, 7, 1, 0, 0, 535, 536, 7, 2, 0, 0, 536, 538, + 3, 154, 77, 0, 537, 531, 1, 0, 0, 0, 537, 534, 1, 0, 0, 0, 538, 67, 1, + 0, 0, 0, 539, 540, 5, 93, 0, 0, 540, 542, 3, 30, 15, 0, 541, 543, 3, 8, + 4, 0, 542, 541, 1, 0, 0, 0, 542, 543, 1, 0, 0, 0, 543, 545, 1, 0, 0, 0, + 544, 546, 3, 10, 5, 0, 545, 544, 1, 0, 0, 0, 545, 546, 1, 0, 0, 0, 546, + 548, 1, 0, 0, 0, 547, 549, 3, 12, 6, 0, 548, 547, 1, 0, 0, 0, 548, 549, + 1, 0, 0, 0, 549, 555, 1, 0, 0, 0, 550, 551, 5, 93, 0, 0, 551, 552, 3, 30, + 15, 0, 552, 553, 3, 14, 7, 0, 553, 555, 1, 0, 0, 0, 554, 539, 1, 0, 0, + 0, 554, 550, 1, 0, 0, 0, 555, 69, 1, 0, 0, 0, 556, 557, 5, 223, 0, 0, 557, + 558, 3, 154, 77, 0, 558, 71, 1, 0, 0, 0, 559, 561, 5, 180, 0, 0, 560, 562, + 3, 78, 39, 0, 561, 560, 1, 0, 0, 0, 561, 562, 1, 0, 0, 0, 562, 563, 1, + 0, 0, 0, 563, 581, 5, 275, 0, 0, 564, 566, 5, 180, 0, 0, 565, 567, 3, 78, + 39, 0, 566, 565, 1, 0, 0, 0, 566, 567, 1, 0, 0, 0, 567, 568, 1, 0, 0, 0, + 568, 581, 3, 74, 37, 0, 569, 571, 5, 180, 0, 0, 570, 572, 3, 78, 39, 0, + 571, 570, 1, 0, 0, 0, 571, 572, 1, 0, 0, 0, 572, 573, 1, 0, 0, 0, 573, + 574, 5, 216, 0, 0, 574, 581, 3, 154, 77, 0, 575, 576, 5, 235, 0, 0, 576, + 577, 3, 154, 77, 0, 577, 578, 5, 13, 0, 0, 578, 579, 3, 154, 77, 0, 579, + 581, 1, 0, 0, 0, 580, 559, 1, 0, 0, 0, 580, 564, 1, 0, 0, 0, 580, 569, + 1, 0, 0, 0, 580, 575, 1, 0, 0, 0, 581, 73, 1, 0, 0, 0, 582, 587, 3, 76, + 38, 0, 583, 584, 5, 268, 0, 0, 584, 586, 3, 76, 38, 0, 585, 583, 1, 0, + 0, 0, 586, 589, 1, 0, 0, 0, 587, 585, 1, 0, 0, 0, 587, 588, 1, 0, 0, 0, + 588, 75, 1, 0, 0, 0, 589, 587, 1, 0, 0, 0, 590, 595, 3, 154, 77, 0, 591, + 593, 5, 10, 0, 0, 592, 591, 1, 0, 0, 0, 592, 593, 1, 0, 0, 0, 593, 594, + 1, 0, 0, 0, 594, 596, 3, 14, 7, 0, 595, 592, 1, 0, 0, 0, 595, 596, 1, 0, + 0, 0, 596, 77, 1, 0, 0, 0, 597, 598, 7, 3, 0, 0, 598, 79, 1, 0, 0, 0, 599, + 600, 5, 241, 0, 0, 600, 605, 3, 82, 41, 0, 601, 602, 5, 268, 0, 0, 602, + 604, 3, 82, 41, 0, 603, 601, 1, 0, 0, 0, 604, 607, 1, 0, 0, 0, 605, 603, + 1, 0, 0, 0, 605, 606, 1, 0, 0, 0, 606, 81, 1, 0, 0, 0, 607, 605, 1, 0, + 0, 0, 608, 609, 3, 154, 77, 0, 609, 610, 5, 10, 0, 0, 610, 611, 3, 14, + 7, 0, 611, 83, 1, 0, 0, 0, 612, 613, 5, 150, 0, 0, 613, 614, 5, 20, 0, + 0, 614, 619, 3, 86, 43, 0, 615, 616, 5, 268, 0, 0, 616, 618, 3, 86, 43, + 0, 617, 615, 1, 0, 0, 0, 618, 621, 1, 0, 0, 0, 619, 617, 1, 0, 0, 0, 619, + 620, 1, 0, 0, 0, 620, 85, 1, 0, 0, 0, 621, 619, 1, 0, 0, 0, 622, 624, 3, + 154, 77, 0, 623, 625, 7, 4, 0, 0, 624, 623, 1, 0, 0, 0, 624, 625, 1, 0, + 0, 0, 625, 628, 1, 0, 0, 0, 626, 627, 5, 140, 0, 0, 627, 629, 7, 5, 0, + 0, 628, 626, 1, 0, 0, 0, 628, 629, 1, 0, 0, 0, 629, 87, 1, 0, 0, 0, 630, + 632, 5, 100, 0, 0, 631, 633, 5, 156, 0, 0, 632, 631, 1, 0, 0, 0, 632, 633, + 1, 0, 0, 0, 633, 634, 1, 0, 0, 0, 634, 635, 5, 20, 0, 0, 635, 640, 3, 92, + 46, 0, 636, 637, 5, 268, 0, 0, 637, 639, 3, 92, 46, 0, 638, 636, 1, 0, + 0, 0, 639, 642, 1, 0, 0, 0, 640, 638, 1, 0, 0, 0, 640, 641, 1, 0, 0, 0, + 641, 644, 1, 0, 0, 0, 642, 640, 1, 0, 0, 0, 643, 645, 3, 90, 45, 0, 644, + 643, 1, 0, 0, 0, 644, 645, 1, 0, 0, 0, 645, 89, 1, 0, 0, 0, 646, 647, 5, + 100, 0, 0, 647, 648, 5, 10, 0, 0, 648, 649, 3, 14, 7, 0, 649, 91, 1, 0, + 0, 0, 650, 653, 3, 158, 79, 0, 651, 652, 5, 10, 0, 0, 652, 654, 3, 14, + 7, 0, 653, 651, 1, 0, 0, 0, 653, 654, 1, 0, 0, 0, 654, 93, 1, 0, 0, 0, + 655, 656, 5, 230, 0, 0, 656, 658, 5, 289, 0, 0, 657, 659, 3, 96, 48, 0, + 658, 657, 1, 0, 0, 0, 658, 659, 1, 0, 0, 0, 659, 661, 1, 0, 0, 0, 660, + 662, 3, 98, 49, 0, 661, 660, 1, 0, 0, 0, 661, 662, 1, 0, 0, 0, 662, 663, + 1, 0, 0, 0, 663, 664, 5, 290, 0, 0, 664, 95, 1, 0, 0, 0, 665, 666, 5, 231, + 0, 0, 666, 667, 5, 20, 0, 0, 667, 672, 3, 154, 77, 0, 668, 669, 5, 268, + 0, 0, 669, 671, 3, 154, 77, 0, 670, 668, 1, 0, 0, 0, 671, 674, 1, 0, 0, + 0, 672, 670, 1, 0, 0, 0, 672, 673, 1, 0, 0, 0, 673, 97, 1, 0, 0, 0, 674, + 672, 1, 0, 0, 0, 675, 676, 5, 150, 0, 0, 676, 677, 5, 20, 0, 0, 677, 682, + 3, 86, 43, 0, 678, 679, 5, 268, 0, 0, 679, 681, 3, 86, 43, 0, 680, 678, + 1, 0, 0, 0, 681, 684, 1, 0, 0, 0, 682, 680, 1, 0, 0, 0, 682, 683, 1, 0, + 0, 0, 683, 99, 1, 0, 0, 0, 684, 682, 1, 0, 0, 0, 685, 686, 5, 101, 0, 0, + 686, 687, 3, 158, 79, 0, 687, 101, 1, 0, 0, 0, 688, 689, 5, 93, 0, 0, 689, + 690, 3, 140, 70, 0, 690, 103, 1, 0, 0, 0, 691, 692, 5, 223, 0, 0, 692, + 693, 3, 158, 79, 0, 693, 105, 1, 0, 0, 0, 694, 695, 5, 238, 0, 0, 695, + 696, 3, 158, 79, 0, 696, 107, 1, 0, 0, 0, 697, 698, 5, 237, 0, 0, 698, + 699, 3, 158, 79, 0, 699, 109, 1, 0, 0, 0, 700, 702, 3, 118, 59, 0, 701, + 700, 1, 0, 0, 0, 701, 702, 1, 0, 0, 0, 702, 703, 1, 0, 0, 0, 703, 704, + 3, 114, 57, 0, 704, 111, 1, 0, 0, 0, 705, 707, 3, 118, 59, 0, 706, 705, + 1, 0, 0, 0, 706, 707, 1, 0, 0, 0, 707, 708, 1, 0, 0, 0, 708, 713, 3, 114, + 57, 0, 709, 710, 5, 268, 0, 0, 710, 712, 3, 114, 57, 0, 711, 709, 1, 0, + 0, 0, 712, 715, 1, 0, 0, 0, 713, 711, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, + 714, 113, 1, 0, 0, 0, 715, 713, 1, 0, 0, 0, 716, 718, 3, 122, 61, 0, 717, + 716, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 720, 1, 0, 0, 0, 719, 721, + 3, 120, 60, 0, 720, 719, 1, 0, 0, 0, 720, 721, 1, 0, 0, 0, 721, 725, 1, + 0, 0, 0, 722, 724, 3, 116, 58, 0, 723, 722, 1, 0, 0, 0, 724, 727, 1, 0, + 0, 0, 725, 723, 1, 0, 0, 0, 725, 726, 1, 0, 0, 0, 726, 115, 1, 0, 0, 0, + 727, 725, 1, 0, 0, 0, 728, 732, 3, 124, 62, 0, 729, 732, 3, 126, 63, 0, + 730, 732, 3, 128, 64, 0, 731, 728, 1, 0, 0, 0, 731, 729, 1, 0, 0, 0, 731, + 730, 1, 0, 0, 0, 732, 117, 1, 0, 0, 0, 733, 734, 7, 6, 0, 0, 734, 745, + 5, 184, 0, 0, 735, 737, 5, 8, 0, 0, 736, 738, 5, 296, 0, 0, 737, 736, 1, + 0, 0, 0, 737, 738, 1, 0, 0, 0, 738, 745, 1, 0, 0, 0, 739, 740, 5, 184, + 0, 0, 740, 742, 5, 296, 0, 0, 741, 743, 5, 100, 0, 0, 742, 741, 1, 0, 0, + 0, 742, 743, 1, 0, 0, 0, 743, 745, 1, 0, 0, 0, 744, 733, 1, 0, 0, 0, 744, + 735, 1, 0, 0, 0, 744, 739, 1, 0, 0, 0, 745, 119, 1, 0, 0, 0, 746, 747, + 3, 14, 7, 0, 747, 748, 5, 278, 0, 0, 748, 121, 1, 0, 0, 0, 749, 750, 5, + 298, 0, 0, 750, 123, 1, 0, 0, 0, 751, 753, 5, 289, 0, 0, 752, 754, 3, 14, + 7, 0, 753, 752, 1, 0, 0, 0, 753, 754, 1, 0, 0, 0, 754, 756, 1, 0, 0, 0, + 755, 757, 3, 136, 68, 0, 756, 755, 1, 0, 0, 0, 756, 757, 1, 0, 0, 0, 757, + 759, 1, 0, 0, 0, 758, 760, 3, 70, 35, 0, 759, 758, 1, 0, 0, 0, 759, 760, + 1, 0, 0, 0, 760, 761, 1, 0, 0, 0, 761, 762, 5, 290, 0, 0, 762, 125, 1, + 0, 0, 0, 763, 765, 3, 132, 66, 0, 764, 766, 3, 130, 65, 0, 765, 764, 1, + 0, 0, 0, 765, 766, 1, 0, 0, 0, 766, 772, 1, 0, 0, 0, 767, 769, 3, 138, + 69, 0, 768, 770, 3, 130, 65, 0, 769, 768, 1, 0, 0, 0, 769, 770, 1, 0, 0, + 0, 770, 772, 1, 0, 0, 0, 771, 763, 1, 0, 0, 0, 771, 767, 1, 0, 0, 0, 772, + 127, 1, 0, 0, 0, 773, 775, 5, 289, 0, 0, 774, 776, 3, 122, 61, 0, 775, + 774, 1, 0, 0, 0, 775, 776, 1, 0, 0, 0, 776, 778, 1, 0, 0, 0, 777, 779, + 3, 120, 60, 0, 778, 777, 1, 0, 0, 0, 778, 779, 1, 0, 0, 0, 779, 781, 1, + 0, 0, 0, 780, 782, 3, 116, 58, 0, 781, 780, 1, 0, 0, 0, 782, 783, 1, 0, + 0, 0, 783, 781, 1, 0, 0, 0, 783, 784, 1, 0, 0, 0, 784, 786, 1, 0, 0, 0, + 785, 787, 3, 70, 35, 0, 786, 785, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, + 788, 1, 0, 0, 0, 788, 790, 5, 290, 0, 0, 789, 791, 3, 130, 65, 0, 790, + 789, 1, 0, 0, 0, 790, 791, 1, 0, 0, 0, 791, 812, 1, 0, 0, 0, 792, 794, + 5, 285, 0, 0, 793, 795, 3, 122, 61, 0, 794, 793, 1, 0, 0, 0, 794, 795, + 1, 0, 0, 0, 795, 797, 1, 0, 0, 0, 796, 798, 3, 120, 60, 0, 797, 796, 1, + 0, 0, 0, 797, 798, 1, 0, 0, 0, 798, 800, 1, 0, 0, 0, 799, 801, 3, 116, + 58, 0, 800, 799, 1, 0, 0, 0, 801, 802, 1, 0, 0, 0, 802, 800, 1, 0, 0, 0, + 802, 803, 1, 0, 0, 0, 803, 805, 1, 0, 0, 0, 804, 806, 3, 70, 35, 0, 805, + 804, 1, 0, 0, 0, 805, 806, 1, 0, 0, 0, 806, 807, 1, 0, 0, 0, 807, 809, + 5, 286, 0, 0, 808, 810, 3, 130, 65, 0, 809, 808, 1, 0, 0, 0, 809, 810, + 1, 0, 0, 0, 810, 812, 1, 0, 0, 0, 811, 773, 1, 0, 0, 0, 811, 792, 1, 0, + 0, 0, 812, 129, 1, 0, 0, 0, 813, 822, 7, 7, 0, 0, 814, 815, 5, 287, 0, + 0, 815, 816, 5, 296, 0, 0, 816, 818, 5, 268, 0, 0, 817, 819, 5, 296, 0, + 0, 818, 817, 1, 0, 0, 0, 818, 819, 1, 0, 0, 0, 819, 820, 1, 0, 0, 0, 820, + 822, 5, 288, 0, 0, 821, 813, 1, 0, 0, 0, 821, 814, 1, 0, 0, 0, 822, 131, + 1, 0, 0, 0, 823, 824, 5, 270, 0, 0, 824, 825, 3, 134, 67, 0, 825, 826, + 5, 270, 0, 0, 826, 827, 5, 282, 0, 0, 827, 858, 1, 0, 0, 0, 828, 829, 5, + 274, 0, 0, 829, 830, 3, 134, 67, 0, 830, 831, 5, 274, 0, 0, 831, 858, 1, + 0, 0, 0, 832, 833, 5, 281, 0, 0, 833, 834, 5, 270, 0, 0, 834, 835, 3, 134, + 67, 0, 835, 836, 5, 270, 0, 0, 836, 858, 1, 0, 0, 0, 837, 838, 5, 274, + 0, 0, 838, 839, 3, 134, 67, 0, 839, 840, 5, 274, 0, 0, 840, 841, 5, 282, + 0, 0, 841, 858, 1, 0, 0, 0, 842, 843, 5, 281, 0, 0, 843, 844, 5, 274, 0, + 0, 844, 845, 3, 134, 67, 0, 845, 846, 5, 274, 0, 0, 846, 858, 1, 0, 0, + 0, 847, 848, 5, 281, 0, 0, 848, 849, 5, 270, 0, 0, 849, 850, 3, 134, 67, + 0, 850, 851, 5, 270, 0, 0, 851, 852, 5, 282, 0, 0, 852, 858, 1, 0, 0, 0, + 853, 854, 5, 270, 0, 0, 854, 855, 3, 134, 67, 0, 855, 856, 5, 270, 0, 0, + 856, 858, 1, 0, 0, 0, 857, 823, 1, 0, 0, 0, 857, 828, 1, 0, 0, 0, 857, + 832, 1, 0, 0, 0, 857, 837, 1, 0, 0, 0, 857, 842, 1, 0, 0, 0, 857, 847, + 1, 0, 0, 0, 857, 853, 1, 0, 0, 0, 858, 133, 1, 0, 0, 0, 859, 861, 5, 285, + 0, 0, 860, 862, 3, 14, 7, 0, 861, 860, 1, 0, 0, 0, 861, 862, 1, 0, 0, 0, + 862, 864, 1, 0, 0, 0, 863, 865, 3, 136, 68, 0, 864, 863, 1, 0, 0, 0, 864, + 865, 1, 0, 0, 0, 865, 867, 1, 0, 0, 0, 866, 868, 3, 70, 35, 0, 867, 866, + 1, 0, 0, 0, 867, 868, 1, 0, 0, 0, 868, 869, 1, 0, 0, 0, 869, 870, 5, 286, + 0, 0, 870, 135, 1, 0, 0, 0, 871, 872, 5, 291, 0, 0, 872, 873, 3, 14, 7, + 0, 873, 137, 1, 0, 0, 0, 874, 887, 5, 274, 0, 0, 875, 876, 5, 274, 0, 0, + 876, 887, 5, 282, 0, 0, 877, 878, 5, 281, 0, 0, 878, 887, 5, 274, 0, 0, + 879, 881, 5, 281, 0, 0, 880, 879, 1, 0, 0, 0, 880, 881, 1, 0, 0, 0, 881, + 882, 1, 0, 0, 0, 882, 884, 5, 270, 0, 0, 883, 885, 5, 282, 0, 0, 884, 883, + 1, 0, 0, 0, 884, 885, 1, 0, 0, 0, 885, 887, 1, 0, 0, 0, 886, 874, 1, 0, + 0, 0, 886, 875, 1, 0, 0, 0, 886, 877, 1, 0, 0, 0, 886, 880, 1, 0, 0, 0, + 887, 139, 1, 0, 0, 0, 888, 889, 6, 70, -1, 0, 889, 895, 3, 142, 71, 0, + 890, 891, 5, 289, 0, 0, 891, 892, 3, 140, 70, 0, 892, 893, 5, 290, 0, 0, + 893, 895, 1, 0, 0, 0, 894, 888, 1, 0, 0, 0, 894, 890, 1, 0, 0, 0, 895, + 916, 1, 0, 0, 0, 896, 898, 10, 5, 0, 0, 897, 899, 3, 152, 76, 0, 898, 897, + 1, 0, 0, 0, 898, 899, 1, 0, 0, 0, 899, 900, 1, 0, 0, 0, 900, 901, 5, 46, + 0, 0, 901, 902, 5, 118, 0, 0, 902, 915, 3, 148, 74, 0, 903, 904, 10, 4, + 0, 0, 904, 905, 5, 268, 0, 0, 905, 915, 3, 148, 74, 0, 906, 908, 10, 3, + 0, 0, 907, 909, 3, 152, 76, 0, 908, 907, 1, 0, 0, 0, 908, 909, 1, 0, 0, + 0, 909, 910, 1, 0, 0, 0, 910, 911, 5, 118, 0, 0, 911, 912, 3, 148, 74, + 0, 912, 913, 3, 150, 75, 0, 913, 915, 1, 0, 0, 0, 914, 896, 1, 0, 0, 0, + 914, 903, 1, 0, 0, 0, 914, 906, 1, 0, 0, 0, 915, 918, 1, 0, 0, 0, 916, + 914, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, 917, 141, 1, 0, 0, 0, 918, 916, + 1, 0, 0, 0, 919, 922, 3, 144, 72, 0, 920, 922, 3, 146, 73, 0, 921, 919, + 1, 0, 0, 0, 921, 920, 1, 0, 0, 0, 922, 143, 1, 0, 0, 0, 923, 924, 3, 158, + 79, 0, 924, 925, 3, 14, 7, 0, 925, 947, 1, 0, 0, 0, 926, 928, 3, 158, 79, + 0, 927, 929, 3, 8, 4, 0, 928, 927, 1, 0, 0, 0, 928, 929, 1, 0, 0, 0, 929, + 931, 1, 0, 0, 0, 930, 932, 3, 10, 5, 0, 931, 930, 1, 0, 0, 0, 931, 932, + 1, 0, 0, 0, 932, 934, 1, 0, 0, 0, 933, 935, 3, 12, 6, 0, 934, 933, 1, 0, + 0, 0, 934, 935, 1, 0, 0, 0, 935, 947, 1, 0, 0, 0, 936, 938, 3, 218, 109, + 0, 937, 939, 3, 8, 4, 0, 938, 937, 1, 0, 0, 0, 938, 939, 1, 0, 0, 0, 939, + 941, 1, 0, 0, 0, 940, 942, 3, 10, 5, 0, 941, 940, 1, 0, 0, 0, 941, 942, + 1, 0, 0, 0, 942, 944, 1, 0, 0, 0, 943, 945, 3, 12, 6, 0, 944, 943, 1, 0, + 0, 0, 944, 945, 1, 0, 0, 0, 945, 947, 1, 0, 0, 0, 946, 923, 1, 0, 0, 0, + 946, 926, 1, 0, 0, 0, 946, 936, 1, 0, 0, 0, 947, 145, 1, 0, 0, 0, 948, + 949, 5, 236, 0, 0, 949, 951, 3, 154, 77, 0, 950, 952, 3, 8, 4, 0, 951, + 950, 1, 0, 0, 0, 951, 952, 1, 0, 0, 0, 952, 954, 1, 0, 0, 0, 953, 955, + 3, 10, 5, 0, 954, 953, 1, 0, 0, 0, 954, 955, 1, 0, 0, 0, 955, 957, 1, 0, + 0, 0, 956, 958, 3, 12, 6, 0, 957, 956, 1, 0, 0, 0, 957, 958, 1, 0, 0, 0, + 958, 147, 1, 0, 0, 0, 959, 965, 3, 142, 71, 0, 960, 961, 5, 289, 0, 0, + 961, 962, 3, 140, 70, 0, 962, 963, 5, 290, 0, 0, 963, 965, 1, 0, 0, 0, + 964, 959, 1, 0, 0, 0, 964, 960, 1, 0, 0, 0, 965, 149, 1, 0, 0, 0, 966, + 967, 5, 145, 0, 0, 967, 968, 3, 154, 77, 0, 968, 151, 1, 0, 0, 0, 969, + 984, 5, 107, 0, 0, 970, 972, 5, 123, 0, 0, 971, 973, 5, 151, 0, 0, 972, + 971, 1, 0, 0, 0, 972, 973, 1, 0, 0, 0, 973, 984, 1, 0, 0, 0, 974, 976, + 5, 174, 0, 0, 975, 977, 5, 151, 0, 0, 976, 975, 1, 0, 0, 0, 976, 977, 1, + 0, 0, 0, 977, 984, 1, 0, 0, 0, 978, 980, 5, 94, 0, 0, 979, 981, 5, 151, + 0, 0, 980, 979, 1, 0, 0, 0, 980, 981, 1, 0, 0, 0, 981, 984, 1, 0, 0, 0, + 982, 984, 5, 151, 0, 0, 983, 969, 1, 0, 0, 0, 983, 970, 1, 0, 0, 0, 983, + 974, 1, 0, 0, 0, 983, 978, 1, 0, 0, 0, 983, 982, 1, 0, 0, 0, 984, 153, + 1, 0, 0, 0, 985, 986, 3, 156, 78, 0, 986, 155, 1, 0, 0, 0, 987, 988, 6, + 78, -1, 0, 988, 989, 3, 158, 79, 0, 989, 1019, 1, 0, 0, 0, 990, 992, 10, + 4, 0, 0, 991, 993, 5, 151, 0, 0, 992, 991, 1, 0, 0, 0, 992, 993, 1, 0, + 0, 0, 993, 994, 1, 0, 0, 0, 994, 996, 5, 75, 0, 0, 995, 997, 7, 3, 0, 0, + 996, 995, 1, 0, 0, 0, 996, 997, 1, 0, 0, 0, 997, 998, 1, 0, 0, 0, 998, + 1018, 3, 158, 79, 0, 999, 1001, 10, 3, 0, 0, 1000, 1002, 5, 151, 0, 0, + 1001, 1000, 1, 0, 0, 0, 1001, 1002, 1, 0, 0, 0, 1002, 1003, 1, 0, 0, 0, + 1003, 1005, 5, 207, 0, 0, 1004, 1006, 7, 3, 0, 0, 1005, 1004, 1, 0, 0, + 0, 1005, 1006, 1, 0, 0, 0, 1006, 1007, 1, 0, 0, 0, 1007, 1018, 3, 158, + 79, 0, 1008, 1010, 10, 2, 0, 0, 1009, 1011, 5, 151, 0, 0, 1010, 1009, 1, + 0, 0, 0, 1010, 1011, 1, 0, 0, 0, 1011, 1012, 1, 0, 0, 0, 1012, 1014, 5, + 113, 0, 0, 1013, 1015, 7, 3, 0, 0, 1014, 1013, 1, 0, 0, 0, 1014, 1015, + 1, 0, 0, 0, 1015, 1016, 1, 0, 0, 0, 1016, 1018, 3, 158, 79, 0, 1017, 990, + 1, 0, 0, 0, 1017, 999, 1, 0, 0, 0, 1017, 1008, 1, 0, 0, 0, 1018, 1021, + 1, 0, 0, 0, 1019, 1017, 1, 0, 0, 0, 1019, 1020, 1, 0, 0, 0, 1020, 157, + 1, 0, 0, 0, 1021, 1019, 1, 0, 0, 0, 1022, 1023, 3, 72, 36, 0, 1023, 1025, + 3, 102, 51, 0, 1024, 1026, 3, 80, 40, 0, 1025, 1024, 1, 0, 0, 0, 1025, + 1026, 1, 0, 0, 0, 1026, 1028, 1, 0, 0, 0, 1027, 1029, 3, 104, 52, 0, 1028, + 1027, 1, 0, 0, 0, 1028, 1029, 1, 0, 0, 0, 1029, 1031, 1, 0, 0, 0, 1030, + 1032, 3, 88, 44, 0, 1031, 1030, 1, 0, 0, 0, 1031, 1032, 1, 0, 0, 0, 1032, + 1034, 1, 0, 0, 0, 1033, 1035, 3, 100, 50, 0, 1034, 1033, 1, 0, 0, 0, 1034, + 1035, 1, 0, 0, 0, 1035, 1037, 1, 0, 0, 0, 1036, 1038, 3, 84, 42, 0, 1037, + 1036, 1, 0, 0, 0, 1037, 1038, 1, 0, 0, 0, 1038, 1040, 1, 0, 0, 0, 1039, + 1041, 3, 108, 54, 0, 1040, 1039, 1, 0, 0, 0, 1040, 1041, 1, 0, 0, 0, 1041, + 1043, 1, 0, 0, 0, 1042, 1044, 3, 106, 53, 0, 1043, 1042, 1, 0, 0, 0, 1043, + 1044, 1, 0, 0, 0, 1044, 1047, 1, 0, 0, 0, 1045, 1047, 3, 160, 80, 0, 1046, + 1022, 1, 0, 0, 0, 1046, 1045, 1, 0, 0, 0, 1047, 159, 1, 0, 0, 0, 1048, + 1049, 6, 80, -1, 0, 1049, 1050, 3, 162, 81, 0, 1050, 1056, 1, 0, 0, 0, + 1051, 1052, 10, 2, 0, 0, 1052, 1053, 5, 149, 0, 0, 1053, 1055, 3, 162, + 81, 0, 1054, 1051, 1, 0, 0, 0, 1055, 1058, 1, 0, 0, 0, 1056, 1054, 1, 0, + 0, 0, 1056, 1057, 1, 0, 0, 0, 1057, 161, 1, 0, 0, 0, 1058, 1056, 1, 0, + 0, 0, 1059, 1060, 6, 81, -1, 0, 1060, 1061, 3, 164, 82, 0, 1061, 1067, + 1, 0, 0, 0, 1062, 1063, 10, 2, 0, 0, 1063, 1064, 5, 7, 0, 0, 1064, 1066, + 3, 164, 82, 0, 1065, 1062, 1, 0, 0, 0, 1066, 1069, 1, 0, 0, 0, 1067, 1065, + 1, 0, 0, 0, 1067, 1068, 1, 0, 0, 0, 1068, 163, 1, 0, 0, 0, 1069, 1067, + 1, 0, 0, 0, 1070, 1071, 5, 138, 0, 0, 1071, 1074, 3, 164, 82, 0, 1072, + 1074, 3, 166, 83, 0, 1073, 1070, 1, 0, 0, 0, 1073, 1072, 1, 0, 0, 0, 1074, + 165, 1, 0, 0, 0, 1075, 1076, 6, 83, -1, 0, 1076, 1077, 3, 168, 84, 0, 1077, + 1123, 1, 0, 0, 0, 1078, 1079, 10, 7, 0, 0, 1079, 1080, 7, 8, 0, 0, 1080, + 1122, 3, 168, 84, 0, 1081, 1082, 10, 6, 0, 0, 1082, 1084, 5, 116, 0, 0, + 1083, 1085, 5, 138, 0, 0, 1084, 1083, 1, 0, 0, 0, 1084, 1085, 1, 0, 0, + 0, 1085, 1086, 1, 0, 0, 0, 1086, 1122, 3, 236, 118, 0, 1087, 1089, 10, + 5, 0, 0, 1088, 1090, 5, 138, 0, 0, 1089, 1088, 1, 0, 0, 0, 1089, 1090, + 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1092, 5, 104, 0, 0, 1092, 1093, + 5, 289, 0, 0, 1093, 1094, 3, 154, 77, 0, 1094, 1095, 5, 290, 0, 0, 1095, + 1122, 1, 0, 0, 0, 1096, 1098, 10, 4, 0, 0, 1097, 1099, 5, 138, 0, 0, 1098, + 1097, 1, 0, 0, 0, 1098, 1099, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, + 1101, 5, 104, 0, 0, 1101, 1122, 3, 168, 84, 0, 1102, 1104, 10, 3, 0, 0, + 1103, 1105, 5, 138, 0, 0, 1104, 1103, 1, 0, 0, 0, 1104, 1105, 1, 0, 0, + 0, 1105, 1106, 1, 0, 0, 0, 1106, 1107, 5, 125, 0, 0, 1107, 1110, 3, 168, + 84, 0, 1108, 1109, 5, 74, 0, 0, 1109, 1111, 3, 154, 77, 0, 1110, 1108, + 1, 0, 0, 0, 1110, 1111, 1, 0, 0, 0, 1111, 1122, 1, 0, 0, 0, 1112, 1114, + 10, 2, 0, 0, 1113, 1115, 5, 138, 0, 0, 1114, 1113, 1, 0, 0, 0, 1114, 1115, + 1, 0, 0, 0, 1115, 1116, 1, 0, 0, 0, 1116, 1117, 5, 17, 0, 0, 1117, 1118, + 3, 168, 84, 0, 1118, 1119, 5, 7, 0, 0, 1119, 1120, 3, 168, 84, 0, 1120, + 1122, 1, 0, 0, 0, 1121, 1078, 1, 0, 0, 0, 1121, 1081, 1, 0, 0, 0, 1121, + 1087, 1, 0, 0, 0, 1121, 1096, 1, 0, 0, 0, 1121, 1102, 1, 0, 0, 0, 1121, + 1112, 1, 0, 0, 0, 1122, 1125, 1, 0, 0, 0, 1123, 1121, 1, 0, 0, 0, 1123, + 1124, 1, 0, 0, 0, 1124, 167, 1, 0, 0, 0, 1125, 1123, 1, 0, 0, 0, 1126, + 1127, 6, 84, -1, 0, 1127, 1128, 3, 170, 85, 0, 1128, 1134, 1, 0, 0, 0, + 1129, 1130, 10, 2, 0, 0, 1130, 1131, 5, 280, 0, 0, 1131, 1133, 3, 170, + 85, 0, 1132, 1129, 1, 0, 0, 0, 1133, 1136, 1, 0, 0, 0, 1134, 1132, 1, 0, + 0, 0, 1134, 1135, 1, 0, 0, 0, 1135, 169, 1, 0, 0, 0, 1136, 1134, 1, 0, + 0, 0, 1137, 1138, 6, 85, -1, 0, 1138, 1139, 3, 172, 86, 0, 1139, 1145, + 1, 0, 0, 0, 1140, 1141, 10, 2, 0, 0, 1141, 1142, 7, 9, 0, 0, 1142, 1144, + 3, 172, 86, 0, 1143, 1140, 1, 0, 0, 0, 1144, 1147, 1, 0, 0, 0, 1145, 1143, + 1, 0, 0, 0, 1145, 1146, 1, 0, 0, 0, 1146, 171, 1, 0, 0, 0, 1147, 1145, + 1, 0, 0, 0, 1148, 1149, 6, 86, -1, 0, 1149, 1150, 3, 174, 87, 0, 1150, + 1156, 1, 0, 0, 0, 1151, 1152, 10, 2, 0, 0, 1152, 1153, 7, 10, 0, 0, 1153, + 1155, 3, 174, 87, 0, 1154, 1151, 1, 0, 0, 0, 1155, 1158, 1, 0, 0, 0, 1156, + 1154, 1, 0, 0, 0, 1156, 1157, 1, 0, 0, 0, 1157, 173, 1, 0, 0, 0, 1158, + 1156, 1, 0, 0, 0, 1159, 1160, 7, 9, 0, 0, 1160, 1163, 3, 174, 87, 0, 1161, + 1163, 3, 176, 88, 0, 1162, 1159, 1, 0, 0, 0, 1162, 1161, 1, 0, 0, 0, 1163, + 175, 1, 0, 0, 0, 1164, 1165, 6, 88, -1, 0, 1165, 1184, 3, 178, 89, 0, 1166, + 1184, 3, 200, 100, 0, 1167, 1184, 3, 192, 96, 0, 1168, 1184, 3, 194, 97, + 0, 1169, 1184, 3, 204, 102, 0, 1170, 1184, 3, 202, 101, 0, 1171, 1184, + 3, 206, 103, 0, 1172, 1184, 3, 182, 91, 0, 1173, 1184, 3, 210, 105, 0, + 1174, 1184, 3, 196, 98, 0, 1175, 1184, 3, 208, 104, 0, 1176, 1184, 3, 212, + 106, 0, 1177, 1184, 3, 180, 90, 0, 1178, 1184, 3, 216, 108, 0, 1179, 1184, + 3, 184, 92, 0, 1180, 1184, 3, 190, 95, 0, 1181, 1184, 3, 186, 93, 0, 1182, + 1184, 3, 198, 99, 0, 1183, 1164, 1, 0, 0, 0, 1183, 1166, 1, 0, 0, 0, 1183, + 1167, 1, 0, 0, 0, 1183, 1168, 1, 0, 0, 0, 1183, 1169, 1, 0, 0, 0, 1183, + 1170, 1, 0, 0, 0, 1183, 1171, 1, 0, 0, 0, 1183, 1172, 1, 0, 0, 0, 1183, + 1173, 1, 0, 0, 0, 1183, 1174, 1, 0, 0, 0, 1183, 1175, 1, 0, 0, 0, 1183, + 1176, 1, 0, 0, 0, 1183, 1177, 1, 0, 0, 0, 1183, 1178, 1, 0, 0, 0, 1183, + 1179, 1, 0, 0, 0, 1183, 1180, 1, 0, 0, 0, 1183, 1181, 1, 0, 0, 0, 1183, + 1182, 1, 0, 0, 0, 1184, 1193, 1, 0, 0, 0, 1185, 1187, 10, 6, 0, 0, 1186, + 1188, 3, 214, 107, 0, 1187, 1186, 1, 0, 0, 0, 1188, 1189, 1, 0, 0, 0, 1189, + 1187, 1, 0, 0, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1192, 1, 0, 0, 0, 1191, + 1185, 1, 0, 0, 0, 1192, 1195, 1, 0, 0, 0, 1193, 1191, 1, 0, 0, 0, 1193, + 1194, 1, 0, 0, 0, 1194, 177, 1, 0, 0, 0, 1195, 1193, 1, 0, 0, 0, 1196, + 1197, 5, 289, 0, 0, 1197, 1198, 3, 154, 77, 0, 1198, 1199, 5, 290, 0, 0, + 1199, 1206, 1, 0, 0, 0, 1200, 1206, 3, 220, 110, 0, 1201, 1206, 3, 222, + 111, 0, 1202, 1206, 3, 234, 117, 0, 1203, 1206, 3, 224, 112, 0, 1204, 1206, + 3, 230, 115, 0, 1205, 1196, 1, 0, 0, 0, 1205, 1200, 1, 0, 0, 0, 1205, 1201, + 1, 0, 0, 0, 1205, 1202, 1, 0, 0, 0, 1205, 1203, 1, 0, 0, 0, 1205, 1204, + 1, 0, 0, 0, 1206, 179, 1, 0, 0, 0, 1207, 1208, 5, 141, 0, 0, 1208, 1209, + 5, 289, 0, 0, 1209, 1210, 3, 154, 77, 0, 1210, 1211, 5, 268, 0, 0, 1211, + 1212, 3, 154, 77, 0, 1212, 1213, 5, 290, 0, 0, 1213, 181, 1, 0, 0, 0, 1214, + 1215, 5, 32, 0, 0, 1215, 1216, 5, 289, 0, 0, 1216, 1221, 3, 154, 77, 0, + 1217, 1218, 5, 268, 0, 0, 1218, 1220, 3, 154, 77, 0, 1219, 1217, 1, 0, + 0, 0, 1220, 1223, 1, 0, 0, 0, 1221, 1219, 1, 0, 0, 0, 1221, 1222, 1, 0, + 0, 0, 1222, 1224, 1, 0, 0, 0, 1223, 1221, 1, 0, 0, 0, 1224, 1225, 5, 290, + 0, 0, 1225, 183, 1, 0, 0, 0, 1226, 1228, 5, 23, 0, 0, 1227, 1229, 3, 154, + 77, 0, 1228, 1227, 1, 0, 0, 0, 1228, 1229, 1, 0, 0, 0, 1229, 1235, 1, 0, + 0, 0, 1230, 1231, 5, 221, 0, 0, 1231, 1232, 3, 154, 77, 0, 1232, 1233, + 5, 198, 0, 0, 1233, 1234, 3, 154, 77, 0, 1234, 1236, 1, 0, 0, 0, 1235, + 1230, 1, 0, 0, 0, 1236, 1237, 1, 0, 0, 0, 1237, 1235, 1, 0, 0, 0, 1237, + 1238, 1, 0, 0, 0, 1238, 1241, 1, 0, 0, 0, 1239, 1240, 5, 71, 0, 0, 1240, + 1242, 3, 154, 77, 0, 1241, 1239, 1, 0, 0, 0, 1241, 1242, 1, 0, 0, 0, 1242, + 1243, 1, 0, 0, 0, 1243, 1244, 5, 72, 0, 0, 1244, 185, 1, 0, 0, 0, 1245, + 1246, 5, 217, 0, 0, 1246, 1251, 3, 188, 94, 0, 1247, 1248, 5, 268, 0, 0, + 1248, 1250, 3, 188, 94, 0, 1249, 1247, 1, 0, 0, 0, 1250, 1253, 1, 0, 0, + 0, 1251, 1249, 1, 0, 0, 0, 1251, 1252, 1, 0, 0, 0, 1252, 187, 1, 0, 0, + 0, 1253, 1251, 1, 0, 0, 0, 1254, 1255, 5, 289, 0, 0, 1255, 1260, 3, 154, + 77, 0, 1256, 1257, 5, 268, 0, 0, 1257, 1259, 3, 154, 77, 0, 1258, 1256, + 1, 0, 0, 0, 1259, 1262, 1, 0, 0, 0, 1260, 1258, 1, 0, 0, 0, 1260, 1261, + 1, 0, 0, 0, 1261, 1263, 1, 0, 0, 0, 1262, 1260, 1, 0, 0, 0, 1263, 1264, + 5, 290, 0, 0, 1264, 189, 1, 0, 0, 0, 1265, 1266, 5, 289, 0, 0, 1266, 1269, + 3, 154, 77, 0, 1267, 1268, 5, 268, 0, 0, 1268, 1270, 3, 154, 77, 0, 1269, + 1267, 1, 0, 0, 0, 1270, 1271, 1, 0, 0, 0, 1271, 1269, 1, 0, 0, 0, 1271, + 1272, 1, 0, 0, 0, 1272, 1273, 1, 0, 0, 0, 1273, 1274, 5, 290, 0, 0, 1274, + 191, 1, 0, 0, 0, 1275, 1276, 7, 11, 0, 0, 1276, 1285, 5, 289, 0, 0, 1277, + 1282, 3, 154, 77, 0, 1278, 1279, 5, 268, 0, 0, 1279, 1281, 3, 154, 77, + 0, 1280, 1278, 1, 0, 0, 0, 1281, 1284, 1, 0, 0, 0, 1282, 1280, 1, 0, 0, + 0, 1282, 1283, 1, 0, 0, 0, 1283, 1286, 1, 0, 0, 0, 1284, 1282, 1, 0, 0, + 0, 1285, 1277, 1, 0, 0, 0, 1285, 1286, 1, 0, 0, 0, 1286, 1287, 1, 0, 0, + 0, 1287, 1288, 5, 290, 0, 0, 1288, 193, 1, 0, 0, 0, 1289, 1290, 5, 193, + 0, 0, 1290, 1291, 5, 289, 0, 0, 1291, 1298, 3, 154, 77, 0, 1292, 1293, + 5, 268, 0, 0, 1293, 1296, 3, 154, 77, 0, 1294, 1295, 5, 268, 0, 0, 1295, + 1297, 3, 154, 77, 0, 1296, 1294, 1, 0, 0, 0, 1296, 1297, 1, 0, 0, 0, 1297, + 1299, 1, 0, 0, 0, 1298, 1292, 1, 0, 0, 0, 1298, 1299, 1, 0, 0, 0, 1299, + 1300, 1, 0, 0, 0, 1300, 1301, 5, 290, 0, 0, 1301, 1316, 1, 0, 0, 0, 1302, + 1303, 5, 193, 0, 0, 1303, 1304, 5, 289, 0, 0, 1304, 1311, 3, 154, 77, 0, + 1305, 1306, 5, 93, 0, 0, 1306, 1309, 3, 154, 77, 0, 1307, 1308, 5, 90, + 0, 0, 1308, 1310, 3, 154, 77, 0, 1309, 1307, 1, 0, 0, 0, 1309, 1310, 1, + 0, 0, 0, 1310, 1312, 1, 0, 0, 0, 1311, 1305, 1, 0, 0, 0, 1311, 1312, 1, + 0, 0, 0, 1312, 1313, 1, 0, 0, 0, 1313, 1314, 5, 290, 0, 0, 1314, 1316, + 1, 0, 0, 0, 1315, 1289, 1, 0, 0, 0, 1315, 1302, 1, 0, 0, 0, 1316, 195, + 1, 0, 0, 0, 1317, 1318, 5, 44, 0, 0, 1318, 1319, 5, 289, 0, 0, 1319, 1320, + 5, 275, 0, 0, 1320, 1330, 5, 290, 0, 0, 1321, 1322, 7, 12, 0, 0, 1322, + 1324, 5, 289, 0, 0, 1323, 1325, 3, 78, 39, 0, 1324, 1323, 1, 0, 0, 0, 1324, + 1325, 1, 0, 0, 0, 1325, 1326, 1, 0, 0, 0, 1326, 1327, 3, 154, 77, 0, 1327, + 1328, 5, 290, 0, 0, 1328, 1330, 1, 0, 0, 0, 1329, 1317, 1, 0, 0, 0, 1329, + 1321, 1, 0, 0, 0, 1330, 197, 1, 0, 0, 0, 1331, 1332, 7, 13, 0, 0, 1332, + 1333, 5, 289, 0, 0, 1333, 1340, 3, 154, 77, 0, 1334, 1335, 5, 268, 0, 0, + 1335, 1338, 3, 154, 77, 0, 1336, 1337, 5, 268, 0, 0, 1337, 1339, 3, 154, + 77, 0, 1338, 1336, 1, 0, 0, 0, 1338, 1339, 1, 0, 0, 0, 1339, 1341, 1, 0, + 0, 0, 1340, 1334, 1, 0, 0, 0, 1340, 1341, 1, 0, 0, 0, 1341, 1342, 1, 0, + 0, 0, 1342, 1343, 5, 290, 0, 0, 1343, 1344, 3, 94, 47, 0, 1344, 199, 1, + 0, 0, 0, 1345, 1346, 5, 24, 0, 0, 1346, 1347, 5, 289, 0, 0, 1347, 1348, + 3, 154, 77, 0, 1348, 1349, 5, 10, 0, 0, 1349, 1350, 3, 236, 118, 0, 1350, + 1351, 5, 290, 0, 0, 1351, 201, 1, 0, 0, 0, 1352, 1353, 5, 233, 0, 0, 1353, + 1354, 5, 289, 0, 0, 1354, 1355, 3, 154, 77, 0, 1355, 1356, 5, 10, 0, 0, + 1356, 1357, 3, 236, 118, 0, 1357, 1358, 5, 290, 0, 0, 1358, 203, 1, 0, + 0, 0, 1359, 1360, 5, 232, 0, 0, 1360, 1361, 5, 289, 0, 0, 1361, 1362, 3, + 154, 77, 0, 1362, 1363, 5, 10, 0, 0, 1363, 1364, 3, 236, 118, 0, 1364, + 1365, 5, 290, 0, 0, 1365, 205, 1, 0, 0, 0, 1366, 1367, 5, 83, 0, 0, 1367, + 1368, 5, 289, 0, 0, 1368, 1369, 5, 298, 0, 0, 1369, 1370, 5, 93, 0, 0, + 1370, 1371, 3, 154, 77, 0, 1371, 1372, 5, 290, 0, 0, 1372, 207, 1, 0, 0, + 0, 1373, 1374, 5, 205, 0, 0, 1374, 1382, 5, 289, 0, 0, 1375, 1377, 5, 298, + 0, 0, 1376, 1375, 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1379, 1, 0, + 0, 0, 1378, 1380, 3, 154, 77, 0, 1379, 1378, 1, 0, 0, 0, 1379, 1380, 1, + 0, 0, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1383, 5, 93, 0, 0, 1382, 1376, 1, + 0, 0, 0, 1382, 1383, 1, 0, 0, 0, 1383, 1384, 1, 0, 0, 0, 1384, 1385, 3, + 154, 77, 0, 1385, 1386, 5, 290, 0, 0, 1386, 209, 1, 0, 0, 0, 1387, 1388, + 7, 14, 0, 0, 1388, 1389, 5, 289, 0, 0, 1389, 1390, 5, 298, 0, 0, 1390, + 1391, 5, 268, 0, 0, 1391, 1392, 3, 154, 77, 0, 1392, 1393, 5, 268, 0, 0, + 1393, 1394, 3, 154, 77, 0, 1394, 1395, 5, 290, 0, 0, 1395, 211, 1, 0, 0, + 0, 1396, 1397, 7, 15, 0, 0, 1397, 1406, 5, 289, 0, 0, 1398, 1403, 3, 154, + 77, 0, 1399, 1400, 5, 268, 0, 0, 1400, 1402, 3, 154, 77, 0, 1401, 1399, + 1, 0, 0, 0, 1402, 1405, 1, 0, 0, 0, 1403, 1401, 1, 0, 0, 0, 1403, 1404, + 1, 0, 0, 0, 1404, 1407, 1, 0, 0, 0, 1405, 1403, 1, 0, 0, 0, 1406, 1398, + 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 1408, 1, 0, 0, 0, 1408, 1424, + 5, 290, 0, 0, 1409, 1410, 3, 14, 7, 0, 1410, 1419, 5, 289, 0, 0, 1411, + 1416, 3, 154, 77, 0, 1412, 1413, 5, 268, 0, 0, 1413, 1415, 3, 154, 77, + 0, 1414, 1412, 1, 0, 0, 0, 1415, 1418, 1, 0, 0, 0, 1416, 1414, 1, 0, 0, + 0, 1416, 1417, 1, 0, 0, 0, 1417, 1420, 1, 0, 0, 0, 1418, 1416, 1, 0, 0, + 0, 1419, 1411, 1, 0, 0, 0, 1419, 1420, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, + 0, 1421, 1422, 5, 290, 0, 0, 1422, 1424, 1, 0, 0, 0, 1423, 1396, 1, 0, + 0, 0, 1423, 1409, 1, 0, 0, 0, 1424, 213, 1, 0, 0, 0, 1425, 1426, 5, 285, + 0, 0, 1426, 1427, 3, 154, 77, 0, 1427, 1428, 5, 286, 0, 0, 1428, 1437, + 1, 0, 0, 0, 1429, 1430, 5, 285, 0, 0, 1430, 1431, 5, 275, 0, 0, 1431, 1437, + 5, 286, 0, 0, 1432, 1433, 5, 294, 0, 0, 1433, 1437, 3, 14, 7, 0, 1434, + 1435, 5, 294, 0, 0, 1435, 1437, 5, 275, 0, 0, 1436, 1425, 1, 0, 0, 0, 1436, + 1429, 1, 0, 0, 0, 1436, 1432, 1, 0, 0, 0, 1436, 1434, 1, 0, 0, 0, 1437, + 215, 1, 0, 0, 0, 1438, 1439, 5, 289, 0, 0, 1439, 1440, 3, 176, 88, 0, 1440, + 1441, 5, 128, 0, 0, 1441, 1442, 3, 112, 56, 0, 1442, 1443, 5, 290, 0, 0, + 1443, 217, 1, 0, 0, 0, 1444, 1445, 3, 176, 88, 0, 1445, 1446, 5, 128, 0, + 0, 1446, 1447, 3, 110, 55, 0, 1447, 219, 1, 0, 0, 0, 1448, 1449, 5, 293, + 0, 0, 1449, 221, 1, 0, 0, 0, 1450, 1452, 5, 273, 0, 0, 1451, 1450, 1, 0, + 0, 0, 1451, 1452, 1, 0, 0, 0, 1452, 1453, 1, 0, 0, 0, 1453, 1454, 7, 0, + 0, 0, 1454, 223, 1, 0, 0, 0, 1455, 1458, 3, 226, 113, 0, 1456, 1458, 3, + 228, 114, 0, 1457, 1455, 1, 0, 0, 0, 1457, 1456, 1, 0, 0, 0, 1458, 225, + 1, 0, 0, 0, 1459, 1468, 5, 285, 0, 0, 1460, 1465, 3, 154, 77, 0, 1461, + 1462, 5, 268, 0, 0, 1462, 1464, 3, 154, 77, 0, 1463, 1461, 1, 0, 0, 0, + 1464, 1467, 1, 0, 0, 0, 1465, 1463, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, + 1466, 1469, 1, 0, 0, 0, 1467, 1465, 1, 0, 0, 0, 1468, 1460, 1, 0, 0, 0, + 1468, 1469, 1, 0, 0, 0, 1469, 1470, 1, 0, 0, 0, 1470, 1471, 5, 286, 0, + 0, 1471, 227, 1, 0, 0, 0, 1472, 1481, 5, 283, 0, 0, 1473, 1478, 3, 154, + 77, 0, 1474, 1475, 5, 268, 0, 0, 1475, 1477, 3, 154, 77, 0, 1476, 1474, + 1, 0, 0, 0, 1477, 1480, 1, 0, 0, 0, 1478, 1476, 1, 0, 0, 0, 1478, 1479, + 1, 0, 0, 0, 1479, 1482, 1, 0, 0, 0, 1480, 1478, 1, 0, 0, 0, 1481, 1473, + 1, 0, 0, 0, 1481, 1482, 1, 0, 0, 0, 1482, 1483, 1, 0, 0, 0, 1483, 1484, + 5, 284, 0, 0, 1484, 229, 1, 0, 0, 0, 1485, 1494, 5, 287, 0, 0, 1486, 1491, + 3, 232, 116, 0, 1487, 1488, 5, 268, 0, 0, 1488, 1490, 3, 232, 116, 0, 1489, + 1487, 1, 0, 0, 0, 1490, 1493, 1, 0, 0, 0, 1491, 1489, 1, 0, 0, 0, 1491, + 1492, 1, 0, 0, 0, 1492, 1495, 1, 0, 0, 0, 1493, 1491, 1, 0, 0, 0, 1494, + 1486, 1, 0, 0, 0, 1494, 1495, 1, 0, 0, 0, 1495, 1496, 1, 0, 0, 0, 1496, + 1497, 5, 288, 0, 0, 1497, 231, 1, 0, 0, 0, 1498, 1499, 3, 154, 77, 0, 1499, + 1500, 5, 291, 0, 0, 1500, 1501, 3, 154, 77, 0, 1501, 233, 1, 0, 0, 0, 1502, + 1525, 5, 139, 0, 0, 1503, 1525, 5, 234, 0, 0, 1504, 1525, 5, 206, 0, 0, + 1505, 1525, 5, 86, 0, 0, 1506, 1525, 5, 295, 0, 0, 1507, 1525, 5, 296, + 0, 0, 1508, 1525, 5, 297, 0, 0, 1509, 1525, 5, 304, 0, 0, 1510, 1511, 5, + 53, 0, 0, 1511, 1525, 5, 295, 0, 0, 1512, 1516, 5, 199, 0, 0, 1513, 1514, + 5, 289, 0, 0, 1514, 1515, 5, 296, 0, 0, 1515, 1517, 5, 290, 0, 0, 1516, + 1513, 1, 0, 0, 0, 1516, 1517, 1, 0, 0, 0, 1517, 1521, 1, 0, 0, 0, 1518, + 1519, 5, 224, 0, 0, 1519, 1520, 5, 199, 0, 0, 1520, 1522, 5, 227, 0, 0, + 1521, 1518, 1, 0, 0, 0, 1521, 1522, 1, 0, 0, 0, 1522, 1523, 1, 0, 0, 0, + 1523, 1525, 5, 295, 0, 0, 1524, 1502, 1, 0, 0, 0, 1524, 1503, 1, 0, 0, + 0, 1524, 1504, 1, 0, 0, 0, 1524, 1505, 1, 0, 0, 0, 1524, 1506, 1, 0, 0, + 0, 1524, 1507, 1, 0, 0, 0, 1524, 1508, 1, 0, 0, 0, 1524, 1509, 1, 0, 0, + 0, 1524, 1510, 1, 0, 0, 0, 1524, 1512, 1, 0, 0, 0, 1525, 235, 1, 0, 0, + 0, 1526, 1565, 7, 16, 0, 0, 1527, 1528, 5, 69, 0, 0, 1528, 1565, 5, 159, + 0, 0, 1529, 1533, 7, 17, 0, 0, 1530, 1531, 5, 289, 0, 0, 1531, 1532, 5, + 296, 0, 0, 1532, 1534, 5, 290, 0, 0, 1533, 1530, 1, 0, 0, 0, 1533, 1534, + 1, 0, 0, 0, 1534, 1565, 1, 0, 0, 0, 1535, 1536, 5, 27, 0, 0, 1536, 1540, + 5, 219, 0, 0, 1537, 1538, 5, 289, 0, 0, 1538, 1539, 5, 296, 0, 0, 1539, + 1541, 5, 290, 0, 0, 1540, 1537, 1, 0, 0, 0, 1540, 1541, 1, 0, 0, 0, 1541, + 1565, 1, 0, 0, 0, 1542, 1550, 7, 18, 0, 0, 1543, 1544, 5, 289, 0, 0, 1544, + 1547, 5, 296, 0, 0, 1545, 1546, 5, 268, 0, 0, 1546, 1548, 5, 296, 0, 0, + 1547, 1545, 1, 0, 0, 0, 1547, 1548, 1, 0, 0, 0, 1548, 1549, 1, 0, 0, 0, + 1549, 1551, 5, 290, 0, 0, 1550, 1543, 1, 0, 0, 0, 1550, 1551, 1, 0, 0, + 0, 1551, 1565, 1, 0, 0, 0, 1552, 1556, 5, 199, 0, 0, 1553, 1554, 5, 289, + 0, 0, 1554, 1555, 5, 296, 0, 0, 1555, 1557, 5, 290, 0, 0, 1556, 1553, 1, + 0, 0, 0, 1556, 1557, 1, 0, 0, 0, 1557, 1561, 1, 0, 0, 0, 1558, 1559, 5, + 224, 0, 0, 1559, 1560, 5, 199, 0, 0, 1560, 1562, 5, 227, 0, 0, 1561, 1558, + 1, 0, 0, 0, 1561, 1562, 1, 0, 0, 0, 1562, 1565, 1, 0, 0, 0, 1563, 1565, + 3, 14, 7, 0, 1564, 1526, 1, 0, 0, 0, 1564, 1527, 1, 0, 0, 0, 1564, 1529, + 1, 0, 0, 0, 1564, 1535, 1, 0, 0, 0, 1564, 1542, 1, 0, 0, 0, 1564, 1552, + 1, 0, 0, 0, 1564, 1563, 1, 0, 0, 0, 1565, 237, 1, 0, 0, 0, 202, 243, 247, + 258, 263, 265, 273, 298, 301, 305, 320, 325, 336, 342, 345, 348, 352, 357, + 360, 365, 372, 378, 391, 397, 405, 419, 422, 425, 434, 437, 443, 447, 449, + 461, 464, 472, 480, 492, 507, 517, 520, 528, 537, 542, 545, 548, 554, 561, + 566, 571, 580, 587, 592, 595, 605, 619, 624, 628, 632, 640, 644, 653, 658, + 661, 672, 682, 701, 706, 713, 717, 720, 725, 731, 737, 742, 744, 753, 756, + 759, 765, 769, 771, 775, 778, 783, 786, 790, 794, 797, 802, 805, 809, 811, + 818, 821, 857, 861, 864, 867, 880, 884, 886, 894, 898, 908, 914, 916, 921, + 928, 931, 934, 938, 941, 944, 946, 951, 954, 957, 964, 972, 976, 980, 983, + 992, 996, 1001, 1005, 1010, 1014, 1017, 1019, 1025, 1028, 1031, 1034, 1037, + 1040, 1043, 1046, 1056, 1067, 1073, 1084, 1089, 1098, 1104, 1110, 1114, + 1121, 1123, 1134, 1145, 1156, 1162, 1183, 1189, 1193, 1205, 1221, 1228, + 1237, 1241, 1251, 1260, 1271, 1282, 1285, 1296, 1298, 1309, 1311, 1315, + 1324, 1329, 1338, 1340, 1376, 1379, 1382, 1403, 1406, 1416, 1419, 1423, + 1436, 1451, 1457, 1465, 1468, 1478, 1481, 1491, 1494, 1516, 1521, 1524, + 1533, 1540, 1547, 1550, 1556, 1561, 1564, + } + deserializer := antlr.NewATNDeserializer(nil) + staticData.atn = deserializer.Deserialize(staticData.serializedATN) + atn := staticData.atn + staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) + decisionToDFA := staticData.decisionToDFA + for index, state := range atn.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(state, index) + } +} + +// PartiQLParserParserInit initializes any static state used to implement PartiQLParserParser. By default the +// static state used to implement the parser is lazily initialized during the first call to +// NewPartiQLParserParser(). You can call this function if you wish to initialize the static state ahead +// of time. +func PartiQLParserParserInit() { + staticData := &PartiQLParserParserStaticData + staticData.once.Do(partiqlparserParserInit) +} + +// NewPartiQLParserParser produces a new parser instance for the optional input antlr.TokenStream. +func NewPartiQLParserParser(input antlr.TokenStream) *PartiQLParserParser { + PartiQLParserParserInit() + this := new(PartiQLParserParser) + this.BaseParser = antlr.NewBaseParser(input) + staticData := &PartiQLParserParserStaticData + this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) + this.RuleNames = staticData.RuleNames + this.LiteralNames = staticData.LiteralNames + this.SymbolicNames = staticData.SymbolicNames + this.GrammarFileName = "PartiQLParser.g4" + + return this +} + +// PartiQLParserParser tokens. +const ( + PartiQLParserParserEOF = antlr.TokenEOF + PartiQLParserParserABSOLUTE = 1 + PartiQLParserParserACTION = 2 + PartiQLParserParserADD = 3 + PartiQLParserParserALL = 4 + PartiQLParserParserALLOCATE = 5 + PartiQLParserParserALTER = 6 + PartiQLParserParserAND = 7 + PartiQLParserParserANY = 8 + PartiQLParserParserARE = 9 + PartiQLParserParserAS = 10 + PartiQLParserParserASC = 11 + PartiQLParserParserASSERTION = 12 + PartiQLParserParserAT = 13 + PartiQLParserParserAUTHORIZATION = 14 + PartiQLParserParserAVG = 15 + PartiQLParserParserBEGIN = 16 + PartiQLParserParserBETWEEN = 17 + PartiQLParserParserBIT = 18 + PartiQLParserParserBIT_LENGTH = 19 + PartiQLParserParserBY = 20 + PartiQLParserParserCASCADE = 21 + PartiQLParserParserCASCADED = 22 + PartiQLParserParserCASE = 23 + PartiQLParserParserCAST = 24 + PartiQLParserParserCATALOG = 25 + PartiQLParserParserCHAR = 26 + PartiQLParserParserCHARACTER = 27 + PartiQLParserParserCHARACTER_LENGTH = 28 + PartiQLParserParserCHAR_LENGTH = 29 + PartiQLParserParserCHECK = 30 + PartiQLParserParserCLOSE = 31 + PartiQLParserParserCOALESCE = 32 + PartiQLParserParserCOLLATE = 33 + PartiQLParserParserCOLLATION = 34 + PartiQLParserParserCOLUMN = 35 + PartiQLParserParserCOMMIT = 36 + PartiQLParserParserCONNECT = 37 + PartiQLParserParserCONNECTION = 38 + PartiQLParserParserCONSTRAINT = 39 + PartiQLParserParserCONSTRAINTS = 40 + PartiQLParserParserCONTINUE = 41 + PartiQLParserParserCONVERT = 42 + PartiQLParserParserCORRESPONDING = 43 + PartiQLParserParserCOUNT = 44 + PartiQLParserParserCREATE = 45 + PartiQLParserParserCROSS = 46 + PartiQLParserParserCURRENT = 47 + PartiQLParserParserCURRENT_DATE = 48 + PartiQLParserParserCURRENT_TIME = 49 + PartiQLParserParserCURRENT_TIMESTAMP = 50 + PartiQLParserParserCURRENT_USER = 51 + PartiQLParserParserCURSOR = 52 + PartiQLParserParserDATE = 53 + PartiQLParserParserDEALLOCATE = 54 + PartiQLParserParserDEC = 55 + PartiQLParserParserDECIMAL = 56 + PartiQLParserParserDECLARE = 57 + PartiQLParserParserDEFAULT = 58 + PartiQLParserParserDEFERRABLE = 59 + PartiQLParserParserDEFERRED = 60 + PartiQLParserParserDELETE = 61 + PartiQLParserParserDESC = 62 + PartiQLParserParserDESCRIBE = 63 + PartiQLParserParserDESCRIPTOR = 64 + PartiQLParserParserDIAGNOSTICS = 65 + PartiQLParserParserDISCONNECT = 66 + PartiQLParserParserDISTINCT = 67 + PartiQLParserParserDOMAIN = 68 + PartiQLParserParserDOUBLE = 69 + PartiQLParserParserDROP = 70 + PartiQLParserParserELSE = 71 + PartiQLParserParserEND = 72 + PartiQLParserParserEND_EXEC = 73 + PartiQLParserParserESCAPE = 74 + PartiQLParserParserEXCEPT = 75 + PartiQLParserParserEXCEPTION = 76 + PartiQLParserParserEXCLUDED = 77 + PartiQLParserParserEXEC = 78 + PartiQLParserParserEXECUTE = 79 + PartiQLParserParserEXISTS = 80 + PartiQLParserParserEXPLAIN = 81 + PartiQLParserParserEXTERNAL = 82 + PartiQLParserParserEXTRACT = 83 + PartiQLParserParserDATE_ADD = 84 + PartiQLParserParserDATE_DIFF = 85 + PartiQLParserParserFALSE = 86 + PartiQLParserParserFETCH = 87 + PartiQLParserParserFIRST = 88 + PartiQLParserParserFLOAT = 89 + PartiQLParserParserFOR = 90 + PartiQLParserParserFOREIGN = 91 + PartiQLParserParserFOUND = 92 + PartiQLParserParserFROM = 93 + PartiQLParserParserFULL = 94 + PartiQLParserParserGET = 95 + PartiQLParserParserGLOBAL = 96 + PartiQLParserParserGO = 97 + PartiQLParserParserGOTO = 98 + PartiQLParserParserGRANT = 99 + PartiQLParserParserGROUP = 100 + PartiQLParserParserHAVING = 101 + PartiQLParserParserIDENTITY = 102 + PartiQLParserParserIMMEDIATE = 103 + PartiQLParserParserIN = 104 + PartiQLParserParserINDICATOR = 105 + PartiQLParserParserINITIALLY = 106 + PartiQLParserParserINNER = 107 + PartiQLParserParserINPUT = 108 + PartiQLParserParserINSENSITIVE = 109 + PartiQLParserParserINSERT = 110 + PartiQLParserParserINT = 111 + PartiQLParserParserINTEGER = 112 + PartiQLParserParserINTERSECT = 113 + PartiQLParserParserINTERVAL = 114 + PartiQLParserParserINTO = 115 + PartiQLParserParserIS = 116 + PartiQLParserParserISOLATION = 117 + PartiQLParserParserJOIN = 118 + PartiQLParserParserKEY = 119 + PartiQLParserParserLANGUAGE = 120 + PartiQLParserParserLAST = 121 + PartiQLParserParserLATERAL = 122 + PartiQLParserParserLEFT = 123 + PartiQLParserParserLEVEL = 124 + PartiQLParserParserLIKE = 125 + PartiQLParserParserLOCAL = 126 + PartiQLParserParserLOWER = 127 + PartiQLParserParserMATCH = 128 + PartiQLParserParserMAX = 129 + PartiQLParserParserMIN = 130 + PartiQLParserParserMODULE = 131 + PartiQLParserParserNAMES = 132 + PartiQLParserParserNATIONAL = 133 + PartiQLParserParserNATURAL = 134 + PartiQLParserParserNCHAR = 135 + PartiQLParserParserNEXT = 136 + PartiQLParserParserNO = 137 + PartiQLParserParserNOT = 138 + PartiQLParserParserNULL = 139 + PartiQLParserParserNULLS = 140 + PartiQLParserParserNULLIF = 141 + PartiQLParserParserNUMERIC = 142 + PartiQLParserParserOCTET_LENGTH = 143 + PartiQLParserParserOF = 144 + PartiQLParserParserON = 145 + PartiQLParserParserONLY = 146 + PartiQLParserParserOPEN = 147 + PartiQLParserParserOPTION = 148 + PartiQLParserParserOR = 149 + PartiQLParserParserORDER = 150 + PartiQLParserParserOUTER = 151 + PartiQLParserParserOUTPUT = 152 + PartiQLParserParserOVERLAPS = 153 + PartiQLParserParserOVERLAY = 154 + PartiQLParserParserPAD = 155 + PartiQLParserParserPARTIAL = 156 + PartiQLParserParserPLACING = 157 + PartiQLParserParserPOSITION = 158 + PartiQLParserParserPRECISION = 159 + PartiQLParserParserPREPARE = 160 + PartiQLParserParserPRESERVE = 161 + PartiQLParserParserPRIMARY = 162 + PartiQLParserParserPRIOR = 163 + PartiQLParserParserPRIVILEGES = 164 + PartiQLParserParserPROCEDURE = 165 + PartiQLParserParserPUBLIC = 166 + PartiQLParserParserREAD = 167 + PartiQLParserParserREAL = 168 + PartiQLParserParserREFERENCES = 169 + PartiQLParserParserRELATIVE = 170 + PartiQLParserParserREPLACE = 171 + PartiQLParserParserRESTRICT = 172 + PartiQLParserParserREVOKE = 173 + PartiQLParserParserRIGHT = 174 + PartiQLParserParserROLLBACK = 175 + PartiQLParserParserROWS = 176 + PartiQLParserParserSCHEMA = 177 + PartiQLParserParserSCROLL = 178 + PartiQLParserParserSECTION = 179 + PartiQLParserParserSELECT = 180 + PartiQLParserParserSESSION = 181 + PartiQLParserParserSESSION_USER = 182 + PartiQLParserParserSET = 183 + PartiQLParserParserSHORTEST = 184 + PartiQLParserParserSIZE = 185 + PartiQLParserParserSMALLINT = 186 + PartiQLParserParserSOME = 187 + PartiQLParserParserSPACE = 188 + PartiQLParserParserSQL = 189 + PartiQLParserParserSQLCODE = 190 + PartiQLParserParserSQLERROR = 191 + PartiQLParserParserSQLSTATE = 192 + PartiQLParserParserSUBSTRING = 193 + PartiQLParserParserSUM = 194 + PartiQLParserParserSYSTEM_USER = 195 + PartiQLParserParserTABLE = 196 + PartiQLParserParserTEMPORARY = 197 + PartiQLParserParserTHEN = 198 + PartiQLParserParserTIME = 199 + PartiQLParserParserTIMESTAMP = 200 + PartiQLParserParserTO = 201 + PartiQLParserParserTRANSACTION = 202 + PartiQLParserParserTRANSLATE = 203 + PartiQLParserParserTRANSLATION = 204 + PartiQLParserParserTRIM = 205 + PartiQLParserParserTRUE = 206 + PartiQLParserParserUNION = 207 + PartiQLParserParserUNIQUE = 208 + PartiQLParserParserUNKNOWN = 209 + PartiQLParserParserUPDATE = 210 + PartiQLParserParserUPPER = 211 + PartiQLParserParserUPSERT = 212 + PartiQLParserParserUSAGE = 213 + PartiQLParserParserUSER = 214 + PartiQLParserParserUSING = 215 + PartiQLParserParserVALUE = 216 + PartiQLParserParserVALUES = 217 + PartiQLParserParserVARCHAR = 218 + PartiQLParserParserVARYING = 219 + PartiQLParserParserVIEW = 220 + PartiQLParserParserWHEN = 221 + PartiQLParserParserWHENEVER = 222 + PartiQLParserParserWHERE = 223 + PartiQLParserParserWITH = 224 + PartiQLParserParserWORK = 225 + PartiQLParserParserWRITE = 226 + PartiQLParserParserZONE = 227 + PartiQLParserParserLAG = 228 + PartiQLParserParserLEAD = 229 + PartiQLParserParserOVER = 230 + PartiQLParserParserPARTITION = 231 + PartiQLParserParserCAN_CAST = 232 + PartiQLParserParserCAN_LOSSLESS_CAST = 233 + PartiQLParserParserMISSING = 234 + PartiQLParserParserPIVOT = 235 + PartiQLParserParserUNPIVOT = 236 + PartiQLParserParserLIMIT = 237 + PartiQLParserParserOFFSET = 238 + PartiQLParserParserREMOVE = 239 + PartiQLParserParserINDEX = 240 + PartiQLParserParserLET = 241 + PartiQLParserParserCONFLICT = 242 + PartiQLParserParserDO = 243 + PartiQLParserParserRETURNING = 244 + PartiQLParserParserMODIFIED = 245 + PartiQLParserParserNEW = 246 + PartiQLParserParserOLD = 247 + PartiQLParserParserNOTHING = 248 + PartiQLParserParserTUPLE = 249 + PartiQLParserParserINTEGER2 = 250 + PartiQLParserParserINT2 = 251 + PartiQLParserParserINTEGER4 = 252 + PartiQLParserParserINT4 = 253 + PartiQLParserParserINTEGER8 = 254 + PartiQLParserParserINT8 = 255 + PartiQLParserParserBIGINT = 256 + PartiQLParserParserBOOL = 257 + PartiQLParserParserBOOLEAN = 258 + PartiQLParserParserSTRING = 259 + PartiQLParserParserSYMBOL = 260 + PartiQLParserParserCLOB = 261 + PartiQLParserParserBLOB = 262 + PartiQLParserParserSTRUCT = 263 + PartiQLParserParserLIST = 264 + PartiQLParserParserSEXP = 265 + PartiQLParserParserBAG = 266 + PartiQLParserParserCARET = 267 + PartiQLParserParserCOMMA = 268 + PartiQLParserParserPLUS = 269 + PartiQLParserParserMINUS = 270 + PartiQLParserParserSLASH_FORWARD = 271 + PartiQLParserParserPERCENT = 272 + PartiQLParserParserAT_SIGN = 273 + PartiQLParserParserTILDE = 274 + PartiQLParserParserASTERISK = 275 + PartiQLParserParserLT_EQ = 276 + PartiQLParserParserGT_EQ = 277 + PartiQLParserParserEQ = 278 + PartiQLParserParserNEQ = 279 + PartiQLParserParserCONCAT = 280 + PartiQLParserParserANGLE_LEFT = 281 + PartiQLParserParserANGLE_RIGHT = 282 + PartiQLParserParserANGLE_DOUBLE_LEFT = 283 + PartiQLParserParserANGLE_DOUBLE_RIGHT = 284 + PartiQLParserParserBRACKET_LEFT = 285 + PartiQLParserParserBRACKET_RIGHT = 286 + PartiQLParserParserBRACE_LEFT = 287 + PartiQLParserParserBRACE_RIGHT = 288 + PartiQLParserParserPAREN_LEFT = 289 + PartiQLParserParserPAREN_RIGHT = 290 + PartiQLParserParserCOLON = 291 + PartiQLParserParserCOLON_SEMI = 292 + PartiQLParserParserQUESTION_MARK = 293 + PartiQLParserParserPERIOD = 294 + PartiQLParserParserLITERAL_STRING = 295 + PartiQLParserParserLITERAL_INTEGER = 296 + PartiQLParserParserLITERAL_DECIMAL = 297 + PartiQLParserParserIDENTIFIER = 298 + PartiQLParserParserIDENTIFIER_QUOTED = 299 + PartiQLParserParserWS = 300 + PartiQLParserParserCOMMENT_SINGLE = 301 + PartiQLParserParserCOMMENT_BLOCK = 302 + PartiQLParserParserUNRECOGNIZED = 303 + PartiQLParserParserION_CLOSURE = 304 + PartiQLParserParserBACKTICK = 305 +) + +// PartiQLParserParser rules. +const ( + PartiQLParserParserRULE_script = 0 + PartiQLParserParserRULE_root = 1 + PartiQLParserParserRULE_statement = 2 + PartiQLParserParserRULE_explainOption = 3 + PartiQLParserParserRULE_asIdent = 4 + PartiQLParserParserRULE_atIdent = 5 + PartiQLParserParserRULE_byIdent = 6 + PartiQLParserParserRULE_symbolPrimitive = 7 + PartiQLParserParserRULE_dql = 8 + PartiQLParserParserRULE_execCommand = 9 + PartiQLParserParserRULE_ddl = 10 + PartiQLParserParserRULE_createCommand = 11 + PartiQLParserParserRULE_dropCommand = 12 + PartiQLParserParserRULE_dml = 13 + PartiQLParserParserRULE_dmlBaseCommand = 14 + PartiQLParserParserRULE_pathSimple = 15 + PartiQLParserParserRULE_pathSimpleSteps = 16 + PartiQLParserParserRULE_replaceCommand = 17 + PartiQLParserParserRULE_upsertCommand = 18 + PartiQLParserParserRULE_removeCommand = 19 + PartiQLParserParserRULE_insertCommandReturning = 20 + PartiQLParserParserRULE_insertCommand = 21 + PartiQLParserParserRULE_onConflictClause = 22 + PartiQLParserParserRULE_conflictTarget = 23 + PartiQLParserParserRULE_constraintName = 24 + PartiQLParserParserRULE_conflictAction = 25 + PartiQLParserParserRULE_doReplace = 26 + PartiQLParserParserRULE_doUpdate = 27 + PartiQLParserParserRULE_updateClause = 28 + PartiQLParserParserRULE_setCommand = 29 + PartiQLParserParserRULE_setAssignment = 30 + PartiQLParserParserRULE_deleteCommand = 31 + PartiQLParserParserRULE_returningClause = 32 + PartiQLParserParserRULE_returningColumn = 33 + PartiQLParserParserRULE_fromClauseSimple = 34 + PartiQLParserParserRULE_whereClause = 35 + PartiQLParserParserRULE_selectClause = 36 + PartiQLParserParserRULE_projectionItems = 37 + PartiQLParserParserRULE_projectionItem = 38 + PartiQLParserParserRULE_setQuantifierStrategy = 39 + PartiQLParserParserRULE_letClause = 40 + PartiQLParserParserRULE_letBinding = 41 + PartiQLParserParserRULE_orderByClause = 42 + PartiQLParserParserRULE_orderSortSpec = 43 + PartiQLParserParserRULE_groupClause = 44 + PartiQLParserParserRULE_groupAlias = 45 + PartiQLParserParserRULE_groupKey = 46 + PartiQLParserParserRULE_over = 47 + PartiQLParserParserRULE_windowPartitionList = 48 + PartiQLParserParserRULE_windowSortSpecList = 49 + PartiQLParserParserRULE_havingClause = 50 + PartiQLParserParserRULE_fromClause = 51 + PartiQLParserParserRULE_whereClauseSelect = 52 + PartiQLParserParserRULE_offsetByClause = 53 + PartiQLParserParserRULE_limitClause = 54 + PartiQLParserParserRULE_gpmlPattern = 55 + PartiQLParserParserRULE_gpmlPatternList = 56 + PartiQLParserParserRULE_matchPattern = 57 + PartiQLParserParserRULE_graphPart = 58 + PartiQLParserParserRULE_matchSelector = 59 + PartiQLParserParserRULE_patternPathVariable = 60 + PartiQLParserParserRULE_patternRestrictor = 61 + PartiQLParserParserRULE_node = 62 + PartiQLParserParserRULE_edge = 63 + PartiQLParserParserRULE_pattern = 64 + PartiQLParserParserRULE_patternQuantifier = 65 + PartiQLParserParserRULE_edgeWSpec = 66 + PartiQLParserParserRULE_edgeSpec = 67 + PartiQLParserParserRULE_patternPartLabel = 68 + PartiQLParserParserRULE_edgeAbbrev = 69 + PartiQLParserParserRULE_tableReference = 70 + PartiQLParserParserRULE_tableNonJoin = 71 + PartiQLParserParserRULE_tableBaseReference = 72 + PartiQLParserParserRULE_tableUnpivot = 73 + PartiQLParserParserRULE_joinRhs = 74 + PartiQLParserParserRULE_joinSpec = 75 + PartiQLParserParserRULE_joinType = 76 + PartiQLParserParserRULE_expr = 77 + PartiQLParserParserRULE_exprBagOp = 78 + PartiQLParserParserRULE_exprSelect = 79 + PartiQLParserParserRULE_exprOr = 80 + PartiQLParserParserRULE_exprAnd = 81 + PartiQLParserParserRULE_exprNot = 82 + PartiQLParserParserRULE_exprPredicate = 83 + PartiQLParserParserRULE_mathOp00 = 84 + PartiQLParserParserRULE_mathOp01 = 85 + PartiQLParserParserRULE_mathOp02 = 86 + PartiQLParserParserRULE_valueExpr = 87 + PartiQLParserParserRULE_exprPrimary = 88 + PartiQLParserParserRULE_exprTerm = 89 + PartiQLParserParserRULE_nullIf = 90 + PartiQLParserParserRULE_coalesce = 91 + PartiQLParserParserRULE_caseExpr = 92 + PartiQLParserParserRULE_values = 93 + PartiQLParserParserRULE_valueRow = 94 + PartiQLParserParserRULE_valueList = 95 + PartiQLParserParserRULE_sequenceConstructor = 96 + PartiQLParserParserRULE_substring = 97 + PartiQLParserParserRULE_aggregate = 98 + PartiQLParserParserRULE_windowFunction = 99 + PartiQLParserParserRULE_cast = 100 + PartiQLParserParserRULE_canLosslessCast = 101 + PartiQLParserParserRULE_canCast = 102 + PartiQLParserParserRULE_extract = 103 + PartiQLParserParserRULE_trimFunction = 104 + PartiQLParserParserRULE_dateFunction = 105 + PartiQLParserParserRULE_functionCall = 106 + PartiQLParserParserRULE_pathStep = 107 + PartiQLParserParserRULE_exprGraphMatchMany = 108 + PartiQLParserParserRULE_exprGraphMatchOne = 109 + PartiQLParserParserRULE_parameter = 110 + PartiQLParserParserRULE_varRefExpr = 111 + PartiQLParserParserRULE_collection = 112 + PartiQLParserParserRULE_array = 113 + PartiQLParserParserRULE_bag = 114 + PartiQLParserParserRULE_tuple = 115 + PartiQLParserParserRULE_pair = 116 + PartiQLParserParserRULE_literal = 117 + PartiQLParserParserRULE_type = 118 +) + +// IScriptContext is an interface to support dynamic dispatch. +type IScriptContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AllRoot() []IRootContext + Root(i int) IRootContext + EOF() antlr.TerminalNode + AllCOLON_SEMI() []antlr.TerminalNode + COLON_SEMI(i int) antlr.TerminalNode + + // IsScriptContext differentiates from other interfaces. + IsScriptContext() +} + +type ScriptContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyScriptContext() *ScriptContext { + var p = new(ScriptContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_script + return p +} + +func InitEmptyScriptContext(p *ScriptContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_script +} + +func (*ScriptContext) IsScriptContext() {} + +func NewScriptContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ScriptContext { + var p = new(ScriptContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_script + + return p +} + +func (s *ScriptContext) GetParser() antlr.Parser { return s.parser } + +func (s *ScriptContext) AllRoot() []IRootContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IRootContext); ok { + len++ + } + } + + tst := make([]IRootContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IRootContext); ok { + tst[i] = t.(IRootContext) + i++ + } + } + + return tst +} + +func (s *ScriptContext) Root(i int) IRootContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IRootContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IRootContext) +} + +func (s *ScriptContext) EOF() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEOF, 0) +} + +func (s *ScriptContext) AllCOLON_SEMI() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOLON_SEMI) +} + +func (s *ScriptContext) COLON_SEMI(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOLON_SEMI, i) +} + +func (s *ScriptContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ScriptContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ScriptContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterScript(s) + } +} + +func (s *ScriptContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitScript(s) + } +} + +func (s *ScriptContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitScript(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Script() (localctx IScriptContext) { + localctx = NewScriptContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 0, PartiQLParserParserRULE_script) + var _la int + + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(238) + p.Root() + } + p.SetState(243) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 0, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(239) + p.Match(PartiQLParserParserCOLON_SEMI) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(240) + p.Root() + } + + } + p.SetState(245) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 0, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + p.SetState(247) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserCOLON_SEMI { + { + p.SetState(246) + p.Match(PartiQLParserParserCOLON_SEMI) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(249) + p.Match(PartiQLParserParserEOF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IRootContext is an interface to support dynamic dispatch. +type IRootContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Statement() IStatementContext + EXPLAIN() antlr.TerminalNode + PAREN_LEFT() antlr.TerminalNode + AllExplainOption() []IExplainOptionContext + ExplainOption(i int) IExplainOptionContext + PAREN_RIGHT() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsRootContext differentiates from other interfaces. + IsRootContext() +} + +type RootContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyRootContext() *RootContext { + var p = new(RootContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_root + return p +} + +func InitEmptyRootContext(p *RootContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_root +} + +func (*RootContext) IsRootContext() {} + +func NewRootContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RootContext { + var p = new(RootContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_root + + return p +} + +func (s *RootContext) GetParser() antlr.Parser { return s.parser } + +func (s *RootContext) Statement() IStatementContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStatementContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IStatementContext) +} + +func (s *RootContext) EXPLAIN() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEXPLAIN, 0) +} + +func (s *RootContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *RootContext) AllExplainOption() []IExplainOptionContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExplainOptionContext); ok { + len++ + } + } + + tst := make([]IExplainOptionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExplainOptionContext); ok { + tst[i] = t.(IExplainOptionContext) + i++ + } + } + + return tst +} + +func (s *RootContext) ExplainOption(i int) IExplainOptionContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExplainOptionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExplainOptionContext) +} + +func (s *RootContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *RootContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *RootContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *RootContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *RootContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *RootContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterRoot(s) + } +} + +func (s *RootContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitRoot(s) + } +} + +func (s *RootContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitRoot(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Root() (localctx IRootContext) { + localctx = NewRootContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 2, PartiQLParserParserRULE_root) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(265) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserEXPLAIN { + { + p.SetState(251) + p.Match(PartiQLParserParserEXPLAIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(263) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext()) == 1 { + { + p.SetState(252) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(253) + p.ExplainOption() + } + p.SetState(258) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(254) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(255) + p.ExplainOption() + } + + p.SetState(260) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(261) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + + } + { + p.SetState(267) + p.Statement() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IStatementContext is an interface to support dynamic dispatch. +type IStatementContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsStatementContext differentiates from other interfaces. + IsStatementContext() +} + +type StatementContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyStatementContext() *StatementContext { + var p = new(StatementContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_statement + return p +} + +func InitEmptyStatementContext(p *StatementContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_statement +} + +func (*StatementContext) IsStatementContext() {} + +func NewStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StatementContext { + var p = new(StatementContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_statement + + return p +} + +func (s *StatementContext) GetParser() antlr.Parser { return s.parser } + +func (s *StatementContext) CopyAll(ctx *StatementContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *StatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *StatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type QueryExecContext struct { + StatementContext +} + +func NewQueryExecContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QueryExecContext { + var p = new(QueryExecContext) + + InitEmptyStatementContext(&p.StatementContext) + p.parser = parser + p.CopyAll(ctx.(*StatementContext)) + + return p +} + +func (s *QueryExecContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *QueryExecContext) ExecCommand() IExecCommandContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExecCommandContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExecCommandContext) +} + +func (s *QueryExecContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterQueryExec(s) + } +} + +func (s *QueryExecContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitQueryExec(s) + } +} + +func (s *QueryExecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitQueryExec(s) + + default: + return t.VisitChildren(s) + } +} + +type QueryDdlContext struct { + StatementContext +} + +func NewQueryDdlContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QueryDdlContext { + var p = new(QueryDdlContext) + + InitEmptyStatementContext(&p.StatementContext) + p.parser = parser + p.CopyAll(ctx.(*StatementContext)) + + return p +} + +func (s *QueryDdlContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *QueryDdlContext) Ddl() IDdlContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDdlContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDdlContext) +} + +func (s *QueryDdlContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterQueryDdl(s) + } +} + +func (s *QueryDdlContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitQueryDdl(s) + } +} + +func (s *QueryDdlContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitQueryDdl(s) + + default: + return t.VisitChildren(s) + } +} + +type QueryDqlContext struct { + StatementContext +} + +func NewQueryDqlContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QueryDqlContext { + var p = new(QueryDqlContext) + + InitEmptyStatementContext(&p.StatementContext) + p.parser = parser + p.CopyAll(ctx.(*StatementContext)) + + return p +} + +func (s *QueryDqlContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *QueryDqlContext) Dql() IDqlContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDqlContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDqlContext) +} + +func (s *QueryDqlContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterQueryDql(s) + } +} + +func (s *QueryDqlContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitQueryDql(s) + } +} + +func (s *QueryDqlContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitQueryDql(s) + + default: + return t.VisitChildren(s) + } +} + +type QueryDmlContext struct { + StatementContext +} + +func NewQueryDmlContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QueryDmlContext { + var p = new(QueryDmlContext) + + InitEmptyStatementContext(&p.StatementContext) + p.parser = parser + p.CopyAll(ctx.(*StatementContext)) + + return p +} + +func (s *QueryDmlContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *QueryDmlContext) Dml() IDmlContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDmlContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDmlContext) +} + +func (s *QueryDmlContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterQueryDml(s) + } +} + +func (s *QueryDmlContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitQueryDml(s) + } +} + +func (s *QueryDmlContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitQueryDml(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Statement() (localctx IStatementContext) { + localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 4, PartiQLParserParserRULE_statement) + p.SetState(273) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserAVG, PartiQLParserParserBIT_LENGTH, PartiQLParserParserCASE, PartiQLParserParserCAST, PartiQLParserParserCHARACTER_LENGTH, PartiQLParserParserCHAR_LENGTH, PartiQLParserParserCOALESCE, PartiQLParserParserCOUNT, PartiQLParserParserDATE, PartiQLParserParserEXISTS, PartiQLParserParserEXTRACT, PartiQLParserParserDATE_ADD, PartiQLParserParserDATE_DIFF, PartiQLParserParserFALSE, PartiQLParserParserLOWER, PartiQLParserParserMAX, PartiQLParserParserMIN, PartiQLParserParserNOT, PartiQLParserParserNULL, PartiQLParserParserNULLIF, PartiQLParserParserOCTET_LENGTH, PartiQLParserParserSELECT, PartiQLParserParserSIZE, PartiQLParserParserSUBSTRING, PartiQLParserParserSUM, PartiQLParserParserTIME, PartiQLParserParserTRIM, PartiQLParserParserTRUE, PartiQLParserParserUPPER, PartiQLParserParserVALUES, PartiQLParserParserLAG, PartiQLParserParserLEAD, PartiQLParserParserCAN_CAST, PartiQLParserParserCAN_LOSSLESS_CAST, PartiQLParserParserMISSING, PartiQLParserParserPIVOT, PartiQLParserParserLIST, PartiQLParserParserSEXP, PartiQLParserParserPLUS, PartiQLParserParserMINUS, PartiQLParserParserAT_SIGN, PartiQLParserParserANGLE_DOUBLE_LEFT, PartiQLParserParserBRACKET_LEFT, PartiQLParserParserBRACE_LEFT, PartiQLParserParserPAREN_LEFT, PartiQLParserParserQUESTION_MARK, PartiQLParserParserLITERAL_STRING, PartiQLParserParserLITERAL_INTEGER, PartiQLParserParserLITERAL_DECIMAL, PartiQLParserParserIDENTIFIER, PartiQLParserParserIDENTIFIER_QUOTED, PartiQLParserParserION_CLOSURE: + localctx = NewQueryDqlContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(269) + p.Dql() + } + + case PartiQLParserParserDELETE, PartiQLParserParserFROM, PartiQLParserParserINSERT, PartiQLParserParserREPLACE, PartiQLParserParserSET, PartiQLParserParserUPDATE, PartiQLParserParserUPSERT, PartiQLParserParserREMOVE: + localctx = NewQueryDmlContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(270) + p.Dml() + } + + case PartiQLParserParserCREATE, PartiQLParserParserDROP: + localctx = NewQueryDdlContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(271) + p.Ddl() + } + + case PartiQLParserParserEXEC: + localctx = NewQueryExecContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(272) + p.ExecCommand() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExplainOptionContext is an interface to support dynamic dispatch. +type IExplainOptionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetParam returns the param token. + GetParam() antlr.Token + + // GetValue returns the value token. + GetValue() antlr.Token + + // SetParam sets the param token. + SetParam(antlr.Token) + + // SetValue sets the value token. + SetValue(antlr.Token) + + // Getter signatures + AllIDENTIFIER() []antlr.TerminalNode + IDENTIFIER(i int) antlr.TerminalNode + + // IsExplainOptionContext differentiates from other interfaces. + IsExplainOptionContext() +} + +type ExplainOptionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + param antlr.Token + value antlr.Token +} + +func NewEmptyExplainOptionContext() *ExplainOptionContext { + var p = new(ExplainOptionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_explainOption + return p +} + +func InitEmptyExplainOptionContext(p *ExplainOptionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_explainOption +} + +func (*ExplainOptionContext) IsExplainOptionContext() {} + +func NewExplainOptionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExplainOptionContext { + var p = new(ExplainOptionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_explainOption + + return p +} + +func (s *ExplainOptionContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExplainOptionContext) GetParam() antlr.Token { return s.param } + +func (s *ExplainOptionContext) GetValue() antlr.Token { return s.value } + +func (s *ExplainOptionContext) SetParam(v antlr.Token) { s.param = v } + +func (s *ExplainOptionContext) SetValue(v antlr.Token) { s.value = v } + +func (s *ExplainOptionContext) AllIDENTIFIER() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserIDENTIFIER) +} + +func (s *ExplainOptionContext) IDENTIFIER(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIDENTIFIER, i) +} + +func (s *ExplainOptionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExplainOptionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ExplainOptionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExplainOption(s) + } +} + +func (s *ExplainOptionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExplainOption(s) + } +} + +func (s *ExplainOptionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExplainOption(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExplainOption() (localctx IExplainOptionContext) { + localctx = NewExplainOptionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 6, PartiQLParserParserRULE_explainOption) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(275) + + var _m = p.Match(PartiQLParserParserIDENTIFIER) + + localctx.(*ExplainOptionContext).param = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(276) + + var _m = p.Match(PartiQLParserParserIDENTIFIER) + + localctx.(*ExplainOptionContext).value = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IAsIdentContext is an interface to support dynamic dispatch. +type IAsIdentContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AS() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + + // IsAsIdentContext differentiates from other interfaces. + IsAsIdentContext() +} + +type AsIdentContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAsIdentContext() *AsIdentContext { + var p = new(AsIdentContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_asIdent + return p +} + +func InitEmptyAsIdentContext(p *AsIdentContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_asIdent +} + +func (*AsIdentContext) IsAsIdentContext() {} + +func NewAsIdentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AsIdentContext { + var p = new(AsIdentContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_asIdent + + return p +} + +func (s *AsIdentContext) GetParser() antlr.Parser { return s.parser } + +func (s *AsIdentContext) AS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAS, 0) +} + +func (s *AsIdentContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *AsIdentContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AsIdentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AsIdentContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterAsIdent(s) + } +} + +func (s *AsIdentContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitAsIdent(s) + } +} + +func (s *AsIdentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitAsIdent(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) AsIdent() (localctx IAsIdentContext) { + localctx = NewAsIdentContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 8, PartiQLParserParserRULE_asIdent) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(278) + p.Match(PartiQLParserParserAS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(279) + p.SymbolPrimitive() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IAtIdentContext is an interface to support dynamic dispatch. +type IAtIdentContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AT() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + + // IsAtIdentContext differentiates from other interfaces. + IsAtIdentContext() +} + +type AtIdentContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAtIdentContext() *AtIdentContext { + var p = new(AtIdentContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_atIdent + return p +} + +func InitEmptyAtIdentContext(p *AtIdentContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_atIdent +} + +func (*AtIdentContext) IsAtIdentContext() {} + +func NewAtIdentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AtIdentContext { + var p = new(AtIdentContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_atIdent + + return p +} + +func (s *AtIdentContext) GetParser() antlr.Parser { return s.parser } + +func (s *AtIdentContext) AT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAT, 0) +} + +func (s *AtIdentContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *AtIdentContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AtIdentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AtIdentContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterAtIdent(s) + } +} + +func (s *AtIdentContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitAtIdent(s) + } +} + +func (s *AtIdentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitAtIdent(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) AtIdent() (localctx IAtIdentContext) { + localctx = NewAtIdentContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 10, PartiQLParserParserRULE_atIdent) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(281) + p.Match(PartiQLParserParserAT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(282) + p.SymbolPrimitive() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IByIdentContext is an interface to support dynamic dispatch. +type IByIdentContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + BY() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + + // IsByIdentContext differentiates from other interfaces. + IsByIdentContext() +} + +type ByIdentContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyByIdentContext() *ByIdentContext { + var p = new(ByIdentContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_byIdent + return p +} + +func InitEmptyByIdentContext(p *ByIdentContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_byIdent +} + +func (*ByIdentContext) IsByIdentContext() {} + +func NewByIdentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ByIdentContext { + var p = new(ByIdentContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_byIdent + + return p +} + +func (s *ByIdentContext) GetParser() antlr.Parser { return s.parser } + +func (s *ByIdentContext) BY() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBY, 0) +} + +func (s *ByIdentContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *ByIdentContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ByIdentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ByIdentContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterByIdent(s) + } +} + +func (s *ByIdentContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitByIdent(s) + } +} + +func (s *ByIdentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitByIdent(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ByIdent() (localctx IByIdentContext) { + localctx = NewByIdentContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, PartiQLParserParserRULE_byIdent) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(284) + p.Match(PartiQLParserParserBY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(285) + p.SymbolPrimitive() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ISymbolPrimitiveContext is an interface to support dynamic dispatch. +type ISymbolPrimitiveContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetIdent returns the ident token. + GetIdent() antlr.Token + + // SetIdent sets the ident token. + SetIdent(antlr.Token) + + // Getter signatures + IDENTIFIER() antlr.TerminalNode + IDENTIFIER_QUOTED() antlr.TerminalNode + + // IsSymbolPrimitiveContext differentiates from other interfaces. + IsSymbolPrimitiveContext() +} + +type SymbolPrimitiveContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + ident antlr.Token +} + +func NewEmptySymbolPrimitiveContext() *SymbolPrimitiveContext { + var p = new(SymbolPrimitiveContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_symbolPrimitive + return p +} + +func InitEmptySymbolPrimitiveContext(p *SymbolPrimitiveContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_symbolPrimitive +} + +func (*SymbolPrimitiveContext) IsSymbolPrimitiveContext() {} + +func NewSymbolPrimitiveContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SymbolPrimitiveContext { + var p = new(SymbolPrimitiveContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_symbolPrimitive + + return p +} + +func (s *SymbolPrimitiveContext) GetParser() antlr.Parser { return s.parser } + +func (s *SymbolPrimitiveContext) GetIdent() antlr.Token { return s.ident } + +func (s *SymbolPrimitiveContext) SetIdent(v antlr.Token) { s.ident = v } + +func (s *SymbolPrimitiveContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIDENTIFIER, 0) +} + +func (s *SymbolPrimitiveContext) IDENTIFIER_QUOTED() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIDENTIFIER_QUOTED, 0) +} + +func (s *SymbolPrimitiveContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SymbolPrimitiveContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SymbolPrimitiveContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSymbolPrimitive(s) + } +} + +func (s *SymbolPrimitiveContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSymbolPrimitive(s) + } +} + +func (s *SymbolPrimitiveContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSymbolPrimitive(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) SymbolPrimitive() (localctx ISymbolPrimitiveContext) { + localctx = NewSymbolPrimitiveContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 14, PartiQLParserParserRULE_symbolPrimitive) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(287) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*SymbolPrimitiveContext).ident = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserIDENTIFIER || _la == PartiQLParserParserIDENTIFIER_QUOTED) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*SymbolPrimitiveContext).ident = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDqlContext is an interface to support dynamic dispatch. +type IDqlContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Expr() IExprContext + + // IsDqlContext differentiates from other interfaces. + IsDqlContext() +} + +type DqlContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDqlContext() *DqlContext { + var p = new(DqlContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_dql + return p +} + +func InitEmptyDqlContext(p *DqlContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_dql +} + +func (*DqlContext) IsDqlContext() {} + +func NewDqlContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DqlContext { + var p = new(DqlContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_dql + + return p +} + +func (s *DqlContext) GetParser() antlr.Parser { return s.parser } + +func (s *DqlContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *DqlContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DqlContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DqlContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDql(s) + } +} + +func (s *DqlContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDql(s) + } +} + +func (s *DqlContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDql(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Dql() (localctx IDqlContext) { + localctx = NewDqlContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, PartiQLParserParserRULE_dql) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(289) + p.Expr() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExecCommandContext is an interface to support dynamic dispatch. +type IExecCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetName returns the name rule contexts. + GetName() IExprContext + + // Get_expr returns the _expr rule contexts. + Get_expr() IExprContext + + // SetName sets the name rule contexts. + SetName(IExprContext) + + // Set_expr sets the _expr rule contexts. + Set_expr(IExprContext) + + // GetArgs returns the args rule context list. + GetArgs() []IExprContext + + // SetArgs sets the args rule context list. + SetArgs([]IExprContext) + + // Getter signatures + EXEC() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsExecCommandContext differentiates from other interfaces. + IsExecCommandContext() +} + +type ExecCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + name IExprContext + _expr IExprContext + args []IExprContext +} + +func NewEmptyExecCommandContext() *ExecCommandContext { + var p = new(ExecCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_execCommand + return p +} + +func InitEmptyExecCommandContext(p *ExecCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_execCommand +} + +func (*ExecCommandContext) IsExecCommandContext() {} + +func NewExecCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExecCommandContext { + var p = new(ExecCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_execCommand + + return p +} + +func (s *ExecCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExecCommandContext) GetName() IExprContext { return s.name } + +func (s *ExecCommandContext) Get_expr() IExprContext { return s._expr } + +func (s *ExecCommandContext) SetName(v IExprContext) { s.name = v } + +func (s *ExecCommandContext) Set_expr(v IExprContext) { s._expr = v } + +func (s *ExecCommandContext) GetArgs() []IExprContext { return s.args } + +func (s *ExecCommandContext) SetArgs(v []IExprContext) { s.args = v } + +func (s *ExecCommandContext) EXEC() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEXEC, 0) +} + +func (s *ExecCommandContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *ExecCommandContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *ExecCommandContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *ExecCommandContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *ExecCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExecCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ExecCommandContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExecCommand(s) + } +} + +func (s *ExecCommandContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExecCommand(s) + } +} + +func (s *ExecCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExecCommand(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExecCommand() (localctx IExecCommandContext) { + localctx = NewExecCommandContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, PartiQLParserParserRULE_execCommand) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(291) + p.Match(PartiQLParserParserEXEC) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(292) + + var _x = p.Expr() + + localctx.(*ExecCommandContext).name = _x + } + p.SetState(301) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9024796566781952) != 0) || ((int64((_la-80)) & ^0x3f) == 0 && ((int64(1)<<(_la-80))&-6051008311837327239) != 0) || ((int64((_la-180)) & ^0x3f) == 0 && ((int64(1)<<(_la-180))&68398559028338721) != 0) || ((int64((_la-264)) & ^0x3f) == 0 && ((int64(1)<<(_la-264))&1166665056867) != 0) { + { + p.SetState(293) + + var _x = p.Expr() + + localctx.(*ExecCommandContext)._expr = _x + } + localctx.(*ExecCommandContext).args = append(localctx.(*ExecCommandContext).args, localctx.(*ExecCommandContext)._expr) + p.SetState(298) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(294) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(295) + + var _x = p.Expr() + + localctx.(*ExecCommandContext)._expr = _x + } + localctx.(*ExecCommandContext).args = append(localctx.(*ExecCommandContext).args, localctx.(*ExecCommandContext)._expr) + + p.SetState(300) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDdlContext is an interface to support dynamic dispatch. +type IDdlContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + CreateCommand() ICreateCommandContext + DropCommand() IDropCommandContext + + // IsDdlContext differentiates from other interfaces. + IsDdlContext() +} + +type DdlContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDdlContext() *DdlContext { + var p = new(DdlContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_ddl + return p +} + +func InitEmptyDdlContext(p *DdlContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_ddl +} + +func (*DdlContext) IsDdlContext() {} + +func NewDdlContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DdlContext { + var p = new(DdlContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_ddl + + return p +} + +func (s *DdlContext) GetParser() antlr.Parser { return s.parser } + +func (s *DdlContext) CreateCommand() ICreateCommandContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICreateCommandContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICreateCommandContext) +} + +func (s *DdlContext) DropCommand() IDropCommandContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDropCommandContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDropCommandContext) +} + +func (s *DdlContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DdlContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DdlContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDdl(s) + } +} + +func (s *DdlContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDdl(s) + } +} + +func (s *DdlContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDdl(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Ddl() (localctx IDdlContext) { + localctx = NewDdlContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 20, PartiQLParserParserRULE_ddl) + p.SetState(305) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserCREATE: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(303) + p.CreateCommand() + } + + case PartiQLParserParserDROP: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(304) + p.DropCommand() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ICreateCommandContext is an interface to support dynamic dispatch. +type ICreateCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsCreateCommandContext differentiates from other interfaces. + IsCreateCommandContext() +} + +type CreateCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreateCommandContext() *CreateCommandContext { + var p = new(CreateCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_createCommand + return p +} + +func InitEmptyCreateCommandContext(p *CreateCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_createCommand +} + +func (*CreateCommandContext) IsCreateCommandContext() {} + +func NewCreateCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateCommandContext { + var p = new(CreateCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_createCommand + + return p +} + +func (s *CreateCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateCommandContext) CopyAll(ctx *CreateCommandContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *CreateCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type CreateIndexContext struct { + CreateCommandContext +} + +func NewCreateIndexContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateIndexContext { + var p = new(CreateIndexContext) + + InitEmptyCreateCommandContext(&p.CreateCommandContext) + p.parser = parser + p.CopyAll(ctx.(*CreateCommandContext)) + + return p +} + +func (s *CreateIndexContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateIndexContext) CREATE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCREATE, 0) +} + +func (s *CreateIndexContext) INDEX() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINDEX, 0) +} + +func (s *CreateIndexContext) ON() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserON, 0) +} + +func (s *CreateIndexContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *CreateIndexContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *CreateIndexContext) AllPathSimple() []IPathSimpleContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IPathSimpleContext); ok { + len++ + } + } + + tst := make([]IPathSimpleContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IPathSimpleContext); ok { + tst[i] = t.(IPathSimpleContext) + i++ + } + } + + return tst +} + +func (s *CreateIndexContext) PathSimple(i int) IPathSimpleContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPathSimpleContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IPathSimpleContext) +} + +func (s *CreateIndexContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *CreateIndexContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *CreateIndexContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *CreateIndexContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterCreateIndex(s) + } +} + +func (s *CreateIndexContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitCreateIndex(s) + } +} + +func (s *CreateIndexContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitCreateIndex(s) + + default: + return t.VisitChildren(s) + } +} + +type CreateTableContext struct { + CreateCommandContext +} + +func NewCreateTableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateTableContext { + var p = new(CreateTableContext) + + InitEmptyCreateCommandContext(&p.CreateCommandContext) + p.parser = parser + p.CopyAll(ctx.(*CreateCommandContext)) + + return p +} + +func (s *CreateTableContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateTableContext) CREATE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCREATE, 0) +} + +func (s *CreateTableContext) TABLE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTABLE, 0) +} + +func (s *CreateTableContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *CreateTableContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterCreateTable(s) + } +} + +func (s *CreateTableContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitCreateTable(s) + } +} + +func (s *CreateTableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitCreateTable(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) CreateCommand() (localctx ICreateCommandContext) { + localctx = NewCreateCommandContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 22, PartiQLParserParserRULE_createCommand) + var _la int + + p.SetState(325) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 10, p.GetParserRuleContext()) { + case 1: + localctx = NewCreateTableContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(307) + p.Match(PartiQLParserParserCREATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(308) + p.Match(PartiQLParserParserTABLE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(309) + p.SymbolPrimitive() + } + + case 2: + localctx = NewCreateIndexContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(310) + p.Match(PartiQLParserParserCREATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(311) + p.Match(PartiQLParserParserINDEX) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(312) + p.Match(PartiQLParserParserON) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(313) + p.SymbolPrimitive() + } + { + p.SetState(314) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(315) + p.PathSimple() + } + p.SetState(320) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(316) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(317) + p.PathSimple() + } + + p.SetState(322) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(323) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDropCommandContext is an interface to support dynamic dispatch. +type IDropCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsDropCommandContext differentiates from other interfaces. + IsDropCommandContext() +} + +type DropCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropCommandContext() *DropCommandContext { + var p = new(DropCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_dropCommand + return p +} + +func InitEmptyDropCommandContext(p *DropCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_dropCommand +} + +func (*DropCommandContext) IsDropCommandContext() {} + +func NewDropCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropCommandContext { + var p = new(DropCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_dropCommand + + return p +} + +func (s *DropCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropCommandContext) CopyAll(ctx *DropCommandContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *DropCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type DropTableContext struct { + DropCommandContext + target ISymbolPrimitiveContext +} + +func NewDropTableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DropTableContext { + var p = new(DropTableContext) + + InitEmptyDropCommandContext(&p.DropCommandContext) + p.parser = parser + p.CopyAll(ctx.(*DropCommandContext)) + + return p +} + +func (s *DropTableContext) GetTarget() ISymbolPrimitiveContext { return s.target } + +func (s *DropTableContext) SetTarget(v ISymbolPrimitiveContext) { s.target = v } + +func (s *DropTableContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropTableContext) DROP() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDROP, 0) +} + +func (s *DropTableContext) TABLE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTABLE, 0) +} + +func (s *DropTableContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *DropTableContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDropTable(s) + } +} + +func (s *DropTableContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDropTable(s) + } +} + +func (s *DropTableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDropTable(s) + + default: + return t.VisitChildren(s) + } +} + +type DropIndexContext struct { + DropCommandContext + target ISymbolPrimitiveContext + on ISymbolPrimitiveContext +} + +func NewDropIndexContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DropIndexContext { + var p = new(DropIndexContext) + + InitEmptyDropCommandContext(&p.DropCommandContext) + p.parser = parser + p.CopyAll(ctx.(*DropCommandContext)) + + return p +} + +func (s *DropIndexContext) GetTarget() ISymbolPrimitiveContext { return s.target } + +func (s *DropIndexContext) GetOn() ISymbolPrimitiveContext { return s.on } + +func (s *DropIndexContext) SetTarget(v ISymbolPrimitiveContext) { s.target = v } + +func (s *DropIndexContext) SetOn(v ISymbolPrimitiveContext) { s.on = v } + +func (s *DropIndexContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropIndexContext) DROP() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDROP, 0) +} + +func (s *DropIndexContext) INDEX() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINDEX, 0) +} + +func (s *DropIndexContext) ON() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserON, 0) +} + +func (s *DropIndexContext) AllSymbolPrimitive() []ISymbolPrimitiveContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + len++ + } + } + + tst := make([]ISymbolPrimitiveContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ISymbolPrimitiveContext); ok { + tst[i] = t.(ISymbolPrimitiveContext) + i++ + } + } + + return tst +} + +func (s *DropIndexContext) SymbolPrimitive(i int) ISymbolPrimitiveContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *DropIndexContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDropIndex(s) + } +} + +func (s *DropIndexContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDropIndex(s) + } +} + +func (s *DropIndexContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDropIndex(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) DropCommand() (localctx IDropCommandContext) { + localctx = NewDropCommandContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 24, PartiQLParserParserRULE_dropCommand) + p.SetState(336) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) { + case 1: + localctx = NewDropTableContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(327) + p.Match(PartiQLParserParserDROP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(328) + p.Match(PartiQLParserParserTABLE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(329) + + var _x = p.SymbolPrimitive() + + localctx.(*DropTableContext).target = _x + } + + case 2: + localctx = NewDropIndexContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(330) + p.Match(PartiQLParserParserDROP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(331) + p.Match(PartiQLParserParserINDEX) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(332) + + var _x = p.SymbolPrimitive() + + localctx.(*DropIndexContext).target = _x + } + { + p.SetState(333) + p.Match(PartiQLParserParserON) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(334) + + var _x = p.SymbolPrimitive() + + localctx.(*DropIndexContext).on = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDmlContext is an interface to support dynamic dispatch. +type IDmlContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsDmlContext differentiates from other interfaces. + IsDmlContext() +} + +type DmlContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDmlContext() *DmlContext { + var p = new(DmlContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_dml + return p +} + +func InitEmptyDmlContext(p *DmlContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_dml +} + +func (*DmlContext) IsDmlContext() {} + +func NewDmlContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DmlContext { + var p = new(DmlContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_dml + + return p +} + +func (s *DmlContext) GetParser() antlr.Parser { return s.parser } + +func (s *DmlContext) CopyAll(ctx *DmlContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *DmlContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DmlContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type DmlDeleteContext struct { + DmlContext +} + +func NewDmlDeleteContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DmlDeleteContext { + var p = new(DmlDeleteContext) + + InitEmptyDmlContext(&p.DmlContext) + p.parser = parser + p.CopyAll(ctx.(*DmlContext)) + + return p +} + +func (s *DmlDeleteContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DmlDeleteContext) DeleteCommand() IDeleteCommandContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDeleteCommandContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDeleteCommandContext) +} + +func (s *DmlDeleteContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDmlDelete(s) + } +} + +func (s *DmlDeleteContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDmlDelete(s) + } +} + +func (s *DmlDeleteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDmlDelete(s) + + default: + return t.VisitChildren(s) + } +} + +type DmlInsertReturningContext struct { + DmlContext +} + +func NewDmlInsertReturningContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DmlInsertReturningContext { + var p = new(DmlInsertReturningContext) + + InitEmptyDmlContext(&p.DmlContext) + p.parser = parser + p.CopyAll(ctx.(*DmlContext)) + + return p +} + +func (s *DmlInsertReturningContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DmlInsertReturningContext) InsertCommandReturning() IInsertCommandReturningContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInsertCommandReturningContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInsertCommandReturningContext) +} + +func (s *DmlInsertReturningContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDmlInsertReturning(s) + } +} + +func (s *DmlInsertReturningContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDmlInsertReturning(s) + } +} + +func (s *DmlInsertReturningContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDmlInsertReturning(s) + + default: + return t.VisitChildren(s) + } +} + +type DmlBaseWrapperContext struct { + DmlContext +} + +func NewDmlBaseWrapperContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DmlBaseWrapperContext { + var p = new(DmlBaseWrapperContext) + + InitEmptyDmlContext(&p.DmlContext) + p.parser = parser + p.CopyAll(ctx.(*DmlContext)) + + return p +} + +func (s *DmlBaseWrapperContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DmlBaseWrapperContext) UpdateClause() IUpdateClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IUpdateClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IUpdateClauseContext) +} + +func (s *DmlBaseWrapperContext) AllDmlBaseCommand() []IDmlBaseCommandContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IDmlBaseCommandContext); ok { + len++ + } + } + + tst := make([]IDmlBaseCommandContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IDmlBaseCommandContext); ok { + tst[i] = t.(IDmlBaseCommandContext) + i++ + } + } + + return tst +} + +func (s *DmlBaseWrapperContext) DmlBaseCommand(i int) IDmlBaseCommandContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDmlBaseCommandContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IDmlBaseCommandContext) +} + +func (s *DmlBaseWrapperContext) WhereClause() IWhereClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWhereClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IWhereClauseContext) +} + +func (s *DmlBaseWrapperContext) ReturningClause() IReturningClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReturningClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IReturningClauseContext) +} + +func (s *DmlBaseWrapperContext) FromClause() IFromClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFromClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFromClauseContext) +} + +func (s *DmlBaseWrapperContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDmlBaseWrapper(s) + } +} + +func (s *DmlBaseWrapperContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDmlBaseWrapper(s) + } +} + +func (s *DmlBaseWrapperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDmlBaseWrapper(s) + + default: + return t.VisitChildren(s) + } +} + +type DmlBaseContext struct { + DmlContext +} + +func NewDmlBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DmlBaseContext { + var p = new(DmlBaseContext) + + InitEmptyDmlContext(&p.DmlContext) + p.parser = parser + p.CopyAll(ctx.(*DmlContext)) + + return p +} + +func (s *DmlBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DmlBaseContext) DmlBaseCommand() IDmlBaseCommandContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDmlBaseCommandContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDmlBaseCommandContext) +} + +func (s *DmlBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDmlBase(s) + } +} + +func (s *DmlBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDmlBase(s) + } +} + +func (s *DmlBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDmlBase(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Dml() (localctx IDmlContext) { + localctx = NewDmlContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 26, PartiQLParserParserRULE_dml) + var _la int + + p.SetState(365) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { + case 1: + localctx = NewDmlBaseWrapperContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(338) + p.UpdateClause() + } + p.SetState(340) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == PartiQLParserParserINSERT || _la == PartiQLParserParserREPLACE || ((int64((_la-183)) & ^0x3f) == 0 && ((int64(1)<<(_la-183))&72057594574798849) != 0) { + { + p.SetState(339) + p.DmlBaseCommand() + } + + p.SetState(342) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(345) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserWHERE { + { + p.SetState(344) + p.WhereClause() + } + + } + p.SetState(348) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserRETURNING { + { + p.SetState(347) + p.ReturningClause() + } + + } + + case 2: + localctx = NewDmlBaseWrapperContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(350) + p.FromClause() + } + p.SetState(352) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserWHERE { + { + p.SetState(351) + p.WhereClause() + } + + } + p.SetState(355) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == PartiQLParserParserINSERT || _la == PartiQLParserParserREPLACE || ((int64((_la-183)) & ^0x3f) == 0 && ((int64(1)<<(_la-183))&72057594574798849) != 0) { + { + p.SetState(354) + p.DmlBaseCommand() + } + + p.SetState(357) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(360) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserRETURNING { + { + p.SetState(359) + p.ReturningClause() + } + + } + + case 3: + localctx = NewDmlDeleteContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(362) + p.DeleteCommand() + } + + case 4: + localctx = NewDmlInsertReturningContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(363) + p.InsertCommandReturning() + } + + case 5: + localctx = NewDmlBaseContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(364) + p.DmlBaseCommand() + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDmlBaseCommandContext is an interface to support dynamic dispatch. +type IDmlBaseCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + InsertCommand() IInsertCommandContext + SetCommand() ISetCommandContext + ReplaceCommand() IReplaceCommandContext + RemoveCommand() IRemoveCommandContext + UpsertCommand() IUpsertCommandContext + + // IsDmlBaseCommandContext differentiates from other interfaces. + IsDmlBaseCommandContext() +} + +type DmlBaseCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDmlBaseCommandContext() *DmlBaseCommandContext { + var p = new(DmlBaseCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_dmlBaseCommand + return p +} + +func InitEmptyDmlBaseCommandContext(p *DmlBaseCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_dmlBaseCommand +} + +func (*DmlBaseCommandContext) IsDmlBaseCommandContext() {} + +func NewDmlBaseCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DmlBaseCommandContext { + var p = new(DmlBaseCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_dmlBaseCommand + + return p +} + +func (s *DmlBaseCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *DmlBaseCommandContext) InsertCommand() IInsertCommandContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInsertCommandContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInsertCommandContext) +} + +func (s *DmlBaseCommandContext) SetCommand() ISetCommandContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISetCommandContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISetCommandContext) +} + +func (s *DmlBaseCommandContext) ReplaceCommand() IReplaceCommandContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReplaceCommandContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IReplaceCommandContext) +} + +func (s *DmlBaseCommandContext) RemoveCommand() IRemoveCommandContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IRemoveCommandContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IRemoveCommandContext) +} + +func (s *DmlBaseCommandContext) UpsertCommand() IUpsertCommandContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IUpsertCommandContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IUpsertCommandContext) +} + +func (s *DmlBaseCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DmlBaseCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DmlBaseCommandContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDmlBaseCommand(s) + } +} + +func (s *DmlBaseCommandContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDmlBaseCommand(s) + } +} + +func (s *DmlBaseCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDmlBaseCommand(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) DmlBaseCommand() (localctx IDmlBaseCommandContext) { + localctx = NewDmlBaseCommandContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 28, PartiQLParserParserRULE_dmlBaseCommand) + p.SetState(372) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserINSERT: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(367) + p.InsertCommand() + } + + case PartiQLParserParserSET: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(368) + p.SetCommand() + } + + case PartiQLParserParserREPLACE: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(369) + p.ReplaceCommand() + } + + case PartiQLParserParserREMOVE: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(370) + p.RemoveCommand() + } + + case PartiQLParserParserUPSERT: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(371) + p.UpsertCommand() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IPathSimpleContext is an interface to support dynamic dispatch. +type IPathSimpleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SymbolPrimitive() ISymbolPrimitiveContext + AllPathSimpleSteps() []IPathSimpleStepsContext + PathSimpleSteps(i int) IPathSimpleStepsContext + + // IsPathSimpleContext differentiates from other interfaces. + IsPathSimpleContext() +} + +type PathSimpleContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyPathSimpleContext() *PathSimpleContext { + var p = new(PathSimpleContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_pathSimple + return p +} + +func InitEmptyPathSimpleContext(p *PathSimpleContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_pathSimple +} + +func (*PathSimpleContext) IsPathSimpleContext() {} + +func NewPathSimpleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PathSimpleContext { + var p = new(PathSimpleContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_pathSimple + + return p +} + +func (s *PathSimpleContext) GetParser() antlr.Parser { return s.parser } + +func (s *PathSimpleContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *PathSimpleContext) AllPathSimpleSteps() []IPathSimpleStepsContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IPathSimpleStepsContext); ok { + len++ + } + } + + tst := make([]IPathSimpleStepsContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IPathSimpleStepsContext); ok { + tst[i] = t.(IPathSimpleStepsContext) + i++ + } + } + + return tst +} + +func (s *PathSimpleContext) PathSimpleSteps(i int) IPathSimpleStepsContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPathSimpleStepsContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IPathSimpleStepsContext) +} + +func (s *PathSimpleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PathSimpleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *PathSimpleContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPathSimple(s) + } +} + +func (s *PathSimpleContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPathSimple(s) + } +} + +func (s *PathSimpleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPathSimple(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) PathSimple() (localctx IPathSimpleContext) { + localctx = NewPathSimpleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 30, PartiQLParserParserRULE_pathSimple) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(374) + p.SymbolPrimitive() + } + p.SetState(378) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserBRACKET_LEFT || _la == PartiQLParserParserPERIOD { + { + p.SetState(375) + p.PathSimpleSteps() + } + + p.SetState(380) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IPathSimpleStepsContext is an interface to support dynamic dispatch. +type IPathSimpleStepsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsPathSimpleStepsContext differentiates from other interfaces. + IsPathSimpleStepsContext() +} + +type PathSimpleStepsContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyPathSimpleStepsContext() *PathSimpleStepsContext { + var p = new(PathSimpleStepsContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_pathSimpleSteps + return p +} + +func InitEmptyPathSimpleStepsContext(p *PathSimpleStepsContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_pathSimpleSteps +} + +func (*PathSimpleStepsContext) IsPathSimpleStepsContext() {} + +func NewPathSimpleStepsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PathSimpleStepsContext { + var p = new(PathSimpleStepsContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_pathSimpleSteps + + return p +} + +func (s *PathSimpleStepsContext) GetParser() antlr.Parser { return s.parser } + +func (s *PathSimpleStepsContext) CopyAll(ctx *PathSimpleStepsContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *PathSimpleStepsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PathSimpleStepsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type PathSimpleLiteralContext struct { + PathSimpleStepsContext + key ILiteralContext +} + +func NewPathSimpleLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PathSimpleLiteralContext { + var p = new(PathSimpleLiteralContext) + + InitEmptyPathSimpleStepsContext(&p.PathSimpleStepsContext) + p.parser = parser + p.CopyAll(ctx.(*PathSimpleStepsContext)) + + return p +} + +func (s *PathSimpleLiteralContext) GetKey() ILiteralContext { return s.key } + +func (s *PathSimpleLiteralContext) SetKey(v ILiteralContext) { s.key = v } + +func (s *PathSimpleLiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PathSimpleLiteralContext) BRACKET_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_LEFT, 0) +} + +func (s *PathSimpleLiteralContext) BRACKET_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_RIGHT, 0) +} + +func (s *PathSimpleLiteralContext) Literal() ILiteralContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ILiteralContext) +} + +func (s *PathSimpleLiteralContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPathSimpleLiteral(s) + } +} + +func (s *PathSimpleLiteralContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPathSimpleLiteral(s) + } +} + +func (s *PathSimpleLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPathSimpleLiteral(s) + + default: + return t.VisitChildren(s) + } +} + +type PathSimpleDotSymbolContext struct { + PathSimpleStepsContext + key ISymbolPrimitiveContext +} + +func NewPathSimpleDotSymbolContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PathSimpleDotSymbolContext { + var p = new(PathSimpleDotSymbolContext) + + InitEmptyPathSimpleStepsContext(&p.PathSimpleStepsContext) + p.parser = parser + p.CopyAll(ctx.(*PathSimpleStepsContext)) + + return p +} + +func (s *PathSimpleDotSymbolContext) GetKey() ISymbolPrimitiveContext { return s.key } + +func (s *PathSimpleDotSymbolContext) SetKey(v ISymbolPrimitiveContext) { s.key = v } + +func (s *PathSimpleDotSymbolContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PathSimpleDotSymbolContext) PERIOD() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPERIOD, 0) +} + +func (s *PathSimpleDotSymbolContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *PathSimpleDotSymbolContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPathSimpleDotSymbol(s) + } +} + +func (s *PathSimpleDotSymbolContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPathSimpleDotSymbol(s) + } +} + +func (s *PathSimpleDotSymbolContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPathSimpleDotSymbol(s) + + default: + return t.VisitChildren(s) + } +} + +type PathSimpleSymbolContext struct { + PathSimpleStepsContext + key ISymbolPrimitiveContext +} + +func NewPathSimpleSymbolContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PathSimpleSymbolContext { + var p = new(PathSimpleSymbolContext) + + InitEmptyPathSimpleStepsContext(&p.PathSimpleStepsContext) + p.parser = parser + p.CopyAll(ctx.(*PathSimpleStepsContext)) + + return p +} + +func (s *PathSimpleSymbolContext) GetKey() ISymbolPrimitiveContext { return s.key } + +func (s *PathSimpleSymbolContext) SetKey(v ISymbolPrimitiveContext) { s.key = v } + +func (s *PathSimpleSymbolContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PathSimpleSymbolContext) BRACKET_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_LEFT, 0) +} + +func (s *PathSimpleSymbolContext) BRACKET_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_RIGHT, 0) +} + +func (s *PathSimpleSymbolContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *PathSimpleSymbolContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPathSimpleSymbol(s) + } +} + +func (s *PathSimpleSymbolContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPathSimpleSymbol(s) + } +} + +func (s *PathSimpleSymbolContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPathSimpleSymbol(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) PathSimpleSteps() (localctx IPathSimpleStepsContext) { + localctx = NewPathSimpleStepsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 32, PartiQLParserParserRULE_pathSimpleSteps) + p.SetState(391) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 21, p.GetParserRuleContext()) { + case 1: + localctx = NewPathSimpleLiteralContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(381) + p.Match(PartiQLParserParserBRACKET_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(382) + + var _x = p.Literal() + + localctx.(*PathSimpleLiteralContext).key = _x + } + { + p.SetState(383) + p.Match(PartiQLParserParserBRACKET_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + localctx = NewPathSimpleSymbolContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(385) + p.Match(PartiQLParserParserBRACKET_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(386) + + var _x = p.SymbolPrimitive() + + localctx.(*PathSimpleSymbolContext).key = _x + } + { + p.SetState(387) + p.Match(PartiQLParserParserBRACKET_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 3: + localctx = NewPathSimpleDotSymbolContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(389) + p.Match(PartiQLParserParserPERIOD) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(390) + + var _x = p.SymbolPrimitive() + + localctx.(*PathSimpleDotSymbolContext).key = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IReplaceCommandContext is an interface to support dynamic dispatch. +type IReplaceCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetValue returns the value rule contexts. + GetValue() IExprContext + + // SetValue sets the value rule contexts. + SetValue(IExprContext) + + // Getter signatures + REPLACE() antlr.TerminalNode + INTO() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + Expr() IExprContext + AsIdent() IAsIdentContext + + // IsReplaceCommandContext differentiates from other interfaces. + IsReplaceCommandContext() +} + +type ReplaceCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + value IExprContext +} + +func NewEmptyReplaceCommandContext() *ReplaceCommandContext { + var p = new(ReplaceCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_replaceCommand + return p +} + +func InitEmptyReplaceCommandContext(p *ReplaceCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_replaceCommand +} + +func (*ReplaceCommandContext) IsReplaceCommandContext() {} + +func NewReplaceCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReplaceCommandContext { + var p = new(ReplaceCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_replaceCommand + + return p +} + +func (s *ReplaceCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *ReplaceCommandContext) GetValue() IExprContext { return s.value } + +func (s *ReplaceCommandContext) SetValue(v IExprContext) { s.value = v } + +func (s *ReplaceCommandContext) REPLACE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserREPLACE, 0) +} + +func (s *ReplaceCommandContext) INTO() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINTO, 0) +} + +func (s *ReplaceCommandContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *ReplaceCommandContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *ReplaceCommandContext) AsIdent() IAsIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAsIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAsIdentContext) +} + +func (s *ReplaceCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ReplaceCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ReplaceCommandContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterReplaceCommand(s) + } +} + +func (s *ReplaceCommandContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitReplaceCommand(s) + } +} + +func (s *ReplaceCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitReplaceCommand(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ReplaceCommand() (localctx IReplaceCommandContext) { + localctx = NewReplaceCommandContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 34, PartiQLParserParserRULE_replaceCommand) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(393) + p.Match(PartiQLParserParserREPLACE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(394) + p.Match(PartiQLParserParserINTO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(395) + p.SymbolPrimitive() + } + p.SetState(397) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserAS { + { + p.SetState(396) + p.AsIdent() + } + + } + { + p.SetState(399) + + var _x = p.Expr() + + localctx.(*ReplaceCommandContext).value = _x + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IUpsertCommandContext is an interface to support dynamic dispatch. +type IUpsertCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetValue returns the value rule contexts. + GetValue() IExprContext + + // SetValue sets the value rule contexts. + SetValue(IExprContext) + + // Getter signatures + UPSERT() antlr.TerminalNode + INTO() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + Expr() IExprContext + AsIdent() IAsIdentContext + + // IsUpsertCommandContext differentiates from other interfaces. + IsUpsertCommandContext() +} + +type UpsertCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + value IExprContext +} + +func NewEmptyUpsertCommandContext() *UpsertCommandContext { + var p = new(UpsertCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_upsertCommand + return p +} + +func InitEmptyUpsertCommandContext(p *UpsertCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_upsertCommand +} + +func (*UpsertCommandContext) IsUpsertCommandContext() {} + +func NewUpsertCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UpsertCommandContext { + var p = new(UpsertCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_upsertCommand + + return p +} + +func (s *UpsertCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *UpsertCommandContext) GetValue() IExprContext { return s.value } + +func (s *UpsertCommandContext) SetValue(v IExprContext) { s.value = v } + +func (s *UpsertCommandContext) UPSERT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserUPSERT, 0) +} + +func (s *UpsertCommandContext) INTO() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINTO, 0) +} + +func (s *UpsertCommandContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *UpsertCommandContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *UpsertCommandContext) AsIdent() IAsIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAsIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAsIdentContext) +} + +func (s *UpsertCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *UpsertCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *UpsertCommandContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterUpsertCommand(s) + } +} + +func (s *UpsertCommandContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitUpsertCommand(s) + } +} + +func (s *UpsertCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitUpsertCommand(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) UpsertCommand() (localctx IUpsertCommandContext) { + localctx = NewUpsertCommandContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 36, PartiQLParserParserRULE_upsertCommand) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(401) + p.Match(PartiQLParserParserUPSERT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(402) + p.Match(PartiQLParserParserINTO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(403) + p.SymbolPrimitive() + } + p.SetState(405) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserAS { + { + p.SetState(404) + p.AsIdent() + } + + } + { + p.SetState(407) + + var _x = p.Expr() + + localctx.(*UpsertCommandContext).value = _x + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IRemoveCommandContext is an interface to support dynamic dispatch. +type IRemoveCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + REMOVE() antlr.TerminalNode + PathSimple() IPathSimpleContext + + // IsRemoveCommandContext differentiates from other interfaces. + IsRemoveCommandContext() +} + +type RemoveCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyRemoveCommandContext() *RemoveCommandContext { + var p = new(RemoveCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_removeCommand + return p +} + +func InitEmptyRemoveCommandContext(p *RemoveCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_removeCommand +} + +func (*RemoveCommandContext) IsRemoveCommandContext() {} + +func NewRemoveCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RemoveCommandContext { + var p = new(RemoveCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_removeCommand + + return p +} + +func (s *RemoveCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *RemoveCommandContext) REMOVE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserREMOVE, 0) +} + +func (s *RemoveCommandContext) PathSimple() IPathSimpleContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPathSimpleContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPathSimpleContext) +} + +func (s *RemoveCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *RemoveCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *RemoveCommandContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterRemoveCommand(s) + } +} + +func (s *RemoveCommandContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitRemoveCommand(s) + } +} + +func (s *RemoveCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitRemoveCommand(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) RemoveCommand() (localctx IRemoveCommandContext) { + localctx = NewRemoveCommandContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 38, PartiQLParserParserRULE_removeCommand) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(409) + p.Match(PartiQLParserParserREMOVE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(410) + p.PathSimple() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IInsertCommandReturningContext is an interface to support dynamic dispatch. +type IInsertCommandReturningContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetValue returns the value rule contexts. + GetValue() IExprContext + + // GetPos returns the pos rule contexts. + GetPos() IExprContext + + // SetValue sets the value rule contexts. + SetValue(IExprContext) + + // SetPos sets the pos rule contexts. + SetPos(IExprContext) + + // Getter signatures + INSERT() antlr.TerminalNode + INTO() antlr.TerminalNode + PathSimple() IPathSimpleContext + VALUE() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + AT() antlr.TerminalNode + OnConflictClause() IOnConflictClauseContext + ReturningClause() IReturningClauseContext + + // IsInsertCommandReturningContext differentiates from other interfaces. + IsInsertCommandReturningContext() +} + +type InsertCommandReturningContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + value IExprContext + pos IExprContext +} + +func NewEmptyInsertCommandReturningContext() *InsertCommandReturningContext { + var p = new(InsertCommandReturningContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_insertCommandReturning + return p +} + +func InitEmptyInsertCommandReturningContext(p *InsertCommandReturningContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_insertCommandReturning +} + +func (*InsertCommandReturningContext) IsInsertCommandReturningContext() {} + +func NewInsertCommandReturningContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InsertCommandReturningContext { + var p = new(InsertCommandReturningContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_insertCommandReturning + + return p +} + +func (s *InsertCommandReturningContext) GetParser() antlr.Parser { return s.parser } + +func (s *InsertCommandReturningContext) GetValue() IExprContext { return s.value } + +func (s *InsertCommandReturningContext) GetPos() IExprContext { return s.pos } + +func (s *InsertCommandReturningContext) SetValue(v IExprContext) { s.value = v } + +func (s *InsertCommandReturningContext) SetPos(v IExprContext) { s.pos = v } + +func (s *InsertCommandReturningContext) INSERT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINSERT, 0) +} + +func (s *InsertCommandReturningContext) INTO() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINTO, 0) +} + +func (s *InsertCommandReturningContext) PathSimple() IPathSimpleContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPathSimpleContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPathSimpleContext) +} + +func (s *InsertCommandReturningContext) VALUE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserVALUE, 0) +} + +func (s *InsertCommandReturningContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *InsertCommandReturningContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *InsertCommandReturningContext) AT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAT, 0) +} + +func (s *InsertCommandReturningContext) OnConflictClause() IOnConflictClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOnConflictClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IOnConflictClauseContext) +} + +func (s *InsertCommandReturningContext) ReturningClause() IReturningClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReturningClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IReturningClauseContext) +} + +func (s *InsertCommandReturningContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *InsertCommandReturningContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *InsertCommandReturningContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterInsertCommandReturning(s) + } +} + +func (s *InsertCommandReturningContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitInsertCommandReturning(s) + } +} + +func (s *InsertCommandReturningContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitInsertCommandReturning(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) InsertCommandReturning() (localctx IInsertCommandReturningContext) { + localctx = NewInsertCommandReturningContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 40, PartiQLParserParserRULE_insertCommandReturning) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(412) + p.Match(PartiQLParserParserINSERT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(413) + p.Match(PartiQLParserParserINTO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(414) + p.PathSimple() + } + { + p.SetState(415) + p.Match(PartiQLParserParserVALUE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(416) + + var _x = p.Expr() + + localctx.(*InsertCommandReturningContext).value = _x + } + p.SetState(419) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserAT { + { + p.SetState(417) + p.Match(PartiQLParserParserAT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(418) + + var _x = p.Expr() + + localctx.(*InsertCommandReturningContext).pos = _x + } + + } + p.SetState(422) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserON { + { + p.SetState(421) + p.OnConflictClause() + } + + } + p.SetState(425) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserRETURNING { + { + p.SetState(424) + p.ReturningClause() + } + + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IInsertCommandContext is an interface to support dynamic dispatch. +type IInsertCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsInsertCommandContext differentiates from other interfaces. + IsInsertCommandContext() +} + +type InsertCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyInsertCommandContext() *InsertCommandContext { + var p = new(InsertCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_insertCommand + return p +} + +func InitEmptyInsertCommandContext(p *InsertCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_insertCommand +} + +func (*InsertCommandContext) IsInsertCommandContext() {} + +func NewInsertCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InsertCommandContext { + var p = new(InsertCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_insertCommand + + return p +} + +func (s *InsertCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *InsertCommandContext) CopyAll(ctx *InsertCommandContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *InsertCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *InsertCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type InsertLegacyContext struct { + InsertCommandContext + value IExprContext + pos IExprContext +} + +func NewInsertLegacyContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InsertLegacyContext { + var p = new(InsertLegacyContext) + + InitEmptyInsertCommandContext(&p.InsertCommandContext) + p.parser = parser + p.CopyAll(ctx.(*InsertCommandContext)) + + return p +} + +func (s *InsertLegacyContext) GetValue() IExprContext { return s.value } + +func (s *InsertLegacyContext) GetPos() IExprContext { return s.pos } + +func (s *InsertLegacyContext) SetValue(v IExprContext) { s.value = v } + +func (s *InsertLegacyContext) SetPos(v IExprContext) { s.pos = v } + +func (s *InsertLegacyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *InsertLegacyContext) INSERT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINSERT, 0) +} + +func (s *InsertLegacyContext) INTO() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINTO, 0) +} + +func (s *InsertLegacyContext) PathSimple() IPathSimpleContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPathSimpleContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPathSimpleContext) +} + +func (s *InsertLegacyContext) VALUE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserVALUE, 0) +} + +func (s *InsertLegacyContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *InsertLegacyContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *InsertLegacyContext) AT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAT, 0) +} + +func (s *InsertLegacyContext) OnConflictClause() IOnConflictClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOnConflictClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IOnConflictClauseContext) +} + +func (s *InsertLegacyContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterInsertLegacy(s) + } +} + +func (s *InsertLegacyContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitInsertLegacy(s) + } +} + +func (s *InsertLegacyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitInsertLegacy(s) + + default: + return t.VisitChildren(s) + } +} + +type InsertContext struct { + InsertCommandContext + value IExprContext +} + +func NewInsertContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InsertContext { + var p = new(InsertContext) + + InitEmptyInsertCommandContext(&p.InsertCommandContext) + p.parser = parser + p.CopyAll(ctx.(*InsertCommandContext)) + + return p +} + +func (s *InsertContext) GetValue() IExprContext { return s.value } + +func (s *InsertContext) SetValue(v IExprContext) { s.value = v } + +func (s *InsertContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *InsertContext) INSERT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINSERT, 0) +} + +func (s *InsertContext) INTO() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINTO, 0) +} + +func (s *InsertContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *InsertContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *InsertContext) AsIdent() IAsIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAsIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAsIdentContext) +} + +func (s *InsertContext) OnConflictClause() IOnConflictClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOnConflictClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IOnConflictClauseContext) +} + +func (s *InsertContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterInsert(s) + } +} + +func (s *InsertContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitInsert(s) + } +} + +func (s *InsertContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitInsert(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) InsertCommand() (localctx IInsertCommandContext) { + localctx = NewInsertCommandContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 42, PartiQLParserParserRULE_insertCommand) + var _la int + + p.SetState(449) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 31, p.GetParserRuleContext()) { + case 1: + localctx = NewInsertLegacyContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(427) + p.Match(PartiQLParserParserINSERT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(428) + p.Match(PartiQLParserParserINTO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(429) + p.PathSimple() + } + { + p.SetState(430) + p.Match(PartiQLParserParserVALUE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(431) + + var _x = p.Expr() + + localctx.(*InsertLegacyContext).value = _x + } + p.SetState(434) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserAT { + { + p.SetState(432) + p.Match(PartiQLParserParserAT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(433) + + var _x = p.Expr() + + localctx.(*InsertLegacyContext).pos = _x + } + + } + p.SetState(437) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserON { + { + p.SetState(436) + p.OnConflictClause() + } + + } + + case 2: + localctx = NewInsertContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(439) + p.Match(PartiQLParserParserINSERT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(440) + p.Match(PartiQLParserParserINTO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(441) + p.SymbolPrimitive() + } + p.SetState(443) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserAS { + { + p.SetState(442) + p.AsIdent() + } + + } + { + p.SetState(445) + + var _x = p.Expr() + + localctx.(*InsertContext).value = _x + } + p.SetState(447) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserON { + { + p.SetState(446) + p.OnConflictClause() + } + + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IOnConflictClauseContext is an interface to support dynamic dispatch. +type IOnConflictClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsOnConflictClauseContext differentiates from other interfaces. + IsOnConflictClauseContext() +} + +type OnConflictClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyOnConflictClauseContext() *OnConflictClauseContext { + var p = new(OnConflictClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_onConflictClause + return p +} + +func InitEmptyOnConflictClauseContext(p *OnConflictClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_onConflictClause +} + +func (*OnConflictClauseContext) IsOnConflictClauseContext() {} + +func NewOnConflictClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OnConflictClauseContext { + var p = new(OnConflictClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_onConflictClause + + return p +} + +func (s *OnConflictClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *OnConflictClauseContext) CopyAll(ctx *OnConflictClauseContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *OnConflictClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *OnConflictClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type OnConflictLegacyContext struct { + OnConflictClauseContext +} + +func NewOnConflictLegacyContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *OnConflictLegacyContext { + var p = new(OnConflictLegacyContext) + + InitEmptyOnConflictClauseContext(&p.OnConflictClauseContext) + p.parser = parser + p.CopyAll(ctx.(*OnConflictClauseContext)) + + return p +} + +func (s *OnConflictLegacyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *OnConflictLegacyContext) ON() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserON, 0) +} + +func (s *OnConflictLegacyContext) CONFLICT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCONFLICT, 0) +} + +func (s *OnConflictLegacyContext) WHERE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserWHERE, 0) +} + +func (s *OnConflictLegacyContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *OnConflictLegacyContext) DO() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDO, 0) +} + +func (s *OnConflictLegacyContext) NOTHING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNOTHING, 0) +} + +func (s *OnConflictLegacyContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterOnConflictLegacy(s) + } +} + +func (s *OnConflictLegacyContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitOnConflictLegacy(s) + } +} + +func (s *OnConflictLegacyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitOnConflictLegacy(s) + + default: + return t.VisitChildren(s) + } +} + +type OnConflictContext struct { + OnConflictClauseContext +} + +func NewOnConflictContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *OnConflictContext { + var p = new(OnConflictContext) + + InitEmptyOnConflictClauseContext(&p.OnConflictClauseContext) + p.parser = parser + p.CopyAll(ctx.(*OnConflictClauseContext)) + + return p +} + +func (s *OnConflictContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *OnConflictContext) ON() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserON, 0) +} + +func (s *OnConflictContext) CONFLICT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCONFLICT, 0) +} + +func (s *OnConflictContext) ConflictAction() IConflictActionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConflictActionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IConflictActionContext) +} + +func (s *OnConflictContext) ConflictTarget() IConflictTargetContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConflictTargetContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IConflictTargetContext) +} + +func (s *OnConflictContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterOnConflict(s) + } +} + +func (s *OnConflictContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitOnConflict(s) + } +} + +func (s *OnConflictContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitOnConflict(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) OnConflictClause() (localctx IOnConflictClauseContext) { + localctx = NewOnConflictClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 44, PartiQLParserParserRULE_onConflictClause) + var _la int + + p.SetState(464) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 33, p.GetParserRuleContext()) { + case 1: + localctx = NewOnConflictLegacyContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(451) + p.Match(PartiQLParserParserON) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(452) + p.Match(PartiQLParserParserCONFLICT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(453) + p.Match(PartiQLParserParserWHERE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(454) + p.Expr() + } + { + p.SetState(455) + p.Match(PartiQLParserParserDO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(456) + p.Match(PartiQLParserParserNOTHING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + localctx = NewOnConflictContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(458) + p.Match(PartiQLParserParserON) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(459) + p.Match(PartiQLParserParserCONFLICT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(461) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserON || _la == PartiQLParserParserPAREN_LEFT { + { + p.SetState(460) + p.ConflictTarget() + } + + } + { + p.SetState(463) + p.ConflictAction() + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IConflictTargetContext is an interface to support dynamic dispatch. +type IConflictTargetContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + PAREN_LEFT() antlr.TerminalNode + AllSymbolPrimitive() []ISymbolPrimitiveContext + SymbolPrimitive(i int) ISymbolPrimitiveContext + PAREN_RIGHT() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + ON() antlr.TerminalNode + CONSTRAINT() antlr.TerminalNode + ConstraintName() IConstraintNameContext + + // IsConflictTargetContext differentiates from other interfaces. + IsConflictTargetContext() +} + +type ConflictTargetContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyConflictTargetContext() *ConflictTargetContext { + var p = new(ConflictTargetContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_conflictTarget + return p +} + +func InitEmptyConflictTargetContext(p *ConflictTargetContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_conflictTarget +} + +func (*ConflictTargetContext) IsConflictTargetContext() {} + +func NewConflictTargetContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConflictTargetContext { + var p = new(ConflictTargetContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_conflictTarget + + return p +} + +func (s *ConflictTargetContext) GetParser() antlr.Parser { return s.parser } + +func (s *ConflictTargetContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *ConflictTargetContext) AllSymbolPrimitive() []ISymbolPrimitiveContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + len++ + } + } + + tst := make([]ISymbolPrimitiveContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ISymbolPrimitiveContext); ok { + tst[i] = t.(ISymbolPrimitiveContext) + i++ + } + } + + return tst +} + +func (s *ConflictTargetContext) SymbolPrimitive(i int) ISymbolPrimitiveContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *ConflictTargetContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *ConflictTargetContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *ConflictTargetContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *ConflictTargetContext) ON() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserON, 0) +} + +func (s *ConflictTargetContext) CONSTRAINT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCONSTRAINT, 0) +} + +func (s *ConflictTargetContext) ConstraintName() IConstraintNameContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConstraintNameContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IConstraintNameContext) +} + +func (s *ConflictTargetContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConflictTargetContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ConflictTargetContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterConflictTarget(s) + } +} + +func (s *ConflictTargetContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitConflictTarget(s) + } +} + +func (s *ConflictTargetContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitConflictTarget(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ConflictTarget() (localctx IConflictTargetContext) { + localctx = NewConflictTargetContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 46, PartiQLParserParserRULE_conflictTarget) + var _la int + + p.SetState(480) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserPAREN_LEFT: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(466) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(467) + p.SymbolPrimitive() + } + p.SetState(472) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(468) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(469) + p.SymbolPrimitive() + } + + p.SetState(474) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(475) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserON: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(477) + p.Match(PartiQLParserParserON) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(478) + p.Match(PartiQLParserParserCONSTRAINT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(479) + p.ConstraintName() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IConstraintNameContext is an interface to support dynamic dispatch. +type IConstraintNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SymbolPrimitive() ISymbolPrimitiveContext + + // IsConstraintNameContext differentiates from other interfaces. + IsConstraintNameContext() +} + +type ConstraintNameContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyConstraintNameContext() *ConstraintNameContext { + var p = new(ConstraintNameContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_constraintName + return p +} + +func InitEmptyConstraintNameContext(p *ConstraintNameContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_constraintName +} + +func (*ConstraintNameContext) IsConstraintNameContext() {} + +func NewConstraintNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConstraintNameContext { + var p = new(ConstraintNameContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_constraintName + + return p +} + +func (s *ConstraintNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *ConstraintNameContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *ConstraintNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConstraintNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ConstraintNameContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterConstraintName(s) + } +} + +func (s *ConstraintNameContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitConstraintName(s) + } +} + +func (s *ConstraintNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitConstraintName(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ConstraintName() (localctx IConstraintNameContext) { + localctx = NewConstraintNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 48, PartiQLParserParserRULE_constraintName) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(482) + p.SymbolPrimitive() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IConflictActionContext is an interface to support dynamic dispatch. +type IConflictActionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DO() antlr.TerminalNode + NOTHING() antlr.TerminalNode + REPLACE() antlr.TerminalNode + DoReplace() IDoReplaceContext + UPDATE() antlr.TerminalNode + DoUpdate() IDoUpdateContext + + // IsConflictActionContext differentiates from other interfaces. + IsConflictActionContext() +} + +type ConflictActionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyConflictActionContext() *ConflictActionContext { + var p = new(ConflictActionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_conflictAction + return p +} + +func InitEmptyConflictActionContext(p *ConflictActionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_conflictAction +} + +func (*ConflictActionContext) IsConflictActionContext() {} + +func NewConflictActionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConflictActionContext { + var p = new(ConflictActionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_conflictAction + + return p +} + +func (s *ConflictActionContext) GetParser() antlr.Parser { return s.parser } + +func (s *ConflictActionContext) DO() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDO, 0) +} + +func (s *ConflictActionContext) NOTHING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNOTHING, 0) +} + +func (s *ConflictActionContext) REPLACE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserREPLACE, 0) +} + +func (s *ConflictActionContext) DoReplace() IDoReplaceContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDoReplaceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDoReplaceContext) +} + +func (s *ConflictActionContext) UPDATE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserUPDATE, 0) +} + +func (s *ConflictActionContext) DoUpdate() IDoUpdateContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDoUpdateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDoUpdateContext) +} + +func (s *ConflictActionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConflictActionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ConflictActionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterConflictAction(s) + } +} + +func (s *ConflictActionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitConflictAction(s) + } +} + +func (s *ConflictActionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitConflictAction(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ConflictAction() (localctx IConflictActionContext) { + localctx = NewConflictActionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 50, PartiQLParserParserRULE_conflictAction) + p.SetState(492) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 36, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(484) + p.Match(PartiQLParserParserDO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(485) + p.Match(PartiQLParserParserNOTHING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(486) + p.Match(PartiQLParserParserDO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(487) + p.Match(PartiQLParserParserREPLACE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(488) + p.DoReplace() + } + + case 3: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(489) + p.Match(PartiQLParserParserDO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(490) + p.Match(PartiQLParserParserUPDATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(491) + p.DoUpdate() + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDoReplaceContext is an interface to support dynamic dispatch. +type IDoReplaceContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + EXCLUDED() antlr.TerminalNode + + // IsDoReplaceContext differentiates from other interfaces. + IsDoReplaceContext() +} + +type DoReplaceContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDoReplaceContext() *DoReplaceContext { + var p = new(DoReplaceContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_doReplace + return p +} + +func InitEmptyDoReplaceContext(p *DoReplaceContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_doReplace +} + +func (*DoReplaceContext) IsDoReplaceContext() {} + +func NewDoReplaceContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DoReplaceContext { + var p = new(DoReplaceContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_doReplace + + return p +} + +func (s *DoReplaceContext) GetParser() antlr.Parser { return s.parser } + +func (s *DoReplaceContext) EXCLUDED() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEXCLUDED, 0) +} + +func (s *DoReplaceContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DoReplaceContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DoReplaceContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDoReplace(s) + } +} + +func (s *DoReplaceContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDoReplace(s) + } +} + +func (s *DoReplaceContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDoReplace(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) DoReplace() (localctx IDoReplaceContext) { + localctx = NewDoReplaceContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 52, PartiQLParserParserRULE_doReplace) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(494) + p.Match(PartiQLParserParserEXCLUDED) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDoUpdateContext is an interface to support dynamic dispatch. +type IDoUpdateContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + EXCLUDED() antlr.TerminalNode + + // IsDoUpdateContext differentiates from other interfaces. + IsDoUpdateContext() +} + +type DoUpdateContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDoUpdateContext() *DoUpdateContext { + var p = new(DoUpdateContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_doUpdate + return p +} + +func InitEmptyDoUpdateContext(p *DoUpdateContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_doUpdate +} + +func (*DoUpdateContext) IsDoUpdateContext() {} + +func NewDoUpdateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DoUpdateContext { + var p = new(DoUpdateContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_doUpdate + + return p +} + +func (s *DoUpdateContext) GetParser() antlr.Parser { return s.parser } + +func (s *DoUpdateContext) EXCLUDED() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEXCLUDED, 0) +} + +func (s *DoUpdateContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DoUpdateContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DoUpdateContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDoUpdate(s) + } +} + +func (s *DoUpdateContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDoUpdate(s) + } +} + +func (s *DoUpdateContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDoUpdate(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) DoUpdate() (localctx IDoUpdateContext) { + localctx = NewDoUpdateContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 54, PartiQLParserParserRULE_doUpdate) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(496) + p.Match(PartiQLParserParserEXCLUDED) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IUpdateClauseContext is an interface to support dynamic dispatch. +type IUpdateClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + UPDATE() antlr.TerminalNode + TableBaseReference() ITableBaseReferenceContext + + // IsUpdateClauseContext differentiates from other interfaces. + IsUpdateClauseContext() +} + +type UpdateClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyUpdateClauseContext() *UpdateClauseContext { + var p = new(UpdateClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_updateClause + return p +} + +func InitEmptyUpdateClauseContext(p *UpdateClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_updateClause +} + +func (*UpdateClauseContext) IsUpdateClauseContext() {} + +func NewUpdateClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UpdateClauseContext { + var p = new(UpdateClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_updateClause + + return p +} + +func (s *UpdateClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *UpdateClauseContext) UPDATE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserUPDATE, 0) +} + +func (s *UpdateClauseContext) TableBaseReference() ITableBaseReferenceContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITableBaseReferenceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITableBaseReferenceContext) +} + +func (s *UpdateClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *UpdateClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *UpdateClauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterUpdateClause(s) + } +} + +func (s *UpdateClauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitUpdateClause(s) + } +} + +func (s *UpdateClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitUpdateClause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) UpdateClause() (localctx IUpdateClauseContext) { + localctx = NewUpdateClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 56, PartiQLParserParserRULE_updateClause) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(498) + p.Match(PartiQLParserParserUPDATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(499) + p.TableBaseReference() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ISetCommandContext is an interface to support dynamic dispatch. +type ISetCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SET() antlr.TerminalNode + AllSetAssignment() []ISetAssignmentContext + SetAssignment(i int) ISetAssignmentContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsSetCommandContext differentiates from other interfaces. + IsSetCommandContext() +} + +type SetCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySetCommandContext() *SetCommandContext { + var p = new(SetCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_setCommand + return p +} + +func InitEmptySetCommandContext(p *SetCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_setCommand +} + +func (*SetCommandContext) IsSetCommandContext() {} + +func NewSetCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SetCommandContext { + var p = new(SetCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_setCommand + + return p +} + +func (s *SetCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *SetCommandContext) SET() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSET, 0) +} + +func (s *SetCommandContext) AllSetAssignment() []ISetAssignmentContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ISetAssignmentContext); ok { + len++ + } + } + + tst := make([]ISetAssignmentContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ISetAssignmentContext); ok { + tst[i] = t.(ISetAssignmentContext) + i++ + } + } + + return tst +} + +func (s *SetCommandContext) SetAssignment(i int) ISetAssignmentContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISetAssignmentContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(ISetAssignmentContext) +} + +func (s *SetCommandContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *SetCommandContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *SetCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SetCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SetCommandContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSetCommand(s) + } +} + +func (s *SetCommandContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSetCommand(s) + } +} + +func (s *SetCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSetCommand(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) SetCommand() (localctx ISetCommandContext) { + localctx = NewSetCommandContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 58, PartiQLParserParserRULE_setCommand) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(501) + p.Match(PartiQLParserParserSET) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(502) + p.SetAssignment() + } + p.SetState(507) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(503) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(504) + p.SetAssignment() + } + + p.SetState(509) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ISetAssignmentContext is an interface to support dynamic dispatch. +type ISetAssignmentContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + PathSimple() IPathSimpleContext + EQ() antlr.TerminalNode + Expr() IExprContext + + // IsSetAssignmentContext differentiates from other interfaces. + IsSetAssignmentContext() +} + +type SetAssignmentContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySetAssignmentContext() *SetAssignmentContext { + var p = new(SetAssignmentContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_setAssignment + return p +} + +func InitEmptySetAssignmentContext(p *SetAssignmentContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_setAssignment +} + +func (*SetAssignmentContext) IsSetAssignmentContext() {} + +func NewSetAssignmentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SetAssignmentContext { + var p = new(SetAssignmentContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_setAssignment + + return p +} + +func (s *SetAssignmentContext) GetParser() antlr.Parser { return s.parser } + +func (s *SetAssignmentContext) PathSimple() IPathSimpleContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPathSimpleContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPathSimpleContext) +} + +func (s *SetAssignmentContext) EQ() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEQ, 0) +} + +func (s *SetAssignmentContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *SetAssignmentContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SetAssignmentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SetAssignmentContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSetAssignment(s) + } +} + +func (s *SetAssignmentContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSetAssignment(s) + } +} + +func (s *SetAssignmentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSetAssignment(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) SetAssignment() (localctx ISetAssignmentContext) { + localctx = NewSetAssignmentContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 60, PartiQLParserParserRULE_setAssignment) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(510) + p.PathSimple() + } + { + p.SetState(511) + p.Match(PartiQLParserParserEQ) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(512) + p.Expr() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDeleteCommandContext is an interface to support dynamic dispatch. +type IDeleteCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DELETE() antlr.TerminalNode + FromClauseSimple() IFromClauseSimpleContext + WhereClause() IWhereClauseContext + ReturningClause() IReturningClauseContext + + // IsDeleteCommandContext differentiates from other interfaces. + IsDeleteCommandContext() +} + +type DeleteCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDeleteCommandContext() *DeleteCommandContext { + var p = new(DeleteCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_deleteCommand + return p +} + +func InitEmptyDeleteCommandContext(p *DeleteCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_deleteCommand +} + +func (*DeleteCommandContext) IsDeleteCommandContext() {} + +func NewDeleteCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DeleteCommandContext { + var p = new(DeleteCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_deleteCommand + + return p +} + +func (s *DeleteCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *DeleteCommandContext) DELETE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDELETE, 0) +} + +func (s *DeleteCommandContext) FromClauseSimple() IFromClauseSimpleContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFromClauseSimpleContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFromClauseSimpleContext) +} + +func (s *DeleteCommandContext) WhereClause() IWhereClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWhereClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IWhereClauseContext) +} + +func (s *DeleteCommandContext) ReturningClause() IReturningClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReturningClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IReturningClauseContext) +} + +func (s *DeleteCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DeleteCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DeleteCommandContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDeleteCommand(s) + } +} + +func (s *DeleteCommandContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDeleteCommand(s) + } +} + +func (s *DeleteCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDeleteCommand(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) DeleteCommand() (localctx IDeleteCommandContext) { + localctx = NewDeleteCommandContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 62, PartiQLParserParserRULE_deleteCommand) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(514) + p.Match(PartiQLParserParserDELETE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(515) + p.FromClauseSimple() + } + p.SetState(517) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserWHERE { + { + p.SetState(516) + p.WhereClause() + } + + } + p.SetState(520) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserRETURNING { + { + p.SetState(519) + p.ReturningClause() + } + + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IReturningClauseContext is an interface to support dynamic dispatch. +type IReturningClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + RETURNING() antlr.TerminalNode + AllReturningColumn() []IReturningColumnContext + ReturningColumn(i int) IReturningColumnContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsReturningClauseContext differentiates from other interfaces. + IsReturningClauseContext() +} + +type ReturningClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyReturningClauseContext() *ReturningClauseContext { + var p = new(ReturningClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_returningClause + return p +} + +func InitEmptyReturningClauseContext(p *ReturningClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_returningClause +} + +func (*ReturningClauseContext) IsReturningClauseContext() {} + +func NewReturningClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReturningClauseContext { + var p = new(ReturningClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_returningClause + + return p +} + +func (s *ReturningClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *ReturningClauseContext) RETURNING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserRETURNING, 0) +} + +func (s *ReturningClauseContext) AllReturningColumn() []IReturningColumnContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IReturningColumnContext); ok { + len++ + } + } + + tst := make([]IReturningColumnContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IReturningColumnContext); ok { + tst[i] = t.(IReturningColumnContext) + i++ + } + } + + return tst +} + +func (s *ReturningClauseContext) ReturningColumn(i int) IReturningColumnContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReturningColumnContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IReturningColumnContext) +} + +func (s *ReturningClauseContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *ReturningClauseContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *ReturningClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ReturningClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ReturningClauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterReturningClause(s) + } +} + +func (s *ReturningClauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitReturningClause(s) + } +} + +func (s *ReturningClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitReturningClause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ReturningClause() (localctx IReturningClauseContext) { + localctx = NewReturningClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 64, PartiQLParserParserRULE_returningClause) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(522) + p.Match(PartiQLParserParserRETURNING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(523) + p.ReturningColumn() + } + p.SetState(528) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(524) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(525) + p.ReturningColumn() + } + + p.SetState(530) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IReturningColumnContext is an interface to support dynamic dispatch. +type IReturningColumnContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetStatus returns the status token. + GetStatus() antlr.Token + + // GetAge returns the age token. + GetAge() antlr.Token + + // SetStatus sets the status token. + SetStatus(antlr.Token) + + // SetAge sets the age token. + SetAge(antlr.Token) + + // GetCol returns the col rule contexts. + GetCol() IExprContext + + // SetCol sets the col rule contexts. + SetCol(IExprContext) + + // Getter signatures + ASTERISK() antlr.TerminalNode + MODIFIED() antlr.TerminalNode + ALL() antlr.TerminalNode + OLD() antlr.TerminalNode + NEW() antlr.TerminalNode + Expr() IExprContext + + // IsReturningColumnContext differentiates from other interfaces. + IsReturningColumnContext() +} + +type ReturningColumnContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + status antlr.Token + age antlr.Token + col IExprContext +} + +func NewEmptyReturningColumnContext() *ReturningColumnContext { + var p = new(ReturningColumnContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_returningColumn + return p +} + +func InitEmptyReturningColumnContext(p *ReturningColumnContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_returningColumn +} + +func (*ReturningColumnContext) IsReturningColumnContext() {} + +func NewReturningColumnContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReturningColumnContext { + var p = new(ReturningColumnContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_returningColumn + + return p +} + +func (s *ReturningColumnContext) GetParser() antlr.Parser { return s.parser } + +func (s *ReturningColumnContext) GetStatus() antlr.Token { return s.status } + +func (s *ReturningColumnContext) GetAge() antlr.Token { return s.age } + +func (s *ReturningColumnContext) SetStatus(v antlr.Token) { s.status = v } + +func (s *ReturningColumnContext) SetAge(v antlr.Token) { s.age = v } + +func (s *ReturningColumnContext) GetCol() IExprContext { return s.col } + +func (s *ReturningColumnContext) SetCol(v IExprContext) { s.col = v } + +func (s *ReturningColumnContext) ASTERISK() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserASTERISK, 0) +} + +func (s *ReturningColumnContext) MODIFIED() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMODIFIED, 0) +} + +func (s *ReturningColumnContext) ALL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserALL, 0) +} + +func (s *ReturningColumnContext) OLD() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserOLD, 0) +} + +func (s *ReturningColumnContext) NEW() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNEW, 0) +} + +func (s *ReturningColumnContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *ReturningColumnContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ReturningColumnContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ReturningColumnContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterReturningColumn(s) + } +} + +func (s *ReturningColumnContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitReturningColumn(s) + } +} + +func (s *ReturningColumnContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitReturningColumn(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ReturningColumn() (localctx IReturningColumnContext) { + localctx = NewReturningColumnContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 66, PartiQLParserParserRULE_returningColumn) + var _la int + + p.SetState(537) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 41, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(531) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*ReturningColumnContext).status = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserALL || _la == PartiQLParserParserMODIFIED) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*ReturningColumnContext).status = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(532) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*ReturningColumnContext).age = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserNEW || _la == PartiQLParserParserOLD) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*ReturningColumnContext).age = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(533) + p.Match(PartiQLParserParserASTERISK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(534) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*ReturningColumnContext).status = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserALL || _la == PartiQLParserParserMODIFIED) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*ReturningColumnContext).status = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(535) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*ReturningColumnContext).age = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserNEW || _la == PartiQLParserParserOLD) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*ReturningColumnContext).age = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(536) + + var _x = p.Expr() + + localctx.(*ReturningColumnContext).col = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IFromClauseSimpleContext is an interface to support dynamic dispatch. +type IFromClauseSimpleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsFromClauseSimpleContext differentiates from other interfaces. + IsFromClauseSimpleContext() +} + +type FromClauseSimpleContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyFromClauseSimpleContext() *FromClauseSimpleContext { + var p = new(FromClauseSimpleContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_fromClauseSimple + return p +} + +func InitEmptyFromClauseSimpleContext(p *FromClauseSimpleContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_fromClauseSimple +} + +func (*FromClauseSimpleContext) IsFromClauseSimpleContext() {} + +func NewFromClauseSimpleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FromClauseSimpleContext { + var p = new(FromClauseSimpleContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_fromClauseSimple + + return p +} + +func (s *FromClauseSimpleContext) GetParser() antlr.Parser { return s.parser } + +func (s *FromClauseSimpleContext) CopyAll(ctx *FromClauseSimpleContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *FromClauseSimpleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FromClauseSimpleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type FromClauseSimpleExplicitContext struct { + FromClauseSimpleContext +} + +func NewFromClauseSimpleExplicitContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FromClauseSimpleExplicitContext { + var p = new(FromClauseSimpleExplicitContext) + + InitEmptyFromClauseSimpleContext(&p.FromClauseSimpleContext) + p.parser = parser + p.CopyAll(ctx.(*FromClauseSimpleContext)) + + return p +} + +func (s *FromClauseSimpleExplicitContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FromClauseSimpleExplicitContext) FROM() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFROM, 0) +} + +func (s *FromClauseSimpleExplicitContext) PathSimple() IPathSimpleContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPathSimpleContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPathSimpleContext) +} + +func (s *FromClauseSimpleExplicitContext) AsIdent() IAsIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAsIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAsIdentContext) +} + +func (s *FromClauseSimpleExplicitContext) AtIdent() IAtIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAtIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAtIdentContext) +} + +func (s *FromClauseSimpleExplicitContext) ByIdent() IByIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IByIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IByIdentContext) +} + +func (s *FromClauseSimpleExplicitContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterFromClauseSimpleExplicit(s) + } +} + +func (s *FromClauseSimpleExplicitContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitFromClauseSimpleExplicit(s) + } +} + +func (s *FromClauseSimpleExplicitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitFromClauseSimpleExplicit(s) + + default: + return t.VisitChildren(s) + } +} + +type FromClauseSimpleImplicitContext struct { + FromClauseSimpleContext +} + +func NewFromClauseSimpleImplicitContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FromClauseSimpleImplicitContext { + var p = new(FromClauseSimpleImplicitContext) + + InitEmptyFromClauseSimpleContext(&p.FromClauseSimpleContext) + p.parser = parser + p.CopyAll(ctx.(*FromClauseSimpleContext)) + + return p +} + +func (s *FromClauseSimpleImplicitContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FromClauseSimpleImplicitContext) FROM() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFROM, 0) +} + +func (s *FromClauseSimpleImplicitContext) PathSimple() IPathSimpleContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPathSimpleContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPathSimpleContext) +} + +func (s *FromClauseSimpleImplicitContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *FromClauseSimpleImplicitContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterFromClauseSimpleImplicit(s) + } +} + +func (s *FromClauseSimpleImplicitContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitFromClauseSimpleImplicit(s) + } +} + +func (s *FromClauseSimpleImplicitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitFromClauseSimpleImplicit(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) FromClauseSimple() (localctx IFromClauseSimpleContext) { + localctx = NewFromClauseSimpleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 68, PartiQLParserParserRULE_fromClauseSimple) + var _la int + + p.SetState(554) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 45, p.GetParserRuleContext()) { + case 1: + localctx = NewFromClauseSimpleExplicitContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(539) + p.Match(PartiQLParserParserFROM) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(540) + p.PathSimple() + } + p.SetState(542) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserAS { + { + p.SetState(541) + p.AsIdent() + } + + } + p.SetState(545) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserAT { + { + p.SetState(544) + p.AtIdent() + } + + } + p.SetState(548) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserBY { + { + p.SetState(547) + p.ByIdent() + } + + } + + case 2: + localctx = NewFromClauseSimpleImplicitContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(550) + p.Match(PartiQLParserParserFROM) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(551) + p.PathSimple() + } + { + p.SetState(552) + p.SymbolPrimitive() + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IWhereClauseContext is an interface to support dynamic dispatch. +type IWhereClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetArg returns the arg rule contexts. + GetArg() IExprContext + + // SetArg sets the arg rule contexts. + SetArg(IExprContext) + + // Getter signatures + WHERE() antlr.TerminalNode + Expr() IExprContext + + // IsWhereClauseContext differentiates from other interfaces. + IsWhereClauseContext() +} + +type WhereClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + arg IExprContext +} + +func NewEmptyWhereClauseContext() *WhereClauseContext { + var p = new(WhereClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_whereClause + return p +} + +func InitEmptyWhereClauseContext(p *WhereClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_whereClause +} + +func (*WhereClauseContext) IsWhereClauseContext() {} + +func NewWhereClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WhereClauseContext { + var p = new(WhereClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_whereClause + + return p +} + +func (s *WhereClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *WhereClauseContext) GetArg() IExprContext { return s.arg } + +func (s *WhereClauseContext) SetArg(v IExprContext) { s.arg = v } + +func (s *WhereClauseContext) WHERE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserWHERE, 0) +} + +func (s *WhereClauseContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *WhereClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *WhereClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *WhereClauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterWhereClause(s) + } +} + +func (s *WhereClauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitWhereClause(s) + } +} + +func (s *WhereClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitWhereClause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) WhereClause() (localctx IWhereClauseContext) { + localctx = NewWhereClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 70, PartiQLParserParserRULE_whereClause) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(556) + p.Match(PartiQLParserParserWHERE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(557) + + var _x = p.Expr() + + localctx.(*WhereClauseContext).arg = _x + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ISelectClauseContext is an interface to support dynamic dispatch. +type ISelectClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsSelectClauseContext differentiates from other interfaces. + IsSelectClauseContext() +} + +type SelectClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySelectClauseContext() *SelectClauseContext { + var p = new(SelectClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_selectClause + return p +} + +func InitEmptySelectClauseContext(p *SelectClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_selectClause +} + +func (*SelectClauseContext) IsSelectClauseContext() {} + +func NewSelectClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SelectClauseContext { + var p = new(SelectClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_selectClause + + return p +} + +func (s *SelectClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *SelectClauseContext) CopyAll(ctx *SelectClauseContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *SelectClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SelectClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type SelectAllContext struct { + SelectClauseContext +} + +func NewSelectAllContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectAllContext { + var p = new(SelectAllContext) + + InitEmptySelectClauseContext(&p.SelectClauseContext) + p.parser = parser + p.CopyAll(ctx.(*SelectClauseContext)) + + return p +} + +func (s *SelectAllContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SelectAllContext) SELECT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSELECT, 0) +} + +func (s *SelectAllContext) ASTERISK() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserASTERISK, 0) +} + +func (s *SelectAllContext) SetQuantifierStrategy() ISetQuantifierStrategyContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISetQuantifierStrategyContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISetQuantifierStrategyContext) +} + +func (s *SelectAllContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSelectAll(s) + } +} + +func (s *SelectAllContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSelectAll(s) + } +} + +func (s *SelectAllContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSelectAll(s) + + default: + return t.VisitChildren(s) + } +} + +type SelectValueContext struct { + SelectClauseContext +} + +func NewSelectValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectValueContext { + var p = new(SelectValueContext) + + InitEmptySelectClauseContext(&p.SelectClauseContext) + p.parser = parser + p.CopyAll(ctx.(*SelectClauseContext)) + + return p +} + +func (s *SelectValueContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SelectValueContext) SELECT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSELECT, 0) +} + +func (s *SelectValueContext) VALUE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserVALUE, 0) +} + +func (s *SelectValueContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *SelectValueContext) SetQuantifierStrategy() ISetQuantifierStrategyContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISetQuantifierStrategyContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISetQuantifierStrategyContext) +} + +func (s *SelectValueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSelectValue(s) + } +} + +func (s *SelectValueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSelectValue(s) + } +} + +func (s *SelectValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSelectValue(s) + + default: + return t.VisitChildren(s) + } +} + +type SelectItemsContext struct { + SelectClauseContext +} + +func NewSelectItemsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectItemsContext { + var p = new(SelectItemsContext) + + InitEmptySelectClauseContext(&p.SelectClauseContext) + p.parser = parser + p.CopyAll(ctx.(*SelectClauseContext)) + + return p +} + +func (s *SelectItemsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SelectItemsContext) SELECT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSELECT, 0) +} + +func (s *SelectItemsContext) ProjectionItems() IProjectionItemsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IProjectionItemsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IProjectionItemsContext) +} + +func (s *SelectItemsContext) SetQuantifierStrategy() ISetQuantifierStrategyContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISetQuantifierStrategyContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISetQuantifierStrategyContext) +} + +func (s *SelectItemsContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSelectItems(s) + } +} + +func (s *SelectItemsContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSelectItems(s) + } +} + +func (s *SelectItemsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSelectItems(s) + + default: + return t.VisitChildren(s) + } +} + +type SelectPivotContext struct { + SelectClauseContext + pivot IExprContext + at IExprContext +} + +func NewSelectPivotContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectPivotContext { + var p = new(SelectPivotContext) + + InitEmptySelectClauseContext(&p.SelectClauseContext) + p.parser = parser + p.CopyAll(ctx.(*SelectClauseContext)) + + return p +} + +func (s *SelectPivotContext) GetPivot() IExprContext { return s.pivot } + +func (s *SelectPivotContext) GetAt() IExprContext { return s.at } + +func (s *SelectPivotContext) SetPivot(v IExprContext) { s.pivot = v } + +func (s *SelectPivotContext) SetAt(v IExprContext) { s.at = v } + +func (s *SelectPivotContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SelectPivotContext) PIVOT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPIVOT, 0) +} + +func (s *SelectPivotContext) AT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAT, 0) +} + +func (s *SelectPivotContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *SelectPivotContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *SelectPivotContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSelectPivot(s) + } +} + +func (s *SelectPivotContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSelectPivot(s) + } +} + +func (s *SelectPivotContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSelectPivot(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) SelectClause() (localctx ISelectClauseContext) { + localctx = NewSelectClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 72, PartiQLParserParserRULE_selectClause) + var _la int + + p.SetState(580) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 49, p.GetParserRuleContext()) { + case 1: + localctx = NewSelectAllContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(559) + p.Match(PartiQLParserParserSELECT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(561) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT { + { + p.SetState(560) + p.SetQuantifierStrategy() + } + + } + { + p.SetState(563) + p.Match(PartiQLParserParserASTERISK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + localctx = NewSelectItemsContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(564) + p.Match(PartiQLParserParserSELECT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(566) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT { + { + p.SetState(565) + p.SetQuantifierStrategy() + } + + } + { + p.SetState(568) + p.ProjectionItems() + } + + case 3: + localctx = NewSelectValueContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(569) + p.Match(PartiQLParserParserSELECT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(571) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT { + { + p.SetState(570) + p.SetQuantifierStrategy() + } + + } + { + p.SetState(573) + p.Match(PartiQLParserParserVALUE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(574) + p.Expr() + } + + case 4: + localctx = NewSelectPivotContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(575) + p.Match(PartiQLParserParserPIVOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(576) + + var _x = p.Expr() + + localctx.(*SelectPivotContext).pivot = _x + } + { + p.SetState(577) + p.Match(PartiQLParserParserAT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(578) + + var _x = p.Expr() + + localctx.(*SelectPivotContext).at = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IProjectionItemsContext is an interface to support dynamic dispatch. +type IProjectionItemsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AllProjectionItem() []IProjectionItemContext + ProjectionItem(i int) IProjectionItemContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsProjectionItemsContext differentiates from other interfaces. + IsProjectionItemsContext() +} + +type ProjectionItemsContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyProjectionItemsContext() *ProjectionItemsContext { + var p = new(ProjectionItemsContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_projectionItems + return p +} + +func InitEmptyProjectionItemsContext(p *ProjectionItemsContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_projectionItems +} + +func (*ProjectionItemsContext) IsProjectionItemsContext() {} + +func NewProjectionItemsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ProjectionItemsContext { + var p = new(ProjectionItemsContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_projectionItems + + return p +} + +func (s *ProjectionItemsContext) GetParser() antlr.Parser { return s.parser } + +func (s *ProjectionItemsContext) AllProjectionItem() []IProjectionItemContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IProjectionItemContext); ok { + len++ + } + } + + tst := make([]IProjectionItemContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IProjectionItemContext); ok { + tst[i] = t.(IProjectionItemContext) + i++ + } + } + + return tst +} + +func (s *ProjectionItemsContext) ProjectionItem(i int) IProjectionItemContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IProjectionItemContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IProjectionItemContext) +} + +func (s *ProjectionItemsContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *ProjectionItemsContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *ProjectionItemsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ProjectionItemsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ProjectionItemsContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterProjectionItems(s) + } +} + +func (s *ProjectionItemsContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitProjectionItems(s) + } +} + +func (s *ProjectionItemsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitProjectionItems(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ProjectionItems() (localctx IProjectionItemsContext) { + localctx = NewProjectionItemsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 74, PartiQLParserParserRULE_projectionItems) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(582) + p.ProjectionItem() + } + p.SetState(587) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(583) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(584) + p.ProjectionItem() + } + + p.SetState(589) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IProjectionItemContext is an interface to support dynamic dispatch. +type IProjectionItemContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Expr() IExprContext + SymbolPrimitive() ISymbolPrimitiveContext + AS() antlr.TerminalNode + + // IsProjectionItemContext differentiates from other interfaces. + IsProjectionItemContext() +} + +type ProjectionItemContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyProjectionItemContext() *ProjectionItemContext { + var p = new(ProjectionItemContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_projectionItem + return p +} + +func InitEmptyProjectionItemContext(p *ProjectionItemContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_projectionItem +} + +func (*ProjectionItemContext) IsProjectionItemContext() {} + +func NewProjectionItemContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ProjectionItemContext { + var p = new(ProjectionItemContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_projectionItem + + return p +} + +func (s *ProjectionItemContext) GetParser() antlr.Parser { return s.parser } + +func (s *ProjectionItemContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *ProjectionItemContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *ProjectionItemContext) AS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAS, 0) +} + +func (s *ProjectionItemContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ProjectionItemContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ProjectionItemContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterProjectionItem(s) + } +} + +func (s *ProjectionItemContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitProjectionItem(s) + } +} + +func (s *ProjectionItemContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitProjectionItem(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ProjectionItem() (localctx IProjectionItemContext) { + localctx = NewProjectionItemContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 76, PartiQLParserParserRULE_projectionItem) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(590) + p.Expr() + } + p.SetState(595) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserAS || _la == PartiQLParserParserIDENTIFIER || _la == PartiQLParserParserIDENTIFIER_QUOTED { + p.SetState(592) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserAS { + { + p.SetState(591) + p.Match(PartiQLParserParserAS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(594) + p.SymbolPrimitive() + } + + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ISetQuantifierStrategyContext is an interface to support dynamic dispatch. +type ISetQuantifierStrategyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DISTINCT() antlr.TerminalNode + ALL() antlr.TerminalNode + + // IsSetQuantifierStrategyContext differentiates from other interfaces. + IsSetQuantifierStrategyContext() +} + +type SetQuantifierStrategyContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySetQuantifierStrategyContext() *SetQuantifierStrategyContext { + var p = new(SetQuantifierStrategyContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_setQuantifierStrategy + return p +} + +func InitEmptySetQuantifierStrategyContext(p *SetQuantifierStrategyContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_setQuantifierStrategy +} + +func (*SetQuantifierStrategyContext) IsSetQuantifierStrategyContext() {} + +func NewSetQuantifierStrategyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SetQuantifierStrategyContext { + var p = new(SetQuantifierStrategyContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_setQuantifierStrategy + + return p +} + +func (s *SetQuantifierStrategyContext) GetParser() antlr.Parser { return s.parser } + +func (s *SetQuantifierStrategyContext) DISTINCT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDISTINCT, 0) +} + +func (s *SetQuantifierStrategyContext) ALL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserALL, 0) +} + +func (s *SetQuantifierStrategyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SetQuantifierStrategyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SetQuantifierStrategyContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSetQuantifierStrategy(s) + } +} + +func (s *SetQuantifierStrategyContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSetQuantifierStrategy(s) + } +} + +func (s *SetQuantifierStrategyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSetQuantifierStrategy(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) SetQuantifierStrategy() (localctx ISetQuantifierStrategyContext) { + localctx = NewSetQuantifierStrategyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 78, PartiQLParserParserRULE_setQuantifierStrategy) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(597) + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ILetClauseContext is an interface to support dynamic dispatch. +type ILetClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + LET() antlr.TerminalNode + AllLetBinding() []ILetBindingContext + LetBinding(i int) ILetBindingContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsLetClauseContext differentiates from other interfaces. + IsLetClauseContext() +} + +type LetClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyLetClauseContext() *LetClauseContext { + var p = new(LetClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_letClause + return p +} + +func InitEmptyLetClauseContext(p *LetClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_letClause +} + +func (*LetClauseContext) IsLetClauseContext() {} + +func NewLetClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LetClauseContext { + var p = new(LetClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_letClause + + return p +} + +func (s *LetClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *LetClauseContext) LET() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLET, 0) +} + +func (s *LetClauseContext) AllLetBinding() []ILetBindingContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ILetBindingContext); ok { + len++ + } + } + + tst := make([]ILetBindingContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ILetBindingContext); ok { + tst[i] = t.(ILetBindingContext) + i++ + } + } + + return tst +} + +func (s *LetClauseContext) LetBinding(i int) ILetBindingContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILetBindingContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(ILetBindingContext) +} + +func (s *LetClauseContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *LetClauseContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *LetClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LetClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LetClauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLetClause(s) + } +} + +func (s *LetClauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLetClause(s) + } +} + +func (s *LetClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLetClause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) LetClause() (localctx ILetClauseContext) { + localctx = NewLetClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 80, PartiQLParserParserRULE_letClause) + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(599) + p.Match(PartiQLParserParserLET) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(600) + p.LetBinding() + } + p.SetState(605) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 53, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(601) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(602) + p.LetBinding() + } + + } + p.SetState(607) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 53, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ILetBindingContext is an interface to support dynamic dispatch. +type ILetBindingContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Expr() IExprContext + AS() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + + // IsLetBindingContext differentiates from other interfaces. + IsLetBindingContext() +} + +type LetBindingContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyLetBindingContext() *LetBindingContext { + var p = new(LetBindingContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_letBinding + return p +} + +func InitEmptyLetBindingContext(p *LetBindingContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_letBinding +} + +func (*LetBindingContext) IsLetBindingContext() {} + +func NewLetBindingContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LetBindingContext { + var p = new(LetBindingContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_letBinding + + return p +} + +func (s *LetBindingContext) GetParser() antlr.Parser { return s.parser } + +func (s *LetBindingContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *LetBindingContext) AS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAS, 0) +} + +func (s *LetBindingContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *LetBindingContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LetBindingContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LetBindingContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLetBinding(s) + } +} + +func (s *LetBindingContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLetBinding(s) + } +} + +func (s *LetBindingContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLetBinding(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) LetBinding() (localctx ILetBindingContext) { + localctx = NewLetBindingContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 82, PartiQLParserParserRULE_letBinding) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(608) + p.Expr() + } + { + p.SetState(609) + p.Match(PartiQLParserParserAS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(610) + p.SymbolPrimitive() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IOrderByClauseContext is an interface to support dynamic dispatch. +type IOrderByClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ORDER() antlr.TerminalNode + BY() antlr.TerminalNode + AllOrderSortSpec() []IOrderSortSpecContext + OrderSortSpec(i int) IOrderSortSpecContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsOrderByClauseContext differentiates from other interfaces. + IsOrderByClauseContext() +} + +type OrderByClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyOrderByClauseContext() *OrderByClauseContext { + var p = new(OrderByClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_orderByClause + return p +} + +func InitEmptyOrderByClauseContext(p *OrderByClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_orderByClause +} + +func (*OrderByClauseContext) IsOrderByClauseContext() {} + +func NewOrderByClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OrderByClauseContext { + var p = new(OrderByClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_orderByClause + + return p +} + +func (s *OrderByClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *OrderByClauseContext) ORDER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserORDER, 0) +} + +func (s *OrderByClauseContext) BY() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBY, 0) +} + +func (s *OrderByClauseContext) AllOrderSortSpec() []IOrderSortSpecContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IOrderSortSpecContext); ok { + len++ + } + } + + tst := make([]IOrderSortSpecContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IOrderSortSpecContext); ok { + tst[i] = t.(IOrderSortSpecContext) + i++ + } + } + + return tst +} + +func (s *OrderByClauseContext) OrderSortSpec(i int) IOrderSortSpecContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOrderSortSpecContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IOrderSortSpecContext) +} + +func (s *OrderByClauseContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *OrderByClauseContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *OrderByClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *OrderByClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *OrderByClauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterOrderByClause(s) + } +} + +func (s *OrderByClauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitOrderByClause(s) + } +} + +func (s *OrderByClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitOrderByClause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) OrderByClause() (localctx IOrderByClauseContext) { + localctx = NewOrderByClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 84, PartiQLParserParserRULE_orderByClause) + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(612) + p.Match(PartiQLParserParserORDER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(613) + p.Match(PartiQLParserParserBY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(614) + p.OrderSortSpec() + } + p.SetState(619) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 54, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(615) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(616) + p.OrderSortSpec() + } + + } + p.SetState(621) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 54, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IOrderSortSpecContext is an interface to support dynamic dispatch. +type IOrderSortSpecContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetDir returns the dir token. + GetDir() antlr.Token + + // GetNulls returns the nulls token. + GetNulls() antlr.Token + + // SetDir sets the dir token. + SetDir(antlr.Token) + + // SetNulls sets the nulls token. + SetNulls(antlr.Token) + + // Getter signatures + Expr() IExprContext + NULLS() antlr.TerminalNode + ASC() antlr.TerminalNode + DESC() antlr.TerminalNode + FIRST() antlr.TerminalNode + LAST() antlr.TerminalNode + + // IsOrderSortSpecContext differentiates from other interfaces. + IsOrderSortSpecContext() +} + +type OrderSortSpecContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + dir antlr.Token + nulls antlr.Token +} + +func NewEmptyOrderSortSpecContext() *OrderSortSpecContext { + var p = new(OrderSortSpecContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_orderSortSpec + return p +} + +func InitEmptyOrderSortSpecContext(p *OrderSortSpecContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_orderSortSpec +} + +func (*OrderSortSpecContext) IsOrderSortSpecContext() {} + +func NewOrderSortSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OrderSortSpecContext { + var p = new(OrderSortSpecContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_orderSortSpec + + return p +} + +func (s *OrderSortSpecContext) GetParser() antlr.Parser { return s.parser } + +func (s *OrderSortSpecContext) GetDir() antlr.Token { return s.dir } + +func (s *OrderSortSpecContext) GetNulls() antlr.Token { return s.nulls } + +func (s *OrderSortSpecContext) SetDir(v antlr.Token) { s.dir = v } + +func (s *OrderSortSpecContext) SetNulls(v antlr.Token) { s.nulls = v } + +func (s *OrderSortSpecContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *OrderSortSpecContext) NULLS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNULLS, 0) +} + +func (s *OrderSortSpecContext) ASC() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserASC, 0) +} + +func (s *OrderSortSpecContext) DESC() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDESC, 0) +} + +func (s *OrderSortSpecContext) FIRST() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFIRST, 0) +} + +func (s *OrderSortSpecContext) LAST() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLAST, 0) +} + +func (s *OrderSortSpecContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *OrderSortSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *OrderSortSpecContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterOrderSortSpec(s) + } +} + +func (s *OrderSortSpecContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitOrderSortSpec(s) + } +} + +func (s *OrderSortSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitOrderSortSpec(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) OrderSortSpec() (localctx IOrderSortSpecContext) { + localctx = NewOrderSortSpecContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 86, PartiQLParserParserRULE_orderSortSpec) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(622) + p.Expr() + } + p.SetState(624) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 55, p.GetParserRuleContext()) == 1 { + { + p.SetState(623) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*OrderSortSpecContext).dir = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserASC || _la == PartiQLParserParserDESC) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*OrderSortSpecContext).dir = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(628) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 56, p.GetParserRuleContext()) == 1 { + { + p.SetState(626) + p.Match(PartiQLParserParserNULLS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(627) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*OrderSortSpecContext).nulls = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserFIRST || _la == PartiQLParserParserLAST) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*OrderSortSpecContext).nulls = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IGroupClauseContext is an interface to support dynamic dispatch. +type IGroupClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + GROUP() antlr.TerminalNode + BY() antlr.TerminalNode + AllGroupKey() []IGroupKeyContext + GroupKey(i int) IGroupKeyContext + PARTIAL() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + GroupAlias() IGroupAliasContext + + // IsGroupClauseContext differentiates from other interfaces. + IsGroupClauseContext() +} + +type GroupClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyGroupClauseContext() *GroupClauseContext { + var p = new(GroupClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_groupClause + return p +} + +func InitEmptyGroupClauseContext(p *GroupClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_groupClause +} + +func (*GroupClauseContext) IsGroupClauseContext() {} + +func NewGroupClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupClauseContext { + var p = new(GroupClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_groupClause + + return p +} + +func (s *GroupClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *GroupClauseContext) GROUP() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserGROUP, 0) +} + +func (s *GroupClauseContext) BY() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBY, 0) +} + +func (s *GroupClauseContext) AllGroupKey() []IGroupKeyContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IGroupKeyContext); ok { + len++ + } + } + + tst := make([]IGroupKeyContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IGroupKeyContext); ok { + tst[i] = t.(IGroupKeyContext) + i++ + } + } + + return tst +} + +func (s *GroupClauseContext) GroupKey(i int) IGroupKeyContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGroupKeyContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IGroupKeyContext) +} + +func (s *GroupClauseContext) PARTIAL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPARTIAL, 0) +} + +func (s *GroupClauseContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *GroupClauseContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *GroupClauseContext) GroupAlias() IGroupAliasContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGroupAliasContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IGroupAliasContext) +} + +func (s *GroupClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *GroupClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *GroupClauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterGroupClause(s) + } +} + +func (s *GroupClauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitGroupClause(s) + } +} + +func (s *GroupClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitGroupClause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) GroupClause() (localctx IGroupClauseContext) { + localctx = NewGroupClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 88, PartiQLParserParserRULE_groupClause) + var _la int + + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(630) + p.Match(PartiQLParserParserGROUP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(632) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserPARTIAL { + { + p.SetState(631) + p.Match(PartiQLParserParserPARTIAL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(634) + p.Match(PartiQLParserParserBY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(635) + p.GroupKey() + } + p.SetState(640) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 58, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(636) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(637) + p.GroupKey() + } + + } + p.SetState(642) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 58, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + p.SetState(644) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 59, p.GetParserRuleContext()) == 1 { + { + p.SetState(643) + p.GroupAlias() + } + + } else if p.HasError() { // JIM + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IGroupAliasContext is an interface to support dynamic dispatch. +type IGroupAliasContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + GROUP() antlr.TerminalNode + AS() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + + // IsGroupAliasContext differentiates from other interfaces. + IsGroupAliasContext() +} + +type GroupAliasContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyGroupAliasContext() *GroupAliasContext { + var p = new(GroupAliasContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_groupAlias + return p +} + +func InitEmptyGroupAliasContext(p *GroupAliasContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_groupAlias +} + +func (*GroupAliasContext) IsGroupAliasContext() {} + +func NewGroupAliasContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupAliasContext { + var p = new(GroupAliasContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_groupAlias + + return p +} + +func (s *GroupAliasContext) GetParser() antlr.Parser { return s.parser } + +func (s *GroupAliasContext) GROUP() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserGROUP, 0) +} + +func (s *GroupAliasContext) AS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAS, 0) +} + +func (s *GroupAliasContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *GroupAliasContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *GroupAliasContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *GroupAliasContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterGroupAlias(s) + } +} + +func (s *GroupAliasContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitGroupAlias(s) + } +} + +func (s *GroupAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitGroupAlias(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) GroupAlias() (localctx IGroupAliasContext) { + localctx = NewGroupAliasContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 90, PartiQLParserParserRULE_groupAlias) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(646) + p.Match(PartiQLParserParserGROUP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(647) + p.Match(PartiQLParserParserAS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(648) + p.SymbolPrimitive() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IGroupKeyContext is an interface to support dynamic dispatch. +type IGroupKeyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetKey returns the key rule contexts. + GetKey() IExprSelectContext + + // SetKey sets the key rule contexts. + SetKey(IExprSelectContext) + + // Getter signatures + ExprSelect() IExprSelectContext + AS() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + + // IsGroupKeyContext differentiates from other interfaces. + IsGroupKeyContext() +} + +type GroupKeyContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + key IExprSelectContext +} + +func NewEmptyGroupKeyContext() *GroupKeyContext { + var p = new(GroupKeyContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_groupKey + return p +} + +func InitEmptyGroupKeyContext(p *GroupKeyContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_groupKey +} + +func (*GroupKeyContext) IsGroupKeyContext() {} + +func NewGroupKeyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupKeyContext { + var p = new(GroupKeyContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_groupKey + + return p +} + +func (s *GroupKeyContext) GetParser() antlr.Parser { return s.parser } + +func (s *GroupKeyContext) GetKey() IExprSelectContext { return s.key } + +func (s *GroupKeyContext) SetKey(v IExprSelectContext) { s.key = v } + +func (s *GroupKeyContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *GroupKeyContext) AS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAS, 0) +} + +func (s *GroupKeyContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *GroupKeyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *GroupKeyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *GroupKeyContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterGroupKey(s) + } +} + +func (s *GroupKeyContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitGroupKey(s) + } +} + +func (s *GroupKeyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitGroupKey(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) GroupKey() (localctx IGroupKeyContext) { + localctx = NewGroupKeyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 92, PartiQLParserParserRULE_groupKey) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(650) + + var _x = p.ExprSelect() + + localctx.(*GroupKeyContext).key = _x + } + p.SetState(653) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 60, p.GetParserRuleContext()) == 1 { + { + p.SetState(651) + p.Match(PartiQLParserParserAS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(652) + p.SymbolPrimitive() + } + + } else if p.HasError() { // JIM + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IOverContext is an interface to support dynamic dispatch. +type IOverContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + OVER() antlr.TerminalNode + PAREN_LEFT() antlr.TerminalNode + PAREN_RIGHT() antlr.TerminalNode + WindowPartitionList() IWindowPartitionListContext + WindowSortSpecList() IWindowSortSpecListContext + + // IsOverContext differentiates from other interfaces. + IsOverContext() +} + +type OverContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyOverContext() *OverContext { + var p = new(OverContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_over + return p +} + +func InitEmptyOverContext(p *OverContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_over +} + +func (*OverContext) IsOverContext() {} + +func NewOverContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OverContext { + var p = new(OverContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_over + + return p +} + +func (s *OverContext) GetParser() antlr.Parser { return s.parser } + +func (s *OverContext) OVER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserOVER, 0) +} + +func (s *OverContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *OverContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *OverContext) WindowPartitionList() IWindowPartitionListContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWindowPartitionListContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IWindowPartitionListContext) +} + +func (s *OverContext) WindowSortSpecList() IWindowSortSpecListContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWindowSortSpecListContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IWindowSortSpecListContext) +} + +func (s *OverContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *OverContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *OverContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterOver(s) + } +} + +func (s *OverContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitOver(s) + } +} + +func (s *OverContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitOver(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Over() (localctx IOverContext) { + localctx = NewOverContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 94, PartiQLParserParserRULE_over) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(655) + p.Match(PartiQLParserParserOVER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(656) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(658) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserPARTITION { + { + p.SetState(657) + p.WindowPartitionList() + } + + } + p.SetState(661) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserORDER { + { + p.SetState(660) + p.WindowSortSpecList() + } + + } + { + p.SetState(663) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IWindowPartitionListContext is an interface to support dynamic dispatch. +type IWindowPartitionListContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + PARTITION() antlr.TerminalNode + BY() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsWindowPartitionListContext differentiates from other interfaces. + IsWindowPartitionListContext() +} + +type WindowPartitionListContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyWindowPartitionListContext() *WindowPartitionListContext { + var p = new(WindowPartitionListContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_windowPartitionList + return p +} + +func InitEmptyWindowPartitionListContext(p *WindowPartitionListContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_windowPartitionList +} + +func (*WindowPartitionListContext) IsWindowPartitionListContext() {} + +func NewWindowPartitionListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WindowPartitionListContext { + var p = new(WindowPartitionListContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_windowPartitionList + + return p +} + +func (s *WindowPartitionListContext) GetParser() antlr.Parser { return s.parser } + +func (s *WindowPartitionListContext) PARTITION() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPARTITION, 0) +} + +func (s *WindowPartitionListContext) BY() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBY, 0) +} + +func (s *WindowPartitionListContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *WindowPartitionListContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *WindowPartitionListContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *WindowPartitionListContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *WindowPartitionListContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *WindowPartitionListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *WindowPartitionListContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterWindowPartitionList(s) + } +} + +func (s *WindowPartitionListContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitWindowPartitionList(s) + } +} + +func (s *WindowPartitionListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitWindowPartitionList(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) WindowPartitionList() (localctx IWindowPartitionListContext) { + localctx = NewWindowPartitionListContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 96, PartiQLParserParserRULE_windowPartitionList) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(665) + p.Match(PartiQLParserParserPARTITION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(666) + p.Match(PartiQLParserParserBY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(667) + p.Expr() + } + p.SetState(672) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(668) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(669) + p.Expr() + } + + p.SetState(674) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IWindowSortSpecListContext is an interface to support dynamic dispatch. +type IWindowSortSpecListContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ORDER() antlr.TerminalNode + BY() antlr.TerminalNode + AllOrderSortSpec() []IOrderSortSpecContext + OrderSortSpec(i int) IOrderSortSpecContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsWindowSortSpecListContext differentiates from other interfaces. + IsWindowSortSpecListContext() +} + +type WindowSortSpecListContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyWindowSortSpecListContext() *WindowSortSpecListContext { + var p = new(WindowSortSpecListContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_windowSortSpecList + return p +} + +func InitEmptyWindowSortSpecListContext(p *WindowSortSpecListContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_windowSortSpecList +} + +func (*WindowSortSpecListContext) IsWindowSortSpecListContext() {} + +func NewWindowSortSpecListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WindowSortSpecListContext { + var p = new(WindowSortSpecListContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_windowSortSpecList + + return p +} + +func (s *WindowSortSpecListContext) GetParser() antlr.Parser { return s.parser } + +func (s *WindowSortSpecListContext) ORDER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserORDER, 0) +} + +func (s *WindowSortSpecListContext) BY() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBY, 0) +} + +func (s *WindowSortSpecListContext) AllOrderSortSpec() []IOrderSortSpecContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IOrderSortSpecContext); ok { + len++ + } + } + + tst := make([]IOrderSortSpecContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IOrderSortSpecContext); ok { + tst[i] = t.(IOrderSortSpecContext) + i++ + } + } + + return tst +} + +func (s *WindowSortSpecListContext) OrderSortSpec(i int) IOrderSortSpecContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOrderSortSpecContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IOrderSortSpecContext) +} + +func (s *WindowSortSpecListContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *WindowSortSpecListContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *WindowSortSpecListContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *WindowSortSpecListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *WindowSortSpecListContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterWindowSortSpecList(s) + } +} + +func (s *WindowSortSpecListContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitWindowSortSpecList(s) + } +} + +func (s *WindowSortSpecListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitWindowSortSpecList(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) WindowSortSpecList() (localctx IWindowSortSpecListContext) { + localctx = NewWindowSortSpecListContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 98, PartiQLParserParserRULE_windowSortSpecList) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(675) + p.Match(PartiQLParserParserORDER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(676) + p.Match(PartiQLParserParserBY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(677) + p.OrderSortSpec() + } + p.SetState(682) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(678) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(679) + p.OrderSortSpec() + } + + p.SetState(684) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IHavingClauseContext is an interface to support dynamic dispatch. +type IHavingClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetArg returns the arg rule contexts. + GetArg() IExprSelectContext + + // SetArg sets the arg rule contexts. + SetArg(IExprSelectContext) + + // Getter signatures + HAVING() antlr.TerminalNode + ExprSelect() IExprSelectContext + + // IsHavingClauseContext differentiates from other interfaces. + IsHavingClauseContext() +} + +type HavingClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + arg IExprSelectContext +} + +func NewEmptyHavingClauseContext() *HavingClauseContext { + var p = new(HavingClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_havingClause + return p +} + +func InitEmptyHavingClauseContext(p *HavingClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_havingClause +} + +func (*HavingClauseContext) IsHavingClauseContext() {} + +func NewHavingClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *HavingClauseContext { + var p = new(HavingClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_havingClause + + return p +} + +func (s *HavingClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *HavingClauseContext) GetArg() IExprSelectContext { return s.arg } + +func (s *HavingClauseContext) SetArg(v IExprSelectContext) { s.arg = v } + +func (s *HavingClauseContext) HAVING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserHAVING, 0) +} + +func (s *HavingClauseContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *HavingClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *HavingClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *HavingClauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterHavingClause(s) + } +} + +func (s *HavingClauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitHavingClause(s) + } +} + +func (s *HavingClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitHavingClause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) HavingClause() (localctx IHavingClauseContext) { + localctx = NewHavingClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 100, PartiQLParserParserRULE_havingClause) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(685) + p.Match(PartiQLParserParserHAVING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(686) + + var _x = p.ExprSelect() + + localctx.(*HavingClauseContext).arg = _x + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IFromClauseContext is an interface to support dynamic dispatch. +type IFromClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + FROM() antlr.TerminalNode + TableReference() ITableReferenceContext + + // IsFromClauseContext differentiates from other interfaces. + IsFromClauseContext() +} + +type FromClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyFromClauseContext() *FromClauseContext { + var p = new(FromClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_fromClause + return p +} + +func InitEmptyFromClauseContext(p *FromClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_fromClause +} + +func (*FromClauseContext) IsFromClauseContext() {} + +func NewFromClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FromClauseContext { + var p = new(FromClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_fromClause + + return p +} + +func (s *FromClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *FromClauseContext) FROM() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFROM, 0) +} + +func (s *FromClauseContext) TableReference() ITableReferenceContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITableReferenceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITableReferenceContext) +} + +func (s *FromClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FromClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *FromClauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterFromClause(s) + } +} + +func (s *FromClauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitFromClause(s) + } +} + +func (s *FromClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitFromClause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) FromClause() (localctx IFromClauseContext) { + localctx = NewFromClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 102, PartiQLParserParserRULE_fromClause) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(688) + p.Match(PartiQLParserParserFROM) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(689) + p.tableReference(0) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IWhereClauseSelectContext is an interface to support dynamic dispatch. +type IWhereClauseSelectContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetArg returns the arg rule contexts. + GetArg() IExprSelectContext + + // SetArg sets the arg rule contexts. + SetArg(IExprSelectContext) + + // Getter signatures + WHERE() antlr.TerminalNode + ExprSelect() IExprSelectContext + + // IsWhereClauseSelectContext differentiates from other interfaces. + IsWhereClauseSelectContext() +} + +type WhereClauseSelectContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + arg IExprSelectContext +} + +func NewEmptyWhereClauseSelectContext() *WhereClauseSelectContext { + var p = new(WhereClauseSelectContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_whereClauseSelect + return p +} + +func InitEmptyWhereClauseSelectContext(p *WhereClauseSelectContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_whereClauseSelect +} + +func (*WhereClauseSelectContext) IsWhereClauseSelectContext() {} + +func NewWhereClauseSelectContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WhereClauseSelectContext { + var p = new(WhereClauseSelectContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_whereClauseSelect + + return p +} + +func (s *WhereClauseSelectContext) GetParser() antlr.Parser { return s.parser } + +func (s *WhereClauseSelectContext) GetArg() IExprSelectContext { return s.arg } + +func (s *WhereClauseSelectContext) SetArg(v IExprSelectContext) { s.arg = v } + +func (s *WhereClauseSelectContext) WHERE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserWHERE, 0) +} + +func (s *WhereClauseSelectContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *WhereClauseSelectContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *WhereClauseSelectContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *WhereClauseSelectContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterWhereClauseSelect(s) + } +} + +func (s *WhereClauseSelectContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitWhereClauseSelect(s) + } +} + +func (s *WhereClauseSelectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitWhereClauseSelect(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) WhereClauseSelect() (localctx IWhereClauseSelectContext) { + localctx = NewWhereClauseSelectContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 104, PartiQLParserParserRULE_whereClauseSelect) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(691) + p.Match(PartiQLParserParserWHERE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(692) + + var _x = p.ExprSelect() + + localctx.(*WhereClauseSelectContext).arg = _x + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IOffsetByClauseContext is an interface to support dynamic dispatch. +type IOffsetByClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetArg returns the arg rule contexts. + GetArg() IExprSelectContext + + // SetArg sets the arg rule contexts. + SetArg(IExprSelectContext) + + // Getter signatures + OFFSET() antlr.TerminalNode + ExprSelect() IExprSelectContext + + // IsOffsetByClauseContext differentiates from other interfaces. + IsOffsetByClauseContext() +} + +type OffsetByClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + arg IExprSelectContext +} + +func NewEmptyOffsetByClauseContext() *OffsetByClauseContext { + var p = new(OffsetByClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_offsetByClause + return p +} + +func InitEmptyOffsetByClauseContext(p *OffsetByClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_offsetByClause +} + +func (*OffsetByClauseContext) IsOffsetByClauseContext() {} + +func NewOffsetByClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OffsetByClauseContext { + var p = new(OffsetByClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_offsetByClause + + return p +} + +func (s *OffsetByClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *OffsetByClauseContext) GetArg() IExprSelectContext { return s.arg } + +func (s *OffsetByClauseContext) SetArg(v IExprSelectContext) { s.arg = v } + +func (s *OffsetByClauseContext) OFFSET() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserOFFSET, 0) +} + +func (s *OffsetByClauseContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *OffsetByClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *OffsetByClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *OffsetByClauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterOffsetByClause(s) + } +} + +func (s *OffsetByClauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitOffsetByClause(s) + } +} + +func (s *OffsetByClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitOffsetByClause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) OffsetByClause() (localctx IOffsetByClauseContext) { + localctx = NewOffsetByClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 106, PartiQLParserParserRULE_offsetByClause) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(694) + p.Match(PartiQLParserParserOFFSET) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(695) + + var _x = p.ExprSelect() + + localctx.(*OffsetByClauseContext).arg = _x + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ILimitClauseContext is an interface to support dynamic dispatch. +type ILimitClauseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetArg returns the arg rule contexts. + GetArg() IExprSelectContext + + // SetArg sets the arg rule contexts. + SetArg(IExprSelectContext) + + // Getter signatures + LIMIT() antlr.TerminalNode + ExprSelect() IExprSelectContext + + // IsLimitClauseContext differentiates from other interfaces. + IsLimitClauseContext() +} + +type LimitClauseContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + arg IExprSelectContext +} + +func NewEmptyLimitClauseContext() *LimitClauseContext { + var p = new(LimitClauseContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_limitClause + return p +} + +func InitEmptyLimitClauseContext(p *LimitClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_limitClause +} + +func (*LimitClauseContext) IsLimitClauseContext() {} + +func NewLimitClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LimitClauseContext { + var p = new(LimitClauseContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_limitClause + + return p +} + +func (s *LimitClauseContext) GetParser() antlr.Parser { return s.parser } + +func (s *LimitClauseContext) GetArg() IExprSelectContext { return s.arg } + +func (s *LimitClauseContext) SetArg(v IExprSelectContext) { s.arg = v } + +func (s *LimitClauseContext) LIMIT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLIMIT, 0) +} + +func (s *LimitClauseContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *LimitClauseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LimitClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LimitClauseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLimitClause(s) + } +} + +func (s *LimitClauseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLimitClause(s) + } +} + +func (s *LimitClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLimitClause(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) LimitClause() (localctx ILimitClauseContext) { + localctx = NewLimitClauseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 108, PartiQLParserParserRULE_limitClause) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(697) + p.Match(PartiQLParserParserLIMIT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(698) + + var _x = p.ExprSelect() + + localctx.(*LimitClauseContext).arg = _x + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IGpmlPatternContext is an interface to support dynamic dispatch. +type IGpmlPatternContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetSelector returns the selector rule contexts. + GetSelector() IMatchSelectorContext + + // SetSelector sets the selector rule contexts. + SetSelector(IMatchSelectorContext) + + // Getter signatures + MatchPattern() IMatchPatternContext + MatchSelector() IMatchSelectorContext + + // IsGpmlPatternContext differentiates from other interfaces. + IsGpmlPatternContext() +} + +type GpmlPatternContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + selector IMatchSelectorContext +} + +func NewEmptyGpmlPatternContext() *GpmlPatternContext { + var p = new(GpmlPatternContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_gpmlPattern + return p +} + +func InitEmptyGpmlPatternContext(p *GpmlPatternContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_gpmlPattern +} + +func (*GpmlPatternContext) IsGpmlPatternContext() {} + +func NewGpmlPatternContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GpmlPatternContext { + var p = new(GpmlPatternContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_gpmlPattern + + return p +} + +func (s *GpmlPatternContext) GetParser() antlr.Parser { return s.parser } + +func (s *GpmlPatternContext) GetSelector() IMatchSelectorContext { return s.selector } + +func (s *GpmlPatternContext) SetSelector(v IMatchSelectorContext) { s.selector = v } + +func (s *GpmlPatternContext) MatchPattern() IMatchPatternContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMatchPatternContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMatchPatternContext) +} + +func (s *GpmlPatternContext) MatchSelector() IMatchSelectorContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMatchSelectorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMatchSelectorContext) +} + +func (s *GpmlPatternContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *GpmlPatternContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *GpmlPatternContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterGpmlPattern(s) + } +} + +func (s *GpmlPatternContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitGpmlPattern(s) + } +} + +func (s *GpmlPatternContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitGpmlPattern(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) GpmlPattern() (localctx IGpmlPatternContext) { + localctx = NewGpmlPatternContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 110, PartiQLParserParserRULE_gpmlPattern) + p.EnterOuterAlt(localctx, 1) + p.SetState(701) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 65, p.GetParserRuleContext()) == 1 { + { + p.SetState(700) + + var _x = p.MatchSelector() + + localctx.(*GpmlPatternContext).selector = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + { + p.SetState(703) + p.MatchPattern() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IGpmlPatternListContext is an interface to support dynamic dispatch. +type IGpmlPatternListContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetSelector returns the selector rule contexts. + GetSelector() IMatchSelectorContext + + // SetSelector sets the selector rule contexts. + SetSelector(IMatchSelectorContext) + + // Getter signatures + AllMatchPattern() []IMatchPatternContext + MatchPattern(i int) IMatchPatternContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + MatchSelector() IMatchSelectorContext + + // IsGpmlPatternListContext differentiates from other interfaces. + IsGpmlPatternListContext() +} + +type GpmlPatternListContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + selector IMatchSelectorContext +} + +func NewEmptyGpmlPatternListContext() *GpmlPatternListContext { + var p = new(GpmlPatternListContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_gpmlPatternList + return p +} + +func InitEmptyGpmlPatternListContext(p *GpmlPatternListContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_gpmlPatternList +} + +func (*GpmlPatternListContext) IsGpmlPatternListContext() {} + +func NewGpmlPatternListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GpmlPatternListContext { + var p = new(GpmlPatternListContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_gpmlPatternList + + return p +} + +func (s *GpmlPatternListContext) GetParser() antlr.Parser { return s.parser } + +func (s *GpmlPatternListContext) GetSelector() IMatchSelectorContext { return s.selector } + +func (s *GpmlPatternListContext) SetSelector(v IMatchSelectorContext) { s.selector = v } + +func (s *GpmlPatternListContext) AllMatchPattern() []IMatchPatternContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IMatchPatternContext); ok { + len++ + } + } + + tst := make([]IMatchPatternContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IMatchPatternContext); ok { + tst[i] = t.(IMatchPatternContext) + i++ + } + } + + return tst +} + +func (s *GpmlPatternListContext) MatchPattern(i int) IMatchPatternContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMatchPatternContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IMatchPatternContext) +} + +func (s *GpmlPatternListContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *GpmlPatternListContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *GpmlPatternListContext) MatchSelector() IMatchSelectorContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMatchSelectorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMatchSelectorContext) +} + +func (s *GpmlPatternListContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *GpmlPatternListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *GpmlPatternListContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterGpmlPatternList(s) + } +} + +func (s *GpmlPatternListContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitGpmlPatternList(s) + } +} + +func (s *GpmlPatternListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitGpmlPatternList(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) GpmlPatternList() (localctx IGpmlPatternListContext) { + localctx = NewGpmlPatternListContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 112, PartiQLParserParserRULE_gpmlPatternList) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(706) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserALL || _la == PartiQLParserParserANY || _la == PartiQLParserParserSHORTEST { + { + p.SetState(705) + + var _x = p.MatchSelector() + + localctx.(*GpmlPatternListContext).selector = _x + } + + } + { + p.SetState(708) + p.MatchPattern() + } + p.SetState(713) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(709) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(710) + p.MatchPattern() + } + + p.SetState(715) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IMatchPatternContext is an interface to support dynamic dispatch. +type IMatchPatternContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetRestrictor returns the restrictor rule contexts. + GetRestrictor() IPatternRestrictorContext + + // GetVariable returns the variable rule contexts. + GetVariable() IPatternPathVariableContext + + // SetRestrictor sets the restrictor rule contexts. + SetRestrictor(IPatternRestrictorContext) + + // SetVariable sets the variable rule contexts. + SetVariable(IPatternPathVariableContext) + + // Getter signatures + AllGraphPart() []IGraphPartContext + GraphPart(i int) IGraphPartContext + PatternRestrictor() IPatternRestrictorContext + PatternPathVariable() IPatternPathVariableContext + + // IsMatchPatternContext differentiates from other interfaces. + IsMatchPatternContext() +} + +type MatchPatternContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + restrictor IPatternRestrictorContext + variable IPatternPathVariableContext +} + +func NewEmptyMatchPatternContext() *MatchPatternContext { + var p = new(MatchPatternContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_matchPattern + return p +} + +func InitEmptyMatchPatternContext(p *MatchPatternContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_matchPattern +} + +func (*MatchPatternContext) IsMatchPatternContext() {} + +func NewMatchPatternContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MatchPatternContext { + var p = new(MatchPatternContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_matchPattern + + return p +} + +func (s *MatchPatternContext) GetParser() antlr.Parser { return s.parser } + +func (s *MatchPatternContext) GetRestrictor() IPatternRestrictorContext { return s.restrictor } + +func (s *MatchPatternContext) GetVariable() IPatternPathVariableContext { return s.variable } + +func (s *MatchPatternContext) SetRestrictor(v IPatternRestrictorContext) { s.restrictor = v } + +func (s *MatchPatternContext) SetVariable(v IPatternPathVariableContext) { s.variable = v } + +func (s *MatchPatternContext) AllGraphPart() []IGraphPartContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IGraphPartContext); ok { + len++ + } + } + + tst := make([]IGraphPartContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IGraphPartContext); ok { + tst[i] = t.(IGraphPartContext) + i++ + } + } + + return tst +} + +func (s *MatchPatternContext) GraphPart(i int) IGraphPartContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGraphPartContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IGraphPartContext) +} + +func (s *MatchPatternContext) PatternRestrictor() IPatternRestrictorContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPatternRestrictorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPatternRestrictorContext) +} + +func (s *MatchPatternContext) PatternPathVariable() IPatternPathVariableContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPatternPathVariableContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPatternPathVariableContext) +} + +func (s *MatchPatternContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MatchPatternContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MatchPatternContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterMatchPattern(s) + } +} + +func (s *MatchPatternContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitMatchPattern(s) + } +} + +func (s *MatchPatternContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitMatchPattern(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) MatchPattern() (localctx IMatchPatternContext) { + localctx = NewMatchPatternContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 114, PartiQLParserParserRULE_matchPattern) + var _alt int + + p.EnterOuterAlt(localctx, 1) + p.SetState(717) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 68, p.GetParserRuleContext()) == 1 { + { + p.SetState(716) + + var _x = p.PatternRestrictor() + + localctx.(*MatchPatternContext).restrictor = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(720) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 69, p.GetParserRuleContext()) == 1 { + { + p.SetState(719) + + var _x = p.PatternPathVariable() + + localctx.(*MatchPatternContext).variable = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(725) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 70, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(722) + p.GraphPart() + } + + } + p.SetState(727) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 70, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IGraphPartContext is an interface to support dynamic dispatch. +type IGraphPartContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Node() INodeContext + Edge() IEdgeContext + Pattern() IPatternContext + + // IsGraphPartContext differentiates from other interfaces. + IsGraphPartContext() +} + +type GraphPartContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyGraphPartContext() *GraphPartContext { + var p = new(GraphPartContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_graphPart + return p +} + +func InitEmptyGraphPartContext(p *GraphPartContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_graphPart +} + +func (*GraphPartContext) IsGraphPartContext() {} + +func NewGraphPartContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GraphPartContext { + var p = new(GraphPartContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_graphPart + + return p +} + +func (s *GraphPartContext) GetParser() antlr.Parser { return s.parser } + +func (s *GraphPartContext) Node() INodeContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INodeContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(INodeContext) +} + +func (s *GraphPartContext) Edge() IEdgeContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEdgeContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEdgeContext) +} + +func (s *GraphPartContext) Pattern() IPatternContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPatternContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPatternContext) +} + +func (s *GraphPartContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *GraphPartContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *GraphPartContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterGraphPart(s) + } +} + +func (s *GraphPartContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitGraphPart(s) + } +} + +func (s *GraphPartContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitGraphPart(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) GraphPart() (localctx IGraphPartContext) { + localctx = NewGraphPartContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 116, PartiQLParserParserRULE_graphPart) + p.SetState(731) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 71, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(728) + p.Node() + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(729) + p.Edge() + } + + case 3: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(730) + p.Pattern() + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IMatchSelectorContext is an interface to support dynamic dispatch. +type IMatchSelectorContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsMatchSelectorContext differentiates from other interfaces. + IsMatchSelectorContext() +} + +type MatchSelectorContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyMatchSelectorContext() *MatchSelectorContext { + var p = new(MatchSelectorContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_matchSelector + return p +} + +func InitEmptyMatchSelectorContext(p *MatchSelectorContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_matchSelector +} + +func (*MatchSelectorContext) IsMatchSelectorContext() {} + +func NewMatchSelectorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MatchSelectorContext { + var p = new(MatchSelectorContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_matchSelector + + return p +} + +func (s *MatchSelectorContext) GetParser() antlr.Parser { return s.parser } + +func (s *MatchSelectorContext) CopyAll(ctx *MatchSelectorContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *MatchSelectorContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MatchSelectorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type SelectorAnyContext struct { + MatchSelectorContext + k antlr.Token +} + +func NewSelectorAnyContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectorAnyContext { + var p = new(SelectorAnyContext) + + InitEmptyMatchSelectorContext(&p.MatchSelectorContext) + p.parser = parser + p.CopyAll(ctx.(*MatchSelectorContext)) + + return p +} + +func (s *SelectorAnyContext) GetK() antlr.Token { return s.k } + +func (s *SelectorAnyContext) SetK(v antlr.Token) { s.k = v } + +func (s *SelectorAnyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SelectorAnyContext) ANY() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANY, 0) +} + +func (s *SelectorAnyContext) LITERAL_INTEGER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_INTEGER, 0) +} + +func (s *SelectorAnyContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSelectorAny(s) + } +} + +func (s *SelectorAnyContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSelectorAny(s) + } +} + +func (s *SelectorAnyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSelectorAny(s) + + default: + return t.VisitChildren(s) + } +} + +type SelectorShortestContext struct { + MatchSelectorContext + k antlr.Token +} + +func NewSelectorShortestContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectorShortestContext { + var p = new(SelectorShortestContext) + + InitEmptyMatchSelectorContext(&p.MatchSelectorContext) + p.parser = parser + p.CopyAll(ctx.(*MatchSelectorContext)) + + return p +} + +func (s *SelectorShortestContext) GetK() antlr.Token { return s.k } + +func (s *SelectorShortestContext) SetK(v antlr.Token) { s.k = v } + +func (s *SelectorShortestContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SelectorShortestContext) SHORTEST() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSHORTEST, 0) +} + +func (s *SelectorShortestContext) LITERAL_INTEGER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_INTEGER, 0) +} + +func (s *SelectorShortestContext) GROUP() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserGROUP, 0) +} + +func (s *SelectorShortestContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSelectorShortest(s) + } +} + +func (s *SelectorShortestContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSelectorShortest(s) + } +} + +func (s *SelectorShortestContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSelectorShortest(s) + + default: + return t.VisitChildren(s) + } +} + +type SelectorBasicContext struct { + MatchSelectorContext + mod antlr.Token +} + +func NewSelectorBasicContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectorBasicContext { + var p = new(SelectorBasicContext) + + InitEmptyMatchSelectorContext(&p.MatchSelectorContext) + p.parser = parser + p.CopyAll(ctx.(*MatchSelectorContext)) + + return p +} + +func (s *SelectorBasicContext) GetMod() antlr.Token { return s.mod } + +func (s *SelectorBasicContext) SetMod(v antlr.Token) { s.mod = v } + +func (s *SelectorBasicContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SelectorBasicContext) SHORTEST() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSHORTEST, 0) +} + +func (s *SelectorBasicContext) ANY() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANY, 0) +} + +func (s *SelectorBasicContext) ALL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserALL, 0) +} + +func (s *SelectorBasicContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSelectorBasic(s) + } +} + +func (s *SelectorBasicContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSelectorBasic(s) + } +} + +func (s *SelectorBasicContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSelectorBasic(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) MatchSelector() (localctx IMatchSelectorContext) { + localctx = NewMatchSelectorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 118, PartiQLParserParserRULE_matchSelector) + var _la int + + p.SetState(744) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 74, p.GetParserRuleContext()) { + case 1: + localctx = NewSelectorBasicContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(733) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*SelectorBasicContext).mod = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserALL || _la == PartiQLParserParserANY) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*SelectorBasicContext).mod = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(734) + p.Match(PartiQLParserParserSHORTEST) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + localctx = NewSelectorAnyContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(735) + p.Match(PartiQLParserParserANY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(737) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 72, p.GetParserRuleContext()) == 1 { + { + p.SetState(736) + + var _m = p.Match(PartiQLParserParserLITERAL_INTEGER) + + localctx.(*SelectorAnyContext).k = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case 3: + localctx = NewSelectorShortestContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(739) + p.Match(PartiQLParserParserSHORTEST) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(740) + + var _m = p.Match(PartiQLParserParserLITERAL_INTEGER) + + localctx.(*SelectorShortestContext).k = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(742) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 73, p.GetParserRuleContext()) == 1 { + { + p.SetState(741) + p.Match(PartiQLParserParserGROUP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IPatternPathVariableContext is an interface to support dynamic dispatch. +type IPatternPathVariableContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SymbolPrimitive() ISymbolPrimitiveContext + EQ() antlr.TerminalNode + + // IsPatternPathVariableContext differentiates from other interfaces. + IsPatternPathVariableContext() +} + +type PatternPathVariableContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyPatternPathVariableContext() *PatternPathVariableContext { + var p = new(PatternPathVariableContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_patternPathVariable + return p +} + +func InitEmptyPatternPathVariableContext(p *PatternPathVariableContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_patternPathVariable +} + +func (*PatternPathVariableContext) IsPatternPathVariableContext() {} + +func NewPatternPathVariableContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PatternPathVariableContext { + var p = new(PatternPathVariableContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_patternPathVariable + + return p +} + +func (s *PatternPathVariableContext) GetParser() antlr.Parser { return s.parser } + +func (s *PatternPathVariableContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *PatternPathVariableContext) EQ() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEQ, 0) +} + +func (s *PatternPathVariableContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PatternPathVariableContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *PatternPathVariableContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPatternPathVariable(s) + } +} + +func (s *PatternPathVariableContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPatternPathVariable(s) + } +} + +func (s *PatternPathVariableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPatternPathVariable(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) PatternPathVariable() (localctx IPatternPathVariableContext) { + localctx = NewPatternPathVariableContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 120, PartiQLParserParserRULE_patternPathVariable) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(746) + p.SymbolPrimitive() + } + { + p.SetState(747) + p.Match(PartiQLParserParserEQ) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IPatternRestrictorContext is an interface to support dynamic dispatch. +type IPatternRestrictorContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetRestrictor returns the restrictor token. + GetRestrictor() antlr.Token + + // SetRestrictor sets the restrictor token. + SetRestrictor(antlr.Token) + + // Getter signatures + IDENTIFIER() antlr.TerminalNode + + // IsPatternRestrictorContext differentiates from other interfaces. + IsPatternRestrictorContext() +} + +type PatternRestrictorContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + restrictor antlr.Token +} + +func NewEmptyPatternRestrictorContext() *PatternRestrictorContext { + var p = new(PatternRestrictorContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_patternRestrictor + return p +} + +func InitEmptyPatternRestrictorContext(p *PatternRestrictorContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_patternRestrictor +} + +func (*PatternRestrictorContext) IsPatternRestrictorContext() {} + +func NewPatternRestrictorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PatternRestrictorContext { + var p = new(PatternRestrictorContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_patternRestrictor + + return p +} + +func (s *PatternRestrictorContext) GetParser() antlr.Parser { return s.parser } + +func (s *PatternRestrictorContext) GetRestrictor() antlr.Token { return s.restrictor } + +func (s *PatternRestrictorContext) SetRestrictor(v antlr.Token) { s.restrictor = v } + +func (s *PatternRestrictorContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIDENTIFIER, 0) +} + +func (s *PatternRestrictorContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PatternRestrictorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *PatternRestrictorContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPatternRestrictor(s) + } +} + +func (s *PatternRestrictorContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPatternRestrictor(s) + } +} + +func (s *PatternRestrictorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPatternRestrictor(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) PatternRestrictor() (localctx IPatternRestrictorContext) { + localctx = NewPatternRestrictorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 122, PartiQLParserParserRULE_patternRestrictor) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(749) + + var _m = p.Match(PartiQLParserParserIDENTIFIER) + + localctx.(*PatternRestrictorContext).restrictor = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// INodeContext is an interface to support dynamic dispatch. +type INodeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + PAREN_LEFT() antlr.TerminalNode + PAREN_RIGHT() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + PatternPartLabel() IPatternPartLabelContext + WhereClause() IWhereClauseContext + + // IsNodeContext differentiates from other interfaces. + IsNodeContext() +} + +type NodeContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyNodeContext() *NodeContext { + var p = new(NodeContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_node + return p +} + +func InitEmptyNodeContext(p *NodeContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_node +} + +func (*NodeContext) IsNodeContext() {} + +func NewNodeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NodeContext { + var p = new(NodeContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_node + + return p +} + +func (s *NodeContext) GetParser() antlr.Parser { return s.parser } + +func (s *NodeContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *NodeContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *NodeContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *NodeContext) PatternPartLabel() IPatternPartLabelContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPatternPartLabelContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPatternPartLabelContext) +} + +func (s *NodeContext) WhereClause() IWhereClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWhereClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IWhereClauseContext) +} + +func (s *NodeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NodeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *NodeContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterNode(s) + } +} + +func (s *NodeContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitNode(s) + } +} + +func (s *NodeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitNode(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Node() (localctx INodeContext) { + localctx = NewNodeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 124, PartiQLParserParserRULE_node) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(751) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(753) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserIDENTIFIER || _la == PartiQLParserParserIDENTIFIER_QUOTED { + { + p.SetState(752) + p.SymbolPrimitive() + } + + } + p.SetState(756) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserCOLON { + { + p.SetState(755) + p.PatternPartLabel() + } + + } + p.SetState(759) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserWHERE { + { + p.SetState(758) + p.WhereClause() + } + + } + { + p.SetState(761) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IEdgeContext is an interface to support dynamic dispatch. +type IEdgeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsEdgeContext differentiates from other interfaces. + IsEdgeContext() +} + +type EdgeContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyEdgeContext() *EdgeContext { + var p = new(EdgeContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_edge + return p +} + +func InitEmptyEdgeContext(p *EdgeContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_edge +} + +func (*EdgeContext) IsEdgeContext() {} + +func NewEdgeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EdgeContext { + var p = new(EdgeContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_edge + + return p +} + +func (s *EdgeContext) GetParser() antlr.Parser { return s.parser } + +func (s *EdgeContext) CopyAll(ctx *EdgeContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *EdgeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type EdgeWithSpecContext struct { + EdgeContext + quantifier IPatternQuantifierContext +} + +func NewEdgeWithSpecContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EdgeWithSpecContext { + var p = new(EdgeWithSpecContext) + + InitEmptyEdgeContext(&p.EdgeContext) + p.parser = parser + p.CopyAll(ctx.(*EdgeContext)) + + return p +} + +func (s *EdgeWithSpecContext) GetQuantifier() IPatternQuantifierContext { return s.quantifier } + +func (s *EdgeWithSpecContext) SetQuantifier(v IPatternQuantifierContext) { s.quantifier = v } + +func (s *EdgeWithSpecContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeWithSpecContext) EdgeWSpec() IEdgeWSpecContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEdgeWSpecContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEdgeWSpecContext) +} + +func (s *EdgeWithSpecContext) PatternQuantifier() IPatternQuantifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPatternQuantifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPatternQuantifierContext) +} + +func (s *EdgeWithSpecContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeWithSpec(s) + } +} + +func (s *EdgeWithSpecContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeWithSpec(s) + } +} + +func (s *EdgeWithSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeWithSpec(s) + + default: + return t.VisitChildren(s) + } +} + +type EdgeAbbreviatedContext struct { + EdgeContext + quantifier IPatternQuantifierContext +} + +func NewEdgeAbbreviatedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EdgeAbbreviatedContext { + var p = new(EdgeAbbreviatedContext) + + InitEmptyEdgeContext(&p.EdgeContext) + p.parser = parser + p.CopyAll(ctx.(*EdgeContext)) + + return p +} + +func (s *EdgeAbbreviatedContext) GetQuantifier() IPatternQuantifierContext { return s.quantifier } + +func (s *EdgeAbbreviatedContext) SetQuantifier(v IPatternQuantifierContext) { s.quantifier = v } + +func (s *EdgeAbbreviatedContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeAbbreviatedContext) EdgeAbbrev() IEdgeAbbrevContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEdgeAbbrevContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEdgeAbbrevContext) +} + +func (s *EdgeAbbreviatedContext) PatternQuantifier() IPatternQuantifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPatternQuantifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPatternQuantifierContext) +} + +func (s *EdgeAbbreviatedContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeAbbreviated(s) + } +} + +func (s *EdgeAbbreviatedContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeAbbreviated(s) + } +} + +func (s *EdgeAbbreviatedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeAbbreviated(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Edge() (localctx IEdgeContext) { + localctx = NewEdgeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 126, PartiQLParserParserRULE_edge) + p.SetState(771) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 80, p.GetParserRuleContext()) { + case 1: + localctx = NewEdgeWithSpecContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(763) + p.EdgeWSpec() + } + p.SetState(765) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 78, p.GetParserRuleContext()) == 1 { + { + p.SetState(764) + + var _x = p.PatternQuantifier() + + localctx.(*EdgeWithSpecContext).quantifier = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case 2: + localctx = NewEdgeAbbreviatedContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(767) + p.EdgeAbbrev() + } + p.SetState(769) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 79, p.GetParserRuleContext()) == 1 { + { + p.SetState(768) + + var _x = p.PatternQuantifier() + + localctx.(*EdgeAbbreviatedContext).quantifier = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IPatternContext is an interface to support dynamic dispatch. +type IPatternContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetRestrictor returns the restrictor rule contexts. + GetRestrictor() IPatternRestrictorContext + + // GetVariable returns the variable rule contexts. + GetVariable() IPatternPathVariableContext + + // GetWhere returns the where rule contexts. + GetWhere() IWhereClauseContext + + // GetQuantifier returns the quantifier rule contexts. + GetQuantifier() IPatternQuantifierContext + + // SetRestrictor sets the restrictor rule contexts. + SetRestrictor(IPatternRestrictorContext) + + // SetVariable sets the variable rule contexts. + SetVariable(IPatternPathVariableContext) + + // SetWhere sets the where rule contexts. + SetWhere(IWhereClauseContext) + + // SetQuantifier sets the quantifier rule contexts. + SetQuantifier(IPatternQuantifierContext) + + // Getter signatures + PAREN_LEFT() antlr.TerminalNode + PAREN_RIGHT() antlr.TerminalNode + AllGraphPart() []IGraphPartContext + GraphPart(i int) IGraphPartContext + PatternRestrictor() IPatternRestrictorContext + PatternPathVariable() IPatternPathVariableContext + WhereClause() IWhereClauseContext + PatternQuantifier() IPatternQuantifierContext + BRACKET_LEFT() antlr.TerminalNode + BRACKET_RIGHT() antlr.TerminalNode + + // IsPatternContext differentiates from other interfaces. + IsPatternContext() +} + +type PatternContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + restrictor IPatternRestrictorContext + variable IPatternPathVariableContext + where IWhereClauseContext + quantifier IPatternQuantifierContext +} + +func NewEmptyPatternContext() *PatternContext { + var p = new(PatternContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_pattern + return p +} + +func InitEmptyPatternContext(p *PatternContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_pattern +} + +func (*PatternContext) IsPatternContext() {} + +func NewPatternContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PatternContext { + var p = new(PatternContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_pattern + + return p +} + +func (s *PatternContext) GetParser() antlr.Parser { return s.parser } + +func (s *PatternContext) GetRestrictor() IPatternRestrictorContext { return s.restrictor } + +func (s *PatternContext) GetVariable() IPatternPathVariableContext { return s.variable } + +func (s *PatternContext) GetWhere() IWhereClauseContext { return s.where } + +func (s *PatternContext) GetQuantifier() IPatternQuantifierContext { return s.quantifier } + +func (s *PatternContext) SetRestrictor(v IPatternRestrictorContext) { s.restrictor = v } + +func (s *PatternContext) SetVariable(v IPatternPathVariableContext) { s.variable = v } + +func (s *PatternContext) SetWhere(v IWhereClauseContext) { s.where = v } + +func (s *PatternContext) SetQuantifier(v IPatternQuantifierContext) { s.quantifier = v } + +func (s *PatternContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *PatternContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *PatternContext) AllGraphPart() []IGraphPartContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IGraphPartContext); ok { + len++ + } + } + + tst := make([]IGraphPartContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IGraphPartContext); ok { + tst[i] = t.(IGraphPartContext) + i++ + } + } + + return tst +} + +func (s *PatternContext) GraphPart(i int) IGraphPartContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGraphPartContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IGraphPartContext) +} + +func (s *PatternContext) PatternRestrictor() IPatternRestrictorContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPatternRestrictorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPatternRestrictorContext) +} + +func (s *PatternContext) PatternPathVariable() IPatternPathVariableContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPatternPathVariableContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPatternPathVariableContext) +} + +func (s *PatternContext) WhereClause() IWhereClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWhereClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IWhereClauseContext) +} + +func (s *PatternContext) PatternQuantifier() IPatternQuantifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPatternQuantifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPatternQuantifierContext) +} + +func (s *PatternContext) BRACKET_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_LEFT, 0) +} + +func (s *PatternContext) BRACKET_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_RIGHT, 0) +} + +func (s *PatternContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PatternContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *PatternContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPattern(s) + } +} + +func (s *PatternContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPattern(s) + } +} + +func (s *PatternContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPattern(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Pattern() (localctx IPatternContext) { + localctx = NewPatternContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 128, PartiQLParserParserRULE_pattern) + var _la int + + p.SetState(811) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserPAREN_LEFT: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(773) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(775) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 81, p.GetParserRuleContext()) == 1 { + { + p.SetState(774) + + var _x = p.PatternRestrictor() + + localctx.(*PatternContext).restrictor = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(778) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserIDENTIFIER || _la == PartiQLParserParserIDENTIFIER_QUOTED { + { + p.SetState(777) + + var _x = p.PatternPathVariable() + + localctx.(*PatternContext).variable = _x + } + + } + p.SetState(781) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = ((int64((_la-270)) & ^0x3f) == 0 && ((int64(1)<<(_la-270))&559121) != 0) { + { + p.SetState(780) + p.GraphPart() + } + + p.SetState(783) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(786) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserWHERE { + { + p.SetState(785) + + var _x = p.WhereClause() + + localctx.(*PatternContext).where = _x + } + + } + { + p.SetState(788) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(790) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 85, p.GetParserRuleContext()) == 1 { + { + p.SetState(789) + + var _x = p.PatternQuantifier() + + localctx.(*PatternContext).quantifier = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case PartiQLParserParserBRACKET_LEFT: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(792) + p.Match(PartiQLParserParserBRACKET_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(794) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 86, p.GetParserRuleContext()) == 1 { + { + p.SetState(793) + + var _x = p.PatternRestrictor() + + localctx.(*PatternContext).restrictor = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(797) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserIDENTIFIER || _la == PartiQLParserParserIDENTIFIER_QUOTED { + { + p.SetState(796) + + var _x = p.PatternPathVariable() + + localctx.(*PatternContext).variable = _x + } + + } + p.SetState(800) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = ((int64((_la-270)) & ^0x3f) == 0 && ((int64(1)<<(_la-270))&559121) != 0) { + { + p.SetState(799) + p.GraphPart() + } + + p.SetState(802) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(805) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserWHERE { + { + p.SetState(804) + + var _x = p.WhereClause() + + localctx.(*PatternContext).where = _x + } + + } + { + p.SetState(807) + p.Match(PartiQLParserParserBRACKET_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(809) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 90, p.GetParserRuleContext()) == 1 { + { + p.SetState(808) + + var _x = p.PatternQuantifier() + + localctx.(*PatternContext).quantifier = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IPatternQuantifierContext is an interface to support dynamic dispatch. +type IPatternQuantifierContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetQuant returns the quant token. + GetQuant() antlr.Token + + // GetLower returns the lower token. + GetLower() antlr.Token + + // GetUpper returns the upper token. + GetUpper() antlr.Token + + // SetQuant sets the quant token. + SetQuant(antlr.Token) + + // SetLower sets the lower token. + SetLower(antlr.Token) + + // SetUpper sets the upper token. + SetUpper(antlr.Token) + + // Getter signatures + PLUS() antlr.TerminalNode + ASTERISK() antlr.TerminalNode + BRACE_LEFT() antlr.TerminalNode + COMMA() antlr.TerminalNode + BRACE_RIGHT() antlr.TerminalNode + AllLITERAL_INTEGER() []antlr.TerminalNode + LITERAL_INTEGER(i int) antlr.TerminalNode + + // IsPatternQuantifierContext differentiates from other interfaces. + IsPatternQuantifierContext() +} + +type PatternQuantifierContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + quant antlr.Token + lower antlr.Token + upper antlr.Token +} + +func NewEmptyPatternQuantifierContext() *PatternQuantifierContext { + var p = new(PatternQuantifierContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_patternQuantifier + return p +} + +func InitEmptyPatternQuantifierContext(p *PatternQuantifierContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_patternQuantifier +} + +func (*PatternQuantifierContext) IsPatternQuantifierContext() {} + +func NewPatternQuantifierContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PatternQuantifierContext { + var p = new(PatternQuantifierContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_patternQuantifier + + return p +} + +func (s *PatternQuantifierContext) GetParser() antlr.Parser { return s.parser } + +func (s *PatternQuantifierContext) GetQuant() antlr.Token { return s.quant } + +func (s *PatternQuantifierContext) GetLower() antlr.Token { return s.lower } + +func (s *PatternQuantifierContext) GetUpper() antlr.Token { return s.upper } + +func (s *PatternQuantifierContext) SetQuant(v antlr.Token) { s.quant = v } + +func (s *PatternQuantifierContext) SetLower(v antlr.Token) { s.lower = v } + +func (s *PatternQuantifierContext) SetUpper(v antlr.Token) { s.upper = v } + +func (s *PatternQuantifierContext) PLUS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPLUS, 0) +} + +func (s *PatternQuantifierContext) ASTERISK() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserASTERISK, 0) +} + +func (s *PatternQuantifierContext) BRACE_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACE_LEFT, 0) +} + +func (s *PatternQuantifierContext) COMMA() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, 0) +} + +func (s *PatternQuantifierContext) BRACE_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACE_RIGHT, 0) +} + +func (s *PatternQuantifierContext) AllLITERAL_INTEGER() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserLITERAL_INTEGER) +} + +func (s *PatternQuantifierContext) LITERAL_INTEGER(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_INTEGER, i) +} + +func (s *PatternQuantifierContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PatternQuantifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *PatternQuantifierContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPatternQuantifier(s) + } +} + +func (s *PatternQuantifierContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPatternQuantifier(s) + } +} + +func (s *PatternQuantifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPatternQuantifier(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) PatternQuantifier() (localctx IPatternQuantifierContext) { + localctx = NewPatternQuantifierContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 130, PartiQLParserParserRULE_patternQuantifier) + var _la int + + p.SetState(821) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserPLUS, PartiQLParserParserASTERISK: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(813) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*PatternQuantifierContext).quant = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserPLUS || _la == PartiQLParserParserASTERISK) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*PatternQuantifierContext).quant = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + case PartiQLParserParserBRACE_LEFT: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(814) + p.Match(PartiQLParserParserBRACE_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(815) + + var _m = p.Match(PartiQLParserParserLITERAL_INTEGER) + + localctx.(*PatternQuantifierContext).lower = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(816) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(818) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserLITERAL_INTEGER { + { + p.SetState(817) + + var _m = p.Match(PartiQLParserParserLITERAL_INTEGER) + + localctx.(*PatternQuantifierContext).upper = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(820) + p.Match(PartiQLParserParserBRACE_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IEdgeWSpecContext is an interface to support dynamic dispatch. +type IEdgeWSpecContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsEdgeWSpecContext differentiates from other interfaces. + IsEdgeWSpecContext() +} + +type EdgeWSpecContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyEdgeWSpecContext() *EdgeWSpecContext { + var p = new(EdgeWSpecContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_edgeWSpec + return p +} + +func InitEmptyEdgeWSpecContext(p *EdgeWSpecContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_edgeWSpec +} + +func (*EdgeWSpecContext) IsEdgeWSpecContext() {} + +func NewEdgeWSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EdgeWSpecContext { + var p = new(EdgeWSpecContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_edgeWSpec + + return p +} + +func (s *EdgeWSpecContext) GetParser() antlr.Parser { return s.parser } + +func (s *EdgeWSpecContext) CopyAll(ctx *EdgeWSpecContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *EdgeWSpecContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeWSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type EdgeSpecLeftContext struct { + EdgeWSpecContext +} + +func NewEdgeSpecLeftContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EdgeSpecLeftContext { + var p = new(EdgeSpecLeftContext) + + InitEmptyEdgeWSpecContext(&p.EdgeWSpecContext) + p.parser = parser + p.CopyAll(ctx.(*EdgeWSpecContext)) + + return p +} + +func (s *EdgeSpecLeftContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeSpecLeftContext) ANGLE_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_LEFT, 0) +} + +func (s *EdgeSpecLeftContext) AllMINUS() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserMINUS) +} + +func (s *EdgeSpecLeftContext) MINUS(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMINUS, i) +} + +func (s *EdgeSpecLeftContext) EdgeSpec() IEdgeSpecContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEdgeSpecContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEdgeSpecContext) +} + +func (s *EdgeSpecLeftContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeSpecLeft(s) + } +} + +func (s *EdgeSpecLeftContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeSpecLeft(s) + } +} + +func (s *EdgeSpecLeftContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeSpecLeft(s) + + default: + return t.VisitChildren(s) + } +} + +type EdgeSpecUndirectedLeftContext struct { + EdgeWSpecContext +} + +func NewEdgeSpecUndirectedLeftContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EdgeSpecUndirectedLeftContext { + var p = new(EdgeSpecUndirectedLeftContext) + + InitEmptyEdgeWSpecContext(&p.EdgeWSpecContext) + p.parser = parser + p.CopyAll(ctx.(*EdgeWSpecContext)) + + return p +} + +func (s *EdgeSpecUndirectedLeftContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeSpecUndirectedLeftContext) ANGLE_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_LEFT, 0) +} + +func (s *EdgeSpecUndirectedLeftContext) AllTILDE() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserTILDE) +} + +func (s *EdgeSpecUndirectedLeftContext) TILDE(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTILDE, i) +} + +func (s *EdgeSpecUndirectedLeftContext) EdgeSpec() IEdgeSpecContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEdgeSpecContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEdgeSpecContext) +} + +func (s *EdgeSpecUndirectedLeftContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeSpecUndirectedLeft(s) + } +} + +func (s *EdgeSpecUndirectedLeftContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeSpecUndirectedLeft(s) + } +} + +func (s *EdgeSpecUndirectedLeftContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeSpecUndirectedLeft(s) + + default: + return t.VisitChildren(s) + } +} + +type EdgeSpecBidirectionalContext struct { + EdgeWSpecContext +} + +func NewEdgeSpecBidirectionalContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EdgeSpecBidirectionalContext { + var p = new(EdgeSpecBidirectionalContext) + + InitEmptyEdgeWSpecContext(&p.EdgeWSpecContext) + p.parser = parser + p.CopyAll(ctx.(*EdgeWSpecContext)) + + return p +} + +func (s *EdgeSpecBidirectionalContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeSpecBidirectionalContext) ANGLE_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_LEFT, 0) +} + +func (s *EdgeSpecBidirectionalContext) AllMINUS() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserMINUS) +} + +func (s *EdgeSpecBidirectionalContext) MINUS(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMINUS, i) +} + +func (s *EdgeSpecBidirectionalContext) EdgeSpec() IEdgeSpecContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEdgeSpecContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEdgeSpecContext) +} + +func (s *EdgeSpecBidirectionalContext) ANGLE_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_RIGHT, 0) +} + +func (s *EdgeSpecBidirectionalContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeSpecBidirectional(s) + } +} + +func (s *EdgeSpecBidirectionalContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeSpecBidirectional(s) + } +} + +func (s *EdgeSpecBidirectionalContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeSpecBidirectional(s) + + default: + return t.VisitChildren(s) + } +} + +type EdgeSpecRightContext struct { + EdgeWSpecContext +} + +func NewEdgeSpecRightContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EdgeSpecRightContext { + var p = new(EdgeSpecRightContext) + + InitEmptyEdgeWSpecContext(&p.EdgeWSpecContext) + p.parser = parser + p.CopyAll(ctx.(*EdgeWSpecContext)) + + return p +} + +func (s *EdgeSpecRightContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeSpecRightContext) AllMINUS() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserMINUS) +} + +func (s *EdgeSpecRightContext) MINUS(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMINUS, i) +} + +func (s *EdgeSpecRightContext) EdgeSpec() IEdgeSpecContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEdgeSpecContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEdgeSpecContext) +} + +func (s *EdgeSpecRightContext) ANGLE_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_RIGHT, 0) +} + +func (s *EdgeSpecRightContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeSpecRight(s) + } +} + +func (s *EdgeSpecRightContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeSpecRight(s) + } +} + +func (s *EdgeSpecRightContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeSpecRight(s) + + default: + return t.VisitChildren(s) + } +} + +type EdgeSpecUndirectedBidirectionalContext struct { + EdgeWSpecContext +} + +func NewEdgeSpecUndirectedBidirectionalContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EdgeSpecUndirectedBidirectionalContext { + var p = new(EdgeSpecUndirectedBidirectionalContext) + + InitEmptyEdgeWSpecContext(&p.EdgeWSpecContext) + p.parser = parser + p.CopyAll(ctx.(*EdgeWSpecContext)) + + return p +} + +func (s *EdgeSpecUndirectedBidirectionalContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeSpecUndirectedBidirectionalContext) AllMINUS() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserMINUS) +} + +func (s *EdgeSpecUndirectedBidirectionalContext) MINUS(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMINUS, i) +} + +func (s *EdgeSpecUndirectedBidirectionalContext) EdgeSpec() IEdgeSpecContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEdgeSpecContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEdgeSpecContext) +} + +func (s *EdgeSpecUndirectedBidirectionalContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeSpecUndirectedBidirectional(s) + } +} + +func (s *EdgeSpecUndirectedBidirectionalContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeSpecUndirectedBidirectional(s) + } +} + +func (s *EdgeSpecUndirectedBidirectionalContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeSpecUndirectedBidirectional(s) + + default: + return t.VisitChildren(s) + } +} + +type EdgeSpecUndirectedContext struct { + EdgeWSpecContext +} + +func NewEdgeSpecUndirectedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EdgeSpecUndirectedContext { + var p = new(EdgeSpecUndirectedContext) + + InitEmptyEdgeWSpecContext(&p.EdgeWSpecContext) + p.parser = parser + p.CopyAll(ctx.(*EdgeWSpecContext)) + + return p +} + +func (s *EdgeSpecUndirectedContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeSpecUndirectedContext) AllTILDE() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserTILDE) +} + +func (s *EdgeSpecUndirectedContext) TILDE(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTILDE, i) +} + +func (s *EdgeSpecUndirectedContext) EdgeSpec() IEdgeSpecContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEdgeSpecContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEdgeSpecContext) +} + +func (s *EdgeSpecUndirectedContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeSpecUndirected(s) + } +} + +func (s *EdgeSpecUndirectedContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeSpecUndirected(s) + } +} + +func (s *EdgeSpecUndirectedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeSpecUndirected(s) + + default: + return t.VisitChildren(s) + } +} + +type EdgeSpecUndirectedRightContext struct { + EdgeWSpecContext +} + +func NewEdgeSpecUndirectedRightContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EdgeSpecUndirectedRightContext { + var p = new(EdgeSpecUndirectedRightContext) + + InitEmptyEdgeWSpecContext(&p.EdgeWSpecContext) + p.parser = parser + p.CopyAll(ctx.(*EdgeWSpecContext)) + + return p +} + +func (s *EdgeSpecUndirectedRightContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeSpecUndirectedRightContext) AllTILDE() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserTILDE) +} + +func (s *EdgeSpecUndirectedRightContext) TILDE(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTILDE, i) +} + +func (s *EdgeSpecUndirectedRightContext) EdgeSpec() IEdgeSpecContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEdgeSpecContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEdgeSpecContext) +} + +func (s *EdgeSpecUndirectedRightContext) ANGLE_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_RIGHT, 0) +} + +func (s *EdgeSpecUndirectedRightContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeSpecUndirectedRight(s) + } +} + +func (s *EdgeSpecUndirectedRightContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeSpecUndirectedRight(s) + } +} + +func (s *EdgeSpecUndirectedRightContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeSpecUndirectedRight(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) EdgeWSpec() (localctx IEdgeWSpecContext) { + localctx = NewEdgeWSpecContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 132, PartiQLParserParserRULE_edgeWSpec) + p.SetState(857) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 94, p.GetParserRuleContext()) { + case 1: + localctx = NewEdgeSpecRightContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(823) + p.Match(PartiQLParserParserMINUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(824) + p.EdgeSpec() + } + { + p.SetState(825) + p.Match(PartiQLParserParserMINUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(826) + p.Match(PartiQLParserParserANGLE_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + localctx = NewEdgeSpecUndirectedContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(828) + p.Match(PartiQLParserParserTILDE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(829) + p.EdgeSpec() + } + { + p.SetState(830) + p.Match(PartiQLParserParserTILDE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 3: + localctx = NewEdgeSpecLeftContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(832) + p.Match(PartiQLParserParserANGLE_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(833) + p.Match(PartiQLParserParserMINUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(834) + p.EdgeSpec() + } + { + p.SetState(835) + p.Match(PartiQLParserParserMINUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 4: + localctx = NewEdgeSpecUndirectedRightContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(837) + p.Match(PartiQLParserParserTILDE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(838) + p.EdgeSpec() + } + { + p.SetState(839) + p.Match(PartiQLParserParserTILDE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(840) + p.Match(PartiQLParserParserANGLE_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 5: + localctx = NewEdgeSpecUndirectedLeftContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(842) + p.Match(PartiQLParserParserANGLE_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(843) + p.Match(PartiQLParserParserTILDE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(844) + p.EdgeSpec() + } + { + p.SetState(845) + p.Match(PartiQLParserParserTILDE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 6: + localctx = NewEdgeSpecBidirectionalContext(p, localctx) + p.EnterOuterAlt(localctx, 6) + { + p.SetState(847) + p.Match(PartiQLParserParserANGLE_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(848) + p.Match(PartiQLParserParserMINUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(849) + p.EdgeSpec() + } + { + p.SetState(850) + p.Match(PartiQLParserParserMINUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(851) + p.Match(PartiQLParserParserANGLE_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 7: + localctx = NewEdgeSpecUndirectedBidirectionalContext(p, localctx) + p.EnterOuterAlt(localctx, 7) + { + p.SetState(853) + p.Match(PartiQLParserParserMINUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(854) + p.EdgeSpec() + } + { + p.SetState(855) + p.Match(PartiQLParserParserMINUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IEdgeSpecContext is an interface to support dynamic dispatch. +type IEdgeSpecContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + BRACKET_LEFT() antlr.TerminalNode + BRACKET_RIGHT() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + PatternPartLabel() IPatternPartLabelContext + WhereClause() IWhereClauseContext + + // IsEdgeSpecContext differentiates from other interfaces. + IsEdgeSpecContext() +} + +type EdgeSpecContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyEdgeSpecContext() *EdgeSpecContext { + var p = new(EdgeSpecContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_edgeSpec + return p +} + +func InitEmptyEdgeSpecContext(p *EdgeSpecContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_edgeSpec +} + +func (*EdgeSpecContext) IsEdgeSpecContext() {} + +func NewEdgeSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EdgeSpecContext { + var p = new(EdgeSpecContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_edgeSpec + + return p +} + +func (s *EdgeSpecContext) GetParser() antlr.Parser { return s.parser } + +func (s *EdgeSpecContext) BRACKET_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_LEFT, 0) +} + +func (s *EdgeSpecContext) BRACKET_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_RIGHT, 0) +} + +func (s *EdgeSpecContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *EdgeSpecContext) PatternPartLabel() IPatternPartLabelContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPatternPartLabelContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPatternPartLabelContext) +} + +func (s *EdgeSpecContext) WhereClause() IWhereClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWhereClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IWhereClauseContext) +} + +func (s *EdgeSpecContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *EdgeSpecContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeSpec(s) + } +} + +func (s *EdgeSpecContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeSpec(s) + } +} + +func (s *EdgeSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeSpec(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) EdgeSpec() (localctx IEdgeSpecContext) { + localctx = NewEdgeSpecContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 134, PartiQLParserParserRULE_edgeSpec) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(859) + p.Match(PartiQLParserParserBRACKET_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(861) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserIDENTIFIER || _la == PartiQLParserParserIDENTIFIER_QUOTED { + { + p.SetState(860) + p.SymbolPrimitive() + } + + } + p.SetState(864) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserCOLON { + { + p.SetState(863) + p.PatternPartLabel() + } + + } + p.SetState(867) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserWHERE { + { + p.SetState(866) + p.WhereClause() + } + + } + { + p.SetState(869) + p.Match(PartiQLParserParserBRACKET_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IPatternPartLabelContext is an interface to support dynamic dispatch. +type IPatternPartLabelContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + COLON() antlr.TerminalNode + SymbolPrimitive() ISymbolPrimitiveContext + + // IsPatternPartLabelContext differentiates from other interfaces. + IsPatternPartLabelContext() +} + +type PatternPartLabelContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyPatternPartLabelContext() *PatternPartLabelContext { + var p = new(PatternPartLabelContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_patternPartLabel + return p +} + +func InitEmptyPatternPartLabelContext(p *PatternPartLabelContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_patternPartLabel +} + +func (*PatternPartLabelContext) IsPatternPartLabelContext() {} + +func NewPatternPartLabelContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PatternPartLabelContext { + var p = new(PatternPartLabelContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_patternPartLabel + + return p +} + +func (s *PatternPartLabelContext) GetParser() antlr.Parser { return s.parser } + +func (s *PatternPartLabelContext) COLON() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOLON, 0) +} + +func (s *PatternPartLabelContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *PatternPartLabelContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PatternPartLabelContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *PatternPartLabelContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPatternPartLabel(s) + } +} + +func (s *PatternPartLabelContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPatternPartLabel(s) + } +} + +func (s *PatternPartLabelContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPatternPartLabel(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) PatternPartLabel() (localctx IPatternPartLabelContext) { + localctx = NewPatternPartLabelContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 136, PartiQLParserParserRULE_patternPartLabel) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(871) + p.Match(PartiQLParserParserCOLON) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(872) + p.SymbolPrimitive() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IEdgeAbbrevContext is an interface to support dynamic dispatch. +type IEdgeAbbrevContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + TILDE() antlr.TerminalNode + ANGLE_RIGHT() antlr.TerminalNode + ANGLE_LEFT() antlr.TerminalNode + MINUS() antlr.TerminalNode + + // IsEdgeAbbrevContext differentiates from other interfaces. + IsEdgeAbbrevContext() +} + +type EdgeAbbrevContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyEdgeAbbrevContext() *EdgeAbbrevContext { + var p = new(EdgeAbbrevContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_edgeAbbrev + return p +} + +func InitEmptyEdgeAbbrevContext(p *EdgeAbbrevContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_edgeAbbrev +} + +func (*EdgeAbbrevContext) IsEdgeAbbrevContext() {} + +func NewEdgeAbbrevContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EdgeAbbrevContext { + var p = new(EdgeAbbrevContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_edgeAbbrev + + return p +} + +func (s *EdgeAbbrevContext) GetParser() antlr.Parser { return s.parser } + +func (s *EdgeAbbrevContext) TILDE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTILDE, 0) +} + +func (s *EdgeAbbrevContext) ANGLE_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_RIGHT, 0) +} + +func (s *EdgeAbbrevContext) ANGLE_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_LEFT, 0) +} + +func (s *EdgeAbbrevContext) MINUS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMINUS, 0) +} + +func (s *EdgeAbbrevContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EdgeAbbrevContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *EdgeAbbrevContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterEdgeAbbrev(s) + } +} + +func (s *EdgeAbbrevContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitEdgeAbbrev(s) + } +} + +func (s *EdgeAbbrevContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitEdgeAbbrev(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) EdgeAbbrev() (localctx IEdgeAbbrevContext) { + localctx = NewEdgeAbbrevContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 138, PartiQLParserParserRULE_edgeAbbrev) + var _la int + + p.SetState(886) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 100, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(874) + p.Match(PartiQLParserParserTILDE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(875) + p.Match(PartiQLParserParserTILDE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(876) + p.Match(PartiQLParserParserANGLE_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 3: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(877) + p.Match(PartiQLParserParserANGLE_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(878) + p.Match(PartiQLParserParserTILDE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 4: + p.EnterOuterAlt(localctx, 4) + p.SetState(880) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserANGLE_LEFT { + { + p.SetState(879) + p.Match(PartiQLParserParserANGLE_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(882) + p.Match(PartiQLParserParserMINUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(884) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 99, p.GetParserRuleContext()) == 1 { + { + p.SetState(883) + p.Match(PartiQLParserParserANGLE_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ITableReferenceContext is an interface to support dynamic dispatch. +type ITableReferenceContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsTableReferenceContext differentiates from other interfaces. + IsTableReferenceContext() +} + +type TableReferenceContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTableReferenceContext() *TableReferenceContext { + var p = new(TableReferenceContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_tableReference + return p +} + +func InitEmptyTableReferenceContext(p *TableReferenceContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_tableReference +} + +func (*TableReferenceContext) IsTableReferenceContext() {} + +func NewTableReferenceContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TableReferenceContext { + var p = new(TableReferenceContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_tableReference + + return p +} + +func (s *TableReferenceContext) GetParser() antlr.Parser { return s.parser } + +func (s *TableReferenceContext) CopyAll(ctx *TableReferenceContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *TableReferenceContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableReferenceContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type TableWrappedContext struct { + TableReferenceContext +} + +func NewTableWrappedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TableWrappedContext { + var p = new(TableWrappedContext) + + InitEmptyTableReferenceContext(&p.TableReferenceContext) + p.parser = parser + p.CopyAll(ctx.(*TableReferenceContext)) + + return p +} + +func (s *TableWrappedContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableWrappedContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *TableWrappedContext) TableReference() ITableReferenceContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITableReferenceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITableReferenceContext) +} + +func (s *TableWrappedContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *TableWrappedContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTableWrapped(s) + } +} + +func (s *TableWrappedContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTableWrapped(s) + } +} + +func (s *TableWrappedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTableWrapped(s) + + default: + return t.VisitChildren(s) + } +} + +type TableCrossJoinContext struct { + TableReferenceContext + lhs ITableReferenceContext + rhs IJoinRhsContext +} + +func NewTableCrossJoinContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TableCrossJoinContext { + var p = new(TableCrossJoinContext) + + InitEmptyTableReferenceContext(&p.TableReferenceContext) + p.parser = parser + p.CopyAll(ctx.(*TableReferenceContext)) + + return p +} + +func (s *TableCrossJoinContext) GetLhs() ITableReferenceContext { return s.lhs } + +func (s *TableCrossJoinContext) GetRhs() IJoinRhsContext { return s.rhs } + +func (s *TableCrossJoinContext) SetLhs(v ITableReferenceContext) { s.lhs = v } + +func (s *TableCrossJoinContext) SetRhs(v IJoinRhsContext) { s.rhs = v } + +func (s *TableCrossJoinContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableCrossJoinContext) CROSS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCROSS, 0) +} + +func (s *TableCrossJoinContext) JOIN() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserJOIN, 0) +} + +func (s *TableCrossJoinContext) TableReference() ITableReferenceContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITableReferenceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITableReferenceContext) +} + +func (s *TableCrossJoinContext) JoinRhs() IJoinRhsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IJoinRhsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IJoinRhsContext) +} + +func (s *TableCrossJoinContext) JoinType() IJoinTypeContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IJoinTypeContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IJoinTypeContext) +} + +func (s *TableCrossJoinContext) COMMA() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, 0) +} + +func (s *TableCrossJoinContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTableCrossJoin(s) + } +} + +func (s *TableCrossJoinContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTableCrossJoin(s) + } +} + +func (s *TableCrossJoinContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTableCrossJoin(s) + + default: + return t.VisitChildren(s) + } +} + +type TableQualifiedJoinContext struct { + TableReferenceContext + lhs ITableReferenceContext + rhs IJoinRhsContext +} + +func NewTableQualifiedJoinContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TableQualifiedJoinContext { + var p = new(TableQualifiedJoinContext) + + InitEmptyTableReferenceContext(&p.TableReferenceContext) + p.parser = parser + p.CopyAll(ctx.(*TableReferenceContext)) + + return p +} + +func (s *TableQualifiedJoinContext) GetLhs() ITableReferenceContext { return s.lhs } + +func (s *TableQualifiedJoinContext) GetRhs() IJoinRhsContext { return s.rhs } + +func (s *TableQualifiedJoinContext) SetLhs(v ITableReferenceContext) { s.lhs = v } + +func (s *TableQualifiedJoinContext) SetRhs(v IJoinRhsContext) { s.rhs = v } + +func (s *TableQualifiedJoinContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableQualifiedJoinContext) JOIN() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserJOIN, 0) +} + +func (s *TableQualifiedJoinContext) JoinSpec() IJoinSpecContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IJoinSpecContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IJoinSpecContext) +} + +func (s *TableQualifiedJoinContext) TableReference() ITableReferenceContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITableReferenceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITableReferenceContext) +} + +func (s *TableQualifiedJoinContext) JoinRhs() IJoinRhsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IJoinRhsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IJoinRhsContext) +} + +func (s *TableQualifiedJoinContext) JoinType() IJoinTypeContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IJoinTypeContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IJoinTypeContext) +} + +func (s *TableQualifiedJoinContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTableQualifiedJoin(s) + } +} + +func (s *TableQualifiedJoinContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTableQualifiedJoin(s) + } +} + +func (s *TableQualifiedJoinContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTableQualifiedJoin(s) + + default: + return t.VisitChildren(s) + } +} + +type TableRefBaseContext struct { + TableReferenceContext +} + +func NewTableRefBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TableRefBaseContext { + var p = new(TableRefBaseContext) + + InitEmptyTableReferenceContext(&p.TableReferenceContext) + p.parser = parser + p.CopyAll(ctx.(*TableReferenceContext)) + + return p +} + +func (s *TableRefBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableRefBaseContext) TableNonJoin() ITableNonJoinContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITableNonJoinContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITableNonJoinContext) +} + +func (s *TableRefBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTableRefBase(s) + } +} + +func (s *TableRefBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTableRefBase(s) + } +} + +func (s *TableRefBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTableRefBase(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) TableReference() (localctx ITableReferenceContext) { + return p.tableReference(0) +} + +func (p *PartiQLParserParser) tableReference(_p int) (localctx ITableReferenceContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewTableReferenceContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx ITableReferenceContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 140 + p.EnterRecursionRule(localctx, 140, PartiQLParserParserRULE_tableReference, _p) + var _la int + + var _alt int + + p.EnterOuterAlt(localctx, 1) + p.SetState(894) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 101, p.GetParserRuleContext()) { + case 1: + localctx = NewTableRefBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + + { + p.SetState(889) + p.TableNonJoin() + } + + case 2: + localctx = NewTableWrappedContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(890) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(891) + p.tableReference(0) + } + { + p.SetState(892) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(916) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 105, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + p.SetState(914) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 104, p.GetParserRuleContext()) { + case 1: + localctx = NewTableCrossJoinContext(p, NewTableReferenceContext(p, _parentctx, _parentState)) + localctx.(*TableCrossJoinContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_tableReference) + p.SetState(896) + + if !(p.Precpred(p.GetParserRuleContext(), 5)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) + goto errorExit + } + p.SetState(898) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64((_la-94)) & ^0x3f) == 0 && ((int64(1)<<(_la-94))&144115188612734977) != 0) || _la == PartiQLParserParserRIGHT { + { + p.SetState(897) + p.JoinType() + } + + } + { + p.SetState(900) + p.Match(PartiQLParserParserCROSS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(901) + p.Match(PartiQLParserParserJOIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(902) + + var _x = p.JoinRhs() + + localctx.(*TableCrossJoinContext).rhs = _x + } + + case 2: + localctx = NewTableCrossJoinContext(p, NewTableReferenceContext(p, _parentctx, _parentState)) + localctx.(*TableCrossJoinContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_tableReference) + p.SetState(903) + + if !(p.Precpred(p.GetParserRuleContext(), 4)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) + goto errorExit + } + { + p.SetState(904) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(905) + + var _x = p.JoinRhs() + + localctx.(*TableCrossJoinContext).rhs = _x + } + + case 3: + localctx = NewTableQualifiedJoinContext(p, NewTableReferenceContext(p, _parentctx, _parentState)) + localctx.(*TableQualifiedJoinContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_tableReference) + p.SetState(906) + + if !(p.Precpred(p.GetParserRuleContext(), 3)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + goto errorExit + } + p.SetState(908) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64((_la-94)) & ^0x3f) == 0 && ((int64(1)<<(_la-94))&144115188612734977) != 0) || _la == PartiQLParserParserRIGHT { + { + p.SetState(907) + p.JoinType() + } + + } + { + p.SetState(910) + p.Match(PartiQLParserParserJOIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(911) + + var _x = p.JoinRhs() + + localctx.(*TableQualifiedJoinContext).rhs = _x + } + { + p.SetState(912) + p.JoinSpec() + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + + } + p.SetState(918) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 105, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ITableNonJoinContext is an interface to support dynamic dispatch. +type ITableNonJoinContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + TableBaseReference() ITableBaseReferenceContext + TableUnpivot() ITableUnpivotContext + + // IsTableNonJoinContext differentiates from other interfaces. + IsTableNonJoinContext() +} + +type TableNonJoinContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTableNonJoinContext() *TableNonJoinContext { + var p = new(TableNonJoinContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_tableNonJoin + return p +} + +func InitEmptyTableNonJoinContext(p *TableNonJoinContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_tableNonJoin +} + +func (*TableNonJoinContext) IsTableNonJoinContext() {} + +func NewTableNonJoinContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TableNonJoinContext { + var p = new(TableNonJoinContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_tableNonJoin + + return p +} + +func (s *TableNonJoinContext) GetParser() antlr.Parser { return s.parser } + +func (s *TableNonJoinContext) TableBaseReference() ITableBaseReferenceContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITableBaseReferenceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITableBaseReferenceContext) +} + +func (s *TableNonJoinContext) TableUnpivot() ITableUnpivotContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITableUnpivotContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITableUnpivotContext) +} + +func (s *TableNonJoinContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableNonJoinContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TableNonJoinContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTableNonJoin(s) + } +} + +func (s *TableNonJoinContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTableNonJoin(s) + } +} + +func (s *TableNonJoinContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTableNonJoin(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) TableNonJoin() (localctx ITableNonJoinContext) { + localctx = NewTableNonJoinContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 142, PartiQLParserParserRULE_tableNonJoin) + p.SetState(921) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserAVG, PartiQLParserParserBIT_LENGTH, PartiQLParserParserCASE, PartiQLParserParserCAST, PartiQLParserParserCHARACTER_LENGTH, PartiQLParserParserCHAR_LENGTH, PartiQLParserParserCOALESCE, PartiQLParserParserCOUNT, PartiQLParserParserDATE, PartiQLParserParserEXISTS, PartiQLParserParserEXTRACT, PartiQLParserParserDATE_ADD, PartiQLParserParserDATE_DIFF, PartiQLParserParserFALSE, PartiQLParserParserLOWER, PartiQLParserParserMAX, PartiQLParserParserMIN, PartiQLParserParserNOT, PartiQLParserParserNULL, PartiQLParserParserNULLIF, PartiQLParserParserOCTET_LENGTH, PartiQLParserParserSELECT, PartiQLParserParserSIZE, PartiQLParserParserSUBSTRING, PartiQLParserParserSUM, PartiQLParserParserTIME, PartiQLParserParserTRIM, PartiQLParserParserTRUE, PartiQLParserParserUPPER, PartiQLParserParserVALUES, PartiQLParserParserLAG, PartiQLParserParserLEAD, PartiQLParserParserCAN_CAST, PartiQLParserParserCAN_LOSSLESS_CAST, PartiQLParserParserMISSING, PartiQLParserParserPIVOT, PartiQLParserParserLIST, PartiQLParserParserSEXP, PartiQLParserParserPLUS, PartiQLParserParserMINUS, PartiQLParserParserAT_SIGN, PartiQLParserParserANGLE_DOUBLE_LEFT, PartiQLParserParserBRACKET_LEFT, PartiQLParserParserBRACE_LEFT, PartiQLParserParserPAREN_LEFT, PartiQLParserParserQUESTION_MARK, PartiQLParserParserLITERAL_STRING, PartiQLParserParserLITERAL_INTEGER, PartiQLParserParserLITERAL_DECIMAL, PartiQLParserParserIDENTIFIER, PartiQLParserParserIDENTIFIER_QUOTED, PartiQLParserParserION_CLOSURE: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(919) + p.TableBaseReference() + } + + case PartiQLParserParserUNPIVOT: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(920) + p.TableUnpivot() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ITableBaseReferenceContext is an interface to support dynamic dispatch. +type ITableBaseReferenceContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsTableBaseReferenceContext differentiates from other interfaces. + IsTableBaseReferenceContext() +} + +type TableBaseReferenceContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTableBaseReferenceContext() *TableBaseReferenceContext { + var p = new(TableBaseReferenceContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_tableBaseReference + return p +} + +func InitEmptyTableBaseReferenceContext(p *TableBaseReferenceContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_tableBaseReference +} + +func (*TableBaseReferenceContext) IsTableBaseReferenceContext() {} + +func NewTableBaseReferenceContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TableBaseReferenceContext { + var p = new(TableBaseReferenceContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_tableBaseReference + + return p +} + +func (s *TableBaseReferenceContext) GetParser() antlr.Parser { return s.parser } + +func (s *TableBaseReferenceContext) CopyAll(ctx *TableBaseReferenceContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *TableBaseReferenceContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableBaseReferenceContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type TableBaseRefSymbolContext struct { + TableBaseReferenceContext + source IExprSelectContext +} + +func NewTableBaseRefSymbolContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TableBaseRefSymbolContext { + var p = new(TableBaseRefSymbolContext) + + InitEmptyTableBaseReferenceContext(&p.TableBaseReferenceContext) + p.parser = parser + p.CopyAll(ctx.(*TableBaseReferenceContext)) + + return p +} + +func (s *TableBaseRefSymbolContext) GetSource() IExprSelectContext { return s.source } + +func (s *TableBaseRefSymbolContext) SetSource(v IExprSelectContext) { s.source = v } + +func (s *TableBaseRefSymbolContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableBaseRefSymbolContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *TableBaseRefSymbolContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *TableBaseRefSymbolContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTableBaseRefSymbol(s) + } +} + +func (s *TableBaseRefSymbolContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTableBaseRefSymbol(s) + } +} + +func (s *TableBaseRefSymbolContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTableBaseRefSymbol(s) + + default: + return t.VisitChildren(s) + } +} + +type TableBaseRefClausesContext struct { + TableBaseReferenceContext + source IExprSelectContext +} + +func NewTableBaseRefClausesContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TableBaseRefClausesContext { + var p = new(TableBaseRefClausesContext) + + InitEmptyTableBaseReferenceContext(&p.TableBaseReferenceContext) + p.parser = parser + p.CopyAll(ctx.(*TableBaseReferenceContext)) + + return p +} + +func (s *TableBaseRefClausesContext) GetSource() IExprSelectContext { return s.source } + +func (s *TableBaseRefClausesContext) SetSource(v IExprSelectContext) { s.source = v } + +func (s *TableBaseRefClausesContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableBaseRefClausesContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *TableBaseRefClausesContext) AsIdent() IAsIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAsIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAsIdentContext) +} + +func (s *TableBaseRefClausesContext) AtIdent() IAtIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAtIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAtIdentContext) +} + +func (s *TableBaseRefClausesContext) ByIdent() IByIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IByIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IByIdentContext) +} + +func (s *TableBaseRefClausesContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTableBaseRefClauses(s) + } +} + +func (s *TableBaseRefClausesContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTableBaseRefClauses(s) + } +} + +func (s *TableBaseRefClausesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTableBaseRefClauses(s) + + default: + return t.VisitChildren(s) + } +} + +type TableBaseRefMatchContext struct { + TableBaseReferenceContext + source IExprGraphMatchOneContext +} + +func NewTableBaseRefMatchContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TableBaseRefMatchContext { + var p = new(TableBaseRefMatchContext) + + InitEmptyTableBaseReferenceContext(&p.TableBaseReferenceContext) + p.parser = parser + p.CopyAll(ctx.(*TableBaseReferenceContext)) + + return p +} + +func (s *TableBaseRefMatchContext) GetSource() IExprGraphMatchOneContext { return s.source } + +func (s *TableBaseRefMatchContext) SetSource(v IExprGraphMatchOneContext) { s.source = v } + +func (s *TableBaseRefMatchContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableBaseRefMatchContext) ExprGraphMatchOne() IExprGraphMatchOneContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprGraphMatchOneContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprGraphMatchOneContext) +} + +func (s *TableBaseRefMatchContext) AsIdent() IAsIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAsIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAsIdentContext) +} + +func (s *TableBaseRefMatchContext) AtIdent() IAtIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAtIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAtIdentContext) +} + +func (s *TableBaseRefMatchContext) ByIdent() IByIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IByIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IByIdentContext) +} + +func (s *TableBaseRefMatchContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTableBaseRefMatch(s) + } +} + +func (s *TableBaseRefMatchContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTableBaseRefMatch(s) + } +} + +func (s *TableBaseRefMatchContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTableBaseRefMatch(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) TableBaseReference() (localctx ITableBaseReferenceContext) { + localctx = NewTableBaseReferenceContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 144, PartiQLParserParserRULE_tableBaseReference) + p.SetState(946) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 113, p.GetParserRuleContext()) { + case 1: + localctx = NewTableBaseRefSymbolContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(923) + + var _x = p.ExprSelect() + + localctx.(*TableBaseRefSymbolContext).source = _x + } + { + p.SetState(924) + p.SymbolPrimitive() + } + + case 2: + localctx = NewTableBaseRefClausesContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(926) + + var _x = p.ExprSelect() + + localctx.(*TableBaseRefClausesContext).source = _x + } + p.SetState(928) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 107, p.GetParserRuleContext()) == 1 { + { + p.SetState(927) + p.AsIdent() + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(931) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 108, p.GetParserRuleContext()) == 1 { + { + p.SetState(930) + p.AtIdent() + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(934) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 109, p.GetParserRuleContext()) == 1 { + { + p.SetState(933) + p.ByIdent() + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case 3: + localctx = NewTableBaseRefMatchContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(936) + + var _x = p.ExprGraphMatchOne() + + localctx.(*TableBaseRefMatchContext).source = _x + } + p.SetState(938) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 110, p.GetParserRuleContext()) == 1 { + { + p.SetState(937) + p.AsIdent() + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(941) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 111, p.GetParserRuleContext()) == 1 { + { + p.SetState(940) + p.AtIdent() + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(944) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 112, p.GetParserRuleContext()) == 1 { + { + p.SetState(943) + p.ByIdent() + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ITableUnpivotContext is an interface to support dynamic dispatch. +type ITableUnpivotContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + UNPIVOT() antlr.TerminalNode + Expr() IExprContext + AsIdent() IAsIdentContext + AtIdent() IAtIdentContext + ByIdent() IByIdentContext + + // IsTableUnpivotContext differentiates from other interfaces. + IsTableUnpivotContext() +} + +type TableUnpivotContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTableUnpivotContext() *TableUnpivotContext { + var p = new(TableUnpivotContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_tableUnpivot + return p +} + +func InitEmptyTableUnpivotContext(p *TableUnpivotContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_tableUnpivot +} + +func (*TableUnpivotContext) IsTableUnpivotContext() {} + +func NewTableUnpivotContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TableUnpivotContext { + var p = new(TableUnpivotContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_tableUnpivot + + return p +} + +func (s *TableUnpivotContext) GetParser() antlr.Parser { return s.parser } + +func (s *TableUnpivotContext) UNPIVOT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserUNPIVOT, 0) +} + +func (s *TableUnpivotContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *TableUnpivotContext) AsIdent() IAsIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAsIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAsIdentContext) +} + +func (s *TableUnpivotContext) AtIdent() IAtIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAtIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAtIdentContext) +} + +func (s *TableUnpivotContext) ByIdent() IByIdentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IByIdentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IByIdentContext) +} + +func (s *TableUnpivotContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableUnpivotContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TableUnpivotContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTableUnpivot(s) + } +} + +func (s *TableUnpivotContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTableUnpivot(s) + } +} + +func (s *TableUnpivotContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTableUnpivot(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) TableUnpivot() (localctx ITableUnpivotContext) { + localctx = NewTableUnpivotContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 146, PartiQLParserParserRULE_tableUnpivot) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(948) + p.Match(PartiQLParserParserUNPIVOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(949) + p.Expr() + } + p.SetState(951) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 114, p.GetParserRuleContext()) == 1 { + { + p.SetState(950) + p.AsIdent() + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(954) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 115, p.GetParserRuleContext()) == 1 { + { + p.SetState(953) + p.AtIdent() + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(957) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 116, p.GetParserRuleContext()) == 1 { + { + p.SetState(956) + p.ByIdent() + } + + } else if p.HasError() { // JIM + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IJoinRhsContext is an interface to support dynamic dispatch. +type IJoinRhsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsJoinRhsContext differentiates from other interfaces. + IsJoinRhsContext() +} + +type JoinRhsContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyJoinRhsContext() *JoinRhsContext { + var p = new(JoinRhsContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_joinRhs + return p +} + +func InitEmptyJoinRhsContext(p *JoinRhsContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_joinRhs +} + +func (*JoinRhsContext) IsJoinRhsContext() {} + +func NewJoinRhsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *JoinRhsContext { + var p = new(JoinRhsContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_joinRhs + + return p +} + +func (s *JoinRhsContext) GetParser() antlr.Parser { return s.parser } + +func (s *JoinRhsContext) CopyAll(ctx *JoinRhsContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *JoinRhsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *JoinRhsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type JoinRhsBaseContext struct { + JoinRhsContext +} + +func NewJoinRhsBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *JoinRhsBaseContext { + var p = new(JoinRhsBaseContext) + + InitEmptyJoinRhsContext(&p.JoinRhsContext) + p.parser = parser + p.CopyAll(ctx.(*JoinRhsContext)) + + return p +} + +func (s *JoinRhsBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *JoinRhsBaseContext) TableNonJoin() ITableNonJoinContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITableNonJoinContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITableNonJoinContext) +} + +func (s *JoinRhsBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterJoinRhsBase(s) + } +} + +func (s *JoinRhsBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitJoinRhsBase(s) + } +} + +func (s *JoinRhsBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitJoinRhsBase(s) + + default: + return t.VisitChildren(s) + } +} + +type JoinRhsTableJoinedContext struct { + JoinRhsContext +} + +func NewJoinRhsTableJoinedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *JoinRhsTableJoinedContext { + var p = new(JoinRhsTableJoinedContext) + + InitEmptyJoinRhsContext(&p.JoinRhsContext) + p.parser = parser + p.CopyAll(ctx.(*JoinRhsContext)) + + return p +} + +func (s *JoinRhsTableJoinedContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *JoinRhsTableJoinedContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *JoinRhsTableJoinedContext) TableReference() ITableReferenceContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITableReferenceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITableReferenceContext) +} + +func (s *JoinRhsTableJoinedContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *JoinRhsTableJoinedContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterJoinRhsTableJoined(s) + } +} + +func (s *JoinRhsTableJoinedContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitJoinRhsTableJoined(s) + } +} + +func (s *JoinRhsTableJoinedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitJoinRhsTableJoined(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) JoinRhs() (localctx IJoinRhsContext) { + localctx = NewJoinRhsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 148, PartiQLParserParserRULE_joinRhs) + p.SetState(964) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 117, p.GetParserRuleContext()) { + case 1: + localctx = NewJoinRhsBaseContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(959) + p.TableNonJoin() + } + + case 2: + localctx = NewJoinRhsTableJoinedContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(960) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(961) + p.tableReference(0) + } + { + p.SetState(962) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IJoinSpecContext is an interface to support dynamic dispatch. +type IJoinSpecContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ON() antlr.TerminalNode + Expr() IExprContext + + // IsJoinSpecContext differentiates from other interfaces. + IsJoinSpecContext() +} + +type JoinSpecContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyJoinSpecContext() *JoinSpecContext { + var p = new(JoinSpecContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_joinSpec + return p +} + +func InitEmptyJoinSpecContext(p *JoinSpecContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_joinSpec +} + +func (*JoinSpecContext) IsJoinSpecContext() {} + +func NewJoinSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *JoinSpecContext { + var p = new(JoinSpecContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_joinSpec + + return p +} + +func (s *JoinSpecContext) GetParser() antlr.Parser { return s.parser } + +func (s *JoinSpecContext) ON() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserON, 0) +} + +func (s *JoinSpecContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *JoinSpecContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *JoinSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *JoinSpecContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterJoinSpec(s) + } +} + +func (s *JoinSpecContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitJoinSpec(s) + } +} + +func (s *JoinSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitJoinSpec(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) JoinSpec() (localctx IJoinSpecContext) { + localctx = NewJoinSpecContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 150, PartiQLParserParserRULE_joinSpec) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(966) + p.Match(PartiQLParserParserON) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(967) + p.Expr() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IJoinTypeContext is an interface to support dynamic dispatch. +type IJoinTypeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetMod returns the mod token. + GetMod() antlr.Token + + // SetMod sets the mod token. + SetMod(antlr.Token) + + // Getter signatures + INNER() antlr.TerminalNode + LEFT() antlr.TerminalNode + OUTER() antlr.TerminalNode + RIGHT() antlr.TerminalNode + FULL() antlr.TerminalNode + + // IsJoinTypeContext differentiates from other interfaces. + IsJoinTypeContext() +} + +type JoinTypeContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + mod antlr.Token +} + +func NewEmptyJoinTypeContext() *JoinTypeContext { + var p = new(JoinTypeContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_joinType + return p +} + +func InitEmptyJoinTypeContext(p *JoinTypeContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_joinType +} + +func (*JoinTypeContext) IsJoinTypeContext() {} + +func NewJoinTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *JoinTypeContext { + var p = new(JoinTypeContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_joinType + + return p +} + +func (s *JoinTypeContext) GetParser() antlr.Parser { return s.parser } + +func (s *JoinTypeContext) GetMod() antlr.Token { return s.mod } + +func (s *JoinTypeContext) SetMod(v antlr.Token) { s.mod = v } + +func (s *JoinTypeContext) INNER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINNER, 0) +} + +func (s *JoinTypeContext) LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLEFT, 0) +} + +func (s *JoinTypeContext) OUTER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserOUTER, 0) +} + +func (s *JoinTypeContext) RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserRIGHT, 0) +} + +func (s *JoinTypeContext) FULL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFULL, 0) +} + +func (s *JoinTypeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *JoinTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *JoinTypeContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterJoinType(s) + } +} + +func (s *JoinTypeContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitJoinType(s) + } +} + +func (s *JoinTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitJoinType(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) JoinType() (localctx IJoinTypeContext) { + localctx = NewJoinTypeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 152, PartiQLParserParserRULE_joinType) + var _la int + + p.SetState(983) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserINNER: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(969) + + var _m = p.Match(PartiQLParserParserINNER) + + localctx.(*JoinTypeContext).mod = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserLEFT: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(970) + + var _m = p.Match(PartiQLParserParserLEFT) + + localctx.(*JoinTypeContext).mod = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(972) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserOUTER { + { + p.SetState(971) + p.Match(PartiQLParserParserOUTER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + + case PartiQLParserParserRIGHT: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(974) + + var _m = p.Match(PartiQLParserParserRIGHT) + + localctx.(*JoinTypeContext).mod = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(976) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserOUTER { + { + p.SetState(975) + p.Match(PartiQLParserParserOUTER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + + case PartiQLParserParserFULL: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(978) + + var _m = p.Match(PartiQLParserParserFULL) + + localctx.(*JoinTypeContext).mod = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(980) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserOUTER { + { + p.SetState(979) + p.Match(PartiQLParserParserOUTER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + + case PartiQLParserParserOUTER: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(982) + + var _m = p.Match(PartiQLParserParserOUTER) + + localctx.(*JoinTypeContext).mod = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprContext is an interface to support dynamic dispatch. +type IExprContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ExprBagOp() IExprBagOpContext + + // IsExprContext differentiates from other interfaces. + IsExprContext() +} + +type ExprContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprContext() *ExprContext { + var p = new(ExprContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_expr + return p +} + +func InitEmptyExprContext(p *ExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_expr +} + +func (*ExprContext) IsExprContext() {} + +func NewExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprContext { + var p = new(ExprContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_expr + + return p +} + +func (s *ExprContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprContext) ExprBagOp() IExprBagOpContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprBagOpContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprBagOpContext) +} + +func (s *ExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExpr(s) + } +} + +func (s *ExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExpr(s) + } +} + +func (s *ExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExpr(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Expr() (localctx IExprContext) { + localctx = NewExprContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 154, PartiQLParserParserRULE_expr) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(985) + p.exprBagOp(0) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprBagOpContext is an interface to support dynamic dispatch. +type IExprBagOpContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsExprBagOpContext differentiates from other interfaces. + IsExprBagOpContext() +} + +type ExprBagOpContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprBagOpContext() *ExprBagOpContext { + var p = new(ExprBagOpContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprBagOp + return p +} + +func InitEmptyExprBagOpContext(p *ExprBagOpContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprBagOp +} + +func (*ExprBagOpContext) IsExprBagOpContext() {} + +func NewExprBagOpContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprBagOpContext { + var p = new(ExprBagOpContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_exprBagOp + + return p +} + +func (s *ExprBagOpContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprBagOpContext) CopyAll(ctx *ExprBagOpContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ExprBagOpContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprBagOpContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type IntersectContext struct { + ExprBagOpContext + lhs IExprBagOpContext + rhs IExprSelectContext +} + +func NewIntersectContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntersectContext { + var p = new(IntersectContext) + + InitEmptyExprBagOpContext(&p.ExprBagOpContext) + p.parser = parser + p.CopyAll(ctx.(*ExprBagOpContext)) + + return p +} + +func (s *IntersectContext) GetLhs() IExprBagOpContext { return s.lhs } + +func (s *IntersectContext) GetRhs() IExprSelectContext { return s.rhs } + +func (s *IntersectContext) SetLhs(v IExprBagOpContext) { s.lhs = v } + +func (s *IntersectContext) SetRhs(v IExprSelectContext) { s.rhs = v } + +func (s *IntersectContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IntersectContext) INTERSECT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINTERSECT, 0) +} + +func (s *IntersectContext) ExprBagOp() IExprBagOpContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprBagOpContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprBagOpContext) +} + +func (s *IntersectContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *IntersectContext) OUTER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserOUTER, 0) +} + +func (s *IntersectContext) DISTINCT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDISTINCT, 0) +} + +func (s *IntersectContext) ALL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserALL, 0) +} + +func (s *IntersectContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterIntersect(s) + } +} + +func (s *IntersectContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitIntersect(s) + } +} + +func (s *IntersectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitIntersect(s) + + default: + return t.VisitChildren(s) + } +} + +type QueryBaseContext struct { + ExprBagOpContext +} + +func NewQueryBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QueryBaseContext { + var p = new(QueryBaseContext) + + InitEmptyExprBagOpContext(&p.ExprBagOpContext) + p.parser = parser + p.CopyAll(ctx.(*ExprBagOpContext)) + + return p +} + +func (s *QueryBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *QueryBaseContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *QueryBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterQueryBase(s) + } +} + +func (s *QueryBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitQueryBase(s) + } +} + +func (s *QueryBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitQueryBase(s) + + default: + return t.VisitChildren(s) + } +} + +type ExceptContext struct { + ExprBagOpContext + lhs IExprBagOpContext + rhs IExprSelectContext +} + +func NewExceptContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExceptContext { + var p = new(ExceptContext) + + InitEmptyExprBagOpContext(&p.ExprBagOpContext) + p.parser = parser + p.CopyAll(ctx.(*ExprBagOpContext)) + + return p +} + +func (s *ExceptContext) GetLhs() IExprBagOpContext { return s.lhs } + +func (s *ExceptContext) GetRhs() IExprSelectContext { return s.rhs } + +func (s *ExceptContext) SetLhs(v IExprBagOpContext) { s.lhs = v } + +func (s *ExceptContext) SetRhs(v IExprSelectContext) { s.rhs = v } + +func (s *ExceptContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExceptContext) EXCEPT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEXCEPT, 0) +} + +func (s *ExceptContext) ExprBagOp() IExprBagOpContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprBagOpContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprBagOpContext) +} + +func (s *ExceptContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *ExceptContext) OUTER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserOUTER, 0) +} + +func (s *ExceptContext) DISTINCT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDISTINCT, 0) +} + +func (s *ExceptContext) ALL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserALL, 0) +} + +func (s *ExceptContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExcept(s) + } +} + +func (s *ExceptContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExcept(s) + } +} + +func (s *ExceptContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExcept(s) + + default: + return t.VisitChildren(s) + } +} + +type UnionContext struct { + ExprBagOpContext + lhs IExprBagOpContext + rhs IExprSelectContext +} + +func NewUnionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UnionContext { + var p = new(UnionContext) + + InitEmptyExprBagOpContext(&p.ExprBagOpContext) + p.parser = parser + p.CopyAll(ctx.(*ExprBagOpContext)) + + return p +} + +func (s *UnionContext) GetLhs() IExprBagOpContext { return s.lhs } + +func (s *UnionContext) GetRhs() IExprSelectContext { return s.rhs } + +func (s *UnionContext) SetLhs(v IExprBagOpContext) { s.lhs = v } + +func (s *UnionContext) SetRhs(v IExprSelectContext) { s.rhs = v } + +func (s *UnionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *UnionContext) UNION() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserUNION, 0) +} + +func (s *UnionContext) ExprBagOp() IExprBagOpContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprBagOpContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprBagOpContext) +} + +func (s *UnionContext) ExprSelect() IExprSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprSelectContext) +} + +func (s *UnionContext) OUTER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserOUTER, 0) +} + +func (s *UnionContext) DISTINCT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDISTINCT, 0) +} + +func (s *UnionContext) ALL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserALL, 0) +} + +func (s *UnionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterUnion(s) + } +} + +func (s *UnionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitUnion(s) + } +} + +func (s *UnionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitUnion(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExprBagOp() (localctx IExprBagOpContext) { + return p.exprBagOp(0) +} + +func (p *PartiQLParserParser) exprBagOp(_p int) (localctx IExprBagOpContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewExprBagOpContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx IExprBagOpContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 156 + p.EnterRecursionRule(localctx, 156, PartiQLParserParserRULE_exprBagOp, _p) + var _la int + + var _alt int + + p.EnterOuterAlt(localctx, 1) + localctx = NewQueryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + + { + p.SetState(988) + p.ExprSelect() + } + + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(1019) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 129, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + p.SetState(1017) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 128, p.GetParserRuleContext()) { + case 1: + localctx = NewExceptContext(p, NewExprBagOpContext(p, _parentctx, _parentState)) + localctx.(*ExceptContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprBagOp) + p.SetState(990) + + if !(p.Precpred(p.GetParserRuleContext(), 4)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) + goto errorExit + } + p.SetState(992) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserOUTER { + { + p.SetState(991) + p.Match(PartiQLParserParserOUTER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(994) + p.Match(PartiQLParserParserEXCEPT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(996) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT { + { + p.SetState(995) + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + } + { + p.SetState(998) + + var _x = p.ExprSelect() + + localctx.(*ExceptContext).rhs = _x + } + + case 2: + localctx = NewUnionContext(p, NewExprBagOpContext(p, _parentctx, _parentState)) + localctx.(*UnionContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprBagOp) + p.SetState(999) + + if !(p.Precpred(p.GetParserRuleContext(), 3)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + goto errorExit + } + p.SetState(1001) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserOUTER { + { + p.SetState(1000) + p.Match(PartiQLParserParserOUTER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(1003) + p.Match(PartiQLParserParserUNION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1005) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT { + { + p.SetState(1004) + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + } + { + p.SetState(1007) + + var _x = p.ExprSelect() + + localctx.(*UnionContext).rhs = _x + } + + case 3: + localctx = NewIntersectContext(p, NewExprBagOpContext(p, _parentctx, _parentState)) + localctx.(*IntersectContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprBagOp) + p.SetState(1008) + + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + p.SetState(1010) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserOUTER { + { + p.SetState(1009) + p.Match(PartiQLParserParserOUTER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(1012) + p.Match(PartiQLParserParserINTERSECT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1014) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT { + { + p.SetState(1013) + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + } + { + p.SetState(1016) + + var _x = p.ExprSelect() + + localctx.(*IntersectContext).rhs = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + + } + p.SetState(1021) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 129, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprSelectContext is an interface to support dynamic dispatch. +type IExprSelectContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsExprSelectContext differentiates from other interfaces. + IsExprSelectContext() +} + +type ExprSelectContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprSelectContext() *ExprSelectContext { + var p = new(ExprSelectContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprSelect + return p +} + +func InitEmptyExprSelectContext(p *ExprSelectContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprSelect +} + +func (*ExprSelectContext) IsExprSelectContext() {} + +func NewExprSelectContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprSelectContext { + var p = new(ExprSelectContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_exprSelect + + return p +} + +func (s *ExprSelectContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprSelectContext) CopyAll(ctx *ExprSelectContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ExprSelectContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprSelectContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type SfwBaseContext struct { + ExprSelectContext +} + +func NewSfwBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SfwBaseContext { + var p = new(SfwBaseContext) + + InitEmptyExprSelectContext(&p.ExprSelectContext) + p.parser = parser + p.CopyAll(ctx.(*ExprSelectContext)) + + return p +} + +func (s *SfwBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SfwBaseContext) ExprOr() IExprOrContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprOrContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprOrContext) +} + +func (s *SfwBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSfwBase(s) + } +} + +func (s *SfwBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSfwBase(s) + } +} + +func (s *SfwBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSfwBase(s) + + default: + return t.VisitChildren(s) + } +} + +type SfwQueryContext struct { + ExprSelectContext + select_ ISelectClauseContext + from IFromClauseContext + let ILetClauseContext + where IWhereClauseSelectContext + group IGroupClauseContext + having IHavingClauseContext + order IOrderByClauseContext + limit ILimitClauseContext + offset IOffsetByClauseContext +} + +func NewSfwQueryContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SfwQueryContext { + var p = new(SfwQueryContext) + + InitEmptyExprSelectContext(&p.ExprSelectContext) + p.parser = parser + p.CopyAll(ctx.(*ExprSelectContext)) + + return p +} + +func (s *SfwQueryContext) GetSelect_() ISelectClauseContext { return s.select_ } + +func (s *SfwQueryContext) GetFrom() IFromClauseContext { return s.from } + +func (s *SfwQueryContext) GetLet() ILetClauseContext { return s.let } + +func (s *SfwQueryContext) GetWhere() IWhereClauseSelectContext { return s.where } + +func (s *SfwQueryContext) GetGroup() IGroupClauseContext { return s.group } + +func (s *SfwQueryContext) GetHaving() IHavingClauseContext { return s.having } + +func (s *SfwQueryContext) GetOrder() IOrderByClauseContext { return s.order } + +func (s *SfwQueryContext) GetLimit() ILimitClauseContext { return s.limit } + +func (s *SfwQueryContext) GetOffset() IOffsetByClauseContext { return s.offset } + +func (s *SfwQueryContext) SetSelect_(v ISelectClauseContext) { s.select_ = v } + +func (s *SfwQueryContext) SetFrom(v IFromClauseContext) { s.from = v } + +func (s *SfwQueryContext) SetLet(v ILetClauseContext) { s.let = v } + +func (s *SfwQueryContext) SetWhere(v IWhereClauseSelectContext) { s.where = v } + +func (s *SfwQueryContext) SetGroup(v IGroupClauseContext) { s.group = v } + +func (s *SfwQueryContext) SetHaving(v IHavingClauseContext) { s.having = v } + +func (s *SfwQueryContext) SetOrder(v IOrderByClauseContext) { s.order = v } + +func (s *SfwQueryContext) SetLimit(v ILimitClauseContext) { s.limit = v } + +func (s *SfwQueryContext) SetOffset(v IOffsetByClauseContext) { s.offset = v } + +func (s *SfwQueryContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SfwQueryContext) SelectClause() ISelectClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISelectClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISelectClauseContext) +} + +func (s *SfwQueryContext) FromClause() IFromClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFromClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFromClauseContext) +} + +func (s *SfwQueryContext) LetClause() ILetClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILetClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ILetClauseContext) +} + +func (s *SfwQueryContext) WhereClauseSelect() IWhereClauseSelectContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWhereClauseSelectContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IWhereClauseSelectContext) +} + +func (s *SfwQueryContext) GroupClause() IGroupClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGroupClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IGroupClauseContext) +} + +func (s *SfwQueryContext) HavingClause() IHavingClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IHavingClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IHavingClauseContext) +} + +func (s *SfwQueryContext) OrderByClause() IOrderByClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOrderByClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IOrderByClauseContext) +} + +func (s *SfwQueryContext) LimitClause() ILimitClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILimitClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ILimitClauseContext) +} + +func (s *SfwQueryContext) OffsetByClause() IOffsetByClauseContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOffsetByClauseContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IOffsetByClauseContext) +} + +func (s *SfwQueryContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSfwQuery(s) + } +} + +func (s *SfwQueryContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSfwQuery(s) + } +} + +func (s *SfwQueryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSfwQuery(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExprSelect() (localctx IExprSelectContext) { + localctx = NewExprSelectContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 158, PartiQLParserParserRULE_exprSelect) + p.SetState(1046) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserSELECT, PartiQLParserParserPIVOT: + localctx = NewSfwQueryContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1022) + + var _x = p.SelectClause() + + localctx.(*SfwQueryContext).select_ = _x + } + { + p.SetState(1023) + + var _x = p.FromClause() + + localctx.(*SfwQueryContext).from = _x + } + p.SetState(1025) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 130, p.GetParserRuleContext()) == 1 { + { + p.SetState(1024) + + var _x = p.LetClause() + + localctx.(*SfwQueryContext).let = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(1028) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 131, p.GetParserRuleContext()) == 1 { + { + p.SetState(1027) + + var _x = p.WhereClauseSelect() + + localctx.(*SfwQueryContext).where = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(1031) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 132, p.GetParserRuleContext()) == 1 { + { + p.SetState(1030) + + var _x = p.GroupClause() + + localctx.(*SfwQueryContext).group = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(1034) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 133, p.GetParserRuleContext()) == 1 { + { + p.SetState(1033) + + var _x = p.HavingClause() + + localctx.(*SfwQueryContext).having = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(1037) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 134, p.GetParserRuleContext()) == 1 { + { + p.SetState(1036) + + var _x = p.OrderByClause() + + localctx.(*SfwQueryContext).order = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(1040) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 135, p.GetParserRuleContext()) == 1 { + { + p.SetState(1039) + + var _x = p.LimitClause() + + localctx.(*SfwQueryContext).limit = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(1043) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 136, p.GetParserRuleContext()) == 1 { + { + p.SetState(1042) + + var _x = p.OffsetByClause() + + localctx.(*SfwQueryContext).offset = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case PartiQLParserParserAVG, PartiQLParserParserBIT_LENGTH, PartiQLParserParserCASE, PartiQLParserParserCAST, PartiQLParserParserCHARACTER_LENGTH, PartiQLParserParserCHAR_LENGTH, PartiQLParserParserCOALESCE, PartiQLParserParserCOUNT, PartiQLParserParserDATE, PartiQLParserParserEXISTS, PartiQLParserParserEXTRACT, PartiQLParserParserDATE_ADD, PartiQLParserParserDATE_DIFF, PartiQLParserParserFALSE, PartiQLParserParserLOWER, PartiQLParserParserMAX, PartiQLParserParserMIN, PartiQLParserParserNOT, PartiQLParserParserNULL, PartiQLParserParserNULLIF, PartiQLParserParserOCTET_LENGTH, PartiQLParserParserSIZE, PartiQLParserParserSUBSTRING, PartiQLParserParserSUM, PartiQLParserParserTIME, PartiQLParserParserTRIM, PartiQLParserParserTRUE, PartiQLParserParserUPPER, PartiQLParserParserVALUES, PartiQLParserParserLAG, PartiQLParserParserLEAD, PartiQLParserParserCAN_CAST, PartiQLParserParserCAN_LOSSLESS_CAST, PartiQLParserParserMISSING, PartiQLParserParserLIST, PartiQLParserParserSEXP, PartiQLParserParserPLUS, PartiQLParserParserMINUS, PartiQLParserParserAT_SIGN, PartiQLParserParserANGLE_DOUBLE_LEFT, PartiQLParserParserBRACKET_LEFT, PartiQLParserParserBRACE_LEFT, PartiQLParserParserPAREN_LEFT, PartiQLParserParserQUESTION_MARK, PartiQLParserParserLITERAL_STRING, PartiQLParserParserLITERAL_INTEGER, PartiQLParserParserLITERAL_DECIMAL, PartiQLParserParserIDENTIFIER, PartiQLParserParserIDENTIFIER_QUOTED, PartiQLParserParserION_CLOSURE: + localctx = NewSfwBaseContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1045) + p.exprOr(0) + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprOrContext is an interface to support dynamic dispatch. +type IExprOrContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsExprOrContext differentiates from other interfaces. + IsExprOrContext() +} + +type ExprOrContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprOrContext() *ExprOrContext { + var p = new(ExprOrContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprOr + return p +} + +func InitEmptyExprOrContext(p *ExprOrContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprOr +} + +func (*ExprOrContext) IsExprOrContext() {} + +func NewExprOrContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprOrContext { + var p = new(ExprOrContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_exprOr + + return p +} + +func (s *ExprOrContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprOrContext) CopyAll(ctx *ExprOrContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ExprOrContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprOrContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type OrContext struct { + ExprOrContext + lhs IExprOrContext + rhs IExprAndContext +} + +func NewOrContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *OrContext { + var p = new(OrContext) + + InitEmptyExprOrContext(&p.ExprOrContext) + p.parser = parser + p.CopyAll(ctx.(*ExprOrContext)) + + return p +} + +func (s *OrContext) GetLhs() IExprOrContext { return s.lhs } + +func (s *OrContext) GetRhs() IExprAndContext { return s.rhs } + +func (s *OrContext) SetLhs(v IExprOrContext) { s.lhs = v } + +func (s *OrContext) SetRhs(v IExprAndContext) { s.rhs = v } + +func (s *OrContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *OrContext) OR() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserOR, 0) +} + +func (s *OrContext) ExprOr() IExprOrContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprOrContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprOrContext) +} + +func (s *OrContext) ExprAnd() IExprAndContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprAndContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprAndContext) +} + +func (s *OrContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterOr(s) + } +} + +func (s *OrContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitOr(s) + } +} + +func (s *OrContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitOr(s) + + default: + return t.VisitChildren(s) + } +} + +type ExprOrBaseContext struct { + ExprOrContext + parent_ IExprAndContext +} + +func NewExprOrBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExprOrBaseContext { + var p = new(ExprOrBaseContext) + + InitEmptyExprOrContext(&p.ExprOrContext) + p.parser = parser + p.CopyAll(ctx.(*ExprOrContext)) + + return p +} + +func (s *ExprOrBaseContext) GetParent_() IExprAndContext { return s.parent_ } + +func (s *ExprOrBaseContext) SetParent_(v IExprAndContext) { s.parent_ = v } + +func (s *ExprOrBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprOrBaseContext) ExprAnd() IExprAndContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprAndContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprAndContext) +} + +func (s *ExprOrBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExprOrBase(s) + } +} + +func (s *ExprOrBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExprOrBase(s) + } +} + +func (s *ExprOrBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExprOrBase(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExprOr() (localctx IExprOrContext) { + return p.exprOr(0) +} + +func (p *PartiQLParserParser) exprOr(_p int) (localctx IExprOrContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewExprOrContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx IExprOrContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 160 + p.EnterRecursionRule(localctx, 160, PartiQLParserParserRULE_exprOr, _p) + var _alt int + + p.EnterOuterAlt(localctx, 1) + localctx = NewExprOrBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + + { + p.SetState(1049) + + var _x = p.exprAnd(0) + + localctx.(*ExprOrBaseContext).parent_ = _x + } + + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(1056) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 138, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + localctx = NewOrContext(p, NewExprOrContext(p, _parentctx, _parentState)) + localctx.(*OrContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprOr) + p.SetState(1051) + + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + { + p.SetState(1052) + p.Match(PartiQLParserParserOR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1053) + + var _x = p.exprAnd(0) + + localctx.(*OrContext).rhs = _x + } + + } + p.SetState(1058) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 138, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprAndContext is an interface to support dynamic dispatch. +type IExprAndContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsExprAndContext differentiates from other interfaces. + IsExprAndContext() +} + +type ExprAndContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprAndContext() *ExprAndContext { + var p = new(ExprAndContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprAnd + return p +} + +func InitEmptyExprAndContext(p *ExprAndContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprAnd +} + +func (*ExprAndContext) IsExprAndContext() {} + +func NewExprAndContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprAndContext { + var p = new(ExprAndContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_exprAnd + + return p +} + +func (s *ExprAndContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprAndContext) CopyAll(ctx *ExprAndContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ExprAndContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprAndContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type ExprAndBaseContext struct { + ExprAndContext + parent_ IExprNotContext +} + +func NewExprAndBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExprAndBaseContext { + var p = new(ExprAndBaseContext) + + InitEmptyExprAndContext(&p.ExprAndContext) + p.parser = parser + p.CopyAll(ctx.(*ExprAndContext)) + + return p +} + +func (s *ExprAndBaseContext) GetParent_() IExprNotContext { return s.parent_ } + +func (s *ExprAndBaseContext) SetParent_(v IExprNotContext) { s.parent_ = v } + +func (s *ExprAndBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprAndBaseContext) ExprNot() IExprNotContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprNotContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprNotContext) +} + +func (s *ExprAndBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExprAndBase(s) + } +} + +func (s *ExprAndBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExprAndBase(s) + } +} + +func (s *ExprAndBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExprAndBase(s) + + default: + return t.VisitChildren(s) + } +} + +type AndContext struct { + ExprAndContext + lhs IExprAndContext + op antlr.Token + rhs IExprNotContext +} + +func NewAndContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AndContext { + var p = new(AndContext) + + InitEmptyExprAndContext(&p.ExprAndContext) + p.parser = parser + p.CopyAll(ctx.(*ExprAndContext)) + + return p +} + +func (s *AndContext) GetOp() antlr.Token { return s.op } + +func (s *AndContext) SetOp(v antlr.Token) { s.op = v } + +func (s *AndContext) GetLhs() IExprAndContext { return s.lhs } + +func (s *AndContext) GetRhs() IExprNotContext { return s.rhs } + +func (s *AndContext) SetLhs(v IExprAndContext) { s.lhs = v } + +func (s *AndContext) SetRhs(v IExprNotContext) { s.rhs = v } + +func (s *AndContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AndContext) ExprAnd() IExprAndContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprAndContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprAndContext) +} + +func (s *AndContext) AND() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAND, 0) +} + +func (s *AndContext) ExprNot() IExprNotContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprNotContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprNotContext) +} + +func (s *AndContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterAnd(s) + } +} + +func (s *AndContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitAnd(s) + } +} + +func (s *AndContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitAnd(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExprAnd() (localctx IExprAndContext) { + return p.exprAnd(0) +} + +func (p *PartiQLParserParser) exprAnd(_p int) (localctx IExprAndContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewExprAndContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx IExprAndContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 162 + p.EnterRecursionRule(localctx, 162, PartiQLParserParserRULE_exprAnd, _p) + var _alt int + + p.EnterOuterAlt(localctx, 1) + localctx = NewExprAndBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + + { + p.SetState(1060) + + var _x = p.ExprNot() + + localctx.(*ExprAndBaseContext).parent_ = _x + } + + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(1067) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 139, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + localctx = NewAndContext(p, NewExprAndContext(p, _parentctx, _parentState)) + localctx.(*AndContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprAnd) + p.SetState(1062) + + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + { + p.SetState(1063) + + var _m = p.Match(PartiQLParserParserAND) + + localctx.(*AndContext).op = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1064) + + var _x = p.ExprNot() + + localctx.(*AndContext).rhs = _x + } + + } + p.SetState(1069) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 139, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprNotContext is an interface to support dynamic dispatch. +type IExprNotContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsExprNotContext differentiates from other interfaces. + IsExprNotContext() +} + +type ExprNotContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprNotContext() *ExprNotContext { + var p = new(ExprNotContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprNot + return p +} + +func InitEmptyExprNotContext(p *ExprNotContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprNot +} + +func (*ExprNotContext) IsExprNotContext() {} + +func NewExprNotContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprNotContext { + var p = new(ExprNotContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_exprNot + + return p +} + +func (s *ExprNotContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprNotContext) CopyAll(ctx *ExprNotContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ExprNotContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprNotContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type NotContext struct { + ExprNotContext + op antlr.Token + rhs IExprNotContext +} + +func NewNotContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NotContext { + var p = new(NotContext) + + InitEmptyExprNotContext(&p.ExprNotContext) + p.parser = parser + p.CopyAll(ctx.(*ExprNotContext)) + + return p +} + +func (s *NotContext) GetOp() antlr.Token { return s.op } + +func (s *NotContext) SetOp(v antlr.Token) { s.op = v } + +func (s *NotContext) GetRhs() IExprNotContext { return s.rhs } + +func (s *NotContext) SetRhs(v IExprNotContext) { s.rhs = v } + +func (s *NotContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NotContext) NOT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNOT, 0) +} + +func (s *NotContext) ExprNot() IExprNotContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprNotContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprNotContext) +} + +func (s *NotContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterNot(s) + } +} + +func (s *NotContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitNot(s) + } +} + +func (s *NotContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitNot(s) + + default: + return t.VisitChildren(s) + } +} + +type ExprNotBaseContext struct { + ExprNotContext + parent_ IExprPredicateContext +} + +func NewExprNotBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExprNotBaseContext { + var p = new(ExprNotBaseContext) + + InitEmptyExprNotContext(&p.ExprNotContext) + p.parser = parser + p.CopyAll(ctx.(*ExprNotContext)) + + return p +} + +func (s *ExprNotBaseContext) GetParent_() IExprPredicateContext { return s.parent_ } + +func (s *ExprNotBaseContext) SetParent_(v IExprPredicateContext) { s.parent_ = v } + +func (s *ExprNotBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprNotBaseContext) ExprPredicate() IExprPredicateContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprPredicateContext) +} + +func (s *ExprNotBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExprNotBase(s) + } +} + +func (s *ExprNotBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExprNotBase(s) + } +} + +func (s *ExprNotBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExprNotBase(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExprNot() (localctx IExprNotContext) { + localctx = NewExprNotContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 164, PartiQLParserParserRULE_exprNot) + p.SetState(1073) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserNOT: + localctx = NewNotContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1070) + + var _m = p.Match(PartiQLParserParserNOT) + + localctx.(*NotContext).op = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1071) + + var _x = p.ExprNot() + + localctx.(*NotContext).rhs = _x + } + + case PartiQLParserParserAVG, PartiQLParserParserBIT_LENGTH, PartiQLParserParserCASE, PartiQLParserParserCAST, PartiQLParserParserCHARACTER_LENGTH, PartiQLParserParserCHAR_LENGTH, PartiQLParserParserCOALESCE, PartiQLParserParserCOUNT, PartiQLParserParserDATE, PartiQLParserParserEXISTS, PartiQLParserParserEXTRACT, PartiQLParserParserDATE_ADD, PartiQLParserParserDATE_DIFF, PartiQLParserParserFALSE, PartiQLParserParserLOWER, PartiQLParserParserMAX, PartiQLParserParserMIN, PartiQLParserParserNULL, PartiQLParserParserNULLIF, PartiQLParserParserOCTET_LENGTH, PartiQLParserParserSIZE, PartiQLParserParserSUBSTRING, PartiQLParserParserSUM, PartiQLParserParserTIME, PartiQLParserParserTRIM, PartiQLParserParserTRUE, PartiQLParserParserUPPER, PartiQLParserParserVALUES, PartiQLParserParserLAG, PartiQLParserParserLEAD, PartiQLParserParserCAN_CAST, PartiQLParserParserCAN_LOSSLESS_CAST, PartiQLParserParserMISSING, PartiQLParserParserLIST, PartiQLParserParserSEXP, PartiQLParserParserPLUS, PartiQLParserParserMINUS, PartiQLParserParserAT_SIGN, PartiQLParserParserANGLE_DOUBLE_LEFT, PartiQLParserParserBRACKET_LEFT, PartiQLParserParserBRACE_LEFT, PartiQLParserParserPAREN_LEFT, PartiQLParserParserQUESTION_MARK, PartiQLParserParserLITERAL_STRING, PartiQLParserParserLITERAL_INTEGER, PartiQLParserParserLITERAL_DECIMAL, PartiQLParserParserIDENTIFIER, PartiQLParserParserIDENTIFIER_QUOTED, PartiQLParserParserION_CLOSURE: + localctx = NewExprNotBaseContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1072) + + var _x = p.exprPredicate(0) + + localctx.(*ExprNotBaseContext).parent_ = _x + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprPredicateContext is an interface to support dynamic dispatch. +type IExprPredicateContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsExprPredicateContext differentiates from other interfaces. + IsExprPredicateContext() +} + +type ExprPredicateContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprPredicateContext() *ExprPredicateContext { + var p = new(ExprPredicateContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprPredicate + return p +} + +func InitEmptyExprPredicateContext(p *ExprPredicateContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprPredicate +} + +func (*ExprPredicateContext) IsExprPredicateContext() {} + +func NewExprPredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprPredicateContext { + var p = new(ExprPredicateContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_exprPredicate + + return p +} + +func (s *ExprPredicateContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprPredicateContext) CopyAll(ctx *ExprPredicateContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ExprPredicateContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprPredicateContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type PredicateInContext struct { + ExprPredicateContext + lhs IExprPredicateContext + rhs IMathOp00Context +} + +func NewPredicateInContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateInContext { + var p = new(PredicateInContext) + + InitEmptyExprPredicateContext(&p.ExprPredicateContext) + p.parser = parser + p.CopyAll(ctx.(*ExprPredicateContext)) + + return p +} + +func (s *PredicateInContext) GetLhs() IExprPredicateContext { return s.lhs } + +func (s *PredicateInContext) GetRhs() IMathOp00Context { return s.rhs } + +func (s *PredicateInContext) SetLhs(v IExprPredicateContext) { s.lhs = v } + +func (s *PredicateInContext) SetRhs(v IMathOp00Context) { s.rhs = v } + +func (s *PredicateInContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PredicateInContext) IN() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIN, 0) +} + +func (s *PredicateInContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *PredicateInContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *PredicateInContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *PredicateInContext) ExprPredicate() IExprPredicateContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprPredicateContext) +} + +func (s *PredicateInContext) NOT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNOT, 0) +} + +func (s *PredicateInContext) MathOp00() IMathOp00Context { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMathOp00Context); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMathOp00Context) +} + +func (s *PredicateInContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPredicateIn(s) + } +} + +func (s *PredicateInContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPredicateIn(s) + } +} + +func (s *PredicateInContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPredicateIn(s) + + default: + return t.VisitChildren(s) + } +} + +type PredicateBetweenContext struct { + ExprPredicateContext + lhs IExprPredicateContext + lower IMathOp00Context + upper IMathOp00Context +} + +func NewPredicateBetweenContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateBetweenContext { + var p = new(PredicateBetweenContext) + + InitEmptyExprPredicateContext(&p.ExprPredicateContext) + p.parser = parser + p.CopyAll(ctx.(*ExprPredicateContext)) + + return p +} + +func (s *PredicateBetweenContext) GetLhs() IExprPredicateContext { return s.lhs } + +func (s *PredicateBetweenContext) GetLower() IMathOp00Context { return s.lower } + +func (s *PredicateBetweenContext) GetUpper() IMathOp00Context { return s.upper } + +func (s *PredicateBetweenContext) SetLhs(v IExprPredicateContext) { s.lhs = v } + +func (s *PredicateBetweenContext) SetLower(v IMathOp00Context) { s.lower = v } + +func (s *PredicateBetweenContext) SetUpper(v IMathOp00Context) { s.upper = v } + +func (s *PredicateBetweenContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PredicateBetweenContext) BETWEEN() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBETWEEN, 0) +} + +func (s *PredicateBetweenContext) AND() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAND, 0) +} + +func (s *PredicateBetweenContext) ExprPredicate() IExprPredicateContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprPredicateContext) +} + +func (s *PredicateBetweenContext) AllMathOp00() []IMathOp00Context { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IMathOp00Context); ok { + len++ + } + } + + tst := make([]IMathOp00Context, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IMathOp00Context); ok { + tst[i] = t.(IMathOp00Context) + i++ + } + } + + return tst +} + +func (s *PredicateBetweenContext) MathOp00(i int) IMathOp00Context { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMathOp00Context); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IMathOp00Context) +} + +func (s *PredicateBetweenContext) NOT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNOT, 0) +} + +func (s *PredicateBetweenContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPredicateBetween(s) + } +} + +func (s *PredicateBetweenContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPredicateBetween(s) + } +} + +func (s *PredicateBetweenContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPredicateBetween(s) + + default: + return t.VisitChildren(s) + } +} + +type PredicateBaseContext struct { + ExprPredicateContext + parent_ IMathOp00Context +} + +func NewPredicateBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateBaseContext { + var p = new(PredicateBaseContext) + + InitEmptyExprPredicateContext(&p.ExprPredicateContext) + p.parser = parser + p.CopyAll(ctx.(*ExprPredicateContext)) + + return p +} + +func (s *PredicateBaseContext) GetParent_() IMathOp00Context { return s.parent_ } + +func (s *PredicateBaseContext) SetParent_(v IMathOp00Context) { s.parent_ = v } + +func (s *PredicateBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PredicateBaseContext) MathOp00() IMathOp00Context { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMathOp00Context); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMathOp00Context) +} + +func (s *PredicateBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPredicateBase(s) + } +} + +func (s *PredicateBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPredicateBase(s) + } +} + +func (s *PredicateBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPredicateBase(s) + + default: + return t.VisitChildren(s) + } +} + +type PredicateComparisonContext struct { + ExprPredicateContext + lhs IExprPredicateContext + op antlr.Token + rhs IMathOp00Context +} + +func NewPredicateComparisonContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateComparisonContext { + var p = new(PredicateComparisonContext) + + InitEmptyExprPredicateContext(&p.ExprPredicateContext) + p.parser = parser + p.CopyAll(ctx.(*ExprPredicateContext)) + + return p +} + +func (s *PredicateComparisonContext) GetOp() antlr.Token { return s.op } + +func (s *PredicateComparisonContext) SetOp(v antlr.Token) { s.op = v } + +func (s *PredicateComparisonContext) GetLhs() IExprPredicateContext { return s.lhs } + +func (s *PredicateComparisonContext) GetRhs() IMathOp00Context { return s.rhs } + +func (s *PredicateComparisonContext) SetLhs(v IExprPredicateContext) { s.lhs = v } + +func (s *PredicateComparisonContext) SetRhs(v IMathOp00Context) { s.rhs = v } + +func (s *PredicateComparisonContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PredicateComparisonContext) ExprPredicate() IExprPredicateContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprPredicateContext) +} + +func (s *PredicateComparisonContext) MathOp00() IMathOp00Context { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMathOp00Context); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMathOp00Context) +} + +func (s *PredicateComparisonContext) LT_EQ() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLT_EQ, 0) +} + +func (s *PredicateComparisonContext) GT_EQ() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserGT_EQ, 0) +} + +func (s *PredicateComparisonContext) ANGLE_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_LEFT, 0) +} + +func (s *PredicateComparisonContext) ANGLE_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_RIGHT, 0) +} + +func (s *PredicateComparisonContext) NEQ() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNEQ, 0) +} + +func (s *PredicateComparisonContext) EQ() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEQ, 0) +} + +func (s *PredicateComparisonContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPredicateComparison(s) + } +} + +func (s *PredicateComparisonContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPredicateComparison(s) + } +} + +func (s *PredicateComparisonContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPredicateComparison(s) + + default: + return t.VisitChildren(s) + } +} + +type PredicateIsContext struct { + ExprPredicateContext + lhs IExprPredicateContext +} + +func NewPredicateIsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateIsContext { + var p = new(PredicateIsContext) + + InitEmptyExprPredicateContext(&p.ExprPredicateContext) + p.parser = parser + p.CopyAll(ctx.(*ExprPredicateContext)) + + return p +} + +func (s *PredicateIsContext) GetLhs() IExprPredicateContext { return s.lhs } + +func (s *PredicateIsContext) SetLhs(v IExprPredicateContext) { s.lhs = v } + +func (s *PredicateIsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PredicateIsContext) IS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIS, 0) +} + +func (s *PredicateIsContext) Type_() ITypeContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITypeContext) +} + +func (s *PredicateIsContext) ExprPredicate() IExprPredicateContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprPredicateContext) +} + +func (s *PredicateIsContext) NOT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNOT, 0) +} + +func (s *PredicateIsContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPredicateIs(s) + } +} + +func (s *PredicateIsContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPredicateIs(s) + } +} + +func (s *PredicateIsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPredicateIs(s) + + default: + return t.VisitChildren(s) + } +} + +type PredicateLikeContext struct { + ExprPredicateContext + lhs IExprPredicateContext + rhs IMathOp00Context + escape IExprContext +} + +func NewPredicateLikeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateLikeContext { + var p = new(PredicateLikeContext) + + InitEmptyExprPredicateContext(&p.ExprPredicateContext) + p.parser = parser + p.CopyAll(ctx.(*ExprPredicateContext)) + + return p +} + +func (s *PredicateLikeContext) GetLhs() IExprPredicateContext { return s.lhs } + +func (s *PredicateLikeContext) GetRhs() IMathOp00Context { return s.rhs } + +func (s *PredicateLikeContext) GetEscape() IExprContext { return s.escape } + +func (s *PredicateLikeContext) SetLhs(v IExprPredicateContext) { s.lhs = v } + +func (s *PredicateLikeContext) SetRhs(v IMathOp00Context) { s.rhs = v } + +func (s *PredicateLikeContext) SetEscape(v IExprContext) { s.escape = v } + +func (s *PredicateLikeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PredicateLikeContext) LIKE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLIKE, 0) +} + +func (s *PredicateLikeContext) ExprPredicate() IExprPredicateContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprPredicateContext) +} + +func (s *PredicateLikeContext) MathOp00() IMathOp00Context { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMathOp00Context); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMathOp00Context) +} + +func (s *PredicateLikeContext) NOT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNOT, 0) +} + +func (s *PredicateLikeContext) ESCAPE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserESCAPE, 0) +} + +func (s *PredicateLikeContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *PredicateLikeContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPredicateLike(s) + } +} + +func (s *PredicateLikeContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPredicateLike(s) + } +} + +func (s *PredicateLikeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPredicateLike(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExprPredicate() (localctx IExprPredicateContext) { + return p.exprPredicate(0) +} + +func (p *PartiQLParserParser) exprPredicate(_p int) (localctx IExprPredicateContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewExprPredicateContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx IExprPredicateContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 166 + p.EnterRecursionRule(localctx, 166, PartiQLParserParserRULE_exprPredicate, _p) + var _la int + + var _alt int + + p.EnterOuterAlt(localctx, 1) + localctx = NewPredicateBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + + { + p.SetState(1076) + + var _x = p.mathOp00(0) + + localctx.(*PredicateBaseContext).parent_ = _x + } + + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(1123) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 148, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + p.SetState(1121) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 147, p.GetParserRuleContext()) { + case 1: + localctx = NewPredicateComparisonContext(p, NewExprPredicateContext(p, _parentctx, _parentState)) + localctx.(*PredicateComparisonContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprPredicate) + p.SetState(1078) + + if !(p.Precpred(p.GetParserRuleContext(), 7)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", "")) + goto errorExit + } + { + p.SetState(1079) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*PredicateComparisonContext).op = _lt + + _la = p.GetTokenStream().LA(1) + + if !((int64((_la-276)) & ^0x3f) == 0 && ((int64(1)<<(_la-276))&111) != 0) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*PredicateComparisonContext).op = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1080) + + var _x = p.mathOp00(0) + + localctx.(*PredicateComparisonContext).rhs = _x + } + + case 2: + localctx = NewPredicateIsContext(p, NewExprPredicateContext(p, _parentctx, _parentState)) + localctx.(*PredicateIsContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprPredicate) + p.SetState(1081) + + if !(p.Precpred(p.GetParserRuleContext(), 6)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) + goto errorExit + } + { + p.SetState(1082) + p.Match(PartiQLParserParserIS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1084) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserNOT { + { + p.SetState(1083) + p.Match(PartiQLParserParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(1086) + p.Type_() + } + + case 3: + localctx = NewPredicateInContext(p, NewExprPredicateContext(p, _parentctx, _parentState)) + localctx.(*PredicateInContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprPredicate) + p.SetState(1087) + + if !(p.Precpred(p.GetParserRuleContext(), 5)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) + goto errorExit + } + p.SetState(1089) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserNOT { + { + p.SetState(1088) + p.Match(PartiQLParserParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(1091) + p.Match(PartiQLParserParserIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1092) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1093) + p.Expr() + } + { + p.SetState(1094) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 4: + localctx = NewPredicateInContext(p, NewExprPredicateContext(p, _parentctx, _parentState)) + localctx.(*PredicateInContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprPredicate) + p.SetState(1096) + + if !(p.Precpred(p.GetParserRuleContext(), 4)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) + goto errorExit + } + p.SetState(1098) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserNOT { + { + p.SetState(1097) + p.Match(PartiQLParserParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(1100) + p.Match(PartiQLParserParserIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1101) + + var _x = p.mathOp00(0) + + localctx.(*PredicateInContext).rhs = _x + } + + case 5: + localctx = NewPredicateLikeContext(p, NewExprPredicateContext(p, _parentctx, _parentState)) + localctx.(*PredicateLikeContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprPredicate) + p.SetState(1102) + + if !(p.Precpred(p.GetParserRuleContext(), 3)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + goto errorExit + } + p.SetState(1104) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserNOT { + { + p.SetState(1103) + p.Match(PartiQLParserParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(1106) + p.Match(PartiQLParserParserLIKE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1107) + + var _x = p.mathOp00(0) + + localctx.(*PredicateLikeContext).rhs = _x + } + p.SetState(1110) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 145, p.GetParserRuleContext()) == 1 { + { + p.SetState(1108) + p.Match(PartiQLParserParserESCAPE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1109) + + var _x = p.Expr() + + localctx.(*PredicateLikeContext).escape = _x + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case 6: + localctx = NewPredicateBetweenContext(p, NewExprPredicateContext(p, _parentctx, _parentState)) + localctx.(*PredicateBetweenContext).lhs = _prevctx + + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprPredicate) + p.SetState(1112) + + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + p.SetState(1114) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserNOT { + { + p.SetState(1113) + p.Match(PartiQLParserParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(1116) + p.Match(PartiQLParserParserBETWEEN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1117) + + var _x = p.mathOp00(0) + + localctx.(*PredicateBetweenContext).lower = _x + } + { + p.SetState(1118) + p.Match(PartiQLParserParserAND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1119) + + var _x = p.mathOp00(0) + + localctx.(*PredicateBetweenContext).upper = _x + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + + } + p.SetState(1125) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 148, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IMathOp00Context is an interface to support dynamic dispatch. +type IMathOp00Context interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetOp returns the op token. + GetOp() antlr.Token + + // SetOp sets the op token. + SetOp(antlr.Token) + + // GetLhs returns the lhs rule contexts. + GetLhs() IMathOp00Context + + // GetParent_ returns the parent_ rule contexts. + GetParent_() IMathOp01Context + + // GetRhs returns the rhs rule contexts. + GetRhs() IMathOp01Context + + // SetLhs sets the lhs rule contexts. + SetLhs(IMathOp00Context) + + // SetParent_ sets the parent_ rule contexts. + SetParent_(IMathOp01Context) + + // SetRhs sets the rhs rule contexts. + SetRhs(IMathOp01Context) + + // Getter signatures + MathOp01() IMathOp01Context + MathOp00() IMathOp00Context + CONCAT() antlr.TerminalNode + + // IsMathOp00Context differentiates from other interfaces. + IsMathOp00Context() +} + +type MathOp00Context struct { + antlr.BaseParserRuleContext + parser antlr.Parser + lhs IMathOp00Context + parent_ IMathOp01Context + op antlr.Token + rhs IMathOp01Context +} + +func NewEmptyMathOp00Context() *MathOp00Context { + var p = new(MathOp00Context) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_mathOp00 + return p +} + +func InitEmptyMathOp00Context(p *MathOp00Context) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_mathOp00 +} + +func (*MathOp00Context) IsMathOp00Context() {} + +func NewMathOp00Context(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MathOp00Context { + var p = new(MathOp00Context) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_mathOp00 + + return p +} + +func (s *MathOp00Context) GetParser() antlr.Parser { return s.parser } + +func (s *MathOp00Context) GetOp() antlr.Token { return s.op } + +func (s *MathOp00Context) SetOp(v antlr.Token) { s.op = v } + +func (s *MathOp00Context) GetLhs() IMathOp00Context { return s.lhs } + +func (s *MathOp00Context) GetParent_() IMathOp01Context { return s.parent_ } + +func (s *MathOp00Context) GetRhs() IMathOp01Context { return s.rhs } + +func (s *MathOp00Context) SetLhs(v IMathOp00Context) { s.lhs = v } + +func (s *MathOp00Context) SetParent_(v IMathOp01Context) { s.parent_ = v } + +func (s *MathOp00Context) SetRhs(v IMathOp01Context) { s.rhs = v } + +func (s *MathOp00Context) MathOp01() IMathOp01Context { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMathOp01Context); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMathOp01Context) +} + +func (s *MathOp00Context) MathOp00() IMathOp00Context { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMathOp00Context); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMathOp00Context) +} + +func (s *MathOp00Context) CONCAT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCONCAT, 0) +} + +func (s *MathOp00Context) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MathOp00Context) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MathOp00Context) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterMathOp00(s) + } +} + +func (s *MathOp00Context) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitMathOp00(s) + } +} + +func (s *MathOp00Context) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitMathOp00(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) MathOp00() (localctx IMathOp00Context) { + return p.mathOp00(0) +} + +func (p *PartiQLParserParser) mathOp00(_p int) (localctx IMathOp00Context) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewMathOp00Context(p, p.GetParserRuleContext(), _parentState) + var _prevctx IMathOp00Context = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 168 + p.EnterRecursionRule(localctx, 168, PartiQLParserParserRULE_mathOp00, _p) + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1127) + + var _x = p.mathOp01(0) + + localctx.(*MathOp00Context).parent_ = _x + } + + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(1134) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 149, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + localctx = NewMathOp00Context(p, _parentctx, _parentState) + localctx.(*MathOp00Context).lhs = _prevctx + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_mathOp00) + p.SetState(1129) + + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + { + p.SetState(1130) + + var _m = p.Match(PartiQLParserParserCONCAT) + + localctx.(*MathOp00Context).op = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1131) + + var _x = p.mathOp01(0) + + localctx.(*MathOp00Context).rhs = _x + } + + } + p.SetState(1136) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 149, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IMathOp01Context is an interface to support dynamic dispatch. +type IMathOp01Context interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetOp returns the op token. + GetOp() antlr.Token + + // SetOp sets the op token. + SetOp(antlr.Token) + + // GetLhs returns the lhs rule contexts. + GetLhs() IMathOp01Context + + // GetParent_ returns the parent_ rule contexts. + GetParent_() IMathOp02Context + + // GetRhs returns the rhs rule contexts. + GetRhs() IMathOp02Context + + // SetLhs sets the lhs rule contexts. + SetLhs(IMathOp01Context) + + // SetParent_ sets the parent_ rule contexts. + SetParent_(IMathOp02Context) + + // SetRhs sets the rhs rule contexts. + SetRhs(IMathOp02Context) + + // Getter signatures + MathOp02() IMathOp02Context + MathOp01() IMathOp01Context + PLUS() antlr.TerminalNode + MINUS() antlr.TerminalNode + + // IsMathOp01Context differentiates from other interfaces. + IsMathOp01Context() +} + +type MathOp01Context struct { + antlr.BaseParserRuleContext + parser antlr.Parser + lhs IMathOp01Context + parent_ IMathOp02Context + op antlr.Token + rhs IMathOp02Context +} + +func NewEmptyMathOp01Context() *MathOp01Context { + var p = new(MathOp01Context) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_mathOp01 + return p +} + +func InitEmptyMathOp01Context(p *MathOp01Context) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_mathOp01 +} + +func (*MathOp01Context) IsMathOp01Context() {} + +func NewMathOp01Context(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MathOp01Context { + var p = new(MathOp01Context) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_mathOp01 + + return p +} + +func (s *MathOp01Context) GetParser() antlr.Parser { return s.parser } + +func (s *MathOp01Context) GetOp() antlr.Token { return s.op } + +func (s *MathOp01Context) SetOp(v antlr.Token) { s.op = v } + +func (s *MathOp01Context) GetLhs() IMathOp01Context { return s.lhs } + +func (s *MathOp01Context) GetParent_() IMathOp02Context { return s.parent_ } + +func (s *MathOp01Context) GetRhs() IMathOp02Context { return s.rhs } + +func (s *MathOp01Context) SetLhs(v IMathOp01Context) { s.lhs = v } + +func (s *MathOp01Context) SetParent_(v IMathOp02Context) { s.parent_ = v } + +func (s *MathOp01Context) SetRhs(v IMathOp02Context) { s.rhs = v } + +func (s *MathOp01Context) MathOp02() IMathOp02Context { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMathOp02Context); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMathOp02Context) +} + +func (s *MathOp01Context) MathOp01() IMathOp01Context { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMathOp01Context); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMathOp01Context) +} + +func (s *MathOp01Context) PLUS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPLUS, 0) +} + +func (s *MathOp01Context) MINUS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMINUS, 0) +} + +func (s *MathOp01Context) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MathOp01Context) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MathOp01Context) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterMathOp01(s) + } +} + +func (s *MathOp01Context) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitMathOp01(s) + } +} + +func (s *MathOp01Context) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitMathOp01(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) MathOp01() (localctx IMathOp01Context) { + return p.mathOp01(0) +} + +func (p *PartiQLParserParser) mathOp01(_p int) (localctx IMathOp01Context) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewMathOp01Context(p, p.GetParserRuleContext(), _parentState) + var _prevctx IMathOp01Context = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 170 + p.EnterRecursionRule(localctx, 170, PartiQLParserParserRULE_mathOp01, _p) + var _la int + + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1138) + + var _x = p.mathOp02(0) + + localctx.(*MathOp01Context).parent_ = _x + } + + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(1145) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 150, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + localctx = NewMathOp01Context(p, _parentctx, _parentState) + localctx.(*MathOp01Context).lhs = _prevctx + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_mathOp01) + p.SetState(1140) + + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + { + p.SetState(1141) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*MathOp01Context).op = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserPLUS || _la == PartiQLParserParserMINUS) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*MathOp01Context).op = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1142) + + var _x = p.mathOp02(0) + + localctx.(*MathOp01Context).rhs = _x + } + + } + p.SetState(1147) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 150, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IMathOp02Context is an interface to support dynamic dispatch. +type IMathOp02Context interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetOp returns the op token. + GetOp() antlr.Token + + // SetOp sets the op token. + SetOp(antlr.Token) + + // GetLhs returns the lhs rule contexts. + GetLhs() IMathOp02Context + + // GetParent_ returns the parent_ rule contexts. + GetParent_() IValueExprContext + + // GetRhs returns the rhs rule contexts. + GetRhs() IValueExprContext + + // SetLhs sets the lhs rule contexts. + SetLhs(IMathOp02Context) + + // SetParent_ sets the parent_ rule contexts. + SetParent_(IValueExprContext) + + // SetRhs sets the rhs rule contexts. + SetRhs(IValueExprContext) + + // Getter signatures + ValueExpr() IValueExprContext + MathOp02() IMathOp02Context + PERCENT() antlr.TerminalNode + ASTERISK() antlr.TerminalNode + SLASH_FORWARD() antlr.TerminalNode + + // IsMathOp02Context differentiates from other interfaces. + IsMathOp02Context() +} + +type MathOp02Context struct { + antlr.BaseParserRuleContext + parser antlr.Parser + lhs IMathOp02Context + parent_ IValueExprContext + op antlr.Token + rhs IValueExprContext +} + +func NewEmptyMathOp02Context() *MathOp02Context { + var p = new(MathOp02Context) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_mathOp02 + return p +} + +func InitEmptyMathOp02Context(p *MathOp02Context) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_mathOp02 +} + +func (*MathOp02Context) IsMathOp02Context() {} + +func NewMathOp02Context(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MathOp02Context { + var p = new(MathOp02Context) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_mathOp02 + + return p +} + +func (s *MathOp02Context) GetParser() antlr.Parser { return s.parser } + +func (s *MathOp02Context) GetOp() antlr.Token { return s.op } + +func (s *MathOp02Context) SetOp(v antlr.Token) { s.op = v } + +func (s *MathOp02Context) GetLhs() IMathOp02Context { return s.lhs } + +func (s *MathOp02Context) GetParent_() IValueExprContext { return s.parent_ } + +func (s *MathOp02Context) GetRhs() IValueExprContext { return s.rhs } + +func (s *MathOp02Context) SetLhs(v IMathOp02Context) { s.lhs = v } + +func (s *MathOp02Context) SetParent_(v IValueExprContext) { s.parent_ = v } + +func (s *MathOp02Context) SetRhs(v IValueExprContext) { s.rhs = v } + +func (s *MathOp02Context) ValueExpr() IValueExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *MathOp02Context) MathOp02() IMathOp02Context { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMathOp02Context); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMathOp02Context) +} + +func (s *MathOp02Context) PERCENT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPERCENT, 0) +} + +func (s *MathOp02Context) ASTERISK() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserASTERISK, 0) +} + +func (s *MathOp02Context) SLASH_FORWARD() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSLASH_FORWARD, 0) +} + +func (s *MathOp02Context) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MathOp02Context) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MathOp02Context) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterMathOp02(s) + } +} + +func (s *MathOp02Context) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitMathOp02(s) + } +} + +func (s *MathOp02Context) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitMathOp02(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) MathOp02() (localctx IMathOp02Context) { + return p.mathOp02(0) +} + +func (p *PartiQLParserParser) mathOp02(_p int) (localctx IMathOp02Context) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewMathOp02Context(p, p.GetParserRuleContext(), _parentState) + var _prevctx IMathOp02Context = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 172 + p.EnterRecursionRule(localctx, 172, PartiQLParserParserRULE_mathOp02, _p) + var _la int + + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1149) + + var _x = p.ValueExpr() + + localctx.(*MathOp02Context).parent_ = _x + } + + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(1156) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 151, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + localctx = NewMathOp02Context(p, _parentctx, _parentState) + localctx.(*MathOp02Context).lhs = _prevctx + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_mathOp02) + p.SetState(1151) + + if !(p.Precpred(p.GetParserRuleContext(), 2)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) + goto errorExit + } + { + p.SetState(1152) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*MathOp02Context).op = _lt + + _la = p.GetTokenStream().LA(1) + + if !((int64((_la-271)) & ^0x3f) == 0 && ((int64(1)<<(_la-271))&19) != 0) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*MathOp02Context).op = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1153) + + var _x = p.ValueExpr() + + localctx.(*MathOp02Context).rhs = _x + } + + } + p.SetState(1158) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 151, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IValueExprContext is an interface to support dynamic dispatch. +type IValueExprContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetSign returns the sign token. + GetSign() antlr.Token + + // SetSign sets the sign token. + SetSign(antlr.Token) + + // GetRhs returns the rhs rule contexts. + GetRhs() IValueExprContext + + // GetParent_ returns the parent_ rule contexts. + GetParent_() IExprPrimaryContext + + // SetRhs sets the rhs rule contexts. + SetRhs(IValueExprContext) + + // SetParent_ sets the parent_ rule contexts. + SetParent_(IExprPrimaryContext) + + // Getter signatures + ValueExpr() IValueExprContext + PLUS() antlr.TerminalNode + MINUS() antlr.TerminalNode + ExprPrimary() IExprPrimaryContext + + // IsValueExprContext differentiates from other interfaces. + IsValueExprContext() +} + +type ValueExprContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + sign antlr.Token + rhs IValueExprContext + parent_ IExprPrimaryContext +} + +func NewEmptyValueExprContext() *ValueExprContext { + var p = new(ValueExprContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_valueExpr + return p +} + +func InitEmptyValueExprContext(p *ValueExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_valueExpr +} + +func (*ValueExprContext) IsValueExprContext() {} + +func NewValueExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValueExprContext { + var p = new(ValueExprContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_valueExpr + + return p +} + +func (s *ValueExprContext) GetParser() antlr.Parser { return s.parser } + +func (s *ValueExprContext) GetSign() antlr.Token { return s.sign } + +func (s *ValueExprContext) SetSign(v antlr.Token) { s.sign = v } + +func (s *ValueExprContext) GetRhs() IValueExprContext { return s.rhs } + +func (s *ValueExprContext) GetParent_() IExprPrimaryContext { return s.parent_ } + +func (s *ValueExprContext) SetRhs(v IValueExprContext) { s.rhs = v } + +func (s *ValueExprContext) SetParent_(v IExprPrimaryContext) { s.parent_ = v } + +func (s *ValueExprContext) ValueExpr() IValueExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValueExprContext) +} + +func (s *ValueExprContext) PLUS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPLUS, 0) +} + +func (s *ValueExprContext) MINUS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMINUS, 0) +} + +func (s *ValueExprContext) ExprPrimary() IExprPrimaryContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprPrimaryContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprPrimaryContext) +} + +func (s *ValueExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ValueExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ValueExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterValueExpr(s) + } +} + +func (s *ValueExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitValueExpr(s) + } +} + +func (s *ValueExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitValueExpr(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ValueExpr() (localctx IValueExprContext) { + localctx = NewValueExprContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 174, PartiQLParserParserRULE_valueExpr) + var _la int + + p.SetState(1162) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserPLUS, PartiQLParserParserMINUS: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1159) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*ValueExprContext).sign = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserPLUS || _la == PartiQLParserParserMINUS) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*ValueExprContext).sign = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1160) + + var _x = p.ValueExpr() + + localctx.(*ValueExprContext).rhs = _x + } + + case PartiQLParserParserAVG, PartiQLParserParserBIT_LENGTH, PartiQLParserParserCASE, PartiQLParserParserCAST, PartiQLParserParserCHARACTER_LENGTH, PartiQLParserParserCHAR_LENGTH, PartiQLParserParserCOALESCE, PartiQLParserParserCOUNT, PartiQLParserParserDATE, PartiQLParserParserEXISTS, PartiQLParserParserEXTRACT, PartiQLParserParserDATE_ADD, PartiQLParserParserDATE_DIFF, PartiQLParserParserFALSE, PartiQLParserParserLOWER, PartiQLParserParserMAX, PartiQLParserParserMIN, PartiQLParserParserNULL, PartiQLParserParserNULLIF, PartiQLParserParserOCTET_LENGTH, PartiQLParserParserSIZE, PartiQLParserParserSUBSTRING, PartiQLParserParserSUM, PartiQLParserParserTIME, PartiQLParserParserTRIM, PartiQLParserParserTRUE, PartiQLParserParserUPPER, PartiQLParserParserVALUES, PartiQLParserParserLAG, PartiQLParserParserLEAD, PartiQLParserParserCAN_CAST, PartiQLParserParserCAN_LOSSLESS_CAST, PartiQLParserParserMISSING, PartiQLParserParserLIST, PartiQLParserParserSEXP, PartiQLParserParserAT_SIGN, PartiQLParserParserANGLE_DOUBLE_LEFT, PartiQLParserParserBRACKET_LEFT, PartiQLParserParserBRACE_LEFT, PartiQLParserParserPAREN_LEFT, PartiQLParserParserQUESTION_MARK, PartiQLParserParserLITERAL_STRING, PartiQLParserParserLITERAL_INTEGER, PartiQLParserParserLITERAL_DECIMAL, PartiQLParserParserIDENTIFIER, PartiQLParserParserIDENTIFIER_QUOTED, PartiQLParserParserION_CLOSURE: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1161) + + var _x = p.exprPrimary(0) + + localctx.(*ValueExprContext).parent_ = _x + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprPrimaryContext is an interface to support dynamic dispatch. +type IExprPrimaryContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsExprPrimaryContext differentiates from other interfaces. + IsExprPrimaryContext() +} + +type ExprPrimaryContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprPrimaryContext() *ExprPrimaryContext { + var p = new(ExprPrimaryContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprPrimary + return p +} + +func InitEmptyExprPrimaryContext(p *ExprPrimaryContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprPrimary +} + +func (*ExprPrimaryContext) IsExprPrimaryContext() {} + +func NewExprPrimaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprPrimaryContext { + var p = new(ExprPrimaryContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_exprPrimary + + return p +} + +func (s *ExprPrimaryContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprPrimaryContext) CopyAll(ctx *ExprPrimaryContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ExprPrimaryContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprPrimaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type ExprPrimaryPathContext struct { + ExprPrimaryContext +} + +func NewExprPrimaryPathContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExprPrimaryPathContext { + var p = new(ExprPrimaryPathContext) + + InitEmptyExprPrimaryContext(&p.ExprPrimaryContext) + p.parser = parser + p.CopyAll(ctx.(*ExprPrimaryContext)) + + return p +} + +func (s *ExprPrimaryPathContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprPrimaryPathContext) ExprPrimary() IExprPrimaryContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprPrimaryContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprPrimaryContext) +} + +func (s *ExprPrimaryPathContext) AllPathStep() []IPathStepContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IPathStepContext); ok { + len++ + } + } + + tst := make([]IPathStepContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IPathStepContext); ok { + tst[i] = t.(IPathStepContext) + i++ + } + } + + return tst +} + +func (s *ExprPrimaryPathContext) PathStep(i int) IPathStepContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPathStepContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IPathStepContext) +} + +func (s *ExprPrimaryPathContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExprPrimaryPath(s) + } +} + +func (s *ExprPrimaryPathContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExprPrimaryPath(s) + } +} + +func (s *ExprPrimaryPathContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExprPrimaryPath(s) + + default: + return t.VisitChildren(s) + } +} + +type ExprPrimaryBaseContext struct { + ExprPrimaryContext +} + +func NewExprPrimaryBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExprPrimaryBaseContext { + var p = new(ExprPrimaryBaseContext) + + InitEmptyExprPrimaryContext(&p.ExprPrimaryContext) + p.parser = parser + p.CopyAll(ctx.(*ExprPrimaryContext)) + + return p +} + +func (s *ExprPrimaryBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprPrimaryBaseContext) ExprTerm() IExprTermContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprTermContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprTermContext) +} + +func (s *ExprPrimaryBaseContext) Cast() ICastContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICastContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICastContext) +} + +func (s *ExprPrimaryBaseContext) SequenceConstructor() ISequenceConstructorContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISequenceConstructorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISequenceConstructorContext) +} + +func (s *ExprPrimaryBaseContext) Substring() ISubstringContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISubstringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISubstringContext) +} + +func (s *ExprPrimaryBaseContext) CanCast() ICanCastContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICanCastContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICanCastContext) +} + +func (s *ExprPrimaryBaseContext) CanLosslessCast() ICanLosslessCastContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICanLosslessCastContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICanLosslessCastContext) +} + +func (s *ExprPrimaryBaseContext) Extract() IExtractContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExtractContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExtractContext) +} + +func (s *ExprPrimaryBaseContext) Coalesce() ICoalesceContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICoalesceContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICoalesceContext) +} + +func (s *ExprPrimaryBaseContext) DateFunction() IDateFunctionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDateFunctionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDateFunctionContext) +} + +func (s *ExprPrimaryBaseContext) Aggregate() IAggregateContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAggregateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAggregateContext) +} + +func (s *ExprPrimaryBaseContext) TrimFunction() ITrimFunctionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITrimFunctionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITrimFunctionContext) +} + +func (s *ExprPrimaryBaseContext) FunctionCall() IFunctionCallContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFunctionCallContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFunctionCallContext) +} + +func (s *ExprPrimaryBaseContext) NullIf() INullIfContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INullIfContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(INullIfContext) +} + +func (s *ExprPrimaryBaseContext) ExprGraphMatchMany() IExprGraphMatchManyContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprGraphMatchManyContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprGraphMatchManyContext) +} + +func (s *ExprPrimaryBaseContext) CaseExpr() ICaseExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICaseExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICaseExprContext) +} + +func (s *ExprPrimaryBaseContext) ValueList() IValueListContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueListContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValueListContext) +} + +func (s *ExprPrimaryBaseContext) Values() IValuesContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValuesContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValuesContext) +} + +func (s *ExprPrimaryBaseContext) WindowFunction() IWindowFunctionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IWindowFunctionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IWindowFunctionContext) +} + +func (s *ExprPrimaryBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExprPrimaryBase(s) + } +} + +func (s *ExprPrimaryBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExprPrimaryBase(s) + } +} + +func (s *ExprPrimaryBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExprPrimaryBase(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExprPrimary() (localctx IExprPrimaryContext) { + return p.exprPrimary(0) +} + +func (p *PartiQLParserParser) exprPrimary(_p int) (localctx IExprPrimaryContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + + _parentState := p.GetState() + localctx = NewExprPrimaryContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx IExprPrimaryContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 176 + p.EnterRecursionRule(localctx, 176, PartiQLParserParserRULE_exprPrimary, _p) + var _alt int + + p.EnterOuterAlt(localctx, 1) + p.SetState(1183) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 153, p.GetParserRuleContext()) { + case 1: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + + { + p.SetState(1165) + p.ExprTerm() + } + + case 2: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1166) + p.Cast() + } + + case 3: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1167) + p.SequenceConstructor() + } + + case 4: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1168) + p.Substring() + } + + case 5: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1169) + p.CanCast() + } + + case 6: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1170) + p.CanLosslessCast() + } + + case 7: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1171) + p.Extract() + } + + case 8: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1172) + p.Coalesce() + } + + case 9: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1173) + p.DateFunction() + } + + case 10: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1174) + p.Aggregate() + } + + case 11: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1175) + p.TrimFunction() + } + + case 12: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1176) + p.FunctionCall() + } + + case 13: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1177) + p.NullIf() + } + + case 14: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1178) + p.ExprGraphMatchMany() + } + + case 15: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1179) + p.CaseExpr() + } + + case 16: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1180) + p.ValueList() + } + + case 17: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1181) + p.Values() + } + + case 18: + localctx = NewExprPrimaryBaseContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(1182) + p.WindowFunction() + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) + p.SetState(1193) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 155, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + if p.GetParseListeners() != nil { + p.TriggerExitRuleEvent() + } + _prevctx = localctx + localctx = NewExprPrimaryPathContext(p, NewExprPrimaryContext(p, _parentctx, _parentState)) + p.PushNewRecursionContext(localctx, _startState, PartiQLParserParserRULE_exprPrimary) + p.SetState(1185) + + if !(p.Precpred(p.GetParserRuleContext(), 6)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) + goto errorExit + } + p.SetState(1187) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = 1 + for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + switch _alt { + case 1: + { + p.SetState(1186) + p.PathStep() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + + p.SetState(1189) + p.GetErrorHandler().Sync(p) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 154, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + + } + p.SetState(1195) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 155, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprTermContext is an interface to support dynamic dispatch. +type IExprTermContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsExprTermContext differentiates from other interfaces. + IsExprTermContext() +} + +type ExprTermContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprTermContext() *ExprTermContext { + var p = new(ExprTermContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprTerm + return p +} + +func InitEmptyExprTermContext(p *ExprTermContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprTerm +} + +func (*ExprTermContext) IsExprTermContext() {} + +func NewExprTermContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprTermContext { + var p = new(ExprTermContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_exprTerm + + return p +} + +func (s *ExprTermContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprTermContext) CopyAll(ctx *ExprTermContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ExprTermContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprTermContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type ExprTermWrappedQueryContext struct { + ExprTermContext +} + +func NewExprTermWrappedQueryContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExprTermWrappedQueryContext { + var p = new(ExprTermWrappedQueryContext) + + InitEmptyExprTermContext(&p.ExprTermContext) + p.parser = parser + p.CopyAll(ctx.(*ExprTermContext)) + + return p +} + +func (s *ExprTermWrappedQueryContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprTermWrappedQueryContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *ExprTermWrappedQueryContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *ExprTermWrappedQueryContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *ExprTermWrappedQueryContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExprTermWrappedQuery(s) + } +} + +func (s *ExprTermWrappedQueryContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExprTermWrappedQuery(s) + } +} + +func (s *ExprTermWrappedQueryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExprTermWrappedQuery(s) + + default: + return t.VisitChildren(s) + } +} + +type ExprTermBaseContext struct { + ExprTermContext +} + +func NewExprTermBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExprTermBaseContext { + var p = new(ExprTermBaseContext) + + InitEmptyExprTermContext(&p.ExprTermContext) + p.parser = parser + p.CopyAll(ctx.(*ExprTermContext)) + + return p +} + +func (s *ExprTermBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprTermBaseContext) Parameter() IParameterContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IParameterContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IParameterContext) +} + +func (s *ExprTermBaseContext) VarRefExpr() IVarRefExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IVarRefExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IVarRefExprContext) +} + +func (s *ExprTermBaseContext) Literal() ILiteralContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ILiteralContext) +} + +func (s *ExprTermBaseContext) Collection() ICollectionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICollectionContext) +} + +func (s *ExprTermBaseContext) Tuple() ITupleContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITupleContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITupleContext) +} + +func (s *ExprTermBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExprTermBase(s) + } +} + +func (s *ExprTermBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExprTermBase(s) + } +} + +func (s *ExprTermBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExprTermBase(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExprTerm() (localctx IExprTermContext) { + localctx = NewExprTermContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 178, PartiQLParserParserRULE_exprTerm) + p.SetState(1205) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserPAREN_LEFT: + localctx = NewExprTermWrappedQueryContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1196) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1197) + p.Expr() + } + { + p.SetState(1198) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserQUESTION_MARK: + localctx = NewExprTermBaseContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1200) + p.Parameter() + } + + case PartiQLParserParserAT_SIGN, PartiQLParserParserIDENTIFIER, PartiQLParserParserIDENTIFIER_QUOTED: + localctx = NewExprTermBaseContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(1201) + p.VarRefExpr() + } + + case PartiQLParserParserDATE, PartiQLParserParserFALSE, PartiQLParserParserNULL, PartiQLParserParserTIME, PartiQLParserParserTRUE, PartiQLParserParserMISSING, PartiQLParserParserLITERAL_STRING, PartiQLParserParserLITERAL_INTEGER, PartiQLParserParserLITERAL_DECIMAL, PartiQLParserParserION_CLOSURE: + localctx = NewExprTermBaseContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(1202) + p.Literal() + } + + case PartiQLParserParserANGLE_DOUBLE_LEFT, PartiQLParserParserBRACKET_LEFT: + localctx = NewExprTermBaseContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(1203) + p.Collection() + } + + case PartiQLParserParserBRACE_LEFT: + localctx = NewExprTermBaseContext(p, localctx) + p.EnterOuterAlt(localctx, 6) + { + p.SetState(1204) + p.Tuple() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// INullIfContext is an interface to support dynamic dispatch. +type INullIfContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + NULLIF() antlr.TerminalNode + PAREN_LEFT() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + COMMA() antlr.TerminalNode + PAREN_RIGHT() antlr.TerminalNode + + // IsNullIfContext differentiates from other interfaces. + IsNullIfContext() +} + +type NullIfContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyNullIfContext() *NullIfContext { + var p = new(NullIfContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_nullIf + return p +} + +func InitEmptyNullIfContext(p *NullIfContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_nullIf +} + +func (*NullIfContext) IsNullIfContext() {} + +func NewNullIfContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NullIfContext { + var p = new(NullIfContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_nullIf + + return p +} + +func (s *NullIfContext) GetParser() antlr.Parser { return s.parser } + +func (s *NullIfContext) NULLIF() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNULLIF, 0) +} + +func (s *NullIfContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *NullIfContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *NullIfContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *NullIfContext) COMMA() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, 0) +} + +func (s *NullIfContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *NullIfContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NullIfContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *NullIfContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterNullIf(s) + } +} + +func (s *NullIfContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitNullIf(s) + } +} + +func (s *NullIfContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitNullIf(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) NullIf() (localctx INullIfContext) { + localctx = NewNullIfContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 180, PartiQLParserParserRULE_nullIf) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1207) + p.Match(PartiQLParserParserNULLIF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1208) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1209) + p.Expr() + } + { + p.SetState(1210) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1211) + p.Expr() + } + { + p.SetState(1212) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ICoalesceContext is an interface to support dynamic dispatch. +type ICoalesceContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + COALESCE() antlr.TerminalNode + PAREN_LEFT() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + PAREN_RIGHT() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsCoalesceContext differentiates from other interfaces. + IsCoalesceContext() +} + +type CoalesceContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCoalesceContext() *CoalesceContext { + var p = new(CoalesceContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_coalesce + return p +} + +func InitEmptyCoalesceContext(p *CoalesceContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_coalesce +} + +func (*CoalesceContext) IsCoalesceContext() {} + +func NewCoalesceContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CoalesceContext { + var p = new(CoalesceContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_coalesce + + return p +} + +func (s *CoalesceContext) GetParser() antlr.Parser { return s.parser } + +func (s *CoalesceContext) COALESCE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOALESCE, 0) +} + +func (s *CoalesceContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *CoalesceContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *CoalesceContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *CoalesceContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *CoalesceContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *CoalesceContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *CoalesceContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CoalesceContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CoalesceContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterCoalesce(s) + } +} + +func (s *CoalesceContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitCoalesce(s) + } +} + +func (s *CoalesceContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitCoalesce(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Coalesce() (localctx ICoalesceContext) { + localctx = NewCoalesceContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 182, PartiQLParserParserRULE_coalesce) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1214) + p.Match(PartiQLParserParserCOALESCE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1215) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1216) + p.Expr() + } + p.SetState(1221) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(1217) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1218) + p.Expr() + } + + p.SetState(1223) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(1224) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ICaseExprContext is an interface to support dynamic dispatch. +type ICaseExprContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetCase_ returns the case_ rule contexts. + GetCase_() IExprContext + + // Get_expr returns the _expr rule contexts. + Get_expr() IExprContext + + // GetElse_ returns the else_ rule contexts. + GetElse_() IExprContext + + // SetCase_ sets the case_ rule contexts. + SetCase_(IExprContext) + + // Set_expr sets the _expr rule contexts. + Set_expr(IExprContext) + + // SetElse_ sets the else_ rule contexts. + SetElse_(IExprContext) + + // GetWhens returns the whens rule context list. + GetWhens() []IExprContext + + // GetThens returns the thens rule context list. + GetThens() []IExprContext + + // SetWhens sets the whens rule context list. + SetWhens([]IExprContext) + + // SetThens sets the thens rule context list. + SetThens([]IExprContext) + + // Getter signatures + CASE() antlr.TerminalNode + END() antlr.TerminalNode + AllWHEN() []antlr.TerminalNode + WHEN(i int) antlr.TerminalNode + AllTHEN() []antlr.TerminalNode + THEN(i int) antlr.TerminalNode + ELSE() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + + // IsCaseExprContext differentiates from other interfaces. + IsCaseExprContext() +} + +type CaseExprContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + case_ IExprContext + _expr IExprContext + whens []IExprContext + thens []IExprContext + else_ IExprContext +} + +func NewEmptyCaseExprContext() *CaseExprContext { + var p = new(CaseExprContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_caseExpr + return p +} + +func InitEmptyCaseExprContext(p *CaseExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_caseExpr +} + +func (*CaseExprContext) IsCaseExprContext() {} + +func NewCaseExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CaseExprContext { + var p = new(CaseExprContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_caseExpr + + return p +} + +func (s *CaseExprContext) GetParser() antlr.Parser { return s.parser } + +func (s *CaseExprContext) GetCase_() IExprContext { return s.case_ } + +func (s *CaseExprContext) Get_expr() IExprContext { return s._expr } + +func (s *CaseExprContext) GetElse_() IExprContext { return s.else_ } + +func (s *CaseExprContext) SetCase_(v IExprContext) { s.case_ = v } + +func (s *CaseExprContext) Set_expr(v IExprContext) { s._expr = v } + +func (s *CaseExprContext) SetElse_(v IExprContext) { s.else_ = v } + +func (s *CaseExprContext) GetWhens() []IExprContext { return s.whens } + +func (s *CaseExprContext) GetThens() []IExprContext { return s.thens } + +func (s *CaseExprContext) SetWhens(v []IExprContext) { s.whens = v } + +func (s *CaseExprContext) SetThens(v []IExprContext) { s.thens = v } + +func (s *CaseExprContext) CASE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCASE, 0) +} + +func (s *CaseExprContext) END() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEND, 0) +} + +func (s *CaseExprContext) AllWHEN() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserWHEN) +} + +func (s *CaseExprContext) WHEN(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserWHEN, i) +} + +func (s *CaseExprContext) AllTHEN() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserTHEN) +} + +func (s *CaseExprContext) THEN(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTHEN, i) +} + +func (s *CaseExprContext) ELSE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserELSE, 0) +} + +func (s *CaseExprContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *CaseExprContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *CaseExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CaseExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CaseExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterCaseExpr(s) + } +} + +func (s *CaseExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitCaseExpr(s) + } +} + +func (s *CaseExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitCaseExpr(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) CaseExpr() (localctx ICaseExprContext) { + localctx = NewCaseExprContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 184, PartiQLParserParserRULE_caseExpr) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1226) + p.Match(PartiQLParserParserCASE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1228) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9024796566781952) != 0) || ((int64((_la-80)) & ^0x3f) == 0 && ((int64(1)<<(_la-80))&-6051008311837327239) != 0) || ((int64((_la-180)) & ^0x3f) == 0 && ((int64(1)<<(_la-180))&68398559028338721) != 0) || ((int64((_la-264)) & ^0x3f) == 0 && ((int64(1)<<(_la-264))&1166665056867) != 0) { + { + p.SetState(1227) + + var _x = p.Expr() + + localctx.(*CaseExprContext).case_ = _x + } + + } + p.SetState(1235) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == PartiQLParserParserWHEN { + { + p.SetState(1230) + p.Match(PartiQLParserParserWHEN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1231) + + var _x = p.Expr() + + localctx.(*CaseExprContext)._expr = _x + } + localctx.(*CaseExprContext).whens = append(localctx.(*CaseExprContext).whens, localctx.(*CaseExprContext)._expr) + { + p.SetState(1232) + p.Match(PartiQLParserParserTHEN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1233) + + var _x = p.Expr() + + localctx.(*CaseExprContext)._expr = _x + } + localctx.(*CaseExprContext).thens = append(localctx.(*CaseExprContext).thens, localctx.(*CaseExprContext)._expr) + + p.SetState(1237) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(1241) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserELSE { + { + p.SetState(1239) + p.Match(PartiQLParserParserELSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1240) + + var _x = p.Expr() + + localctx.(*CaseExprContext).else_ = _x + } + + } + { + p.SetState(1243) + p.Match(PartiQLParserParserEND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IValuesContext is an interface to support dynamic dispatch. +type IValuesContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + VALUES() antlr.TerminalNode + AllValueRow() []IValueRowContext + ValueRow(i int) IValueRowContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsValuesContext differentiates from other interfaces. + IsValuesContext() +} + +type ValuesContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyValuesContext() *ValuesContext { + var p = new(ValuesContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_values + return p +} + +func InitEmptyValuesContext(p *ValuesContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_values +} + +func (*ValuesContext) IsValuesContext() {} + +func NewValuesContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValuesContext { + var p = new(ValuesContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_values + + return p +} + +func (s *ValuesContext) GetParser() antlr.Parser { return s.parser } + +func (s *ValuesContext) VALUES() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserVALUES, 0) +} + +func (s *ValuesContext) AllValueRow() []IValueRowContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IValueRowContext); ok { + len++ + } + } + + tst := make([]IValueRowContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IValueRowContext); ok { + tst[i] = t.(IValueRowContext) + i++ + } + } + + return tst +} + +func (s *ValuesContext) ValueRow(i int) IValueRowContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValueRowContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IValueRowContext) +} + +func (s *ValuesContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *ValuesContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *ValuesContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ValuesContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ValuesContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterValues(s) + } +} + +func (s *ValuesContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitValues(s) + } +} + +func (s *ValuesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitValues(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Values() (localctx IValuesContext) { + localctx = NewValuesContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 186, PartiQLParserParserRULE_values) + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1245) + p.Match(PartiQLParserParserVALUES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1246) + p.ValueRow() + } + p.SetState(1251) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 161, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(1247) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1248) + p.ValueRow() + } + + } + p.SetState(1253) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 161, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IValueRowContext is an interface to support dynamic dispatch. +type IValueRowContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + PAREN_LEFT() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + PAREN_RIGHT() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsValueRowContext differentiates from other interfaces. + IsValueRowContext() +} + +type ValueRowContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyValueRowContext() *ValueRowContext { + var p = new(ValueRowContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_valueRow + return p +} + +func InitEmptyValueRowContext(p *ValueRowContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_valueRow +} + +func (*ValueRowContext) IsValueRowContext() {} + +func NewValueRowContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValueRowContext { + var p = new(ValueRowContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_valueRow + + return p +} + +func (s *ValueRowContext) GetParser() antlr.Parser { return s.parser } + +func (s *ValueRowContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *ValueRowContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *ValueRowContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *ValueRowContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *ValueRowContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *ValueRowContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *ValueRowContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ValueRowContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ValueRowContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterValueRow(s) + } +} + +func (s *ValueRowContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitValueRow(s) + } +} + +func (s *ValueRowContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitValueRow(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ValueRow() (localctx IValueRowContext) { + localctx = NewValueRowContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 188, PartiQLParserParserRULE_valueRow) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1254) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1255) + p.Expr() + } + p.SetState(1260) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(1256) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1257) + p.Expr() + } + + p.SetState(1262) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(1263) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IValueListContext is an interface to support dynamic dispatch. +type IValueListContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + PAREN_LEFT() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + PAREN_RIGHT() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsValueListContext differentiates from other interfaces. + IsValueListContext() +} + +type ValueListContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyValueListContext() *ValueListContext { + var p = new(ValueListContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_valueList + return p +} + +func InitEmptyValueListContext(p *ValueListContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_valueList +} + +func (*ValueListContext) IsValueListContext() {} + +func NewValueListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValueListContext { + var p = new(ValueListContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_valueList + + return p +} + +func (s *ValueListContext) GetParser() antlr.Parser { return s.parser } + +func (s *ValueListContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *ValueListContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *ValueListContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *ValueListContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *ValueListContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *ValueListContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *ValueListContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ValueListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ValueListContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterValueList(s) + } +} + +func (s *ValueListContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitValueList(s) + } +} + +func (s *ValueListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitValueList(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ValueList() (localctx IValueListContext) { + localctx = NewValueListContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 190, PartiQLParserParserRULE_valueList) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1265) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1266) + p.Expr() + } + p.SetState(1269) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == PartiQLParserParserCOMMA { + { + p.SetState(1267) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1268) + p.Expr() + } + + p.SetState(1271) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(1273) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ISequenceConstructorContext is an interface to support dynamic dispatch. +type ISequenceConstructorContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetDatatype returns the datatype token. + GetDatatype() antlr.Token + + // SetDatatype sets the datatype token. + SetDatatype(antlr.Token) + + // Getter signatures + PAREN_LEFT() antlr.TerminalNode + PAREN_RIGHT() antlr.TerminalNode + LIST() antlr.TerminalNode + SEXP() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsSequenceConstructorContext differentiates from other interfaces. + IsSequenceConstructorContext() +} + +type SequenceConstructorContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + datatype antlr.Token +} + +func NewEmptySequenceConstructorContext() *SequenceConstructorContext { + var p = new(SequenceConstructorContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_sequenceConstructor + return p +} + +func InitEmptySequenceConstructorContext(p *SequenceConstructorContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_sequenceConstructor +} + +func (*SequenceConstructorContext) IsSequenceConstructorContext() {} + +func NewSequenceConstructorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SequenceConstructorContext { + var p = new(SequenceConstructorContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_sequenceConstructor + + return p +} + +func (s *SequenceConstructorContext) GetParser() antlr.Parser { return s.parser } + +func (s *SequenceConstructorContext) GetDatatype() antlr.Token { return s.datatype } + +func (s *SequenceConstructorContext) SetDatatype(v antlr.Token) { s.datatype = v } + +func (s *SequenceConstructorContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *SequenceConstructorContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *SequenceConstructorContext) LIST() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLIST, 0) +} + +func (s *SequenceConstructorContext) SEXP() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSEXP, 0) +} + +func (s *SequenceConstructorContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *SequenceConstructorContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *SequenceConstructorContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *SequenceConstructorContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *SequenceConstructorContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SequenceConstructorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SequenceConstructorContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSequenceConstructor(s) + } +} + +func (s *SequenceConstructorContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSequenceConstructor(s) + } +} + +func (s *SequenceConstructorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSequenceConstructor(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) SequenceConstructor() (localctx ISequenceConstructorContext) { + localctx = NewSequenceConstructorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 192, PartiQLParserParserRULE_sequenceConstructor) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1275) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*SequenceConstructorContext).datatype = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserLIST || _la == PartiQLParserParserSEXP) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*SequenceConstructorContext).datatype = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1276) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1285) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9024796566781952) != 0) || ((int64((_la-80)) & ^0x3f) == 0 && ((int64(1)<<(_la-80))&-6051008311837327239) != 0) || ((int64((_la-180)) & ^0x3f) == 0 && ((int64(1)<<(_la-180))&68398559028338721) != 0) || ((int64((_la-264)) & ^0x3f) == 0 && ((int64(1)<<(_la-264))&1166665056867) != 0) { + { + p.SetState(1277) + p.Expr() + } + p.SetState(1282) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(1278) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1279) + p.Expr() + } + + p.SetState(1284) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(1287) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ISubstringContext is an interface to support dynamic dispatch. +type ISubstringContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SUBSTRING() antlr.TerminalNode + PAREN_LEFT() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + PAREN_RIGHT() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + FROM() antlr.TerminalNode + FOR() antlr.TerminalNode + + // IsSubstringContext differentiates from other interfaces. + IsSubstringContext() +} + +type SubstringContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySubstringContext() *SubstringContext { + var p = new(SubstringContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_substring + return p +} + +func InitEmptySubstringContext(p *SubstringContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_substring +} + +func (*SubstringContext) IsSubstringContext() {} + +func NewSubstringContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SubstringContext { + var p = new(SubstringContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_substring + + return p +} + +func (s *SubstringContext) GetParser() antlr.Parser { return s.parser } + +func (s *SubstringContext) SUBSTRING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSUBSTRING, 0) +} + +func (s *SubstringContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *SubstringContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *SubstringContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *SubstringContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *SubstringContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *SubstringContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *SubstringContext) FROM() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFROM, 0) +} + +func (s *SubstringContext) FOR() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFOR, 0) +} + +func (s *SubstringContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SubstringContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SubstringContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterSubstring(s) + } +} + +func (s *SubstringContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitSubstring(s) + } +} + +func (s *SubstringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitSubstring(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Substring() (localctx ISubstringContext) { + localctx = NewSubstringContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 194, PartiQLParserParserRULE_substring) + var _la int + + p.SetState(1315) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 170, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1289) + p.Match(PartiQLParserParserSUBSTRING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1290) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1291) + p.Expr() + } + p.SetState(1298) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserCOMMA { + { + p.SetState(1292) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1293) + p.Expr() + } + p.SetState(1296) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserCOMMA { + { + p.SetState(1294) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1295) + p.Expr() + } + + } + + } + { + p.SetState(1300) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1302) + p.Match(PartiQLParserParserSUBSTRING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1303) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1304) + p.Expr() + } + p.SetState(1311) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserFROM { + { + p.SetState(1305) + p.Match(PartiQLParserParserFROM) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1306) + p.Expr() + } + p.SetState(1309) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserFOR { + { + p.SetState(1307) + p.Match(PartiQLParserParserFOR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1308) + p.Expr() + } + + } + + } + { + p.SetState(1313) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IAggregateContext is an interface to support dynamic dispatch. +type IAggregateContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsAggregateContext differentiates from other interfaces. + IsAggregateContext() +} + +type AggregateContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAggregateContext() *AggregateContext { + var p = new(AggregateContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_aggregate + return p +} + +func InitEmptyAggregateContext(p *AggregateContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_aggregate +} + +func (*AggregateContext) IsAggregateContext() {} + +func NewAggregateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AggregateContext { + var p = new(AggregateContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_aggregate + + return p +} + +func (s *AggregateContext) GetParser() antlr.Parser { return s.parser } + +func (s *AggregateContext) CopyAll(ctx *AggregateContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *AggregateContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AggregateContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type AggregateBaseContext struct { + AggregateContext + func_ antlr.Token +} + +func NewAggregateBaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AggregateBaseContext { + var p = new(AggregateBaseContext) + + InitEmptyAggregateContext(&p.AggregateContext) + p.parser = parser + p.CopyAll(ctx.(*AggregateContext)) + + return p +} + +func (s *AggregateBaseContext) GetFunc_() antlr.Token { return s.func_ } + +func (s *AggregateBaseContext) SetFunc_(v antlr.Token) { s.func_ = v } + +func (s *AggregateBaseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AggregateBaseContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *AggregateBaseContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *AggregateBaseContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *AggregateBaseContext) COUNT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOUNT, 0) +} + +func (s *AggregateBaseContext) MAX() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMAX, 0) +} + +func (s *AggregateBaseContext) MIN() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMIN, 0) +} + +func (s *AggregateBaseContext) SUM() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSUM, 0) +} + +func (s *AggregateBaseContext) AVG() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAVG, 0) +} + +func (s *AggregateBaseContext) SetQuantifierStrategy() ISetQuantifierStrategyContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISetQuantifierStrategyContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISetQuantifierStrategyContext) +} + +func (s *AggregateBaseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterAggregateBase(s) + } +} + +func (s *AggregateBaseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitAggregateBase(s) + } +} + +func (s *AggregateBaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitAggregateBase(s) + + default: + return t.VisitChildren(s) + } +} + +type CountAllContext struct { + AggregateContext + func_ antlr.Token +} + +func NewCountAllContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CountAllContext { + var p = new(CountAllContext) + + InitEmptyAggregateContext(&p.AggregateContext) + p.parser = parser + p.CopyAll(ctx.(*AggregateContext)) + + return p +} + +func (s *CountAllContext) GetFunc_() antlr.Token { return s.func_ } + +func (s *CountAllContext) SetFunc_(v antlr.Token) { s.func_ = v } + +func (s *CountAllContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CountAllContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *CountAllContext) ASTERISK() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserASTERISK, 0) +} + +func (s *CountAllContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *CountAllContext) COUNT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOUNT, 0) +} + +func (s *CountAllContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterCountAll(s) + } +} + +func (s *CountAllContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitCountAll(s) + } +} + +func (s *CountAllContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitCountAll(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Aggregate() (localctx IAggregateContext) { + localctx = NewAggregateContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 196, PartiQLParserParserRULE_aggregate) + var _la int + + p.SetState(1329) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 172, p.GetParserRuleContext()) { + case 1: + localctx = NewCountAllContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1317) + + var _m = p.Match(PartiQLParserParserCOUNT) + + localctx.(*CountAllContext).func_ = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1318) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1319) + p.Match(PartiQLParserParserASTERISK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1320) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + localctx = NewAggregateBaseContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1321) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*AggregateBaseContext).func_ = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserAVG || _la == PartiQLParserParserCOUNT || _la == PartiQLParserParserMAX || _la == PartiQLParserParserMIN || _la == PartiQLParserParserSUM) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*AggregateBaseContext).func_ = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1322) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1324) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserALL || _la == PartiQLParserParserDISTINCT { + { + p.SetState(1323) + p.SetQuantifierStrategy() + } + + } + { + p.SetState(1326) + p.Expr() + } + { + p.SetState(1327) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IWindowFunctionContext is an interface to support dynamic dispatch. +type IWindowFunctionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsWindowFunctionContext differentiates from other interfaces. + IsWindowFunctionContext() +} + +type WindowFunctionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyWindowFunctionContext() *WindowFunctionContext { + var p = new(WindowFunctionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_windowFunction + return p +} + +func InitEmptyWindowFunctionContext(p *WindowFunctionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_windowFunction +} + +func (*WindowFunctionContext) IsWindowFunctionContext() {} + +func NewWindowFunctionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WindowFunctionContext { + var p = new(WindowFunctionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_windowFunction + + return p +} + +func (s *WindowFunctionContext) GetParser() antlr.Parser { return s.parser } + +func (s *WindowFunctionContext) CopyAll(ctx *WindowFunctionContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *WindowFunctionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *WindowFunctionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type LagLeadFunctionContext struct { + WindowFunctionContext + func_ antlr.Token +} + +func NewLagLeadFunctionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LagLeadFunctionContext { + var p = new(LagLeadFunctionContext) + + InitEmptyWindowFunctionContext(&p.WindowFunctionContext) + p.parser = parser + p.CopyAll(ctx.(*WindowFunctionContext)) + + return p +} + +func (s *LagLeadFunctionContext) GetFunc_() antlr.Token { return s.func_ } + +func (s *LagLeadFunctionContext) SetFunc_(v antlr.Token) { s.func_ = v } + +func (s *LagLeadFunctionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LagLeadFunctionContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *LagLeadFunctionContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *LagLeadFunctionContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *LagLeadFunctionContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *LagLeadFunctionContext) Over() IOverContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOverContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IOverContext) +} + +func (s *LagLeadFunctionContext) LAG() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLAG, 0) +} + +func (s *LagLeadFunctionContext) LEAD() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLEAD, 0) +} + +func (s *LagLeadFunctionContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *LagLeadFunctionContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *LagLeadFunctionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLagLeadFunction(s) + } +} + +func (s *LagLeadFunctionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLagLeadFunction(s) + } +} + +func (s *LagLeadFunctionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLagLeadFunction(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) WindowFunction() (localctx IWindowFunctionContext) { + localctx = NewWindowFunctionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 198, PartiQLParserParserRULE_windowFunction) + var _la int + + localctx = NewLagLeadFunctionContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1331) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*LagLeadFunctionContext).func_ = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserLAG || _la == PartiQLParserParserLEAD) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*LagLeadFunctionContext).func_ = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1332) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1333) + p.Expr() + } + p.SetState(1340) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserCOMMA { + { + p.SetState(1334) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1335) + p.Expr() + } + p.SetState(1338) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserCOMMA { + { + p.SetState(1336) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1337) + p.Expr() + } + + } + + } + { + p.SetState(1342) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1343) + p.Over() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ICastContext is an interface to support dynamic dispatch. +type ICastContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + CAST() antlr.TerminalNode + PAREN_LEFT() antlr.TerminalNode + Expr() IExprContext + AS() antlr.TerminalNode + Type_() ITypeContext + PAREN_RIGHT() antlr.TerminalNode + + // IsCastContext differentiates from other interfaces. + IsCastContext() +} + +type CastContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCastContext() *CastContext { + var p = new(CastContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_cast + return p +} + +func InitEmptyCastContext(p *CastContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_cast +} + +func (*CastContext) IsCastContext() {} + +func NewCastContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CastContext { + var p = new(CastContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_cast + + return p +} + +func (s *CastContext) GetParser() antlr.Parser { return s.parser } + +func (s *CastContext) CAST() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCAST, 0) +} + +func (s *CastContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *CastContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *CastContext) AS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAS, 0) +} + +func (s *CastContext) Type_() ITypeContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITypeContext) +} + +func (s *CastContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *CastContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CastContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CastContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterCast(s) + } +} + +func (s *CastContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitCast(s) + } +} + +func (s *CastContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitCast(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Cast() (localctx ICastContext) { + localctx = NewCastContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 200, PartiQLParserParserRULE_cast) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1345) + p.Match(PartiQLParserParserCAST) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1346) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1347) + p.Expr() + } + { + p.SetState(1348) + p.Match(PartiQLParserParserAS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1349) + p.Type_() + } + { + p.SetState(1350) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ICanLosslessCastContext is an interface to support dynamic dispatch. +type ICanLosslessCastContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + CAN_LOSSLESS_CAST() antlr.TerminalNode + PAREN_LEFT() antlr.TerminalNode + Expr() IExprContext + AS() antlr.TerminalNode + Type_() ITypeContext + PAREN_RIGHT() antlr.TerminalNode + + // IsCanLosslessCastContext differentiates from other interfaces. + IsCanLosslessCastContext() +} + +type CanLosslessCastContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCanLosslessCastContext() *CanLosslessCastContext { + var p = new(CanLosslessCastContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_canLosslessCast + return p +} + +func InitEmptyCanLosslessCastContext(p *CanLosslessCastContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_canLosslessCast +} + +func (*CanLosslessCastContext) IsCanLosslessCastContext() {} + +func NewCanLosslessCastContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CanLosslessCastContext { + var p = new(CanLosslessCastContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_canLosslessCast + + return p +} + +func (s *CanLosslessCastContext) GetParser() antlr.Parser { return s.parser } + +func (s *CanLosslessCastContext) CAN_LOSSLESS_CAST() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCAN_LOSSLESS_CAST, 0) +} + +func (s *CanLosslessCastContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *CanLosslessCastContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *CanLosslessCastContext) AS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAS, 0) +} + +func (s *CanLosslessCastContext) Type_() ITypeContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITypeContext) +} + +func (s *CanLosslessCastContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *CanLosslessCastContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CanLosslessCastContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CanLosslessCastContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterCanLosslessCast(s) + } +} + +func (s *CanLosslessCastContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitCanLosslessCast(s) + } +} + +func (s *CanLosslessCastContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitCanLosslessCast(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) CanLosslessCast() (localctx ICanLosslessCastContext) { + localctx = NewCanLosslessCastContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 202, PartiQLParserParserRULE_canLosslessCast) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1352) + p.Match(PartiQLParserParserCAN_LOSSLESS_CAST) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1353) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1354) + p.Expr() + } + { + p.SetState(1355) + p.Match(PartiQLParserParserAS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1356) + p.Type_() + } + { + p.SetState(1357) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ICanCastContext is an interface to support dynamic dispatch. +type ICanCastContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + CAN_CAST() antlr.TerminalNode + PAREN_LEFT() antlr.TerminalNode + Expr() IExprContext + AS() antlr.TerminalNode + Type_() ITypeContext + PAREN_RIGHT() antlr.TerminalNode + + // IsCanCastContext differentiates from other interfaces. + IsCanCastContext() +} + +type CanCastContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCanCastContext() *CanCastContext { + var p = new(CanCastContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_canCast + return p +} + +func InitEmptyCanCastContext(p *CanCastContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_canCast +} + +func (*CanCastContext) IsCanCastContext() {} + +func NewCanCastContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CanCastContext { + var p = new(CanCastContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_canCast + + return p +} + +func (s *CanCastContext) GetParser() antlr.Parser { return s.parser } + +func (s *CanCastContext) CAN_CAST() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCAN_CAST, 0) +} + +func (s *CanCastContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *CanCastContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *CanCastContext) AS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAS, 0) +} + +func (s *CanCastContext) Type_() ITypeContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITypeContext) +} + +func (s *CanCastContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *CanCastContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CanCastContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CanCastContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterCanCast(s) + } +} + +func (s *CanCastContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitCanCast(s) + } +} + +func (s *CanCastContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitCanCast(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) CanCast() (localctx ICanCastContext) { + localctx = NewCanCastContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 204, PartiQLParserParserRULE_canCast) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1359) + p.Match(PartiQLParserParserCAN_CAST) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1360) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1361) + p.Expr() + } + { + p.SetState(1362) + p.Match(PartiQLParserParserAS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1363) + p.Type_() + } + { + p.SetState(1364) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExtractContext is an interface to support dynamic dispatch. +type IExtractContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetRhs returns the rhs rule contexts. + GetRhs() IExprContext + + // SetRhs sets the rhs rule contexts. + SetRhs(IExprContext) + + // Getter signatures + EXTRACT() antlr.TerminalNode + PAREN_LEFT() antlr.TerminalNode + IDENTIFIER() antlr.TerminalNode + FROM() antlr.TerminalNode + PAREN_RIGHT() antlr.TerminalNode + Expr() IExprContext + + // IsExtractContext differentiates from other interfaces. + IsExtractContext() +} + +type ExtractContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + rhs IExprContext +} + +func NewEmptyExtractContext() *ExtractContext { + var p = new(ExtractContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_extract + return p +} + +func InitEmptyExtractContext(p *ExtractContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_extract +} + +func (*ExtractContext) IsExtractContext() {} + +func NewExtractContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExtractContext { + var p = new(ExtractContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_extract + + return p +} + +func (s *ExtractContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExtractContext) GetRhs() IExprContext { return s.rhs } + +func (s *ExtractContext) SetRhs(v IExprContext) { s.rhs = v } + +func (s *ExtractContext) EXTRACT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEXTRACT, 0) +} + +func (s *ExtractContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *ExtractContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIDENTIFIER, 0) +} + +func (s *ExtractContext) FROM() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFROM, 0) +} + +func (s *ExtractContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *ExtractContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *ExtractContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExtractContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ExtractContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExtract(s) + } +} + +func (s *ExtractContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExtract(s) + } +} + +func (s *ExtractContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExtract(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Extract() (localctx IExtractContext) { + localctx = NewExtractContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 206, PartiQLParserParserRULE_extract) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1366) + p.Match(PartiQLParserParserEXTRACT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1367) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1368) + p.Match(PartiQLParserParserIDENTIFIER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1369) + p.Match(PartiQLParserParserFROM) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1370) + + var _x = p.Expr() + + localctx.(*ExtractContext).rhs = _x + } + { + p.SetState(1371) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ITrimFunctionContext is an interface to support dynamic dispatch. +type ITrimFunctionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetFunc_ returns the func_ token. + GetFunc_() antlr.Token + + // GetMod returns the mod token. + GetMod() antlr.Token + + // SetFunc_ sets the func_ token. + SetFunc_(antlr.Token) + + // SetMod sets the mod token. + SetMod(antlr.Token) + + // GetSub returns the sub rule contexts. + GetSub() IExprContext + + // GetTarget returns the target rule contexts. + GetTarget() IExprContext + + // SetSub sets the sub rule contexts. + SetSub(IExprContext) + + // SetTarget sets the target rule contexts. + SetTarget(IExprContext) + + // Getter signatures + PAREN_LEFT() antlr.TerminalNode + PAREN_RIGHT() antlr.TerminalNode + TRIM() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + FROM() antlr.TerminalNode + IDENTIFIER() antlr.TerminalNode + + // IsTrimFunctionContext differentiates from other interfaces. + IsTrimFunctionContext() +} + +type TrimFunctionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + func_ antlr.Token + mod antlr.Token + sub IExprContext + target IExprContext +} + +func NewEmptyTrimFunctionContext() *TrimFunctionContext { + var p = new(TrimFunctionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_trimFunction + return p +} + +func InitEmptyTrimFunctionContext(p *TrimFunctionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_trimFunction +} + +func (*TrimFunctionContext) IsTrimFunctionContext() {} + +func NewTrimFunctionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TrimFunctionContext { + var p = new(TrimFunctionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_trimFunction + + return p +} + +func (s *TrimFunctionContext) GetParser() antlr.Parser { return s.parser } + +func (s *TrimFunctionContext) GetFunc_() antlr.Token { return s.func_ } + +func (s *TrimFunctionContext) GetMod() antlr.Token { return s.mod } + +func (s *TrimFunctionContext) SetFunc_(v antlr.Token) { s.func_ = v } + +func (s *TrimFunctionContext) SetMod(v antlr.Token) { s.mod = v } + +func (s *TrimFunctionContext) GetSub() IExprContext { return s.sub } + +func (s *TrimFunctionContext) GetTarget() IExprContext { return s.target } + +func (s *TrimFunctionContext) SetSub(v IExprContext) { s.sub = v } + +func (s *TrimFunctionContext) SetTarget(v IExprContext) { s.target = v } + +func (s *TrimFunctionContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *TrimFunctionContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *TrimFunctionContext) TRIM() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTRIM, 0) +} + +func (s *TrimFunctionContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *TrimFunctionContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *TrimFunctionContext) FROM() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFROM, 0) +} + +func (s *TrimFunctionContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIDENTIFIER, 0) +} + +func (s *TrimFunctionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TrimFunctionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TrimFunctionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTrimFunction(s) + } +} + +func (s *TrimFunctionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTrimFunction(s) + } +} + +func (s *TrimFunctionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTrimFunction(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) TrimFunction() (localctx ITrimFunctionContext) { + localctx = NewTrimFunctionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 208, PartiQLParserParserRULE_trimFunction) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1373) + + var _m = p.Match(PartiQLParserParserTRIM) + + localctx.(*TrimFunctionContext).func_ = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1374) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1382) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 177, p.GetParserRuleContext()) == 1 { + p.SetState(1376) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 175, p.GetParserRuleContext()) == 1 { + { + p.SetState(1375) + + var _m = p.Match(PartiQLParserParserIDENTIFIER) + + localctx.(*TrimFunctionContext).mod = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(1379) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9024796566781952) != 0) || ((int64((_la-80)) & ^0x3f) == 0 && ((int64(1)<<(_la-80))&-6051008311837327239) != 0) || ((int64((_la-180)) & ^0x3f) == 0 && ((int64(1)<<(_la-180))&68398559028338721) != 0) || ((int64((_la-264)) & ^0x3f) == 0 && ((int64(1)<<(_la-264))&1166665056867) != 0) { + { + p.SetState(1378) + + var _x = p.Expr() + + localctx.(*TrimFunctionContext).sub = _x + } + + } + { + p.SetState(1381) + p.Match(PartiQLParserParserFROM) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + { + p.SetState(1384) + + var _x = p.Expr() + + localctx.(*TrimFunctionContext).target = _x + } + { + p.SetState(1385) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IDateFunctionContext is an interface to support dynamic dispatch. +type IDateFunctionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetFunc_ returns the func_ token. + GetFunc_() antlr.Token + + // GetDt returns the dt token. + GetDt() antlr.Token + + // SetFunc_ sets the func_ token. + SetFunc_(antlr.Token) + + // SetDt sets the dt token. + SetDt(antlr.Token) + + // Getter signatures + PAREN_LEFT() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + PAREN_RIGHT() antlr.TerminalNode + IDENTIFIER() antlr.TerminalNode + DATE_ADD() antlr.TerminalNode + DATE_DIFF() antlr.TerminalNode + + // IsDateFunctionContext differentiates from other interfaces. + IsDateFunctionContext() +} + +type DateFunctionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + func_ antlr.Token + dt antlr.Token +} + +func NewEmptyDateFunctionContext() *DateFunctionContext { + var p = new(DateFunctionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_dateFunction + return p +} + +func InitEmptyDateFunctionContext(p *DateFunctionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_dateFunction +} + +func (*DateFunctionContext) IsDateFunctionContext() {} + +func NewDateFunctionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DateFunctionContext { + var p = new(DateFunctionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_dateFunction + + return p +} + +func (s *DateFunctionContext) GetParser() antlr.Parser { return s.parser } + +func (s *DateFunctionContext) GetFunc_() antlr.Token { return s.func_ } + +func (s *DateFunctionContext) GetDt() antlr.Token { return s.dt } + +func (s *DateFunctionContext) SetFunc_(v antlr.Token) { s.func_ = v } + +func (s *DateFunctionContext) SetDt(v antlr.Token) { s.dt = v } + +func (s *DateFunctionContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *DateFunctionContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *DateFunctionContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *DateFunctionContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *DateFunctionContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *DateFunctionContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *DateFunctionContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIDENTIFIER, 0) +} + +func (s *DateFunctionContext) DATE_ADD() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDATE_ADD, 0) +} + +func (s *DateFunctionContext) DATE_DIFF() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDATE_DIFF, 0) +} + +func (s *DateFunctionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DateFunctionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DateFunctionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterDateFunction(s) + } +} + +func (s *DateFunctionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitDateFunction(s) + } +} + +func (s *DateFunctionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitDateFunction(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) DateFunction() (localctx IDateFunctionContext) { + localctx = NewDateFunctionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 210, PartiQLParserParserRULE_dateFunction) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1387) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*DateFunctionContext).func_ = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserDATE_ADD || _la == PartiQLParserParserDATE_DIFF) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*DateFunctionContext).func_ = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1388) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1389) + + var _m = p.Match(PartiQLParserParserIDENTIFIER) + + localctx.(*DateFunctionContext).dt = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1390) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1391) + p.Expr() + } + { + p.SetState(1392) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1393) + p.Expr() + } + { + p.SetState(1394) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IFunctionCallContext is an interface to support dynamic dispatch. +type IFunctionCallContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsFunctionCallContext differentiates from other interfaces. + IsFunctionCallContext() +} + +type FunctionCallContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyFunctionCallContext() *FunctionCallContext { + var p = new(FunctionCallContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_functionCall + return p +} + +func InitEmptyFunctionCallContext(p *FunctionCallContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_functionCall +} + +func (*FunctionCallContext) IsFunctionCallContext() {} + +func NewFunctionCallContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FunctionCallContext { + var p = new(FunctionCallContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_functionCall + + return p +} + +func (s *FunctionCallContext) GetParser() antlr.Parser { return s.parser } + +func (s *FunctionCallContext) CopyAll(ctx *FunctionCallContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *FunctionCallContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FunctionCallContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type FunctionCallIdentContext struct { + FunctionCallContext + name ISymbolPrimitiveContext +} + +func NewFunctionCallIdentContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FunctionCallIdentContext { + var p = new(FunctionCallIdentContext) + + InitEmptyFunctionCallContext(&p.FunctionCallContext) + p.parser = parser + p.CopyAll(ctx.(*FunctionCallContext)) + + return p +} + +func (s *FunctionCallIdentContext) GetName() ISymbolPrimitiveContext { return s.name } + +func (s *FunctionCallIdentContext) SetName(v ISymbolPrimitiveContext) { s.name = v } + +func (s *FunctionCallIdentContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FunctionCallIdentContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *FunctionCallIdentContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *FunctionCallIdentContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *FunctionCallIdentContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *FunctionCallIdentContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *FunctionCallIdentContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *FunctionCallIdentContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *FunctionCallIdentContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterFunctionCallIdent(s) + } +} + +func (s *FunctionCallIdentContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitFunctionCallIdent(s) + } +} + +func (s *FunctionCallIdentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitFunctionCallIdent(s) + + default: + return t.VisitChildren(s) + } +} + +type FunctionCallReservedContext struct { + FunctionCallContext + name antlr.Token +} + +func NewFunctionCallReservedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FunctionCallReservedContext { + var p = new(FunctionCallReservedContext) + + InitEmptyFunctionCallContext(&p.FunctionCallContext) + p.parser = parser + p.CopyAll(ctx.(*FunctionCallContext)) + + return p +} + +func (s *FunctionCallReservedContext) GetName() antlr.Token { return s.name } + +func (s *FunctionCallReservedContext) SetName(v antlr.Token) { s.name = v } + +func (s *FunctionCallReservedContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FunctionCallReservedContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *FunctionCallReservedContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *FunctionCallReservedContext) CHAR_LENGTH() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCHAR_LENGTH, 0) +} + +func (s *FunctionCallReservedContext) CHARACTER_LENGTH() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCHARACTER_LENGTH, 0) +} + +func (s *FunctionCallReservedContext) OCTET_LENGTH() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserOCTET_LENGTH, 0) +} + +func (s *FunctionCallReservedContext) BIT_LENGTH() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBIT_LENGTH, 0) +} + +func (s *FunctionCallReservedContext) UPPER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserUPPER, 0) +} + +func (s *FunctionCallReservedContext) LOWER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLOWER, 0) +} + +func (s *FunctionCallReservedContext) SIZE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSIZE, 0) +} + +func (s *FunctionCallReservedContext) EXISTS() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserEXISTS, 0) +} + +func (s *FunctionCallReservedContext) COUNT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOUNT, 0) +} + +func (s *FunctionCallReservedContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *FunctionCallReservedContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *FunctionCallReservedContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *FunctionCallReservedContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *FunctionCallReservedContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterFunctionCallReserved(s) + } +} + +func (s *FunctionCallReservedContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitFunctionCallReserved(s) + } +} + +func (s *FunctionCallReservedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitFunctionCallReserved(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) FunctionCall() (localctx IFunctionCallContext) { + localctx = NewFunctionCallContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 212, PartiQLParserParserRULE_functionCall) + var _la int + + p.SetState(1423) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserBIT_LENGTH, PartiQLParserParserCHARACTER_LENGTH, PartiQLParserParserCHAR_LENGTH, PartiQLParserParserCOUNT, PartiQLParserParserEXISTS, PartiQLParserParserLOWER, PartiQLParserParserOCTET_LENGTH, PartiQLParserParserSIZE, PartiQLParserParserUPPER: + localctx = NewFunctionCallReservedContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1396) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*FunctionCallReservedContext).name = _lt + + _la = p.GetTokenStream().LA(1) + + if !(((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&17592991875072) != 0) || ((int64((_la-80)) & ^0x3f) == 0 && ((int64(1)<<(_la-80))&-9223231299366420479) != 0) || _la == PartiQLParserParserSIZE || _la == PartiQLParserParserUPPER) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*FunctionCallReservedContext).name = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1397) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1406) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9024796566781952) != 0) || ((int64((_la-80)) & ^0x3f) == 0 && ((int64(1)<<(_la-80))&-6051008311837327239) != 0) || ((int64((_la-180)) & ^0x3f) == 0 && ((int64(1)<<(_la-180))&68398559028338721) != 0) || ((int64((_la-264)) & ^0x3f) == 0 && ((int64(1)<<(_la-264))&1166665056867) != 0) { + { + p.SetState(1398) + p.Expr() + } + p.SetState(1403) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(1399) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1400) + p.Expr() + } + + p.SetState(1405) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(1408) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserIDENTIFIER, PartiQLParserParserIDENTIFIER_QUOTED: + localctx = NewFunctionCallIdentContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1409) + + var _x = p.SymbolPrimitive() + + localctx.(*FunctionCallIdentContext).name = _x + } + { + p.SetState(1410) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1419) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9024796566781952) != 0) || ((int64((_la-80)) & ^0x3f) == 0 && ((int64(1)<<(_la-80))&-6051008311837327239) != 0) || ((int64((_la-180)) & ^0x3f) == 0 && ((int64(1)<<(_la-180))&68398559028338721) != 0) || ((int64((_la-264)) & ^0x3f) == 0 && ((int64(1)<<(_la-264))&1166665056867) != 0) { + { + p.SetState(1411) + p.Expr() + } + p.SetState(1416) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(1412) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1413) + p.Expr() + } + + p.SetState(1418) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(1421) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IPathStepContext is an interface to support dynamic dispatch. +type IPathStepContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsPathStepContext differentiates from other interfaces. + IsPathStepContext() +} + +type PathStepContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyPathStepContext() *PathStepContext { + var p = new(PathStepContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_pathStep + return p +} + +func InitEmptyPathStepContext(p *PathStepContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_pathStep +} + +func (*PathStepContext) IsPathStepContext() {} + +func NewPathStepContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PathStepContext { + var p = new(PathStepContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_pathStep + + return p +} + +func (s *PathStepContext) GetParser() antlr.Parser { return s.parser } + +func (s *PathStepContext) CopyAll(ctx *PathStepContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *PathStepContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PathStepContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type PathStepDotAllContext struct { + PathStepContext + all antlr.Token +} + +func NewPathStepDotAllContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PathStepDotAllContext { + var p = new(PathStepDotAllContext) + + InitEmptyPathStepContext(&p.PathStepContext) + p.parser = parser + p.CopyAll(ctx.(*PathStepContext)) + + return p +} + +func (s *PathStepDotAllContext) GetAll() antlr.Token { return s.all } + +func (s *PathStepDotAllContext) SetAll(v antlr.Token) { s.all = v } + +func (s *PathStepDotAllContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PathStepDotAllContext) PERIOD() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPERIOD, 0) +} + +func (s *PathStepDotAllContext) ASTERISK() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserASTERISK, 0) +} + +func (s *PathStepDotAllContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPathStepDotAll(s) + } +} + +func (s *PathStepDotAllContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPathStepDotAll(s) + } +} + +func (s *PathStepDotAllContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPathStepDotAll(s) + + default: + return t.VisitChildren(s) + } +} + +type PathStepIndexAllContext struct { + PathStepContext + all antlr.Token +} + +func NewPathStepIndexAllContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PathStepIndexAllContext { + var p = new(PathStepIndexAllContext) + + InitEmptyPathStepContext(&p.PathStepContext) + p.parser = parser + p.CopyAll(ctx.(*PathStepContext)) + + return p +} + +func (s *PathStepIndexAllContext) GetAll() antlr.Token { return s.all } + +func (s *PathStepIndexAllContext) SetAll(v antlr.Token) { s.all = v } + +func (s *PathStepIndexAllContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PathStepIndexAllContext) BRACKET_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_LEFT, 0) +} + +func (s *PathStepIndexAllContext) BRACKET_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_RIGHT, 0) +} + +func (s *PathStepIndexAllContext) ASTERISK() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserASTERISK, 0) +} + +func (s *PathStepIndexAllContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPathStepIndexAll(s) + } +} + +func (s *PathStepIndexAllContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPathStepIndexAll(s) + } +} + +func (s *PathStepIndexAllContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPathStepIndexAll(s) + + default: + return t.VisitChildren(s) + } +} + +type PathStepIndexExprContext struct { + PathStepContext + key IExprContext +} + +func NewPathStepIndexExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PathStepIndexExprContext { + var p = new(PathStepIndexExprContext) + + InitEmptyPathStepContext(&p.PathStepContext) + p.parser = parser + p.CopyAll(ctx.(*PathStepContext)) + + return p +} + +func (s *PathStepIndexExprContext) GetKey() IExprContext { return s.key } + +func (s *PathStepIndexExprContext) SetKey(v IExprContext) { s.key = v } + +func (s *PathStepIndexExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PathStepIndexExprContext) BRACKET_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_LEFT, 0) +} + +func (s *PathStepIndexExprContext) BRACKET_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_RIGHT, 0) +} + +func (s *PathStepIndexExprContext) Expr() IExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *PathStepIndexExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPathStepIndexExpr(s) + } +} + +func (s *PathStepIndexExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPathStepIndexExpr(s) + } +} + +func (s *PathStepIndexExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPathStepIndexExpr(s) + + default: + return t.VisitChildren(s) + } +} + +type PathStepDotExprContext struct { + PathStepContext + key ISymbolPrimitiveContext +} + +func NewPathStepDotExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PathStepDotExprContext { + var p = new(PathStepDotExprContext) + + InitEmptyPathStepContext(&p.PathStepContext) + p.parser = parser + p.CopyAll(ctx.(*PathStepContext)) + + return p +} + +func (s *PathStepDotExprContext) GetKey() ISymbolPrimitiveContext { return s.key } + +func (s *PathStepDotExprContext) SetKey(v ISymbolPrimitiveContext) { s.key = v } + +func (s *PathStepDotExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PathStepDotExprContext) PERIOD() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPERIOD, 0) +} + +func (s *PathStepDotExprContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *PathStepDotExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPathStepDotExpr(s) + } +} + +func (s *PathStepDotExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPathStepDotExpr(s) + } +} + +func (s *PathStepDotExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPathStepDotExpr(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) PathStep() (localctx IPathStepContext) { + localctx = NewPathStepContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 214, PartiQLParserParserRULE_pathStep) + p.SetState(1436) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 183, p.GetParserRuleContext()) { + case 1: + localctx = NewPathStepIndexExprContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1425) + p.Match(PartiQLParserParserBRACKET_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1426) + + var _x = p.Expr() + + localctx.(*PathStepIndexExprContext).key = _x + } + { + p.SetState(1427) + p.Match(PartiQLParserParserBRACKET_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + localctx = NewPathStepIndexAllContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1429) + p.Match(PartiQLParserParserBRACKET_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1430) + + var _m = p.Match(PartiQLParserParserASTERISK) + + localctx.(*PathStepIndexAllContext).all = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1431) + p.Match(PartiQLParserParserBRACKET_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 3: + localctx = NewPathStepDotExprContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(1432) + p.Match(PartiQLParserParserPERIOD) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1433) + + var _x = p.SymbolPrimitive() + + localctx.(*PathStepDotExprContext).key = _x + } + + case 4: + localctx = NewPathStepDotAllContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(1434) + p.Match(PartiQLParserParserPERIOD) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1435) + + var _m = p.Match(PartiQLParserParserASTERISK) + + localctx.(*PathStepDotAllContext).all = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprGraphMatchManyContext is an interface to support dynamic dispatch. +type IExprGraphMatchManyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + PAREN_LEFT() antlr.TerminalNode + ExprPrimary() IExprPrimaryContext + MATCH() antlr.TerminalNode + GpmlPatternList() IGpmlPatternListContext + PAREN_RIGHT() antlr.TerminalNode + + // IsExprGraphMatchManyContext differentiates from other interfaces. + IsExprGraphMatchManyContext() +} + +type ExprGraphMatchManyContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprGraphMatchManyContext() *ExprGraphMatchManyContext { + var p = new(ExprGraphMatchManyContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprGraphMatchMany + return p +} + +func InitEmptyExprGraphMatchManyContext(p *ExprGraphMatchManyContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprGraphMatchMany +} + +func (*ExprGraphMatchManyContext) IsExprGraphMatchManyContext() {} + +func NewExprGraphMatchManyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprGraphMatchManyContext { + var p = new(ExprGraphMatchManyContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_exprGraphMatchMany + + return p +} + +func (s *ExprGraphMatchManyContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprGraphMatchManyContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *ExprGraphMatchManyContext) ExprPrimary() IExprPrimaryContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprPrimaryContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprPrimaryContext) +} + +func (s *ExprGraphMatchManyContext) MATCH() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMATCH, 0) +} + +func (s *ExprGraphMatchManyContext) GpmlPatternList() IGpmlPatternListContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGpmlPatternListContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IGpmlPatternListContext) +} + +func (s *ExprGraphMatchManyContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *ExprGraphMatchManyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprGraphMatchManyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ExprGraphMatchManyContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExprGraphMatchMany(s) + } +} + +func (s *ExprGraphMatchManyContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExprGraphMatchMany(s) + } +} + +func (s *ExprGraphMatchManyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExprGraphMatchMany(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExprGraphMatchMany() (localctx IExprGraphMatchManyContext) { + localctx = NewExprGraphMatchManyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 216, PartiQLParserParserRULE_exprGraphMatchMany) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1438) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1439) + p.exprPrimary(0) + } + { + p.SetState(1440) + p.Match(PartiQLParserParserMATCH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1441) + p.GpmlPatternList() + } + { + p.SetState(1442) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IExprGraphMatchOneContext is an interface to support dynamic dispatch. +type IExprGraphMatchOneContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ExprPrimary() IExprPrimaryContext + MATCH() antlr.TerminalNode + GpmlPattern() IGpmlPatternContext + + // IsExprGraphMatchOneContext differentiates from other interfaces. + IsExprGraphMatchOneContext() +} + +type ExprGraphMatchOneContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExprGraphMatchOneContext() *ExprGraphMatchOneContext { + var p = new(ExprGraphMatchOneContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprGraphMatchOne + return p +} + +func InitEmptyExprGraphMatchOneContext(p *ExprGraphMatchOneContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_exprGraphMatchOne +} + +func (*ExprGraphMatchOneContext) IsExprGraphMatchOneContext() {} + +func NewExprGraphMatchOneContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprGraphMatchOneContext { + var p = new(ExprGraphMatchOneContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_exprGraphMatchOne + + return p +} + +func (s *ExprGraphMatchOneContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExprGraphMatchOneContext) ExprPrimary() IExprPrimaryContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprPrimaryContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExprPrimaryContext) +} + +func (s *ExprGraphMatchOneContext) MATCH() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMATCH, 0) +} + +func (s *ExprGraphMatchOneContext) GpmlPattern() IGpmlPatternContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGpmlPatternContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IGpmlPatternContext) +} + +func (s *ExprGraphMatchOneContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExprGraphMatchOneContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ExprGraphMatchOneContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterExprGraphMatchOne(s) + } +} + +func (s *ExprGraphMatchOneContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitExprGraphMatchOne(s) + } +} + +func (s *ExprGraphMatchOneContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitExprGraphMatchOne(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) ExprGraphMatchOne() (localctx IExprGraphMatchOneContext) { + localctx = NewExprGraphMatchOneContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 218, PartiQLParserParserRULE_exprGraphMatchOne) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1444) + p.exprPrimary(0) + } + { + p.SetState(1445) + p.Match(PartiQLParserParserMATCH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1446) + p.GpmlPattern() + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IParameterContext is an interface to support dynamic dispatch. +type IParameterContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + QUESTION_MARK() antlr.TerminalNode + + // IsParameterContext differentiates from other interfaces. + IsParameterContext() +} + +type ParameterContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyParameterContext() *ParameterContext { + var p = new(ParameterContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_parameter + return p +} + +func InitEmptyParameterContext(p *ParameterContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_parameter +} + +func (*ParameterContext) IsParameterContext() {} + +func NewParameterContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParameterContext { + var p = new(ParameterContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_parameter + + return p +} + +func (s *ParameterContext) GetParser() antlr.Parser { return s.parser } + +func (s *ParameterContext) QUESTION_MARK() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserQUESTION_MARK, 0) +} + +func (s *ParameterContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ParameterContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ParameterContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterParameter(s) + } +} + +func (s *ParameterContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitParameter(s) + } +} + +func (s *ParameterContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitParameter(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Parameter() (localctx IParameterContext) { + localctx = NewParameterContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 220, PartiQLParserParserRULE_parameter) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1448) + p.Match(PartiQLParserParserQUESTION_MARK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IVarRefExprContext is an interface to support dynamic dispatch. +type IVarRefExprContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetQualifier returns the qualifier token. + GetQualifier() antlr.Token + + // GetIdent returns the ident token. + GetIdent() antlr.Token + + // SetQualifier sets the qualifier token. + SetQualifier(antlr.Token) + + // SetIdent sets the ident token. + SetIdent(antlr.Token) + + // Getter signatures + IDENTIFIER() antlr.TerminalNode + IDENTIFIER_QUOTED() antlr.TerminalNode + AT_SIGN() antlr.TerminalNode + + // IsVarRefExprContext differentiates from other interfaces. + IsVarRefExprContext() +} + +type VarRefExprContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + qualifier antlr.Token + ident antlr.Token +} + +func NewEmptyVarRefExprContext() *VarRefExprContext { + var p = new(VarRefExprContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_varRefExpr + return p +} + +func InitEmptyVarRefExprContext(p *VarRefExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_varRefExpr +} + +func (*VarRefExprContext) IsVarRefExprContext() {} + +func NewVarRefExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *VarRefExprContext { + var p = new(VarRefExprContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_varRefExpr + + return p +} + +func (s *VarRefExprContext) GetParser() antlr.Parser { return s.parser } + +func (s *VarRefExprContext) GetQualifier() antlr.Token { return s.qualifier } + +func (s *VarRefExprContext) GetIdent() antlr.Token { return s.ident } + +func (s *VarRefExprContext) SetQualifier(v antlr.Token) { s.qualifier = v } + +func (s *VarRefExprContext) SetIdent(v antlr.Token) { s.ident = v } + +func (s *VarRefExprContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIDENTIFIER, 0) +} + +func (s *VarRefExprContext) IDENTIFIER_QUOTED() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserIDENTIFIER_QUOTED, 0) +} + +func (s *VarRefExprContext) AT_SIGN() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserAT_SIGN, 0) +} + +func (s *VarRefExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *VarRefExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *VarRefExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterVarRefExpr(s) + } +} + +func (s *VarRefExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitVarRefExpr(s) + } +} + +func (s *VarRefExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitVarRefExpr(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) VarRefExpr() (localctx IVarRefExprContext) { + localctx = NewVarRefExprContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 222, PartiQLParserParserRULE_varRefExpr) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(1451) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserAT_SIGN { + { + p.SetState(1450) + + var _m = p.Match(PartiQLParserParserAT_SIGN) + + localctx.(*VarRefExprContext).qualifier = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(1453) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*VarRefExprContext).ident = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserIDENTIFIER || _la == PartiQLParserParserIDENTIFIER_QUOTED) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*VarRefExprContext).ident = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ICollectionContext is an interface to support dynamic dispatch. +type ICollectionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Array() IArrayContext + Bag() IBagContext + + // IsCollectionContext differentiates from other interfaces. + IsCollectionContext() +} + +type CollectionContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCollectionContext() *CollectionContext { + var p = new(CollectionContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_collection + return p +} + +func InitEmptyCollectionContext(p *CollectionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_collection +} + +func (*CollectionContext) IsCollectionContext() {} + +func NewCollectionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CollectionContext { + var p = new(CollectionContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_collection + + return p +} + +func (s *CollectionContext) GetParser() antlr.Parser { return s.parser } + +func (s *CollectionContext) Array() IArrayContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArrayContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArrayContext) +} + +func (s *CollectionContext) Bag() IBagContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBagContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IBagContext) +} + +func (s *CollectionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CollectionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CollectionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterCollection(s) + } +} + +func (s *CollectionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitCollection(s) + } +} + +func (s *CollectionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitCollection(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Collection() (localctx ICollectionContext) { + localctx = NewCollectionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 224, PartiQLParserParserRULE_collection) + p.SetState(1457) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserBRACKET_LEFT: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1455) + p.Array() + } + + case PartiQLParserParserANGLE_DOUBLE_LEFT: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1456) + p.Bag() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IArrayContext is an interface to support dynamic dispatch. +type IArrayContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + BRACKET_LEFT() antlr.TerminalNode + BRACKET_RIGHT() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsArrayContext differentiates from other interfaces. + IsArrayContext() +} + +type ArrayContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyArrayContext() *ArrayContext { + var p = new(ArrayContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_array + return p +} + +func InitEmptyArrayContext(p *ArrayContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_array +} + +func (*ArrayContext) IsArrayContext() {} + +func NewArrayContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrayContext { + var p = new(ArrayContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_array + + return p +} + +func (s *ArrayContext) GetParser() antlr.Parser { return s.parser } + +func (s *ArrayContext) BRACKET_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_LEFT, 0) +} + +func (s *ArrayContext) BRACKET_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACKET_RIGHT, 0) +} + +func (s *ArrayContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *ArrayContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *ArrayContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *ArrayContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *ArrayContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ArrayContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ArrayContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterArray(s) + } +} + +func (s *ArrayContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitArray(s) + } +} + +func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitArray(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Array() (localctx IArrayContext) { + localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 226, PartiQLParserParserRULE_array) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1459) + p.Match(PartiQLParserParserBRACKET_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1468) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9024796566781952) != 0) || ((int64((_la-80)) & ^0x3f) == 0 && ((int64(1)<<(_la-80))&-6051008311837327239) != 0) || ((int64((_la-180)) & ^0x3f) == 0 && ((int64(1)<<(_la-180))&68398559028338721) != 0) || ((int64((_la-264)) & ^0x3f) == 0 && ((int64(1)<<(_la-264))&1166665056867) != 0) { + { + p.SetState(1460) + p.Expr() + } + p.SetState(1465) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(1461) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1462) + p.Expr() + } + + p.SetState(1467) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(1470) + p.Match(PartiQLParserParserBRACKET_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IBagContext is an interface to support dynamic dispatch. +type IBagContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ANGLE_DOUBLE_LEFT() antlr.TerminalNode + ANGLE_DOUBLE_RIGHT() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsBagContext differentiates from other interfaces. + IsBagContext() +} + +type BagContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBagContext() *BagContext { + var p = new(BagContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_bag + return p +} + +func InitEmptyBagContext(p *BagContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_bag +} + +func (*BagContext) IsBagContext() {} + +func NewBagContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BagContext { + var p = new(BagContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_bag + + return p +} + +func (s *BagContext) GetParser() antlr.Parser { return s.parser } + +func (s *BagContext) ANGLE_DOUBLE_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_DOUBLE_LEFT, 0) +} + +func (s *BagContext) ANGLE_DOUBLE_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANGLE_DOUBLE_RIGHT, 0) +} + +func (s *BagContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *BagContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *BagContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *BagContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *BagContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BagContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *BagContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterBag(s) + } +} + +func (s *BagContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitBag(s) + } +} + +func (s *BagContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitBag(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Bag() (localctx IBagContext) { + localctx = NewBagContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 228, PartiQLParserParserRULE_bag) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1472) + p.Match(PartiQLParserParserANGLE_DOUBLE_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1481) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9024796566781952) != 0) || ((int64((_la-80)) & ^0x3f) == 0 && ((int64(1)<<(_la-80))&-6051008311837327239) != 0) || ((int64((_la-180)) & ^0x3f) == 0 && ((int64(1)<<(_la-180))&68398559028338721) != 0) || ((int64((_la-264)) & ^0x3f) == 0 && ((int64(1)<<(_la-264))&1166665056867) != 0) { + { + p.SetState(1473) + p.Expr() + } + p.SetState(1478) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(1474) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1475) + p.Expr() + } + + p.SetState(1480) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(1483) + p.Match(PartiQLParserParserANGLE_DOUBLE_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ITupleContext is an interface to support dynamic dispatch. +type ITupleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + BRACE_LEFT() antlr.TerminalNode + BRACE_RIGHT() antlr.TerminalNode + AllPair() []IPairContext + Pair(i int) IPairContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + + // IsTupleContext differentiates from other interfaces. + IsTupleContext() +} + +type TupleContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTupleContext() *TupleContext { + var p = new(TupleContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_tuple + return p +} + +func InitEmptyTupleContext(p *TupleContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_tuple +} + +func (*TupleContext) IsTupleContext() {} + +func NewTupleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TupleContext { + var p = new(TupleContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_tuple + + return p +} + +func (s *TupleContext) GetParser() antlr.Parser { return s.parser } + +func (s *TupleContext) BRACE_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACE_LEFT, 0) +} + +func (s *TupleContext) BRACE_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBRACE_RIGHT, 0) +} + +func (s *TupleContext) AllPair() []IPairContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IPairContext); ok { + len++ + } + } + + tst := make([]IPairContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IPairContext); ok { + tst[i] = t.(IPairContext) + i++ + } + } + + return tst +} + +func (s *TupleContext) Pair(i int) IPairContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPairContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IPairContext) +} + +func (s *TupleContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserCOMMA) +} + +func (s *TupleContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, i) +} + +func (s *TupleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TupleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TupleContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTuple(s) + } +} + +func (s *TupleContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTuple(s) + } +} + +func (s *TupleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTuple(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Tuple() (localctx ITupleContext) { + localctx = NewTupleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 230, PartiQLParserParserRULE_tuple) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1485) + p.Match(PartiQLParserParserBRACE_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1494) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9024796566781952) != 0) || ((int64((_la-80)) & ^0x3f) == 0 && ((int64(1)<<(_la-80))&-6051008311837327239) != 0) || ((int64((_la-180)) & ^0x3f) == 0 && ((int64(1)<<(_la-180))&68398559028338721) != 0) || ((int64((_la-264)) & ^0x3f) == 0 && ((int64(1)<<(_la-264))&1166665056867) != 0) { + { + p.SetState(1486) + p.Pair() + } + p.SetState(1491) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == PartiQLParserParserCOMMA { + { + p.SetState(1487) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1488) + p.Pair() + } + + p.SetState(1493) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + } + { + p.SetState(1496) + p.Match(PartiQLParserParserBRACE_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IPairContext is an interface to support dynamic dispatch. +type IPairContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetLhs returns the lhs rule contexts. + GetLhs() IExprContext + + // GetRhs returns the rhs rule contexts. + GetRhs() IExprContext + + // SetLhs sets the lhs rule contexts. + SetLhs(IExprContext) + + // SetRhs sets the rhs rule contexts. + SetRhs(IExprContext) + + // Getter signatures + COLON() antlr.TerminalNode + AllExpr() []IExprContext + Expr(i int) IExprContext + + // IsPairContext differentiates from other interfaces. + IsPairContext() +} + +type PairContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser + lhs IExprContext + rhs IExprContext +} + +func NewEmptyPairContext() *PairContext { + var p = new(PairContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_pair + return p +} + +func InitEmptyPairContext(p *PairContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_pair +} + +func (*PairContext) IsPairContext() {} + +func NewPairContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PairContext { + var p = new(PairContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_pair + + return p +} + +func (s *PairContext) GetParser() antlr.Parser { return s.parser } + +func (s *PairContext) GetLhs() IExprContext { return s.lhs } + +func (s *PairContext) GetRhs() IExprContext { return s.rhs } + +func (s *PairContext) SetLhs(v IExprContext) { s.lhs = v } + +func (s *PairContext) SetRhs(v IExprContext) { s.rhs = v } + +func (s *PairContext) COLON() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOLON, 0) +} + +func (s *PairContext) AllExpr() []IExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IExprContext); ok { + len++ + } + } + + tst := make([]IExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IExprContext); ok { + tst[i] = t.(IExprContext) + i++ + } + } + + return tst +} + +func (s *PairContext) Expr(i int) IExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IExprContext) +} + +func (s *PairContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PairContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *PairContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterPair(s) + } +} + +func (s *PairContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitPair(s) + } +} + +func (s *PairContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitPair(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Pair() (localctx IPairContext) { + localctx = NewPairContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 232, PartiQLParserParserRULE_pair) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1498) + + var _x = p.Expr() + + localctx.(*PairContext).lhs = _x + } + { + p.SetState(1499) + p.Match(PartiQLParserParserCOLON) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1500) + + var _x = p.Expr() + + localctx.(*PairContext).rhs = _x + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ILiteralContext is an interface to support dynamic dispatch. +type ILiteralContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsLiteralContext differentiates from other interfaces. + IsLiteralContext() +} + +type LiteralContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyLiteralContext() *LiteralContext { + var p = new(LiteralContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_literal + return p +} + +func InitEmptyLiteralContext(p *LiteralContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_literal +} + +func (*LiteralContext) IsLiteralContext() {} + +func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext { + var p = new(LiteralContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_literal + + return p +} + +func (s *LiteralContext) GetParser() antlr.Parser { return s.parser } + +func (s *LiteralContext) CopyAll(ctx *LiteralContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *LiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type LiteralMissingContext struct { + LiteralContext +} + +func NewLiteralMissingContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralMissingContext { + var p = new(LiteralMissingContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *LiteralMissingContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralMissingContext) MISSING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMISSING, 0) +} + +func (s *LiteralMissingContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLiteralMissing(s) + } +} + +func (s *LiteralMissingContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLiteralMissing(s) + } +} + +func (s *LiteralMissingContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLiteralMissing(s) + + default: + return t.VisitChildren(s) + } +} + +type LiteralIntegerContext struct { + LiteralContext +} + +func NewLiteralIntegerContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralIntegerContext { + var p = new(LiteralIntegerContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *LiteralIntegerContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralIntegerContext) LITERAL_INTEGER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_INTEGER, 0) +} + +func (s *LiteralIntegerContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLiteralInteger(s) + } +} + +func (s *LiteralIntegerContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLiteralInteger(s) + } +} + +func (s *LiteralIntegerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLiteralInteger(s) + + default: + return t.VisitChildren(s) + } +} + +type LiteralDateContext struct { + LiteralContext +} + +func NewLiteralDateContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralDateContext { + var p = new(LiteralDateContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *LiteralDateContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralDateContext) DATE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDATE, 0) +} + +func (s *LiteralDateContext) LITERAL_STRING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_STRING, 0) +} + +func (s *LiteralDateContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLiteralDate(s) + } +} + +func (s *LiteralDateContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLiteralDate(s) + } +} + +func (s *LiteralDateContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLiteralDate(s) + + default: + return t.VisitChildren(s) + } +} + +type LiteralFalseContext struct { + LiteralContext +} + +func NewLiteralFalseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralFalseContext { + var p = new(LiteralFalseContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *LiteralFalseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralFalseContext) FALSE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFALSE, 0) +} + +func (s *LiteralFalseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLiteralFalse(s) + } +} + +func (s *LiteralFalseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLiteralFalse(s) + } +} + +func (s *LiteralFalseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLiteralFalse(s) + + default: + return t.VisitChildren(s) + } +} + +type LiteralStringContext struct { + LiteralContext +} + +func NewLiteralStringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralStringContext { + var p = new(LiteralStringContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *LiteralStringContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralStringContext) LITERAL_STRING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_STRING, 0) +} + +func (s *LiteralStringContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLiteralString(s) + } +} + +func (s *LiteralStringContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLiteralString(s) + } +} + +func (s *LiteralStringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLiteralString(s) + + default: + return t.VisitChildren(s) + } +} + +type LiteralDecimalContext struct { + LiteralContext +} + +func NewLiteralDecimalContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralDecimalContext { + var p = new(LiteralDecimalContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *LiteralDecimalContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralDecimalContext) LITERAL_DECIMAL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_DECIMAL, 0) +} + +func (s *LiteralDecimalContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLiteralDecimal(s) + } +} + +func (s *LiteralDecimalContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLiteralDecimal(s) + } +} + +func (s *LiteralDecimalContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLiteralDecimal(s) + + default: + return t.VisitChildren(s) + } +} + +type LiteralNullContext struct { + LiteralContext +} + +func NewLiteralNullContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralNullContext { + var p = new(LiteralNullContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *LiteralNullContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralNullContext) NULL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNULL, 0) +} + +func (s *LiteralNullContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLiteralNull(s) + } +} + +func (s *LiteralNullContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLiteralNull(s) + } +} + +func (s *LiteralNullContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLiteralNull(s) + + default: + return t.VisitChildren(s) + } +} + +type LiteralIonContext struct { + LiteralContext +} + +func NewLiteralIonContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralIonContext { + var p = new(LiteralIonContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *LiteralIonContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralIonContext) ION_CLOSURE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserION_CLOSURE, 0) +} + +func (s *LiteralIonContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLiteralIon(s) + } +} + +func (s *LiteralIonContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLiteralIon(s) + } +} + +func (s *LiteralIonContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLiteralIon(s) + + default: + return t.VisitChildren(s) + } +} + +type LiteralTrueContext struct { + LiteralContext +} + +func NewLiteralTrueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralTrueContext { + var p = new(LiteralTrueContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *LiteralTrueContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralTrueContext) TRUE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTRUE, 0) +} + +func (s *LiteralTrueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLiteralTrue(s) + } +} + +func (s *LiteralTrueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLiteralTrue(s) + } +} + +func (s *LiteralTrueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLiteralTrue(s) + + default: + return t.VisitChildren(s) + } +} + +type LiteralTimeContext struct { + LiteralContext +} + +func NewLiteralTimeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralTimeContext { + var p = new(LiteralTimeContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *LiteralTimeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralTimeContext) AllTIME() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserTIME) +} + +func (s *LiteralTimeContext) TIME(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTIME, i) +} + +func (s *LiteralTimeContext) LITERAL_STRING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_STRING, 0) +} + +func (s *LiteralTimeContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *LiteralTimeContext) LITERAL_INTEGER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_INTEGER, 0) +} + +func (s *LiteralTimeContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *LiteralTimeContext) WITH() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserWITH, 0) +} + +func (s *LiteralTimeContext) ZONE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserZONE, 0) +} + +func (s *LiteralTimeContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterLiteralTime(s) + } +} + +func (s *LiteralTimeContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitLiteralTime(s) + } +} + +func (s *LiteralTimeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitLiteralTime(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Literal() (localctx ILiteralContext) { + localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 234, PartiQLParserParserRULE_literal) + var _la int + + p.SetState(1524) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case PartiQLParserParserNULL: + localctx = NewLiteralNullContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1502) + p.Match(PartiQLParserParserNULL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserMISSING: + localctx = NewLiteralMissingContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1503) + p.Match(PartiQLParserParserMISSING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserTRUE: + localctx = NewLiteralTrueContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(1504) + p.Match(PartiQLParserParserTRUE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserFALSE: + localctx = NewLiteralFalseContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(1505) + p.Match(PartiQLParserParserFALSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserLITERAL_STRING: + localctx = NewLiteralStringContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(1506) + p.Match(PartiQLParserParserLITERAL_STRING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserLITERAL_INTEGER: + localctx = NewLiteralIntegerContext(p, localctx) + p.EnterOuterAlt(localctx, 6) + { + p.SetState(1507) + p.Match(PartiQLParserParserLITERAL_INTEGER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserLITERAL_DECIMAL: + localctx = NewLiteralDecimalContext(p, localctx) + p.EnterOuterAlt(localctx, 7) + { + p.SetState(1508) + p.Match(PartiQLParserParserLITERAL_DECIMAL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserION_CLOSURE: + localctx = NewLiteralIonContext(p, localctx) + p.EnterOuterAlt(localctx, 8) + { + p.SetState(1509) + p.Match(PartiQLParserParserION_CLOSURE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserDATE: + localctx = NewLiteralDateContext(p, localctx) + p.EnterOuterAlt(localctx, 9) + { + p.SetState(1510) + p.Match(PartiQLParserParserDATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1511) + p.Match(PartiQLParserParserLITERAL_STRING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case PartiQLParserParserTIME: + localctx = NewLiteralTimeContext(p, localctx) + p.EnterOuterAlt(localctx, 10) + { + p.SetState(1512) + p.Match(PartiQLParserParserTIME) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1516) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserPAREN_LEFT { + { + p.SetState(1513) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1514) + p.Match(PartiQLParserParserLITERAL_INTEGER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1515) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + p.SetState(1521) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserWITH { + { + p.SetState(1518) + p.Match(PartiQLParserParserWITH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1519) + p.Match(PartiQLParserParserTIME) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1520) + p.Match(PartiQLParserParserZONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(1523) + p.Match(PartiQLParserParserLITERAL_STRING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ITypeContext is an interface to support dynamic dispatch. +type ITypeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsTypeContext differentiates from other interfaces. + IsTypeContext() +} + +type TypeContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTypeContext() *TypeContext { + var p = new(TypeContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_type + return p +} + +func InitEmptyTypeContext(p *TypeContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = PartiQLParserParserRULE_type +} + +func (*TypeContext) IsTypeContext() {} + +func NewTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeContext { + var p = new(TypeContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = PartiQLParserParserRULE_type + + return p +} + +func (s *TypeContext) GetParser() antlr.Parser { return s.parser } + +func (s *TypeContext) CopyAll(ctx *TypeContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *TypeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type TypeArgSingleContext struct { + TypeContext + datatype antlr.Token + arg0 antlr.Token +} + +func NewTypeArgSingleContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TypeArgSingleContext { + var p = new(TypeArgSingleContext) + + InitEmptyTypeContext(&p.TypeContext) + p.parser = parser + p.CopyAll(ctx.(*TypeContext)) + + return p +} + +func (s *TypeArgSingleContext) GetDatatype() antlr.Token { return s.datatype } + +func (s *TypeArgSingleContext) GetArg0() antlr.Token { return s.arg0 } + +func (s *TypeArgSingleContext) SetDatatype(v antlr.Token) { s.datatype = v } + +func (s *TypeArgSingleContext) SetArg0(v antlr.Token) { s.arg0 = v } + +func (s *TypeArgSingleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TypeArgSingleContext) CHARACTER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCHARACTER, 0) +} + +func (s *TypeArgSingleContext) CHAR() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCHAR, 0) +} + +func (s *TypeArgSingleContext) FLOAT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserFLOAT, 0) +} + +func (s *TypeArgSingleContext) VARCHAR() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserVARCHAR, 0) +} + +func (s *TypeArgSingleContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *TypeArgSingleContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *TypeArgSingleContext) LITERAL_INTEGER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_INTEGER, 0) +} + +func (s *TypeArgSingleContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTypeArgSingle(s) + } +} + +func (s *TypeArgSingleContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTypeArgSingle(s) + } +} + +func (s *TypeArgSingleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTypeArgSingle(s) + + default: + return t.VisitChildren(s) + } +} + +type TypeAtomicContext struct { + TypeContext + datatype antlr.Token +} + +func NewTypeAtomicContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TypeAtomicContext { + var p = new(TypeAtomicContext) + + InitEmptyTypeContext(&p.TypeContext) + p.parser = parser + p.CopyAll(ctx.(*TypeContext)) + + return p +} + +func (s *TypeAtomicContext) GetDatatype() antlr.Token { return s.datatype } + +func (s *TypeAtomicContext) SetDatatype(v antlr.Token) { s.datatype = v } + +func (s *TypeAtomicContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TypeAtomicContext) NULL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNULL, 0) +} + +func (s *TypeAtomicContext) BOOL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBOOL, 0) +} + +func (s *TypeAtomicContext) BOOLEAN() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBOOLEAN, 0) +} + +func (s *TypeAtomicContext) SMALLINT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSMALLINT, 0) +} + +func (s *TypeAtomicContext) INTEGER2() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINTEGER2, 0) +} + +func (s *TypeAtomicContext) INT2() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINT2, 0) +} + +func (s *TypeAtomicContext) INTEGER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINTEGER, 0) +} + +func (s *TypeAtomicContext) INT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINT, 0) +} + +func (s *TypeAtomicContext) INTEGER4() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINTEGER4, 0) +} + +func (s *TypeAtomicContext) INT4() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINT4, 0) +} + +func (s *TypeAtomicContext) INTEGER8() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINTEGER8, 0) +} + +func (s *TypeAtomicContext) INT8() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserINT8, 0) +} + +func (s *TypeAtomicContext) BIGINT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBIGINT, 0) +} + +func (s *TypeAtomicContext) REAL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserREAL, 0) +} + +func (s *TypeAtomicContext) TIMESTAMP() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTIMESTAMP, 0) +} + +func (s *TypeAtomicContext) CHAR() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCHAR, 0) +} + +func (s *TypeAtomicContext) CHARACTER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCHARACTER, 0) +} + +func (s *TypeAtomicContext) MISSING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserMISSING, 0) +} + +func (s *TypeAtomicContext) STRING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSTRING, 0) +} + +func (s *TypeAtomicContext) SYMBOL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSYMBOL, 0) +} + +func (s *TypeAtomicContext) BLOB() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBLOB, 0) +} + +func (s *TypeAtomicContext) CLOB() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCLOB, 0) +} + +func (s *TypeAtomicContext) DATE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDATE, 0) +} + +func (s *TypeAtomicContext) STRUCT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSTRUCT, 0) +} + +func (s *TypeAtomicContext) TUPLE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTUPLE, 0) +} + +func (s *TypeAtomicContext) LIST() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLIST, 0) +} + +func (s *TypeAtomicContext) SEXP() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserSEXP, 0) +} + +func (s *TypeAtomicContext) BAG() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserBAG, 0) +} + +func (s *TypeAtomicContext) ANY() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserANY, 0) +} + +func (s *TypeAtomicContext) PRECISION() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPRECISION, 0) +} + +func (s *TypeAtomicContext) DOUBLE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDOUBLE, 0) +} + +func (s *TypeAtomicContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTypeAtomic(s) + } +} + +func (s *TypeAtomicContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTypeAtomic(s) + } +} + +func (s *TypeAtomicContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTypeAtomic(s) + + default: + return t.VisitChildren(s) + } +} + +type TypeArgDoubleContext struct { + TypeContext + datatype antlr.Token + arg0 antlr.Token + arg1 antlr.Token +} + +func NewTypeArgDoubleContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TypeArgDoubleContext { + var p = new(TypeArgDoubleContext) + + InitEmptyTypeContext(&p.TypeContext) + p.parser = parser + p.CopyAll(ctx.(*TypeContext)) + + return p +} + +func (s *TypeArgDoubleContext) GetDatatype() antlr.Token { return s.datatype } + +func (s *TypeArgDoubleContext) GetArg0() antlr.Token { return s.arg0 } + +func (s *TypeArgDoubleContext) GetArg1() antlr.Token { return s.arg1 } + +func (s *TypeArgDoubleContext) SetDatatype(v antlr.Token) { s.datatype = v } + +func (s *TypeArgDoubleContext) SetArg0(v antlr.Token) { s.arg0 = v } + +func (s *TypeArgDoubleContext) SetArg1(v antlr.Token) { s.arg1 = v } + +func (s *TypeArgDoubleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TypeArgDoubleContext) DECIMAL() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDECIMAL, 0) +} + +func (s *TypeArgDoubleContext) DEC() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserDEC, 0) +} + +func (s *TypeArgDoubleContext) NUMERIC() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserNUMERIC, 0) +} + +func (s *TypeArgDoubleContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *TypeArgDoubleContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *TypeArgDoubleContext) AllLITERAL_INTEGER() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserLITERAL_INTEGER) +} + +func (s *TypeArgDoubleContext) LITERAL_INTEGER(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_INTEGER, i) +} + +func (s *TypeArgDoubleContext) COMMA() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCOMMA, 0) +} + +func (s *TypeArgDoubleContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTypeArgDouble(s) + } +} + +func (s *TypeArgDoubleContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTypeArgDouble(s) + } +} + +func (s *TypeArgDoubleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTypeArgDouble(s) + + default: + return t.VisitChildren(s) + } +} + +type TypeTimeZoneContext struct { + TypeContext + precision antlr.Token +} + +func NewTypeTimeZoneContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TypeTimeZoneContext { + var p = new(TypeTimeZoneContext) + + InitEmptyTypeContext(&p.TypeContext) + p.parser = parser + p.CopyAll(ctx.(*TypeContext)) + + return p +} + +func (s *TypeTimeZoneContext) GetPrecision() antlr.Token { return s.precision } + +func (s *TypeTimeZoneContext) SetPrecision(v antlr.Token) { s.precision = v } + +func (s *TypeTimeZoneContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TypeTimeZoneContext) AllTIME() []antlr.TerminalNode { + return s.GetTokens(PartiQLParserParserTIME) +} + +func (s *TypeTimeZoneContext) TIME(i int) antlr.TerminalNode { + return s.GetToken(PartiQLParserParserTIME, i) +} + +func (s *TypeTimeZoneContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *TypeTimeZoneContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *TypeTimeZoneContext) WITH() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserWITH, 0) +} + +func (s *TypeTimeZoneContext) ZONE() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserZONE, 0) +} + +func (s *TypeTimeZoneContext) LITERAL_INTEGER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_INTEGER, 0) +} + +func (s *TypeTimeZoneContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTypeTimeZone(s) + } +} + +func (s *TypeTimeZoneContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTypeTimeZone(s) + } +} + +func (s *TypeTimeZoneContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTypeTimeZone(s) + + default: + return t.VisitChildren(s) + } +} + +type TypeCustomContext struct { + TypeContext +} + +func NewTypeCustomContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TypeCustomContext { + var p = new(TypeCustomContext) + + InitEmptyTypeContext(&p.TypeContext) + p.parser = parser + p.CopyAll(ctx.(*TypeContext)) + + return p +} + +func (s *TypeCustomContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TypeCustomContext) SymbolPrimitive() ISymbolPrimitiveContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISymbolPrimitiveContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISymbolPrimitiveContext) +} + +func (s *TypeCustomContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTypeCustom(s) + } +} + +func (s *TypeCustomContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTypeCustom(s) + } +} + +func (s *TypeCustomContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTypeCustom(s) + + default: + return t.VisitChildren(s) + } +} + +type TypeVarCharContext struct { + TypeContext + arg0 antlr.Token +} + +func NewTypeVarCharContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TypeVarCharContext { + var p = new(TypeVarCharContext) + + InitEmptyTypeContext(&p.TypeContext) + p.parser = parser + p.CopyAll(ctx.(*TypeContext)) + + return p +} + +func (s *TypeVarCharContext) GetArg0() antlr.Token { return s.arg0 } + +func (s *TypeVarCharContext) SetArg0(v antlr.Token) { s.arg0 = v } + +func (s *TypeVarCharContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TypeVarCharContext) CHARACTER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserCHARACTER, 0) +} + +func (s *TypeVarCharContext) VARYING() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserVARYING, 0) +} + +func (s *TypeVarCharContext) PAREN_LEFT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_LEFT, 0) +} + +func (s *TypeVarCharContext) PAREN_RIGHT() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserPAREN_RIGHT, 0) +} + +func (s *TypeVarCharContext) LITERAL_INTEGER() antlr.TerminalNode { + return s.GetToken(PartiQLParserParserLITERAL_INTEGER, 0) +} + +func (s *TypeVarCharContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.EnterTypeVarChar(s) + } +} + +func (s *TypeVarCharContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(PartiQLParserListener); ok { + listenerT.ExitTypeVarChar(s) + } +} + +func (s *TypeVarCharContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case PartiQLParserVisitor: + return t.VisitTypeVarChar(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *PartiQLParserParser) Type_() (localctx ITypeContext) { + localctx = NewTypeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 236, PartiQLParserParserRULE_type) + var _la int + + p.SetState(1564) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 201, p.GetParserRuleContext()) { + case 1: + localctx = NewTypeAtomicContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1526) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*TypeAtomicContext).datatype = _lt + + _la = p.GetTokenStream().LA(1) + + if !(((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&9007199456067840) != 0) || ((int64((_la-111)) & ^0x3f) == 0 && ((int64(1)<<(_la-111))&144115188344291331) != 0) || ((int64((_la-186)) & ^0x3f) == 0 && ((int64(1)<<(_la-186))&-9223090561878048767) != 0) || ((int64((_la-250)) & ^0x3f) == 0 && ((int64(1)<<(_la-250))&131071) != 0)) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*TypeAtomicContext).datatype = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + case 2: + localctx = NewTypeAtomicContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1527) + + var _m = p.Match(PartiQLParserParserDOUBLE) + + localctx.(*TypeAtomicContext).datatype = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1528) + p.Match(PartiQLParserParserPRECISION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 3: + localctx = NewTypeArgSingleContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(1529) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*TypeArgSingleContext).datatype = _lt + + _la = p.GetTokenStream().LA(1) + + if !(((int64((_la-26)) & ^0x3f) == 0 && ((int64(1)<<(_la-26))&-9223372036854775805) != 0) || _la == PartiQLParserParserVARCHAR) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*TypeArgSingleContext).datatype = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + p.SetState(1533) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 195, p.GetParserRuleContext()) == 1 { + { + p.SetState(1530) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1531) + + var _m = p.Match(PartiQLParserParserLITERAL_INTEGER) + + localctx.(*TypeArgSingleContext).arg0 = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1532) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case 4: + localctx = NewTypeVarCharContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(1535) + p.Match(PartiQLParserParserCHARACTER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1536) + p.Match(PartiQLParserParserVARYING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1540) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 196, p.GetParserRuleContext()) == 1 { + { + p.SetState(1537) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1538) + + var _m = p.Match(PartiQLParserParserLITERAL_INTEGER) + + localctx.(*TypeVarCharContext).arg0 = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1539) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case 5: + localctx = NewTypeArgDoubleContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(1542) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*TypeArgDoubleContext).datatype = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == PartiQLParserParserDEC || _la == PartiQLParserParserDECIMAL || _la == PartiQLParserParserNUMERIC) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*TypeArgDoubleContext).datatype = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + p.SetState(1550) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 198, p.GetParserRuleContext()) == 1 { + { + p.SetState(1543) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1544) + + var _m = p.Match(PartiQLParserParserLITERAL_INTEGER) + + localctx.(*TypeArgDoubleContext).arg0 = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1547) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == PartiQLParserParserCOMMA { + { + p.SetState(1545) + p.Match(PartiQLParserParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1546) + + var _m = p.Match(PartiQLParserParserLITERAL_INTEGER) + + localctx.(*TypeArgDoubleContext).arg1 = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(1549) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case 6: + localctx = NewTypeTimeZoneContext(p, localctx) + p.EnterOuterAlt(localctx, 6) + { + p.SetState(1552) + p.Match(PartiQLParserParserTIME) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1556) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 199, p.GetParserRuleContext()) == 1 { + { + p.SetState(1553) + p.Match(PartiQLParserParserPAREN_LEFT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1554) + + var _m = p.Match(PartiQLParserParserLITERAL_INTEGER) + + localctx.(*TypeTimeZoneContext).precision = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1555) + p.Match(PartiQLParserParserPAREN_RIGHT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + p.SetState(1561) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 200, p.GetParserRuleContext()) == 1 { + { + p.SetState(1558) + p.Match(PartiQLParserParserWITH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1559) + p.Match(PartiQLParserParserTIME) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1560) + p.Match(PartiQLParserParserZONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } else if p.HasError() { // JIM + goto errorExit + } + + case 7: + localctx = NewTypeCustomContext(p, localctx) + p.EnterOuterAlt(localctx, 7) + { + p.SetState(1563) + p.SymbolPrimitive() + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +func (p *PartiQLParserParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { + switch ruleIndex { + case 70: + var t *TableReferenceContext = nil + if localctx != nil { + t = localctx.(*TableReferenceContext) + } + return p.TableReference_Sempred(t, predIndex) + + case 78: + var t *ExprBagOpContext = nil + if localctx != nil { + t = localctx.(*ExprBagOpContext) + } + return p.ExprBagOp_Sempred(t, predIndex) + + case 80: + var t *ExprOrContext = nil + if localctx != nil { + t = localctx.(*ExprOrContext) + } + return p.ExprOr_Sempred(t, predIndex) + + case 81: + var t *ExprAndContext = nil + if localctx != nil { + t = localctx.(*ExprAndContext) + } + return p.ExprAnd_Sempred(t, predIndex) + + case 83: + var t *ExprPredicateContext = nil + if localctx != nil { + t = localctx.(*ExprPredicateContext) + } + return p.ExprPredicate_Sempred(t, predIndex) + + case 84: + var t *MathOp00Context = nil + if localctx != nil { + t = localctx.(*MathOp00Context) + } + return p.MathOp00_Sempred(t, predIndex) + + case 85: + var t *MathOp01Context = nil + if localctx != nil { + t = localctx.(*MathOp01Context) + } + return p.MathOp01_Sempred(t, predIndex) + + case 86: + var t *MathOp02Context = nil + if localctx != nil { + t = localctx.(*MathOp02Context) + } + return p.MathOp02_Sempred(t, predIndex) + + case 88: + var t *ExprPrimaryContext = nil + if localctx != nil { + t = localctx.(*ExprPrimaryContext) + } + return p.ExprPrimary_Sempred(t, predIndex) + + default: + panic("No predicate with index: " + fmt.Sprint(ruleIndex)) + } +} + +func (p *PartiQLParserParser) TableReference_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 0: + return p.Precpred(p.GetParserRuleContext(), 5) + + case 1: + return p.Precpred(p.GetParserRuleContext(), 4) + + case 2: + return p.Precpred(p.GetParserRuleContext(), 3) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} + +func (p *PartiQLParserParser) ExprBagOp_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 3: + return p.Precpred(p.GetParserRuleContext(), 4) + + case 4: + return p.Precpred(p.GetParserRuleContext(), 3) + + case 5: + return p.Precpred(p.GetParserRuleContext(), 2) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} + +func (p *PartiQLParserParser) ExprOr_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 6: + return p.Precpred(p.GetParserRuleContext(), 2) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} + +func (p *PartiQLParserParser) ExprAnd_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 7: + return p.Precpred(p.GetParserRuleContext(), 2) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} + +func (p *PartiQLParserParser) ExprPredicate_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 8: + return p.Precpred(p.GetParserRuleContext(), 7) + + case 9: + return p.Precpred(p.GetParserRuleContext(), 6) + + case 10: + return p.Precpred(p.GetParserRuleContext(), 5) + + case 11: + return p.Precpred(p.GetParserRuleContext(), 4) + + case 12: + return p.Precpred(p.GetParserRuleContext(), 3) + + case 13: + return p.Precpred(p.GetParserRuleContext(), 2) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} + +func (p *PartiQLParserParser) MathOp00_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 14: + return p.Precpred(p.GetParserRuleContext(), 2) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} + +func (p *PartiQLParserParser) MathOp01_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 15: + return p.Precpred(p.GetParserRuleContext(), 2) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} + +func (p *PartiQLParserParser) MathOp02_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 16: + return p.Precpred(p.GetParserRuleContext(), 2) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} + +func (p *PartiQLParserParser) ExprPrimary_Sempred(localctx antlr.RuleContext, predIndex int) bool { + switch predIndex { + case 17: + return p.Precpred(p.GetParserRuleContext(), 6) + + default: + panic("No predicate with index: " + fmt.Sprint(predIndex)) + } +} diff --git a/partiql/partiqlparser_visitor.go b/partiql/partiqlparser_visitor.go new file mode 100644 index 0000000..eeab27f --- /dev/null +++ b/partiql/partiqlparser_visitor.go @@ -0,0 +1,558 @@ +// Code generated from PartiQLParser.g4 by ANTLR 4.13.2. DO NOT EDIT. + +package partiql // PartiQLParser +import "github.com/antlr4-go/antlr/v4" + +// A complete Visitor for a parse tree produced by PartiQLParserParser. +type PartiQLParserVisitor interface { + antlr.ParseTreeVisitor + + // Visit a parse tree produced by PartiQLParserParser#script. + VisitScript(ctx *ScriptContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#root. + VisitRoot(ctx *RootContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#QueryDql. + VisitQueryDql(ctx *QueryDqlContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#QueryDml. + VisitQueryDml(ctx *QueryDmlContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#QueryDdl. + VisitQueryDdl(ctx *QueryDdlContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#QueryExec. + VisitQueryExec(ctx *QueryExecContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#explainOption. + VisitExplainOption(ctx *ExplainOptionContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#asIdent. + VisitAsIdent(ctx *AsIdentContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#atIdent. + VisitAtIdent(ctx *AtIdentContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#byIdent. + VisitByIdent(ctx *ByIdentContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#symbolPrimitive. + VisitSymbolPrimitive(ctx *SymbolPrimitiveContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#dql. + VisitDql(ctx *DqlContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#execCommand. + VisitExecCommand(ctx *ExecCommandContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#ddl. + VisitDdl(ctx *DdlContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#CreateTable. + VisitCreateTable(ctx *CreateTableContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#CreateIndex. + VisitCreateIndex(ctx *CreateIndexContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#DropTable. + VisitDropTable(ctx *DropTableContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#DropIndex. + VisitDropIndex(ctx *DropIndexContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#DmlBaseWrapper. + VisitDmlBaseWrapper(ctx *DmlBaseWrapperContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#DmlDelete. + VisitDmlDelete(ctx *DmlDeleteContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#DmlInsertReturning. + VisitDmlInsertReturning(ctx *DmlInsertReturningContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#DmlBase. + VisitDmlBase(ctx *DmlBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#dmlBaseCommand. + VisitDmlBaseCommand(ctx *DmlBaseCommandContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#pathSimple. + VisitPathSimple(ctx *PathSimpleContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PathSimpleLiteral. + VisitPathSimpleLiteral(ctx *PathSimpleLiteralContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PathSimpleSymbol. + VisitPathSimpleSymbol(ctx *PathSimpleSymbolContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PathSimpleDotSymbol. + VisitPathSimpleDotSymbol(ctx *PathSimpleDotSymbolContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#replaceCommand. + VisitReplaceCommand(ctx *ReplaceCommandContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#upsertCommand. + VisitUpsertCommand(ctx *UpsertCommandContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#removeCommand. + VisitRemoveCommand(ctx *RemoveCommandContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#insertCommandReturning. + VisitInsertCommandReturning(ctx *InsertCommandReturningContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#InsertLegacy. + VisitInsertLegacy(ctx *InsertLegacyContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#Insert. + VisitInsert(ctx *InsertContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#OnConflictLegacy. + VisitOnConflictLegacy(ctx *OnConflictLegacyContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#OnConflict. + VisitOnConflict(ctx *OnConflictContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#conflictTarget. + VisitConflictTarget(ctx *ConflictTargetContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#constraintName. + VisitConstraintName(ctx *ConstraintNameContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#conflictAction. + VisitConflictAction(ctx *ConflictActionContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#doReplace. + VisitDoReplace(ctx *DoReplaceContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#doUpdate. + VisitDoUpdate(ctx *DoUpdateContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#updateClause. + VisitUpdateClause(ctx *UpdateClauseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#setCommand. + VisitSetCommand(ctx *SetCommandContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#setAssignment. + VisitSetAssignment(ctx *SetAssignmentContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#deleteCommand. + VisitDeleteCommand(ctx *DeleteCommandContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#returningClause. + VisitReturningClause(ctx *ReturningClauseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#returningColumn. + VisitReturningColumn(ctx *ReturningColumnContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#FromClauseSimpleExplicit. + VisitFromClauseSimpleExplicit(ctx *FromClauseSimpleExplicitContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#FromClauseSimpleImplicit. + VisitFromClauseSimpleImplicit(ctx *FromClauseSimpleImplicitContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#whereClause. + VisitWhereClause(ctx *WhereClauseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#SelectAll. + VisitSelectAll(ctx *SelectAllContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#SelectItems. + VisitSelectItems(ctx *SelectItemsContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#SelectValue. + VisitSelectValue(ctx *SelectValueContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#SelectPivot. + VisitSelectPivot(ctx *SelectPivotContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#projectionItems. + VisitProjectionItems(ctx *ProjectionItemsContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#projectionItem. + VisitProjectionItem(ctx *ProjectionItemContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#setQuantifierStrategy. + VisitSetQuantifierStrategy(ctx *SetQuantifierStrategyContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#letClause. + VisitLetClause(ctx *LetClauseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#letBinding. + VisitLetBinding(ctx *LetBindingContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#orderByClause. + VisitOrderByClause(ctx *OrderByClauseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#orderSortSpec. + VisitOrderSortSpec(ctx *OrderSortSpecContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#groupClause. + VisitGroupClause(ctx *GroupClauseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#groupAlias. + VisitGroupAlias(ctx *GroupAliasContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#groupKey. + VisitGroupKey(ctx *GroupKeyContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#over. + VisitOver(ctx *OverContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#windowPartitionList. + VisitWindowPartitionList(ctx *WindowPartitionListContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#windowSortSpecList. + VisitWindowSortSpecList(ctx *WindowSortSpecListContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#havingClause. + VisitHavingClause(ctx *HavingClauseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#fromClause. + VisitFromClause(ctx *FromClauseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#whereClauseSelect. + VisitWhereClauseSelect(ctx *WhereClauseSelectContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#offsetByClause. + VisitOffsetByClause(ctx *OffsetByClauseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#limitClause. + VisitLimitClause(ctx *LimitClauseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#gpmlPattern. + VisitGpmlPattern(ctx *GpmlPatternContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#gpmlPatternList. + VisitGpmlPatternList(ctx *GpmlPatternListContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#matchPattern. + VisitMatchPattern(ctx *MatchPatternContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#graphPart. + VisitGraphPart(ctx *GraphPartContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#SelectorBasic. + VisitSelectorBasic(ctx *SelectorBasicContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#SelectorAny. + VisitSelectorAny(ctx *SelectorAnyContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#SelectorShortest. + VisitSelectorShortest(ctx *SelectorShortestContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#patternPathVariable. + VisitPatternPathVariable(ctx *PatternPathVariableContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#patternRestrictor. + VisitPatternRestrictor(ctx *PatternRestrictorContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#node. + VisitNode(ctx *NodeContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#EdgeWithSpec. + VisitEdgeWithSpec(ctx *EdgeWithSpecContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#EdgeAbbreviated. + VisitEdgeAbbreviated(ctx *EdgeAbbreviatedContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#pattern. + VisitPattern(ctx *PatternContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#patternQuantifier. + VisitPatternQuantifier(ctx *PatternQuantifierContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#EdgeSpecRight. + VisitEdgeSpecRight(ctx *EdgeSpecRightContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#EdgeSpecUndirected. + VisitEdgeSpecUndirected(ctx *EdgeSpecUndirectedContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#EdgeSpecLeft. + VisitEdgeSpecLeft(ctx *EdgeSpecLeftContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#EdgeSpecUndirectedRight. + VisitEdgeSpecUndirectedRight(ctx *EdgeSpecUndirectedRightContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#EdgeSpecUndirectedLeft. + VisitEdgeSpecUndirectedLeft(ctx *EdgeSpecUndirectedLeftContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#EdgeSpecBidirectional. + VisitEdgeSpecBidirectional(ctx *EdgeSpecBidirectionalContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#EdgeSpecUndirectedBidirectional. + VisitEdgeSpecUndirectedBidirectional(ctx *EdgeSpecUndirectedBidirectionalContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#edgeSpec. + VisitEdgeSpec(ctx *EdgeSpecContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#patternPartLabel. + VisitPatternPartLabel(ctx *PatternPartLabelContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#edgeAbbrev. + VisitEdgeAbbrev(ctx *EdgeAbbrevContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TableWrapped. + VisitTableWrapped(ctx *TableWrappedContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TableCrossJoin. + VisitTableCrossJoin(ctx *TableCrossJoinContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TableQualifiedJoin. + VisitTableQualifiedJoin(ctx *TableQualifiedJoinContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TableRefBase. + VisitTableRefBase(ctx *TableRefBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#tableNonJoin. + VisitTableNonJoin(ctx *TableNonJoinContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TableBaseRefSymbol. + VisitTableBaseRefSymbol(ctx *TableBaseRefSymbolContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TableBaseRefClauses. + VisitTableBaseRefClauses(ctx *TableBaseRefClausesContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TableBaseRefMatch. + VisitTableBaseRefMatch(ctx *TableBaseRefMatchContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#tableUnpivot. + VisitTableUnpivot(ctx *TableUnpivotContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#JoinRhsBase. + VisitJoinRhsBase(ctx *JoinRhsBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#JoinRhsTableJoined. + VisitJoinRhsTableJoined(ctx *JoinRhsTableJoinedContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#joinSpec. + VisitJoinSpec(ctx *JoinSpecContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#joinType. + VisitJoinType(ctx *JoinTypeContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#expr. + VisitExpr(ctx *ExprContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#Intersect. + VisitIntersect(ctx *IntersectContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#QueryBase. + VisitQueryBase(ctx *QueryBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#Except. + VisitExcept(ctx *ExceptContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#Union. + VisitUnion(ctx *UnionContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#SfwQuery. + VisitSfwQuery(ctx *SfwQueryContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#SfwBase. + VisitSfwBase(ctx *SfwBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#Or. + VisitOr(ctx *OrContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#ExprOrBase. + VisitExprOrBase(ctx *ExprOrBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#ExprAndBase. + VisitExprAndBase(ctx *ExprAndBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#And. + VisitAnd(ctx *AndContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#Not. + VisitNot(ctx *NotContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#ExprNotBase. + VisitExprNotBase(ctx *ExprNotBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PredicateIn. + VisitPredicateIn(ctx *PredicateInContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PredicateBetween. + VisitPredicateBetween(ctx *PredicateBetweenContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PredicateBase. + VisitPredicateBase(ctx *PredicateBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PredicateComparison. + VisitPredicateComparison(ctx *PredicateComparisonContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PredicateIs. + VisitPredicateIs(ctx *PredicateIsContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PredicateLike. + VisitPredicateLike(ctx *PredicateLikeContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#mathOp00. + VisitMathOp00(ctx *MathOp00Context) interface{} + + // Visit a parse tree produced by PartiQLParserParser#mathOp01. + VisitMathOp01(ctx *MathOp01Context) interface{} + + // Visit a parse tree produced by PartiQLParserParser#mathOp02. + VisitMathOp02(ctx *MathOp02Context) interface{} + + // Visit a parse tree produced by PartiQLParserParser#valueExpr. + VisitValueExpr(ctx *ValueExprContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#ExprPrimaryPath. + VisitExprPrimaryPath(ctx *ExprPrimaryPathContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#ExprPrimaryBase. + VisitExprPrimaryBase(ctx *ExprPrimaryBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#ExprTermWrappedQuery. + VisitExprTermWrappedQuery(ctx *ExprTermWrappedQueryContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#ExprTermBase. + VisitExprTermBase(ctx *ExprTermBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#nullIf. + VisitNullIf(ctx *NullIfContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#coalesce. + VisitCoalesce(ctx *CoalesceContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#caseExpr. + VisitCaseExpr(ctx *CaseExprContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#values. + VisitValues(ctx *ValuesContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#valueRow. + VisitValueRow(ctx *ValueRowContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#valueList. + VisitValueList(ctx *ValueListContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#sequenceConstructor. + VisitSequenceConstructor(ctx *SequenceConstructorContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#substring. + VisitSubstring(ctx *SubstringContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#CountAll. + VisitCountAll(ctx *CountAllContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#AggregateBase. + VisitAggregateBase(ctx *AggregateBaseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LagLeadFunction. + VisitLagLeadFunction(ctx *LagLeadFunctionContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#cast. + VisitCast(ctx *CastContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#canLosslessCast. + VisitCanLosslessCast(ctx *CanLosslessCastContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#canCast. + VisitCanCast(ctx *CanCastContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#extract. + VisitExtract(ctx *ExtractContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#trimFunction. + VisitTrimFunction(ctx *TrimFunctionContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#dateFunction. + VisitDateFunction(ctx *DateFunctionContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#FunctionCallReserved. + VisitFunctionCallReserved(ctx *FunctionCallReservedContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#FunctionCallIdent. + VisitFunctionCallIdent(ctx *FunctionCallIdentContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PathStepIndexExpr. + VisitPathStepIndexExpr(ctx *PathStepIndexExprContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PathStepIndexAll. + VisitPathStepIndexAll(ctx *PathStepIndexAllContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PathStepDotExpr. + VisitPathStepDotExpr(ctx *PathStepDotExprContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#PathStepDotAll. + VisitPathStepDotAll(ctx *PathStepDotAllContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#exprGraphMatchMany. + VisitExprGraphMatchMany(ctx *ExprGraphMatchManyContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#exprGraphMatchOne. + VisitExprGraphMatchOne(ctx *ExprGraphMatchOneContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#parameter. + VisitParameter(ctx *ParameterContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#varRefExpr. + VisitVarRefExpr(ctx *VarRefExprContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#collection. + VisitCollection(ctx *CollectionContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#array. + VisitArray(ctx *ArrayContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#bag. + VisitBag(ctx *BagContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#tuple. + VisitTuple(ctx *TupleContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#pair. + VisitPair(ctx *PairContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LiteralNull. + VisitLiteralNull(ctx *LiteralNullContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LiteralMissing. + VisitLiteralMissing(ctx *LiteralMissingContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LiteralTrue. + VisitLiteralTrue(ctx *LiteralTrueContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LiteralFalse. + VisitLiteralFalse(ctx *LiteralFalseContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LiteralString. + VisitLiteralString(ctx *LiteralStringContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LiteralInteger. + VisitLiteralInteger(ctx *LiteralIntegerContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LiteralDecimal. + VisitLiteralDecimal(ctx *LiteralDecimalContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LiteralIon. + VisitLiteralIon(ctx *LiteralIonContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LiteralDate. + VisitLiteralDate(ctx *LiteralDateContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#LiteralTime. + VisitLiteralTime(ctx *LiteralTimeContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TypeAtomic. + VisitTypeAtomic(ctx *TypeAtomicContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TypeArgSingle. + VisitTypeArgSingle(ctx *TypeArgSingleContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TypeVarChar. + VisitTypeVarChar(ctx *TypeVarCharContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TypeArgDouble. + VisitTypeArgDouble(ctx *TypeArgDoubleContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TypeTimeZone. + VisitTypeTimeZone(ctx *TypeTimeZoneContext) interface{} + + // Visit a parse tree produced by PartiQLParserParser#TypeCustom. + VisitTypeCustom(ctx *TypeCustomContext) interface{} +} diff --git a/partiql/simple.sql b/partiql/simple.sql new file mode 100644 index 0000000..6440575 --- /dev/null +++ b/partiql/simple.sql @@ -0,0 +1,5 @@ +DELETE FROM Music WHERE Artist = 'Pink Floyd' AND SongTitle = 'Money'; +INSERT INTO Music VALUE {'AlbumTitle': 'The Dark Side of the Moon', 'Artist': 'Pink Floyd', 'Awards': 300, 'SongTitle': 'Money'}; +INSERT INTO Music VALUE {'AlbumTitle': 'The Dark Side of the Moon', 'Artist': 'Pink Floyd', 'Awards': 300, 'SongTitle': 'Money02'}; +INSERT INTO Music VALUE {'AlbumTitle': 'The Dark Side of the Moon', 'Artist': 'Pink Floyd', 'Awards': 300, 'SongTitle': 'Money03'}; +DELETE FROM Music WHERE Artist = 'Pink Floyd' AND SongTitle = 'Money02' \ No newline at end of file