diff --git a/shardingsphere-operator/pkg/distsql/antlr4/mask/Alphabet.g4 b/shardingsphere-operator/pkg/distsql/antlr4/mask/Alphabet.g4 new file mode 100644 index 00000000..1e9e8f00 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/mask/Alphabet.g4 @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Alphabet; + +FOR_GENERATOR: 'DO NOT MATCH ANY THING, JUST FOR GENERATOR'; + +fragment A: [Aa]; +fragment B: [Bb]; +fragment C: [Cc]; +fragment D: [Dd]; +fragment E: [Ee]; +fragment F: [Ff]; +fragment G: [Gg]; +fragment H: [Hh]; +fragment I: [Ii]; +fragment J: [Jj]; +fragment K: [Kk]; +fragment L: [Ll]; +fragment M: [Mm]; +fragment N: [Nn]; +fragment O: [Oo]; +fragment P: [Pp]; +fragment Q: [Qq]; +fragment R: [Rr]; +fragment S: [Ss]; +fragment T: [Tt]; +fragment U: [Uu]; +fragment V: [Vv]; +fragment W: [Ww]; +fragment X: [Xx]; +fragment Y: [Yy]; +fragment Z: [Zz]; +fragment UL_: '_'; \ No newline at end of file diff --git a/shardingsphere-operator/pkg/distsql/antlr4/mask/BaseRule.g4 b/shardingsphere-operator/pkg/distsql/antlr4/mask/BaseRule.g4 new file mode 100644 index 00000000..aca9d352 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/mask/BaseRule.g4 @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar BaseRule; + +import Symbol, Keyword, Literals; + +literal + : STRING_ | (MINUS_)? INT_ | TRUE | FALSE + ; + +algorithmDefinition + : TYPE LP_ NAME EQ_ algorithmTypeName (COMMA_ propertiesDefinition)? RP_ + ; + +algorithmTypeName + : STRING_ | buildInMaskAlgorithmType + ; + +buildInMaskAlgorithmType + : MD5 + | KEEP_FIRST_N_LAST_M + | KEEP_FROM_X_TO_Y + | MASK_FIRST_N_LAST_M + | MASK_FROM_X_TO_Y + | MASK_BEFORE_SPECIAL_CHARS + | MASK_AFTER_SPECIAL_CHARS + | PERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE + | MILITARY_IDENTITY_NUMBER_RANDOM_REPLACE + | LANDLINE_NUMBER_RANDOM_REPLACE + | TELEPHONE_RANDOM_REPLACE + | UNIFIED_CREDIT_CODE_RANDOM_REPLACE + | GENERIC_TABLE_RANDOM_REPLACE + ; + +propertiesDefinition + : PROPERTIES LP_ properties? RP_ + ; + +properties + : property (COMMA_ property)* + ; + +property + : key=STRING_ EQ_ value=literal + ; + +ruleName + : IDENTIFIER_ + ; \ No newline at end of file diff --git a/shardingsphere-operator/pkg/distsql/antlr4/mask/Keyword.g4 b/shardingsphere-operator/pkg/distsql/antlr4/mask/Keyword.g4 new file mode 100644 index 00000000..cb250a48 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/mask/Keyword.g4 @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Keyword; + +import Alphabet; + +WS + : [ \t\r\n] + ->skip + ; + +TRUE + : T R U E + ; + +FALSE + : F A L S E + ; + +CREATE + : C R E A T E + ; + +ALTER + : A L T E R + ; + +DROP + : D R O P + ; + +SHOW + : S H O W + ; + +RULE + : R U L E + ; + +FROM + : F R O M + ; + +MASK + : M A S K + ; + +TYPE + : T Y P E + ; + +NAME + : N A M E + ; + +PROPERTIES + : P R O P E R T I E S + ; + +COLUMN + : C O L U M N + ; + +RULES + : R U L E S + ; + +TABLE + : T A B L E + ; + +COLUMNS + : C O L U M N S + ; + +IF + : I F + ; + +EXISTS + : E X I S T S + ; + +COUNT + : C O U N T + ; + +NOT + : N O T + ; + +MD5 + : M D [5] + ; + +KEEP_FIRST_N_LAST_M + : K E E P UL_ F I R S T UL_ N UL_ L A S T UL_ M + ; + +KEEP_FROM_X_TO_Y + : K E E P UL_ F R O M UL_ X UL_ T O UL_ Y + ; + +MASK_FIRST_N_LAST_M + : M A S K UL_ F I R S T UL_ N UL_ L A S T UL_ M + ; + +MASK_FROM_X_TO_Y + : M A S K UL_ F R O M UL_ X UL_ T O UL_ Y + ; + +MASK_BEFORE_SPECIAL_CHARS + : M A S K UL_ B E F O R E UL_ S P E C I A L UL_ C H A R S + ; + +MASK_AFTER_SPECIAL_CHARS + : M A S K UL_ A F T E R UL_ S P E C I A L UL_ C H A R S + ; + +PERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE + : P E R S O N A L UL_ I D E N T I T Y UL_ N U M B E R UL_ R A N D O M UL_ R E P L A C E + ; + +MILITARY_IDENTITY_NUMBER_RANDOM_REPLACE + : M I L I T A R Y UL_ I D E N T I T Y UL_ N U M B E R UL_ R A N D O M UL_ R E P L A C E + ; + +LANDLINE_NUMBER_RANDOM_REPLACE + : L A N D L I N E UL_ N U M B E R UL_ R A N D O M UL_ R E P L A C E + ; + +TELEPHONE_RANDOM_REPLACE + : T E L E P H O N E UL_ R A N D O M UL_ R E P L A C E + ; + +UNIFIED_CREDIT_CODE_RANDOM_REPLACE + : U N I F I E D UL_ C R E D I T UL_ C O D E UL_ R A N D O M UL_ R E P L A C E + ; + +GENERIC_TABLE_RANDOM_REPLACE + : G E N E R I C UL_ T A B L E UL_ R A N D O M UL_ R E P L A C E + ; + +ADDRESS_RANDOM_REPLACE + : A D D R E S S UL_ R A N D O M UL_ R E P L A C E + ; \ No newline at end of file diff --git a/shardingsphere-operator/pkg/distsql/antlr4/mask/Literals.g4 b/shardingsphere-operator/pkg/distsql/antlr4/mask/Literals.g4 new file mode 100644 index 00000000..fbcf5621 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/mask/Literals.g4 @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Literals; + +import Alphabet, Symbol; + +IDENTIFIER_ + : [A-Za-z_$0-9]*?[A-Za-z_$]+?[A-Za-z_$0-9]* + | BQ_ ~'`'+ BQ_ + ; + +STRING_ + : (DQ_ ('\\'. | '""' | ~('"' | '\\'))* DQ_) + | (SQ_ ('\\'. | '\'\'' | ~('\'' | '\\'))* SQ_) + ; + +INT_ + : [0-9]+ + ; + +HEX_ + : [0-9a-fA-F] + ; + +NUMBER_ + : INT_? DOT_? INT_ (E (PLUS_ | MINUS_)? INT_)? + ; + +HEXDIGIT_ + : '0x' HEX_+ | 'X' SQ_ HEX_+ SQ_ + ; + +BITNUM_ + : '0b' ('0' | '1')+ | B SQ_ ('0' | '1')+ SQ_ + ; \ No newline at end of file diff --git a/shardingsphere-operator/pkg/distsql/antlr4/mask/RDLStatement.g4 b/shardingsphere-operator/pkg/distsql/antlr4/mask/RDLStatement.g4 new file mode 100644 index 00000000..5ee11832 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/mask/RDLStatement.g4 @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar RDLStatement; + +import BaseRule; + +createMaskRule + : CREATE MASK TABLE? RULE ifNotExists? maskRuleDefinition (COMMA_ maskRuleDefinition)* + ; + +alterMaskRule + : ALTER MASK TABLE? RULE maskRuleDefinition (COMMA_ maskRuleDefinition)* + ; + +dropMaskRule + : DROP MASK TABLE? RULE ifExists? ruleName (COMMA_ ruleName)* + ; + +maskRuleDefinition + : ruleName LP_ COLUMNS LP_ columnDefinition (COMMA_ columnDefinition)* RP_ RP_ + ; + +columnDefinition + : LP_ NAME EQ_ columnName COMMA_ algorithmDefinition RP_ + ; + +columnName + : IDENTIFIER_ + ; + +ifExists + : IF EXISTS + ; + +ifNotExists + : IF NOT EXISTS + ; \ No newline at end of file diff --git a/shardingsphere-operator/pkg/distsql/antlr4/mask/RQLStatement.g4 b/shardingsphere-operator/pkg/distsql/antlr4/mask/RQLStatement.g4 new file mode 100644 index 00000000..1180d381 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/mask/RQLStatement.g4 @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar RQLStatement; + +import BaseRule; + +showMaskRules + : SHOW MASK TABLE? (RULE ruleName | RULES) (FROM databaseName)? + ; + +countMaskRule + : COUNT MASK RULE (FROM databaseName)? + ; + +databaseName + : IDENTIFIER_ + ; \ No newline at end of file diff --git a/shardingsphere-operator/pkg/distsql/antlr4/mask/Symbol.g4 b/shardingsphere-operator/pkg/distsql/antlr4/mask/Symbol.g4 new file mode 100644 index 00000000..237ab032 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/mask/Symbol.g4 @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Symbol; + +AND_: '&&'; +OR_: '||'; +NOT_: '!'; +TILDE_: '~'; +VERTICALBAR_: '|'; +AMPERSAND_: '&'; +SIGNEDLEFTSHIFT_: '<<'; +SIGNEDRIGHTSHIFT_: '>>'; +CARET_: '^'; +MOD_: '%'; +COLON_: ':'; +PLUS_: '+'; +MINUS_: '-'; +ASTERISK_: '*'; +SLASH_: '/'; +BACKSLASH_: '\\'; +DOT_: '.'; +DOTASTERISK_: '.*'; +SAFEEQ_: '<=>'; +DEQ_: '=='; +EQ_: '='; +NEQ_: '<>' | '!='; +GT_: '>'; +GTE_: '>='; +LT_: '<'; +LTE_: '<='; +POUND_: '#'; +LP_: '('; +RP_: ')'; +LBE_: '{'; +RBE_: '}'; +LBT_: '['; +RBT_: ']'; +COMMA_: ','; +DQ_: '"'; +SQ_: '\''; +BQ_: '`'; +QUESTION_: '?'; +AT_: '@'; +SEMI_: ';'; +JSONSEPARATOR_: '->>'; +UL_: '_'; \ No newline at end of file diff --git a/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Alphabet.g4 b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Alphabet.g4 new file mode 100644 index 00000000..f7603cc7 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Alphabet.g4 @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Alphabet; + +FOR_GENERATOR: 'DO NOT MATCH ANY THING, JUST FOR GENERATOR'; + +fragment A: [Aa]; +fragment B: [Bb]; +fragment C: [Cc]; +fragment D: [Dd]; +fragment E: [Ee]; +fragment F: [Ff]; +fragment G: [Gg]; +fragment H: [Hh]; +fragment I: [Ii]; +fragment J: [Jj]; +fragment K: [Kk]; +fragment L: [Ll]; +fragment M: [Mm]; +fragment N: [Nn]; +fragment O: [Oo]; +fragment P: [Pp]; +fragment Q: [Qq]; +fragment R: [Rr]; +fragment S: [Ss]; +fragment T: [Tt]; +fragment U: [Uu]; +fragment V: [Vv]; +fragment W: [Ww]; +fragment X: [Xx]; +fragment Y: [Yy]; +fragment Z: [Zz]; +fragment UL_: '_'; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/BaseRule.g4 b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/BaseRule.g4 new file mode 100644 index 00000000..8b23e501 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/BaseRule.g4 @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar BaseRule; + +import Symbol, Keyword, Literals; + +literal + : STRING_ | (MINUS_)? INT_ | TRUE | FALSE + ; + +algorithmDefinition + : TYPE LP_ NAME EQ_ algorithmTypeName (COMMA_ propertiesDefinition)? RP_ + ; + +algorithmTypeName + : STRING_ | buildInReadQueryLoadBalanceAlgorithmType + ; + +buildInReadQueryLoadBalanceAlgorithmType + : ROUND_ROBIN + | RANDOM + | WEIGHT + ; + +propertiesDefinition + : PROPERTIES LP_ properties? RP_ + ; + +properties + : property (COMMA_ property)* + ; + +property + : key=STRING_ EQ_ value=literal + ; + +databaseName + : IDENTIFIER_ + ; + +groupName + : IDENTIFIER_ + ; + +storageUnitName + : IDENTIFIER_ + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Keyword.g4 b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Keyword.g4 new file mode 100644 index 00000000..3965f963 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Keyword.g4 @@ -0,0 +1,136 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Keyword; + +import Alphabet; + +WS + : [ \t\r\n] + ->skip + ; + +TRUE + : T R U E + ; + +FALSE + : F A L S E + ; + +CREATE + : C R E A T E + ; + +ALTER + : A L T E R + ; + +DROP + : D R O P + ; + +SHOW + : S H O W + ; + +RULE + : R U L E + ; + +FROM + : F R O M + ; + +READWRITE_SPLITTING + : R E A D W R I T E UL_ S P L I T T I N G + ; + +WRITE_STORAGE_UNIT + : W R I T E UL_ S T O R A G E UL_ U N I T + ; + +READ_STORAGE_UNITS + : R E A D UL_ S T O R A G E UL_ U N I T S + ; + +TRANSACTIONAL_READ_QUERY_STRATEGY + : T R A N S A C T I O N A L UL_ R E A D UL_ Q U E R Y UL_ S T R A T E G Y + ; + +TYPE + : T Y P E + ; + +NAME + : N A M E + ; + +PROPERTIES + : P R O P E R T I E S + ; + +RULES + : R U L E S + ; + +RESOURCES + : R E S O U R C E S + ; + +STATUS + : S T A T U S + ; + +ENABLE + : E N A B L E + ; + +DISABLE + : D I S A B L E + ; + +READ + : R E A D + ; + +IF + : I F + ; + +EXISTS + : E X I S T S + ; + +COUNT + : C O U N T + ; + +ROUND_ROBIN + : R O U N D UL_ R O B I N + ; + +RANDOM + : R A N D O M + ; + +WEIGHT + : W E I G H T + ; + +NOT + : N O T + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Literals.g4 b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Literals.g4 new file mode 100644 index 00000000..1d13bcc2 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Literals.g4 @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Literals; + +import Alphabet, Symbol; + +IDENTIFIER_ + : [A-Za-z_$0-9]*?[A-Za-z_$]+?[A-Za-z_$0-9]* + | BQ_ ~'`'+ BQ_ + ; + +STRING_ + : (DQ_ ('\\'. | '""' | ~('"' | '\\'))* DQ_) + | (SQ_ ('\\'. | '\'\'' | ~('\'' | '\\'))* SQ_) + ; + +INT_ + : [0-9]+ + ; + +HEX_ + : [0-9a-fA-F] + ; + +NUMBER_ + : INT_? DOT_? INT_ (E (PLUS_ | MINUS_)? INT_)? + ; + +HEXDIGIT_ + : '0x' HEX_+ | 'X' SQ_ HEX_+ SQ_ + ; + +BITNUM_ + : '0b' ('0' | '1')+ | B SQ_ ('0' | '1')+ SQ_ + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/RALStatement.g4 b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/RALStatement.g4 new file mode 100644 index 00000000..d94b56d3 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/RALStatement.g4 @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar RALStatement; + +import BaseRule; + +alterReadwriteSplittingStorageUnitStatus + : ALTER READWRITE_SPLITTING RULE (groupName)? (ENABLE | DISABLE) storageUnitName (FROM databaseName)? + ; + +showStatusFromReadwriteSplittingRules + : SHOW STATUS FROM READWRITE_SPLITTING (RULES | RULE groupName) (FROM databaseName)? + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/RDLStatement.g4 b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/RDLStatement.g4 new file mode 100644 index 00000000..0b49507f --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/RDLStatement.g4 @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar RDLStatement; + +import BaseRule; + +createReadwriteSplittingRule + : CREATE READWRITE_SPLITTING RULE ifNotExists? readwriteSplittingRuleDefinition (COMMA_ readwriteSplittingRuleDefinition)* + ; + +alterReadwriteSplittingRule + : ALTER READWRITE_SPLITTING RULE readwriteSplittingRuleDefinition (COMMA_ readwriteSplittingRuleDefinition)* + ; + +dropReadwriteSplittingRule + : DROP READWRITE_SPLITTING RULE ifExists? ruleName (COMMA_ ruleName)* + ; + +readwriteSplittingRuleDefinition + : ruleName LP_ dataSourceDefinition (COMMA_ transactionalReadQueryStrategy)? (COMMA_ algorithmDefinition)? RP_ + ; + +dataSourceDefinition + : writeStorageUnit COMMA_ readStorageUnits + ; + +ruleName + : IDENTIFIER_ + ; + +writeStorageUnit + : WRITE_STORAGE_UNIT EQ_ writeStorageUnitName + ; + +readStorageUnits + : READ_STORAGE_UNITS LP_ readStorageUnitsNames RP_ + ; + +transactionalReadQueryStrategy + : TRANSACTIONAL_READ_QUERY_STRATEGY EQ_ transactionalReadQueryStrategyName + ; + +writeStorageUnitName + : storageUnitName + ; + +readStorageUnitsNames + : storageUnitName (COMMA_ storageUnitName)* + ; + +transactionalReadQueryStrategyName + : STRING_ + ; + +ifExists + : IF EXISTS + ; + +ifNotExists + : IF NOT EXISTS + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/RQLStatement.g4 b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/RQLStatement.g4 new file mode 100644 index 00000000..c2862919 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/RQLStatement.g4 @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar RQLStatement; + +import BaseRule; + +showReadwriteSplittingRules + : SHOW READWRITE_SPLITTING (RULE ruleName | RULES) (FROM databaseName)? + ; + +countReadwriteSplittingRule + : COUNT READWRITE_SPLITTING RULE (FROM databaseName)? + ; + +ruleName + : IDENTIFIER_ + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Symbol.g4 b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Symbol.g4 new file mode 100644 index 00000000..90dba68c --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/read_write_splitting/Symbol.g4 @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Symbol; + +AND_: '&&'; +OR_: '||'; +NOT_: '!'; +TILDE_: '~'; +VERTICALBAR_: '|'; +AMPERSAND_: '&'; +SIGNEDLEFTSHIFT_: '<<'; +SIGNEDRIGHTSHIFT_: '>>'; +CARET_: '^'; +MOD_: '%'; +COLON_: ':'; +PLUS_: '+'; +MINUS_: '-'; +ASTERISK_: '*'; +SLASH_: '/'; +BACKSLASH_: '\\'; +DOT_: '.'; +DOTASTERISK_: '.*'; +SAFEEQ_: '<=>'; +DEQ_: '=='; +EQ_: '='; +NEQ_: '<>' | '!='; +GT_: '>'; +GTE_: '>='; +LT_: '<'; +LTE_: '<='; +POUND_: '#'; +LP_: '('; +RP_: ')'; +LBE_: '{'; +RBE_: '}'; +LBT_: '['; +RBT_: ']'; +COMMA_: ','; +DQ_: '"'; +SQ_: '\''; +BQ_: '`'; +QUESTION_: '?'; +AT_: '@'; +SEMI_: ';'; +JSONSEPARATOR_: '->>'; +UL_: '_'; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/shadow/Alphabet.g4 b/shardingsphere-operator/pkg/distsql/antlr4/shadow/Alphabet.g4 new file mode 100644 index 00000000..f7603cc7 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/shadow/Alphabet.g4 @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Alphabet; + +FOR_GENERATOR: 'DO NOT MATCH ANY THING, JUST FOR GENERATOR'; + +fragment A: [Aa]; +fragment B: [Bb]; +fragment C: [Cc]; +fragment D: [Dd]; +fragment E: [Ee]; +fragment F: [Ff]; +fragment G: [Gg]; +fragment H: [Hh]; +fragment I: [Ii]; +fragment J: [Jj]; +fragment K: [Kk]; +fragment L: [Ll]; +fragment M: [Mm]; +fragment N: [Nn]; +fragment O: [Oo]; +fragment P: [Pp]; +fragment Q: [Qq]; +fragment R: [Rr]; +fragment S: [Ss]; +fragment T: [Tt]; +fragment U: [Uu]; +fragment V: [Vv]; +fragment W: [Ww]; +fragment X: [Xx]; +fragment Y: [Yy]; +fragment Z: [Zz]; +fragment UL_: '_'; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/shadow/BaseRule.g4 b/shardingsphere-operator/pkg/distsql/antlr4/shadow/BaseRule.g4 new file mode 100644 index 00000000..1c310335 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/shadow/BaseRule.g4 @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar BaseRule; + +import Symbol, Keyword, Literals; + +literal + : STRING_ | (MINUS_)? INT_ | TRUE | FALSE + ; + +algorithmDefinition + : TYPE LP_ NAME EQ_ algorithmTypeName (COMMA_ propertiesDefinition)? RP_ + ; + +algorithmTypeName + : STRING_ | buildInShadowAlgorithmType + ; + +buildInShadowAlgorithmType + : VALUE_MATCH + | REGEX_MATCH + | SQL_HINT + ; + +propertiesDefinition + : PROPERTIES LP_ properties? RP_ + ; + +properties + : property (COMMA_ property)* + ; + +property + : key=STRING_ EQ_ value=literal + ; + +ruleName + : IDENTIFIER_ + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/shadow/Keyword.g4 b/shardingsphere-operator/pkg/distsql/antlr4/shadow/Keyword.g4 new file mode 100644 index 00000000..f82b1856 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/shadow/Keyword.g4 @@ -0,0 +1,152 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Keyword; + +import Alphabet; + +WS + : [ \t\r\n] + ->skip + ; + +TRUE + : T R U E + ; + +FALSE + : F A L S E + ; + +CREATE + : C R E A T E + ; + +ALTER + : A L T E R + ; + +DROP + : D R O P + ; + +SHOW + : S H O W + ; + +SHADOW + : S H A D O W + ; + +SOURCE + : S O U R C E + ; + +RULE + : R U L E + ; + +FROM + : F R O M + ; + +RESOURCES + : R E S O U R C E S + ; + +TABLE + : T A B L E + ; + +TYPE + : T Y P E + ; + +NAME + : N A M E + ; + +PROPERTIES + : P R O P E R T I E S + ; + +RULES + : R U L E S + ; + +ALGORITHM + : A L G O R I T H M + ; + +ALGORITHMS + : A L G O R I T H M S + ; + +SET + : S E T + ; + +ADD + : A D D + ; + +DATABASE_VALUE + : D A T A B A S E UL_ V A L U E + ; + +TABLE_VALUE + : T A B L E UL_ V A L U E + ; + +STATUS + : S T A T U S + ; + +CLEAR + : C L E A R + ; + +DEFAULT + : D E F A U L T + ; + +IF + : I F + ; + +EXISTS + : E X I S T S + ; + +COUNT + : C O U N T + ; + +VALUE_MATCH + : V A L U E UL_ M A T C H + ; + +REGEX_MATCH + : R E G E X UL_ M A T C H + ; + +SQL_HINT + : S I M P L E UL_ H I N T + ; + +NOT + : N O T + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/shadow/Literals.g4 b/shardingsphere-operator/pkg/distsql/antlr4/shadow/Literals.g4 new file mode 100644 index 00000000..3634476f --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/shadow/Literals.g4 @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Literals; + +import Alphabet, Symbol; + +IDENTIFIER_ + : [A-Za-z_$0-9]*?[A-Za-z_$]+?[A-Za-z_$0-9]* + | BQ_ ~'`'+ BQ_ + ; + +STRING_ + : (DQ_ ('\\'. | '""' | ~('"' | '\\'))* DQ_) + | (SQ_ ('\\'. | '\'\'' | ~('\'' | '\\'))* SQ_) + ; + +INT_ + : [0-9]+ + ; + +HEX_ + : [0-9a-fA-F] + ; + +NUMBER_ + : INT_? DOT_? INT_ (E (PLUS_ | MINUS_)? INT_)? + ; + +HEXDIGIT_ + : '0x' HEX_+ | 'X' SQ_ HEX_+ SQ_ + ; + +BITNUM_ + : '0b' ('0' | '1')+ | B SQ_ ('0' | '1')+ SQ_ + ; + +BOOL_ + : T R U E | F A L S E + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/shadow/RDLStatement.g4 b/shardingsphere-operator/pkg/distsql/antlr4/shadow/RDLStatement.g4 new file mode 100644 index 00000000..c5070ec6 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/shadow/RDLStatement.g4 @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar RDLStatement; + +import BaseRule; + +createShadowRule + : CREATE SHADOW RULE ifNotExists? shadowRuleDefinition (COMMA_ shadowRuleDefinition)* + ; + +alterShadowRule + : ALTER SHADOW RULE shadowRuleDefinition (COMMA_ shadowRuleDefinition)* + ; + +dropShadowRule + : DROP SHADOW RULE ifExists? ruleName (COMMA_ ruleName)* + ; + +dropShadowAlgorithm + : DROP SHADOW ALGORITHM ifExists? algorithmName (COMMA_ algorithmName)* + ; + +createDefaultShadowAlgorithm + : CREATE DEFAULT SHADOW ALGORITHM ifNotExists? algorithmDefinition + ; + +dropDefaultShadowAlgorithm + : DROP DEFAULT SHADOW ALGORITHM ifExists? + ; + +alterDefaultShadowAlgorithm + : ALTER DEFAULT SHADOW ALGORITHM algorithmDefinition + ; + +shadowRuleDefinition + : ruleName LP_ SOURCE EQ_ source COMMA_ SHADOW EQ_ shadow COMMA_ shadowTableRule (COMMA_ shadowTableRule)* RP_ + ; + +shadowTableRule + : tableName LP_ algorithmDefinition (COMMA_ algorithmDefinition)* RP_ + ; + +source + : IDENTIFIER_ + ; + +shadow + : IDENTIFIER_ + ; + +tableName + : IDENTIFIER_ + ; + +algorithmName + : IDENTIFIER_ + ; + +ifExists + : IF EXISTS + ; + +ifNotExists + : IF NOT EXISTS + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/shadow/RQLStatement.g4 b/shardingsphere-operator/pkg/distsql/antlr4/shadow/RQLStatement.g4 new file mode 100644 index 00000000..0c20410e --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/shadow/RQLStatement.g4 @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar RQLStatement; + +import BaseRule; + +showShadowRules + : SHOW SHADOW (shadowRule | RULES) (FROM databaseName)? + ; + +showShadowTableRules + : SHOW SHADOW TABLE RULES (FROM databaseName)? + ; + +showShadowAlgorithms + : SHOW SHADOW ALGORITHMS (FROM databaseName)? + ; + +showDefaultShadowAlgorithm + : SHOW DEFAULT SHADOW ALGORITHM (FROM databaseName)? + ; + +shadowRule + : RULE ruleName + ; + +countShadowRule + : COUNT SHADOW RULE (FROM databaseName)? + ; + +databaseName + : IDENTIFIER_ + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/shadow/Symbol.g4 b/shardingsphere-operator/pkg/distsql/antlr4/shadow/Symbol.g4 new file mode 100644 index 00000000..90dba68c --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/shadow/Symbol.g4 @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Symbol; + +AND_: '&&'; +OR_: '||'; +NOT_: '!'; +TILDE_: '~'; +VERTICALBAR_: '|'; +AMPERSAND_: '&'; +SIGNEDLEFTSHIFT_: '<<'; +SIGNEDRIGHTSHIFT_: '>>'; +CARET_: '^'; +MOD_: '%'; +COLON_: ':'; +PLUS_: '+'; +MINUS_: '-'; +ASTERISK_: '*'; +SLASH_: '/'; +BACKSLASH_: '\\'; +DOT_: '.'; +DOTASTERISK_: '.*'; +SAFEEQ_: '<=>'; +DEQ_: '=='; +EQ_: '='; +NEQ_: '<>' | '!='; +GT_: '>'; +GTE_: '>='; +LT_: '<'; +LTE_: '<='; +POUND_: '#'; +LP_: '('; +RP_: ')'; +LBE_: '{'; +RBE_: '}'; +LBT_: '['; +RBT_: ']'; +COMMA_: ','; +DQ_: '"'; +SQ_: '\''; +BQ_: '`'; +QUESTION_: '?'; +AT_: '@'; +SEMI_: ';'; +JSONSEPARATOR_: '->>'; +UL_: '_'; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/sharding/Alphabet.g4 b/shardingsphere-operator/pkg/distsql/antlr4/sharding/Alphabet.g4 new file mode 100644 index 00000000..f7603cc7 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/sharding/Alphabet.g4 @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Alphabet; + +FOR_GENERATOR: 'DO NOT MATCH ANY THING, JUST FOR GENERATOR'; + +fragment A: [Aa]; +fragment B: [Bb]; +fragment C: [Cc]; +fragment D: [Dd]; +fragment E: [Ee]; +fragment F: [Ff]; +fragment G: [Gg]; +fragment H: [Hh]; +fragment I: [Ii]; +fragment J: [Jj]; +fragment K: [Kk]; +fragment L: [Ll]; +fragment M: [Mm]; +fragment N: [Nn]; +fragment O: [Oo]; +fragment P: [Pp]; +fragment Q: [Qq]; +fragment R: [Rr]; +fragment S: [Ss]; +fragment T: [Tt]; +fragment U: [Uu]; +fragment V: [Vv]; +fragment W: [Ww]; +fragment X: [Xx]; +fragment Y: [Yy]; +fragment Z: [Zz]; +fragment UL_: '_'; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/sharding/BaseRule.g4 b/shardingsphere-operator/pkg/distsql/antlr4/sharding/BaseRule.g4 new file mode 100644 index 00000000..f1587ee5 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/sharding/BaseRule.g4 @@ -0,0 +1,92 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar BaseRule; + +import Symbol, Keyword, Literals; + +literal + : STRING_ | (MINUS_)? INT_ | TRUE | FALSE + ; + +algorithmDefinition + : TYPE LP_ NAME EQ_ algorithmTypeName (COMMA_ propertiesDefinition)? RP_ + ; + +algorithmTypeName + : STRING_ | buildInShardingAlgorithmType | buildInKeyGenerateAlgorithmType | buildInShardingAuditAlgorithmType + ; + +buildInShardingAlgorithmType + : MOD + | HASH_MOD + | VOLUME_RANGE + | BOUNDARY_RANGE + | AUTO_INTERVAL + | INLINE + | INTERVAL + | COSID_MOD + | COSID_INTERVAL + | COSID_INTERVAL_SNOWFLAKE + | COMPLEX_INLINE + | HINT_INLINE + | CLASS_BASED + ; + +buildInKeyGenerateAlgorithmType + : SNOWFLAKE + | NANOID + | UUID + | COSID + | COSID_SNOWFLAKE + ; + +buildInShardingAuditAlgorithmType + : DML_SHARDING_CONDITIONS + ; + +propertiesDefinition + : PROPERTIES LP_ properties? RP_ + ; + +properties + : property (COMMA_ property)* + ; + +property + : key=STRING_ EQ_ value=literal + ; + +tableName + : IDENTIFIER_ + ; + +shardingAlgorithmName + : IDENTIFIER_ + ; + +keyGeneratorName + : IDENTIFIER_ + ; + +auditorName + : IDENTIFIER_ + ; + +ruleName + : IDENTIFIER_ + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/sharding/Keyword.g4 b/shardingsphere-operator/pkg/distsql/antlr4/sharding/Keyword.g4 new file mode 100644 index 00000000..b92d9648 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/sharding/Keyword.g4 @@ -0,0 +1,308 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Keyword; + +import Alphabet; + +WS + : [ \t\r\n] + ->skip + ; + +CREATE + : C R E A T E + ; + +ALTER + : A L T E R + ; + +DROP + : D R O P + ; + +SHOW + : S H O W + ; + +SHARDING + : S H A R D I N G + ; + +RULE + : R U L E + ; + +FROM + : F R O M + ; + +STORAGE_UNITS + : S T O R A G E UL_ U N I T S + ; + +KEY_GENERATE_STRATEGY + : K E Y UL_ G E N E R A T E UL_ S T R A T E G Y + ; + +DEFAULT_TABLE_STRATEGY + : D E F A U L T UL_ T A B L E UL_ S T R A T E G Y + ; + +TABLE + : T A B L E + ; + +SHARDING_COLUMN + : S H A R D I N G UL_ C O L U M N + ; + +SHARDING_COLUMNS + : S H A R D I N G UL_ C O L U M N S + ; + +TYPE + : T Y P E + ; + +NAME + : N A M E + ; + +PROPERTIES + : P R O P E R T I E S + ; + +COLUMN + : C O L U M N + ; + +REFERENCE + : R E F E R E N C E + ; + +BROADCAST + : B R O A D C A S T + ; + +RULES + : R U L E S + ; + +COLUMNS + : C O L U M N S + ; + +ALGORITHM + : A L G O R I T H M + ; + +ALGORITHMS + : A L G O R I T H M S + ; + +HINT + : H I N T + ; + +DEFAULT + : D E F A U L T + ; + +DATABASE + : D A T A B A S E + ; + +SHARDING_ALGORITHM + : S H A R D I N G UL_ A L G O R I T H M + ; + +STRATEGY + : S T R A T E G Y + ; + +DATANODES + : D A T A N O D E S + ; + +DATABASE_STRATEGY + : D A T A B A S E UL_ S T R A T E G Y + ; + +TABLE_STRATEGY + : T A B L E UL_ S T R A T E G Y + ; + +NODES + : N O D E S + ; + +KEY + : K E Y + ; + +GENERATOR + : G E N E R A T O R + ; + +GENERATORS + : G E N E R A T O R S + ; + +KEY_GENERATOR + : K E Y UL_ G E N E R A T O R + ; + +UNUSED + : U N U S E D + ; + +USED + : U S E D + ; + +IF + : I F + ; + +EXISTS + : E X I S T S + ; + +WITH + : W I T H + ; + +COUNT + : C O U N T + ; + +AUDITOR + : A U D I T O R + ; + +AUDITORS + : A U D I T O R S + ; + +AUDIT_STRATEGY + : A U D I T UL_ S T R A T E G Y + ; + +ALLOW_HINT_DISABLE + : A L L O W UL_ H I N T UL_ D I S A B L E + ; + +TRUE + : T R U E + ; + +FALSE + : F A L S E + ; + +MOD + : M O D + ; + +COSID_MOD + : C O S I D UL_ M O D + ; + +HASH_MOD + : H A S H UL_ M O D + ; + +VOLUME_RANGE + : V O L U M E UL_ R A N G E + ; + +BOUNDARY_RANGE + : B O U N D A R Y UL_ R A N G E + ; + +AUTO_INTERVAL + : A U T O UL_ I N T E R V A L + ; + +INLINE + : I N L I N E + ; + +INTERVAL + : I N T E R V A L + ; + +COSID_INTERVAL + : C O S I D UL_ I N T E R V A L + ; + +COSID_INTERVAL_SNOWFLAKE + : C O S I D UL_ I N T E R V A L UL_ S N O W F L A K E + ; + +COMPLEX_INLINE + : C O M P L E X UL_ I N L I N E + ; + +HINT_INLINE + : H I N T UL_ I N L I N E + ; + +CLASS_BASED + : C L A S S UL_ B A S E D + ; + +SNOWFLAKE + : S N O W F L A K E + ; + +NANOID + : N A N O I D + ; + +UUID + : U U I D + ; + +COSID + : C O S I D + ; + +COSID_SNOWFLAKE + : C O S I D UL_ S N O W F L A K E + ; + +STANDARD + : S T A N D A R D + ; + +COMPLEX + : C O M P L E X + ; + +DML_SHARDING_CONDITIONS + : D M L UL_ S H A R D I N G UL_ C O N D I T I O N S + ; + +NOT + : N O T + ; + +NONE + : N O N E + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/sharding/Literals.g4 b/shardingsphere-operator/pkg/distsql/antlr4/sharding/Literals.g4 new file mode 100644 index 00000000..68f6a1b0 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/sharding/Literals.g4 @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Literals; + +import Alphabet, Symbol; + +IDENTIFIER_ + : [A-Za-z_$0-9]*?[A-Za-z_$]+?[A-Za-z_$0-9]* + | BQ_ ~'`'+ BQ_ + ; + +STRING_ + : (DQ_ ('\\'. | '""' | ~('"' | '\\'))* DQ_) + | (SQ_ ('\\'. | '\'\'' | ~('\'' | '\\'))* SQ_) + ; + +INT_ + : [0-9]+ + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/sharding/RDLStatement.g4 b/shardingsphere-operator/pkg/distsql/antlr4/sharding/RDLStatement.g4 new file mode 100644 index 00000000..cd7bc8c2 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/sharding/RDLStatement.g4 @@ -0,0 +1,195 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar RDLStatement; + +import BaseRule; + +createShardingTableRule + : CREATE SHARDING TABLE RULE ifNotExists? shardingTableRuleDefinition (COMMA_ shardingTableRuleDefinition)* + ; + +alterShardingTableRule + : ALTER SHARDING TABLE RULE shardingTableRuleDefinition (COMMA_ shardingTableRuleDefinition)* + ; + +dropShardingTableRule + : DROP SHARDING TABLE RULE ifExists? tableName (COMMA_ tableName)* + ; + +createShardingTableReferenceRule + : CREATE SHARDING TABLE REFERENCE RULE ifNotExists? tableReferenceRuleDefinition (COMMA_ tableReferenceRuleDefinition)* + ; + +alterShardingTableReferenceRule + : ALTER SHARDING TABLE REFERENCE RULE tableReferenceRuleDefinition (COMMA_ tableReferenceRuleDefinition)* + ; + +dropShardingTableReferenceRule + : DROP SHARDING TABLE REFERENCE RULE ifExists? ruleName (COMMA_ ruleName)* + ; + +createBroadcastTableRule + : CREATE BROADCAST TABLE RULE ifNotExists? tableName (COMMA_ tableName)* + ; + +dropBroadcastTableRule + : DROP BROADCAST TABLE RULE ifExists? tableName (COMMA_ tableName)* + ; + +dropShardingAlgorithm + : DROP SHARDING ALGORITHM ifExists? shardingAlgorithmName (COMMA_ shardingAlgorithmName)* + ; + +createDefaultShardingStrategy + : CREATE DEFAULT SHARDING type=(DATABASE | TABLE) STRATEGY ifNotExists? LP_ shardingStrategy RP_ + ; + +alterDefaultShardingStrategy + : ALTER DEFAULT SHARDING type=(DATABASE | TABLE) STRATEGY LP_ shardingStrategy RP_ + ; + +dropDefaultShardingStrategy + : DROP DEFAULT SHARDING type=(DATABASE | TABLE) STRATEGY ifExists? + ; + +dropShardingKeyGenerator + : DROP SHARDING KEY GENERATOR ifExists? keyGeneratorName (COMMA_ keyGeneratorName)* + ; + +dropShardingAuditor + : DROP SHARDING AUDITOR ifExists? auditorName (COMMA_ auditorName)* + ; + +shardingTableRuleDefinition + : (shardingAutoTableRule | shardingTableRule) + ; + +shardingAutoTableRule + : tableName LP_ storageUnits COMMA_ autoShardingColumnDefinition COMMA_ algorithmDefinition (COMMA_ keyGenerateDefinition)? (COMMA_ auditDefinition)? RP_ + ; + +shardingTableRule + : tableName LP_ dataNodes (COMMA_ databaseStrategy)? (COMMA_ tableStrategy)? (COMMA_ keyGenerateDefinition)? (COMMA_ auditDefinition)? RP_ + ; + +keyGeneratorName + : IDENTIFIER_ + ; + +auditorDefinition + : auditorName LP_ algorithmDefinition RP_ + ; + +auditorName + : IDENTIFIER_ + ; + +storageUnits + : STORAGE_UNITS LP_ storageUnit (COMMA_ storageUnit)* RP_ + ; + +storageUnit + : IDENTIFIER_ | STRING_ + ; + +dataNodes + : DATANODES LP_ dataNode (COMMA_ dataNode)* RP_ + ; + +dataNode + : STRING_ + ; + +autoShardingColumnDefinition + : shardingColumn + ; + +shardingColumnDefinition + : shardingColumn | shardingColumns + ; + +shardingColumn + : SHARDING_COLUMN EQ_ columnName + ; + +shardingColumns + : SHARDING_COLUMNS EQ_ columnName COMMA_ columnName (COMMA_ columnName)* + ; + +shardingAlgorithm + : SHARDING_ALGORITHM LP_ algorithmDefinition RP_ + ; + +shardingStrategy + : TYPE EQ_ strategyType ((COMMA_ shardingColumnDefinition)? COMMA_ shardingAlgorithm)? + ; + +databaseStrategy + : DATABASE_STRATEGY LP_ shardingStrategy RP_ + ; + +tableStrategy + : TABLE_STRATEGY LP_ shardingStrategy RP_ + ; + +keyGenerateDefinition + : KEY_GENERATE_STRATEGY LP_ COLUMN EQ_ columnName COMMA_ algorithmDefinition RP_ + ; + +auditDefinition + : AUDIT_STRATEGY LP_ multiAuditDefinition COMMA_ ALLOW_HINT_DISABLE EQ_ auditAllowHintDisable RP_ + ; + +multiAuditDefinition + : singleAuditDefinition (COMMA_ singleAuditDefinition)* + ; + +singleAuditDefinition + : algorithmDefinition + ; + +auditAllowHintDisable + : TRUE | FALSE + ; + +columnName + : IDENTIFIER_ + ; + +tableReferenceRuleDefinition + : ruleName LP_ tableName (COMMA_ tableName)* RP_ + ; + +strategyType + : STRING_ | buildInStrategyType + ; + +buildInStrategyType + : STANDARD + | COMPLEX + | HINT + | NONE + ; + +ifExists + : IF EXISTS + ; + +ifNotExists + : IF NOT EXISTS + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/sharding/RQLStatement.g4 b/shardingsphere-operator/pkg/distsql/antlr4/sharding/RQLStatement.g4 new file mode 100644 index 00000000..cc021eb5 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/sharding/RQLStatement.g4 @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +grammar RQLStatement; + +import BaseRule; + +showShardingTableRules + : SHOW SHARDING TABLE (tableRule | RULES) (FROM databaseName)? + ; + +showShardingTableReferenceRules + : SHOW SHARDING TABLE REFERENCE (RULE ruleName | RULES) (FROM databaseName)? + ; + +showBroadcastTableRules + : SHOW BROADCAST TABLE RULES (FROM databaseName)? + ; + +showShardingAlgorithms + : SHOW SHARDING ALGORITHMS (FROM databaseName)? + ; + +showShardingAuditors + : SHOW SHARDING AUDITORS (FROM databaseName)? + ; + +showShardingTableNodes + : SHOW SHARDING TABLE NODES tableName? (FROM databaseName)? + ; + +showShardingKeyGenerators + : SHOW SHARDING KEY GENERATORS (FROM databaseName)? + ; + +showDefaultShardingStrategy + : SHOW DEFAULT SHARDING STRATEGY (FROM databaseName)? + ; + +showUnusedShardingAlgorithms + : SHOW UNUSED SHARDING ALGORITHMS (FROM databaseName)? + ; + +showUnusedShardingKeyGenerators + : SHOW UNUSED SHARDING KEY GENERATORS (FROM databaseName)? + ; + +showUnusedShardingAuditors + : SHOW UNUSED SHARDING AUDITORS (FROM databaseName)? + ; + +showShardingTableRulesUsedAlgorithm + : SHOW SHARDING TABLE RULES USED ALGORITHM shardingAlgorithmName (FROM databaseName)? + ; + +showShardingTableRulesUsedKeyGenerator + : SHOW SHARDING TABLE RULES USED KEY GENERATOR keyGeneratorName (FROM databaseName)? + ; + +showShardingTableRulesUsedAuditor + : SHOW SHARDING TABLE RULES USED AUDITOR auditorName (FROM databaseName)? + ; + +countShardingRule + : COUNT SHARDING RULE (FROM databaseName)? + ; + +tableRule + : RULE tableName + ; + +databaseName + : IDENTIFIER_ + ; diff --git a/shardingsphere-operator/pkg/distsql/antlr4/sharding/Symbol.g4 b/shardingsphere-operator/pkg/distsql/antlr4/sharding/Symbol.g4 new file mode 100644 index 00000000..90dba68c --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/antlr4/sharding/Symbol.g4 @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +lexer grammar Symbol; + +AND_: '&&'; +OR_: '||'; +NOT_: '!'; +TILDE_: '~'; +VERTICALBAR_: '|'; +AMPERSAND_: '&'; +SIGNEDLEFTSHIFT_: '<<'; +SIGNEDRIGHTSHIFT_: '>>'; +CARET_: '^'; +MOD_: '%'; +COLON_: ':'; +PLUS_: '+'; +MINUS_: '-'; +ASTERISK_: '*'; +SLASH_: '/'; +BACKSLASH_: '\\'; +DOT_: '.'; +DOTASTERISK_: '.*'; +SAFEEQ_: '<=>'; +DEQ_: '=='; +EQ_: '='; +NEQ_: '<>' | '!='; +GT_: '>'; +GTE_: '>='; +LT_: '<'; +LTE_: '<='; +POUND_: '#'; +LP_: '('; +RP_: ')'; +LBE_: '{'; +RBE_: '}'; +LBT_: '['; +RBT_: ']'; +COMMA_: ','; +DQ_: '"'; +SQ_: '\''; +BQ_: '`'; +QUESTION_: '?'; +AT_: '@'; +SEMI_: ';'; +JSONSEPARATOR_: '->>'; +UL_: '_'; diff --git a/shardingsphere-operator/pkg/distsql/ast/rdl_ast.go b/shardingsphere-operator/pkg/distsql/ast/encrypt_rdl_ast.go similarity index 99% rename from shardingsphere-operator/pkg/distsql/ast/rdl_ast.go rename to shardingsphere-operator/pkg/distsql/ast/encrypt_rdl_ast.go index 8e6adca7..e1c2a4b6 100644 --- a/shardingsphere-operator/pkg/distsql/ast/rdl_ast.go +++ b/shardingsphere-operator/pkg/distsql/ast/encrypt_rdl_ast.go @@ -22,7 +22,7 @@ import ( "strings" ) -// Define RDL AST +// Define Create Encrypt Rule AST type CreateEncryptRule struct { IfNotExists *IfNotExists EncryptRuleDefinition *EncryptRuleDefinition diff --git a/shardingsphere-operator/pkg/distsql/ast/mask_rdl_ast.go b/shardingsphere-operator/pkg/distsql/ast/mask_rdl_ast.go new file mode 100644 index 00000000..6ac0c57f --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/ast/mask_rdl_ast.go @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ast + +import ( + "fmt" + "strings" +) + +type CreateMaskRule struct { + AllMaskRuleDefinition []*MaskRuleDefinition + Table string + IfNotExists *IfNotExists +} + +func (createMaskRule *CreateMaskRule) ToString() string { + var ( + distSQL = "CREATE MASK" + maskRuleDefinition = []string{} + ) + + if createMaskRule.Table != "" { + distSQL = fmt.Sprintf("%s %s", distSQL, createMaskRule.Table) + } + + if createMaskRule.IfNotExists != nil { + distSQL = fmt.Sprintf("%s %s", distSQL, createMaskRule.IfNotExists.ToString()) + } + + if createMaskRule.AllMaskRuleDefinition != nil { + for _, mr := range createMaskRule.AllMaskRuleDefinition { + maskRuleDefinition = append(maskRuleDefinition, mr.ToString()) + } + } + return fmt.Sprintf("%s %s", distSQL, strings.Join(maskRuleDefinition, ",")) +} + +type MaskRuleDefinition struct { + RuleName *CommonIdentifier + ColumnDefinition []*ColumnDefinition +} + +func (maskRuleDefinition *MaskRuleDefinition) ToString() string { + var ( + columnDefinition []string + ) + + if maskRuleDefinition.ColumnDefinition != nil { + for _, cd := range maskRuleDefinition.ColumnDefinition { + columnDefinition = append(columnDefinition, cd.ToString()) + } + } + + return fmt.Sprintf("%s (( %s ))", maskRuleDefinition.RuleName.ToString(), strings.Join(columnDefinition, ",")) +} + +type AlterMaskRule struct { + Table string + AllMaskRuleDefinition []*MaskRuleDefinition +} + +func (alterMaskRule *AlterMaskRule) ToString() string { + var ( + distSQL = fmt.Sprintf("ALTER MASK %s RULE", alterMaskRule.Table) + ruleDefinitions []string + ) + if alterMaskRule.AllMaskRuleDefinition != nil { + for _, rule := range alterMaskRule.AllMaskRuleDefinition { + ruleDefinitions = append(ruleDefinitions, rule.ToString()) + } + } + return fmt.Sprintf("%s %s", distSQL, strings.Join(ruleDefinitions, ",")) +} + +type DropMaskRule struct { + IfExists *IfExists + Table string + AllRuleName []*CommonIdentifier +} + +func (dropMaskRule *DropMaskRule) ToString() string { + var ( + distSQL = "DROP MASK" + ruleNames []string + ) + if dropMaskRule.Table != "" { + distSQL = fmt.Sprintf("%s %s", distSQL, dropMaskRule.Table) + } + if dropMaskRule.IfExists != nil { + distSQL = fmt.Sprintf("%s %s", distSQL, dropMaskRule.IfExists.ToString()) + } + if dropMaskRule.AllRuleName != nil { + for _, ruleName := range dropMaskRule.AllRuleName { + ruleNames = append(ruleNames, ruleName.ToString()) + } + } + return fmt.Sprintf("%s %s", distSQL, strings.Join(ruleNames, ",")) +} diff --git a/shardingsphere-operator/pkg/distsql/visitor/distsql_test.go b/shardingsphere-operator/pkg/distsql/visitor/distsql_test.go index 0f5d683f..ebe23cfb 100644 --- a/shardingsphere-operator/pkg/distsql/visitor/distsql_test.go +++ b/shardingsphere-operator/pkg/distsql/visitor/distsql_test.go @@ -28,7 +28,7 @@ import ( var _ = Describe("Distsql", func() { var ( encryptDistSQL = "CREATE ENCRYPT RULE t_encrypt (COLUMNS((NAME=user_id,PLAIN=user_plain,CIPHER=user_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc')))),(NAME=order_id,CIPHER=order_cipher,ENCRYPT_ALGORITHM(TYPE(NAME='MD5')))),QUERY_WITH_CIPHER_COLUMN=true);" - visitor = Visitor{} + visitor = EncryptVisitor{} ast = &ast.CreateEncryptRule{} ) diff --git a/shardingsphere-operator/pkg/distsql/visitor/rdl_visitor.go b/shardingsphere-operator/pkg/distsql/visitor/encrypt_rdl_visitor.go similarity index 75% rename from shardingsphere-operator/pkg/distsql/visitor/rdl_visitor.go rename to shardingsphere-operator/pkg/distsql/visitor/encrypt_rdl_visitor.go index e6e65138..ab999289 100644 --- a/shardingsphere-operator/pkg/distsql/visitor/rdl_visitor.go +++ b/shardingsphere-operator/pkg/distsql/visitor/encrypt_rdl_visitor.go @@ -24,11 +24,11 @@ import ( parser "github.com/apache/shardingsphere-on-cloud/shardingsphere-operator/pkg/distsql/visitor_parser/encrypt" ) -type Visitor struct { +type EncryptVisitor struct { parser.BaseRDLStatementVisitor } -func (v *Visitor) VisitCreateEncryptRule(ctx *parser.CreateEncryptRuleContext) *ast.CreateEncryptRule { +func (v *EncryptVisitor) VisitCreateEncryptRule(ctx *parser.CreateEncryptRuleContext) *ast.CreateEncryptRule { stmt := &ast.CreateEncryptRule{} if ctx.IfNotExists() != nil { @@ -50,19 +50,19 @@ func (v *Visitor) VisitCreateEncryptRule(ctx *parser.CreateEncryptRuleContext) * return stmt } -func (v *Visitor) VisitIfNotExists(ctx *parser.IfNotExistsContext) *ast.IfNotExists { +func (v *EncryptVisitor) VisitIfNotExists(ctx *parser.IfNotExistsContext) *ast.IfNotExists { return &ast.IfNotExists{ IfNotExists: fmt.Sprintf("%s %s %s", ctx.IF().GetText(), ctx.NOT().GetText(), ctx.EXISTS().GetText()), } } -func (v *Visitor) VisitIfExists(ctx *parser.IfExistsContext) *ast.IfExists { +func (v *EncryptVisitor) VisitIfExists(ctx *parser.IfExistsContext) *ast.IfExists { return &ast.IfExists{ IfExists: fmt.Sprintf("%s %s", ctx.IF().GetText(), ctx.EXISTS().GetText()), } } -func (v *Visitor) VisitAlterEncryptRule(ctx *parser.AlterEncryptRuleContext) *ast.AlterEncryptRule { +func (v *EncryptVisitor) VisitAlterEncryptRule(ctx *parser.AlterEncryptRuleContext) *ast.AlterEncryptRule { stmt := &ast.AlterEncryptRule{} if ctx.AllEncryptRuleDefinition() != nil { @@ -73,7 +73,7 @@ func (v *Visitor) VisitAlterEncryptRule(ctx *parser.AlterEncryptRuleContext) *as return stmt } -func (v *Visitor) VisitDropEncryptRule(ctx *parser.DropEncryptRuleContext) *ast.DropEncryptRule { +func (v *EncryptVisitor) VisitDropEncryptRule(ctx *parser.DropEncryptRuleContext) *ast.DropEncryptRule { stmt := &ast.DropEncryptRule{} if ctx.IfExists() != nil { @@ -88,7 +88,7 @@ func (v *Visitor) VisitDropEncryptRule(ctx *parser.DropEncryptRuleContext) *ast. return stmt } -func (v *Visitor) VisitEncryptRuleDefinition(ctx *parser.EncryptRuleDefinitionContext) *ast.EncryptRuleDefinition { +func (v *EncryptVisitor) VisitEncryptRuleDefinition(ctx *parser.EncryptRuleDefinitionContext) *ast.EncryptRuleDefinition { stmt := &ast.EncryptRuleDefinition{} if ctx.TableName() != nil { @@ -116,7 +116,7 @@ func (v *Visitor) VisitEncryptRuleDefinition(ctx *parser.EncryptRuleDefinitionCo return stmt } -func (v *Visitor) VisitQueryWithCipherColumn(ctx *parser.QueryWithCipherColumnContext) *ast.QueryWithCipherColumn { +func (v *EncryptVisitor) VisitQueryWithCipherColumn(ctx *parser.QueryWithCipherColumnContext) *ast.QueryWithCipherColumn { stmt := &ast.QueryWithCipherColumn{} switch { case ctx.TRUE() != nil: @@ -127,7 +127,7 @@ func (v *Visitor) VisitQueryWithCipherColumn(ctx *parser.QueryWithCipherColumnCo return stmt } -func (v *Visitor) VisitEncryptColumnDefinition(ctx *parser.EncryptColumnDefinitionContext) *ast.EncryptColumnDefinition { +func (v *EncryptVisitor) VisitEncryptColumnDefinition(ctx *parser.EncryptColumnDefinitionContext) *ast.EncryptColumnDefinition { stmt := &ast.EncryptColumnDefinition{} if ctx.ColumnDefinition() != nil { @@ -169,7 +169,7 @@ func (v *Visitor) VisitEncryptColumnDefinition(ctx *parser.EncryptColumnDefiniti return stmt } -func (v *Visitor) VisitPlainColumnDefinition(ctx *parser.PlainColumnDefinitionContext) *ast.PlainColumnDefinition { +func (v *EncryptVisitor) VisitPlainColumnDefinition(ctx *parser.PlainColumnDefinitionContext) *ast.PlainColumnDefinition { stmt := &ast.PlainColumnDefinition{} if ctx.PlainColumnName() != nil { stmt.PlainColumnName = v.VisitPlainColumnName(ctx.PlainColumnName().(*parser.PlainColumnNameContext)) @@ -181,7 +181,7 @@ func (v *Visitor) VisitPlainColumnDefinition(ctx *parser.PlainColumnDefinitionCo return stmt } -func (v *Visitor) VisitPlainColumnName(ctx *parser.PlainColumnNameContext) *ast.CommonIdentifier { +func (v *EncryptVisitor) VisitPlainColumnName(ctx *parser.PlainColumnNameContext) *ast.CommonIdentifier { stmt := &ast.CommonIdentifier{} if ctx.IDENTIFIER_() != nil { stmt.Identifier = ctx.IDENTIFIER_().GetText() @@ -189,7 +189,7 @@ func (v *Visitor) VisitPlainColumnName(ctx *parser.PlainColumnNameContext) *ast. return stmt } -func (v *Visitor) VisitCipherColumnDefinition(ctx *parser.CipherColumnDefinitionContext) *ast.CipherColumnDefinition { +func (v *EncryptVisitor) VisitCipherColumnDefinition(ctx *parser.CipherColumnDefinitionContext) *ast.CipherColumnDefinition { stmt := &ast.CipherColumnDefinition{} if ctx.CipherColumnName() != nil { stmt.CipherColumnName = v.VisitCipherColumnName(ctx.CipherColumnName().(*parser.CipherColumnNameContext)) @@ -202,7 +202,7 @@ func (v *Visitor) VisitCipherColumnDefinition(ctx *parser.CipherColumnDefinition return stmt } -func (v *Visitor) VisitCipherColumnName(ctx *parser.CipherColumnNameContext) *ast.CommonIdentifier { +func (v *EncryptVisitor) VisitCipherColumnName(ctx *parser.CipherColumnNameContext) *ast.CommonIdentifier { stmt := &ast.CommonIdentifier{} if ctx.IDENTIFIER_() != nil { stmt.Identifier = ctx.IDENTIFIER_().GetText() @@ -210,7 +210,7 @@ func (v *Visitor) VisitCipherColumnName(ctx *parser.CipherColumnNameContext) *as return stmt } -func (v *Visitor) VisitAssistedQueryColumnDefinition(ctx *parser.AssistedQueryColumnDefinitionContext) *ast.AssistedQueryColumnDefinition { +func (v *EncryptVisitor) VisitAssistedQueryColumnDefinition(ctx *parser.AssistedQueryColumnDefinitionContext) *ast.AssistedQueryColumnDefinition { stmt := &ast.AssistedQueryColumnDefinition{} if ctx.AssistedQueryColumnName() != nil { stmt.AssistedQueryColumnName = v.VisitAssistedQueryColumnName(ctx.AssistedQueryColumnName().(*parser.AssistedQueryColumnNameContext)) @@ -223,7 +223,7 @@ func (v *Visitor) VisitAssistedQueryColumnDefinition(ctx *parser.AssistedQueryCo return stmt } -func (v *Visitor) VisitAssistedQueryColumnName(ctx *parser.AssistedQueryColumnNameContext) *ast.CommonIdentifier { +func (v *EncryptVisitor) VisitAssistedQueryColumnName(ctx *parser.AssistedQueryColumnNameContext) *ast.CommonIdentifier { stmt := &ast.CommonIdentifier{} if ctx.IDENTIFIER_() != nil { stmt.Identifier = ctx.IDENTIFIER_().GetText() @@ -231,7 +231,7 @@ func (v *Visitor) VisitAssistedQueryColumnName(ctx *parser.AssistedQueryColumnNa return stmt } -func (v *Visitor) VisitLikeQueryColumnDefinition(ctx *parser.LikeQueryColumnDefinitionContext) *ast.LikeQueryColumnDefinition { +func (v *EncryptVisitor) VisitLikeQueryColumnDefinition(ctx *parser.LikeQueryColumnDefinitionContext) *ast.LikeQueryColumnDefinition { stmt := &ast.LikeQueryColumnDefinition{} if ctx.LikeQueryColumnName() != nil { stmt.LikeQueryColumnName = v.VisitLikeQueryColumnName(ctx.LikeQueryColumnName().(*parser.LikeQueryColumnNameContext)) @@ -243,7 +243,7 @@ func (v *Visitor) VisitLikeQueryColumnDefinition(ctx *parser.LikeQueryColumnDefi return stmt } -func (v *Visitor) VisitLikeQueryColumnName(ctx *parser.LikeQueryColumnNameContext) *ast.CommonIdentifier { +func (v *EncryptVisitor) VisitLikeQueryColumnName(ctx *parser.LikeQueryColumnNameContext) *ast.CommonIdentifier { stmt := &ast.CommonIdentifier{} if ctx.IDENTIFIER_() != nil { stmt.Identifier = ctx.IDENTIFIER_().GetText() @@ -251,7 +251,7 @@ func (v *Visitor) VisitLikeQueryColumnName(ctx *parser.LikeQueryColumnNameContex return stmt } -func (v *Visitor) VisitAssistedQueryAlgorithm(ctx *parser.AssistedQueryAlgorithmContext) *ast.AssistedQueryAlgorithm { +func (v *EncryptVisitor) VisitAssistedQueryAlgorithm(ctx *parser.AssistedQueryAlgorithmContext) *ast.AssistedQueryAlgorithm { stmt := &ast.AssistedQueryAlgorithm{} if ctx.AlgorithmDefinition() != nil { stmt.AlgorithmDefinition = v.VisitAlgorithmDefinition(ctx.AlgorithmDefinition().(*parser.AlgorithmDefinitionContext)) @@ -259,7 +259,7 @@ func (v *Visitor) VisitAssistedQueryAlgorithm(ctx *parser.AssistedQueryAlgorithm return stmt } -func (v *Visitor) VisitLikeQueryAlgorithm(ctx *parser.LikeQueryAlgorithmContext) *ast.LikeQueryAlgorithm { +func (v *EncryptVisitor) VisitLikeQueryAlgorithm(ctx *parser.LikeQueryAlgorithmContext) *ast.LikeQueryAlgorithm { stmt := &ast.LikeQueryAlgorithm{} if ctx.AlgorithmDefinition() != nil { stmt.AlgorithmDefinition = v.VisitAlgorithmDefinition(ctx.AlgorithmDefinition().(*parser.AlgorithmDefinitionContext)) @@ -267,7 +267,7 @@ func (v *Visitor) VisitLikeQueryAlgorithm(ctx *parser.LikeQueryAlgorithmContext) return stmt } -func (v *Visitor) VisitEncryptAlgorithm(ctx *parser.EncryptAlgorithmContext) *ast.EncryptAlgorithm { +func (v *EncryptVisitor) VisitEncryptAlgorithm(ctx *parser.EncryptAlgorithmContext) *ast.EncryptAlgorithm { stmt := &ast.EncryptAlgorithm{} if ctx.AlgorithmDefinition() != nil { stmt.AlgorithmDefinition = v.VisitAlgorithmDefinition(ctx.AlgorithmDefinition().(*parser.AlgorithmDefinitionContext)) @@ -275,7 +275,7 @@ func (v *Visitor) VisitEncryptAlgorithm(ctx *parser.EncryptAlgorithmContext) *as return stmt } -func (v *Visitor) VisitColumnDefinition(ctx *parser.ColumnDefinitionContext) *ast.ColumnDefinition { +func (v *EncryptVisitor) VisitColumnDefinition(ctx *parser.ColumnDefinitionContext) *ast.ColumnDefinition { stmt := &ast.ColumnDefinition{} if ctx.ColumnName() != nil { stmt.ColumnName = v.VisitColumnName(ctx.ColumnName().(*parser.ColumnNameContext)) @@ -287,7 +287,7 @@ func (v *Visitor) VisitColumnDefinition(ctx *parser.ColumnDefinitionContext) *as return stmt } -func (v *Visitor) VisitColumnName(ctx *parser.ColumnNameContext) *ast.CommonIdentifier { +func (v *EncryptVisitor) VisitColumnName(ctx *parser.ColumnNameContext) *ast.CommonIdentifier { stmt := &ast.CommonIdentifier{} if ctx.IDENTIFIER_() != nil { stmt.Identifier = ctx.IDENTIFIER_().GetText() @@ -295,7 +295,7 @@ func (v *Visitor) VisitColumnName(ctx *parser.ColumnNameContext) *ast.CommonIden return stmt } -func (v *Visitor) VisitDataType(ctx *parser.DataTypeContext) *ast.DataType { +func (v *EncryptVisitor) VisitDataType(ctx *parser.DataTypeContext) *ast.DataType { stmt := &ast.DataType{} if ctx.STRING_() != nil { stmt.String = ctx.STRING_().GetText() @@ -303,7 +303,7 @@ func (v *Visitor) VisitDataType(ctx *parser.DataTypeContext) *ast.DataType { return stmt } -func (v *Visitor) VisitResourceDefinition(ctx *parser.ResourceDefinitionContext) *ast.ResourceDefinition { +func (v *EncryptVisitor) VisitResourceDefinition(ctx *parser.ResourceDefinitionContext) *ast.ResourceDefinition { stmt := &ast.ResourceDefinition{} if ctx.ResourceName() != nil { stmt.ResourceName = v.VisitResourceName(ctx.ResourceName().(*parser.ResourceNameContext)) @@ -311,7 +311,7 @@ func (v *Visitor) VisitResourceDefinition(ctx *parser.ResourceDefinitionContext) return stmt } -func (v *Visitor) VisitResourceName(ctx *parser.ResourceNameContext) *ast.CommonIdentifier { +func (v *EncryptVisitor) VisitResourceName(ctx *parser.ResourceNameContext) *ast.CommonIdentifier { stmt := &ast.CommonIdentifier{} if ctx.IDENTIFIER_() != nil { stmt.Identifier = ctx.IDENTIFIER_().GetText() @@ -319,7 +319,8 @@ func (v *Visitor) VisitResourceName(ctx *parser.ResourceNameContext) *ast.Common return stmt } -func (v *Visitor) VisitLiteral(ctx *parser.LiteralContext) *ast.Literal { +// nolint +func (v *EncryptVisitor) VisitLiteral(ctx *parser.LiteralContext) *ast.Literal { stmt := &ast.Literal{} switch { case ctx.STRING_() != nil: @@ -336,7 +337,7 @@ func (v *Visitor) VisitLiteral(ctx *parser.LiteralContext) *ast.Literal { return stmt } -func (v *Visitor) VisitAlgorithmDefinition(ctx *parser.AlgorithmDefinitionContext) *ast.AlgorithmDefinition { +func (v *EncryptVisitor) VisitAlgorithmDefinition(ctx *parser.AlgorithmDefinitionContext) *ast.AlgorithmDefinition { stmt := &ast.AlgorithmDefinition{} if ctx.AlgorithmTypeName() != nil { stmt.AlgorithmTypeName = v.VisitAlgorithmTypeName(ctx.AlgorithmTypeName().(*parser.AlgorithmTypeNameContext)) @@ -348,7 +349,7 @@ func (v *Visitor) VisitAlgorithmDefinition(ctx *parser.AlgorithmDefinitionContex return stmt } -func (v *Visitor) VisitAlgorithmTypeName(ctx *parser.AlgorithmTypeNameContext) *ast.AlgorithmTypeName { +func (v *EncryptVisitor) VisitAlgorithmTypeName(ctx *parser.AlgorithmTypeNameContext) *ast.AlgorithmTypeName { stmt := &ast.AlgorithmTypeName{} switch { case ctx.STRING_() != nil: @@ -359,7 +360,7 @@ func (v *Visitor) VisitAlgorithmTypeName(ctx *parser.AlgorithmTypeNameContext) * return stmt } -func (v *Visitor) VisitBuildinAlgorithmTypeName(ctx *parser.BuildinAlgorithmTypeNameContext) *ast.BuildinAlgorithmTypeName { +func (v *EncryptVisitor) VisitBuildinAlgorithmTypeName(ctx *parser.BuildinAlgorithmTypeNameContext) *ast.BuildinAlgorithmTypeName { stmt := &ast.BuildinAlgorithmTypeName{} switch { case ctx.MD5() != nil: @@ -378,7 +379,7 @@ func (v *Visitor) VisitBuildinAlgorithmTypeName(ctx *parser.BuildinAlgorithmType return stmt } -func (v *Visitor) VisitPropertiesDefinition(ctx *parser.PropertiesDefinitionContext) *ast.PropertiesDefinition { +func (v *EncryptVisitor) VisitPropertiesDefinition(ctx *parser.PropertiesDefinitionContext) *ast.PropertiesDefinition { stmt := &ast.PropertiesDefinition{} if ctx.Properties() != nil { stmt.Properties = v.VisitProperties(ctx.Properties().(*parser.PropertiesContext)) @@ -386,7 +387,7 @@ func (v *Visitor) VisitPropertiesDefinition(ctx *parser.PropertiesDefinitionCont return stmt } -func (v *Visitor) VisitProperties(ctx *parser.PropertiesContext) *ast.Properties { +func (v *EncryptVisitor) VisitProperties(ctx *parser.PropertiesContext) *ast.Properties { stmt := &ast.Properties{} for _, p := range ctx.AllProperty() { stmt.Properties = append(stmt.Properties, v.VisitProperty(p.(*parser.PropertyContext))) @@ -394,7 +395,7 @@ func (v *Visitor) VisitProperties(ctx *parser.PropertiesContext) *ast.Properties return stmt } -func (v *Visitor) VisitProperty(ctx *parser.PropertyContext) *ast.Property { +func (v *EncryptVisitor) VisitProperty(ctx *parser.PropertyContext) *ast.Property { stmt := &ast.Property{} if ctx.STRING_() != nil { stmt.Key = ctx.STRING_().GetText() @@ -405,7 +406,7 @@ func (v *Visitor) VisitProperty(ctx *parser.PropertyContext) *ast.Property { return stmt } -func (v *Visitor) VisitTableName(ctx *parser.TableNameContext) *ast.CommonIdentifier { +func (v *EncryptVisitor) VisitTableName(ctx *parser.TableNameContext) *ast.CommonIdentifier { stmt := &ast.CommonIdentifier{} if ctx.IDENTIFIER_() != nil { stmt.Identifier = ctx.IDENTIFIER_().GetText() diff --git a/shardingsphere-operator/pkg/distsql/visitor/mask_rdl_visitor.go b/shardingsphere-operator/pkg/distsql/visitor/mask_rdl_visitor.go new file mode 100644 index 00000000..c9bef0e8 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/visitor/mask_rdl_visitor.go @@ -0,0 +1,220 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package visitor + +import ( + "fmt" + + "github.com/apache/shardingsphere-on-cloud/shardingsphere-operator/pkg/distsql/ast" + parser "github.com/apache/shardingsphere-on-cloud/shardingsphere-operator/pkg/distsql/visitor_parser/mask" +) + +type MaskVisitor struct { + parser.BaseRDLStatementVisitor +} + +func (v *MaskVisitor) VisitCreateMaskRule(ctx *parser.CreateMaskRuleContext) *ast.CreateMaskRule { + stmt := &ast.CreateMaskRule{} + if ctx.IfNotExists() != nil { + stmt.IfNotExists = v.VisitIfNotExists(ctx.IfNotExists().(*parser.IfNotExistsContext)) + } + if ctx.TABLE() != nil { + stmt.Table = ctx.TABLE().GetText() + } + if ctx.AllMaskRuleDefinition() != nil { + for _, m := range ctx.AllMaskRuleDefinition() { + stmt.AllMaskRuleDefinition = append(stmt.AllMaskRuleDefinition, v.VisitMaskRuleDefinition(m.(*parser.MaskRuleDefinitionContext))) + } + } + return stmt +} + +func (v *MaskVisitor) VisitAlterMaskRule(ctx *parser.AlterMaskRuleContext) *ast.AlterMaskRule { + stmt := &ast.AlterMaskRule{} + if ctx.TABLE() != nil { + stmt.Table = ctx.TABLE().GetText() + } + if ctx.AllMaskRuleDefinition() != nil { + for _, m := range ctx.AllMaskRuleDefinition() { + stmt.AllMaskRuleDefinition = append(stmt.AllMaskRuleDefinition, v.VisitMaskRuleDefinition(m.(*parser.MaskRuleDefinitionContext))) + } + } + return stmt +} + +func (v *MaskVisitor) VisitDropMaskRule(ctx *parser.DropMaskRuleContext) *ast.DropMaskRule { + stmt := &ast.DropMaskRule{} + if ctx.TABLE() != nil { + stmt.Table = ctx.TABLE().GetText() + } + if ctx.IfExists() != nil { + stmt.IfExists = v.VisitIfExists(ctx.IfExists().(*parser.IfExistsContext)) + } + if ctx.AllRuleName() != nil { + for _, rn := range ctx.AllRuleName() { + stmt.AllRuleName = append(stmt.AllRuleName, v.VisitRuleName(rn.(*parser.RuleNameContext))) + } + } + return stmt +} + +func (v *MaskVisitor) VisitMaskRuleDefinition(ctx *parser.MaskRuleDefinitionContext) *ast.MaskRuleDefinition { + stmt := &ast.MaskRuleDefinition{} + if ctx.RuleName() != nil { + stmt.RuleName = v.VisitRuleName(ctx.RuleName().(*parser.RuleNameContext)) + } + return stmt +} + +func (v *MaskVisitor) VisitColumnDefinition(ctx *parser.ColumnDefinitionContext) *ast.ColumnDefinition { + stmt := &ast.ColumnDefinition{} + if ctx.ColumnName() != nil { + stmt.ColumnName = v.VisitColumnName(ctx.ColumnName().(*parser.ColumnNameContext)) + } + return stmt +} + +func (v *MaskVisitor) VisitColumnName(ctx *parser.ColumnNameContext) *ast.CommonIdentifier { + stmt := &ast.CommonIdentifier{} + if ctx.IDENTIFIER_() != nil { + stmt.Identifier = ctx.IDENTIFIER_().GetText() + } + return stmt +} + +func (v *MaskVisitor) VisitIfExists(ctx *parser.IfExistsContext) *ast.IfExists { + return &ast.IfExists{ + IfExists: fmt.Sprintf("%s %s", ctx.IF().GetText(), ctx.EXISTS().GetText()), + } +} + +func (v *MaskVisitor) VisitIfNotExists(ctx *parser.IfNotExistsContext) *ast.IfNotExists { + return &ast.IfNotExists{ + IfNotExists: fmt.Sprintf("%s %s %s", ctx.IF().GetText(), ctx.NOT().GetText(), ctx.EXISTS().GetText()), + } +} + +// nolint +func (v *MaskVisitor) VisitLiteral(ctx *parser.LiteralContext) *ast.Literal { + stmt := &ast.Literal{} + switch { + case ctx.STRING_() != nil: + stmt.Literal = ctx.STRING_().GetText() + case ctx.MINUS_() != nil: + stmt.Literal = ctx.MINUS_().GetText() + case ctx.INT_() != nil: + stmt.Literal = ctx.INT_().GetText() + case ctx.TRUE() != nil: + stmt.Literal = ctx.TRUE().GetText() + case ctx.FALSE() != nil: + stmt.Literal = ctx.FALSE().GetText() + } + return stmt +} + +func (v *MaskVisitor) VisitAlgorithmDefinition(ctx *parser.AlgorithmDefinitionContext) *ast.AlgorithmDefinition { + stmt := &ast.AlgorithmDefinition{} + if ctx.AlgorithmTypeName() != nil { + stmt.AlgorithmTypeName = v.VisitAlgorithmTypeName(ctx.AlgorithmTypeName().(*parser.AlgorithmTypeNameContext)) + } + + if ctx.PropertiesDefinition() != nil { + stmt.PropertiesDefinition = v.VisitPropertiesDefinition(ctx.PropertiesDefinition().(*parser.PropertiesDefinitionContext)) + } + return stmt +} + +func (v *MaskVisitor) VisitAlgorithmTypeName(ctx *parser.AlgorithmTypeNameContext) *ast.AlgorithmTypeName { + stmt := &ast.AlgorithmTypeName{} + switch { + case ctx.STRING_() != nil: + stmt.String = ctx.STRING_().GetText() + case ctx.BuildInMaskAlgorithmType() != nil: + stmt.BuildinAlgorithmTypeName = v.VisitBuildInMaskAlgorithmType(ctx.BuildInMaskAlgorithmType().(*parser.BuildInMaskAlgorithmTypeContext)) + } + return stmt +} + +func (v *MaskVisitor) VisitBuildInMaskAlgorithmType(ctx *parser.BuildInMaskAlgorithmTypeContext) *ast.BuildinAlgorithmTypeName { + stmt := &ast.BuildinAlgorithmTypeName{} + switch { + case ctx.MD5() != nil: + stmt.AlgorithmTypeName = ctx.MD5().GetText() + case ctx.KEEP_FIRST_N_LAST_M() != nil: + stmt.AlgorithmTypeName = ctx.KEEP_FIRST_N_LAST_M().GetText() + case ctx.KEEP_FROM_X_TO_Y() != nil: + stmt.AlgorithmTypeName = ctx.KEEP_FROM_X_TO_Y().GetText() + case ctx.MASK_FIRST_N_LAST_M() != nil: + stmt.AlgorithmTypeName = ctx.MASK_FIRST_N_LAST_M().GetText() + case ctx.MASK_FROM_X_TO_Y() != nil: + stmt.AlgorithmTypeName = ctx.MASK_FROM_X_TO_Y().GetText() + case ctx.MASK_BEFORE_SPECIAL_CHARS() != nil: + stmt.AlgorithmTypeName = ctx.MASK_BEFORE_SPECIAL_CHARS().GetText() + case ctx.MASK_AFTER_SPECIAL_CHARS() != nil: + stmt.AlgorithmTypeName = ctx.MASK_AFTER_SPECIAL_CHARS().GetText() + case ctx.PERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE() != nil: + stmt.AlgorithmTypeName = ctx.PERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE().GetText() + case ctx.MILITARY_IDENTITY_NUMBER_RANDOM_REPLACE() != nil: + stmt.AlgorithmTypeName = ctx.MILITARY_IDENTITY_NUMBER_RANDOM_REPLACE().GetText() + case ctx.LANDLINE_NUMBER_RANDOM_REPLACE() != nil: + stmt.AlgorithmTypeName = ctx.LANDLINE_NUMBER_RANDOM_REPLACE().GetText() + case ctx.TELEPHONE_RANDOM_REPLACE() != nil: + stmt.AlgorithmTypeName = ctx.TELEPHONE_RANDOM_REPLACE().GetText() + case ctx.UNIFIED_CREDIT_CODE_RANDOM_REPLACE() != nil: + stmt.AlgorithmTypeName = ctx.UNIFIED_CREDIT_CODE_RANDOM_REPLACE().GetText() + case ctx.GENERIC_TABLE_RANDOM_REPLACE() != nil: + stmt.AlgorithmTypeName = ctx.GENERIC_TABLE_RANDOM_REPLACE().GetText() + } + return stmt + +} + +func (v *MaskVisitor) VisitPropertiesDefinition(ctx *parser.PropertiesDefinitionContext) *ast.PropertiesDefinition { + stmt := &ast.PropertiesDefinition{} + if ctx.Properties() != nil { + stmt.Properties = v.VisitProperties(ctx.Properties().(*parser.PropertiesContext)) + } + return stmt +} + +func (v *MaskVisitor) VisitProperties(ctx *parser.PropertiesContext) *ast.Properties { + stmt := &ast.Properties{} + for _, p := range ctx.AllProperty() { + stmt.Properties = append(stmt.Properties, v.VisitProperty(p.(*parser.PropertyContext))) + } + return stmt +} + +func (v *MaskVisitor) VisitProperty(ctx *parser.PropertyContext) *ast.Property { + stmt := &ast.Property{} + if ctx.STRING_() != nil { + stmt.Key = ctx.STRING_().GetText() + } + if ctx.Literal() != nil { + stmt.Literal = v.VisitLiteral(ctx.Literal().(*parser.LiteralContext)) + } + return stmt +} + +func (v *MaskVisitor) VisitRuleName(ctx *parser.RuleNameContext) *ast.CommonIdentifier { + stmt := &ast.CommonIdentifier{} + if ctx.IDENTIFIER_() != nil { + stmt.Identifier = ctx.IDENTIFIER_().GetText() + } + return stmt +} diff --git a/shardingsphere-operator/pkg/distsql/visitor_parser/mask/rdlstatement_base_visitor.go b/shardingsphere-operator/pkg/distsql/visitor_parser/mask/rdlstatement_base_visitor.go new file mode 100644 index 00000000..394b61b1 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/visitor_parser/mask/rdlstatement_base_visitor.go @@ -0,0 +1,90 @@ +// Code generated from RDLStatement.g4 by ANTLR 4.8. DO NOT EDIT. + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package parser // RDLStatement + +import "github.com/antlr/antlr4/runtime/Go/antlr" + +type BaseRDLStatementVisitor struct { + *antlr.BaseParseTreeVisitor +} + +func (v *BaseRDLStatementVisitor) VisitCreateMaskRule(ctx *CreateMaskRuleContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitAlterMaskRule(ctx *AlterMaskRuleContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitDropMaskRule(ctx *DropMaskRuleContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitMaskRuleDefinition(ctx *MaskRuleDefinitionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitColumnDefinition(ctx *ColumnDefinitionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitColumnName(ctx *ColumnNameContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitIfExists(ctx *IfExistsContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitIfNotExists(ctx *IfNotExistsContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitLiteral(ctx *LiteralContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitAlgorithmDefinition(ctx *AlgorithmDefinitionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitAlgorithmTypeName(ctx *AlgorithmTypeNameContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitBuildInMaskAlgorithmType(ctx *BuildInMaskAlgorithmTypeContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitPropertiesDefinition(ctx *PropertiesDefinitionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitProperties(ctx *PropertiesContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitProperty(ctx *PropertyContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseRDLStatementVisitor) VisitRuleName(ctx *RuleNameContext) interface{} { + return v.VisitChildren(ctx) +} diff --git a/shardingsphere-operator/pkg/distsql/visitor_parser/mask/rdlstatement_lexer.go b/shardingsphere-operator/pkg/distsql/visitor_parser/mask/rdlstatement_lexer.go new file mode 100644 index 00000000..60f92fdb --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/visitor_parser/mask/rdlstatement_lexer.go @@ -0,0 +1,662 @@ +// Code generated from RDLStatement.g4 by ANTLR 4.8. DO NOT EDIT. + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package parser + +import ( + "fmt" + "unicode" + + "github.com/antlr/antlr4/runtime/Go/antlr" +) + +// Suppress unused import error +var _ = fmt.Printf +var _ = unicode.IsLetter + +var serializedLexerAtn = []uint16{ + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 87, 1012, + 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, + 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, + 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, + 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, + 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, + 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, + 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, + 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, + 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, + 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, + 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, + 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, + 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, + 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, + 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, + 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, + 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, + 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, + 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, + 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, + 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, + 4, 111, 9, 111, 4, 112, 9, 112, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, + 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, + 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, + 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, + 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, + 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 280, 10, 23, 3, 24, 3, 24, 3, 25, 3, + 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, + 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, + 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, + 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 44, 6, + 44, 327, 10, 44, 13, 44, 14, 44, 328, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, + 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, + 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, + 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, + 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, + 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, + 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, + 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, + 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, + 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, + 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 63, + 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 65, 3, + 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, + 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, + 66, 3, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, + 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 68, 3, 68, 3, + 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, + 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, + 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, + 3, 69, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, + 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, + 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, + 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, + 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, + 71, 3, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, + 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, + 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, + 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, + 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, + 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, + 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, + 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 74, 3, 74, 3, + 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, + 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, + 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 75, 3, 75, 3, 75, + 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, + 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, + 3, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, + 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, + 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, + 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, + 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, + 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, + 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, + 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, + 3, 78, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, + 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, + 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, + 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, + 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 82, 3, + 82, 3, 83, 3, 83, 3, 84, 3, 84, 3, 85, 3, 85, 3, 86, 3, 86, 3, 87, 3, 87, + 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 3, 91, 3, 92, 3, 92, 3, + 93, 3, 93, 3, 94, 3, 94, 3, 95, 3, 95, 3, 96, 3, 96, 3, 97, 3, 97, 3, 98, + 3, 98, 3, 99, 3, 99, 3, 100, 3, 100, 3, 101, 3, 101, 3, 102, 3, 102, 3, + 103, 3, 103, 3, 104, 3, 104, 3, 105, 3, 105, 3, 106, 7, 106, 898, 10, 106, + 12, 106, 14, 106, 901, 11, 106, 3, 106, 6, 106, 904, 10, 106, 13, 106, + 14, 106, 905, 3, 106, 7, 106, 909, 10, 106, 12, 106, 14, 106, 912, 11, + 106, 3, 106, 3, 106, 6, 106, 916, 10, 106, 13, 106, 14, 106, 917, 3, 106, + 3, 106, 5, 106, 922, 10, 106, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, + 107, 7, 107, 930, 10, 107, 12, 107, 14, 107, 933, 11, 107, 3, 107, 3, 107, + 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 7, 107, 943, 10, 107, 12, + 107, 14, 107, 946, 11, 107, 3, 107, 3, 107, 5, 107, 950, 10, 107, 3, 108, + 6, 108, 953, 10, 108, 13, 108, 14, 108, 954, 3, 109, 3, 109, 3, 110, 5, + 110, 960, 10, 110, 3, 110, 5, 110, 963, 10, 110, 3, 110, 3, 110, 3, 110, + 3, 110, 5, 110, 969, 10, 110, 3, 110, 3, 110, 5, 110, 973, 10, 110, 3, + 111, 3, 111, 3, 111, 3, 111, 6, 111, 979, 10, 111, 13, 111, 14, 111, 980, + 3, 111, 3, 111, 3, 111, 6, 111, 986, 10, 111, 13, 111, 14, 111, 987, 3, + 111, 3, 111, 5, 111, 992, 10, 111, 3, 112, 3, 112, 3, 112, 3, 112, 6, 112, + 998, 10, 112, 13, 112, 14, 112, 999, 3, 112, 3, 112, 3, 112, 6, 112, 1005, + 10, 112, 13, 112, 14, 112, 1006, 3, 112, 3, 112, 5, 112, 1011, 10, 112, + 4, 899, 905, 2, 113, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, + 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, + 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, + 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, + 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, + 91, 47, 93, 48, 95, 49, 97, 50, 99, 51, 101, 52, 103, 53, 105, 54, 107, + 55, 109, 56, 111, 57, 113, 58, 115, 59, 117, 60, 119, 61, 121, 62, 123, + 63, 125, 64, 127, 65, 129, 66, 131, 67, 133, 68, 135, 69, 137, 70, 139, + 71, 141, 72, 143, 73, 145, 74, 147, 75, 149, 76, 151, 77, 153, 78, 155, + 79, 157, 80, 159, 2, 161, 2, 163, 2, 165, 2, 167, 2, 169, 2, 171, 2, 173, + 2, 175, 2, 177, 2, 179, 2, 181, 2, 183, 2, 185, 2, 187, 2, 189, 2, 191, + 2, 193, 2, 195, 2, 197, 2, 199, 2, 201, 2, 203, 2, 205, 2, 207, 2, 209, + 2, 211, 81, 213, 82, 215, 83, 217, 84, 219, 85, 221, 86, 223, 87, 3, 2, + 37, 5, 2, 11, 12, 15, 15, 34, 34, 3, 2, 55, 55, 4, 2, 67, 67, 99, 99, 4, + 2, 68, 68, 100, 100, 4, 2, 69, 69, 101, 101, 4, 2, 70, 70, 102, 102, 4, + 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 73, 73, 105, 105, 4, + 2, 74, 74, 106, 106, 4, 2, 75, 75, 107, 107, 4, 2, 76, 76, 108, 108, 4, + 2, 77, 77, 109, 109, 4, 2, 78, 78, 110, 110, 4, 2, 79, 79, 111, 111, 4, + 2, 80, 80, 112, 112, 4, 2, 81, 81, 113, 113, 4, 2, 82, 82, 114, 114, 4, + 2, 83, 83, 115, 115, 4, 2, 84, 84, 116, 116, 4, 2, 85, 85, 117, 117, 4, + 2, 86, 86, 118, 118, 4, 2, 87, 87, 119, 119, 4, 2, 88, 88, 120, 120, 4, + 2, 89, 89, 121, 121, 4, 2, 90, 90, 122, 122, 4, 2, 91, 91, 123, 123, 4, + 2, 92, 92, 124, 124, 7, 2, 38, 38, 50, 59, 67, 92, 97, 97, 99, 124, 6, + 2, 38, 38, 67, 92, 97, 97, 99, 124, 3, 2, 98, 98, 4, 2, 36, 36, 94, 94, + 4, 2, 41, 41, 94, 94, 3, 2, 50, 59, 5, 2, 50, 59, 67, 72, 99, 104, 2, 1011, + 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, + 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, + 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, + 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, + 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, + 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, + 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, + 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, + 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, + 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, + 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, + 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, + 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, + 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, + 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, + 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, + 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, + 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, + 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, + 3, 2, 2, 2, 2, 147, 3, 2, 2, 2, 2, 149, 3, 2, 2, 2, 2, 151, 3, 2, 2, 2, + 2, 153, 3, 2, 2, 2, 2, 155, 3, 2, 2, 2, 2, 157, 3, 2, 2, 2, 2, 211, 3, + 2, 2, 2, 2, 213, 3, 2, 2, 2, 2, 215, 3, 2, 2, 2, 2, 217, 3, 2, 2, 2, 2, + 219, 3, 2, 2, 2, 2, 221, 3, 2, 2, 2, 2, 223, 3, 2, 2, 2, 3, 225, 3, 2, + 2, 2, 5, 228, 3, 2, 2, 2, 7, 231, 3, 2, 2, 2, 9, 233, 3, 2, 2, 2, 11, 235, + 3, 2, 2, 2, 13, 237, 3, 2, 2, 2, 15, 239, 3, 2, 2, 2, 17, 242, 3, 2, 2, + 2, 19, 245, 3, 2, 2, 2, 21, 247, 3, 2, 2, 2, 23, 249, 3, 2, 2, 2, 25, 251, + 3, 2, 2, 2, 27, 253, 3, 2, 2, 2, 29, 255, 3, 2, 2, 2, 31, 257, 3, 2, 2, + 2, 33, 259, 3, 2, 2, 2, 35, 261, 3, 2, 2, 2, 37, 263, 3, 2, 2, 2, 39, 266, + 3, 2, 2, 2, 41, 270, 3, 2, 2, 2, 43, 273, 3, 2, 2, 2, 45, 279, 3, 2, 2, + 2, 47, 281, 3, 2, 2, 2, 49, 283, 3, 2, 2, 2, 51, 286, 3, 2, 2, 2, 53, 288, + 3, 2, 2, 2, 55, 291, 3, 2, 2, 2, 57, 293, 3, 2, 2, 2, 59, 295, 3, 2, 2, + 2, 61, 297, 3, 2, 2, 2, 63, 299, 3, 2, 2, 2, 65, 301, 3, 2, 2, 2, 67, 303, + 3, 2, 2, 2, 69, 305, 3, 2, 2, 2, 71, 307, 3, 2, 2, 2, 73, 309, 3, 2, 2, + 2, 75, 311, 3, 2, 2, 2, 77, 313, 3, 2, 2, 2, 79, 315, 3, 2, 2, 2, 81, 317, + 3, 2, 2, 2, 83, 319, 3, 2, 2, 2, 85, 323, 3, 2, 2, 2, 87, 326, 3, 2, 2, + 2, 89, 332, 3, 2, 2, 2, 91, 337, 3, 2, 2, 2, 93, 343, 3, 2, 2, 2, 95, 350, + 3, 2, 2, 2, 97, 356, 3, 2, 2, 2, 99, 361, 3, 2, 2, 2, 101, 366, 3, 2, 2, + 2, 103, 371, 3, 2, 2, 2, 105, 376, 3, 2, 2, 2, 107, 381, 3, 2, 2, 2, 109, + 386, 3, 2, 2, 2, 111, 391, 3, 2, 2, 2, 113, 402, 3, 2, 2, 2, 115, 409, + 3, 2, 2, 2, 117, 415, 3, 2, 2, 2, 119, 421, 3, 2, 2, 2, 121, 429, 3, 2, + 2, 2, 123, 432, 3, 2, 2, 2, 125, 439, 3, 2, 2, 2, 127, 445, 3, 2, 2, 2, + 129, 449, 3, 2, 2, 2, 131, 453, 3, 2, 2, 2, 133, 473, 3, 2, 2, 2, 135, + 490, 3, 2, 2, 2, 137, 510, 3, 2, 2, 2, 139, 527, 3, 2, 2, 2, 141, 553, + 3, 2, 2, 2, 143, 578, 3, 2, 2, 2, 145, 618, 3, 2, 2, 2, 147, 658, 3, 2, + 2, 2, 149, 689, 3, 2, 2, 2, 151, 714, 3, 2, 2, 2, 153, 749, 3, 2, 2, 2, + 155, 778, 3, 2, 2, 2, 157, 801, 3, 2, 2, 2, 159, 844, 3, 2, 2, 2, 161, + 846, 3, 2, 2, 2, 163, 848, 3, 2, 2, 2, 165, 850, 3, 2, 2, 2, 167, 852, + 3, 2, 2, 2, 169, 854, 3, 2, 2, 2, 171, 856, 3, 2, 2, 2, 173, 858, 3, 2, + 2, 2, 175, 860, 3, 2, 2, 2, 177, 862, 3, 2, 2, 2, 179, 864, 3, 2, 2, 2, + 181, 866, 3, 2, 2, 2, 183, 868, 3, 2, 2, 2, 185, 870, 3, 2, 2, 2, 187, + 872, 3, 2, 2, 2, 189, 874, 3, 2, 2, 2, 191, 876, 3, 2, 2, 2, 193, 878, + 3, 2, 2, 2, 195, 880, 3, 2, 2, 2, 197, 882, 3, 2, 2, 2, 199, 884, 3, 2, + 2, 2, 201, 886, 3, 2, 2, 2, 203, 888, 3, 2, 2, 2, 205, 890, 3, 2, 2, 2, + 207, 892, 3, 2, 2, 2, 209, 894, 3, 2, 2, 2, 211, 921, 3, 2, 2, 2, 213, + 949, 3, 2, 2, 2, 215, 952, 3, 2, 2, 2, 217, 956, 3, 2, 2, 2, 219, 959, + 3, 2, 2, 2, 221, 991, 3, 2, 2, 2, 223, 1010, 3, 2, 2, 2, 225, 226, 7, 40, + 2, 2, 226, 227, 7, 40, 2, 2, 227, 4, 3, 2, 2, 2, 228, 229, 7, 126, 2, 2, + 229, 230, 7, 126, 2, 2, 230, 6, 3, 2, 2, 2, 231, 232, 7, 35, 2, 2, 232, + 8, 3, 2, 2, 2, 233, 234, 7, 128, 2, 2, 234, 10, 3, 2, 2, 2, 235, 236, 7, + 126, 2, 2, 236, 12, 3, 2, 2, 2, 237, 238, 7, 40, 2, 2, 238, 14, 3, 2, 2, + 2, 239, 240, 7, 62, 2, 2, 240, 241, 7, 62, 2, 2, 241, 16, 3, 2, 2, 2, 242, + 243, 7, 64, 2, 2, 243, 244, 7, 64, 2, 2, 244, 18, 3, 2, 2, 2, 245, 246, + 7, 96, 2, 2, 246, 20, 3, 2, 2, 2, 247, 248, 7, 39, 2, 2, 248, 22, 3, 2, + 2, 2, 249, 250, 7, 60, 2, 2, 250, 24, 3, 2, 2, 2, 251, 252, 7, 45, 2, 2, + 252, 26, 3, 2, 2, 2, 253, 254, 7, 47, 2, 2, 254, 28, 3, 2, 2, 2, 255, 256, + 7, 44, 2, 2, 256, 30, 3, 2, 2, 2, 257, 258, 7, 49, 2, 2, 258, 32, 3, 2, + 2, 2, 259, 260, 7, 94, 2, 2, 260, 34, 3, 2, 2, 2, 261, 262, 7, 48, 2, 2, + 262, 36, 3, 2, 2, 2, 263, 264, 7, 48, 2, 2, 264, 265, 7, 44, 2, 2, 265, + 38, 3, 2, 2, 2, 266, 267, 7, 62, 2, 2, 267, 268, 7, 63, 2, 2, 268, 269, + 7, 64, 2, 2, 269, 40, 3, 2, 2, 2, 270, 271, 7, 63, 2, 2, 271, 272, 7, 63, + 2, 2, 272, 42, 3, 2, 2, 2, 273, 274, 7, 63, 2, 2, 274, 44, 3, 2, 2, 2, + 275, 276, 7, 62, 2, 2, 276, 280, 7, 64, 2, 2, 277, 278, 7, 35, 2, 2, 278, + 280, 7, 63, 2, 2, 279, 275, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 280, 46, + 3, 2, 2, 2, 281, 282, 7, 64, 2, 2, 282, 48, 3, 2, 2, 2, 283, 284, 7, 64, + 2, 2, 284, 285, 7, 63, 2, 2, 285, 50, 3, 2, 2, 2, 286, 287, 7, 62, 2, 2, + 287, 52, 3, 2, 2, 2, 288, 289, 7, 62, 2, 2, 289, 290, 7, 63, 2, 2, 290, + 54, 3, 2, 2, 2, 291, 292, 7, 37, 2, 2, 292, 56, 3, 2, 2, 2, 293, 294, 7, + 42, 2, 2, 294, 58, 3, 2, 2, 2, 295, 296, 7, 43, 2, 2, 296, 60, 3, 2, 2, + 2, 297, 298, 7, 125, 2, 2, 298, 62, 3, 2, 2, 2, 299, 300, 7, 127, 2, 2, + 300, 64, 3, 2, 2, 2, 301, 302, 7, 93, 2, 2, 302, 66, 3, 2, 2, 2, 303, 304, + 7, 95, 2, 2, 304, 68, 3, 2, 2, 2, 305, 306, 7, 46, 2, 2, 306, 70, 3, 2, + 2, 2, 307, 308, 7, 36, 2, 2, 308, 72, 3, 2, 2, 2, 309, 310, 7, 41, 2, 2, + 310, 74, 3, 2, 2, 2, 311, 312, 7, 98, 2, 2, 312, 76, 3, 2, 2, 2, 313, 314, + 7, 65, 2, 2, 314, 78, 3, 2, 2, 2, 315, 316, 7, 66, 2, 2, 316, 80, 3, 2, + 2, 2, 317, 318, 7, 61, 2, 2, 318, 82, 3, 2, 2, 2, 319, 320, 7, 47, 2, 2, + 320, 321, 7, 64, 2, 2, 321, 322, 7, 64, 2, 2, 322, 84, 3, 2, 2, 2, 323, + 324, 7, 97, 2, 2, 324, 86, 3, 2, 2, 2, 325, 327, 9, 2, 2, 2, 326, 325, + 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 328, 329, 3, 2, + 2, 2, 329, 330, 3, 2, 2, 2, 330, 331, 8, 44, 2, 2, 331, 88, 3, 2, 2, 2, + 332, 333, 5, 197, 99, 2, 333, 334, 5, 193, 97, 2, 334, 335, 5, 199, 100, + 2, 335, 336, 5, 167, 84, 2, 336, 90, 3, 2, 2, 2, 337, 338, 5, 169, 85, + 2, 338, 339, 5, 159, 80, 2, 339, 340, 5, 181, 91, 2, 340, 341, 5, 195, + 98, 2, 341, 342, 5, 167, 84, 2, 342, 92, 3, 2, 2, 2, 343, 344, 5, 163, + 82, 2, 344, 345, 5, 193, 97, 2, 345, 346, 5, 167, 84, 2, 346, 347, 5, 159, + 80, 2, 347, 348, 5, 197, 99, 2, 348, 349, 5, 167, 84, 2, 349, 94, 3, 2, + 2, 2, 350, 351, 5, 159, 80, 2, 351, 352, 5, 181, 91, 2, 352, 353, 5, 197, + 99, 2, 353, 354, 5, 167, 84, 2, 354, 355, 5, 193, 97, 2, 355, 96, 3, 2, + 2, 2, 356, 357, 5, 165, 83, 2, 357, 358, 5, 193, 97, 2, 358, 359, 5, 187, + 94, 2, 359, 360, 5, 189, 95, 2, 360, 98, 3, 2, 2, 2, 361, 362, 5, 195, + 98, 2, 362, 363, 5, 173, 87, 2, 363, 364, 5, 187, 94, 2, 364, 365, 5, 203, + 102, 2, 365, 100, 3, 2, 2, 2, 366, 367, 5, 193, 97, 2, 367, 368, 5, 199, + 100, 2, 368, 369, 5, 181, 91, 2, 369, 370, 5, 167, 84, 2, 370, 102, 3, + 2, 2, 2, 371, 372, 5, 169, 85, 2, 372, 373, 5, 193, 97, 2, 373, 374, 5, + 187, 94, 2, 374, 375, 5, 183, 92, 2, 375, 104, 3, 2, 2, 2, 376, 377, 5, + 183, 92, 2, 377, 378, 5, 159, 80, 2, 378, 379, 5, 195, 98, 2, 379, 380, + 5, 179, 90, 2, 380, 106, 3, 2, 2, 2, 381, 382, 5, 197, 99, 2, 382, 383, + 5, 207, 104, 2, 383, 384, 5, 189, 95, 2, 384, 385, 5, 167, 84, 2, 385, + 108, 3, 2, 2, 2, 386, 387, 5, 185, 93, 2, 387, 388, 5, 159, 80, 2, 388, + 389, 5, 183, 92, 2, 389, 390, 5, 167, 84, 2, 390, 110, 3, 2, 2, 2, 391, + 392, 5, 189, 95, 2, 392, 393, 5, 193, 97, 2, 393, 394, 5, 187, 94, 2, 394, + 395, 5, 189, 95, 2, 395, 396, 5, 167, 84, 2, 396, 397, 5, 193, 97, 2, 397, + 398, 5, 197, 99, 2, 398, 399, 5, 175, 88, 2, 399, 400, 5, 167, 84, 2, 400, + 401, 5, 195, 98, 2, 401, 112, 3, 2, 2, 2, 402, 403, 5, 163, 82, 2, 403, + 404, 5, 187, 94, 2, 404, 405, 5, 181, 91, 2, 405, 406, 5, 199, 100, 2, + 406, 407, 5, 183, 92, 2, 407, 408, 5, 185, 93, 2, 408, 114, 3, 2, 2, 2, + 409, 410, 5, 193, 97, 2, 410, 411, 5, 199, 100, 2, 411, 412, 5, 181, 91, + 2, 412, 413, 5, 167, 84, 2, 413, 414, 5, 195, 98, 2, 414, 116, 3, 2, 2, + 2, 415, 416, 5, 197, 99, 2, 416, 417, 5, 159, 80, 2, 417, 418, 5, 161, + 81, 2, 418, 419, 5, 181, 91, 2, 419, 420, 5, 167, 84, 2, 420, 118, 3, 2, + 2, 2, 421, 422, 5, 163, 82, 2, 422, 423, 5, 187, 94, 2, 423, 424, 5, 181, + 91, 2, 424, 425, 5, 199, 100, 2, 425, 426, 5, 183, 92, 2, 426, 427, 5, + 185, 93, 2, 427, 428, 5, 195, 98, 2, 428, 120, 3, 2, 2, 2, 429, 430, 5, + 175, 88, 2, 430, 431, 5, 169, 85, 2, 431, 122, 3, 2, 2, 2, 432, 433, 5, + 167, 84, 2, 433, 434, 5, 205, 103, 2, 434, 435, 5, 175, 88, 2, 435, 436, + 5, 195, 98, 2, 436, 437, 5, 197, 99, 2, 437, 438, 5, 195, 98, 2, 438, 124, + 3, 2, 2, 2, 439, 440, 5, 163, 82, 2, 440, 441, 5, 187, 94, 2, 441, 442, + 5, 199, 100, 2, 442, 443, 5, 185, 93, 2, 443, 444, 5, 197, 99, 2, 444, + 126, 3, 2, 2, 2, 445, 446, 5, 185, 93, 2, 446, 447, 5, 187, 94, 2, 447, + 448, 5, 197, 99, 2, 448, 128, 3, 2, 2, 2, 449, 450, 5, 183, 92, 2, 450, + 451, 5, 165, 83, 2, 451, 452, 9, 3, 2, 2, 452, 130, 3, 2, 2, 2, 453, 454, + 5, 179, 90, 2, 454, 455, 5, 167, 84, 2, 455, 456, 5, 167, 84, 2, 456, 457, + 5, 189, 95, 2, 457, 458, 5, 85, 43, 2, 458, 459, 5, 169, 85, 2, 459, 460, + 5, 175, 88, 2, 460, 461, 5, 193, 97, 2, 461, 462, 5, 195, 98, 2, 462, 463, + 5, 197, 99, 2, 463, 464, 5, 85, 43, 2, 464, 465, 5, 185, 93, 2, 465, 466, + 5, 85, 43, 2, 466, 467, 5, 181, 91, 2, 467, 468, 5, 159, 80, 2, 468, 469, + 5, 195, 98, 2, 469, 470, 5, 197, 99, 2, 470, 471, 5, 85, 43, 2, 471, 472, + 5, 183, 92, 2, 472, 132, 3, 2, 2, 2, 473, 474, 5, 179, 90, 2, 474, 475, + 5, 167, 84, 2, 475, 476, 5, 167, 84, 2, 476, 477, 5, 189, 95, 2, 477, 478, + 5, 85, 43, 2, 478, 479, 5, 169, 85, 2, 479, 480, 5, 193, 97, 2, 480, 481, + 5, 187, 94, 2, 481, 482, 5, 183, 92, 2, 482, 483, 5, 85, 43, 2, 483, 484, + 5, 205, 103, 2, 484, 485, 5, 85, 43, 2, 485, 486, 5, 197, 99, 2, 486, 487, + 5, 187, 94, 2, 487, 488, 5, 85, 43, 2, 488, 489, 5, 207, 104, 2, 489, 134, + 3, 2, 2, 2, 490, 491, 5, 183, 92, 2, 491, 492, 5, 159, 80, 2, 492, 493, + 5, 195, 98, 2, 493, 494, 5, 179, 90, 2, 494, 495, 5, 85, 43, 2, 495, 496, + 5, 169, 85, 2, 496, 497, 5, 175, 88, 2, 497, 498, 5, 193, 97, 2, 498, 499, + 5, 195, 98, 2, 499, 500, 5, 197, 99, 2, 500, 501, 5, 85, 43, 2, 501, 502, + 5, 185, 93, 2, 502, 503, 5, 85, 43, 2, 503, 504, 5, 181, 91, 2, 504, 505, + 5, 159, 80, 2, 505, 506, 5, 195, 98, 2, 506, 507, 5, 197, 99, 2, 507, 508, + 5, 85, 43, 2, 508, 509, 5, 183, 92, 2, 509, 136, 3, 2, 2, 2, 510, 511, + 5, 183, 92, 2, 511, 512, 5, 159, 80, 2, 512, 513, 5, 195, 98, 2, 513, 514, + 5, 179, 90, 2, 514, 515, 5, 85, 43, 2, 515, 516, 5, 169, 85, 2, 516, 517, + 5, 193, 97, 2, 517, 518, 5, 187, 94, 2, 518, 519, 5, 183, 92, 2, 519, 520, + 5, 85, 43, 2, 520, 521, 5, 205, 103, 2, 521, 522, 5, 85, 43, 2, 522, 523, + 5, 197, 99, 2, 523, 524, 5, 187, 94, 2, 524, 525, 5, 85, 43, 2, 525, 526, + 5, 207, 104, 2, 526, 138, 3, 2, 2, 2, 527, 528, 5, 183, 92, 2, 528, 529, + 5, 159, 80, 2, 529, 530, 5, 195, 98, 2, 530, 531, 5, 179, 90, 2, 531, 532, + 5, 85, 43, 2, 532, 533, 5, 161, 81, 2, 533, 534, 5, 167, 84, 2, 534, 535, + 5, 169, 85, 2, 535, 536, 5, 187, 94, 2, 536, 537, 5, 193, 97, 2, 537, 538, + 5, 167, 84, 2, 538, 539, 5, 85, 43, 2, 539, 540, 5, 195, 98, 2, 540, 541, + 5, 189, 95, 2, 541, 542, 5, 167, 84, 2, 542, 543, 5, 163, 82, 2, 543, 544, + 5, 175, 88, 2, 544, 545, 5, 159, 80, 2, 545, 546, 5, 181, 91, 2, 546, 547, + 5, 85, 43, 2, 547, 548, 5, 163, 82, 2, 548, 549, 5, 173, 87, 2, 549, 550, + 5, 159, 80, 2, 550, 551, 5, 193, 97, 2, 551, 552, 5, 195, 98, 2, 552, 140, + 3, 2, 2, 2, 553, 554, 5, 183, 92, 2, 554, 555, 5, 159, 80, 2, 555, 556, + 5, 195, 98, 2, 556, 557, 5, 179, 90, 2, 557, 558, 5, 85, 43, 2, 558, 559, + 5, 159, 80, 2, 559, 560, 5, 169, 85, 2, 560, 561, 5, 197, 99, 2, 561, 562, + 5, 167, 84, 2, 562, 563, 5, 193, 97, 2, 563, 564, 5, 85, 43, 2, 564, 565, + 5, 195, 98, 2, 565, 566, 5, 189, 95, 2, 566, 567, 5, 167, 84, 2, 567, 568, + 5, 163, 82, 2, 568, 569, 5, 175, 88, 2, 569, 570, 5, 159, 80, 2, 570, 571, + 5, 181, 91, 2, 571, 572, 5, 85, 43, 2, 572, 573, 5, 163, 82, 2, 573, 574, + 5, 173, 87, 2, 574, 575, 5, 159, 80, 2, 575, 576, 5, 193, 97, 2, 576, 577, + 5, 195, 98, 2, 577, 142, 3, 2, 2, 2, 578, 579, 5, 189, 95, 2, 579, 580, + 5, 167, 84, 2, 580, 581, 5, 193, 97, 2, 581, 582, 5, 195, 98, 2, 582, 583, + 5, 187, 94, 2, 583, 584, 5, 185, 93, 2, 584, 585, 5, 159, 80, 2, 585, 586, + 5, 181, 91, 2, 586, 587, 5, 85, 43, 2, 587, 588, 5, 175, 88, 2, 588, 589, + 5, 165, 83, 2, 589, 590, 5, 167, 84, 2, 590, 591, 5, 185, 93, 2, 591, 592, + 5, 197, 99, 2, 592, 593, 5, 175, 88, 2, 593, 594, 5, 197, 99, 2, 594, 595, + 5, 207, 104, 2, 595, 596, 5, 85, 43, 2, 596, 597, 5, 185, 93, 2, 597, 598, + 5, 199, 100, 2, 598, 599, 5, 183, 92, 2, 599, 600, 5, 161, 81, 2, 600, + 601, 5, 167, 84, 2, 601, 602, 5, 193, 97, 2, 602, 603, 5, 85, 43, 2, 603, + 604, 5, 193, 97, 2, 604, 605, 5, 159, 80, 2, 605, 606, 5, 185, 93, 2, 606, + 607, 5, 165, 83, 2, 607, 608, 5, 187, 94, 2, 608, 609, 5, 183, 92, 2, 609, + 610, 5, 85, 43, 2, 610, 611, 5, 193, 97, 2, 611, 612, 5, 167, 84, 2, 612, + 613, 5, 189, 95, 2, 613, 614, 5, 181, 91, 2, 614, 615, 5, 159, 80, 2, 615, + 616, 5, 163, 82, 2, 616, 617, 5, 167, 84, 2, 617, 144, 3, 2, 2, 2, 618, + 619, 5, 183, 92, 2, 619, 620, 5, 175, 88, 2, 620, 621, 5, 181, 91, 2, 621, + 622, 5, 175, 88, 2, 622, 623, 5, 197, 99, 2, 623, 624, 5, 159, 80, 2, 624, + 625, 5, 193, 97, 2, 625, 626, 5, 207, 104, 2, 626, 627, 5, 85, 43, 2, 627, + 628, 5, 175, 88, 2, 628, 629, 5, 165, 83, 2, 629, 630, 5, 167, 84, 2, 630, + 631, 5, 185, 93, 2, 631, 632, 5, 197, 99, 2, 632, 633, 5, 175, 88, 2, 633, + 634, 5, 197, 99, 2, 634, 635, 5, 207, 104, 2, 635, 636, 5, 85, 43, 2, 636, + 637, 5, 185, 93, 2, 637, 638, 5, 199, 100, 2, 638, 639, 5, 183, 92, 2, + 639, 640, 5, 161, 81, 2, 640, 641, 5, 167, 84, 2, 641, 642, 5, 193, 97, + 2, 642, 643, 5, 85, 43, 2, 643, 644, 5, 193, 97, 2, 644, 645, 5, 159, 80, + 2, 645, 646, 5, 185, 93, 2, 646, 647, 5, 165, 83, 2, 647, 648, 5, 187, + 94, 2, 648, 649, 5, 183, 92, 2, 649, 650, 5, 85, 43, 2, 650, 651, 5, 193, + 97, 2, 651, 652, 5, 167, 84, 2, 652, 653, 5, 189, 95, 2, 653, 654, 5, 181, + 91, 2, 654, 655, 5, 159, 80, 2, 655, 656, 5, 163, 82, 2, 656, 657, 5, 167, + 84, 2, 657, 146, 3, 2, 2, 2, 658, 659, 5, 181, 91, 2, 659, 660, 5, 159, + 80, 2, 660, 661, 5, 185, 93, 2, 661, 662, 5, 165, 83, 2, 662, 663, 5, 181, + 91, 2, 663, 664, 5, 175, 88, 2, 664, 665, 5, 185, 93, 2, 665, 666, 5, 167, + 84, 2, 666, 667, 5, 85, 43, 2, 667, 668, 5, 185, 93, 2, 668, 669, 5, 199, + 100, 2, 669, 670, 5, 183, 92, 2, 670, 671, 5, 161, 81, 2, 671, 672, 5, + 167, 84, 2, 672, 673, 5, 193, 97, 2, 673, 674, 5, 85, 43, 2, 674, 675, + 5, 193, 97, 2, 675, 676, 5, 159, 80, 2, 676, 677, 5, 185, 93, 2, 677, 678, + 5, 165, 83, 2, 678, 679, 5, 187, 94, 2, 679, 680, 5, 183, 92, 2, 680, 681, + 5, 85, 43, 2, 681, 682, 5, 193, 97, 2, 682, 683, 5, 167, 84, 2, 683, 684, + 5, 189, 95, 2, 684, 685, 5, 181, 91, 2, 685, 686, 5, 159, 80, 2, 686, 687, + 5, 163, 82, 2, 687, 688, 5, 167, 84, 2, 688, 148, 3, 2, 2, 2, 689, 690, + 5, 197, 99, 2, 690, 691, 5, 167, 84, 2, 691, 692, 5, 181, 91, 2, 692, 693, + 5, 167, 84, 2, 693, 694, 5, 189, 95, 2, 694, 695, 5, 173, 87, 2, 695, 696, + 5, 187, 94, 2, 696, 697, 5, 185, 93, 2, 697, 698, 5, 167, 84, 2, 698, 699, + 5, 85, 43, 2, 699, 700, 5, 193, 97, 2, 700, 701, 5, 159, 80, 2, 701, 702, + 5, 185, 93, 2, 702, 703, 5, 165, 83, 2, 703, 704, 5, 187, 94, 2, 704, 705, + 5, 183, 92, 2, 705, 706, 5, 85, 43, 2, 706, 707, 5, 193, 97, 2, 707, 708, + 5, 167, 84, 2, 708, 709, 5, 189, 95, 2, 709, 710, 5, 181, 91, 2, 710, 711, + 5, 159, 80, 2, 711, 712, 5, 163, 82, 2, 712, 713, 5, 167, 84, 2, 713, 150, + 3, 2, 2, 2, 714, 715, 5, 199, 100, 2, 715, 716, 5, 185, 93, 2, 716, 717, + 5, 175, 88, 2, 717, 718, 5, 169, 85, 2, 718, 719, 5, 175, 88, 2, 719, 720, + 5, 167, 84, 2, 720, 721, 5, 165, 83, 2, 721, 722, 5, 85, 43, 2, 722, 723, + 5, 163, 82, 2, 723, 724, 5, 193, 97, 2, 724, 725, 5, 167, 84, 2, 725, 726, + 5, 165, 83, 2, 726, 727, 5, 175, 88, 2, 727, 728, 5, 197, 99, 2, 728, 729, + 5, 85, 43, 2, 729, 730, 5, 163, 82, 2, 730, 731, 5, 187, 94, 2, 731, 732, + 5, 165, 83, 2, 732, 733, 5, 167, 84, 2, 733, 734, 5, 85, 43, 2, 734, 735, + 5, 193, 97, 2, 735, 736, 5, 159, 80, 2, 736, 737, 5, 185, 93, 2, 737, 738, + 5, 165, 83, 2, 738, 739, 5, 187, 94, 2, 739, 740, 5, 183, 92, 2, 740, 741, + 5, 85, 43, 2, 741, 742, 5, 193, 97, 2, 742, 743, 5, 167, 84, 2, 743, 744, + 5, 189, 95, 2, 744, 745, 5, 181, 91, 2, 745, 746, 5, 159, 80, 2, 746, 747, + 5, 163, 82, 2, 747, 748, 5, 167, 84, 2, 748, 152, 3, 2, 2, 2, 749, 750, + 5, 171, 86, 2, 750, 751, 5, 167, 84, 2, 751, 752, 5, 185, 93, 2, 752, 753, + 5, 167, 84, 2, 753, 754, 5, 193, 97, 2, 754, 755, 5, 175, 88, 2, 755, 756, + 5, 163, 82, 2, 756, 757, 5, 85, 43, 2, 757, 758, 5, 197, 99, 2, 758, 759, + 5, 159, 80, 2, 759, 760, 5, 161, 81, 2, 760, 761, 5, 181, 91, 2, 761, 762, + 5, 167, 84, 2, 762, 763, 5, 85, 43, 2, 763, 764, 5, 193, 97, 2, 764, 765, + 5, 159, 80, 2, 765, 766, 5, 185, 93, 2, 766, 767, 5, 165, 83, 2, 767, 768, + 5, 187, 94, 2, 768, 769, 5, 183, 92, 2, 769, 770, 5, 85, 43, 2, 770, 771, + 5, 193, 97, 2, 771, 772, 5, 167, 84, 2, 772, 773, 5, 189, 95, 2, 773, 774, + 5, 181, 91, 2, 774, 775, 5, 159, 80, 2, 775, 776, 5, 163, 82, 2, 776, 777, + 5, 167, 84, 2, 777, 154, 3, 2, 2, 2, 778, 779, 5, 159, 80, 2, 779, 780, + 5, 165, 83, 2, 780, 781, 5, 165, 83, 2, 781, 782, 5, 193, 97, 2, 782, 783, + 5, 167, 84, 2, 783, 784, 5, 195, 98, 2, 784, 785, 5, 195, 98, 2, 785, 786, + 5, 85, 43, 2, 786, 787, 5, 193, 97, 2, 787, 788, 5, 159, 80, 2, 788, 789, + 5, 185, 93, 2, 789, 790, 5, 165, 83, 2, 790, 791, 5, 187, 94, 2, 791, 792, + 5, 183, 92, 2, 792, 793, 5, 85, 43, 2, 793, 794, 5, 193, 97, 2, 794, 795, + 5, 167, 84, 2, 795, 796, 5, 189, 95, 2, 796, 797, 5, 181, 91, 2, 797, 798, + 5, 159, 80, 2, 798, 799, 5, 163, 82, 2, 799, 800, 5, 167, 84, 2, 800, 156, + 3, 2, 2, 2, 801, 802, 7, 70, 2, 2, 802, 803, 7, 81, 2, 2, 803, 804, 7, + 34, 2, 2, 804, 805, 7, 80, 2, 2, 805, 806, 7, 81, 2, 2, 806, 807, 7, 86, + 2, 2, 807, 808, 7, 34, 2, 2, 808, 809, 7, 79, 2, 2, 809, 810, 7, 67, 2, + 2, 810, 811, 7, 86, 2, 2, 811, 812, 7, 69, 2, 2, 812, 813, 7, 74, 2, 2, + 813, 814, 7, 34, 2, 2, 814, 815, 7, 67, 2, 2, 815, 816, 7, 80, 2, 2, 816, + 817, 7, 91, 2, 2, 817, 818, 7, 34, 2, 2, 818, 819, 7, 86, 2, 2, 819, 820, + 7, 74, 2, 2, 820, 821, 7, 75, 2, 2, 821, 822, 7, 80, 2, 2, 822, 823, 7, + 73, 2, 2, 823, 824, 7, 46, 2, 2, 824, 825, 7, 34, 2, 2, 825, 826, 7, 76, + 2, 2, 826, 827, 7, 87, 2, 2, 827, 828, 7, 85, 2, 2, 828, 829, 7, 86, 2, + 2, 829, 830, 7, 34, 2, 2, 830, 831, 7, 72, 2, 2, 831, 832, 7, 81, 2, 2, + 832, 833, 7, 84, 2, 2, 833, 834, 7, 34, 2, 2, 834, 835, 7, 73, 2, 2, 835, + 836, 7, 71, 2, 2, 836, 837, 7, 80, 2, 2, 837, 838, 7, 71, 2, 2, 838, 839, + 7, 84, 2, 2, 839, 840, 7, 67, 2, 2, 840, 841, 7, 86, 2, 2, 841, 842, 7, + 81, 2, 2, 842, 843, 7, 84, 2, 2, 843, 158, 3, 2, 2, 2, 844, 845, 9, 4, + 2, 2, 845, 160, 3, 2, 2, 2, 846, 847, 9, 5, 2, 2, 847, 162, 3, 2, 2, 2, + 848, 849, 9, 6, 2, 2, 849, 164, 3, 2, 2, 2, 850, 851, 9, 7, 2, 2, 851, + 166, 3, 2, 2, 2, 852, 853, 9, 8, 2, 2, 853, 168, 3, 2, 2, 2, 854, 855, + 9, 9, 2, 2, 855, 170, 3, 2, 2, 2, 856, 857, 9, 10, 2, 2, 857, 172, 3, 2, + 2, 2, 858, 859, 9, 11, 2, 2, 859, 174, 3, 2, 2, 2, 860, 861, 9, 12, 2, + 2, 861, 176, 3, 2, 2, 2, 862, 863, 9, 13, 2, 2, 863, 178, 3, 2, 2, 2, 864, + 865, 9, 14, 2, 2, 865, 180, 3, 2, 2, 2, 866, 867, 9, 15, 2, 2, 867, 182, + 3, 2, 2, 2, 868, 869, 9, 16, 2, 2, 869, 184, 3, 2, 2, 2, 870, 871, 9, 17, + 2, 2, 871, 186, 3, 2, 2, 2, 872, 873, 9, 18, 2, 2, 873, 188, 3, 2, 2, 2, + 874, 875, 9, 19, 2, 2, 875, 190, 3, 2, 2, 2, 876, 877, 9, 20, 2, 2, 877, + 192, 3, 2, 2, 2, 878, 879, 9, 21, 2, 2, 879, 194, 3, 2, 2, 2, 880, 881, + 9, 22, 2, 2, 881, 196, 3, 2, 2, 2, 882, 883, 9, 23, 2, 2, 883, 198, 3, + 2, 2, 2, 884, 885, 9, 24, 2, 2, 885, 200, 3, 2, 2, 2, 886, 887, 9, 25, + 2, 2, 887, 202, 3, 2, 2, 2, 888, 889, 9, 26, 2, 2, 889, 204, 3, 2, 2, 2, + 890, 891, 9, 27, 2, 2, 891, 206, 3, 2, 2, 2, 892, 893, 9, 28, 2, 2, 893, + 208, 3, 2, 2, 2, 894, 895, 9, 29, 2, 2, 895, 210, 3, 2, 2, 2, 896, 898, + 9, 30, 2, 2, 897, 896, 3, 2, 2, 2, 898, 901, 3, 2, 2, 2, 899, 900, 3, 2, + 2, 2, 899, 897, 3, 2, 2, 2, 900, 903, 3, 2, 2, 2, 901, 899, 3, 2, 2, 2, + 902, 904, 9, 31, 2, 2, 903, 902, 3, 2, 2, 2, 904, 905, 3, 2, 2, 2, 905, + 906, 3, 2, 2, 2, 905, 903, 3, 2, 2, 2, 906, 910, 3, 2, 2, 2, 907, 909, + 9, 30, 2, 2, 908, 907, 3, 2, 2, 2, 909, 912, 3, 2, 2, 2, 910, 908, 3, 2, + 2, 2, 910, 911, 3, 2, 2, 2, 911, 922, 3, 2, 2, 2, 912, 910, 3, 2, 2, 2, + 913, 915, 5, 75, 38, 2, 914, 916, 10, 32, 2, 2, 915, 914, 3, 2, 2, 2, 916, + 917, 3, 2, 2, 2, 917, 915, 3, 2, 2, 2, 917, 918, 3, 2, 2, 2, 918, 919, + 3, 2, 2, 2, 919, 920, 5, 75, 38, 2, 920, 922, 3, 2, 2, 2, 921, 899, 3, + 2, 2, 2, 921, 913, 3, 2, 2, 2, 922, 212, 3, 2, 2, 2, 923, 931, 5, 71, 36, + 2, 924, 925, 7, 94, 2, 2, 925, 930, 11, 2, 2, 2, 926, 927, 7, 36, 2, 2, + 927, 930, 7, 36, 2, 2, 928, 930, 10, 33, 2, 2, 929, 924, 3, 2, 2, 2, 929, + 926, 3, 2, 2, 2, 929, 928, 3, 2, 2, 2, 930, 933, 3, 2, 2, 2, 931, 929, + 3, 2, 2, 2, 931, 932, 3, 2, 2, 2, 932, 934, 3, 2, 2, 2, 933, 931, 3, 2, + 2, 2, 934, 935, 5, 71, 36, 2, 935, 950, 3, 2, 2, 2, 936, 944, 5, 73, 37, + 2, 937, 938, 7, 94, 2, 2, 938, 943, 11, 2, 2, 2, 939, 940, 7, 41, 2, 2, + 940, 943, 7, 41, 2, 2, 941, 943, 10, 34, 2, 2, 942, 937, 3, 2, 2, 2, 942, + 939, 3, 2, 2, 2, 942, 941, 3, 2, 2, 2, 943, 946, 3, 2, 2, 2, 944, 942, + 3, 2, 2, 2, 944, 945, 3, 2, 2, 2, 945, 947, 3, 2, 2, 2, 946, 944, 3, 2, + 2, 2, 947, 948, 5, 73, 37, 2, 948, 950, 3, 2, 2, 2, 949, 923, 3, 2, 2, + 2, 949, 936, 3, 2, 2, 2, 950, 214, 3, 2, 2, 2, 951, 953, 9, 35, 2, 2, 952, + 951, 3, 2, 2, 2, 953, 954, 3, 2, 2, 2, 954, 952, 3, 2, 2, 2, 954, 955, + 3, 2, 2, 2, 955, 216, 3, 2, 2, 2, 956, 957, 9, 36, 2, 2, 957, 218, 3, 2, + 2, 2, 958, 960, 5, 215, 108, 2, 959, 958, 3, 2, 2, 2, 959, 960, 3, 2, 2, + 2, 960, 962, 3, 2, 2, 2, 961, 963, 5, 35, 18, 2, 962, 961, 3, 2, 2, 2, + 962, 963, 3, 2, 2, 2, 963, 964, 3, 2, 2, 2, 964, 972, 5, 215, 108, 2, 965, + 968, 5, 167, 84, 2, 966, 969, 5, 25, 13, 2, 967, 969, 5, 27, 14, 2, 968, + 966, 3, 2, 2, 2, 968, 967, 3, 2, 2, 2, 968, 969, 3, 2, 2, 2, 969, 970, + 3, 2, 2, 2, 970, 971, 5, 215, 108, 2, 971, 973, 3, 2, 2, 2, 972, 965, 3, + 2, 2, 2, 972, 973, 3, 2, 2, 2, 973, 220, 3, 2, 2, 2, 974, 975, 7, 50, 2, + 2, 975, 976, 7, 122, 2, 2, 976, 978, 3, 2, 2, 2, 977, 979, 5, 217, 109, + 2, 978, 977, 3, 2, 2, 2, 979, 980, 3, 2, 2, 2, 980, 978, 3, 2, 2, 2, 980, + 981, 3, 2, 2, 2, 981, 992, 3, 2, 2, 2, 982, 983, 7, 90, 2, 2, 983, 985, + 5, 73, 37, 2, 984, 986, 5, 217, 109, 2, 985, 984, 3, 2, 2, 2, 986, 987, + 3, 2, 2, 2, 987, 985, 3, 2, 2, 2, 987, 988, 3, 2, 2, 2, 988, 989, 3, 2, + 2, 2, 989, 990, 5, 73, 37, 2, 990, 992, 3, 2, 2, 2, 991, 974, 3, 2, 2, + 2, 991, 982, 3, 2, 2, 2, 992, 222, 3, 2, 2, 2, 993, 994, 7, 50, 2, 2, 994, + 995, 7, 100, 2, 2, 995, 997, 3, 2, 2, 2, 996, 998, 4, 50, 51, 2, 997, 996, + 3, 2, 2, 2, 998, 999, 3, 2, 2, 2, 999, 997, 3, 2, 2, 2, 999, 1000, 3, 2, + 2, 2, 1000, 1011, 3, 2, 2, 2, 1001, 1002, 5, 161, 81, 2, 1002, 1004, 5, + 73, 37, 2, 1003, 1005, 4, 50, 51, 2, 1004, 1003, 3, 2, 2, 2, 1005, 1006, + 3, 2, 2, 2, 1006, 1004, 3, 2, 2, 2, 1006, 1007, 3, 2, 2, 2, 1007, 1008, + 3, 2, 2, 2, 1008, 1009, 5, 73, 37, 2, 1009, 1011, 3, 2, 2, 2, 1010, 993, + 3, 2, 2, 2, 1010, 1001, 3, 2, 2, 2, 1011, 224, 3, 2, 2, 2, 26, 2, 279, + 328, 899, 905, 910, 917, 921, 929, 931, 942, 944, 949, 954, 959, 962, 968, + 972, 980, 987, 991, 999, 1006, 1010, 3, 8, 2, 2, +} + +var lexerDeserializer = antlr.NewATNDeserializer(nil) +var lexerAtn = lexerDeserializer.DeserializeFromUInt16(serializedLexerAtn) + +var lexerChannelNames = []string{ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", +} + +var lexerModeNames = []string{ + "DEFAULT_MODE", +} + +var lexerLiteralNames = []string{ + "", "'&&'", "'||'", "'!'", "'~'", "'|'", "'&'", "'<<'", "'>>'", "'^'", + "'%'", "':'", "'+'", "'-'", "'*'", "'/'", "'\\'", "'.'", "'.*'", "'<=>'", + "'=='", "'='", "", "'>'", "'>='", "'<'", "'<='", "'#'", "'('", "')'", "'{'", + "'}'", "'['", "']'", "','", "'\"'", "'''", "'`'", "'?'", "'@'", "';'", + "'->>'", "'_'", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "'DO NOT MATCH ANY THING, JUST FOR GENERATOR'", +} + +var lexerSymbolicNames = []string{ + "", "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "TRUE", "FALSE", "CREATE", "ALTER", "DROP", + "SHOW", "RULE", "FROM", "MASK", "TYPE", "NAME", "PROPERTIES", "COLUMN", + "RULES", "TABLE", "COLUMNS", "IF", "EXISTS", "COUNT", "NOT", "MD5", "KEEP_FIRST_N_LAST_M", + "KEEP_FROM_X_TO_Y", "MASK_FIRST_N_LAST_M", "MASK_FROM_X_TO_Y", "MASK_BEFORE_SPECIAL_CHARS", + "MASK_AFTER_SPECIAL_CHARS", "PERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE", + "MILITARY_IDENTITY_NUMBER_RANDOM_REPLACE", "LANDLINE_NUMBER_RANDOM_REPLACE", + "TELEPHONE_RANDOM_REPLACE", "UNIFIED_CREDIT_CODE_RANDOM_REPLACE", "GENERIC_TABLE_RANDOM_REPLACE", + "ADDRESS_RANDOM_REPLACE", "FOR_GENERATOR", "IDENTIFIER_", "STRING_", "INT_", + "HEX_", "NUMBER_", "HEXDIGIT_", "BITNUM_", +} + +var lexerRuleNames = []string{ + "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "TRUE", "FALSE", "CREATE", "ALTER", "DROP", + "SHOW", "RULE", "FROM", "MASK", "TYPE", "NAME", "PROPERTIES", "COLUMN", + "RULES", "TABLE", "COLUMNS", "IF", "EXISTS", "COUNT", "NOT", "MD5", "KEEP_FIRST_N_LAST_M", + "KEEP_FROM_X_TO_Y", "MASK_FIRST_N_LAST_M", "MASK_FROM_X_TO_Y", "MASK_BEFORE_SPECIAL_CHARS", + "MASK_AFTER_SPECIAL_CHARS", "PERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE", + "MILITARY_IDENTITY_NUMBER_RANDOM_REPLACE", "LANDLINE_NUMBER_RANDOM_REPLACE", + "TELEPHONE_RANDOM_REPLACE", "UNIFIED_CREDIT_CODE_RANDOM_REPLACE", "GENERIC_TABLE_RANDOM_REPLACE", + "ADDRESS_RANDOM_REPLACE", "FOR_GENERATOR", "A", "B", "C", "D", "E", "F", + "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", + "V", "W", "X", "Y", "Z", "IDENTIFIER_", "STRING_", "INT_", "HEX_", "NUMBER_", + "HEXDIGIT_", "BITNUM_", +} + +type RDLStatementLexer struct { + *antlr.BaseLexer + channelNames []string + modeNames []string + // TODO: EOF string +} + +var lexerDecisionToDFA = make([]*antlr.DFA, len(lexerAtn.DecisionToState)) + +func init() { + for index, ds := range lexerAtn.DecisionToState { + lexerDecisionToDFA[index] = antlr.NewDFA(ds, index) + } +} + +func NewRDLStatementLexer(input antlr.CharStream) *RDLStatementLexer { + + l := new(RDLStatementLexer) + + l.BaseLexer = antlr.NewBaseLexer(input) + l.Interpreter = antlr.NewLexerATNSimulator(l, lexerAtn, lexerDecisionToDFA, antlr.NewPredictionContextCache()) + + l.channelNames = lexerChannelNames + l.modeNames = lexerModeNames + l.RuleNames = lexerRuleNames + l.LiteralNames = lexerLiteralNames + l.SymbolicNames = lexerSymbolicNames + l.GrammarFileName = "RDLStatement.g4" + // TODO: l.EOF = antlr.TokenEOF + + return l +} + +// RDLStatementLexer tokens. +const ( + RDLStatementLexerAND_ = 1 + RDLStatementLexerOR_ = 2 + RDLStatementLexerNOT_ = 3 + RDLStatementLexerTILDE_ = 4 + RDLStatementLexerVERTICALBAR_ = 5 + RDLStatementLexerAMPERSAND_ = 6 + RDLStatementLexerSIGNEDLEFTSHIFT_ = 7 + RDLStatementLexerSIGNEDRIGHTSHIFT_ = 8 + RDLStatementLexerCARET_ = 9 + RDLStatementLexerMOD_ = 10 + RDLStatementLexerCOLON_ = 11 + RDLStatementLexerPLUS_ = 12 + RDLStatementLexerMINUS_ = 13 + RDLStatementLexerASTERISK_ = 14 + RDLStatementLexerSLASH_ = 15 + RDLStatementLexerBACKSLASH_ = 16 + RDLStatementLexerDOT_ = 17 + RDLStatementLexerDOTASTERISK_ = 18 + RDLStatementLexerSAFEEQ_ = 19 + RDLStatementLexerDEQ_ = 20 + RDLStatementLexerEQ_ = 21 + RDLStatementLexerNEQ_ = 22 + RDLStatementLexerGT_ = 23 + RDLStatementLexerGTE_ = 24 + RDLStatementLexerLT_ = 25 + RDLStatementLexerLTE_ = 26 + RDLStatementLexerPOUND_ = 27 + RDLStatementLexerLP_ = 28 + RDLStatementLexerRP_ = 29 + RDLStatementLexerLBE_ = 30 + RDLStatementLexerRBE_ = 31 + RDLStatementLexerLBT_ = 32 + RDLStatementLexerRBT_ = 33 + RDLStatementLexerCOMMA_ = 34 + RDLStatementLexerDQ_ = 35 + RDLStatementLexerSQ_ = 36 + RDLStatementLexerBQ_ = 37 + RDLStatementLexerQUESTION_ = 38 + RDLStatementLexerAT_ = 39 + RDLStatementLexerSEMI_ = 40 + RDLStatementLexerJSONSEPARATOR_ = 41 + RDLStatementLexerUL_ = 42 + RDLStatementLexerWS = 43 + RDLStatementLexerTRUE = 44 + RDLStatementLexerFALSE = 45 + RDLStatementLexerCREATE = 46 + RDLStatementLexerALTER = 47 + RDLStatementLexerDROP = 48 + RDLStatementLexerSHOW = 49 + RDLStatementLexerRULE = 50 + RDLStatementLexerFROM = 51 + RDLStatementLexerMASK = 52 + RDLStatementLexerTYPE = 53 + RDLStatementLexerNAME = 54 + RDLStatementLexerPROPERTIES = 55 + RDLStatementLexerCOLUMN = 56 + RDLStatementLexerRULES = 57 + RDLStatementLexerTABLE = 58 + RDLStatementLexerCOLUMNS = 59 + RDLStatementLexerIF = 60 + RDLStatementLexerEXISTS = 61 + RDLStatementLexerCOUNT = 62 + RDLStatementLexerNOT = 63 + RDLStatementLexerMD5 = 64 + RDLStatementLexerKEEP_FIRST_N_LAST_M = 65 + RDLStatementLexerKEEP_FROM_X_TO_Y = 66 + RDLStatementLexerMASK_FIRST_N_LAST_M = 67 + RDLStatementLexerMASK_FROM_X_TO_Y = 68 + RDLStatementLexerMASK_BEFORE_SPECIAL_CHARS = 69 + RDLStatementLexerMASK_AFTER_SPECIAL_CHARS = 70 + RDLStatementLexerPERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE = 71 + RDLStatementLexerMILITARY_IDENTITY_NUMBER_RANDOM_REPLACE = 72 + RDLStatementLexerLANDLINE_NUMBER_RANDOM_REPLACE = 73 + RDLStatementLexerTELEPHONE_RANDOM_REPLACE = 74 + RDLStatementLexerUNIFIED_CREDIT_CODE_RANDOM_REPLACE = 75 + RDLStatementLexerGENERIC_TABLE_RANDOM_REPLACE = 76 + RDLStatementLexerADDRESS_RANDOM_REPLACE = 77 + RDLStatementLexerFOR_GENERATOR = 78 + RDLStatementLexerIDENTIFIER_ = 79 + RDLStatementLexerSTRING_ = 80 + RDLStatementLexerINT_ = 81 + RDLStatementLexerHEX_ = 82 + RDLStatementLexerNUMBER_ = 83 + RDLStatementLexerHEXDIGIT_ = 84 + RDLStatementLexerBITNUM_ = 85 +) diff --git a/shardingsphere-operator/pkg/distsql/visitor_parser/mask/rdlstatement_parser.go b/shardingsphere-operator/pkg/distsql/visitor_parser/mask/rdlstatement_parser.go new file mode 100644 index 00000000..a423119d --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/visitor_parser/mask/rdlstatement_parser.go @@ -0,0 +1,2528 @@ +// Code generated from RDLStatement.g4 by ANTLR 4.8. DO NOT EDIT. + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package parser // RDLStatement + +import ( + "fmt" + "reflect" + "strconv" + + "github.com/antlr/antlr4/runtime/Go/antlr" +) + +// Suppress unused import errors +var _ = fmt.Printf +var _ = reflect.Copy +var _ = strconv.Itoa + +var parserATN = []uint16{ + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 87, 162, + 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, + 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, + 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 3, 2, 3, + 2, 3, 2, 5, 2, 38, 10, 2, 3, 2, 3, 2, 5, 2, 42, 10, 2, 3, 2, 3, 2, 3, 2, + 7, 2, 47, 10, 2, 12, 2, 14, 2, 50, 11, 2, 3, 3, 3, 3, 3, 3, 5, 3, 55, 10, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 61, 10, 3, 12, 3, 14, 3, 64, 11, 3, 3, + 4, 3, 4, 3, 4, 5, 4, 69, 10, 4, 3, 4, 3, 4, 5, 4, 73, 10, 4, 3, 4, 3, 4, + 3, 4, 7, 4, 78, 10, 4, 12, 4, 14, 4, 81, 11, 4, 3, 5, 3, 5, 3, 5, 3, 5, + 3, 5, 3, 5, 3, 5, 7, 5, 90, 10, 5, 12, 5, 14, 5, 93, 11, 5, 3, 5, 3, 5, + 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, + 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 5, 10, 117, 10, 10, 3, + 10, 3, 10, 3, 10, 5, 10, 122, 10, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, + 3, 11, 3, 11, 5, 11, 131, 10, 11, 3, 11, 3, 11, 3, 12, 3, 12, 5, 12, 137, + 10, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 5, 14, 144, 10, 14, 3, 14, 3, + 14, 3, 15, 3, 15, 3, 15, 7, 15, 151, 10, 15, 12, 15, 14, 15, 154, 11, 15, + 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 2, 2, 18, 2, 4, 6, 8, + 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 2, 3, 3, 2, 66, 78, 2, + 162, 2, 34, 3, 2, 2, 2, 4, 51, 3, 2, 2, 2, 6, 65, 3, 2, 2, 2, 8, 82, 3, + 2, 2, 2, 10, 97, 3, 2, 2, 2, 12, 105, 3, 2, 2, 2, 14, 107, 3, 2, 2, 2, + 16, 110, 3, 2, 2, 2, 18, 121, 3, 2, 2, 2, 20, 123, 3, 2, 2, 2, 22, 136, + 3, 2, 2, 2, 24, 138, 3, 2, 2, 2, 26, 140, 3, 2, 2, 2, 28, 147, 3, 2, 2, + 2, 30, 155, 3, 2, 2, 2, 32, 159, 3, 2, 2, 2, 34, 35, 7, 48, 2, 2, 35, 37, + 7, 54, 2, 2, 36, 38, 7, 60, 2, 2, 37, 36, 3, 2, 2, 2, 37, 38, 3, 2, 2, + 2, 38, 39, 3, 2, 2, 2, 39, 41, 7, 52, 2, 2, 40, 42, 5, 16, 9, 2, 41, 40, + 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 43, 3, 2, 2, 2, 43, 48, 5, 8, 5, 2, + 44, 45, 7, 36, 2, 2, 45, 47, 5, 8, 5, 2, 46, 44, 3, 2, 2, 2, 47, 50, 3, + 2, 2, 2, 48, 46, 3, 2, 2, 2, 48, 49, 3, 2, 2, 2, 49, 3, 3, 2, 2, 2, 50, + 48, 3, 2, 2, 2, 51, 52, 7, 49, 2, 2, 52, 54, 7, 54, 2, 2, 53, 55, 7, 60, + 2, 2, 54, 53, 3, 2, 2, 2, 54, 55, 3, 2, 2, 2, 55, 56, 3, 2, 2, 2, 56, 57, + 7, 52, 2, 2, 57, 62, 5, 8, 5, 2, 58, 59, 7, 36, 2, 2, 59, 61, 5, 8, 5, + 2, 60, 58, 3, 2, 2, 2, 61, 64, 3, 2, 2, 2, 62, 60, 3, 2, 2, 2, 62, 63, + 3, 2, 2, 2, 63, 5, 3, 2, 2, 2, 64, 62, 3, 2, 2, 2, 65, 66, 7, 50, 2, 2, + 66, 68, 7, 54, 2, 2, 67, 69, 7, 60, 2, 2, 68, 67, 3, 2, 2, 2, 68, 69, 3, + 2, 2, 2, 69, 70, 3, 2, 2, 2, 70, 72, 7, 52, 2, 2, 71, 73, 5, 14, 8, 2, + 72, 71, 3, 2, 2, 2, 72, 73, 3, 2, 2, 2, 73, 74, 3, 2, 2, 2, 74, 79, 5, + 32, 17, 2, 75, 76, 7, 36, 2, 2, 76, 78, 5, 32, 17, 2, 77, 75, 3, 2, 2, + 2, 78, 81, 3, 2, 2, 2, 79, 77, 3, 2, 2, 2, 79, 80, 3, 2, 2, 2, 80, 7, 3, + 2, 2, 2, 81, 79, 3, 2, 2, 2, 82, 83, 5, 32, 17, 2, 83, 84, 7, 30, 2, 2, + 84, 85, 7, 61, 2, 2, 85, 86, 7, 30, 2, 2, 86, 91, 5, 10, 6, 2, 87, 88, + 7, 36, 2, 2, 88, 90, 5, 10, 6, 2, 89, 87, 3, 2, 2, 2, 90, 93, 3, 2, 2, + 2, 91, 89, 3, 2, 2, 2, 91, 92, 3, 2, 2, 2, 92, 94, 3, 2, 2, 2, 93, 91, + 3, 2, 2, 2, 94, 95, 7, 31, 2, 2, 95, 96, 7, 31, 2, 2, 96, 9, 3, 2, 2, 2, + 97, 98, 7, 30, 2, 2, 98, 99, 7, 56, 2, 2, 99, 100, 7, 23, 2, 2, 100, 101, + 5, 12, 7, 2, 101, 102, 7, 36, 2, 2, 102, 103, 5, 20, 11, 2, 103, 104, 7, + 31, 2, 2, 104, 11, 3, 2, 2, 2, 105, 106, 7, 81, 2, 2, 106, 13, 3, 2, 2, + 2, 107, 108, 7, 62, 2, 2, 108, 109, 7, 63, 2, 2, 109, 15, 3, 2, 2, 2, 110, + 111, 7, 62, 2, 2, 111, 112, 7, 65, 2, 2, 112, 113, 7, 63, 2, 2, 113, 17, + 3, 2, 2, 2, 114, 122, 7, 82, 2, 2, 115, 117, 7, 15, 2, 2, 116, 115, 3, + 2, 2, 2, 116, 117, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 122, 7, 83, 2, + 2, 119, 122, 7, 46, 2, 2, 120, 122, 7, 47, 2, 2, 121, 114, 3, 2, 2, 2, + 121, 116, 3, 2, 2, 2, 121, 119, 3, 2, 2, 2, 121, 120, 3, 2, 2, 2, 122, + 19, 3, 2, 2, 2, 123, 124, 7, 55, 2, 2, 124, 125, 7, 30, 2, 2, 125, 126, + 7, 56, 2, 2, 126, 127, 7, 23, 2, 2, 127, 130, 5, 22, 12, 2, 128, 129, 7, + 36, 2, 2, 129, 131, 5, 26, 14, 2, 130, 128, 3, 2, 2, 2, 130, 131, 3, 2, + 2, 2, 131, 132, 3, 2, 2, 2, 132, 133, 7, 31, 2, 2, 133, 21, 3, 2, 2, 2, + 134, 137, 7, 82, 2, 2, 135, 137, 5, 24, 13, 2, 136, 134, 3, 2, 2, 2, 136, + 135, 3, 2, 2, 2, 137, 23, 3, 2, 2, 2, 138, 139, 9, 2, 2, 2, 139, 25, 3, + 2, 2, 2, 140, 141, 7, 57, 2, 2, 141, 143, 7, 30, 2, 2, 142, 144, 5, 28, + 15, 2, 143, 142, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, + 145, 146, 7, 31, 2, 2, 146, 27, 3, 2, 2, 2, 147, 152, 5, 30, 16, 2, 148, + 149, 7, 36, 2, 2, 149, 151, 5, 30, 16, 2, 150, 148, 3, 2, 2, 2, 151, 154, + 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 29, 3, 2, + 2, 2, 154, 152, 3, 2, 2, 2, 155, 156, 7, 82, 2, 2, 156, 157, 7, 23, 2, + 2, 157, 158, 5, 18, 10, 2, 158, 31, 3, 2, 2, 2, 159, 160, 7, 81, 2, 2, + 160, 33, 3, 2, 2, 2, 17, 37, 41, 48, 54, 62, 68, 72, 79, 91, 116, 121, + 130, 136, 143, 152, +} +var deserializer = antlr.NewATNDeserializer(nil) +var deserializedATN = deserializer.DeserializeFromUInt16(parserATN) + +var literalNames = []string{ + "", "'&&'", "'||'", "'!'", "'~'", "'|'", "'&'", "'<<'", "'>>'", "'^'", + "'%'", "':'", "'+'", "'-'", "'*'", "'/'", "'\\'", "'.'", "'.*'", "'<=>'", + "'=='", "'='", "", "'>'", "'>='", "'<'", "'<='", "'#'", "'('", "')'", "'{'", + "'}'", "'['", "']'", "','", "'\"'", "'''", "'`'", "'?'", "'@'", "';'", + "'->>'", "'_'", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "'DO NOT MATCH ANY THING, JUST FOR GENERATOR'", +} +var symbolicNames = []string{ + "", "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "TRUE", "FALSE", "CREATE", "ALTER", "DROP", + "SHOW", "RULE", "FROM", "MASK", "TYPE", "NAME", "PROPERTIES", "COLUMN", + "RULES", "TABLE", "COLUMNS", "IF", "EXISTS", "COUNT", "NOT", "MD5", "KEEP_FIRST_N_LAST_M", + "KEEP_FROM_X_TO_Y", "MASK_FIRST_N_LAST_M", "MASK_FROM_X_TO_Y", "MASK_BEFORE_SPECIAL_CHARS", + "MASK_AFTER_SPECIAL_CHARS", "PERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE", + "MILITARY_IDENTITY_NUMBER_RANDOM_REPLACE", "LANDLINE_NUMBER_RANDOM_REPLACE", + "TELEPHONE_RANDOM_REPLACE", "UNIFIED_CREDIT_CODE_RANDOM_REPLACE", "GENERIC_TABLE_RANDOM_REPLACE", + "ADDRESS_RANDOM_REPLACE", "FOR_GENERATOR", "IDENTIFIER_", "STRING_", "INT_", + "HEX_", "NUMBER_", "HEXDIGIT_", "BITNUM_", +} + +var ruleNames = []string{ + "createMaskRule", "alterMaskRule", "dropMaskRule", "maskRuleDefinition", + "columnDefinition", "columnName", "ifExists", "ifNotExists", "literal", + "algorithmDefinition", "algorithmTypeName", "buildInMaskAlgorithmType", + "propertiesDefinition", "properties", "property", "ruleName", +} +var decisionToDFA = make([]*antlr.DFA, len(deserializedATN.DecisionToState)) + +func init() { + for index, ds := range deserializedATN.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(ds, index) + } +} + +type RDLStatementParser struct { + *antlr.BaseParser +} + +func NewRDLStatementParser(input antlr.TokenStream) *RDLStatementParser { + this := new(RDLStatementParser) + + this.BaseParser = antlr.NewBaseParser(input) + + this.Interpreter = antlr.NewParserATNSimulator(this, deserializedATN, decisionToDFA, antlr.NewPredictionContextCache()) + this.RuleNames = ruleNames + this.LiteralNames = literalNames + this.SymbolicNames = symbolicNames + this.GrammarFileName = "RDLStatement.g4" + + return this +} + +// RDLStatementParser tokens. +const ( + RDLStatementParserEOF = antlr.TokenEOF + RDLStatementParserAND_ = 1 + RDLStatementParserOR_ = 2 + RDLStatementParserNOT_ = 3 + RDLStatementParserTILDE_ = 4 + RDLStatementParserVERTICALBAR_ = 5 + RDLStatementParserAMPERSAND_ = 6 + RDLStatementParserSIGNEDLEFTSHIFT_ = 7 + RDLStatementParserSIGNEDRIGHTSHIFT_ = 8 + RDLStatementParserCARET_ = 9 + RDLStatementParserMOD_ = 10 + RDLStatementParserCOLON_ = 11 + RDLStatementParserPLUS_ = 12 + RDLStatementParserMINUS_ = 13 + RDLStatementParserASTERISK_ = 14 + RDLStatementParserSLASH_ = 15 + RDLStatementParserBACKSLASH_ = 16 + RDLStatementParserDOT_ = 17 + RDLStatementParserDOTASTERISK_ = 18 + RDLStatementParserSAFEEQ_ = 19 + RDLStatementParserDEQ_ = 20 + RDLStatementParserEQ_ = 21 + RDLStatementParserNEQ_ = 22 + RDLStatementParserGT_ = 23 + RDLStatementParserGTE_ = 24 + RDLStatementParserLT_ = 25 + RDLStatementParserLTE_ = 26 + RDLStatementParserPOUND_ = 27 + RDLStatementParserLP_ = 28 + RDLStatementParserRP_ = 29 + RDLStatementParserLBE_ = 30 + RDLStatementParserRBE_ = 31 + RDLStatementParserLBT_ = 32 + RDLStatementParserRBT_ = 33 + RDLStatementParserCOMMA_ = 34 + RDLStatementParserDQ_ = 35 + RDLStatementParserSQ_ = 36 + RDLStatementParserBQ_ = 37 + RDLStatementParserQUESTION_ = 38 + RDLStatementParserAT_ = 39 + RDLStatementParserSEMI_ = 40 + RDLStatementParserJSONSEPARATOR_ = 41 + RDLStatementParserUL_ = 42 + RDLStatementParserWS = 43 + RDLStatementParserTRUE = 44 + RDLStatementParserFALSE = 45 + RDLStatementParserCREATE = 46 + RDLStatementParserALTER = 47 + RDLStatementParserDROP = 48 + RDLStatementParserSHOW = 49 + RDLStatementParserRULE = 50 + RDLStatementParserFROM = 51 + RDLStatementParserMASK = 52 + RDLStatementParserTYPE = 53 + RDLStatementParserNAME = 54 + RDLStatementParserPROPERTIES = 55 + RDLStatementParserCOLUMN = 56 + RDLStatementParserRULES = 57 + RDLStatementParserTABLE = 58 + RDLStatementParserCOLUMNS = 59 + RDLStatementParserIF = 60 + RDLStatementParserEXISTS = 61 + RDLStatementParserCOUNT = 62 + RDLStatementParserNOT = 63 + RDLStatementParserMD5 = 64 + RDLStatementParserKEEP_FIRST_N_LAST_M = 65 + RDLStatementParserKEEP_FROM_X_TO_Y = 66 + RDLStatementParserMASK_FIRST_N_LAST_M = 67 + RDLStatementParserMASK_FROM_X_TO_Y = 68 + RDLStatementParserMASK_BEFORE_SPECIAL_CHARS = 69 + RDLStatementParserMASK_AFTER_SPECIAL_CHARS = 70 + RDLStatementParserPERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE = 71 + RDLStatementParserMILITARY_IDENTITY_NUMBER_RANDOM_REPLACE = 72 + RDLStatementParserLANDLINE_NUMBER_RANDOM_REPLACE = 73 + RDLStatementParserTELEPHONE_RANDOM_REPLACE = 74 + RDLStatementParserUNIFIED_CREDIT_CODE_RANDOM_REPLACE = 75 + RDLStatementParserGENERIC_TABLE_RANDOM_REPLACE = 76 + RDLStatementParserADDRESS_RANDOM_REPLACE = 77 + RDLStatementParserFOR_GENERATOR = 78 + RDLStatementParserIDENTIFIER_ = 79 + RDLStatementParserSTRING_ = 80 + RDLStatementParserINT_ = 81 + RDLStatementParserHEX_ = 82 + RDLStatementParserNUMBER_ = 83 + RDLStatementParserHEXDIGIT_ = 84 + RDLStatementParserBITNUM_ = 85 +) + +// RDLStatementParser rules. +const ( + RDLStatementParserRULE_createMaskRule = 0 + RDLStatementParserRULE_alterMaskRule = 1 + RDLStatementParserRULE_dropMaskRule = 2 + RDLStatementParserRULE_maskRuleDefinition = 3 + RDLStatementParserRULE_columnDefinition = 4 + RDLStatementParserRULE_columnName = 5 + RDLStatementParserRULE_ifExists = 6 + RDLStatementParserRULE_ifNotExists = 7 + RDLStatementParserRULE_literal = 8 + RDLStatementParserRULE_algorithmDefinition = 9 + RDLStatementParserRULE_algorithmTypeName = 10 + RDLStatementParserRULE_buildInMaskAlgorithmType = 11 + RDLStatementParserRULE_propertiesDefinition = 12 + RDLStatementParserRULE_properties = 13 + RDLStatementParserRULE_property = 14 + RDLStatementParserRULE_ruleName = 15 +) + +// ICreateMaskRuleContext is an interface to support dynamic dispatch. +type ICreateMaskRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsCreateMaskRuleContext differentiates from other interfaces. + IsCreateMaskRuleContext() +} + +type CreateMaskRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreateMaskRuleContext() *CreateMaskRuleContext { + var p = new(CreateMaskRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_createMaskRule + return p +} + +func (*CreateMaskRuleContext) IsCreateMaskRuleContext() {} + +func NewCreateMaskRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateMaskRuleContext { + var p = new(CreateMaskRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_createMaskRule + + return p +} + +func (s *CreateMaskRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateMaskRuleContext) CREATE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCREATE, 0) +} + +func (s *CreateMaskRuleContext) MASK() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMASK, 0) +} + +func (s *CreateMaskRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *CreateMaskRuleContext) AllMaskRuleDefinition() []IMaskRuleDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IMaskRuleDefinitionContext)(nil)).Elem()) + var tst = make([]IMaskRuleDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IMaskRuleDefinitionContext) + } + } + + return tst +} + +func (s *CreateMaskRuleContext) MaskRuleDefinition(i int) IMaskRuleDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IMaskRuleDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IMaskRuleDefinitionContext) +} + +func (s *CreateMaskRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *CreateMaskRuleContext) IfNotExists() IIfNotExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfNotExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfNotExistsContext) +} + +func (s *CreateMaskRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *CreateMaskRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *CreateMaskRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateMaskRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CreateMaskRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitCreateMaskRule(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) CreateMaskRule() (localctx ICreateMaskRuleContext) { + localctx = NewCreateMaskRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 0, RDLStatementParserRULE_createMaskRule) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(32) + p.Match(RDLStatementParserCREATE) + } + { + p.SetState(33) + p.Match(RDLStatementParserMASK) + } + p.SetState(35) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserTABLE { + { + p.SetState(34) + p.Match(RDLStatementParserTABLE) + } + + } + { + p.SetState(37) + p.Match(RDLStatementParserRULE) + } + p.SetState(39) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserIF { + { + p.SetState(38) + p.IfNotExists() + } + + } + { + p.SetState(41) + p.MaskRuleDefinition() + } + p.SetState(46) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(42) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(43) + p.MaskRuleDefinition() + } + + p.SetState(48) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// IAlterMaskRuleContext is an interface to support dynamic dispatch. +type IAlterMaskRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlterMaskRuleContext differentiates from other interfaces. + IsAlterMaskRuleContext() +} + +type AlterMaskRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlterMaskRuleContext() *AlterMaskRuleContext { + var p = new(AlterMaskRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_alterMaskRule + return p +} + +func (*AlterMaskRuleContext) IsAlterMaskRuleContext() {} + +func NewAlterMaskRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlterMaskRuleContext { + var p = new(AlterMaskRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_alterMaskRule + + return p +} + +func (s *AlterMaskRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlterMaskRuleContext) ALTER() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALTER, 0) +} + +func (s *AlterMaskRuleContext) MASK() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMASK, 0) +} + +func (s *AlterMaskRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *AlterMaskRuleContext) AllMaskRuleDefinition() []IMaskRuleDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IMaskRuleDefinitionContext)(nil)).Elem()) + var tst = make([]IMaskRuleDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IMaskRuleDefinitionContext) + } + } + + return tst +} + +func (s *AlterMaskRuleContext) MaskRuleDefinition(i int) IMaskRuleDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IMaskRuleDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IMaskRuleDefinitionContext) +} + +func (s *AlterMaskRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *AlterMaskRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *AlterMaskRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *AlterMaskRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlterMaskRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlterMaskRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlterMaskRule(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlterMaskRule() (localctx IAlterMaskRuleContext) { + localctx = NewAlterMaskRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 2, RDLStatementParserRULE_alterMaskRule) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(49) + p.Match(RDLStatementParserALTER) + } + { + p.SetState(50) + p.Match(RDLStatementParserMASK) + } + p.SetState(52) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserTABLE { + { + p.SetState(51) + p.Match(RDLStatementParserTABLE) + } + + } + { + p.SetState(54) + p.Match(RDLStatementParserRULE) + } + { + p.SetState(55) + p.MaskRuleDefinition() + } + p.SetState(60) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(56) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(57) + p.MaskRuleDefinition() + } + + p.SetState(62) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// IDropMaskRuleContext is an interface to support dynamic dispatch. +type IDropMaskRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropMaskRuleContext differentiates from other interfaces. + IsDropMaskRuleContext() +} + +type DropMaskRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropMaskRuleContext() *DropMaskRuleContext { + var p = new(DropMaskRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropMaskRule + return p +} + +func (*DropMaskRuleContext) IsDropMaskRuleContext() {} + +func NewDropMaskRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropMaskRuleContext { + var p = new(DropMaskRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropMaskRule + + return p +} + +func (s *DropMaskRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropMaskRuleContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropMaskRuleContext) MASK() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMASK, 0) +} + +func (s *DropMaskRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *DropMaskRuleContext) AllRuleName() []IRuleNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IRuleNameContext)(nil)).Elem()) + var tst = make([]IRuleNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IRuleNameContext) + } + } + + return tst +} + +func (s *DropMaskRuleContext) RuleName(i int) IRuleNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IRuleNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IRuleNameContext) +} + +func (s *DropMaskRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *DropMaskRuleContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropMaskRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DropMaskRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DropMaskRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropMaskRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DropMaskRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropMaskRule(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) DropMaskRule() (localctx IDropMaskRuleContext) { + localctx = NewDropMaskRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 4, RDLStatementParserRULE_dropMaskRule) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(63) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(64) + p.Match(RDLStatementParserMASK) + } + p.SetState(66) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserTABLE { + { + p.SetState(65) + p.Match(RDLStatementParserTABLE) + } + + } + { + p.SetState(68) + p.Match(RDLStatementParserRULE) + } + p.SetState(70) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserIF { + { + p.SetState(69) + p.IfExists() + } + + } + { + p.SetState(72) + p.RuleName() + } + p.SetState(77) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(73) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(74) + p.RuleName() + } + + p.SetState(79) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// IMaskRuleDefinitionContext is an interface to support dynamic dispatch. +type IMaskRuleDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsMaskRuleDefinitionContext differentiates from other interfaces. + IsMaskRuleDefinitionContext() +} + +type MaskRuleDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyMaskRuleDefinitionContext() *MaskRuleDefinitionContext { + var p = new(MaskRuleDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_maskRuleDefinition + return p +} + +func (*MaskRuleDefinitionContext) IsMaskRuleDefinitionContext() {} + +func NewMaskRuleDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MaskRuleDefinitionContext { + var p = new(MaskRuleDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_maskRuleDefinition + + return p +} + +func (s *MaskRuleDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *MaskRuleDefinitionContext) RuleName() IRuleNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IRuleNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IRuleNameContext) +} + +func (s *MaskRuleDefinitionContext) AllLP_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserLP_) +} + +func (s *MaskRuleDefinitionContext) LP_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, i) +} + +func (s *MaskRuleDefinitionContext) COLUMNS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOLUMNS, 0) +} + +func (s *MaskRuleDefinitionContext) AllColumnDefinition() []IColumnDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IColumnDefinitionContext)(nil)).Elem()) + var tst = make([]IColumnDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IColumnDefinitionContext) + } + } + + return tst +} + +func (s *MaskRuleDefinitionContext) ColumnDefinition(i int) IColumnDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IColumnDefinitionContext) +} + +func (s *MaskRuleDefinitionContext) AllRP_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserRP_) +} + +func (s *MaskRuleDefinitionContext) RP_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, i) +} + +func (s *MaskRuleDefinitionContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *MaskRuleDefinitionContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *MaskRuleDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MaskRuleDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MaskRuleDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitMaskRuleDefinition(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) MaskRuleDefinition() (localctx IMaskRuleDefinitionContext) { + localctx = NewMaskRuleDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 6, RDLStatementParserRULE_maskRuleDefinition) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(80) + p.RuleName() + } + { + p.SetState(81) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(82) + p.Match(RDLStatementParserCOLUMNS) + } + { + p.SetState(83) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(84) + p.ColumnDefinition() + } + p.SetState(89) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(85) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(86) + p.ColumnDefinition() + } + + p.SetState(91) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(92) + p.Match(RDLStatementParserRP_) + } + { + p.SetState(93) + p.Match(RDLStatementParserRP_) + } + + return localctx +} + +// IColumnDefinitionContext is an interface to support dynamic dispatch. +type IColumnDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsColumnDefinitionContext differentiates from other interfaces. + IsColumnDefinitionContext() +} + +type ColumnDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyColumnDefinitionContext() *ColumnDefinitionContext { + var p = new(ColumnDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_columnDefinition + return p +} + +func (*ColumnDefinitionContext) IsColumnDefinitionContext() {} + +func NewColumnDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ColumnDefinitionContext { + var p = new(ColumnDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_columnDefinition + + return p +} + +func (s *ColumnDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *ColumnDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *ColumnDefinitionContext) NAME() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNAME, 0) +} + +func (s *ColumnDefinitionContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *ColumnDefinitionContext) ColumnName() IColumnNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IColumnNameContext) +} + +func (s *ColumnDefinitionContext) COMMA_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, 0) +} + +func (s *ColumnDefinitionContext) AlgorithmDefinition() IAlgorithmDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmDefinitionContext) +} + +func (s *ColumnDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *ColumnDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ColumnDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ColumnDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitColumnDefinition(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) ColumnDefinition() (localctx IColumnDefinitionContext) { + localctx = NewColumnDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 8, RDLStatementParserRULE_columnDefinition) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(95) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(96) + p.Match(RDLStatementParserNAME) + } + { + p.SetState(97) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(98) + p.ColumnName() + } + { + p.SetState(99) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(100) + p.AlgorithmDefinition() + } + { + p.SetState(101) + p.Match(RDLStatementParserRP_) + } + + return localctx +} + +// IColumnNameContext is an interface to support dynamic dispatch. +type IColumnNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsColumnNameContext differentiates from other interfaces. + IsColumnNameContext() +} + +type ColumnNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyColumnNameContext() *ColumnNameContext { + var p = new(ColumnNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_columnName + return p +} + +func (*ColumnNameContext) IsColumnNameContext() {} + +func NewColumnNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ColumnNameContext { + var p = new(ColumnNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_columnName + + return p +} + +func (s *ColumnNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *ColumnNameContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *ColumnNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ColumnNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ColumnNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitColumnName(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) ColumnName() (localctx IColumnNameContext) { + localctx = NewColumnNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 10, RDLStatementParserRULE_columnName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(103) + p.Match(RDLStatementParserIDENTIFIER_) + } + + return localctx +} + +// IIfExistsContext is an interface to support dynamic dispatch. +type IIfExistsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsIfExistsContext differentiates from other interfaces. + IsIfExistsContext() +} + +type IfExistsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIfExistsContext() *IfExistsContext { + var p = new(IfExistsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_ifExists + return p +} + +func (*IfExistsContext) IsIfExistsContext() {} + +func NewIfExistsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfExistsContext { + var p = new(IfExistsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_ifExists + + return p +} + +func (s *IfExistsContext) GetParser() antlr.Parser { return s.parser } + +func (s *IfExistsContext) IF() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIF, 0) +} + +func (s *IfExistsContext) EXISTS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEXISTS, 0) +} + +func (s *IfExistsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IfExistsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IfExistsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitIfExists(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) IfExists() (localctx IIfExistsContext) { + localctx = NewIfExistsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, RDLStatementParserRULE_ifExists) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(105) + p.Match(RDLStatementParserIF) + } + { + p.SetState(106) + p.Match(RDLStatementParserEXISTS) + } + + return localctx +} + +// IIfNotExistsContext is an interface to support dynamic dispatch. +type IIfNotExistsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsIfNotExistsContext differentiates from other interfaces. + IsIfNotExistsContext() +} + +type IfNotExistsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIfNotExistsContext() *IfNotExistsContext { + var p = new(IfNotExistsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_ifNotExists + return p +} + +func (*IfNotExistsContext) IsIfNotExistsContext() {} + +func NewIfNotExistsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfNotExistsContext { + var p = new(IfNotExistsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_ifNotExists + + return p +} + +func (s *IfNotExistsContext) GetParser() antlr.Parser { return s.parser } + +func (s *IfNotExistsContext) IF() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIF, 0) +} + +func (s *IfNotExistsContext) NOT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNOT, 0) +} + +func (s *IfNotExistsContext) EXISTS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEXISTS, 0) +} + +func (s *IfNotExistsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IfNotExistsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IfNotExistsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitIfNotExists(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) IfNotExists() (localctx IIfNotExistsContext) { + localctx = NewIfNotExistsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 14, RDLStatementParserRULE_ifNotExists) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(108) + p.Match(RDLStatementParserIF) + } + { + p.SetState(109) + p.Match(RDLStatementParserNOT) + } + { + p.SetState(110) + p.Match(RDLStatementParserEXISTS) + } + + return localctx +} + +// 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) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_literal + return p +} + +func (*LiteralContext) IsLiteralContext() {} + +func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext { + var p = new(LiteralContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_literal + + return p +} + +func (s *LiteralContext) GetParser() antlr.Parser { return s.parser } + +func (s *LiteralContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *LiteralContext) INT_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserINT_, 0) +} + +func (s *LiteralContext) MINUS_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMINUS_, 0) +} + +func (s *LiteralContext) TRUE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTRUE, 0) +} + +func (s *LiteralContext) FALSE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserFALSE, 0) +} + +func (s *LiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitLiteral(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) Literal() (localctx ILiteralContext) { + localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, RDLStatementParserRULE_literal) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.SetState(119) + p.GetErrorHandler().Sync(p) + + switch p.GetTokenStream().LA(1) { + case RDLStatementParserSTRING_: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(112) + p.Match(RDLStatementParserSTRING_) + } + + case RDLStatementParserMINUS_, RDLStatementParserINT_: + p.EnterOuterAlt(localctx, 2) + p.SetState(114) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserMINUS_ { + { + p.SetState(113) + p.Match(RDLStatementParserMINUS_) + } + + } + { + p.SetState(116) + p.Match(RDLStatementParserINT_) + } + + case RDLStatementParserTRUE: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(117) + p.Match(RDLStatementParserTRUE) + } + + case RDLStatementParserFALSE: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(118) + p.Match(RDLStatementParserFALSE) + } + + default: + panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + } + + return localctx +} + +// IAlgorithmDefinitionContext is an interface to support dynamic dispatch. +type IAlgorithmDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlgorithmDefinitionContext differentiates from other interfaces. + IsAlgorithmDefinitionContext() +} + +type AlgorithmDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlgorithmDefinitionContext() *AlgorithmDefinitionContext { + var p = new(AlgorithmDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_algorithmDefinition + return p +} + +func (*AlgorithmDefinitionContext) IsAlgorithmDefinitionContext() {} + +func NewAlgorithmDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlgorithmDefinitionContext { + var p = new(AlgorithmDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_algorithmDefinition + + return p +} + +func (s *AlgorithmDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlgorithmDefinitionContext) TYPE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTYPE, 0) +} + +func (s *AlgorithmDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *AlgorithmDefinitionContext) NAME() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNAME, 0) +} + +func (s *AlgorithmDefinitionContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *AlgorithmDefinitionContext) AlgorithmTypeName() IAlgorithmTypeNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmTypeNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmTypeNameContext) +} + +func (s *AlgorithmDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *AlgorithmDefinitionContext) COMMA_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, 0) +} + +func (s *AlgorithmDefinitionContext) PropertiesDefinition() IPropertiesDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertiesDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IPropertiesDefinitionContext) +} + +func (s *AlgorithmDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlgorithmDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlgorithmDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlgorithmDefinition(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlgorithmDefinition() (localctx IAlgorithmDefinitionContext) { + localctx = NewAlgorithmDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, RDLStatementParserRULE_algorithmDefinition) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(121) + p.Match(RDLStatementParserTYPE) + } + { + p.SetState(122) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(123) + p.Match(RDLStatementParserNAME) + } + { + p.SetState(124) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(125) + p.AlgorithmTypeName() + } + p.SetState(128) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserCOMMA_ { + { + p.SetState(126) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(127) + p.PropertiesDefinition() + } + + } + { + p.SetState(130) + p.Match(RDLStatementParserRP_) + } + + return localctx +} + +// IAlgorithmTypeNameContext is an interface to support dynamic dispatch. +type IAlgorithmTypeNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlgorithmTypeNameContext differentiates from other interfaces. + IsAlgorithmTypeNameContext() +} + +type AlgorithmTypeNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlgorithmTypeNameContext() *AlgorithmTypeNameContext { + var p = new(AlgorithmTypeNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_algorithmTypeName + return p +} + +func (*AlgorithmTypeNameContext) IsAlgorithmTypeNameContext() {} + +func NewAlgorithmTypeNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlgorithmTypeNameContext { + var p = new(AlgorithmTypeNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_algorithmTypeName + + return p +} + +func (s *AlgorithmTypeNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlgorithmTypeNameContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *AlgorithmTypeNameContext) BuildInMaskAlgorithmType() IBuildInMaskAlgorithmTypeContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IBuildInMaskAlgorithmTypeContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IBuildInMaskAlgorithmTypeContext) +} + +func (s *AlgorithmTypeNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlgorithmTypeNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlgorithmTypeNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlgorithmTypeName(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlgorithmTypeName() (localctx IAlgorithmTypeNameContext) { + localctx = NewAlgorithmTypeNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 20, RDLStatementParserRULE_algorithmTypeName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.SetState(134) + p.GetErrorHandler().Sync(p) + + switch p.GetTokenStream().LA(1) { + case RDLStatementParserSTRING_: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(132) + p.Match(RDLStatementParserSTRING_) + } + + case RDLStatementParserMD5, RDLStatementParserKEEP_FIRST_N_LAST_M, RDLStatementParserKEEP_FROM_X_TO_Y, RDLStatementParserMASK_FIRST_N_LAST_M, RDLStatementParserMASK_FROM_X_TO_Y, RDLStatementParserMASK_BEFORE_SPECIAL_CHARS, RDLStatementParserMASK_AFTER_SPECIAL_CHARS, RDLStatementParserPERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE, RDLStatementParserMILITARY_IDENTITY_NUMBER_RANDOM_REPLACE, RDLStatementParserLANDLINE_NUMBER_RANDOM_REPLACE, RDLStatementParserTELEPHONE_RANDOM_REPLACE, RDLStatementParserUNIFIED_CREDIT_CODE_RANDOM_REPLACE, RDLStatementParserGENERIC_TABLE_RANDOM_REPLACE: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(133) + p.BuildInMaskAlgorithmType() + } + + default: + panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + } + + return localctx +} + +// IBuildInMaskAlgorithmTypeContext is an interface to support dynamic dispatch. +type IBuildInMaskAlgorithmTypeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsBuildInMaskAlgorithmTypeContext differentiates from other interfaces. + IsBuildInMaskAlgorithmTypeContext() +} + +type BuildInMaskAlgorithmTypeContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBuildInMaskAlgorithmTypeContext() *BuildInMaskAlgorithmTypeContext { + var p = new(BuildInMaskAlgorithmTypeContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_buildInMaskAlgorithmType + return p +} + +func (*BuildInMaskAlgorithmTypeContext) IsBuildInMaskAlgorithmTypeContext() {} + +func NewBuildInMaskAlgorithmTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BuildInMaskAlgorithmTypeContext { + var p = new(BuildInMaskAlgorithmTypeContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_buildInMaskAlgorithmType + + return p +} + +func (s *BuildInMaskAlgorithmTypeContext) GetParser() antlr.Parser { return s.parser } + +func (s *BuildInMaskAlgorithmTypeContext) MD5() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMD5, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) KEEP_FIRST_N_LAST_M() antlr.TerminalNode { + return s.GetToken(RDLStatementParserKEEP_FIRST_N_LAST_M, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) KEEP_FROM_X_TO_Y() antlr.TerminalNode { + return s.GetToken(RDLStatementParserKEEP_FROM_X_TO_Y, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) MASK_FIRST_N_LAST_M() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMASK_FIRST_N_LAST_M, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) MASK_FROM_X_TO_Y() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMASK_FROM_X_TO_Y, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) MASK_BEFORE_SPECIAL_CHARS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMASK_BEFORE_SPECIAL_CHARS, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) MASK_AFTER_SPECIAL_CHARS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMASK_AFTER_SPECIAL_CHARS, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) PERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserPERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) MILITARY_IDENTITY_NUMBER_RANDOM_REPLACE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMILITARY_IDENTITY_NUMBER_RANDOM_REPLACE, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) LANDLINE_NUMBER_RANDOM_REPLACE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLANDLINE_NUMBER_RANDOM_REPLACE, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) TELEPHONE_RANDOM_REPLACE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTELEPHONE_RANDOM_REPLACE, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) UNIFIED_CREDIT_CODE_RANDOM_REPLACE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserUNIFIED_CREDIT_CODE_RANDOM_REPLACE, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) GENERIC_TABLE_RANDOM_REPLACE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserGENERIC_TABLE_RANDOM_REPLACE, 0) +} + +func (s *BuildInMaskAlgorithmTypeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BuildInMaskAlgorithmTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *BuildInMaskAlgorithmTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitBuildInMaskAlgorithmType(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) BuildInMaskAlgorithmType() (localctx IBuildInMaskAlgorithmTypeContext) { + localctx = NewBuildInMaskAlgorithmTypeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 22, RDLStatementParserRULE_buildInMaskAlgorithmType) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(136) + _la = p.GetTokenStream().LA(1) + + if !(((_la-64)&-(0x1f+1)) == 0 && ((1<>'", "'^'", + "'%'", "':'", "'+'", "'-'", "'*'", "'/'", "'\\'", "'.'", "'.*'", "'<=>'", + "'=='", "'='", "", "'>'", "'>='", "'<'", "'<='", "'#'", "'('", "')'", "'{'", + "'}'", "'['", "']'", "','", "'\"'", "'''", "'`'", "'?'", "'@'", "';'", + "'->>'", "'_'", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "'DO NOT MATCH ANY THING, JUST FOR GENERATOR'", +} + +var lexerSymbolicNames = []string{ + "", "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "TRUE", "FALSE", "CREATE", "ALTER", "DROP", + "SHOW", "RULE", "FROM", "READWRITE_SPLITTING", "WRITE_STORAGE_UNIT", "READ_STORAGE_UNITS", + "TRANSACTIONAL_READ_QUERY_STRATEGY", "TYPE", "NAME", "PROPERTIES", "RULES", + "RESOURCES", "STATUS", "ENABLE", "DISABLE", "READ", "IF", "EXISTS", "COUNT", + "ROUND_ROBIN", "RANDOM", "WEIGHT", "NOT", "FOR_GENERATOR", "IDENTIFIER_", + "STRING_", "INT_", "HEX_", "NUMBER_", "HEXDIGIT_", "BITNUM_", +} + +var lexerRuleNames = []string{ + "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "TRUE", "FALSE", "CREATE", "ALTER", "DROP", + "SHOW", "RULE", "FROM", "READWRITE_SPLITTING", "WRITE_STORAGE_UNIT", "READ_STORAGE_UNITS", + "TRANSACTIONAL_READ_QUERY_STRATEGY", "TYPE", "NAME", "PROPERTIES", "RULES", + "RESOURCES", "STATUS", "ENABLE", "DISABLE", "READ", "IF", "EXISTS", "COUNT", + "ROUND_ROBIN", "RANDOM", "WEIGHT", "NOT", "FOR_GENERATOR", "A", "B", "C", + "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", + "S", "T", "U", "V", "W", "X", "Y", "Z", "IDENTIFIER_", "STRING_", "INT_", + "HEX_", "NUMBER_", "HEXDIGIT_", "BITNUM_", +} + +type RDLStatementLexer struct { + *antlr.BaseLexer + channelNames []string + modeNames []string + // TODO: EOF string +} + +var lexerDecisionToDFA = make([]*antlr.DFA, len(lexerAtn.DecisionToState)) + +func init() { + for index, ds := range lexerAtn.DecisionToState { + lexerDecisionToDFA[index] = antlr.NewDFA(ds, index) + } +} + +func NewRDLStatementLexer(input antlr.CharStream) *RDLStatementLexer { + + l := new(RDLStatementLexer) + + l.BaseLexer = antlr.NewBaseLexer(input) + l.Interpreter = antlr.NewLexerATNSimulator(l, lexerAtn, lexerDecisionToDFA, antlr.NewPredictionContextCache()) + + l.channelNames = lexerChannelNames + l.modeNames = lexerModeNames + l.RuleNames = lexerRuleNames + l.LiteralNames = lexerLiteralNames + l.SymbolicNames = lexerSymbolicNames + l.GrammarFileName = "RDLStatement.g4" + // TODO: l.EOF = antlr.TokenEOF + + return l +} + +// RDLStatementLexer tokens. +const ( + RDLStatementLexerAND_ = 1 + RDLStatementLexerOR_ = 2 + RDLStatementLexerNOT_ = 3 + RDLStatementLexerTILDE_ = 4 + RDLStatementLexerVERTICALBAR_ = 5 + RDLStatementLexerAMPERSAND_ = 6 + RDLStatementLexerSIGNEDLEFTSHIFT_ = 7 + RDLStatementLexerSIGNEDRIGHTSHIFT_ = 8 + RDLStatementLexerCARET_ = 9 + RDLStatementLexerMOD_ = 10 + RDLStatementLexerCOLON_ = 11 + RDLStatementLexerPLUS_ = 12 + RDLStatementLexerMINUS_ = 13 + RDLStatementLexerASTERISK_ = 14 + RDLStatementLexerSLASH_ = 15 + RDLStatementLexerBACKSLASH_ = 16 + RDLStatementLexerDOT_ = 17 + RDLStatementLexerDOTASTERISK_ = 18 + RDLStatementLexerSAFEEQ_ = 19 + RDLStatementLexerDEQ_ = 20 + RDLStatementLexerEQ_ = 21 + RDLStatementLexerNEQ_ = 22 + RDLStatementLexerGT_ = 23 + RDLStatementLexerGTE_ = 24 + RDLStatementLexerLT_ = 25 + RDLStatementLexerLTE_ = 26 + RDLStatementLexerPOUND_ = 27 + RDLStatementLexerLP_ = 28 + RDLStatementLexerRP_ = 29 + RDLStatementLexerLBE_ = 30 + RDLStatementLexerRBE_ = 31 + RDLStatementLexerLBT_ = 32 + RDLStatementLexerRBT_ = 33 + RDLStatementLexerCOMMA_ = 34 + RDLStatementLexerDQ_ = 35 + RDLStatementLexerSQ_ = 36 + RDLStatementLexerBQ_ = 37 + RDLStatementLexerQUESTION_ = 38 + RDLStatementLexerAT_ = 39 + RDLStatementLexerSEMI_ = 40 + RDLStatementLexerJSONSEPARATOR_ = 41 + RDLStatementLexerUL_ = 42 + RDLStatementLexerWS = 43 + RDLStatementLexerTRUE = 44 + RDLStatementLexerFALSE = 45 + RDLStatementLexerCREATE = 46 + RDLStatementLexerALTER = 47 + RDLStatementLexerDROP = 48 + RDLStatementLexerSHOW = 49 + RDLStatementLexerRULE = 50 + RDLStatementLexerFROM = 51 + RDLStatementLexerREADWRITE_SPLITTING = 52 + RDLStatementLexerWRITE_STORAGE_UNIT = 53 + RDLStatementLexerREAD_STORAGE_UNITS = 54 + RDLStatementLexerTRANSACTIONAL_READ_QUERY_STRATEGY = 55 + RDLStatementLexerTYPE = 56 + RDLStatementLexerNAME = 57 + RDLStatementLexerPROPERTIES = 58 + RDLStatementLexerRULES = 59 + RDLStatementLexerRESOURCES = 60 + RDLStatementLexerSTATUS = 61 + RDLStatementLexerENABLE = 62 + RDLStatementLexerDISABLE = 63 + RDLStatementLexerREAD = 64 + RDLStatementLexerIF = 65 + RDLStatementLexerEXISTS = 66 + RDLStatementLexerCOUNT = 67 + RDLStatementLexerROUND_ROBIN = 68 + RDLStatementLexerRANDOM = 69 + RDLStatementLexerWEIGHT = 70 + RDLStatementLexerNOT = 71 + RDLStatementLexerFOR_GENERATOR = 72 + RDLStatementLexerIDENTIFIER_ = 73 + RDLStatementLexerSTRING_ = 74 + RDLStatementLexerINT_ = 75 + RDLStatementLexerHEX_ = 76 + RDLStatementLexerNUMBER_ = 77 + RDLStatementLexerHEXDIGIT_ = 78 + RDLStatementLexerBITNUM_ = 79 +) diff --git a/shardingsphere-operator/pkg/distsql/visitor_parser/read_write_splitting/rdlstatement_parser.go b/shardingsphere-operator/pkg/distsql/visitor_parser/read_write_splitting/rdlstatement_parser.go new file mode 100644 index 00000000..ad003cd7 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/visitor_parser/read_write_splitting/rdlstatement_parser.go @@ -0,0 +1,3255 @@ +// Code generated from RDLStatement.g4 by ANTLR 4.8. DO NOT EDIT. + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package parser // RDLStatement + +import ( + "fmt" + "reflect" + "strconv" + + "github.com/antlr/antlr4/runtime/Go/antlr" +) + +// Suppress unused import errors +var _ = fmt.Printf +var _ = reflect.Copy +var _ = strconv.Itoa + +var parserATN = []uint16{ + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 81, 192, + 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, + 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, + 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, + 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, + 4, 24, 9, 24, 4, 25, 9, 25, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 55, 10, 2, 3, + 2, 3, 2, 3, 2, 7, 2, 60, 10, 2, 12, 2, 14, 2, 63, 11, 2, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 7, 3, 71, 10, 3, 12, 3, 14, 3, 74, 11, 3, 3, 4, 3, + 4, 3, 4, 3, 4, 5, 4, 80, 10, 4, 3, 4, 3, 4, 3, 4, 7, 4, 85, 10, 4, 12, + 4, 14, 4, 88, 11, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 95, 10, 5, 3, + 5, 3, 5, 5, 5, 99, 10, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, + 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, + 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 7, 12, 127, 10, 12, 12, + 12, 14, 12, 130, 11, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, + 3, 15, 3, 15, 3, 16, 3, 16, 5, 16, 143, 10, 16, 3, 16, 3, 16, 3, 16, 5, + 16, 148, 10, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, + 157, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 5, 18, 163, 10, 18, 3, 19, 3, + 19, 3, 20, 3, 20, 3, 20, 5, 20, 170, 10, 20, 3, 20, 3, 20, 3, 21, 3, 21, + 3, 21, 7, 21, 177, 10, 21, 12, 21, 14, 21, 180, 11, 21, 3, 22, 3, 22, 3, + 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 2, 2, 26, 2, + 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, + 42, 44, 46, 48, 2, 3, 3, 2, 70, 72, 2, 183, 2, 50, 3, 2, 2, 2, 4, 64, 3, + 2, 2, 2, 6, 75, 3, 2, 2, 2, 8, 89, 3, 2, 2, 2, 10, 102, 3, 2, 2, 2, 12, + 106, 3, 2, 2, 2, 14, 108, 3, 2, 2, 2, 16, 112, 3, 2, 2, 2, 18, 117, 3, + 2, 2, 2, 20, 121, 3, 2, 2, 2, 22, 123, 3, 2, 2, 2, 24, 131, 3, 2, 2, 2, + 26, 133, 3, 2, 2, 2, 28, 136, 3, 2, 2, 2, 30, 147, 3, 2, 2, 2, 32, 149, + 3, 2, 2, 2, 34, 162, 3, 2, 2, 2, 36, 164, 3, 2, 2, 2, 38, 166, 3, 2, 2, + 2, 40, 173, 3, 2, 2, 2, 42, 181, 3, 2, 2, 2, 44, 185, 3, 2, 2, 2, 46, 187, + 3, 2, 2, 2, 48, 189, 3, 2, 2, 2, 50, 51, 7, 48, 2, 2, 51, 52, 7, 54, 2, + 2, 52, 54, 7, 52, 2, 2, 53, 55, 5, 28, 15, 2, 54, 53, 3, 2, 2, 2, 54, 55, + 3, 2, 2, 2, 55, 56, 3, 2, 2, 2, 56, 61, 5, 8, 5, 2, 57, 58, 7, 36, 2, 2, + 58, 60, 5, 8, 5, 2, 59, 57, 3, 2, 2, 2, 60, 63, 3, 2, 2, 2, 61, 59, 3, + 2, 2, 2, 61, 62, 3, 2, 2, 2, 62, 3, 3, 2, 2, 2, 63, 61, 3, 2, 2, 2, 64, + 65, 7, 49, 2, 2, 65, 66, 7, 54, 2, 2, 66, 67, 7, 52, 2, 2, 67, 72, 5, 8, + 5, 2, 68, 69, 7, 36, 2, 2, 69, 71, 5, 8, 5, 2, 70, 68, 3, 2, 2, 2, 71, + 74, 3, 2, 2, 2, 72, 70, 3, 2, 2, 2, 72, 73, 3, 2, 2, 2, 73, 5, 3, 2, 2, + 2, 74, 72, 3, 2, 2, 2, 75, 76, 7, 50, 2, 2, 76, 77, 7, 54, 2, 2, 77, 79, + 7, 52, 2, 2, 78, 80, 5, 26, 14, 2, 79, 78, 3, 2, 2, 2, 79, 80, 3, 2, 2, + 2, 80, 81, 3, 2, 2, 2, 81, 86, 5, 12, 7, 2, 82, 83, 7, 36, 2, 2, 83, 85, + 5, 12, 7, 2, 84, 82, 3, 2, 2, 2, 85, 88, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, + 86, 87, 3, 2, 2, 2, 87, 7, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 89, 90, 5, 12, + 7, 2, 90, 91, 7, 30, 2, 2, 91, 94, 5, 10, 6, 2, 92, 93, 7, 36, 2, 2, 93, + 95, 5, 18, 10, 2, 94, 92, 3, 2, 2, 2, 94, 95, 3, 2, 2, 2, 95, 98, 3, 2, + 2, 2, 96, 97, 7, 36, 2, 2, 97, 99, 5, 32, 17, 2, 98, 96, 3, 2, 2, 2, 98, + 99, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 101, 7, 31, 2, 2, 101, 9, 3, + 2, 2, 2, 102, 103, 5, 14, 8, 2, 103, 104, 7, 36, 2, 2, 104, 105, 5, 16, + 9, 2, 105, 11, 3, 2, 2, 2, 106, 107, 7, 75, 2, 2, 107, 13, 3, 2, 2, 2, + 108, 109, 7, 55, 2, 2, 109, 110, 7, 23, 2, 2, 110, 111, 5, 20, 11, 2, 111, + 15, 3, 2, 2, 2, 112, 113, 7, 56, 2, 2, 113, 114, 7, 30, 2, 2, 114, 115, + 5, 22, 12, 2, 115, 116, 7, 31, 2, 2, 116, 17, 3, 2, 2, 2, 117, 118, 7, + 57, 2, 2, 118, 119, 7, 23, 2, 2, 119, 120, 5, 24, 13, 2, 120, 19, 3, 2, + 2, 2, 121, 122, 5, 48, 25, 2, 122, 21, 3, 2, 2, 2, 123, 128, 5, 48, 25, + 2, 124, 125, 7, 36, 2, 2, 125, 127, 5, 48, 25, 2, 126, 124, 3, 2, 2, 2, + 127, 130, 3, 2, 2, 2, 128, 126, 3, 2, 2, 2, 128, 129, 3, 2, 2, 2, 129, + 23, 3, 2, 2, 2, 130, 128, 3, 2, 2, 2, 131, 132, 7, 76, 2, 2, 132, 25, 3, + 2, 2, 2, 133, 134, 7, 67, 2, 2, 134, 135, 7, 68, 2, 2, 135, 27, 3, 2, 2, + 2, 136, 137, 7, 67, 2, 2, 137, 138, 7, 73, 2, 2, 138, 139, 7, 68, 2, 2, + 139, 29, 3, 2, 2, 2, 140, 148, 7, 76, 2, 2, 141, 143, 7, 15, 2, 2, 142, + 141, 3, 2, 2, 2, 142, 143, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 148, + 7, 77, 2, 2, 145, 148, 7, 46, 2, 2, 146, 148, 7, 47, 2, 2, 147, 140, 3, + 2, 2, 2, 147, 142, 3, 2, 2, 2, 147, 145, 3, 2, 2, 2, 147, 146, 3, 2, 2, + 2, 148, 31, 3, 2, 2, 2, 149, 150, 7, 58, 2, 2, 150, 151, 7, 30, 2, 2, 151, + 152, 7, 59, 2, 2, 152, 153, 7, 23, 2, 2, 153, 156, 5, 34, 18, 2, 154, 155, + 7, 36, 2, 2, 155, 157, 5, 38, 20, 2, 156, 154, 3, 2, 2, 2, 156, 157, 3, + 2, 2, 2, 157, 158, 3, 2, 2, 2, 158, 159, 7, 31, 2, 2, 159, 33, 3, 2, 2, + 2, 160, 163, 7, 76, 2, 2, 161, 163, 5, 36, 19, 2, 162, 160, 3, 2, 2, 2, + 162, 161, 3, 2, 2, 2, 163, 35, 3, 2, 2, 2, 164, 165, 9, 2, 2, 2, 165, 37, + 3, 2, 2, 2, 166, 167, 7, 60, 2, 2, 167, 169, 7, 30, 2, 2, 168, 170, 5, + 40, 21, 2, 169, 168, 3, 2, 2, 2, 169, 170, 3, 2, 2, 2, 170, 171, 3, 2, + 2, 2, 171, 172, 7, 31, 2, 2, 172, 39, 3, 2, 2, 2, 173, 178, 5, 42, 22, + 2, 174, 175, 7, 36, 2, 2, 175, 177, 5, 42, 22, 2, 176, 174, 3, 2, 2, 2, + 177, 180, 3, 2, 2, 2, 178, 176, 3, 2, 2, 2, 178, 179, 3, 2, 2, 2, 179, + 41, 3, 2, 2, 2, 180, 178, 3, 2, 2, 2, 181, 182, 7, 76, 2, 2, 182, 183, + 7, 23, 2, 2, 183, 184, 5, 30, 16, 2, 184, 43, 3, 2, 2, 2, 185, 186, 7, + 75, 2, 2, 186, 45, 3, 2, 2, 2, 187, 188, 7, 75, 2, 2, 188, 47, 3, 2, 2, + 2, 189, 190, 7, 75, 2, 2, 190, 49, 3, 2, 2, 2, 16, 54, 61, 72, 79, 86, + 94, 98, 128, 142, 147, 156, 162, 169, 178, +} +var deserializer = antlr.NewATNDeserializer(nil) +var deserializedATN = deserializer.DeserializeFromUInt16(parserATN) + +var literalNames = []string{ + "", "'&&'", "'||'", "'!'", "'~'", "'|'", "'&'", "'<<'", "'>>'", "'^'", + "'%'", "':'", "'+'", "'-'", "'*'", "'/'", "'\\'", "'.'", "'.*'", "'<=>'", + "'=='", "'='", "", "'>'", "'>='", "'<'", "'<='", "'#'", "'('", "')'", "'{'", + "'}'", "'['", "']'", "','", "'\"'", "'''", "'`'", "'?'", "'@'", "';'", + "'->>'", "'_'", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "'DO NOT MATCH ANY THING, JUST FOR GENERATOR'", +} +var symbolicNames = []string{ + "", "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "TRUE", "FALSE", "CREATE", "ALTER", "DROP", + "SHOW", "RULE", "FROM", "READWRITE_SPLITTING", "WRITE_STORAGE_UNIT", "READ_STORAGE_UNITS", + "TRANSACTIONAL_READ_QUERY_STRATEGY", "TYPE", "NAME", "PROPERTIES", "RULES", + "RESOURCES", "STATUS", "ENABLE", "DISABLE", "READ", "IF", "EXISTS", "COUNT", + "ROUND_ROBIN", "RANDOM", "WEIGHT", "NOT", "FOR_GENERATOR", "IDENTIFIER_", + "STRING_", "INT_", "HEX_", "NUMBER_", "HEXDIGIT_", "BITNUM_", +} + +var ruleNames = []string{ + "createReadwriteSplittingRule", "alterReadwriteSplittingRule", "dropReadwriteSplittingRule", + "readwriteSplittingRuleDefinition", "dataSourceDefinition", "ruleName", + "writeStorageUnit", "readStorageUnits", "transactionalReadQueryStrategy", + "writeStorageUnitName", "readStorageUnitsNames", "transactionalReadQueryStrategyName", + "ifExists", "ifNotExists", "literal", "algorithmDefinition", "algorithmTypeName", + "buildInReadQueryLoadBalanceAlgorithmType", "propertiesDefinition", "properties", + "property", "databaseName", "groupName", "storageUnitName", +} +var decisionToDFA = make([]*antlr.DFA, len(deserializedATN.DecisionToState)) + +func init() { + for index, ds := range deserializedATN.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(ds, index) + } +} + +type RDLStatementParser struct { + *antlr.BaseParser +} + +func NewRDLStatementParser(input antlr.TokenStream) *RDLStatementParser { + this := new(RDLStatementParser) + + this.BaseParser = antlr.NewBaseParser(input) + + this.Interpreter = antlr.NewParserATNSimulator(this, deserializedATN, decisionToDFA, antlr.NewPredictionContextCache()) + this.RuleNames = ruleNames + this.LiteralNames = literalNames + this.SymbolicNames = symbolicNames + this.GrammarFileName = "RDLStatement.g4" + + return this +} + +// RDLStatementParser tokens. +const ( + RDLStatementParserEOF = antlr.TokenEOF + RDLStatementParserAND_ = 1 + RDLStatementParserOR_ = 2 + RDLStatementParserNOT_ = 3 + RDLStatementParserTILDE_ = 4 + RDLStatementParserVERTICALBAR_ = 5 + RDLStatementParserAMPERSAND_ = 6 + RDLStatementParserSIGNEDLEFTSHIFT_ = 7 + RDLStatementParserSIGNEDRIGHTSHIFT_ = 8 + RDLStatementParserCARET_ = 9 + RDLStatementParserMOD_ = 10 + RDLStatementParserCOLON_ = 11 + RDLStatementParserPLUS_ = 12 + RDLStatementParserMINUS_ = 13 + RDLStatementParserASTERISK_ = 14 + RDLStatementParserSLASH_ = 15 + RDLStatementParserBACKSLASH_ = 16 + RDLStatementParserDOT_ = 17 + RDLStatementParserDOTASTERISK_ = 18 + RDLStatementParserSAFEEQ_ = 19 + RDLStatementParserDEQ_ = 20 + RDLStatementParserEQ_ = 21 + RDLStatementParserNEQ_ = 22 + RDLStatementParserGT_ = 23 + RDLStatementParserGTE_ = 24 + RDLStatementParserLT_ = 25 + RDLStatementParserLTE_ = 26 + RDLStatementParserPOUND_ = 27 + RDLStatementParserLP_ = 28 + RDLStatementParserRP_ = 29 + RDLStatementParserLBE_ = 30 + RDLStatementParserRBE_ = 31 + RDLStatementParserLBT_ = 32 + RDLStatementParserRBT_ = 33 + RDLStatementParserCOMMA_ = 34 + RDLStatementParserDQ_ = 35 + RDLStatementParserSQ_ = 36 + RDLStatementParserBQ_ = 37 + RDLStatementParserQUESTION_ = 38 + RDLStatementParserAT_ = 39 + RDLStatementParserSEMI_ = 40 + RDLStatementParserJSONSEPARATOR_ = 41 + RDLStatementParserUL_ = 42 + RDLStatementParserWS = 43 + RDLStatementParserTRUE = 44 + RDLStatementParserFALSE = 45 + RDLStatementParserCREATE = 46 + RDLStatementParserALTER = 47 + RDLStatementParserDROP = 48 + RDLStatementParserSHOW = 49 + RDLStatementParserRULE = 50 + RDLStatementParserFROM = 51 + RDLStatementParserREADWRITE_SPLITTING = 52 + RDLStatementParserWRITE_STORAGE_UNIT = 53 + RDLStatementParserREAD_STORAGE_UNITS = 54 + RDLStatementParserTRANSACTIONAL_READ_QUERY_STRATEGY = 55 + RDLStatementParserTYPE = 56 + RDLStatementParserNAME = 57 + RDLStatementParserPROPERTIES = 58 + RDLStatementParserRULES = 59 + RDLStatementParserRESOURCES = 60 + RDLStatementParserSTATUS = 61 + RDLStatementParserENABLE = 62 + RDLStatementParserDISABLE = 63 + RDLStatementParserREAD = 64 + RDLStatementParserIF = 65 + RDLStatementParserEXISTS = 66 + RDLStatementParserCOUNT = 67 + RDLStatementParserROUND_ROBIN = 68 + RDLStatementParserRANDOM = 69 + RDLStatementParserWEIGHT = 70 + RDLStatementParserNOT = 71 + RDLStatementParserFOR_GENERATOR = 72 + RDLStatementParserIDENTIFIER_ = 73 + RDLStatementParserSTRING_ = 74 + RDLStatementParserINT_ = 75 + RDLStatementParserHEX_ = 76 + RDLStatementParserNUMBER_ = 77 + RDLStatementParserHEXDIGIT_ = 78 + RDLStatementParserBITNUM_ = 79 +) + +// RDLStatementParser rules. +const ( + RDLStatementParserRULE_createReadwriteSplittingRule = 0 + RDLStatementParserRULE_alterReadwriteSplittingRule = 1 + RDLStatementParserRULE_dropReadwriteSplittingRule = 2 + RDLStatementParserRULE_readwriteSplittingRuleDefinition = 3 + RDLStatementParserRULE_dataSourceDefinition = 4 + RDLStatementParserRULE_ruleName = 5 + RDLStatementParserRULE_writeStorageUnit = 6 + RDLStatementParserRULE_readStorageUnits = 7 + RDLStatementParserRULE_transactionalReadQueryStrategy = 8 + RDLStatementParserRULE_writeStorageUnitName = 9 + RDLStatementParserRULE_readStorageUnitsNames = 10 + RDLStatementParserRULE_transactionalReadQueryStrategyName = 11 + RDLStatementParserRULE_ifExists = 12 + RDLStatementParserRULE_ifNotExists = 13 + RDLStatementParserRULE_literal = 14 + RDLStatementParserRULE_algorithmDefinition = 15 + RDLStatementParserRULE_algorithmTypeName = 16 + RDLStatementParserRULE_buildInReadQueryLoadBalanceAlgorithmType = 17 + RDLStatementParserRULE_propertiesDefinition = 18 + RDLStatementParserRULE_properties = 19 + RDLStatementParserRULE_property = 20 + RDLStatementParserRULE_databaseName = 21 + RDLStatementParserRULE_groupName = 22 + RDLStatementParserRULE_storageUnitName = 23 +) + +// ICreateReadwriteSplittingRuleContext is an interface to support dynamic dispatch. +type ICreateReadwriteSplittingRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsCreateReadwriteSplittingRuleContext differentiates from other interfaces. + IsCreateReadwriteSplittingRuleContext() +} + +type CreateReadwriteSplittingRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreateReadwriteSplittingRuleContext() *CreateReadwriteSplittingRuleContext { + var p = new(CreateReadwriteSplittingRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_createReadwriteSplittingRule + return p +} + +func (*CreateReadwriteSplittingRuleContext) IsCreateReadwriteSplittingRuleContext() {} + +func NewCreateReadwriteSplittingRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateReadwriteSplittingRuleContext { + var p = new(CreateReadwriteSplittingRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_createReadwriteSplittingRule + + return p +} + +func (s *CreateReadwriteSplittingRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateReadwriteSplittingRuleContext) CREATE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCREATE, 0) +} + +func (s *CreateReadwriteSplittingRuleContext) READWRITE_SPLITTING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserREADWRITE_SPLITTING, 0) +} + +func (s *CreateReadwriteSplittingRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *CreateReadwriteSplittingRuleContext) AllReadwriteSplittingRuleDefinition() []IReadwriteSplittingRuleDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IReadwriteSplittingRuleDefinitionContext)(nil)).Elem()) + var tst = make([]IReadwriteSplittingRuleDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IReadwriteSplittingRuleDefinitionContext) + } + } + + return tst +} + +func (s *CreateReadwriteSplittingRuleContext) ReadwriteSplittingRuleDefinition(i int) IReadwriteSplittingRuleDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IReadwriteSplittingRuleDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IReadwriteSplittingRuleDefinitionContext) +} + +func (s *CreateReadwriteSplittingRuleContext) IfNotExists() IIfNotExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfNotExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfNotExistsContext) +} + +func (s *CreateReadwriteSplittingRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *CreateReadwriteSplittingRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *CreateReadwriteSplittingRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateReadwriteSplittingRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CreateReadwriteSplittingRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitCreateReadwriteSplittingRule(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) CreateReadwriteSplittingRule() (localctx ICreateReadwriteSplittingRuleContext) { + localctx = NewCreateReadwriteSplittingRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 0, RDLStatementParserRULE_createReadwriteSplittingRule) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(48) + p.Match(RDLStatementParserCREATE) + } + { + p.SetState(49) + p.Match(RDLStatementParserREADWRITE_SPLITTING) + } + { + p.SetState(50) + p.Match(RDLStatementParserRULE) + } + p.SetState(52) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserIF { + { + p.SetState(51) + p.IfNotExists() + } + + } + { + p.SetState(54) + p.ReadwriteSplittingRuleDefinition() + } + p.SetState(59) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(55) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(56) + p.ReadwriteSplittingRuleDefinition() + } + + p.SetState(61) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// IAlterReadwriteSplittingRuleContext is an interface to support dynamic dispatch. +type IAlterReadwriteSplittingRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlterReadwriteSplittingRuleContext differentiates from other interfaces. + IsAlterReadwriteSplittingRuleContext() +} + +type AlterReadwriteSplittingRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlterReadwriteSplittingRuleContext() *AlterReadwriteSplittingRuleContext { + var p = new(AlterReadwriteSplittingRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_alterReadwriteSplittingRule + return p +} + +func (*AlterReadwriteSplittingRuleContext) IsAlterReadwriteSplittingRuleContext() {} + +func NewAlterReadwriteSplittingRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlterReadwriteSplittingRuleContext { + var p = new(AlterReadwriteSplittingRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_alterReadwriteSplittingRule + + return p +} + +func (s *AlterReadwriteSplittingRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlterReadwriteSplittingRuleContext) ALTER() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALTER, 0) +} + +func (s *AlterReadwriteSplittingRuleContext) READWRITE_SPLITTING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserREADWRITE_SPLITTING, 0) +} + +func (s *AlterReadwriteSplittingRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *AlterReadwriteSplittingRuleContext) AllReadwriteSplittingRuleDefinition() []IReadwriteSplittingRuleDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IReadwriteSplittingRuleDefinitionContext)(nil)).Elem()) + var tst = make([]IReadwriteSplittingRuleDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IReadwriteSplittingRuleDefinitionContext) + } + } + + return tst +} + +func (s *AlterReadwriteSplittingRuleContext) ReadwriteSplittingRuleDefinition(i int) IReadwriteSplittingRuleDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IReadwriteSplittingRuleDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IReadwriteSplittingRuleDefinitionContext) +} + +func (s *AlterReadwriteSplittingRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *AlterReadwriteSplittingRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *AlterReadwriteSplittingRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlterReadwriteSplittingRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlterReadwriteSplittingRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlterReadwriteSplittingRule(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlterReadwriteSplittingRule() (localctx IAlterReadwriteSplittingRuleContext) { + localctx = NewAlterReadwriteSplittingRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 2, RDLStatementParserRULE_alterReadwriteSplittingRule) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(62) + p.Match(RDLStatementParserALTER) + } + { + p.SetState(63) + p.Match(RDLStatementParserREADWRITE_SPLITTING) + } + { + p.SetState(64) + p.Match(RDLStatementParserRULE) + } + { + p.SetState(65) + p.ReadwriteSplittingRuleDefinition() + } + p.SetState(70) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(66) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(67) + p.ReadwriteSplittingRuleDefinition() + } + + p.SetState(72) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// IDropReadwriteSplittingRuleContext is an interface to support dynamic dispatch. +type IDropReadwriteSplittingRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropReadwriteSplittingRuleContext differentiates from other interfaces. + IsDropReadwriteSplittingRuleContext() +} + +type DropReadwriteSplittingRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropReadwriteSplittingRuleContext() *DropReadwriteSplittingRuleContext { + var p = new(DropReadwriteSplittingRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropReadwriteSplittingRule + return p +} + +func (*DropReadwriteSplittingRuleContext) IsDropReadwriteSplittingRuleContext() {} + +func NewDropReadwriteSplittingRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropReadwriteSplittingRuleContext { + var p = new(DropReadwriteSplittingRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropReadwriteSplittingRule + + return p +} + +func (s *DropReadwriteSplittingRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropReadwriteSplittingRuleContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropReadwriteSplittingRuleContext) READWRITE_SPLITTING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserREADWRITE_SPLITTING, 0) +} + +func (s *DropReadwriteSplittingRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *DropReadwriteSplittingRuleContext) AllRuleName() []IRuleNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IRuleNameContext)(nil)).Elem()) + var tst = make([]IRuleNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IRuleNameContext) + } + } + + return tst +} + +func (s *DropReadwriteSplittingRuleContext) RuleName(i int) IRuleNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IRuleNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IRuleNameContext) +} + +func (s *DropReadwriteSplittingRuleContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropReadwriteSplittingRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DropReadwriteSplittingRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DropReadwriteSplittingRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropReadwriteSplittingRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DropReadwriteSplittingRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropReadwriteSplittingRule(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) DropReadwriteSplittingRule() (localctx IDropReadwriteSplittingRuleContext) { + localctx = NewDropReadwriteSplittingRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 4, RDLStatementParserRULE_dropReadwriteSplittingRule) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(73) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(74) + p.Match(RDLStatementParserREADWRITE_SPLITTING) + } + { + p.SetState(75) + p.Match(RDLStatementParserRULE) + } + p.SetState(77) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserIF { + { + p.SetState(76) + p.IfExists() + } + + } + { + p.SetState(79) + p.RuleName() + } + p.SetState(84) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(80) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(81) + p.RuleName() + } + + p.SetState(86) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// IReadwriteSplittingRuleDefinitionContext is an interface to support dynamic dispatch. +type IReadwriteSplittingRuleDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsReadwriteSplittingRuleDefinitionContext differentiates from other interfaces. + IsReadwriteSplittingRuleDefinitionContext() +} + +type ReadwriteSplittingRuleDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyReadwriteSplittingRuleDefinitionContext() *ReadwriteSplittingRuleDefinitionContext { + var p = new(ReadwriteSplittingRuleDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_readwriteSplittingRuleDefinition + return p +} + +func (*ReadwriteSplittingRuleDefinitionContext) IsReadwriteSplittingRuleDefinitionContext() {} + +func NewReadwriteSplittingRuleDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReadwriteSplittingRuleDefinitionContext { + var p = new(ReadwriteSplittingRuleDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_readwriteSplittingRuleDefinition + + return p +} + +func (s *ReadwriteSplittingRuleDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *ReadwriteSplittingRuleDefinitionContext) RuleName() IRuleNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IRuleNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IRuleNameContext) +} + +func (s *ReadwriteSplittingRuleDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *ReadwriteSplittingRuleDefinitionContext) DataSourceDefinition() IDataSourceDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataSourceDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IDataSourceDefinitionContext) +} + +func (s *ReadwriteSplittingRuleDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *ReadwriteSplittingRuleDefinitionContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *ReadwriteSplittingRuleDefinitionContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *ReadwriteSplittingRuleDefinitionContext) TransactionalReadQueryStrategy() ITransactionalReadQueryStrategyContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITransactionalReadQueryStrategyContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(ITransactionalReadQueryStrategyContext) +} + +func (s *ReadwriteSplittingRuleDefinitionContext) AlgorithmDefinition() IAlgorithmDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmDefinitionContext) +} + +func (s *ReadwriteSplittingRuleDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ReadwriteSplittingRuleDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ReadwriteSplittingRuleDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitReadwriteSplittingRuleDefinition(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) ReadwriteSplittingRuleDefinition() (localctx IReadwriteSplittingRuleDefinitionContext) { + localctx = NewReadwriteSplittingRuleDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 6, RDLStatementParserRULE_readwriteSplittingRuleDefinition) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(87) + p.RuleName() + } + { + p.SetState(88) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(89) + p.DataSourceDefinition() + } + p.SetState(92) + p.GetErrorHandler().Sync(p) + + if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 5, p.GetParserRuleContext()) == 1 { + { + p.SetState(90) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(91) + p.TransactionalReadQueryStrategy() + } + + } + p.SetState(96) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserCOMMA_ { + { + p.SetState(94) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(95) + p.AlgorithmDefinition() + } + + } + { + p.SetState(98) + p.Match(RDLStatementParserRP_) + } + + return localctx +} + +// IDataSourceDefinitionContext is an interface to support dynamic dispatch. +type IDataSourceDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDataSourceDefinitionContext differentiates from other interfaces. + IsDataSourceDefinitionContext() +} + +type DataSourceDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDataSourceDefinitionContext() *DataSourceDefinitionContext { + var p = new(DataSourceDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dataSourceDefinition + return p +} + +func (*DataSourceDefinitionContext) IsDataSourceDefinitionContext() {} + +func NewDataSourceDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DataSourceDefinitionContext { + var p = new(DataSourceDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dataSourceDefinition + + return p +} + +func (s *DataSourceDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *DataSourceDefinitionContext) WriteStorageUnit() IWriteStorageUnitContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IWriteStorageUnitContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IWriteStorageUnitContext) +} + +func (s *DataSourceDefinitionContext) COMMA_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, 0) +} + +func (s *DataSourceDefinitionContext) ReadStorageUnits() IReadStorageUnitsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IReadStorageUnitsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IReadStorageUnitsContext) +} + +func (s *DataSourceDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DataSourceDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DataSourceDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDataSourceDefinition(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) DataSourceDefinition() (localctx IDataSourceDefinitionContext) { + localctx = NewDataSourceDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 8, RDLStatementParserRULE_dataSourceDefinition) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(100) + p.WriteStorageUnit() + } + { + p.SetState(101) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(102) + p.ReadStorageUnits() + } + + return localctx +} + +// IRuleNameContext is an interface to support dynamic dispatch. +type IRuleNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsRuleNameContext differentiates from other interfaces. + IsRuleNameContext() +} + +type RuleNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyRuleNameContext() *RuleNameContext { + var p = new(RuleNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_ruleName + return p +} + +func (*RuleNameContext) IsRuleNameContext() {} + +func NewRuleNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RuleNameContext { + var p = new(RuleNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_ruleName + + return p +} + +func (s *RuleNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *RuleNameContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *RuleNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *RuleNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *RuleNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitRuleName(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) RuleName() (localctx IRuleNameContext) { + localctx = NewRuleNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 10, RDLStatementParserRULE_ruleName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(104) + p.Match(RDLStatementParserIDENTIFIER_) + } + + return localctx +} + +// IWriteStorageUnitContext is an interface to support dynamic dispatch. +type IWriteStorageUnitContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsWriteStorageUnitContext differentiates from other interfaces. + IsWriteStorageUnitContext() +} + +type WriteStorageUnitContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyWriteStorageUnitContext() *WriteStorageUnitContext { + var p = new(WriteStorageUnitContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_writeStorageUnit + return p +} + +func (*WriteStorageUnitContext) IsWriteStorageUnitContext() {} + +func NewWriteStorageUnitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WriteStorageUnitContext { + var p = new(WriteStorageUnitContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_writeStorageUnit + + return p +} + +func (s *WriteStorageUnitContext) GetParser() antlr.Parser { return s.parser } + +func (s *WriteStorageUnitContext) WRITE_STORAGE_UNIT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserWRITE_STORAGE_UNIT, 0) +} + +func (s *WriteStorageUnitContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *WriteStorageUnitContext) WriteStorageUnitName() IWriteStorageUnitNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IWriteStorageUnitNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IWriteStorageUnitNameContext) +} + +func (s *WriteStorageUnitContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *WriteStorageUnitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *WriteStorageUnitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitWriteStorageUnit(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) WriteStorageUnit() (localctx IWriteStorageUnitContext) { + localctx = NewWriteStorageUnitContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, RDLStatementParserRULE_writeStorageUnit) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(106) + p.Match(RDLStatementParserWRITE_STORAGE_UNIT) + } + { + p.SetState(107) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(108) + p.WriteStorageUnitName() + } + + return localctx +} + +// IReadStorageUnitsContext is an interface to support dynamic dispatch. +type IReadStorageUnitsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsReadStorageUnitsContext differentiates from other interfaces. + IsReadStorageUnitsContext() +} + +type ReadStorageUnitsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyReadStorageUnitsContext() *ReadStorageUnitsContext { + var p = new(ReadStorageUnitsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_readStorageUnits + return p +} + +func (*ReadStorageUnitsContext) IsReadStorageUnitsContext() {} + +func NewReadStorageUnitsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReadStorageUnitsContext { + var p = new(ReadStorageUnitsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_readStorageUnits + + return p +} + +func (s *ReadStorageUnitsContext) GetParser() antlr.Parser { return s.parser } + +func (s *ReadStorageUnitsContext) READ_STORAGE_UNITS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserREAD_STORAGE_UNITS, 0) +} + +func (s *ReadStorageUnitsContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *ReadStorageUnitsContext) ReadStorageUnitsNames() IReadStorageUnitsNamesContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IReadStorageUnitsNamesContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IReadStorageUnitsNamesContext) +} + +func (s *ReadStorageUnitsContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *ReadStorageUnitsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ReadStorageUnitsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ReadStorageUnitsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitReadStorageUnits(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) ReadStorageUnits() (localctx IReadStorageUnitsContext) { + localctx = NewReadStorageUnitsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 14, RDLStatementParserRULE_readStorageUnits) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(110) + p.Match(RDLStatementParserREAD_STORAGE_UNITS) + } + { + p.SetState(111) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(112) + p.ReadStorageUnitsNames() + } + { + p.SetState(113) + p.Match(RDLStatementParserRP_) + } + + return localctx +} + +// ITransactionalReadQueryStrategyContext is an interface to support dynamic dispatch. +type ITransactionalReadQueryStrategyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsTransactionalReadQueryStrategyContext differentiates from other interfaces. + IsTransactionalReadQueryStrategyContext() +} + +type TransactionalReadQueryStrategyContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTransactionalReadQueryStrategyContext() *TransactionalReadQueryStrategyContext { + var p = new(TransactionalReadQueryStrategyContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_transactionalReadQueryStrategy + return p +} + +func (*TransactionalReadQueryStrategyContext) IsTransactionalReadQueryStrategyContext() {} + +func NewTransactionalReadQueryStrategyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TransactionalReadQueryStrategyContext { + var p = new(TransactionalReadQueryStrategyContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_transactionalReadQueryStrategy + + return p +} + +func (s *TransactionalReadQueryStrategyContext) GetParser() antlr.Parser { return s.parser } + +func (s *TransactionalReadQueryStrategyContext) TRANSACTIONAL_READ_QUERY_STRATEGY() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTRANSACTIONAL_READ_QUERY_STRATEGY, 0) +} + +func (s *TransactionalReadQueryStrategyContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *TransactionalReadQueryStrategyContext) TransactionalReadQueryStrategyName() ITransactionalReadQueryStrategyNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITransactionalReadQueryStrategyNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(ITransactionalReadQueryStrategyNameContext) +} + +func (s *TransactionalReadQueryStrategyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TransactionalReadQueryStrategyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TransactionalReadQueryStrategyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitTransactionalReadQueryStrategy(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) TransactionalReadQueryStrategy() (localctx ITransactionalReadQueryStrategyContext) { + localctx = NewTransactionalReadQueryStrategyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, RDLStatementParserRULE_transactionalReadQueryStrategy) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(115) + p.Match(RDLStatementParserTRANSACTIONAL_READ_QUERY_STRATEGY) + } + { + p.SetState(116) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(117) + p.TransactionalReadQueryStrategyName() + } + + return localctx +} + +// IWriteStorageUnitNameContext is an interface to support dynamic dispatch. +type IWriteStorageUnitNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsWriteStorageUnitNameContext differentiates from other interfaces. + IsWriteStorageUnitNameContext() +} + +type WriteStorageUnitNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyWriteStorageUnitNameContext() *WriteStorageUnitNameContext { + var p = new(WriteStorageUnitNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_writeStorageUnitName + return p +} + +func (*WriteStorageUnitNameContext) IsWriteStorageUnitNameContext() {} + +func NewWriteStorageUnitNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WriteStorageUnitNameContext { + var p = new(WriteStorageUnitNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_writeStorageUnitName + + return p +} + +func (s *WriteStorageUnitNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *WriteStorageUnitNameContext) StorageUnitName() IStorageUnitNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IStorageUnitNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IStorageUnitNameContext) +} + +func (s *WriteStorageUnitNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *WriteStorageUnitNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *WriteStorageUnitNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitWriteStorageUnitName(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) WriteStorageUnitName() (localctx IWriteStorageUnitNameContext) { + localctx = NewWriteStorageUnitNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, RDLStatementParserRULE_writeStorageUnitName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(119) + p.StorageUnitName() + } + + return localctx +} + +// IReadStorageUnitsNamesContext is an interface to support dynamic dispatch. +type IReadStorageUnitsNamesContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsReadStorageUnitsNamesContext differentiates from other interfaces. + IsReadStorageUnitsNamesContext() +} + +type ReadStorageUnitsNamesContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyReadStorageUnitsNamesContext() *ReadStorageUnitsNamesContext { + var p = new(ReadStorageUnitsNamesContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_readStorageUnitsNames + return p +} + +func (*ReadStorageUnitsNamesContext) IsReadStorageUnitsNamesContext() {} + +func NewReadStorageUnitsNamesContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReadStorageUnitsNamesContext { + var p = new(ReadStorageUnitsNamesContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_readStorageUnitsNames + + return p +} + +func (s *ReadStorageUnitsNamesContext) GetParser() antlr.Parser { return s.parser } + +func (s *ReadStorageUnitsNamesContext) AllStorageUnitName() []IStorageUnitNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IStorageUnitNameContext)(nil)).Elem()) + var tst = make([]IStorageUnitNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IStorageUnitNameContext) + } + } + + return tst +} + +func (s *ReadStorageUnitsNamesContext) StorageUnitName(i int) IStorageUnitNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IStorageUnitNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IStorageUnitNameContext) +} + +func (s *ReadStorageUnitsNamesContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *ReadStorageUnitsNamesContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *ReadStorageUnitsNamesContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ReadStorageUnitsNamesContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ReadStorageUnitsNamesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitReadStorageUnitsNames(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) ReadStorageUnitsNames() (localctx IReadStorageUnitsNamesContext) { + localctx = NewReadStorageUnitsNamesContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 20, RDLStatementParserRULE_readStorageUnitsNames) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(121) + p.StorageUnitName() + } + p.SetState(126) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(122) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(123) + p.StorageUnitName() + } + + p.SetState(128) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// ITransactionalReadQueryStrategyNameContext is an interface to support dynamic dispatch. +type ITransactionalReadQueryStrategyNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsTransactionalReadQueryStrategyNameContext differentiates from other interfaces. + IsTransactionalReadQueryStrategyNameContext() +} + +type TransactionalReadQueryStrategyNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTransactionalReadQueryStrategyNameContext() *TransactionalReadQueryStrategyNameContext { + var p = new(TransactionalReadQueryStrategyNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_transactionalReadQueryStrategyName + return p +} + +func (*TransactionalReadQueryStrategyNameContext) IsTransactionalReadQueryStrategyNameContext() {} + +func NewTransactionalReadQueryStrategyNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TransactionalReadQueryStrategyNameContext { + var p = new(TransactionalReadQueryStrategyNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_transactionalReadQueryStrategyName + + return p +} + +func (s *TransactionalReadQueryStrategyNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *TransactionalReadQueryStrategyNameContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *TransactionalReadQueryStrategyNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TransactionalReadQueryStrategyNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TransactionalReadQueryStrategyNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitTransactionalReadQueryStrategyName(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) TransactionalReadQueryStrategyName() (localctx ITransactionalReadQueryStrategyNameContext) { + localctx = NewTransactionalReadQueryStrategyNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 22, RDLStatementParserRULE_transactionalReadQueryStrategyName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(129) + p.Match(RDLStatementParserSTRING_) + } + + return localctx +} + +// IIfExistsContext is an interface to support dynamic dispatch. +type IIfExistsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsIfExistsContext differentiates from other interfaces. + IsIfExistsContext() +} + +type IfExistsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIfExistsContext() *IfExistsContext { + var p = new(IfExistsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_ifExists + return p +} + +func (*IfExistsContext) IsIfExistsContext() {} + +func NewIfExistsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfExistsContext { + var p = new(IfExistsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_ifExists + + return p +} + +func (s *IfExistsContext) GetParser() antlr.Parser { return s.parser } + +func (s *IfExistsContext) IF() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIF, 0) +} + +func (s *IfExistsContext) EXISTS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEXISTS, 0) +} + +func (s *IfExistsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IfExistsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IfExistsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitIfExists(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) IfExists() (localctx IIfExistsContext) { + localctx = NewIfExistsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 24, RDLStatementParserRULE_ifExists) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(131) + p.Match(RDLStatementParserIF) + } + { + p.SetState(132) + p.Match(RDLStatementParserEXISTS) + } + + return localctx +} + +// IIfNotExistsContext is an interface to support dynamic dispatch. +type IIfNotExistsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsIfNotExistsContext differentiates from other interfaces. + IsIfNotExistsContext() +} + +type IfNotExistsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIfNotExistsContext() *IfNotExistsContext { + var p = new(IfNotExistsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_ifNotExists + return p +} + +func (*IfNotExistsContext) IsIfNotExistsContext() {} + +func NewIfNotExistsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfNotExistsContext { + var p = new(IfNotExistsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_ifNotExists + + return p +} + +func (s *IfNotExistsContext) GetParser() antlr.Parser { return s.parser } + +func (s *IfNotExistsContext) IF() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIF, 0) +} + +func (s *IfNotExistsContext) NOT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNOT, 0) +} + +func (s *IfNotExistsContext) EXISTS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEXISTS, 0) +} + +func (s *IfNotExistsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IfNotExistsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IfNotExistsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitIfNotExists(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) IfNotExists() (localctx IIfNotExistsContext) { + localctx = NewIfNotExistsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 26, RDLStatementParserRULE_ifNotExists) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(134) + p.Match(RDLStatementParserIF) + } + { + p.SetState(135) + p.Match(RDLStatementParserNOT) + } + { + p.SetState(136) + p.Match(RDLStatementParserEXISTS) + } + + return localctx +} + +// 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) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_literal + return p +} + +func (*LiteralContext) IsLiteralContext() {} + +func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext { + var p = new(LiteralContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_literal + + return p +} + +func (s *LiteralContext) GetParser() antlr.Parser { return s.parser } + +func (s *LiteralContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *LiteralContext) INT_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserINT_, 0) +} + +func (s *LiteralContext) MINUS_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMINUS_, 0) +} + +func (s *LiteralContext) TRUE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTRUE, 0) +} + +func (s *LiteralContext) FALSE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserFALSE, 0) +} + +func (s *LiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitLiteral(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) Literal() (localctx ILiteralContext) { + localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 28, RDLStatementParserRULE_literal) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.SetState(145) + p.GetErrorHandler().Sync(p) + + switch p.GetTokenStream().LA(1) { + case RDLStatementParserSTRING_: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(138) + p.Match(RDLStatementParserSTRING_) + } + + case RDLStatementParserMINUS_, RDLStatementParserINT_: + p.EnterOuterAlt(localctx, 2) + p.SetState(140) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserMINUS_ { + { + p.SetState(139) + p.Match(RDLStatementParserMINUS_) + } + + } + { + p.SetState(142) + p.Match(RDLStatementParserINT_) + } + + case RDLStatementParserTRUE: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(143) + p.Match(RDLStatementParserTRUE) + } + + case RDLStatementParserFALSE: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(144) + p.Match(RDLStatementParserFALSE) + } + + default: + panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + } + + return localctx +} + +// IAlgorithmDefinitionContext is an interface to support dynamic dispatch. +type IAlgorithmDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlgorithmDefinitionContext differentiates from other interfaces. + IsAlgorithmDefinitionContext() +} + +type AlgorithmDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlgorithmDefinitionContext() *AlgorithmDefinitionContext { + var p = new(AlgorithmDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_algorithmDefinition + return p +} + +func (*AlgorithmDefinitionContext) IsAlgorithmDefinitionContext() {} + +func NewAlgorithmDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlgorithmDefinitionContext { + var p = new(AlgorithmDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_algorithmDefinition + + return p +} + +func (s *AlgorithmDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlgorithmDefinitionContext) TYPE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTYPE, 0) +} + +func (s *AlgorithmDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *AlgorithmDefinitionContext) NAME() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNAME, 0) +} + +func (s *AlgorithmDefinitionContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *AlgorithmDefinitionContext) AlgorithmTypeName() IAlgorithmTypeNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmTypeNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmTypeNameContext) +} + +func (s *AlgorithmDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *AlgorithmDefinitionContext) COMMA_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, 0) +} + +func (s *AlgorithmDefinitionContext) PropertiesDefinition() IPropertiesDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertiesDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IPropertiesDefinitionContext) +} + +func (s *AlgorithmDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlgorithmDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlgorithmDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlgorithmDefinition(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlgorithmDefinition() (localctx IAlgorithmDefinitionContext) { + localctx = NewAlgorithmDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 30, RDLStatementParserRULE_algorithmDefinition) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(147) + p.Match(RDLStatementParserTYPE) + } + { + p.SetState(148) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(149) + p.Match(RDLStatementParserNAME) + } + { + p.SetState(150) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(151) + p.AlgorithmTypeName() + } + p.SetState(154) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserCOMMA_ { + { + p.SetState(152) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(153) + p.PropertiesDefinition() + } + + } + { + p.SetState(156) + p.Match(RDLStatementParserRP_) + } + + return localctx +} + +// IAlgorithmTypeNameContext is an interface to support dynamic dispatch. +type IAlgorithmTypeNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlgorithmTypeNameContext differentiates from other interfaces. + IsAlgorithmTypeNameContext() +} + +type AlgorithmTypeNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlgorithmTypeNameContext() *AlgorithmTypeNameContext { + var p = new(AlgorithmTypeNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_algorithmTypeName + return p +} + +func (*AlgorithmTypeNameContext) IsAlgorithmTypeNameContext() {} + +func NewAlgorithmTypeNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlgorithmTypeNameContext { + var p = new(AlgorithmTypeNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_algorithmTypeName + + return p +} + +func (s *AlgorithmTypeNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlgorithmTypeNameContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *AlgorithmTypeNameContext) BuildInReadQueryLoadBalanceAlgorithmType() IBuildInReadQueryLoadBalanceAlgorithmTypeContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IBuildInReadQueryLoadBalanceAlgorithmTypeContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IBuildInReadQueryLoadBalanceAlgorithmTypeContext) +} + +func (s *AlgorithmTypeNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlgorithmTypeNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlgorithmTypeNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlgorithmTypeName(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlgorithmTypeName() (localctx IAlgorithmTypeNameContext) { + localctx = NewAlgorithmTypeNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 32, RDLStatementParserRULE_algorithmTypeName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.SetState(160) + p.GetErrorHandler().Sync(p) + + switch p.GetTokenStream().LA(1) { + case RDLStatementParserSTRING_: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(158) + p.Match(RDLStatementParserSTRING_) + } + + case RDLStatementParserROUND_ROBIN, RDLStatementParserRANDOM, RDLStatementParserWEIGHT: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(159) + p.BuildInReadQueryLoadBalanceAlgorithmType() + } + + default: + panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + } + + return localctx +} + +// IBuildInReadQueryLoadBalanceAlgorithmTypeContext is an interface to support dynamic dispatch. +type IBuildInReadQueryLoadBalanceAlgorithmTypeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsBuildInReadQueryLoadBalanceAlgorithmTypeContext differentiates from other interfaces. + IsBuildInReadQueryLoadBalanceAlgorithmTypeContext() +} + +type BuildInReadQueryLoadBalanceAlgorithmTypeContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBuildInReadQueryLoadBalanceAlgorithmTypeContext() *BuildInReadQueryLoadBalanceAlgorithmTypeContext { + var p = new(BuildInReadQueryLoadBalanceAlgorithmTypeContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_buildInReadQueryLoadBalanceAlgorithmType + return p +} + +func (*BuildInReadQueryLoadBalanceAlgorithmTypeContext) IsBuildInReadQueryLoadBalanceAlgorithmTypeContext() { +} + +func NewBuildInReadQueryLoadBalanceAlgorithmTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BuildInReadQueryLoadBalanceAlgorithmTypeContext { + var p = new(BuildInReadQueryLoadBalanceAlgorithmTypeContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_buildInReadQueryLoadBalanceAlgorithmType + + return p +} + +func (s *BuildInReadQueryLoadBalanceAlgorithmTypeContext) GetParser() antlr.Parser { return s.parser } + +func (s *BuildInReadQueryLoadBalanceAlgorithmTypeContext) ROUND_ROBIN() antlr.TerminalNode { + return s.GetToken(RDLStatementParserROUND_ROBIN, 0) +} + +func (s *BuildInReadQueryLoadBalanceAlgorithmTypeContext) RANDOM() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRANDOM, 0) +} + +func (s *BuildInReadQueryLoadBalanceAlgorithmTypeContext) WEIGHT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserWEIGHT, 0) +} + +func (s *BuildInReadQueryLoadBalanceAlgorithmTypeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BuildInReadQueryLoadBalanceAlgorithmTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *BuildInReadQueryLoadBalanceAlgorithmTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitBuildInReadQueryLoadBalanceAlgorithmType(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) BuildInReadQueryLoadBalanceAlgorithmType() (localctx IBuildInReadQueryLoadBalanceAlgorithmTypeContext) { + localctx = NewBuildInReadQueryLoadBalanceAlgorithmTypeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 34, RDLStatementParserRULE_buildInReadQueryLoadBalanceAlgorithmType) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(162) + _la = p.GetTokenStream().LA(1) + + if !(((_la-68)&-(0x1f+1)) == 0 && ((1<>'", "'^'", + "'%'", "':'", "'+'", "'-'", "'*'", "'/'", "'\\'", "'.'", "'.*'", "'<=>'", + "'=='", "'='", "", "'>'", "'>='", "'<'", "'<='", "'#'", "'('", "')'", "'{'", + "'}'", "'['", "']'", "','", "'\"'", "'''", "'`'", "'?'", "'@'", "';'", + "'->>'", "'_'", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "'DO NOT MATCH ANY THING, JUST FOR GENERATOR'", +} + +var lexerSymbolicNames = []string{ + "", "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "TRUE", "FALSE", "CREATE", "ALTER", "DROP", + "SHOW", "SHADOW", "SOURCE", "RULE", "FROM", "RESOURCES", "TABLE", "TYPE", + "NAME", "PROPERTIES", "RULES", "ALGORITHM", "ALGORITHMS", "SET", "ADD", + "DATABASE_VALUE", "TABLE_VALUE", "STATUS", "CLEAR", "DEFAULT", "IF", "EXISTS", + "COUNT", "VALUE_MATCH", "REGEX_MATCH", "SQL_HINT", "NOT", "FOR_GENERATOR", + "IDENTIFIER_", "STRING_", "INT_", "HEX_", "NUMBER_", "HEXDIGIT_", "BITNUM_", + "BOOL_", +} + +var lexerRuleNames = []string{ + "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "TRUE", "FALSE", "CREATE", "ALTER", "DROP", + "SHOW", "SHADOW", "SOURCE", "RULE", "FROM", "RESOURCES", "TABLE", "TYPE", + "NAME", "PROPERTIES", "RULES", "ALGORITHM", "ALGORITHMS", "SET", "ADD", + "DATABASE_VALUE", "TABLE_VALUE", "STATUS", "CLEAR", "DEFAULT", "IF", "EXISTS", + "COUNT", "VALUE_MATCH", "REGEX_MATCH", "SQL_HINT", "NOT", "FOR_GENERATOR", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", + "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "IDENTIFIER_", "STRING_", + "INT_", "HEX_", "NUMBER_", "HEXDIGIT_", "BITNUM_", "BOOL_", +} + +type RDLStatementLexer struct { + *antlr.BaseLexer + channelNames []string + modeNames []string + // TODO: EOF string +} + +var lexerDecisionToDFA = make([]*antlr.DFA, len(lexerAtn.DecisionToState)) + +func init() { + for index, ds := range lexerAtn.DecisionToState { + lexerDecisionToDFA[index] = antlr.NewDFA(ds, index) + } +} + +func NewRDLStatementLexer(input antlr.CharStream) *RDLStatementLexer { + + l := new(RDLStatementLexer) + + l.BaseLexer = antlr.NewBaseLexer(input) + l.Interpreter = antlr.NewLexerATNSimulator(l, lexerAtn, lexerDecisionToDFA, antlr.NewPredictionContextCache()) + + l.channelNames = lexerChannelNames + l.modeNames = lexerModeNames + l.RuleNames = lexerRuleNames + l.LiteralNames = lexerLiteralNames + l.SymbolicNames = lexerSymbolicNames + l.GrammarFileName = "RDLStatement.g4" + // TODO: l.EOF = antlr.TokenEOF + + return l +} + +// RDLStatementLexer tokens. +const ( + RDLStatementLexerAND_ = 1 + RDLStatementLexerOR_ = 2 + RDLStatementLexerNOT_ = 3 + RDLStatementLexerTILDE_ = 4 + RDLStatementLexerVERTICALBAR_ = 5 + RDLStatementLexerAMPERSAND_ = 6 + RDLStatementLexerSIGNEDLEFTSHIFT_ = 7 + RDLStatementLexerSIGNEDRIGHTSHIFT_ = 8 + RDLStatementLexerCARET_ = 9 + RDLStatementLexerMOD_ = 10 + RDLStatementLexerCOLON_ = 11 + RDLStatementLexerPLUS_ = 12 + RDLStatementLexerMINUS_ = 13 + RDLStatementLexerASTERISK_ = 14 + RDLStatementLexerSLASH_ = 15 + RDLStatementLexerBACKSLASH_ = 16 + RDLStatementLexerDOT_ = 17 + RDLStatementLexerDOTASTERISK_ = 18 + RDLStatementLexerSAFEEQ_ = 19 + RDLStatementLexerDEQ_ = 20 + RDLStatementLexerEQ_ = 21 + RDLStatementLexerNEQ_ = 22 + RDLStatementLexerGT_ = 23 + RDLStatementLexerGTE_ = 24 + RDLStatementLexerLT_ = 25 + RDLStatementLexerLTE_ = 26 + RDLStatementLexerPOUND_ = 27 + RDLStatementLexerLP_ = 28 + RDLStatementLexerRP_ = 29 + RDLStatementLexerLBE_ = 30 + RDLStatementLexerRBE_ = 31 + RDLStatementLexerLBT_ = 32 + RDLStatementLexerRBT_ = 33 + RDLStatementLexerCOMMA_ = 34 + RDLStatementLexerDQ_ = 35 + RDLStatementLexerSQ_ = 36 + RDLStatementLexerBQ_ = 37 + RDLStatementLexerQUESTION_ = 38 + RDLStatementLexerAT_ = 39 + RDLStatementLexerSEMI_ = 40 + RDLStatementLexerJSONSEPARATOR_ = 41 + RDLStatementLexerUL_ = 42 + RDLStatementLexerWS = 43 + RDLStatementLexerTRUE = 44 + RDLStatementLexerFALSE = 45 + RDLStatementLexerCREATE = 46 + RDLStatementLexerALTER = 47 + RDLStatementLexerDROP = 48 + RDLStatementLexerSHOW = 49 + RDLStatementLexerSHADOW = 50 + RDLStatementLexerSOURCE = 51 + RDLStatementLexerRULE = 52 + RDLStatementLexerFROM = 53 + RDLStatementLexerRESOURCES = 54 + RDLStatementLexerTABLE = 55 + RDLStatementLexerTYPE = 56 + RDLStatementLexerNAME = 57 + RDLStatementLexerPROPERTIES = 58 + RDLStatementLexerRULES = 59 + RDLStatementLexerALGORITHM = 60 + RDLStatementLexerALGORITHMS = 61 + RDLStatementLexerSET = 62 + RDLStatementLexerADD = 63 + RDLStatementLexerDATABASE_VALUE = 64 + RDLStatementLexerTABLE_VALUE = 65 + RDLStatementLexerSTATUS = 66 + RDLStatementLexerCLEAR = 67 + RDLStatementLexerDEFAULT = 68 + RDLStatementLexerIF = 69 + RDLStatementLexerEXISTS = 70 + RDLStatementLexerCOUNT = 71 + RDLStatementLexerVALUE_MATCH = 72 + RDLStatementLexerREGEX_MATCH = 73 + RDLStatementLexerSQL_HINT = 74 + RDLStatementLexerNOT = 75 + RDLStatementLexerFOR_GENERATOR = 76 + RDLStatementLexerIDENTIFIER_ = 77 + RDLStatementLexerSTRING_ = 78 + RDLStatementLexerINT_ = 79 + RDLStatementLexerHEX_ = 80 + RDLStatementLexerNUMBER_ = 81 + RDLStatementLexerHEXDIGIT_ = 82 + RDLStatementLexerBITNUM_ = 83 + RDLStatementLexerBOOL_ = 84 +) diff --git a/shardingsphere-operator/pkg/distsql/visitor_parser/shadow/rdlstatement_parser.go b/shardingsphere-operator/pkg/distsql/visitor_parser/shadow/rdlstatement_parser.go new file mode 100644 index 00000000..887165a7 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/visitor_parser/shadow/rdlstatement_parser.go @@ -0,0 +1,3389 @@ +// Code generated from RDLStatement.g4 by ANTLR 4.8. DO NOT EDIT. + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package parser // RDLStatement + +import ( + "fmt" + "reflect" + "strconv" + + "github.com/antlr/antlr4/runtime/Go/antlr" +) + +// Suppress unused import errors +var _ = fmt.Printf +var _ = reflect.Copy +var _ = strconv.Itoa + +var parserATN = []uint16{ + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 86, 218, + 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, + 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, + 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, + 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, + 4, 24, 9, 24, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 53, 10, 2, 3, 2, 3, 2, 3, 2, + 7, 2, 58, 10, 2, 12, 2, 14, 2, 61, 11, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 7, 3, 69, 10, 3, 12, 3, 14, 3, 72, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, + 5, 4, 78, 10, 4, 3, 4, 3, 4, 3, 4, 7, 4, 83, 10, 4, 12, 4, 14, 4, 86, 11, + 4, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 92, 10, 5, 3, 5, 3, 5, 3, 5, 7, 5, 97, + 10, 5, 12, 5, 14, 5, 100, 11, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 107, + 10, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 116, 10, 7, 3, 8, + 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, + 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 7, 9, 137, 10, 9, 12, 9, 14, 9, 140, + 11, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 149, 10, 10, + 12, 10, 14, 10, 152, 11, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, + 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, + 16, 3, 17, 3, 17, 5, 17, 173, 10, 17, 3, 17, 3, 17, 3, 17, 5, 17, 178, + 10, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 187, 10, + 18, 3, 18, 3, 18, 3, 19, 3, 19, 5, 19, 193, 10, 19, 3, 20, 3, 20, 3, 21, + 3, 21, 3, 21, 5, 21, 200, 10, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 7, + 22, 207, 10, 22, 12, 22, 14, 22, 210, 11, 22, 3, 23, 3, 23, 3, 23, 3, 23, + 3, 24, 3, 24, 3, 24, 2, 2, 25, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, + 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 2, 3, 3, 2, 74, 76, 2, + 213, 2, 48, 3, 2, 2, 2, 4, 62, 3, 2, 2, 2, 6, 73, 3, 2, 2, 2, 8, 87, 3, + 2, 2, 2, 10, 101, 3, 2, 2, 2, 12, 110, 3, 2, 2, 2, 14, 117, 3, 2, 2, 2, + 16, 123, 3, 2, 2, 2, 18, 143, 3, 2, 2, 2, 20, 155, 3, 2, 2, 2, 22, 157, + 3, 2, 2, 2, 24, 159, 3, 2, 2, 2, 26, 161, 3, 2, 2, 2, 28, 163, 3, 2, 2, + 2, 30, 166, 3, 2, 2, 2, 32, 177, 3, 2, 2, 2, 34, 179, 3, 2, 2, 2, 36, 192, + 3, 2, 2, 2, 38, 194, 3, 2, 2, 2, 40, 196, 3, 2, 2, 2, 42, 203, 3, 2, 2, + 2, 44, 211, 3, 2, 2, 2, 46, 215, 3, 2, 2, 2, 48, 49, 7, 48, 2, 2, 49, 50, + 7, 52, 2, 2, 50, 52, 7, 54, 2, 2, 51, 53, 5, 30, 16, 2, 52, 51, 3, 2, 2, + 2, 52, 53, 3, 2, 2, 2, 53, 54, 3, 2, 2, 2, 54, 59, 5, 16, 9, 2, 55, 56, + 7, 36, 2, 2, 56, 58, 5, 16, 9, 2, 57, 55, 3, 2, 2, 2, 58, 61, 3, 2, 2, + 2, 59, 57, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 3, 3, 2, 2, 2, 61, 59, 3, + 2, 2, 2, 62, 63, 7, 49, 2, 2, 63, 64, 7, 52, 2, 2, 64, 65, 7, 54, 2, 2, + 65, 70, 5, 16, 9, 2, 66, 67, 7, 36, 2, 2, 67, 69, 5, 16, 9, 2, 68, 66, + 3, 2, 2, 2, 69, 72, 3, 2, 2, 2, 70, 68, 3, 2, 2, 2, 70, 71, 3, 2, 2, 2, + 71, 5, 3, 2, 2, 2, 72, 70, 3, 2, 2, 2, 73, 74, 7, 50, 2, 2, 74, 75, 7, + 52, 2, 2, 75, 77, 7, 54, 2, 2, 76, 78, 5, 28, 15, 2, 77, 76, 3, 2, 2, 2, + 77, 78, 3, 2, 2, 2, 78, 79, 3, 2, 2, 2, 79, 84, 5, 46, 24, 2, 80, 81, 7, + 36, 2, 2, 81, 83, 5, 46, 24, 2, 82, 80, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, + 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 7, 3, 2, 2, 2, 86, 84, 3, 2, + 2, 2, 87, 88, 7, 50, 2, 2, 88, 89, 7, 52, 2, 2, 89, 91, 7, 62, 2, 2, 90, + 92, 5, 28, 15, 2, 91, 90, 3, 2, 2, 2, 91, 92, 3, 2, 2, 2, 92, 93, 3, 2, + 2, 2, 93, 98, 5, 26, 14, 2, 94, 95, 7, 36, 2, 2, 95, 97, 5, 26, 14, 2, + 96, 94, 3, 2, 2, 2, 97, 100, 3, 2, 2, 2, 98, 96, 3, 2, 2, 2, 98, 99, 3, + 2, 2, 2, 99, 9, 3, 2, 2, 2, 100, 98, 3, 2, 2, 2, 101, 102, 7, 48, 2, 2, + 102, 103, 7, 70, 2, 2, 103, 104, 7, 52, 2, 2, 104, 106, 7, 62, 2, 2, 105, + 107, 5, 30, 16, 2, 106, 105, 3, 2, 2, 2, 106, 107, 3, 2, 2, 2, 107, 108, + 3, 2, 2, 2, 108, 109, 5, 34, 18, 2, 109, 11, 3, 2, 2, 2, 110, 111, 7, 50, + 2, 2, 111, 112, 7, 70, 2, 2, 112, 113, 7, 52, 2, 2, 113, 115, 7, 62, 2, + 2, 114, 116, 5, 28, 15, 2, 115, 114, 3, 2, 2, 2, 115, 116, 3, 2, 2, 2, + 116, 13, 3, 2, 2, 2, 117, 118, 7, 49, 2, 2, 118, 119, 7, 70, 2, 2, 119, + 120, 7, 52, 2, 2, 120, 121, 7, 62, 2, 2, 121, 122, 5, 34, 18, 2, 122, 15, + 3, 2, 2, 2, 123, 124, 5, 46, 24, 2, 124, 125, 7, 30, 2, 2, 125, 126, 7, + 53, 2, 2, 126, 127, 7, 23, 2, 2, 127, 128, 5, 20, 11, 2, 128, 129, 7, 36, + 2, 2, 129, 130, 7, 52, 2, 2, 130, 131, 7, 23, 2, 2, 131, 132, 5, 22, 12, + 2, 132, 133, 7, 36, 2, 2, 133, 138, 5, 18, 10, 2, 134, 135, 7, 36, 2, 2, + 135, 137, 5, 18, 10, 2, 136, 134, 3, 2, 2, 2, 137, 140, 3, 2, 2, 2, 138, + 136, 3, 2, 2, 2, 138, 139, 3, 2, 2, 2, 139, 141, 3, 2, 2, 2, 140, 138, + 3, 2, 2, 2, 141, 142, 7, 31, 2, 2, 142, 17, 3, 2, 2, 2, 143, 144, 5, 24, + 13, 2, 144, 145, 7, 30, 2, 2, 145, 150, 5, 34, 18, 2, 146, 147, 7, 36, + 2, 2, 147, 149, 5, 34, 18, 2, 148, 146, 3, 2, 2, 2, 149, 152, 3, 2, 2, + 2, 150, 148, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 153, 3, 2, 2, 2, 152, + 150, 3, 2, 2, 2, 153, 154, 7, 31, 2, 2, 154, 19, 3, 2, 2, 2, 155, 156, + 7, 79, 2, 2, 156, 21, 3, 2, 2, 2, 157, 158, 7, 79, 2, 2, 158, 23, 3, 2, + 2, 2, 159, 160, 7, 79, 2, 2, 160, 25, 3, 2, 2, 2, 161, 162, 7, 79, 2, 2, + 162, 27, 3, 2, 2, 2, 163, 164, 7, 71, 2, 2, 164, 165, 7, 72, 2, 2, 165, + 29, 3, 2, 2, 2, 166, 167, 7, 71, 2, 2, 167, 168, 7, 77, 2, 2, 168, 169, + 7, 72, 2, 2, 169, 31, 3, 2, 2, 2, 170, 178, 7, 80, 2, 2, 171, 173, 7, 15, + 2, 2, 172, 171, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, + 174, 178, 7, 81, 2, 2, 175, 178, 7, 46, 2, 2, 176, 178, 7, 47, 2, 2, 177, + 170, 3, 2, 2, 2, 177, 172, 3, 2, 2, 2, 177, 175, 3, 2, 2, 2, 177, 176, + 3, 2, 2, 2, 178, 33, 3, 2, 2, 2, 179, 180, 7, 58, 2, 2, 180, 181, 7, 30, + 2, 2, 181, 182, 7, 59, 2, 2, 182, 183, 7, 23, 2, 2, 183, 186, 5, 36, 19, + 2, 184, 185, 7, 36, 2, 2, 185, 187, 5, 40, 21, 2, 186, 184, 3, 2, 2, 2, + 186, 187, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 189, 7, 31, 2, 2, 189, + 35, 3, 2, 2, 2, 190, 193, 7, 80, 2, 2, 191, 193, 5, 38, 20, 2, 192, 190, + 3, 2, 2, 2, 192, 191, 3, 2, 2, 2, 193, 37, 3, 2, 2, 2, 194, 195, 9, 2, + 2, 2, 195, 39, 3, 2, 2, 2, 196, 197, 7, 60, 2, 2, 197, 199, 7, 30, 2, 2, + 198, 200, 5, 42, 22, 2, 199, 198, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, + 201, 3, 2, 2, 2, 201, 202, 7, 31, 2, 2, 202, 41, 3, 2, 2, 2, 203, 208, + 5, 44, 23, 2, 204, 205, 7, 36, 2, 2, 205, 207, 5, 44, 23, 2, 206, 204, + 3, 2, 2, 2, 207, 210, 3, 2, 2, 2, 208, 206, 3, 2, 2, 2, 208, 209, 3, 2, + 2, 2, 209, 43, 3, 2, 2, 2, 210, 208, 3, 2, 2, 2, 211, 212, 7, 80, 2, 2, + 212, 213, 7, 23, 2, 2, 213, 214, 5, 32, 17, 2, 214, 45, 3, 2, 2, 2, 215, + 216, 7, 79, 2, 2, 216, 47, 3, 2, 2, 2, 19, 52, 59, 70, 77, 84, 91, 98, + 106, 115, 138, 150, 172, 177, 186, 192, 199, 208, +} +var deserializer = antlr.NewATNDeserializer(nil) +var deserializedATN = deserializer.DeserializeFromUInt16(parserATN) + +var literalNames = []string{ + "", "'&&'", "'||'", "'!'", "'~'", "'|'", "'&'", "'<<'", "'>>'", "'^'", + "'%'", "':'", "'+'", "'-'", "'*'", "'/'", "'\\'", "'.'", "'.*'", "'<=>'", + "'=='", "'='", "", "'>'", "'>='", "'<'", "'<='", "'#'", "'('", "')'", "'{'", + "'}'", "'['", "']'", "','", "'\"'", "'''", "'`'", "'?'", "'@'", "';'", + "'->>'", "'_'", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "'DO NOT MATCH ANY THING, JUST FOR GENERATOR'", +} +var symbolicNames = []string{ + "", "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "TRUE", "FALSE", "CREATE", "ALTER", "DROP", + "SHOW", "SHADOW", "SOURCE", "RULE", "FROM", "RESOURCES", "TABLE", "TYPE", + "NAME", "PROPERTIES", "RULES", "ALGORITHM", "ALGORITHMS", "SET", "ADD", + "DATABASE_VALUE", "TABLE_VALUE", "STATUS", "CLEAR", "DEFAULT", "IF", "EXISTS", + "COUNT", "VALUE_MATCH", "REGEX_MATCH", "SQL_HINT", "NOT", "FOR_GENERATOR", + "IDENTIFIER_", "STRING_", "INT_", "HEX_", "NUMBER_", "HEXDIGIT_", "BITNUM_", + "BOOL_", +} + +var ruleNames = []string{ + "createShadowRule", "alterShadowRule", "dropShadowRule", "dropShadowAlgorithm", + "createDefaultShadowAlgorithm", "dropDefaultShadowAlgorithm", "alterDefaultShadowAlgorithm", + "shadowRuleDefinition", "shadowTableRule", "source", "shadow", "tableName", + "algorithmName", "ifExists", "ifNotExists", "literal", "algorithmDefinition", + "algorithmTypeName", "buildInShadowAlgorithmType", "propertiesDefinition", + "properties", "property", "ruleName", +} +var decisionToDFA = make([]*antlr.DFA, len(deserializedATN.DecisionToState)) + +func init() { + for index, ds := range deserializedATN.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(ds, index) + } +} + +type RDLStatementParser struct { + *antlr.BaseParser +} + +func NewRDLStatementParser(input antlr.TokenStream) *RDLStatementParser { + this := new(RDLStatementParser) + + this.BaseParser = antlr.NewBaseParser(input) + + this.Interpreter = antlr.NewParserATNSimulator(this, deserializedATN, decisionToDFA, antlr.NewPredictionContextCache()) + this.RuleNames = ruleNames + this.LiteralNames = literalNames + this.SymbolicNames = symbolicNames + this.GrammarFileName = "RDLStatement.g4" + + return this +} + +// RDLStatementParser tokens. +const ( + RDLStatementParserEOF = antlr.TokenEOF + RDLStatementParserAND_ = 1 + RDLStatementParserOR_ = 2 + RDLStatementParserNOT_ = 3 + RDLStatementParserTILDE_ = 4 + RDLStatementParserVERTICALBAR_ = 5 + RDLStatementParserAMPERSAND_ = 6 + RDLStatementParserSIGNEDLEFTSHIFT_ = 7 + RDLStatementParserSIGNEDRIGHTSHIFT_ = 8 + RDLStatementParserCARET_ = 9 + RDLStatementParserMOD_ = 10 + RDLStatementParserCOLON_ = 11 + RDLStatementParserPLUS_ = 12 + RDLStatementParserMINUS_ = 13 + RDLStatementParserASTERISK_ = 14 + RDLStatementParserSLASH_ = 15 + RDLStatementParserBACKSLASH_ = 16 + RDLStatementParserDOT_ = 17 + RDLStatementParserDOTASTERISK_ = 18 + RDLStatementParserSAFEEQ_ = 19 + RDLStatementParserDEQ_ = 20 + RDLStatementParserEQ_ = 21 + RDLStatementParserNEQ_ = 22 + RDLStatementParserGT_ = 23 + RDLStatementParserGTE_ = 24 + RDLStatementParserLT_ = 25 + RDLStatementParserLTE_ = 26 + RDLStatementParserPOUND_ = 27 + RDLStatementParserLP_ = 28 + RDLStatementParserRP_ = 29 + RDLStatementParserLBE_ = 30 + RDLStatementParserRBE_ = 31 + RDLStatementParserLBT_ = 32 + RDLStatementParserRBT_ = 33 + RDLStatementParserCOMMA_ = 34 + RDLStatementParserDQ_ = 35 + RDLStatementParserSQ_ = 36 + RDLStatementParserBQ_ = 37 + RDLStatementParserQUESTION_ = 38 + RDLStatementParserAT_ = 39 + RDLStatementParserSEMI_ = 40 + RDLStatementParserJSONSEPARATOR_ = 41 + RDLStatementParserUL_ = 42 + RDLStatementParserWS = 43 + RDLStatementParserTRUE = 44 + RDLStatementParserFALSE = 45 + RDLStatementParserCREATE = 46 + RDLStatementParserALTER = 47 + RDLStatementParserDROP = 48 + RDLStatementParserSHOW = 49 + RDLStatementParserSHADOW = 50 + RDLStatementParserSOURCE = 51 + RDLStatementParserRULE = 52 + RDLStatementParserFROM = 53 + RDLStatementParserRESOURCES = 54 + RDLStatementParserTABLE = 55 + RDLStatementParserTYPE = 56 + RDLStatementParserNAME = 57 + RDLStatementParserPROPERTIES = 58 + RDLStatementParserRULES = 59 + RDLStatementParserALGORITHM = 60 + RDLStatementParserALGORITHMS = 61 + RDLStatementParserSET = 62 + RDLStatementParserADD = 63 + RDLStatementParserDATABASE_VALUE = 64 + RDLStatementParserTABLE_VALUE = 65 + RDLStatementParserSTATUS = 66 + RDLStatementParserCLEAR = 67 + RDLStatementParserDEFAULT = 68 + RDLStatementParserIF = 69 + RDLStatementParserEXISTS = 70 + RDLStatementParserCOUNT = 71 + RDLStatementParserVALUE_MATCH = 72 + RDLStatementParserREGEX_MATCH = 73 + RDLStatementParserSQL_HINT = 74 + RDLStatementParserNOT = 75 + RDLStatementParserFOR_GENERATOR = 76 + RDLStatementParserIDENTIFIER_ = 77 + RDLStatementParserSTRING_ = 78 + RDLStatementParserINT_ = 79 + RDLStatementParserHEX_ = 80 + RDLStatementParserNUMBER_ = 81 + RDLStatementParserHEXDIGIT_ = 82 + RDLStatementParserBITNUM_ = 83 + RDLStatementParserBOOL_ = 84 +) + +// RDLStatementParser rules. +const ( + RDLStatementParserRULE_createShadowRule = 0 + RDLStatementParserRULE_alterShadowRule = 1 + RDLStatementParserRULE_dropShadowRule = 2 + RDLStatementParserRULE_dropShadowAlgorithm = 3 + RDLStatementParserRULE_createDefaultShadowAlgorithm = 4 + RDLStatementParserRULE_dropDefaultShadowAlgorithm = 5 + RDLStatementParserRULE_alterDefaultShadowAlgorithm = 6 + RDLStatementParserRULE_shadowRuleDefinition = 7 + RDLStatementParserRULE_shadowTableRule = 8 + RDLStatementParserRULE_source = 9 + RDLStatementParserRULE_shadow = 10 + RDLStatementParserRULE_tableName = 11 + RDLStatementParserRULE_algorithmName = 12 + RDLStatementParserRULE_ifExists = 13 + RDLStatementParserRULE_ifNotExists = 14 + RDLStatementParserRULE_literal = 15 + RDLStatementParserRULE_algorithmDefinition = 16 + RDLStatementParserRULE_algorithmTypeName = 17 + RDLStatementParserRULE_buildInShadowAlgorithmType = 18 + RDLStatementParserRULE_propertiesDefinition = 19 + RDLStatementParserRULE_properties = 20 + RDLStatementParserRULE_property = 21 + RDLStatementParserRULE_ruleName = 22 +) + +// ICreateShadowRuleContext is an interface to support dynamic dispatch. +type ICreateShadowRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsCreateShadowRuleContext differentiates from other interfaces. + IsCreateShadowRuleContext() +} + +type CreateShadowRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreateShadowRuleContext() *CreateShadowRuleContext { + var p = new(CreateShadowRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_createShadowRule + return p +} + +func (*CreateShadowRuleContext) IsCreateShadowRuleContext() {} + +func NewCreateShadowRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateShadowRuleContext { + var p = new(CreateShadowRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_createShadowRule + + return p +} + +func (s *CreateShadowRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateShadowRuleContext) CREATE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCREATE, 0) +} + +func (s *CreateShadowRuleContext) SHADOW() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHADOW, 0) +} + +func (s *CreateShadowRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *CreateShadowRuleContext) AllShadowRuleDefinition() []IShadowRuleDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IShadowRuleDefinitionContext)(nil)).Elem()) + var tst = make([]IShadowRuleDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IShadowRuleDefinitionContext) + } + } + + return tst +} + +func (s *CreateShadowRuleContext) ShadowRuleDefinition(i int) IShadowRuleDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShadowRuleDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IShadowRuleDefinitionContext) +} + +func (s *CreateShadowRuleContext) IfNotExists() IIfNotExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfNotExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfNotExistsContext) +} + +func (s *CreateShadowRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *CreateShadowRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *CreateShadowRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateShadowRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CreateShadowRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitCreateShadowRule(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) CreateShadowRule() (localctx ICreateShadowRuleContext) { + localctx = NewCreateShadowRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 0, RDLStatementParserRULE_createShadowRule) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(46) + p.Match(RDLStatementParserCREATE) + } + { + p.SetState(47) + p.Match(RDLStatementParserSHADOW) + } + { + p.SetState(48) + p.Match(RDLStatementParserRULE) + } + p.SetState(50) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserIF { + { + p.SetState(49) + p.IfNotExists() + } + + } + { + p.SetState(52) + p.ShadowRuleDefinition() + } + p.SetState(57) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(53) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(54) + p.ShadowRuleDefinition() + } + + p.SetState(59) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// IAlterShadowRuleContext is an interface to support dynamic dispatch. +type IAlterShadowRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlterShadowRuleContext differentiates from other interfaces. + IsAlterShadowRuleContext() +} + +type AlterShadowRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlterShadowRuleContext() *AlterShadowRuleContext { + var p = new(AlterShadowRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_alterShadowRule + return p +} + +func (*AlterShadowRuleContext) IsAlterShadowRuleContext() {} + +func NewAlterShadowRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlterShadowRuleContext { + var p = new(AlterShadowRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_alterShadowRule + + return p +} + +func (s *AlterShadowRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlterShadowRuleContext) ALTER() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALTER, 0) +} + +func (s *AlterShadowRuleContext) SHADOW() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHADOW, 0) +} + +func (s *AlterShadowRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *AlterShadowRuleContext) AllShadowRuleDefinition() []IShadowRuleDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IShadowRuleDefinitionContext)(nil)).Elem()) + var tst = make([]IShadowRuleDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IShadowRuleDefinitionContext) + } + } + + return tst +} + +func (s *AlterShadowRuleContext) ShadowRuleDefinition(i int) IShadowRuleDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShadowRuleDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IShadowRuleDefinitionContext) +} + +func (s *AlterShadowRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *AlterShadowRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *AlterShadowRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlterShadowRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlterShadowRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlterShadowRule(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlterShadowRule() (localctx IAlterShadowRuleContext) { + localctx = NewAlterShadowRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 2, RDLStatementParserRULE_alterShadowRule) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(60) + p.Match(RDLStatementParserALTER) + } + { + p.SetState(61) + p.Match(RDLStatementParserSHADOW) + } + { + p.SetState(62) + p.Match(RDLStatementParserRULE) + } + { + p.SetState(63) + p.ShadowRuleDefinition() + } + p.SetState(68) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(64) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(65) + p.ShadowRuleDefinition() + } + + p.SetState(70) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// IDropShadowRuleContext is an interface to support dynamic dispatch. +type IDropShadowRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropShadowRuleContext differentiates from other interfaces. + IsDropShadowRuleContext() +} + +type DropShadowRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropShadowRuleContext() *DropShadowRuleContext { + var p = new(DropShadowRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropShadowRule + return p +} + +func (*DropShadowRuleContext) IsDropShadowRuleContext() {} + +func NewDropShadowRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropShadowRuleContext { + var p = new(DropShadowRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropShadowRule + + return p +} + +func (s *DropShadowRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropShadowRuleContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropShadowRuleContext) SHADOW() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHADOW, 0) +} + +func (s *DropShadowRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *DropShadowRuleContext) AllRuleName() []IRuleNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IRuleNameContext)(nil)).Elem()) + var tst = make([]IRuleNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IRuleNameContext) + } + } + + return tst +} + +func (s *DropShadowRuleContext) RuleName(i int) IRuleNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IRuleNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IRuleNameContext) +} + +func (s *DropShadowRuleContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropShadowRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DropShadowRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DropShadowRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropShadowRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DropShadowRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropShadowRule(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) DropShadowRule() (localctx IDropShadowRuleContext) { + localctx = NewDropShadowRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 4, RDLStatementParserRULE_dropShadowRule) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(71) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(72) + p.Match(RDLStatementParserSHADOW) + } + { + p.SetState(73) + p.Match(RDLStatementParserRULE) + } + p.SetState(75) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserIF { + { + p.SetState(74) + p.IfExists() + } + + } + { + p.SetState(77) + p.RuleName() + } + p.SetState(82) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(78) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(79) + p.RuleName() + } + + p.SetState(84) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// IDropShadowAlgorithmContext is an interface to support dynamic dispatch. +type IDropShadowAlgorithmContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropShadowAlgorithmContext differentiates from other interfaces. + IsDropShadowAlgorithmContext() +} + +type DropShadowAlgorithmContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropShadowAlgorithmContext() *DropShadowAlgorithmContext { + var p = new(DropShadowAlgorithmContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropShadowAlgorithm + return p +} + +func (*DropShadowAlgorithmContext) IsDropShadowAlgorithmContext() {} + +func NewDropShadowAlgorithmContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropShadowAlgorithmContext { + var p = new(DropShadowAlgorithmContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropShadowAlgorithm + + return p +} + +func (s *DropShadowAlgorithmContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropShadowAlgorithmContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropShadowAlgorithmContext) SHADOW() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHADOW, 0) +} + +func (s *DropShadowAlgorithmContext) ALGORITHM() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALGORITHM, 0) +} + +func (s *DropShadowAlgorithmContext) AllAlgorithmName() []IAlgorithmNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IAlgorithmNameContext)(nil)).Elem()) + var tst = make([]IAlgorithmNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IAlgorithmNameContext) + } + } + + return tst +} + +func (s *DropShadowAlgorithmContext) AlgorithmName(i int) IAlgorithmNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IAlgorithmNameContext) +} + +func (s *DropShadowAlgorithmContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropShadowAlgorithmContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DropShadowAlgorithmContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DropShadowAlgorithmContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropShadowAlgorithmContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DropShadowAlgorithmContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropShadowAlgorithm(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) DropShadowAlgorithm() (localctx IDropShadowAlgorithmContext) { + localctx = NewDropShadowAlgorithmContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 6, RDLStatementParserRULE_dropShadowAlgorithm) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(85) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(86) + p.Match(RDLStatementParserSHADOW) + } + { + p.SetState(87) + p.Match(RDLStatementParserALGORITHM) + } + p.SetState(89) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserIF { + { + p.SetState(88) + p.IfExists() + } + + } + { + p.SetState(91) + p.AlgorithmName() + } + p.SetState(96) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(92) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(93) + p.AlgorithmName() + } + + p.SetState(98) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + return localctx +} + +// ICreateDefaultShadowAlgorithmContext is an interface to support dynamic dispatch. +type ICreateDefaultShadowAlgorithmContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsCreateDefaultShadowAlgorithmContext differentiates from other interfaces. + IsCreateDefaultShadowAlgorithmContext() +} + +type CreateDefaultShadowAlgorithmContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreateDefaultShadowAlgorithmContext() *CreateDefaultShadowAlgorithmContext { + var p = new(CreateDefaultShadowAlgorithmContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_createDefaultShadowAlgorithm + return p +} + +func (*CreateDefaultShadowAlgorithmContext) IsCreateDefaultShadowAlgorithmContext() {} + +func NewCreateDefaultShadowAlgorithmContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateDefaultShadowAlgorithmContext { + var p = new(CreateDefaultShadowAlgorithmContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_createDefaultShadowAlgorithm + + return p +} + +func (s *CreateDefaultShadowAlgorithmContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateDefaultShadowAlgorithmContext) CREATE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCREATE, 0) +} + +func (s *CreateDefaultShadowAlgorithmContext) DEFAULT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDEFAULT, 0) +} + +func (s *CreateDefaultShadowAlgorithmContext) SHADOW() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHADOW, 0) +} + +func (s *CreateDefaultShadowAlgorithmContext) ALGORITHM() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALGORITHM, 0) +} + +func (s *CreateDefaultShadowAlgorithmContext) AlgorithmDefinition() IAlgorithmDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmDefinitionContext) +} + +func (s *CreateDefaultShadowAlgorithmContext) IfNotExists() IIfNotExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfNotExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfNotExistsContext) +} + +func (s *CreateDefaultShadowAlgorithmContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateDefaultShadowAlgorithmContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CreateDefaultShadowAlgorithmContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitCreateDefaultShadowAlgorithm(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) CreateDefaultShadowAlgorithm() (localctx ICreateDefaultShadowAlgorithmContext) { + localctx = NewCreateDefaultShadowAlgorithmContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 8, RDLStatementParserRULE_createDefaultShadowAlgorithm) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(99) + p.Match(RDLStatementParserCREATE) + } + { + p.SetState(100) + p.Match(RDLStatementParserDEFAULT) + } + { + p.SetState(101) + p.Match(RDLStatementParserSHADOW) + } + { + p.SetState(102) + p.Match(RDLStatementParserALGORITHM) + } + p.SetState(104) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserIF { + { + p.SetState(103) + p.IfNotExists() + } + + } + { + p.SetState(106) + p.AlgorithmDefinition() + } + + return localctx +} + +// IDropDefaultShadowAlgorithmContext is an interface to support dynamic dispatch. +type IDropDefaultShadowAlgorithmContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropDefaultShadowAlgorithmContext differentiates from other interfaces. + IsDropDefaultShadowAlgorithmContext() +} + +type DropDefaultShadowAlgorithmContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropDefaultShadowAlgorithmContext() *DropDefaultShadowAlgorithmContext { + var p = new(DropDefaultShadowAlgorithmContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropDefaultShadowAlgorithm + return p +} + +func (*DropDefaultShadowAlgorithmContext) IsDropDefaultShadowAlgorithmContext() {} + +func NewDropDefaultShadowAlgorithmContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropDefaultShadowAlgorithmContext { + var p = new(DropDefaultShadowAlgorithmContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropDefaultShadowAlgorithm + + return p +} + +func (s *DropDefaultShadowAlgorithmContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropDefaultShadowAlgorithmContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropDefaultShadowAlgorithmContext) DEFAULT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDEFAULT, 0) +} + +func (s *DropDefaultShadowAlgorithmContext) SHADOW() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHADOW, 0) +} + +func (s *DropDefaultShadowAlgorithmContext) ALGORITHM() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALGORITHM, 0) +} + +func (s *DropDefaultShadowAlgorithmContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropDefaultShadowAlgorithmContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropDefaultShadowAlgorithmContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DropDefaultShadowAlgorithmContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropDefaultShadowAlgorithm(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) DropDefaultShadowAlgorithm() (localctx IDropDefaultShadowAlgorithmContext) { + localctx = NewDropDefaultShadowAlgorithmContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 10, RDLStatementParserRULE_dropDefaultShadowAlgorithm) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(108) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(109) + p.Match(RDLStatementParserDEFAULT) + } + { + p.SetState(110) + p.Match(RDLStatementParserSHADOW) + } + { + p.SetState(111) + p.Match(RDLStatementParserALGORITHM) + } + p.SetState(113) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserIF { + { + p.SetState(112) + p.IfExists() + } + + } + + return localctx +} + +// IAlterDefaultShadowAlgorithmContext is an interface to support dynamic dispatch. +type IAlterDefaultShadowAlgorithmContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlterDefaultShadowAlgorithmContext differentiates from other interfaces. + IsAlterDefaultShadowAlgorithmContext() +} + +type AlterDefaultShadowAlgorithmContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlterDefaultShadowAlgorithmContext() *AlterDefaultShadowAlgorithmContext { + var p = new(AlterDefaultShadowAlgorithmContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_alterDefaultShadowAlgorithm + return p +} + +func (*AlterDefaultShadowAlgorithmContext) IsAlterDefaultShadowAlgorithmContext() {} + +func NewAlterDefaultShadowAlgorithmContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlterDefaultShadowAlgorithmContext { + var p = new(AlterDefaultShadowAlgorithmContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_alterDefaultShadowAlgorithm + + return p +} + +func (s *AlterDefaultShadowAlgorithmContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlterDefaultShadowAlgorithmContext) ALTER() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALTER, 0) +} + +func (s *AlterDefaultShadowAlgorithmContext) DEFAULT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDEFAULT, 0) +} + +func (s *AlterDefaultShadowAlgorithmContext) SHADOW() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHADOW, 0) +} + +func (s *AlterDefaultShadowAlgorithmContext) ALGORITHM() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALGORITHM, 0) +} + +func (s *AlterDefaultShadowAlgorithmContext) AlgorithmDefinition() IAlgorithmDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmDefinitionContext) +} + +func (s *AlterDefaultShadowAlgorithmContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlterDefaultShadowAlgorithmContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlterDefaultShadowAlgorithmContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlterDefaultShadowAlgorithm(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlterDefaultShadowAlgorithm() (localctx IAlterDefaultShadowAlgorithmContext) { + localctx = NewAlterDefaultShadowAlgorithmContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, RDLStatementParserRULE_alterDefaultShadowAlgorithm) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(115) + p.Match(RDLStatementParserALTER) + } + { + p.SetState(116) + p.Match(RDLStatementParserDEFAULT) + } + { + p.SetState(117) + p.Match(RDLStatementParserSHADOW) + } + { + p.SetState(118) + p.Match(RDLStatementParserALGORITHM) + } + { + p.SetState(119) + p.AlgorithmDefinition() + } + + return localctx +} + +// IShadowRuleDefinitionContext is an interface to support dynamic dispatch. +type IShadowRuleDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShadowRuleDefinitionContext differentiates from other interfaces. + IsShadowRuleDefinitionContext() +} + +type ShadowRuleDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShadowRuleDefinitionContext() *ShadowRuleDefinitionContext { + var p = new(ShadowRuleDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shadowRuleDefinition + return p +} + +func (*ShadowRuleDefinitionContext) IsShadowRuleDefinitionContext() {} + +func NewShadowRuleDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShadowRuleDefinitionContext { + var p = new(ShadowRuleDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shadowRuleDefinition + + return p +} + +func (s *ShadowRuleDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShadowRuleDefinitionContext) RuleName() IRuleNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IRuleNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IRuleNameContext) +} + +func (s *ShadowRuleDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *ShadowRuleDefinitionContext) SOURCE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSOURCE, 0) +} + +func (s *ShadowRuleDefinitionContext) AllEQ_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserEQ_) +} + +func (s *ShadowRuleDefinitionContext) EQ_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, i) +} + +func (s *ShadowRuleDefinitionContext) Source() ISourceContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ISourceContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(ISourceContext) +} + +func (s *ShadowRuleDefinitionContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *ShadowRuleDefinitionContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *ShadowRuleDefinitionContext) SHADOW() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHADOW, 0) +} + +func (s *ShadowRuleDefinitionContext) Shadow() IShadowContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShadowContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShadowContext) +} + +func (s *ShadowRuleDefinitionContext) AllShadowTableRule() []IShadowTableRuleContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IShadowTableRuleContext)(nil)).Elem()) + var tst = make([]IShadowTableRuleContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IShadowTableRuleContext) + } + } + + return tst +} + +func (s *ShadowRuleDefinitionContext) ShadowTableRule(i int) IShadowTableRuleContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShadowTableRuleContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IShadowTableRuleContext) +} + +func (s *ShadowRuleDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *ShadowRuleDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShadowRuleDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ShadowRuleDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShadowRuleDefinition(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) ShadowRuleDefinition() (localctx IShadowRuleDefinitionContext) { + localctx = NewShadowRuleDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 14, RDLStatementParserRULE_shadowRuleDefinition) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(121) + p.RuleName() + } + { + p.SetState(122) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(123) + p.Match(RDLStatementParserSOURCE) + } + { + p.SetState(124) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(125) + p.Source() + } + { + p.SetState(126) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(127) + p.Match(RDLStatementParserSHADOW) + } + { + p.SetState(128) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(129) + p.Shadow() + } + { + p.SetState(130) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(131) + p.ShadowTableRule() + } + p.SetState(136) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(132) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(133) + p.ShadowTableRule() + } + + p.SetState(138) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(139) + p.Match(RDLStatementParserRP_) + } + + return localctx +} + +// IShadowTableRuleContext is an interface to support dynamic dispatch. +type IShadowTableRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShadowTableRuleContext differentiates from other interfaces. + IsShadowTableRuleContext() +} + +type ShadowTableRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShadowTableRuleContext() *ShadowTableRuleContext { + var p = new(ShadowTableRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shadowTableRule + return p +} + +func (*ShadowTableRuleContext) IsShadowTableRuleContext() {} + +func NewShadowTableRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShadowTableRuleContext { + var p = new(ShadowTableRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shadowTableRule + + return p +} + +func (s *ShadowTableRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShadowTableRuleContext) TableName() ITableNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(ITableNameContext) +} + +func (s *ShadowTableRuleContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *ShadowTableRuleContext) AllAlgorithmDefinition() []IAlgorithmDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem()) + var tst = make([]IAlgorithmDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IAlgorithmDefinitionContext) + } + } + + return tst +} + +func (s *ShadowTableRuleContext) AlgorithmDefinition(i int) IAlgorithmDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IAlgorithmDefinitionContext) +} + +func (s *ShadowTableRuleContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *ShadowTableRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *ShadowTableRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *ShadowTableRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShadowTableRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ShadowTableRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShadowTableRule(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) ShadowTableRule() (localctx IShadowTableRuleContext) { + localctx = NewShadowTableRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, RDLStatementParserRULE_shadowTableRule) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(141) + p.TableName() + } + { + p.SetState(142) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(143) + p.AlgorithmDefinition() + } + p.SetState(148) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(144) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(145) + p.AlgorithmDefinition() + } + + p.SetState(150) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(151) + p.Match(RDLStatementParserRP_) + } + + return localctx +} + +// ISourceContext is an interface to support dynamic dispatch. +type ISourceContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsSourceContext differentiates from other interfaces. + IsSourceContext() +} + +type SourceContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySourceContext() *SourceContext { + var p = new(SourceContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_source + return p +} + +func (*SourceContext) IsSourceContext() {} + +func NewSourceContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SourceContext { + var p = new(SourceContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_source + + return p +} + +func (s *SourceContext) GetParser() antlr.Parser { return s.parser } + +func (s *SourceContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *SourceContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SourceContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SourceContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitSource(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) Source() (localctx ISourceContext) { + localctx = NewSourceContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, RDLStatementParserRULE_source) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(153) + p.Match(RDLStatementParserIDENTIFIER_) + } + + return localctx +} + +// IShadowContext is an interface to support dynamic dispatch. +type IShadowContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShadowContext differentiates from other interfaces. + IsShadowContext() +} + +type ShadowContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShadowContext() *ShadowContext { + var p = new(ShadowContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shadow + return p +} + +func (*ShadowContext) IsShadowContext() {} + +func NewShadowContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShadowContext { + var p = new(ShadowContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shadow + + return p +} + +func (s *ShadowContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShadowContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *ShadowContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShadowContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ShadowContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShadow(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) Shadow() (localctx IShadowContext) { + localctx = NewShadowContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 20, RDLStatementParserRULE_shadow) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(155) + p.Match(RDLStatementParserIDENTIFIER_) + } + + return localctx +} + +// ITableNameContext is an interface to support dynamic dispatch. +type ITableNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsTableNameContext differentiates from other interfaces. + IsTableNameContext() +} + +type TableNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTableNameContext() *TableNameContext { + var p = new(TableNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_tableName + return p +} + +func (*TableNameContext) IsTableNameContext() {} + +func NewTableNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TableNameContext { + var p = new(TableNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_tableName + + return p +} + +func (s *TableNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *TableNameContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *TableNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TableNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitTableName(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) TableName() (localctx ITableNameContext) { + localctx = NewTableNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 22, RDLStatementParserRULE_tableName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(157) + p.Match(RDLStatementParserIDENTIFIER_) + } + + return localctx +} + +// IAlgorithmNameContext is an interface to support dynamic dispatch. +type IAlgorithmNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlgorithmNameContext differentiates from other interfaces. + IsAlgorithmNameContext() +} + +type AlgorithmNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlgorithmNameContext() *AlgorithmNameContext { + var p = new(AlgorithmNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_algorithmName + return p +} + +func (*AlgorithmNameContext) IsAlgorithmNameContext() {} + +func NewAlgorithmNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlgorithmNameContext { + var p = new(AlgorithmNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_algorithmName + + return p +} + +func (s *AlgorithmNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlgorithmNameContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *AlgorithmNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlgorithmNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlgorithmNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlgorithmName(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlgorithmName() (localctx IAlgorithmNameContext) { + localctx = NewAlgorithmNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 24, RDLStatementParserRULE_algorithmName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(159) + p.Match(RDLStatementParserIDENTIFIER_) + } + + return localctx +} + +// IIfExistsContext is an interface to support dynamic dispatch. +type IIfExistsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsIfExistsContext differentiates from other interfaces. + IsIfExistsContext() +} + +type IfExistsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIfExistsContext() *IfExistsContext { + var p = new(IfExistsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_ifExists + return p +} + +func (*IfExistsContext) IsIfExistsContext() {} + +func NewIfExistsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfExistsContext { + var p = new(IfExistsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_ifExists + + return p +} + +func (s *IfExistsContext) GetParser() antlr.Parser { return s.parser } + +func (s *IfExistsContext) IF() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIF, 0) +} + +func (s *IfExistsContext) EXISTS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEXISTS, 0) +} + +func (s *IfExistsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IfExistsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IfExistsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitIfExists(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) IfExists() (localctx IIfExistsContext) { + localctx = NewIfExistsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 26, RDLStatementParserRULE_ifExists) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(161) + p.Match(RDLStatementParserIF) + } + { + p.SetState(162) + p.Match(RDLStatementParserEXISTS) + } + + return localctx +} + +// IIfNotExistsContext is an interface to support dynamic dispatch. +type IIfNotExistsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsIfNotExistsContext differentiates from other interfaces. + IsIfNotExistsContext() +} + +type IfNotExistsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIfNotExistsContext() *IfNotExistsContext { + var p = new(IfNotExistsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_ifNotExists + return p +} + +func (*IfNotExistsContext) IsIfNotExistsContext() {} + +func NewIfNotExistsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfNotExistsContext { + var p = new(IfNotExistsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_ifNotExists + + return p +} + +func (s *IfNotExistsContext) GetParser() antlr.Parser { return s.parser } + +func (s *IfNotExistsContext) IF() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIF, 0) +} + +func (s *IfNotExistsContext) NOT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNOT, 0) +} + +func (s *IfNotExistsContext) EXISTS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEXISTS, 0) +} + +func (s *IfNotExistsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IfNotExistsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IfNotExistsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitIfNotExists(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) IfNotExists() (localctx IIfNotExistsContext) { + localctx = NewIfNotExistsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 28, RDLStatementParserRULE_ifNotExists) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(164) + p.Match(RDLStatementParserIF) + } + { + p.SetState(165) + p.Match(RDLStatementParserNOT) + } + { + p.SetState(166) + p.Match(RDLStatementParserEXISTS) + } + + return localctx +} + +// 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) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_literal + return p +} + +func (*LiteralContext) IsLiteralContext() {} + +func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext { + var p = new(LiteralContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_literal + + return p +} + +func (s *LiteralContext) GetParser() antlr.Parser { return s.parser } + +func (s *LiteralContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *LiteralContext) INT_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserINT_, 0) +} + +func (s *LiteralContext) MINUS_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMINUS_, 0) +} + +func (s *LiteralContext) TRUE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTRUE, 0) +} + +func (s *LiteralContext) FALSE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserFALSE, 0) +} + +func (s *LiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitLiteral(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) Literal() (localctx ILiteralContext) { + localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 30, RDLStatementParserRULE_literal) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.SetState(175) + p.GetErrorHandler().Sync(p) + + switch p.GetTokenStream().LA(1) { + case RDLStatementParserSTRING_: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(168) + p.Match(RDLStatementParserSTRING_) + } + + case RDLStatementParserMINUS_, RDLStatementParserINT_: + p.EnterOuterAlt(localctx, 2) + p.SetState(170) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserMINUS_ { + { + p.SetState(169) + p.Match(RDLStatementParserMINUS_) + } + + } + { + p.SetState(172) + p.Match(RDLStatementParserINT_) + } + + case RDLStatementParserTRUE: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(173) + p.Match(RDLStatementParserTRUE) + } + + case RDLStatementParserFALSE: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(174) + p.Match(RDLStatementParserFALSE) + } + + default: + panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + } + + return localctx +} + +// IAlgorithmDefinitionContext is an interface to support dynamic dispatch. +type IAlgorithmDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlgorithmDefinitionContext differentiates from other interfaces. + IsAlgorithmDefinitionContext() +} + +type AlgorithmDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlgorithmDefinitionContext() *AlgorithmDefinitionContext { + var p = new(AlgorithmDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_algorithmDefinition + return p +} + +func (*AlgorithmDefinitionContext) IsAlgorithmDefinitionContext() {} + +func NewAlgorithmDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlgorithmDefinitionContext { + var p = new(AlgorithmDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_algorithmDefinition + + return p +} + +func (s *AlgorithmDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlgorithmDefinitionContext) TYPE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTYPE, 0) +} + +func (s *AlgorithmDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *AlgorithmDefinitionContext) NAME() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNAME, 0) +} + +func (s *AlgorithmDefinitionContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *AlgorithmDefinitionContext) AlgorithmTypeName() IAlgorithmTypeNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmTypeNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmTypeNameContext) +} + +func (s *AlgorithmDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *AlgorithmDefinitionContext) COMMA_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, 0) +} + +func (s *AlgorithmDefinitionContext) PropertiesDefinition() IPropertiesDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertiesDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IPropertiesDefinitionContext) +} + +func (s *AlgorithmDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlgorithmDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlgorithmDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlgorithmDefinition(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlgorithmDefinition() (localctx IAlgorithmDefinitionContext) { + localctx = NewAlgorithmDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 32, RDLStatementParserRULE_algorithmDefinition) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(177) + p.Match(RDLStatementParserTYPE) + } + { + p.SetState(178) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(179) + p.Match(RDLStatementParserNAME) + } + { + p.SetState(180) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(181) + p.AlgorithmTypeName() + } + p.SetState(184) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if _la == RDLStatementParserCOMMA_ { + { + p.SetState(182) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(183) + p.PropertiesDefinition() + } + + } + { + p.SetState(186) + p.Match(RDLStatementParserRP_) + } + + return localctx +} + +// IAlgorithmTypeNameContext is an interface to support dynamic dispatch. +type IAlgorithmTypeNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlgorithmTypeNameContext differentiates from other interfaces. + IsAlgorithmTypeNameContext() +} + +type AlgorithmTypeNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlgorithmTypeNameContext() *AlgorithmTypeNameContext { + var p = new(AlgorithmTypeNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_algorithmTypeName + return p +} + +func (*AlgorithmTypeNameContext) IsAlgorithmTypeNameContext() {} + +func NewAlgorithmTypeNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlgorithmTypeNameContext { + var p = new(AlgorithmTypeNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_algorithmTypeName + + return p +} + +func (s *AlgorithmTypeNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlgorithmTypeNameContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *AlgorithmTypeNameContext) BuildInShadowAlgorithmType() IBuildInShadowAlgorithmTypeContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IBuildInShadowAlgorithmTypeContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IBuildInShadowAlgorithmTypeContext) +} + +func (s *AlgorithmTypeNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlgorithmTypeNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AlgorithmTypeNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlgorithmTypeName(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) AlgorithmTypeName() (localctx IAlgorithmTypeNameContext) { + localctx = NewAlgorithmTypeNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 34, RDLStatementParserRULE_algorithmTypeName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.SetState(190) + p.GetErrorHandler().Sync(p) + + switch p.GetTokenStream().LA(1) { + case RDLStatementParserSTRING_: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(188) + p.Match(RDLStatementParserSTRING_) + } + + case RDLStatementParserVALUE_MATCH, RDLStatementParserREGEX_MATCH, RDLStatementParserSQL_HINT: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(189) + p.BuildInShadowAlgorithmType() + } + + default: + panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + } + + return localctx +} + +// IBuildInShadowAlgorithmTypeContext is an interface to support dynamic dispatch. +type IBuildInShadowAlgorithmTypeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsBuildInShadowAlgorithmTypeContext differentiates from other interfaces. + IsBuildInShadowAlgorithmTypeContext() +} + +type BuildInShadowAlgorithmTypeContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBuildInShadowAlgorithmTypeContext() *BuildInShadowAlgorithmTypeContext { + var p = new(BuildInShadowAlgorithmTypeContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_buildInShadowAlgorithmType + return p +} + +func (*BuildInShadowAlgorithmTypeContext) IsBuildInShadowAlgorithmTypeContext() {} + +func NewBuildInShadowAlgorithmTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BuildInShadowAlgorithmTypeContext { + var p = new(BuildInShadowAlgorithmTypeContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_buildInShadowAlgorithmType + + return p +} + +func (s *BuildInShadowAlgorithmTypeContext) GetParser() antlr.Parser { return s.parser } + +func (s *BuildInShadowAlgorithmTypeContext) VALUE_MATCH() antlr.TerminalNode { + return s.GetToken(RDLStatementParserVALUE_MATCH, 0) +} + +func (s *BuildInShadowAlgorithmTypeContext) REGEX_MATCH() antlr.TerminalNode { + return s.GetToken(RDLStatementParserREGEX_MATCH, 0) +} + +func (s *BuildInShadowAlgorithmTypeContext) SQL_HINT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSQL_HINT, 0) +} + +func (s *BuildInShadowAlgorithmTypeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BuildInShadowAlgorithmTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *BuildInShadowAlgorithmTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitBuildInShadowAlgorithmType(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *RDLStatementParser) BuildInShadowAlgorithmType() (localctx IBuildInShadowAlgorithmTypeContext) { + localctx = NewBuildInShadowAlgorithmTypeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 36, RDLStatementParserRULE_buildInShadowAlgorithmType) + var _la int + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(192) + _la = p.GetTokenStream().LA(1) + + if !(((_la-72)&-(0x1f+1)) == 0 && ((1<>'", "'^'", + "'%'", "':'", "'+'", "'-'", "'*'", "'/'", "'\\'", "'.'", "'.*'", "'<=>'", + "'=='", "'='", "", "'>'", "'>='", "'<'", "'<='", "'#'", "'('", "')'", "'{'", + "'}'", "'['", "']'", "','", "'\"'", "'''", "'`'", "'?'", "'@'", "';'", + "'->>'", "'_'", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "'DO NOT MATCH ANY THING, JUST FOR GENERATOR'", +} + +var lexerSymbolicNames = []string{ + "", "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "CREATE", "ALTER", "DROP", "SHOW", "SHARDING", + "RULE", "FROM", "STORAGE_UNITS", "KEY_GENERATE_STRATEGY", "DEFAULT_TABLE_STRATEGY", + "TABLE", "SHARDING_COLUMN", "SHARDING_COLUMNS", "TYPE", "NAME", "PROPERTIES", + "COLUMN", "REFERENCE", "BROADCAST", "RULES", "COLUMNS", "ALGORITHM", "ALGORITHMS", + "HINT", "DEFAULT", "DATABASE", "SHARDING_ALGORITHM", "STRATEGY", "DATANODES", + "DATABASE_STRATEGY", "TABLE_STRATEGY", "NODES", "KEY", "GENERATOR", "GENERATORS", + "KEY_GENERATOR", "UNUSED", "USED", "IF", "EXISTS", "WITH", "COUNT", "AUDITOR", + "AUDITORS", "AUDIT_STRATEGY", "ALLOW_HINT_DISABLE", "TRUE", "FALSE", "MOD", + "COSID_MOD", "HASH_MOD", "VOLUME_RANGE", "BOUNDARY_RANGE", "AUTO_INTERVAL", + "INLINE", "INTERVAL", "COSID_INTERVAL", "COSID_INTERVAL_SNOWFLAKE", "COMPLEX_INLINE", + "HINT_INLINE", "CLASS_BASED", "SNOWFLAKE", "NANOID", "UUID", "COSID", "COSID_SNOWFLAKE", + "STANDARD", "COMPLEX", "DML_SHARDING_CONDITIONS", "NOT", "NONE", "FOR_GENERATOR", + "IDENTIFIER_", "STRING_", "INT_", +} + +var lexerRuleNames = []string{ + "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "CREATE", "ALTER", "DROP", "SHOW", "SHARDING", + "RULE", "FROM", "STORAGE_UNITS", "KEY_GENERATE_STRATEGY", "DEFAULT_TABLE_STRATEGY", + "TABLE", "SHARDING_COLUMN", "SHARDING_COLUMNS", "TYPE", "NAME", "PROPERTIES", + "COLUMN", "REFERENCE", "BROADCAST", "RULES", "COLUMNS", "ALGORITHM", "ALGORITHMS", + "HINT", "DEFAULT", "DATABASE", "SHARDING_ALGORITHM", "STRATEGY", "DATANODES", + "DATABASE_STRATEGY", "TABLE_STRATEGY", "NODES", "KEY", "GENERATOR", "GENERATORS", + "KEY_GENERATOR", "UNUSED", "USED", "IF", "EXISTS", "WITH", "COUNT", "AUDITOR", + "AUDITORS", "AUDIT_STRATEGY", "ALLOW_HINT_DISABLE", "TRUE", "FALSE", "MOD", + "COSID_MOD", "HASH_MOD", "VOLUME_RANGE", "BOUNDARY_RANGE", "AUTO_INTERVAL", + "INLINE", "INTERVAL", "COSID_INTERVAL", "COSID_INTERVAL_SNOWFLAKE", "COMPLEX_INLINE", + "HINT_INLINE", "CLASS_BASED", "SNOWFLAKE", "NANOID", "UUID", "COSID", "COSID_SNOWFLAKE", + "STANDARD", "COMPLEX", "DML_SHARDING_CONDITIONS", "NOT", "NONE", "FOR_GENERATOR", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", + "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "IDENTIFIER_", "STRING_", + "INT_", +} + +type RDLStatementLexer struct { + *antlr.BaseLexer + channelNames []string + modeNames []string + // TODO: EOF string +} + +var lexerDecisionToDFA = make([]*antlr.DFA, len(lexerAtn.DecisionToState)) + +func init() { + for index, ds := range lexerAtn.DecisionToState { + lexerDecisionToDFA[index] = antlr.NewDFA(ds, index) + } +} + +func NewRDLStatementLexer(input antlr.CharStream) *RDLStatementLexer { + + l := new(RDLStatementLexer) + + l.BaseLexer = antlr.NewBaseLexer(input) + l.Interpreter = antlr.NewLexerATNSimulator(l, lexerAtn, lexerDecisionToDFA, antlr.NewPredictionContextCache()) + + l.channelNames = lexerChannelNames + l.modeNames = lexerModeNames + l.RuleNames = lexerRuleNames + l.LiteralNames = lexerLiteralNames + l.SymbolicNames = lexerSymbolicNames + l.GrammarFileName = "RDLStatement.g4" + // TODO: l.EOF = antlr.TokenEOF + + return l +} + +// RDLStatementLexer tokens. +const ( + RDLStatementLexerAND_ = 1 + RDLStatementLexerOR_ = 2 + RDLStatementLexerNOT_ = 3 + RDLStatementLexerTILDE_ = 4 + RDLStatementLexerVERTICALBAR_ = 5 + RDLStatementLexerAMPERSAND_ = 6 + RDLStatementLexerSIGNEDLEFTSHIFT_ = 7 + RDLStatementLexerSIGNEDRIGHTSHIFT_ = 8 + RDLStatementLexerCARET_ = 9 + RDLStatementLexerMOD_ = 10 + RDLStatementLexerCOLON_ = 11 + RDLStatementLexerPLUS_ = 12 + RDLStatementLexerMINUS_ = 13 + RDLStatementLexerASTERISK_ = 14 + RDLStatementLexerSLASH_ = 15 + RDLStatementLexerBACKSLASH_ = 16 + RDLStatementLexerDOT_ = 17 + RDLStatementLexerDOTASTERISK_ = 18 + RDLStatementLexerSAFEEQ_ = 19 + RDLStatementLexerDEQ_ = 20 + RDLStatementLexerEQ_ = 21 + RDLStatementLexerNEQ_ = 22 + RDLStatementLexerGT_ = 23 + RDLStatementLexerGTE_ = 24 + RDLStatementLexerLT_ = 25 + RDLStatementLexerLTE_ = 26 + RDLStatementLexerPOUND_ = 27 + RDLStatementLexerLP_ = 28 + RDLStatementLexerRP_ = 29 + RDLStatementLexerLBE_ = 30 + RDLStatementLexerRBE_ = 31 + RDLStatementLexerLBT_ = 32 + RDLStatementLexerRBT_ = 33 + RDLStatementLexerCOMMA_ = 34 + RDLStatementLexerDQ_ = 35 + RDLStatementLexerSQ_ = 36 + RDLStatementLexerBQ_ = 37 + RDLStatementLexerQUESTION_ = 38 + RDLStatementLexerAT_ = 39 + RDLStatementLexerSEMI_ = 40 + RDLStatementLexerJSONSEPARATOR_ = 41 + RDLStatementLexerUL_ = 42 + RDLStatementLexerWS = 43 + RDLStatementLexerCREATE = 44 + RDLStatementLexerALTER = 45 + RDLStatementLexerDROP = 46 + RDLStatementLexerSHOW = 47 + RDLStatementLexerSHARDING = 48 + RDLStatementLexerRULE = 49 + RDLStatementLexerFROM = 50 + RDLStatementLexerSTORAGE_UNITS = 51 + RDLStatementLexerKEY_GENERATE_STRATEGY = 52 + RDLStatementLexerDEFAULT_TABLE_STRATEGY = 53 + RDLStatementLexerTABLE = 54 + RDLStatementLexerSHARDING_COLUMN = 55 + RDLStatementLexerSHARDING_COLUMNS = 56 + RDLStatementLexerTYPE = 57 + RDLStatementLexerNAME = 58 + RDLStatementLexerPROPERTIES = 59 + RDLStatementLexerCOLUMN = 60 + RDLStatementLexerREFERENCE = 61 + RDLStatementLexerBROADCAST = 62 + RDLStatementLexerRULES = 63 + RDLStatementLexerCOLUMNS = 64 + RDLStatementLexerALGORITHM = 65 + RDLStatementLexerALGORITHMS = 66 + RDLStatementLexerHINT = 67 + RDLStatementLexerDEFAULT = 68 + RDLStatementLexerDATABASE = 69 + RDLStatementLexerSHARDING_ALGORITHM = 70 + RDLStatementLexerSTRATEGY = 71 + RDLStatementLexerDATANODES = 72 + RDLStatementLexerDATABASE_STRATEGY = 73 + RDLStatementLexerTABLE_STRATEGY = 74 + RDLStatementLexerNODES = 75 + RDLStatementLexerKEY = 76 + RDLStatementLexerGENERATOR = 77 + RDLStatementLexerGENERATORS = 78 + RDLStatementLexerKEY_GENERATOR = 79 + RDLStatementLexerUNUSED = 80 + RDLStatementLexerUSED = 81 + RDLStatementLexerIF = 82 + RDLStatementLexerEXISTS = 83 + RDLStatementLexerWITH = 84 + RDLStatementLexerCOUNT = 85 + RDLStatementLexerAUDITOR = 86 + RDLStatementLexerAUDITORS = 87 + RDLStatementLexerAUDIT_STRATEGY = 88 + RDLStatementLexerALLOW_HINT_DISABLE = 89 + RDLStatementLexerTRUE = 90 + RDLStatementLexerFALSE = 91 + RDLStatementLexerMOD = 92 + RDLStatementLexerCOSID_MOD = 93 + RDLStatementLexerHASH_MOD = 94 + RDLStatementLexerVOLUME_RANGE = 95 + RDLStatementLexerBOUNDARY_RANGE = 96 + RDLStatementLexerAUTO_INTERVAL = 97 + RDLStatementLexerINLINE = 98 + RDLStatementLexerINTERVAL = 99 + RDLStatementLexerCOSID_INTERVAL = 100 + RDLStatementLexerCOSID_INTERVAL_SNOWFLAKE = 101 + RDLStatementLexerCOMPLEX_INLINE = 102 + RDLStatementLexerHINT_INLINE = 103 + RDLStatementLexerCLASS_BASED = 104 + RDLStatementLexerSNOWFLAKE = 105 + RDLStatementLexerNANOID = 106 + RDLStatementLexerUUID = 107 + RDLStatementLexerCOSID = 108 + RDLStatementLexerCOSID_SNOWFLAKE = 109 + RDLStatementLexerSTANDARD = 110 + RDLStatementLexerCOMPLEX = 111 + RDLStatementLexerDML_SHARDING_CONDITIONS = 112 + RDLStatementLexerNOT = 113 + RDLStatementLexerNONE = 114 + RDLStatementLexerFOR_GENERATOR = 115 + RDLStatementLexerIDENTIFIER_ = 116 + RDLStatementLexerSTRING_ = 117 + RDLStatementLexerINT_ = 118 +) diff --git a/shardingsphere-operator/pkg/distsql/visitor_parser/sharding/rdlstatement_parser.go b/shardingsphere-operator/pkg/distsql/visitor_parser/sharding/rdlstatement_parser.go new file mode 100644 index 00000000..a52888ca --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/visitor_parser/sharding/rdlstatement_parser.go @@ -0,0 +1,8821 @@ +// Code generated from RDLStatement.g4 by ANTLR 4.8. DO NOT EDIT. + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package parser // RDLStatement + +import ( + "fmt" + "reflect" + "strconv" + + "github.com/antlr/antlr4/runtime/Go/antlr" +) + +// Suppress unused import errors +var _ = fmt.Printf +var _ = reflect.Copy +var _ = strconv.Itoa + + +var parserATN = []uint16{ + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 120, 543, + 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, + 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, + 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, + 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, + 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, + 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, + 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, + 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, + 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, + 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, + 9, 55, 4, 56, 9, 56, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 118, 10, 2, 3, + 2, 3, 2, 3, 2, 7, 2, 123, 10, 2, 12, 2, 14, 2, 126, 11, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 135, 10, 3, 12, 3, 14, 3, 138, 11, + 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 145, 10, 4, 3, 4, 3, 4, 3, 4, 7, + 4, 150, 10, 4, 12, 4, 14, 4, 153, 11, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, + 3, 5, 5, 5, 161, 10, 5, 3, 5, 3, 5, 3, 5, 7, 5, 166, 10, 5, 12, 5, 14, + 5, 169, 11, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 7, 6, 179, + 10, 6, 12, 6, 14, 6, 182, 11, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, + 7, 190, 10, 7, 3, 7, 3, 7, 3, 7, 7, 7, 195, 10, 7, 12, 7, 14, 7, 198, 11, + 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 205, 10, 8, 3, 8, 3, 8, 3, 8, 7, + 8, 210, 10, 8, 12, 8, 14, 8, 213, 11, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, + 5, 9, 220, 10, 9, 3, 9, 3, 9, 3, 9, 7, 9, 225, 10, 9, 12, 9, 14, 9, 228, + 11, 9, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 234, 10, 10, 3, 10, 3, 10, 3, + 10, 7, 10, 239, 10, 10, 12, 10, 14, 10, 242, 11, 10, 3, 11, 3, 11, 3, 11, + 3, 11, 3, 11, 3, 11, 5, 11, 250, 10, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, + 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, + 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 271, 10, 13, 3, 14, 3, 14, 3, 14, 3, + 14, 3, 14, 5, 14, 278, 10, 14, 3, 14, 3, 14, 3, 14, 7, 14, 283, 10, 14, + 12, 14, 14, 14, 286, 11, 14, 3, 15, 3, 15, 3, 15, 3, 15, 5, 15, 292, 10, + 15, 3, 15, 3, 15, 3, 15, 7, 15, 297, 10, 15, 12, 15, 14, 15, 300, 11, 15, + 3, 16, 3, 16, 5, 16, 304, 10, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, + 17, 3, 17, 3, 17, 3, 17, 5, 17, 315, 10, 17, 3, 17, 3, 17, 5, 17, 319, + 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 328, 10, + 18, 3, 18, 3, 18, 5, 18, 332, 10, 18, 3, 18, 3, 18, 5, 18, 336, 10, 18, + 3, 18, 3, 18, 5, 18, 340, 10, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, + 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, + 7, 22, 358, 10, 22, 12, 22, 14, 22, 361, 11, 22, 3, 22, 3, 22, 3, 23, 3, + 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 372, 10, 24, 12, 24, 14, + 24, 375, 11, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, + 5, 27, 385, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, + 29, 3, 29, 3, 29, 3, 29, 7, 29, 398, 10, 29, 12, 29, 14, 29, 401, 11, 29, + 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, + 31, 413, 10, 31, 3, 31, 3, 31, 5, 31, 417, 10, 31, 3, 32, 3, 32, 3, 32, + 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, + 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, + 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 7, 36, 450, 10, 36, 12, + 36, 14, 36, 453, 11, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, + 3, 40, 3, 40, 3, 40, 3, 40, 7, 40, 466, 10, 40, 12, 40, 14, 40, 469, 11, + 40, 3, 40, 3, 40, 3, 41, 3, 41, 5, 41, 475, 10, 41, 3, 42, 3, 42, 3, 43, + 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 5, 45, 488, 10, + 45, 3, 45, 3, 45, 3, 45, 5, 45, 493, 10, 45, 3, 46, 3, 46, 3, 46, 3, 46, + 3, 46, 3, 46, 3, 46, 5, 46, 502, 10, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, + 47, 3, 47, 5, 47, 510, 10, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 50, 3, 50, + 3, 51, 3, 51, 3, 51, 5, 51, 521, 10, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, + 52, 7, 52, 528, 10, 52, 12, 52, 14, 52, 531, 11, 52, 3, 53, 3, 53, 3, 53, + 3, 53, 3, 54, 3, 54, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 2, 2, 57, 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, 2, + 8, 4, 2, 56, 56, 71, 71, 3, 2, 118, 119, 3, 2, 92, 93, 5, 2, 69, 69, 112, + 113, 116, 116, 3, 2, 94, 106, 3, 2, 107, 111, 2, 535, 2, 112, 3, 2, 2, + 2, 4, 127, 3, 2, 2, 2, 6, 139, 3, 2, 2, 2, 8, 154, 3, 2, 2, 2, 10, 170, + 3, 2, 2, 2, 12, 183, 3, 2, 2, 2, 14, 199, 3, 2, 2, 2, 16, 214, 3, 2, 2, + 2, 18, 229, 3, 2, 2, 2, 20, 243, 3, 2, 2, 2, 22, 255, 3, 2, 2, 2, 24, 264, + 3, 2, 2, 2, 26, 272, 3, 2, 2, 2, 28, 287, 3, 2, 2, 2, 30, 303, 3, 2, 2, + 2, 32, 305, 3, 2, 2, 2, 34, 322, 3, 2, 2, 2, 36, 343, 3, 2, 2, 2, 38, 345, + 3, 2, 2, 2, 40, 350, 3, 2, 2, 2, 42, 352, 3, 2, 2, 2, 44, 364, 3, 2, 2, + 2, 46, 366, 3, 2, 2, 2, 48, 378, 3, 2, 2, 2, 50, 380, 3, 2, 2, 2, 52, 384, + 3, 2, 2, 2, 54, 386, 3, 2, 2, 2, 56, 390, 3, 2, 2, 2, 58, 402, 3, 2, 2, + 2, 60, 407, 3, 2, 2, 2, 62, 418, 3, 2, 2, 2, 64, 423, 3, 2, 2, 2, 66, 428, + 3, 2, 2, 2, 68, 437, 3, 2, 2, 2, 70, 446, 3, 2, 2, 2, 72, 454, 3, 2, 2, + 2, 74, 456, 3, 2, 2, 2, 76, 458, 3, 2, 2, 2, 78, 460, 3, 2, 2, 2, 80, 474, + 3, 2, 2, 2, 82, 476, 3, 2, 2, 2, 84, 478, 3, 2, 2, 2, 86, 481, 3, 2, 2, + 2, 88, 492, 3, 2, 2, 2, 90, 494, 3, 2, 2, 2, 92, 509, 3, 2, 2, 2, 94, 511, + 3, 2, 2, 2, 96, 513, 3, 2, 2, 2, 98, 515, 3, 2, 2, 2, 100, 517, 3, 2, 2, + 2, 102, 524, 3, 2, 2, 2, 104, 532, 3, 2, 2, 2, 106, 536, 3, 2, 2, 2, 108, + 538, 3, 2, 2, 2, 110, 540, 3, 2, 2, 2, 112, 113, 7, 46, 2, 2, 113, 114, + 7, 50, 2, 2, 114, 115, 7, 56, 2, 2, 115, 117, 7, 51, 2, 2, 116, 118, 5, + 86, 44, 2, 117, 116, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 119, 3, 2, + 2, 2, 119, 124, 5, 30, 16, 2, 120, 121, 7, 36, 2, 2, 121, 123, 5, 30, 16, + 2, 122, 120, 3, 2, 2, 2, 123, 126, 3, 2, 2, 2, 124, 122, 3, 2, 2, 2, 124, + 125, 3, 2, 2, 2, 125, 3, 3, 2, 2, 2, 126, 124, 3, 2, 2, 2, 127, 128, 7, + 47, 2, 2, 128, 129, 7, 50, 2, 2, 129, 130, 7, 56, 2, 2, 130, 131, 7, 51, + 2, 2, 131, 136, 5, 30, 16, 2, 132, 133, 7, 36, 2, 2, 133, 135, 5, 30, 16, + 2, 134, 132, 3, 2, 2, 2, 135, 138, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 136, + 137, 3, 2, 2, 2, 137, 5, 3, 2, 2, 2, 138, 136, 3, 2, 2, 2, 139, 140, 7, + 48, 2, 2, 140, 141, 7, 50, 2, 2, 141, 142, 7, 56, 2, 2, 142, 144, 7, 51, + 2, 2, 143, 145, 5, 84, 43, 2, 144, 143, 3, 2, 2, 2, 144, 145, 3, 2, 2, + 2, 145, 146, 3, 2, 2, 2, 146, 151, 5, 106, 54, 2, 147, 148, 7, 36, 2, 2, + 148, 150, 5, 106, 54, 2, 149, 147, 3, 2, 2, 2, 150, 153, 3, 2, 2, 2, 151, + 149, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 7, 3, 2, 2, 2, 153, 151, 3, + 2, 2, 2, 154, 155, 7, 46, 2, 2, 155, 156, 7, 50, 2, 2, 156, 157, 7, 56, + 2, 2, 157, 158, 7, 63, 2, 2, 158, 160, 7, 51, 2, 2, 159, 161, 5, 86, 44, + 2, 160, 159, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, + 167, 5, 78, 40, 2, 163, 164, 7, 36, 2, 2, 164, 166, 5, 78, 40, 2, 165, + 163, 3, 2, 2, 2, 166, 169, 3, 2, 2, 2, 167, 165, 3, 2, 2, 2, 167, 168, + 3, 2, 2, 2, 168, 9, 3, 2, 2, 2, 169, 167, 3, 2, 2, 2, 170, 171, 7, 47, + 2, 2, 171, 172, 7, 50, 2, 2, 172, 173, 7, 56, 2, 2, 173, 174, 7, 63, 2, + 2, 174, 175, 7, 51, 2, 2, 175, 180, 5, 78, 40, 2, 176, 177, 7, 36, 2, 2, + 177, 179, 5, 78, 40, 2, 178, 176, 3, 2, 2, 2, 179, 182, 3, 2, 2, 2, 180, + 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 11, 3, 2, 2, 2, 182, 180, 3, + 2, 2, 2, 183, 184, 7, 48, 2, 2, 184, 185, 7, 50, 2, 2, 185, 186, 7, 56, + 2, 2, 186, 187, 7, 63, 2, 2, 187, 189, 7, 51, 2, 2, 188, 190, 5, 84, 43, + 2, 189, 188, 3, 2, 2, 2, 189, 190, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, + 196, 5, 110, 56, 2, 192, 193, 7, 36, 2, 2, 193, 195, 5, 110, 56, 2, 194, + 192, 3, 2, 2, 2, 195, 198, 3, 2, 2, 2, 196, 194, 3, 2, 2, 2, 196, 197, + 3, 2, 2, 2, 197, 13, 3, 2, 2, 2, 198, 196, 3, 2, 2, 2, 199, 200, 7, 46, + 2, 2, 200, 201, 7, 64, 2, 2, 201, 202, 7, 56, 2, 2, 202, 204, 7, 51, 2, + 2, 203, 205, 5, 86, 44, 2, 204, 203, 3, 2, 2, 2, 204, 205, 3, 2, 2, 2, + 205, 206, 3, 2, 2, 2, 206, 211, 5, 106, 54, 2, 207, 208, 7, 36, 2, 2, 208, + 210, 5, 106, 54, 2, 209, 207, 3, 2, 2, 2, 210, 213, 3, 2, 2, 2, 211, 209, + 3, 2, 2, 2, 211, 212, 3, 2, 2, 2, 212, 15, 3, 2, 2, 2, 213, 211, 3, 2, + 2, 2, 214, 215, 7, 48, 2, 2, 215, 216, 7, 64, 2, 2, 216, 217, 7, 56, 2, + 2, 217, 219, 7, 51, 2, 2, 218, 220, 5, 84, 43, 2, 219, 218, 3, 2, 2, 2, + 219, 220, 3, 2, 2, 2, 220, 221, 3, 2, 2, 2, 221, 226, 5, 106, 54, 2, 222, + 223, 7, 36, 2, 2, 223, 225, 5, 106, 54, 2, 224, 222, 3, 2, 2, 2, 225, 228, + 3, 2, 2, 2, 226, 224, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 17, 3, 2, + 2, 2, 228, 226, 3, 2, 2, 2, 229, 230, 7, 48, 2, 2, 230, 231, 7, 50, 2, + 2, 231, 233, 7, 67, 2, 2, 232, 234, 5, 84, 43, 2, 233, 232, 3, 2, 2, 2, + 233, 234, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 240, 5, 108, 55, 2, 236, + 237, 7, 36, 2, 2, 237, 239, 5, 108, 55, 2, 238, 236, 3, 2, 2, 2, 239, 242, + 3, 2, 2, 2, 240, 238, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 19, 3, 2, + 2, 2, 242, 240, 3, 2, 2, 2, 243, 244, 7, 46, 2, 2, 244, 245, 7, 70, 2, + 2, 245, 246, 7, 50, 2, 2, 246, 247, 9, 2, 2, 2, 247, 249, 7, 73, 2, 2, + 248, 250, 5, 86, 44, 2, 249, 248, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, + 251, 3, 2, 2, 2, 251, 252, 7, 30, 2, 2, 252, 253, 5, 60, 31, 2, 253, 254, + 7, 31, 2, 2, 254, 21, 3, 2, 2, 2, 255, 256, 7, 47, 2, 2, 256, 257, 7, 70, + 2, 2, 257, 258, 7, 50, 2, 2, 258, 259, 9, 2, 2, 2, 259, 260, 7, 73, 2, + 2, 260, 261, 7, 30, 2, 2, 261, 262, 5, 60, 31, 2, 262, 263, 7, 31, 2, 2, + 263, 23, 3, 2, 2, 2, 264, 265, 7, 48, 2, 2, 265, 266, 7, 70, 2, 2, 266, + 267, 7, 50, 2, 2, 267, 268, 9, 2, 2, 2, 268, 270, 7, 73, 2, 2, 269, 271, + 5, 84, 43, 2, 270, 269, 3, 2, 2, 2, 270, 271, 3, 2, 2, 2, 271, 25, 3, 2, + 2, 2, 272, 273, 7, 48, 2, 2, 273, 274, 7, 50, 2, 2, 274, 275, 7, 78, 2, + 2, 275, 277, 7, 79, 2, 2, 276, 278, 5, 84, 43, 2, 277, 276, 3, 2, 2, 2, + 277, 278, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 284, 5, 36, 19, 2, 280, + 281, 7, 36, 2, 2, 281, 283, 5, 36, 19, 2, 282, 280, 3, 2, 2, 2, 283, 286, + 3, 2, 2, 2, 284, 282, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 27, 3, 2, + 2, 2, 286, 284, 3, 2, 2, 2, 287, 288, 7, 48, 2, 2, 288, 289, 7, 50, 2, + 2, 289, 291, 7, 88, 2, 2, 290, 292, 5, 84, 43, 2, 291, 290, 3, 2, 2, 2, + 291, 292, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 298, 5, 40, 21, 2, 294, + 295, 7, 36, 2, 2, 295, 297, 5, 40, 21, 2, 296, 294, 3, 2, 2, 2, 297, 300, + 3, 2, 2, 2, 298, 296, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 29, 3, 2, + 2, 2, 300, 298, 3, 2, 2, 2, 301, 304, 5, 32, 17, 2, 302, 304, 5, 34, 18, + 2, 303, 301, 3, 2, 2, 2, 303, 302, 3, 2, 2, 2, 304, 31, 3, 2, 2, 2, 305, + 306, 5, 106, 54, 2, 306, 307, 7, 30, 2, 2, 307, 308, 5, 42, 22, 2, 308, + 309, 7, 36, 2, 2, 309, 310, 5, 50, 26, 2, 310, 311, 7, 36, 2, 2, 311, 314, + 5, 90, 46, 2, 312, 313, 7, 36, 2, 2, 313, 315, 5, 66, 34, 2, 314, 312, + 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 318, 3, 2, 2, 2, 316, 317, 7, 36, + 2, 2, 317, 319, 5, 68, 35, 2, 318, 316, 3, 2, 2, 2, 318, 319, 3, 2, 2, + 2, 319, 320, 3, 2, 2, 2, 320, 321, 7, 31, 2, 2, 321, 33, 3, 2, 2, 2, 322, + 323, 5, 106, 54, 2, 323, 324, 7, 30, 2, 2, 324, 327, 5, 46, 24, 2, 325, + 326, 7, 36, 2, 2, 326, 328, 5, 62, 32, 2, 327, 325, 3, 2, 2, 2, 327, 328, + 3, 2, 2, 2, 328, 331, 3, 2, 2, 2, 329, 330, 7, 36, 2, 2, 330, 332, 5, 64, + 33, 2, 331, 329, 3, 2, 2, 2, 331, 332, 3, 2, 2, 2, 332, 335, 3, 2, 2, 2, + 333, 334, 7, 36, 2, 2, 334, 336, 5, 66, 34, 2, 335, 333, 3, 2, 2, 2, 335, + 336, 3, 2, 2, 2, 336, 339, 3, 2, 2, 2, 337, 338, 7, 36, 2, 2, 338, 340, + 5, 68, 35, 2, 339, 337, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 341, 3, + 2, 2, 2, 341, 342, 7, 31, 2, 2, 342, 35, 3, 2, 2, 2, 343, 344, 7, 118, + 2, 2, 344, 37, 3, 2, 2, 2, 345, 346, 5, 40, 21, 2, 346, 347, 7, 30, 2, + 2, 347, 348, 5, 90, 46, 2, 348, 349, 7, 31, 2, 2, 349, 39, 3, 2, 2, 2, + 350, 351, 7, 118, 2, 2, 351, 41, 3, 2, 2, 2, 352, 353, 7, 53, 2, 2, 353, + 354, 7, 30, 2, 2, 354, 359, 5, 44, 23, 2, 355, 356, 7, 36, 2, 2, 356, 358, + 5, 44, 23, 2, 357, 355, 3, 2, 2, 2, 358, 361, 3, 2, 2, 2, 359, 357, 3, + 2, 2, 2, 359, 360, 3, 2, 2, 2, 360, 362, 3, 2, 2, 2, 361, 359, 3, 2, 2, + 2, 362, 363, 7, 31, 2, 2, 363, 43, 3, 2, 2, 2, 364, 365, 9, 3, 2, 2, 365, + 45, 3, 2, 2, 2, 366, 367, 7, 74, 2, 2, 367, 368, 7, 30, 2, 2, 368, 373, + 5, 48, 25, 2, 369, 370, 7, 36, 2, 2, 370, 372, 5, 48, 25, 2, 371, 369, + 3, 2, 2, 2, 372, 375, 3, 2, 2, 2, 373, 371, 3, 2, 2, 2, 373, 374, 3, 2, + 2, 2, 374, 376, 3, 2, 2, 2, 375, 373, 3, 2, 2, 2, 376, 377, 7, 31, 2, 2, + 377, 47, 3, 2, 2, 2, 378, 379, 7, 119, 2, 2, 379, 49, 3, 2, 2, 2, 380, + 381, 5, 54, 28, 2, 381, 51, 3, 2, 2, 2, 382, 385, 5, 54, 28, 2, 383, 385, + 5, 56, 29, 2, 384, 382, 3, 2, 2, 2, 384, 383, 3, 2, 2, 2, 385, 53, 3, 2, + 2, 2, 386, 387, 7, 57, 2, 2, 387, 388, 7, 23, 2, 2, 388, 389, 5, 76, 39, + 2, 389, 55, 3, 2, 2, 2, 390, 391, 7, 58, 2, 2, 391, 392, 7, 23, 2, 2, 392, + 393, 5, 76, 39, 2, 393, 394, 7, 36, 2, 2, 394, 399, 5, 76, 39, 2, 395, + 396, 7, 36, 2, 2, 396, 398, 5, 76, 39, 2, 397, 395, 3, 2, 2, 2, 398, 401, + 3, 2, 2, 2, 399, 397, 3, 2, 2, 2, 399, 400, 3, 2, 2, 2, 400, 57, 3, 2, + 2, 2, 401, 399, 3, 2, 2, 2, 402, 403, 7, 72, 2, 2, 403, 404, 7, 30, 2, + 2, 404, 405, 5, 90, 46, 2, 405, 406, 7, 31, 2, 2, 406, 59, 3, 2, 2, 2, + 407, 408, 7, 59, 2, 2, 408, 409, 7, 23, 2, 2, 409, 416, 5, 80, 41, 2, 410, + 411, 7, 36, 2, 2, 411, 413, 5, 52, 27, 2, 412, 410, 3, 2, 2, 2, 412, 413, + 3, 2, 2, 2, 413, 414, 3, 2, 2, 2, 414, 415, 7, 36, 2, 2, 415, 417, 5, 58, + 30, 2, 416, 412, 3, 2, 2, 2, 416, 417, 3, 2, 2, 2, 417, 61, 3, 2, 2, 2, + 418, 419, 7, 75, 2, 2, 419, 420, 7, 30, 2, 2, 420, 421, 5, 60, 31, 2, 421, + 422, 7, 31, 2, 2, 422, 63, 3, 2, 2, 2, 423, 424, 7, 76, 2, 2, 424, 425, + 7, 30, 2, 2, 425, 426, 5, 60, 31, 2, 426, 427, 7, 31, 2, 2, 427, 65, 3, + 2, 2, 2, 428, 429, 7, 54, 2, 2, 429, 430, 7, 30, 2, 2, 430, 431, 7, 62, + 2, 2, 431, 432, 7, 23, 2, 2, 432, 433, 5, 76, 39, 2, 433, 434, 7, 36, 2, + 2, 434, 435, 5, 90, 46, 2, 435, 436, 7, 31, 2, 2, 436, 67, 3, 2, 2, 2, + 437, 438, 7, 90, 2, 2, 438, 439, 7, 30, 2, 2, 439, 440, 5, 70, 36, 2, 440, + 441, 7, 36, 2, 2, 441, 442, 7, 91, 2, 2, 442, 443, 7, 23, 2, 2, 443, 444, + 5, 74, 38, 2, 444, 445, 7, 31, 2, 2, 445, 69, 3, 2, 2, 2, 446, 451, 5, + 72, 37, 2, 447, 448, 7, 36, 2, 2, 448, 450, 5, 72, 37, 2, 449, 447, 3, + 2, 2, 2, 450, 453, 3, 2, 2, 2, 451, 449, 3, 2, 2, 2, 451, 452, 3, 2, 2, + 2, 452, 71, 3, 2, 2, 2, 453, 451, 3, 2, 2, 2, 454, 455, 5, 90, 46, 2, 455, + 73, 3, 2, 2, 2, 456, 457, 9, 4, 2, 2, 457, 75, 3, 2, 2, 2, 458, 459, 7, + 118, 2, 2, 459, 77, 3, 2, 2, 2, 460, 461, 5, 110, 56, 2, 461, 462, 7, 30, + 2, 2, 462, 467, 5, 106, 54, 2, 463, 464, 7, 36, 2, 2, 464, 466, 5, 106, + 54, 2, 465, 463, 3, 2, 2, 2, 466, 469, 3, 2, 2, 2, 467, 465, 3, 2, 2, 2, + 467, 468, 3, 2, 2, 2, 468, 470, 3, 2, 2, 2, 469, 467, 3, 2, 2, 2, 470, + 471, 7, 31, 2, 2, 471, 79, 3, 2, 2, 2, 472, 475, 7, 119, 2, 2, 473, 475, + 5, 82, 42, 2, 474, 472, 3, 2, 2, 2, 474, 473, 3, 2, 2, 2, 475, 81, 3, 2, + 2, 2, 476, 477, 9, 5, 2, 2, 477, 83, 3, 2, 2, 2, 478, 479, 7, 84, 2, 2, + 479, 480, 7, 85, 2, 2, 480, 85, 3, 2, 2, 2, 481, 482, 7, 84, 2, 2, 482, + 483, 7, 115, 2, 2, 483, 484, 7, 85, 2, 2, 484, 87, 3, 2, 2, 2, 485, 493, + 7, 119, 2, 2, 486, 488, 7, 15, 2, 2, 487, 486, 3, 2, 2, 2, 487, 488, 3, + 2, 2, 2, 488, 489, 3, 2, 2, 2, 489, 493, 7, 120, 2, 2, 490, 493, 7, 92, + 2, 2, 491, 493, 7, 93, 2, 2, 492, 485, 3, 2, 2, 2, 492, 487, 3, 2, 2, 2, + 492, 490, 3, 2, 2, 2, 492, 491, 3, 2, 2, 2, 493, 89, 3, 2, 2, 2, 494, 495, + 7, 59, 2, 2, 495, 496, 7, 30, 2, 2, 496, 497, 7, 60, 2, 2, 497, 498, 7, + 23, 2, 2, 498, 501, 5, 92, 47, 2, 499, 500, 7, 36, 2, 2, 500, 502, 5, 100, + 51, 2, 501, 499, 3, 2, 2, 2, 501, 502, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, + 503, 504, 7, 31, 2, 2, 504, 91, 3, 2, 2, 2, 505, 510, 7, 119, 2, 2, 506, + 510, 5, 94, 48, 2, 507, 510, 5, 96, 49, 2, 508, 510, 5, 98, 50, 2, 509, + 505, 3, 2, 2, 2, 509, 506, 3, 2, 2, 2, 509, 507, 3, 2, 2, 2, 509, 508, + 3, 2, 2, 2, 510, 93, 3, 2, 2, 2, 511, 512, 9, 6, 2, 2, 512, 95, 3, 2, 2, + 2, 513, 514, 9, 7, 2, 2, 514, 97, 3, 2, 2, 2, 515, 516, 7, 114, 2, 2, 516, + 99, 3, 2, 2, 2, 517, 518, 7, 61, 2, 2, 518, 520, 7, 30, 2, 2, 519, 521, + 5, 102, 52, 2, 520, 519, 3, 2, 2, 2, 520, 521, 3, 2, 2, 2, 521, 522, 3, + 2, 2, 2, 522, 523, 7, 31, 2, 2, 523, 101, 3, 2, 2, 2, 524, 529, 5, 104, + 53, 2, 525, 526, 7, 36, 2, 2, 526, 528, 5, 104, 53, 2, 527, 525, 3, 2, + 2, 2, 528, 531, 3, 2, 2, 2, 529, 527, 3, 2, 2, 2, 529, 530, 3, 2, 2, 2, + 530, 103, 3, 2, 2, 2, 531, 529, 3, 2, 2, 2, 532, 533, 7, 119, 2, 2, 533, + 534, 7, 23, 2, 2, 534, 535, 5, 88, 45, 2, 535, 105, 3, 2, 2, 2, 536, 537, + 7, 118, 2, 2, 537, 107, 3, 2, 2, 2, 538, 539, 7, 118, 2, 2, 539, 109, 3, + 2, 2, 2, 540, 541, 7, 118, 2, 2, 541, 111, 3, 2, 2, 2, 46, 117, 124, 136, + 144, 151, 160, 167, 180, 189, 196, 204, 211, 219, 226, 233, 240, 249, 270, + 277, 284, 291, 298, 303, 314, 318, 327, 331, 335, 339, 359, 373, 384, 399, + 412, 416, 451, 467, 474, 487, 492, 501, 509, 520, 529, +} +var deserializer = antlr.NewATNDeserializer(nil) +var deserializedATN = deserializer.DeserializeFromUInt16(parserATN) + +var literalNames = []string{ + "", "'&&'", "'||'", "'!'", "'~'", "'|'", "'&'", "'<<'", "'>>'", "'^'", + "'%'", "':'", "'+'", "'-'", "'*'", "'/'", "'\\'", "'.'", "'.*'", "'<=>'", + "'=='", "'='", "", "'>'", "'>='", "'<'", "'<='", "'#'", "'('", "')'", "'{'", + "'}'", "'['", "']'", "','", "'\"'", "'''", "'`'", "'?'", "'@'", "';'", + "'->>'", "'_'", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "'DO NOT MATCH ANY THING, JUST FOR GENERATOR'", +} +var symbolicNames = []string{ + "", "AND_", "OR_", "NOT_", "TILDE_", "VERTICALBAR_", "AMPERSAND_", "SIGNEDLEFTSHIFT_", + "SIGNEDRIGHTSHIFT_", "CARET_", "MOD_", "COLON_", "PLUS_", "MINUS_", "ASTERISK_", + "SLASH_", "BACKSLASH_", "DOT_", "DOTASTERISK_", "SAFEEQ_", "DEQ_", "EQ_", + "NEQ_", "GT_", "GTE_", "LT_", "LTE_", "POUND_", "LP_", "RP_", "LBE_", "RBE_", + "LBT_", "RBT_", "COMMA_", "DQ_", "SQ_", "BQ_", "QUESTION_", "AT_", "SEMI_", + "JSONSEPARATOR_", "UL_", "WS", "CREATE", "ALTER", "DROP", "SHOW", "SHARDING", + "RULE", "FROM", "STORAGE_UNITS", "KEY_GENERATE_STRATEGY", "DEFAULT_TABLE_STRATEGY", + "TABLE", "SHARDING_COLUMN", "SHARDING_COLUMNS", "TYPE", "NAME", "PROPERTIES", + "COLUMN", "REFERENCE", "BROADCAST", "RULES", "COLUMNS", "ALGORITHM", "ALGORITHMS", + "HINT", "DEFAULT", "DATABASE", "SHARDING_ALGORITHM", "STRATEGY", "DATANODES", + "DATABASE_STRATEGY", "TABLE_STRATEGY", "NODES", "KEY", "GENERATOR", "GENERATORS", + "KEY_GENERATOR", "UNUSED", "USED", "IF", "EXISTS", "WITH", "COUNT", "AUDITOR", + "AUDITORS", "AUDIT_STRATEGY", "ALLOW_HINT_DISABLE", "TRUE", "FALSE", "MOD", + "COSID_MOD", "HASH_MOD", "VOLUME_RANGE", "BOUNDARY_RANGE", "AUTO_INTERVAL", + "INLINE", "INTERVAL", "COSID_INTERVAL", "COSID_INTERVAL_SNOWFLAKE", "COMPLEX_INLINE", + "HINT_INLINE", "CLASS_BASED", "SNOWFLAKE", "NANOID", "UUID", "COSID", "COSID_SNOWFLAKE", + "STANDARD", "COMPLEX", "DML_SHARDING_CONDITIONS", "NOT", "NONE", "FOR_GENERATOR", + "IDENTIFIER_", "STRING_", "INT_", +} + +var ruleNames = []string{ + "createShardingTableRule", "alterShardingTableRule", "dropShardingTableRule", + "createShardingTableReferenceRule", "alterShardingTableReferenceRule", + "dropShardingTableReferenceRule", "createBroadcastTableRule", "dropBroadcastTableRule", + "dropShardingAlgorithm", "createDefaultShardingStrategy", "alterDefaultShardingStrategy", + "dropDefaultShardingStrategy", "dropShardingKeyGenerator", "dropShardingAuditor", + "shardingTableRuleDefinition", "shardingAutoTableRule", "shardingTableRule", + "keyGeneratorName", "auditorDefinition", "auditorName", "storageUnits", + "storageUnit", "dataNodes", "dataNode", "autoShardingColumnDefinition", + "shardingColumnDefinition", "shardingColumn", "shardingColumns", "shardingAlgorithm", + "shardingStrategy", "databaseStrategy", "tableStrategy", "keyGenerateDefinition", + "auditDefinition", "multiAuditDefinition", "singleAuditDefinition", "auditAllowHintDisable", + "columnName", "tableReferenceRuleDefinition", "strategyType", "buildInStrategyType", + "ifExists", "ifNotExists", "literal", "algorithmDefinition", "algorithmTypeName", + "buildInShardingAlgorithmType", "buildInKeyGenerateAlgorithmType", "buildInShardingAuditAlgorithmType", + "propertiesDefinition", "properties", "property", "tableName", "shardingAlgorithmName", + "ruleName", +} +var decisionToDFA = make([]*antlr.DFA, len(deserializedATN.DecisionToState)) + +func init() { + for index, ds := range deserializedATN.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(ds, index) + } +} + +type RDLStatementParser struct { + *antlr.BaseParser +} + +func NewRDLStatementParser(input antlr.TokenStream) *RDLStatementParser { + this := new(RDLStatementParser) + + this.BaseParser = antlr.NewBaseParser(input) + + this.Interpreter = antlr.NewParserATNSimulator(this, deserializedATN, decisionToDFA, antlr.NewPredictionContextCache()) + this.RuleNames = ruleNames + this.LiteralNames = literalNames + this.SymbolicNames = symbolicNames + this.GrammarFileName = "RDLStatement.g4" + + return this +} + +// RDLStatementParser tokens. +const ( + RDLStatementParserEOF = antlr.TokenEOF + RDLStatementParserAND_ = 1 + RDLStatementParserOR_ = 2 + RDLStatementParserNOT_ = 3 + RDLStatementParserTILDE_ = 4 + RDLStatementParserVERTICALBAR_ = 5 + RDLStatementParserAMPERSAND_ = 6 + RDLStatementParserSIGNEDLEFTSHIFT_ = 7 + RDLStatementParserSIGNEDRIGHTSHIFT_ = 8 + RDLStatementParserCARET_ = 9 + RDLStatementParserMOD_ = 10 + RDLStatementParserCOLON_ = 11 + RDLStatementParserPLUS_ = 12 + RDLStatementParserMINUS_ = 13 + RDLStatementParserASTERISK_ = 14 + RDLStatementParserSLASH_ = 15 + RDLStatementParserBACKSLASH_ = 16 + RDLStatementParserDOT_ = 17 + RDLStatementParserDOTASTERISK_ = 18 + RDLStatementParserSAFEEQ_ = 19 + RDLStatementParserDEQ_ = 20 + RDLStatementParserEQ_ = 21 + RDLStatementParserNEQ_ = 22 + RDLStatementParserGT_ = 23 + RDLStatementParserGTE_ = 24 + RDLStatementParserLT_ = 25 + RDLStatementParserLTE_ = 26 + RDLStatementParserPOUND_ = 27 + RDLStatementParserLP_ = 28 + RDLStatementParserRP_ = 29 + RDLStatementParserLBE_ = 30 + RDLStatementParserRBE_ = 31 + RDLStatementParserLBT_ = 32 + RDLStatementParserRBT_ = 33 + RDLStatementParserCOMMA_ = 34 + RDLStatementParserDQ_ = 35 + RDLStatementParserSQ_ = 36 + RDLStatementParserBQ_ = 37 + RDLStatementParserQUESTION_ = 38 + RDLStatementParserAT_ = 39 + RDLStatementParserSEMI_ = 40 + RDLStatementParserJSONSEPARATOR_ = 41 + RDLStatementParserUL_ = 42 + RDLStatementParserWS = 43 + RDLStatementParserCREATE = 44 + RDLStatementParserALTER = 45 + RDLStatementParserDROP = 46 + RDLStatementParserSHOW = 47 + RDLStatementParserSHARDING = 48 + RDLStatementParserRULE = 49 + RDLStatementParserFROM = 50 + RDLStatementParserSTORAGE_UNITS = 51 + RDLStatementParserKEY_GENERATE_STRATEGY = 52 + RDLStatementParserDEFAULT_TABLE_STRATEGY = 53 + RDLStatementParserTABLE = 54 + RDLStatementParserSHARDING_COLUMN = 55 + RDLStatementParserSHARDING_COLUMNS = 56 + RDLStatementParserTYPE = 57 + RDLStatementParserNAME = 58 + RDLStatementParserPROPERTIES = 59 + RDLStatementParserCOLUMN = 60 + RDLStatementParserREFERENCE = 61 + RDLStatementParserBROADCAST = 62 + RDLStatementParserRULES = 63 + RDLStatementParserCOLUMNS = 64 + RDLStatementParserALGORITHM = 65 + RDLStatementParserALGORITHMS = 66 + RDLStatementParserHINT = 67 + RDLStatementParserDEFAULT = 68 + RDLStatementParserDATABASE = 69 + RDLStatementParserSHARDING_ALGORITHM = 70 + RDLStatementParserSTRATEGY = 71 + RDLStatementParserDATANODES = 72 + RDLStatementParserDATABASE_STRATEGY = 73 + RDLStatementParserTABLE_STRATEGY = 74 + RDLStatementParserNODES = 75 + RDLStatementParserKEY = 76 + RDLStatementParserGENERATOR = 77 + RDLStatementParserGENERATORS = 78 + RDLStatementParserKEY_GENERATOR = 79 + RDLStatementParserUNUSED = 80 + RDLStatementParserUSED = 81 + RDLStatementParserIF = 82 + RDLStatementParserEXISTS = 83 + RDLStatementParserWITH = 84 + RDLStatementParserCOUNT = 85 + RDLStatementParserAUDITOR = 86 + RDLStatementParserAUDITORS = 87 + RDLStatementParserAUDIT_STRATEGY = 88 + RDLStatementParserALLOW_HINT_DISABLE = 89 + RDLStatementParserTRUE = 90 + RDLStatementParserFALSE = 91 + RDLStatementParserMOD = 92 + RDLStatementParserCOSID_MOD = 93 + RDLStatementParserHASH_MOD = 94 + RDLStatementParserVOLUME_RANGE = 95 + RDLStatementParserBOUNDARY_RANGE = 96 + RDLStatementParserAUTO_INTERVAL = 97 + RDLStatementParserINLINE = 98 + RDLStatementParserINTERVAL = 99 + RDLStatementParserCOSID_INTERVAL = 100 + RDLStatementParserCOSID_INTERVAL_SNOWFLAKE = 101 + RDLStatementParserCOMPLEX_INLINE = 102 + RDLStatementParserHINT_INLINE = 103 + RDLStatementParserCLASS_BASED = 104 + RDLStatementParserSNOWFLAKE = 105 + RDLStatementParserNANOID = 106 + RDLStatementParserUUID = 107 + RDLStatementParserCOSID = 108 + RDLStatementParserCOSID_SNOWFLAKE = 109 + RDLStatementParserSTANDARD = 110 + RDLStatementParserCOMPLEX = 111 + RDLStatementParserDML_SHARDING_CONDITIONS = 112 + RDLStatementParserNOT = 113 + RDLStatementParserNONE = 114 + RDLStatementParserFOR_GENERATOR = 115 + RDLStatementParserIDENTIFIER_ = 116 + RDLStatementParserSTRING_ = 117 + RDLStatementParserINT_ = 118 +) + +// RDLStatementParser rules. +const ( + RDLStatementParserRULE_createShardingTableRule = 0 + RDLStatementParserRULE_alterShardingTableRule = 1 + RDLStatementParserRULE_dropShardingTableRule = 2 + RDLStatementParserRULE_createShardingTableReferenceRule = 3 + RDLStatementParserRULE_alterShardingTableReferenceRule = 4 + RDLStatementParserRULE_dropShardingTableReferenceRule = 5 + RDLStatementParserRULE_createBroadcastTableRule = 6 + RDLStatementParserRULE_dropBroadcastTableRule = 7 + RDLStatementParserRULE_dropShardingAlgorithm = 8 + RDLStatementParserRULE_createDefaultShardingStrategy = 9 + RDLStatementParserRULE_alterDefaultShardingStrategy = 10 + RDLStatementParserRULE_dropDefaultShardingStrategy = 11 + RDLStatementParserRULE_dropShardingKeyGenerator = 12 + RDLStatementParserRULE_dropShardingAuditor = 13 + RDLStatementParserRULE_shardingTableRuleDefinition = 14 + RDLStatementParserRULE_shardingAutoTableRule = 15 + RDLStatementParserRULE_shardingTableRule = 16 + RDLStatementParserRULE_keyGeneratorName = 17 + RDLStatementParserRULE_auditorDefinition = 18 + RDLStatementParserRULE_auditorName = 19 + RDLStatementParserRULE_storageUnits = 20 + RDLStatementParserRULE_storageUnit = 21 + RDLStatementParserRULE_dataNodes = 22 + RDLStatementParserRULE_dataNode = 23 + RDLStatementParserRULE_autoShardingColumnDefinition = 24 + RDLStatementParserRULE_shardingColumnDefinition = 25 + RDLStatementParserRULE_shardingColumn = 26 + RDLStatementParserRULE_shardingColumns = 27 + RDLStatementParserRULE_shardingAlgorithm = 28 + RDLStatementParserRULE_shardingStrategy = 29 + RDLStatementParserRULE_databaseStrategy = 30 + RDLStatementParserRULE_tableStrategy = 31 + RDLStatementParserRULE_keyGenerateDefinition = 32 + RDLStatementParserRULE_auditDefinition = 33 + RDLStatementParserRULE_multiAuditDefinition = 34 + RDLStatementParserRULE_singleAuditDefinition = 35 + RDLStatementParserRULE_auditAllowHintDisable = 36 + RDLStatementParserRULE_columnName = 37 + RDLStatementParserRULE_tableReferenceRuleDefinition = 38 + RDLStatementParserRULE_strategyType = 39 + RDLStatementParserRULE_buildInStrategyType = 40 + RDLStatementParserRULE_ifExists = 41 + RDLStatementParserRULE_ifNotExists = 42 + RDLStatementParserRULE_literal = 43 + RDLStatementParserRULE_algorithmDefinition = 44 + RDLStatementParserRULE_algorithmTypeName = 45 + RDLStatementParserRULE_buildInShardingAlgorithmType = 46 + RDLStatementParserRULE_buildInKeyGenerateAlgorithmType = 47 + RDLStatementParserRULE_buildInShardingAuditAlgorithmType = 48 + RDLStatementParserRULE_propertiesDefinition = 49 + RDLStatementParserRULE_properties = 50 + RDLStatementParserRULE_property = 51 + RDLStatementParserRULE_tableName = 52 + RDLStatementParserRULE_shardingAlgorithmName = 53 + RDLStatementParserRULE_ruleName = 54 +) + +// ICreateShardingTableRuleContext is an interface to support dynamic dispatch. +type ICreateShardingTableRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsCreateShardingTableRuleContext differentiates from other interfaces. + IsCreateShardingTableRuleContext() +} + +type CreateShardingTableRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreateShardingTableRuleContext() *CreateShardingTableRuleContext { + var p = new(CreateShardingTableRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_createShardingTableRule + return p +} + +func (*CreateShardingTableRuleContext) IsCreateShardingTableRuleContext() {} + +func NewCreateShardingTableRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateShardingTableRuleContext { + var p = new(CreateShardingTableRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_createShardingTableRule + + return p +} + +func (s *CreateShardingTableRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateShardingTableRuleContext) CREATE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCREATE, 0) +} + +func (s *CreateShardingTableRuleContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *CreateShardingTableRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *CreateShardingTableRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *CreateShardingTableRuleContext) AllShardingTableRuleDefinition() []IShardingTableRuleDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IShardingTableRuleDefinitionContext)(nil)).Elem()) + var tst = make([]IShardingTableRuleDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IShardingTableRuleDefinitionContext) + } + } + + return tst +} + +func (s *CreateShardingTableRuleContext) ShardingTableRuleDefinition(i int) IShardingTableRuleDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingTableRuleDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IShardingTableRuleDefinitionContext) +} + +func (s *CreateShardingTableRuleContext) IfNotExists() IIfNotExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfNotExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfNotExistsContext) +} + +func (s *CreateShardingTableRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *CreateShardingTableRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *CreateShardingTableRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateShardingTableRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *CreateShardingTableRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitCreateShardingTableRule(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) CreateShardingTableRule() (localctx ICreateShardingTableRuleContext) { + localctx = NewCreateShardingTableRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 0, RDLStatementParserRULE_createShardingTableRule) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(110) + p.Match(RDLStatementParserCREATE) + } + { + p.SetState(111) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(112) + p.Match(RDLStatementParserTABLE) + } + { + p.SetState(113) + p.Match(RDLStatementParserRULE) + } + p.SetState(115) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(114) + p.IfNotExists() + } + + } + { + p.SetState(117) + p.ShardingTableRuleDefinition() + } + p.SetState(122) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(118) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(119) + p.ShardingTableRuleDefinition() + } + + + p.SetState(124) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// IAlterShardingTableRuleContext is an interface to support dynamic dispatch. +type IAlterShardingTableRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlterShardingTableRuleContext differentiates from other interfaces. + IsAlterShardingTableRuleContext() +} + +type AlterShardingTableRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlterShardingTableRuleContext() *AlterShardingTableRuleContext { + var p = new(AlterShardingTableRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_alterShardingTableRule + return p +} + +func (*AlterShardingTableRuleContext) IsAlterShardingTableRuleContext() {} + +func NewAlterShardingTableRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlterShardingTableRuleContext { + var p = new(AlterShardingTableRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_alterShardingTableRule + + return p +} + +func (s *AlterShardingTableRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlterShardingTableRuleContext) ALTER() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALTER, 0) +} + +func (s *AlterShardingTableRuleContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *AlterShardingTableRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *AlterShardingTableRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *AlterShardingTableRuleContext) AllShardingTableRuleDefinition() []IShardingTableRuleDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IShardingTableRuleDefinitionContext)(nil)).Elem()) + var tst = make([]IShardingTableRuleDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IShardingTableRuleDefinitionContext) + } + } + + return tst +} + +func (s *AlterShardingTableRuleContext) ShardingTableRuleDefinition(i int) IShardingTableRuleDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingTableRuleDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IShardingTableRuleDefinitionContext) +} + +func (s *AlterShardingTableRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *AlterShardingTableRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *AlterShardingTableRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlterShardingTableRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *AlterShardingTableRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlterShardingTableRule(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) AlterShardingTableRule() (localctx IAlterShardingTableRuleContext) { + localctx = NewAlterShardingTableRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 2, RDLStatementParserRULE_alterShardingTableRule) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(125) + p.Match(RDLStatementParserALTER) + } + { + p.SetState(126) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(127) + p.Match(RDLStatementParserTABLE) + } + { + p.SetState(128) + p.Match(RDLStatementParserRULE) + } + { + p.SetState(129) + p.ShardingTableRuleDefinition() + } + p.SetState(134) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(130) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(131) + p.ShardingTableRuleDefinition() + } + + + p.SetState(136) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// IDropShardingTableRuleContext is an interface to support dynamic dispatch. +type IDropShardingTableRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropShardingTableRuleContext differentiates from other interfaces. + IsDropShardingTableRuleContext() +} + +type DropShardingTableRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropShardingTableRuleContext() *DropShardingTableRuleContext { + var p = new(DropShardingTableRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropShardingTableRule + return p +} + +func (*DropShardingTableRuleContext) IsDropShardingTableRuleContext() {} + +func NewDropShardingTableRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropShardingTableRuleContext { + var p = new(DropShardingTableRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropShardingTableRule + + return p +} + +func (s *DropShardingTableRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropShardingTableRuleContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropShardingTableRuleContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *DropShardingTableRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *DropShardingTableRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *DropShardingTableRuleContext) AllTableName() []ITableNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ITableNameContext)(nil)).Elem()) + var tst = make([]ITableNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(ITableNameContext) + } + } + + return tst +} + +func (s *DropShardingTableRuleContext) TableName(i int) ITableNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(ITableNameContext) +} + +func (s *DropShardingTableRuleContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropShardingTableRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DropShardingTableRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DropShardingTableRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropShardingTableRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *DropShardingTableRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropShardingTableRule(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) DropShardingTableRule() (localctx IDropShardingTableRuleContext) { + localctx = NewDropShardingTableRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 4, RDLStatementParserRULE_dropShardingTableRule) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(137) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(138) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(139) + p.Match(RDLStatementParserTABLE) + } + { + p.SetState(140) + p.Match(RDLStatementParserRULE) + } + p.SetState(142) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(141) + p.IfExists() + } + + } + { + p.SetState(144) + p.TableName() + } + p.SetState(149) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(145) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(146) + p.TableName() + } + + + p.SetState(151) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// ICreateShardingTableReferenceRuleContext is an interface to support dynamic dispatch. +type ICreateShardingTableReferenceRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsCreateShardingTableReferenceRuleContext differentiates from other interfaces. + IsCreateShardingTableReferenceRuleContext() +} + +type CreateShardingTableReferenceRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreateShardingTableReferenceRuleContext() *CreateShardingTableReferenceRuleContext { + var p = new(CreateShardingTableReferenceRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_createShardingTableReferenceRule + return p +} + +func (*CreateShardingTableReferenceRuleContext) IsCreateShardingTableReferenceRuleContext() {} + +func NewCreateShardingTableReferenceRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateShardingTableReferenceRuleContext { + var p = new(CreateShardingTableReferenceRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_createShardingTableReferenceRule + + return p +} + +func (s *CreateShardingTableReferenceRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateShardingTableReferenceRuleContext) CREATE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCREATE, 0) +} + +func (s *CreateShardingTableReferenceRuleContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *CreateShardingTableReferenceRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *CreateShardingTableReferenceRuleContext) REFERENCE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserREFERENCE, 0) +} + +func (s *CreateShardingTableReferenceRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *CreateShardingTableReferenceRuleContext) AllTableReferenceRuleDefinition() []ITableReferenceRuleDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ITableReferenceRuleDefinitionContext)(nil)).Elem()) + var tst = make([]ITableReferenceRuleDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(ITableReferenceRuleDefinitionContext) + } + } + + return tst +} + +func (s *CreateShardingTableReferenceRuleContext) TableReferenceRuleDefinition(i int) ITableReferenceRuleDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableReferenceRuleDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(ITableReferenceRuleDefinitionContext) +} + +func (s *CreateShardingTableReferenceRuleContext) IfNotExists() IIfNotExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfNotExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfNotExistsContext) +} + +func (s *CreateShardingTableReferenceRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *CreateShardingTableReferenceRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *CreateShardingTableReferenceRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateShardingTableReferenceRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *CreateShardingTableReferenceRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitCreateShardingTableReferenceRule(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) CreateShardingTableReferenceRule() (localctx ICreateShardingTableReferenceRuleContext) { + localctx = NewCreateShardingTableReferenceRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 6, RDLStatementParserRULE_createShardingTableReferenceRule) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(152) + p.Match(RDLStatementParserCREATE) + } + { + p.SetState(153) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(154) + p.Match(RDLStatementParserTABLE) + } + { + p.SetState(155) + p.Match(RDLStatementParserREFERENCE) + } + { + p.SetState(156) + p.Match(RDLStatementParserRULE) + } + p.SetState(158) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(157) + p.IfNotExists() + } + + } + { + p.SetState(160) + p.TableReferenceRuleDefinition() + } + p.SetState(165) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(161) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(162) + p.TableReferenceRuleDefinition() + } + + + p.SetState(167) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// IAlterShardingTableReferenceRuleContext is an interface to support dynamic dispatch. +type IAlterShardingTableReferenceRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlterShardingTableReferenceRuleContext differentiates from other interfaces. + IsAlterShardingTableReferenceRuleContext() +} + +type AlterShardingTableReferenceRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlterShardingTableReferenceRuleContext() *AlterShardingTableReferenceRuleContext { + var p = new(AlterShardingTableReferenceRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_alterShardingTableReferenceRule + return p +} + +func (*AlterShardingTableReferenceRuleContext) IsAlterShardingTableReferenceRuleContext() {} + +func NewAlterShardingTableReferenceRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlterShardingTableReferenceRuleContext { + var p = new(AlterShardingTableReferenceRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_alterShardingTableReferenceRule + + return p +} + +func (s *AlterShardingTableReferenceRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlterShardingTableReferenceRuleContext) ALTER() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALTER, 0) +} + +func (s *AlterShardingTableReferenceRuleContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *AlterShardingTableReferenceRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *AlterShardingTableReferenceRuleContext) REFERENCE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserREFERENCE, 0) +} + +func (s *AlterShardingTableReferenceRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *AlterShardingTableReferenceRuleContext) AllTableReferenceRuleDefinition() []ITableReferenceRuleDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ITableReferenceRuleDefinitionContext)(nil)).Elem()) + var tst = make([]ITableReferenceRuleDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(ITableReferenceRuleDefinitionContext) + } + } + + return tst +} + +func (s *AlterShardingTableReferenceRuleContext) TableReferenceRuleDefinition(i int) ITableReferenceRuleDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableReferenceRuleDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(ITableReferenceRuleDefinitionContext) +} + +func (s *AlterShardingTableReferenceRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *AlterShardingTableReferenceRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *AlterShardingTableReferenceRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlterShardingTableReferenceRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *AlterShardingTableReferenceRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlterShardingTableReferenceRule(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) AlterShardingTableReferenceRule() (localctx IAlterShardingTableReferenceRuleContext) { + localctx = NewAlterShardingTableReferenceRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 8, RDLStatementParserRULE_alterShardingTableReferenceRule) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(168) + p.Match(RDLStatementParserALTER) + } + { + p.SetState(169) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(170) + p.Match(RDLStatementParserTABLE) + } + { + p.SetState(171) + p.Match(RDLStatementParserREFERENCE) + } + { + p.SetState(172) + p.Match(RDLStatementParserRULE) + } + { + p.SetState(173) + p.TableReferenceRuleDefinition() + } + p.SetState(178) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(174) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(175) + p.TableReferenceRuleDefinition() + } + + + p.SetState(180) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// IDropShardingTableReferenceRuleContext is an interface to support dynamic dispatch. +type IDropShardingTableReferenceRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropShardingTableReferenceRuleContext differentiates from other interfaces. + IsDropShardingTableReferenceRuleContext() +} + +type DropShardingTableReferenceRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropShardingTableReferenceRuleContext() *DropShardingTableReferenceRuleContext { + var p = new(DropShardingTableReferenceRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropShardingTableReferenceRule + return p +} + +func (*DropShardingTableReferenceRuleContext) IsDropShardingTableReferenceRuleContext() {} + +func NewDropShardingTableReferenceRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropShardingTableReferenceRuleContext { + var p = new(DropShardingTableReferenceRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropShardingTableReferenceRule + + return p +} + +func (s *DropShardingTableReferenceRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropShardingTableReferenceRuleContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropShardingTableReferenceRuleContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *DropShardingTableReferenceRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *DropShardingTableReferenceRuleContext) REFERENCE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserREFERENCE, 0) +} + +func (s *DropShardingTableReferenceRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *DropShardingTableReferenceRuleContext) AllRuleName() []IRuleNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IRuleNameContext)(nil)).Elem()) + var tst = make([]IRuleNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IRuleNameContext) + } + } + + return tst +} + +func (s *DropShardingTableReferenceRuleContext) RuleName(i int) IRuleNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IRuleNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IRuleNameContext) +} + +func (s *DropShardingTableReferenceRuleContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropShardingTableReferenceRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DropShardingTableReferenceRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DropShardingTableReferenceRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropShardingTableReferenceRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *DropShardingTableReferenceRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropShardingTableReferenceRule(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) DropShardingTableReferenceRule() (localctx IDropShardingTableReferenceRuleContext) { + localctx = NewDropShardingTableReferenceRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 10, RDLStatementParserRULE_dropShardingTableReferenceRule) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(181) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(182) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(183) + p.Match(RDLStatementParserTABLE) + } + { + p.SetState(184) + p.Match(RDLStatementParserREFERENCE) + } + { + p.SetState(185) + p.Match(RDLStatementParserRULE) + } + p.SetState(187) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(186) + p.IfExists() + } + + } + { + p.SetState(189) + p.RuleName() + } + p.SetState(194) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(190) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(191) + p.RuleName() + } + + + p.SetState(196) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// ICreateBroadcastTableRuleContext is an interface to support dynamic dispatch. +type ICreateBroadcastTableRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsCreateBroadcastTableRuleContext differentiates from other interfaces. + IsCreateBroadcastTableRuleContext() +} + +type CreateBroadcastTableRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreateBroadcastTableRuleContext() *CreateBroadcastTableRuleContext { + var p = new(CreateBroadcastTableRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_createBroadcastTableRule + return p +} + +func (*CreateBroadcastTableRuleContext) IsCreateBroadcastTableRuleContext() {} + +func NewCreateBroadcastTableRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateBroadcastTableRuleContext { + var p = new(CreateBroadcastTableRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_createBroadcastTableRule + + return p +} + +func (s *CreateBroadcastTableRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateBroadcastTableRuleContext) CREATE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCREATE, 0) +} + +func (s *CreateBroadcastTableRuleContext) BROADCAST() antlr.TerminalNode { + return s.GetToken(RDLStatementParserBROADCAST, 0) +} + +func (s *CreateBroadcastTableRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *CreateBroadcastTableRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *CreateBroadcastTableRuleContext) AllTableName() []ITableNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ITableNameContext)(nil)).Elem()) + var tst = make([]ITableNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(ITableNameContext) + } + } + + return tst +} + +func (s *CreateBroadcastTableRuleContext) TableName(i int) ITableNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(ITableNameContext) +} + +func (s *CreateBroadcastTableRuleContext) IfNotExists() IIfNotExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfNotExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfNotExistsContext) +} + +func (s *CreateBroadcastTableRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *CreateBroadcastTableRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *CreateBroadcastTableRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateBroadcastTableRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *CreateBroadcastTableRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitCreateBroadcastTableRule(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) CreateBroadcastTableRule() (localctx ICreateBroadcastTableRuleContext) { + localctx = NewCreateBroadcastTableRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, RDLStatementParserRULE_createBroadcastTableRule) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(197) + p.Match(RDLStatementParserCREATE) + } + { + p.SetState(198) + p.Match(RDLStatementParserBROADCAST) + } + { + p.SetState(199) + p.Match(RDLStatementParserTABLE) + } + { + p.SetState(200) + p.Match(RDLStatementParserRULE) + } + p.SetState(202) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(201) + p.IfNotExists() + } + + } + { + p.SetState(204) + p.TableName() + } + p.SetState(209) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(205) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(206) + p.TableName() + } + + + p.SetState(211) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// IDropBroadcastTableRuleContext is an interface to support dynamic dispatch. +type IDropBroadcastTableRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropBroadcastTableRuleContext differentiates from other interfaces. + IsDropBroadcastTableRuleContext() +} + +type DropBroadcastTableRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropBroadcastTableRuleContext() *DropBroadcastTableRuleContext { + var p = new(DropBroadcastTableRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropBroadcastTableRule + return p +} + +func (*DropBroadcastTableRuleContext) IsDropBroadcastTableRuleContext() {} + +func NewDropBroadcastTableRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropBroadcastTableRuleContext { + var p = new(DropBroadcastTableRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropBroadcastTableRule + + return p +} + +func (s *DropBroadcastTableRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropBroadcastTableRuleContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropBroadcastTableRuleContext) BROADCAST() antlr.TerminalNode { + return s.GetToken(RDLStatementParserBROADCAST, 0) +} + +func (s *DropBroadcastTableRuleContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *DropBroadcastTableRuleContext) RULE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRULE, 0) +} + +func (s *DropBroadcastTableRuleContext) AllTableName() []ITableNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ITableNameContext)(nil)).Elem()) + var tst = make([]ITableNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(ITableNameContext) + } + } + + return tst +} + +func (s *DropBroadcastTableRuleContext) TableName(i int) ITableNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(ITableNameContext) +} + +func (s *DropBroadcastTableRuleContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropBroadcastTableRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DropBroadcastTableRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DropBroadcastTableRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropBroadcastTableRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *DropBroadcastTableRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropBroadcastTableRule(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) DropBroadcastTableRule() (localctx IDropBroadcastTableRuleContext) { + localctx = NewDropBroadcastTableRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 14, RDLStatementParserRULE_dropBroadcastTableRule) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(212) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(213) + p.Match(RDLStatementParserBROADCAST) + } + { + p.SetState(214) + p.Match(RDLStatementParserTABLE) + } + { + p.SetState(215) + p.Match(RDLStatementParserRULE) + } + p.SetState(217) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(216) + p.IfExists() + } + + } + { + p.SetState(219) + p.TableName() + } + p.SetState(224) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(220) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(221) + p.TableName() + } + + + p.SetState(226) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// IDropShardingAlgorithmContext is an interface to support dynamic dispatch. +type IDropShardingAlgorithmContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropShardingAlgorithmContext differentiates from other interfaces. + IsDropShardingAlgorithmContext() +} + +type DropShardingAlgorithmContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropShardingAlgorithmContext() *DropShardingAlgorithmContext { + var p = new(DropShardingAlgorithmContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropShardingAlgorithm + return p +} + +func (*DropShardingAlgorithmContext) IsDropShardingAlgorithmContext() {} + +func NewDropShardingAlgorithmContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropShardingAlgorithmContext { + var p = new(DropShardingAlgorithmContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropShardingAlgorithm + + return p +} + +func (s *DropShardingAlgorithmContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropShardingAlgorithmContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropShardingAlgorithmContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *DropShardingAlgorithmContext) ALGORITHM() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALGORITHM, 0) +} + +func (s *DropShardingAlgorithmContext) AllShardingAlgorithmName() []IShardingAlgorithmNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IShardingAlgorithmNameContext)(nil)).Elem()) + var tst = make([]IShardingAlgorithmNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IShardingAlgorithmNameContext) + } + } + + return tst +} + +func (s *DropShardingAlgorithmContext) ShardingAlgorithmName(i int) IShardingAlgorithmNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingAlgorithmNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IShardingAlgorithmNameContext) +} + +func (s *DropShardingAlgorithmContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropShardingAlgorithmContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DropShardingAlgorithmContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DropShardingAlgorithmContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropShardingAlgorithmContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *DropShardingAlgorithmContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropShardingAlgorithm(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) DropShardingAlgorithm() (localctx IDropShardingAlgorithmContext) { + localctx = NewDropShardingAlgorithmContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, RDLStatementParserRULE_dropShardingAlgorithm) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(227) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(228) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(229) + p.Match(RDLStatementParserALGORITHM) + } + p.SetState(231) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(230) + p.IfExists() + } + + } + { + p.SetState(233) + p.ShardingAlgorithmName() + } + p.SetState(238) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(234) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(235) + p.ShardingAlgorithmName() + } + + + p.SetState(240) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// ICreateDefaultShardingStrategyContext is an interface to support dynamic dispatch. +type ICreateDefaultShardingStrategyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetType returns the type token. + GetType() antlr.Token + + + // SetType sets the type token. + SetType(antlr.Token) + + + // IsCreateDefaultShardingStrategyContext differentiates from other interfaces. + IsCreateDefaultShardingStrategyContext() +} + +type CreateDefaultShardingStrategyContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser + typ antlr.Token +} + +func NewEmptyCreateDefaultShardingStrategyContext() *CreateDefaultShardingStrategyContext { + var p = new(CreateDefaultShardingStrategyContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_createDefaultShardingStrategy + return p +} + +func (*CreateDefaultShardingStrategyContext) IsCreateDefaultShardingStrategyContext() {} + +func NewCreateDefaultShardingStrategyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateDefaultShardingStrategyContext { + var p = new(CreateDefaultShardingStrategyContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_createDefaultShardingStrategy + + return p +} + +func (s *CreateDefaultShardingStrategyContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateDefaultShardingStrategyContext) GetType() antlr.Token { return s.typ } + + +func (s *CreateDefaultShardingStrategyContext) SetType(v antlr.Token) { s.typ = v } + + +func (s *CreateDefaultShardingStrategyContext) CREATE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCREATE, 0) +} + +func (s *CreateDefaultShardingStrategyContext) DEFAULT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDEFAULT, 0) +} + +func (s *CreateDefaultShardingStrategyContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *CreateDefaultShardingStrategyContext) STRATEGY() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRATEGY, 0) +} + +func (s *CreateDefaultShardingStrategyContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *CreateDefaultShardingStrategyContext) ShardingStrategy() IShardingStrategyContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingStrategyContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingStrategyContext) +} + +func (s *CreateDefaultShardingStrategyContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *CreateDefaultShardingStrategyContext) DATABASE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDATABASE, 0) +} + +func (s *CreateDefaultShardingStrategyContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *CreateDefaultShardingStrategyContext) IfNotExists() IIfNotExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfNotExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfNotExistsContext) +} + +func (s *CreateDefaultShardingStrategyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateDefaultShardingStrategyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *CreateDefaultShardingStrategyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitCreateDefaultShardingStrategy(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) CreateDefaultShardingStrategy() (localctx ICreateDefaultShardingStrategyContext) { + localctx = NewCreateDefaultShardingStrategyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, RDLStatementParserRULE_createDefaultShardingStrategy) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(241) + p.Match(RDLStatementParserCREATE) + } + { + p.SetState(242) + p.Match(RDLStatementParserDEFAULT) + } + { + p.SetState(243) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(244) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*CreateDefaultShardingStrategyContext).typ = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == RDLStatementParserTABLE || _la == RDLStatementParserDATABASE) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*CreateDefaultShardingStrategyContext).typ = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(245) + p.Match(RDLStatementParserSTRATEGY) + } + p.SetState(247) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(246) + p.IfNotExists() + } + + } + { + p.SetState(249) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(250) + p.ShardingStrategy() + } + { + p.SetState(251) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IAlterDefaultShardingStrategyContext is an interface to support dynamic dispatch. +type IAlterDefaultShardingStrategyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetType returns the type token. + GetType() antlr.Token + + + // SetType sets the type token. + SetType(antlr.Token) + + + // IsAlterDefaultShardingStrategyContext differentiates from other interfaces. + IsAlterDefaultShardingStrategyContext() +} + +type AlterDefaultShardingStrategyContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser + typ antlr.Token +} + +func NewEmptyAlterDefaultShardingStrategyContext() *AlterDefaultShardingStrategyContext { + var p = new(AlterDefaultShardingStrategyContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_alterDefaultShardingStrategy + return p +} + +func (*AlterDefaultShardingStrategyContext) IsAlterDefaultShardingStrategyContext() {} + +func NewAlterDefaultShardingStrategyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlterDefaultShardingStrategyContext { + var p = new(AlterDefaultShardingStrategyContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_alterDefaultShardingStrategy + + return p +} + +func (s *AlterDefaultShardingStrategyContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlterDefaultShardingStrategyContext) GetType() antlr.Token { return s.typ } + + +func (s *AlterDefaultShardingStrategyContext) SetType(v antlr.Token) { s.typ = v } + + +func (s *AlterDefaultShardingStrategyContext) ALTER() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALTER, 0) +} + +func (s *AlterDefaultShardingStrategyContext) DEFAULT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDEFAULT, 0) +} + +func (s *AlterDefaultShardingStrategyContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *AlterDefaultShardingStrategyContext) STRATEGY() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRATEGY, 0) +} + +func (s *AlterDefaultShardingStrategyContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *AlterDefaultShardingStrategyContext) ShardingStrategy() IShardingStrategyContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingStrategyContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingStrategyContext) +} + +func (s *AlterDefaultShardingStrategyContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *AlterDefaultShardingStrategyContext) DATABASE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDATABASE, 0) +} + +func (s *AlterDefaultShardingStrategyContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *AlterDefaultShardingStrategyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlterDefaultShardingStrategyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *AlterDefaultShardingStrategyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlterDefaultShardingStrategy(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) AlterDefaultShardingStrategy() (localctx IAlterDefaultShardingStrategyContext) { + localctx = NewAlterDefaultShardingStrategyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 20, RDLStatementParserRULE_alterDefaultShardingStrategy) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(253) + p.Match(RDLStatementParserALTER) + } + { + p.SetState(254) + p.Match(RDLStatementParserDEFAULT) + } + { + p.SetState(255) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(256) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*AlterDefaultShardingStrategyContext).typ = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == RDLStatementParserTABLE || _la == RDLStatementParserDATABASE) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*AlterDefaultShardingStrategyContext).typ = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(257) + p.Match(RDLStatementParserSTRATEGY) + } + { + p.SetState(258) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(259) + p.ShardingStrategy() + } + { + p.SetState(260) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IDropDefaultShardingStrategyContext is an interface to support dynamic dispatch. +type IDropDefaultShardingStrategyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetType returns the type token. + GetType() antlr.Token + + + // SetType sets the type token. + SetType(antlr.Token) + + + // IsDropDefaultShardingStrategyContext differentiates from other interfaces. + IsDropDefaultShardingStrategyContext() +} + +type DropDefaultShardingStrategyContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser + typ antlr.Token +} + +func NewEmptyDropDefaultShardingStrategyContext() *DropDefaultShardingStrategyContext { + var p = new(DropDefaultShardingStrategyContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropDefaultShardingStrategy + return p +} + +func (*DropDefaultShardingStrategyContext) IsDropDefaultShardingStrategyContext() {} + +func NewDropDefaultShardingStrategyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropDefaultShardingStrategyContext { + var p = new(DropDefaultShardingStrategyContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropDefaultShardingStrategy + + return p +} + +func (s *DropDefaultShardingStrategyContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropDefaultShardingStrategyContext) GetType() antlr.Token { return s.typ } + + +func (s *DropDefaultShardingStrategyContext) SetType(v antlr.Token) { s.typ = v } + + +func (s *DropDefaultShardingStrategyContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropDefaultShardingStrategyContext) DEFAULT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDEFAULT, 0) +} + +func (s *DropDefaultShardingStrategyContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *DropDefaultShardingStrategyContext) STRATEGY() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRATEGY, 0) +} + +func (s *DropDefaultShardingStrategyContext) DATABASE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDATABASE, 0) +} + +func (s *DropDefaultShardingStrategyContext) TABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE, 0) +} + +func (s *DropDefaultShardingStrategyContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropDefaultShardingStrategyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropDefaultShardingStrategyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *DropDefaultShardingStrategyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropDefaultShardingStrategy(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) DropDefaultShardingStrategy() (localctx IDropDefaultShardingStrategyContext) { + localctx = NewDropDefaultShardingStrategyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 22, RDLStatementParserRULE_dropDefaultShardingStrategy) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(262) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(263) + p.Match(RDLStatementParserDEFAULT) + } + { + p.SetState(264) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(265) + + var _lt = p.GetTokenStream().LT(1) + + localctx.(*DropDefaultShardingStrategyContext).typ = _lt + + _la = p.GetTokenStream().LA(1) + + if !(_la == RDLStatementParserTABLE || _la == RDLStatementParserDATABASE) { + var _ri = p.GetErrorHandler().RecoverInline(p) + + localctx.(*DropDefaultShardingStrategyContext).typ = _ri + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(266) + p.Match(RDLStatementParserSTRATEGY) + } + p.SetState(268) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(267) + p.IfExists() + } + + } + + + + return localctx +} + + +// IDropShardingKeyGeneratorContext is an interface to support dynamic dispatch. +type IDropShardingKeyGeneratorContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropShardingKeyGeneratorContext differentiates from other interfaces. + IsDropShardingKeyGeneratorContext() +} + +type DropShardingKeyGeneratorContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropShardingKeyGeneratorContext() *DropShardingKeyGeneratorContext { + var p = new(DropShardingKeyGeneratorContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropShardingKeyGenerator + return p +} + +func (*DropShardingKeyGeneratorContext) IsDropShardingKeyGeneratorContext() {} + +func NewDropShardingKeyGeneratorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropShardingKeyGeneratorContext { + var p = new(DropShardingKeyGeneratorContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropShardingKeyGenerator + + return p +} + +func (s *DropShardingKeyGeneratorContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropShardingKeyGeneratorContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropShardingKeyGeneratorContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *DropShardingKeyGeneratorContext) KEY() antlr.TerminalNode { + return s.GetToken(RDLStatementParserKEY, 0) +} + +func (s *DropShardingKeyGeneratorContext) GENERATOR() antlr.TerminalNode { + return s.GetToken(RDLStatementParserGENERATOR, 0) +} + +func (s *DropShardingKeyGeneratorContext) AllKeyGeneratorName() []IKeyGeneratorNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IKeyGeneratorNameContext)(nil)).Elem()) + var tst = make([]IKeyGeneratorNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IKeyGeneratorNameContext) + } + } + + return tst +} + +func (s *DropShardingKeyGeneratorContext) KeyGeneratorName(i int) IKeyGeneratorNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IKeyGeneratorNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IKeyGeneratorNameContext) +} + +func (s *DropShardingKeyGeneratorContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropShardingKeyGeneratorContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DropShardingKeyGeneratorContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DropShardingKeyGeneratorContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropShardingKeyGeneratorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *DropShardingKeyGeneratorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropShardingKeyGenerator(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) DropShardingKeyGenerator() (localctx IDropShardingKeyGeneratorContext) { + localctx = NewDropShardingKeyGeneratorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 24, RDLStatementParserRULE_dropShardingKeyGenerator) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(270) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(271) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(272) + p.Match(RDLStatementParserKEY) + } + { + p.SetState(273) + p.Match(RDLStatementParserGENERATOR) + } + p.SetState(275) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(274) + p.IfExists() + } + + } + { + p.SetState(277) + p.KeyGeneratorName() + } + p.SetState(282) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(278) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(279) + p.KeyGeneratorName() + } + + + p.SetState(284) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// IDropShardingAuditorContext is an interface to support dynamic dispatch. +type IDropShardingAuditorContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDropShardingAuditorContext differentiates from other interfaces. + IsDropShardingAuditorContext() +} + +type DropShardingAuditorContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropShardingAuditorContext() *DropShardingAuditorContext { + var p = new(DropShardingAuditorContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dropShardingAuditor + return p +} + +func (*DropShardingAuditorContext) IsDropShardingAuditorContext() {} + +func NewDropShardingAuditorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropShardingAuditorContext { + var p = new(DropShardingAuditorContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dropShardingAuditor + + return p +} + +func (s *DropShardingAuditorContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropShardingAuditorContext) DROP() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDROP, 0) +} + +func (s *DropShardingAuditorContext) SHARDING() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING, 0) +} + +func (s *DropShardingAuditorContext) AUDITOR() antlr.TerminalNode { + return s.GetToken(RDLStatementParserAUDITOR, 0) +} + +func (s *DropShardingAuditorContext) AllAuditorName() []IAuditorNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IAuditorNameContext)(nil)).Elem()) + var tst = make([]IAuditorNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IAuditorNameContext) + } + } + + return tst +} + +func (s *DropShardingAuditorContext) AuditorName(i int) IAuditorNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAuditorNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IAuditorNameContext) +} + +func (s *DropShardingAuditorContext) IfExists() IIfExistsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IIfExistsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IIfExistsContext) +} + +func (s *DropShardingAuditorContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DropShardingAuditorContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DropShardingAuditorContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropShardingAuditorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *DropShardingAuditorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDropShardingAuditor(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) DropShardingAuditor() (localctx IDropShardingAuditorContext) { + localctx = NewDropShardingAuditorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 26, RDLStatementParserRULE_dropShardingAuditor) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(285) + p.Match(RDLStatementParserDROP) + } + { + p.SetState(286) + p.Match(RDLStatementParserSHARDING) + } + { + p.SetState(287) + p.Match(RDLStatementParserAUDITOR) + } + p.SetState(289) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserIF { + { + p.SetState(288) + p.IfExists() + } + + } + { + p.SetState(291) + p.AuditorName() + } + p.SetState(296) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(292) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(293) + p.AuditorName() + } + + + p.SetState(298) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// IShardingTableRuleDefinitionContext is an interface to support dynamic dispatch. +type IShardingTableRuleDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShardingTableRuleDefinitionContext differentiates from other interfaces. + IsShardingTableRuleDefinitionContext() +} + +type ShardingTableRuleDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShardingTableRuleDefinitionContext() *ShardingTableRuleDefinitionContext { + var p = new(ShardingTableRuleDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shardingTableRuleDefinition + return p +} + +func (*ShardingTableRuleDefinitionContext) IsShardingTableRuleDefinitionContext() {} + +func NewShardingTableRuleDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShardingTableRuleDefinitionContext { + var p = new(ShardingTableRuleDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shardingTableRuleDefinition + + return p +} + +func (s *ShardingTableRuleDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShardingTableRuleDefinitionContext) ShardingAutoTableRule() IShardingAutoTableRuleContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingAutoTableRuleContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingAutoTableRuleContext) +} + +func (s *ShardingTableRuleDefinitionContext) ShardingTableRule() IShardingTableRuleContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingTableRuleContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingTableRuleContext) +} + +func (s *ShardingTableRuleDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShardingTableRuleDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *ShardingTableRuleDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShardingTableRuleDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) ShardingTableRuleDefinition() (localctx IShardingTableRuleDefinitionContext) { + localctx = NewShardingTableRuleDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 28, RDLStatementParserRULE_shardingTableRuleDefinition) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + p.SetState(301) + p.GetErrorHandler().Sync(p) + switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 22, p.GetParserRuleContext()) { + case 1: + { + p.SetState(299) + p.ShardingAutoTableRule() + } + + + case 2: + { + p.SetState(300) + p.ShardingTableRule() + } + + } + + + + return localctx +} + + +// IShardingAutoTableRuleContext is an interface to support dynamic dispatch. +type IShardingAutoTableRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShardingAutoTableRuleContext differentiates from other interfaces. + IsShardingAutoTableRuleContext() +} + +type ShardingAutoTableRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShardingAutoTableRuleContext() *ShardingAutoTableRuleContext { + var p = new(ShardingAutoTableRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shardingAutoTableRule + return p +} + +func (*ShardingAutoTableRuleContext) IsShardingAutoTableRuleContext() {} + +func NewShardingAutoTableRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShardingAutoTableRuleContext { + var p = new(ShardingAutoTableRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shardingAutoTableRule + + return p +} + +func (s *ShardingAutoTableRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShardingAutoTableRuleContext) TableName() ITableNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(ITableNameContext) +} + +func (s *ShardingAutoTableRuleContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *ShardingAutoTableRuleContext) StorageUnits() IStorageUnitsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IStorageUnitsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IStorageUnitsContext) +} + +func (s *ShardingAutoTableRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *ShardingAutoTableRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *ShardingAutoTableRuleContext) AutoShardingColumnDefinition() IAutoShardingColumnDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAutoShardingColumnDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAutoShardingColumnDefinitionContext) +} + +func (s *ShardingAutoTableRuleContext) AlgorithmDefinition() IAlgorithmDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmDefinitionContext) +} + +func (s *ShardingAutoTableRuleContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *ShardingAutoTableRuleContext) KeyGenerateDefinition() IKeyGenerateDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IKeyGenerateDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IKeyGenerateDefinitionContext) +} + +func (s *ShardingAutoTableRuleContext) AuditDefinition() IAuditDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAuditDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAuditDefinitionContext) +} + +func (s *ShardingAutoTableRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShardingAutoTableRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *ShardingAutoTableRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShardingAutoTableRule(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) ShardingAutoTableRule() (localctx IShardingAutoTableRuleContext) { + localctx = NewShardingAutoTableRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 30, RDLStatementParserRULE_shardingAutoTableRule) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(303) + p.TableName() + } + { + p.SetState(304) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(305) + p.StorageUnits() + } + { + p.SetState(306) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(307) + p.AutoShardingColumnDefinition() + } + { + p.SetState(308) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(309) + p.AlgorithmDefinition() + } + p.SetState(312) + p.GetErrorHandler().Sync(p) + + + if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 23, p.GetParserRuleContext()) == 1 { + { + p.SetState(310) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(311) + p.KeyGenerateDefinition() + } + + + } + p.SetState(316) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserCOMMA_ { + { + p.SetState(314) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(315) + p.AuditDefinition() + } + + } + { + p.SetState(318) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IShardingTableRuleContext is an interface to support dynamic dispatch. +type IShardingTableRuleContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShardingTableRuleContext differentiates from other interfaces. + IsShardingTableRuleContext() +} + +type ShardingTableRuleContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShardingTableRuleContext() *ShardingTableRuleContext { + var p = new(ShardingTableRuleContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shardingTableRule + return p +} + +func (*ShardingTableRuleContext) IsShardingTableRuleContext() {} + +func NewShardingTableRuleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShardingTableRuleContext { + var p = new(ShardingTableRuleContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shardingTableRule + + return p +} + +func (s *ShardingTableRuleContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShardingTableRuleContext) TableName() ITableNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(ITableNameContext) +} + +func (s *ShardingTableRuleContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *ShardingTableRuleContext) DataNodes() IDataNodesContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataNodesContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IDataNodesContext) +} + +func (s *ShardingTableRuleContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *ShardingTableRuleContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *ShardingTableRuleContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *ShardingTableRuleContext) DatabaseStrategy() IDatabaseStrategyContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IDatabaseStrategyContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IDatabaseStrategyContext) +} + +func (s *ShardingTableRuleContext) TableStrategy() ITableStrategyContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableStrategyContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(ITableStrategyContext) +} + +func (s *ShardingTableRuleContext) KeyGenerateDefinition() IKeyGenerateDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IKeyGenerateDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IKeyGenerateDefinitionContext) +} + +func (s *ShardingTableRuleContext) AuditDefinition() IAuditDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAuditDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAuditDefinitionContext) +} + +func (s *ShardingTableRuleContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShardingTableRuleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *ShardingTableRuleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShardingTableRule(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) ShardingTableRule() (localctx IShardingTableRuleContext) { + localctx = NewShardingTableRuleContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 32, RDLStatementParserRULE_shardingTableRule) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(320) + p.TableName() + } + { + p.SetState(321) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(322) + p.DataNodes() + } + p.SetState(325) + p.GetErrorHandler().Sync(p) + + + if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 25, p.GetParserRuleContext()) == 1 { + { + p.SetState(323) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(324) + p.DatabaseStrategy() + } + + + } + p.SetState(329) + p.GetErrorHandler().Sync(p) + + + if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 26, p.GetParserRuleContext()) == 1 { + { + p.SetState(327) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(328) + p.TableStrategy() + } + + + } + p.SetState(333) + p.GetErrorHandler().Sync(p) + + + if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 27, p.GetParserRuleContext()) == 1 { + { + p.SetState(331) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(332) + p.KeyGenerateDefinition() + } + + + } + p.SetState(337) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserCOMMA_ { + { + p.SetState(335) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(336) + p.AuditDefinition() + } + + } + { + p.SetState(339) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IKeyGeneratorNameContext is an interface to support dynamic dispatch. +type IKeyGeneratorNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsKeyGeneratorNameContext differentiates from other interfaces. + IsKeyGeneratorNameContext() +} + +type KeyGeneratorNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyKeyGeneratorNameContext() *KeyGeneratorNameContext { + var p = new(KeyGeneratorNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_keyGeneratorName + return p +} + +func (*KeyGeneratorNameContext) IsKeyGeneratorNameContext() {} + +func NewKeyGeneratorNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *KeyGeneratorNameContext { + var p = new(KeyGeneratorNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_keyGeneratorName + + return p +} + +func (s *KeyGeneratorNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *KeyGeneratorNameContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *KeyGeneratorNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *KeyGeneratorNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *KeyGeneratorNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitKeyGeneratorName(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) KeyGeneratorName() (localctx IKeyGeneratorNameContext) { + localctx = NewKeyGeneratorNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 34, RDLStatementParserRULE_keyGeneratorName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(341) + p.Match(RDLStatementParserIDENTIFIER_) + } + + + + return localctx +} + + +// IAuditorDefinitionContext is an interface to support dynamic dispatch. +type IAuditorDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAuditorDefinitionContext differentiates from other interfaces. + IsAuditorDefinitionContext() +} + +type AuditorDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAuditorDefinitionContext() *AuditorDefinitionContext { + var p = new(AuditorDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_auditorDefinition + return p +} + +func (*AuditorDefinitionContext) IsAuditorDefinitionContext() {} + +func NewAuditorDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AuditorDefinitionContext { + var p = new(AuditorDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_auditorDefinition + + return p +} + +func (s *AuditorDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *AuditorDefinitionContext) AuditorName() IAuditorNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAuditorNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAuditorNameContext) +} + +func (s *AuditorDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *AuditorDefinitionContext) AlgorithmDefinition() IAlgorithmDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmDefinitionContext) +} + +func (s *AuditorDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *AuditorDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AuditorDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *AuditorDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAuditorDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) AuditorDefinition() (localctx IAuditorDefinitionContext) { + localctx = NewAuditorDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 36, RDLStatementParserRULE_auditorDefinition) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(343) + p.AuditorName() + } + { + p.SetState(344) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(345) + p.AlgorithmDefinition() + } + { + p.SetState(346) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IAuditorNameContext is an interface to support dynamic dispatch. +type IAuditorNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAuditorNameContext differentiates from other interfaces. + IsAuditorNameContext() +} + +type AuditorNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAuditorNameContext() *AuditorNameContext { + var p = new(AuditorNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_auditorName + return p +} + +func (*AuditorNameContext) IsAuditorNameContext() {} + +func NewAuditorNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AuditorNameContext { + var p = new(AuditorNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_auditorName + + return p +} + +func (s *AuditorNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *AuditorNameContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *AuditorNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AuditorNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *AuditorNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAuditorName(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) AuditorName() (localctx IAuditorNameContext) { + localctx = NewAuditorNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 38, RDLStatementParserRULE_auditorName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(348) + p.Match(RDLStatementParserIDENTIFIER_) + } + + + + return localctx +} + + +// IStorageUnitsContext is an interface to support dynamic dispatch. +type IStorageUnitsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsStorageUnitsContext differentiates from other interfaces. + IsStorageUnitsContext() +} + +type StorageUnitsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyStorageUnitsContext() *StorageUnitsContext { + var p = new(StorageUnitsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_storageUnits + return p +} + +func (*StorageUnitsContext) IsStorageUnitsContext() {} + +func NewStorageUnitsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StorageUnitsContext { + var p = new(StorageUnitsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_storageUnits + + return p +} + +func (s *StorageUnitsContext) GetParser() antlr.Parser { return s.parser } + +func (s *StorageUnitsContext) STORAGE_UNITS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTORAGE_UNITS, 0) +} + +func (s *StorageUnitsContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *StorageUnitsContext) AllStorageUnit() []IStorageUnitContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IStorageUnitContext)(nil)).Elem()) + var tst = make([]IStorageUnitContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IStorageUnitContext) + } + } + + return tst +} + +func (s *StorageUnitsContext) StorageUnit(i int) IStorageUnitContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IStorageUnitContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IStorageUnitContext) +} + +func (s *StorageUnitsContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *StorageUnitsContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *StorageUnitsContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *StorageUnitsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *StorageUnitsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *StorageUnitsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitStorageUnits(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) StorageUnits() (localctx IStorageUnitsContext) { + localctx = NewStorageUnitsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 40, RDLStatementParserRULE_storageUnits) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(350) + p.Match(RDLStatementParserSTORAGE_UNITS) + } + { + p.SetState(351) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(352) + p.StorageUnit() + } + p.SetState(357) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(353) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(354) + p.StorageUnit() + } + + + p.SetState(359) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(360) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IStorageUnitContext is an interface to support dynamic dispatch. +type IStorageUnitContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsStorageUnitContext differentiates from other interfaces. + IsStorageUnitContext() +} + +type StorageUnitContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyStorageUnitContext() *StorageUnitContext { + var p = new(StorageUnitContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_storageUnit + return p +} + +func (*StorageUnitContext) IsStorageUnitContext() {} + +func NewStorageUnitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StorageUnitContext { + var p = new(StorageUnitContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_storageUnit + + return p +} + +func (s *StorageUnitContext) GetParser() antlr.Parser { return s.parser } + +func (s *StorageUnitContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *StorageUnitContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *StorageUnitContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *StorageUnitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *StorageUnitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitStorageUnit(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) StorageUnit() (localctx IStorageUnitContext) { + localctx = NewStorageUnitContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 42, RDLStatementParserRULE_storageUnit) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(362) + _la = p.GetTokenStream().LA(1) + + if !(_la == RDLStatementParserIDENTIFIER_ || _la == RDLStatementParserSTRING_) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + + + return localctx +} + + +// IDataNodesContext is an interface to support dynamic dispatch. +type IDataNodesContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDataNodesContext differentiates from other interfaces. + IsDataNodesContext() +} + +type DataNodesContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDataNodesContext() *DataNodesContext { + var p = new(DataNodesContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dataNodes + return p +} + +func (*DataNodesContext) IsDataNodesContext() {} + +func NewDataNodesContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DataNodesContext { + var p = new(DataNodesContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dataNodes + + return p +} + +func (s *DataNodesContext) GetParser() antlr.Parser { return s.parser } + +func (s *DataNodesContext) DATANODES() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDATANODES, 0) +} + +func (s *DataNodesContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *DataNodesContext) AllDataNode() []IDataNodeContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IDataNodeContext)(nil)).Elem()) + var tst = make([]IDataNodeContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IDataNodeContext) + } + } + + return tst +} + +func (s *DataNodesContext) DataNode(i int) IDataNodeContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataNodeContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IDataNodeContext) +} + +func (s *DataNodesContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *DataNodesContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *DataNodesContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *DataNodesContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DataNodesContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *DataNodesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDataNodes(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) DataNodes() (localctx IDataNodesContext) { + localctx = NewDataNodesContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 44, RDLStatementParserRULE_dataNodes) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(364) + p.Match(RDLStatementParserDATANODES) + } + { + p.SetState(365) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(366) + p.DataNode() + } + p.SetState(371) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(367) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(368) + p.DataNode() + } + + + p.SetState(373) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(374) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IDataNodeContext is an interface to support dynamic dispatch. +type IDataNodeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDataNodeContext differentiates from other interfaces. + IsDataNodeContext() +} + +type DataNodeContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDataNodeContext() *DataNodeContext { + var p = new(DataNodeContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_dataNode + return p +} + +func (*DataNodeContext) IsDataNodeContext() {} + +func NewDataNodeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DataNodeContext { + var p = new(DataNodeContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_dataNode + + return p +} + +func (s *DataNodeContext) GetParser() antlr.Parser { return s.parser } + +func (s *DataNodeContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *DataNodeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DataNodeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *DataNodeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDataNode(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) DataNode() (localctx IDataNodeContext) { + localctx = NewDataNodeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 46, RDLStatementParserRULE_dataNode) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(376) + p.Match(RDLStatementParserSTRING_) + } + + + + return localctx +} + + +// IAutoShardingColumnDefinitionContext is an interface to support dynamic dispatch. +type IAutoShardingColumnDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAutoShardingColumnDefinitionContext differentiates from other interfaces. + IsAutoShardingColumnDefinitionContext() +} + +type AutoShardingColumnDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAutoShardingColumnDefinitionContext() *AutoShardingColumnDefinitionContext { + var p = new(AutoShardingColumnDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_autoShardingColumnDefinition + return p +} + +func (*AutoShardingColumnDefinitionContext) IsAutoShardingColumnDefinitionContext() {} + +func NewAutoShardingColumnDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AutoShardingColumnDefinitionContext { + var p = new(AutoShardingColumnDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_autoShardingColumnDefinition + + return p +} + +func (s *AutoShardingColumnDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *AutoShardingColumnDefinitionContext) ShardingColumn() IShardingColumnContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingColumnContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingColumnContext) +} + +func (s *AutoShardingColumnDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AutoShardingColumnDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *AutoShardingColumnDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAutoShardingColumnDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) AutoShardingColumnDefinition() (localctx IAutoShardingColumnDefinitionContext) { + localctx = NewAutoShardingColumnDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 48, RDLStatementParserRULE_autoShardingColumnDefinition) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(378) + p.ShardingColumn() + } + + + + return localctx +} + + +// IShardingColumnDefinitionContext is an interface to support dynamic dispatch. +type IShardingColumnDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShardingColumnDefinitionContext differentiates from other interfaces. + IsShardingColumnDefinitionContext() +} + +type ShardingColumnDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShardingColumnDefinitionContext() *ShardingColumnDefinitionContext { + var p = new(ShardingColumnDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shardingColumnDefinition + return p +} + +func (*ShardingColumnDefinitionContext) IsShardingColumnDefinitionContext() {} + +func NewShardingColumnDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShardingColumnDefinitionContext { + var p = new(ShardingColumnDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shardingColumnDefinition + + return p +} + +func (s *ShardingColumnDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShardingColumnDefinitionContext) ShardingColumn() IShardingColumnContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingColumnContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingColumnContext) +} + +func (s *ShardingColumnDefinitionContext) ShardingColumns() IShardingColumnsContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingColumnsContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingColumnsContext) +} + +func (s *ShardingColumnDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShardingColumnDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *ShardingColumnDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShardingColumnDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) ShardingColumnDefinition() (localctx IShardingColumnDefinitionContext) { + localctx = NewShardingColumnDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 50, RDLStatementParserRULE_shardingColumnDefinition) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.SetState(382) + p.GetErrorHandler().Sync(p) + + switch p.GetTokenStream().LA(1) { + case RDLStatementParserSHARDING_COLUMN: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(380) + p.ShardingColumn() + } + + + case RDLStatementParserSHARDING_COLUMNS: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(381) + p.ShardingColumns() + } + + + + default: + panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + } + + + return localctx +} + + +// IShardingColumnContext is an interface to support dynamic dispatch. +type IShardingColumnContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShardingColumnContext differentiates from other interfaces. + IsShardingColumnContext() +} + +type ShardingColumnContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShardingColumnContext() *ShardingColumnContext { + var p = new(ShardingColumnContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shardingColumn + return p +} + +func (*ShardingColumnContext) IsShardingColumnContext() {} + +func NewShardingColumnContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShardingColumnContext { + var p = new(ShardingColumnContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shardingColumn + + return p +} + +func (s *ShardingColumnContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShardingColumnContext) SHARDING_COLUMN() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING_COLUMN, 0) +} + +func (s *ShardingColumnContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *ShardingColumnContext) ColumnName() IColumnNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IColumnNameContext) +} + +func (s *ShardingColumnContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShardingColumnContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *ShardingColumnContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShardingColumn(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) ShardingColumn() (localctx IShardingColumnContext) { + localctx = NewShardingColumnContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 52, RDLStatementParserRULE_shardingColumn) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(384) + p.Match(RDLStatementParserSHARDING_COLUMN) + } + { + p.SetState(385) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(386) + p.ColumnName() + } + + + + return localctx +} + + +// IShardingColumnsContext is an interface to support dynamic dispatch. +type IShardingColumnsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShardingColumnsContext differentiates from other interfaces. + IsShardingColumnsContext() +} + +type ShardingColumnsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShardingColumnsContext() *ShardingColumnsContext { + var p = new(ShardingColumnsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shardingColumns + return p +} + +func (*ShardingColumnsContext) IsShardingColumnsContext() {} + +func NewShardingColumnsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShardingColumnsContext { + var p = new(ShardingColumnsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shardingColumns + + return p +} + +func (s *ShardingColumnsContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShardingColumnsContext) SHARDING_COLUMNS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING_COLUMNS, 0) +} + +func (s *ShardingColumnsContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *ShardingColumnsContext) AllColumnName() []IColumnNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IColumnNameContext)(nil)).Elem()) + var tst = make([]IColumnNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IColumnNameContext) + } + } + + return tst +} + +func (s *ShardingColumnsContext) ColumnName(i int) IColumnNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IColumnNameContext) +} + +func (s *ShardingColumnsContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *ShardingColumnsContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *ShardingColumnsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShardingColumnsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *ShardingColumnsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShardingColumns(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) ShardingColumns() (localctx IShardingColumnsContext) { + localctx = NewShardingColumnsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 54, RDLStatementParserRULE_shardingColumns) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(388) + p.Match(RDLStatementParserSHARDING_COLUMNS) + } + { + p.SetState(389) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(390) + p.ColumnName() + } + { + p.SetState(391) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(392) + p.ColumnName() + } + p.SetState(397) + p.GetErrorHandler().Sync(p) + _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 32, p.GetParserRuleContext()) + + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(393) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(394) + p.ColumnName() + } + + + } + p.SetState(399) + p.GetErrorHandler().Sync(p) + _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 32, p.GetParserRuleContext()) + } + + + + return localctx +} + + +// IShardingAlgorithmContext is an interface to support dynamic dispatch. +type IShardingAlgorithmContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShardingAlgorithmContext differentiates from other interfaces. + IsShardingAlgorithmContext() +} + +type ShardingAlgorithmContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShardingAlgorithmContext() *ShardingAlgorithmContext { + var p = new(ShardingAlgorithmContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shardingAlgorithm + return p +} + +func (*ShardingAlgorithmContext) IsShardingAlgorithmContext() {} + +func NewShardingAlgorithmContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShardingAlgorithmContext { + var p = new(ShardingAlgorithmContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shardingAlgorithm + + return p +} + +func (s *ShardingAlgorithmContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShardingAlgorithmContext) SHARDING_ALGORITHM() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSHARDING_ALGORITHM, 0) +} + +func (s *ShardingAlgorithmContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *ShardingAlgorithmContext) AlgorithmDefinition() IAlgorithmDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmDefinitionContext) +} + +func (s *ShardingAlgorithmContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *ShardingAlgorithmContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShardingAlgorithmContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *ShardingAlgorithmContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShardingAlgorithm(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) ShardingAlgorithm() (localctx IShardingAlgorithmContext) { + localctx = NewShardingAlgorithmContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 56, RDLStatementParserRULE_shardingAlgorithm) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(400) + p.Match(RDLStatementParserSHARDING_ALGORITHM) + } + { + p.SetState(401) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(402) + p.AlgorithmDefinition() + } + { + p.SetState(403) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IShardingStrategyContext is an interface to support dynamic dispatch. +type IShardingStrategyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShardingStrategyContext differentiates from other interfaces. + IsShardingStrategyContext() +} + +type ShardingStrategyContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShardingStrategyContext() *ShardingStrategyContext { + var p = new(ShardingStrategyContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shardingStrategy + return p +} + +func (*ShardingStrategyContext) IsShardingStrategyContext() {} + +func NewShardingStrategyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShardingStrategyContext { + var p = new(ShardingStrategyContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shardingStrategy + + return p +} + +func (s *ShardingStrategyContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShardingStrategyContext) TYPE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTYPE, 0) +} + +func (s *ShardingStrategyContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *ShardingStrategyContext) StrategyType() IStrategyTypeContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IStrategyTypeContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IStrategyTypeContext) +} + +func (s *ShardingStrategyContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *ShardingStrategyContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *ShardingStrategyContext) ShardingAlgorithm() IShardingAlgorithmContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingAlgorithmContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingAlgorithmContext) +} + +func (s *ShardingStrategyContext) ShardingColumnDefinition() IShardingColumnDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingColumnDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingColumnDefinitionContext) +} + +func (s *ShardingStrategyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShardingStrategyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *ShardingStrategyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShardingStrategy(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) ShardingStrategy() (localctx IShardingStrategyContext) { + localctx = NewShardingStrategyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 58, RDLStatementParserRULE_shardingStrategy) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(405) + p.Match(RDLStatementParserTYPE) + } + { + p.SetState(406) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(407) + p.StrategyType() + } + p.SetState(414) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserCOMMA_ { + p.SetState(410) + p.GetErrorHandler().Sync(p) + + + if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 33, p.GetParserRuleContext()) == 1 { + { + p.SetState(408) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(409) + p.ShardingColumnDefinition() + } + + + } + { + p.SetState(412) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(413) + p.ShardingAlgorithm() + } + + } + + + + return localctx +} + + +// IDatabaseStrategyContext is an interface to support dynamic dispatch. +type IDatabaseStrategyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsDatabaseStrategyContext differentiates from other interfaces. + IsDatabaseStrategyContext() +} + +type DatabaseStrategyContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDatabaseStrategyContext() *DatabaseStrategyContext { + var p = new(DatabaseStrategyContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_databaseStrategy + return p +} + +func (*DatabaseStrategyContext) IsDatabaseStrategyContext() {} + +func NewDatabaseStrategyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DatabaseStrategyContext { + var p = new(DatabaseStrategyContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_databaseStrategy + + return p +} + +func (s *DatabaseStrategyContext) GetParser() antlr.Parser { return s.parser } + +func (s *DatabaseStrategyContext) DATABASE_STRATEGY() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDATABASE_STRATEGY, 0) +} + +func (s *DatabaseStrategyContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *DatabaseStrategyContext) ShardingStrategy() IShardingStrategyContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingStrategyContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingStrategyContext) +} + +func (s *DatabaseStrategyContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *DatabaseStrategyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DatabaseStrategyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *DatabaseStrategyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitDatabaseStrategy(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) DatabaseStrategy() (localctx IDatabaseStrategyContext) { + localctx = NewDatabaseStrategyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 60, RDLStatementParserRULE_databaseStrategy) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(416) + p.Match(RDLStatementParserDATABASE_STRATEGY) + } + { + p.SetState(417) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(418) + p.ShardingStrategy() + } + { + p.SetState(419) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// ITableStrategyContext is an interface to support dynamic dispatch. +type ITableStrategyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsTableStrategyContext differentiates from other interfaces. + IsTableStrategyContext() +} + +type TableStrategyContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTableStrategyContext() *TableStrategyContext { + var p = new(TableStrategyContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_tableStrategy + return p +} + +func (*TableStrategyContext) IsTableStrategyContext() {} + +func NewTableStrategyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TableStrategyContext { + var p = new(TableStrategyContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_tableStrategy + + return p +} + +func (s *TableStrategyContext) GetParser() antlr.Parser { return s.parser } + +func (s *TableStrategyContext) TABLE_STRATEGY() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTABLE_STRATEGY, 0) +} + +func (s *TableStrategyContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *TableStrategyContext) ShardingStrategy() IShardingStrategyContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IShardingStrategyContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IShardingStrategyContext) +} + +func (s *TableStrategyContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *TableStrategyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableStrategyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *TableStrategyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitTableStrategy(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) TableStrategy() (localctx ITableStrategyContext) { + localctx = NewTableStrategyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 62, RDLStatementParserRULE_tableStrategy) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(421) + p.Match(RDLStatementParserTABLE_STRATEGY) + } + { + p.SetState(422) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(423) + p.ShardingStrategy() + } + { + p.SetState(424) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IKeyGenerateDefinitionContext is an interface to support dynamic dispatch. +type IKeyGenerateDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsKeyGenerateDefinitionContext differentiates from other interfaces. + IsKeyGenerateDefinitionContext() +} + +type KeyGenerateDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyKeyGenerateDefinitionContext() *KeyGenerateDefinitionContext { + var p = new(KeyGenerateDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_keyGenerateDefinition + return p +} + +func (*KeyGenerateDefinitionContext) IsKeyGenerateDefinitionContext() {} + +func NewKeyGenerateDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *KeyGenerateDefinitionContext { + var p = new(KeyGenerateDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_keyGenerateDefinition + + return p +} + +func (s *KeyGenerateDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *KeyGenerateDefinitionContext) KEY_GENERATE_STRATEGY() antlr.TerminalNode { + return s.GetToken(RDLStatementParserKEY_GENERATE_STRATEGY, 0) +} + +func (s *KeyGenerateDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *KeyGenerateDefinitionContext) COLUMN() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOLUMN, 0) +} + +func (s *KeyGenerateDefinitionContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *KeyGenerateDefinitionContext) ColumnName() IColumnNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IColumnNameContext) +} + +func (s *KeyGenerateDefinitionContext) COMMA_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, 0) +} + +func (s *KeyGenerateDefinitionContext) AlgorithmDefinition() IAlgorithmDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmDefinitionContext) +} + +func (s *KeyGenerateDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *KeyGenerateDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *KeyGenerateDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *KeyGenerateDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitKeyGenerateDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) KeyGenerateDefinition() (localctx IKeyGenerateDefinitionContext) { + localctx = NewKeyGenerateDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 64, RDLStatementParserRULE_keyGenerateDefinition) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(426) + p.Match(RDLStatementParserKEY_GENERATE_STRATEGY) + } + { + p.SetState(427) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(428) + p.Match(RDLStatementParserCOLUMN) + } + { + p.SetState(429) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(430) + p.ColumnName() + } + { + p.SetState(431) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(432) + p.AlgorithmDefinition() + } + { + p.SetState(433) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IAuditDefinitionContext is an interface to support dynamic dispatch. +type IAuditDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAuditDefinitionContext differentiates from other interfaces. + IsAuditDefinitionContext() +} + +type AuditDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAuditDefinitionContext() *AuditDefinitionContext { + var p = new(AuditDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_auditDefinition + return p +} + +func (*AuditDefinitionContext) IsAuditDefinitionContext() {} + +func NewAuditDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AuditDefinitionContext { + var p = new(AuditDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_auditDefinition + + return p +} + +func (s *AuditDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *AuditDefinitionContext) AUDIT_STRATEGY() antlr.TerminalNode { + return s.GetToken(RDLStatementParserAUDIT_STRATEGY, 0) +} + +func (s *AuditDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *AuditDefinitionContext) MultiAuditDefinition() IMultiAuditDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IMultiAuditDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IMultiAuditDefinitionContext) +} + +func (s *AuditDefinitionContext) COMMA_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, 0) +} + +func (s *AuditDefinitionContext) ALLOW_HINT_DISABLE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserALLOW_HINT_DISABLE, 0) +} + +func (s *AuditDefinitionContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *AuditDefinitionContext) AuditAllowHintDisable() IAuditAllowHintDisableContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAuditAllowHintDisableContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAuditAllowHintDisableContext) +} + +func (s *AuditDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *AuditDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AuditDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *AuditDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAuditDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) AuditDefinition() (localctx IAuditDefinitionContext) { + localctx = NewAuditDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 66, RDLStatementParserRULE_auditDefinition) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(435) + p.Match(RDLStatementParserAUDIT_STRATEGY) + } + { + p.SetState(436) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(437) + p.MultiAuditDefinition() + } + { + p.SetState(438) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(439) + p.Match(RDLStatementParserALLOW_HINT_DISABLE) + } + { + p.SetState(440) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(441) + p.AuditAllowHintDisable() + } + { + p.SetState(442) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IMultiAuditDefinitionContext is an interface to support dynamic dispatch. +type IMultiAuditDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsMultiAuditDefinitionContext differentiates from other interfaces. + IsMultiAuditDefinitionContext() +} + +type MultiAuditDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyMultiAuditDefinitionContext() *MultiAuditDefinitionContext { + var p = new(MultiAuditDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_multiAuditDefinition + return p +} + +func (*MultiAuditDefinitionContext) IsMultiAuditDefinitionContext() {} + +func NewMultiAuditDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MultiAuditDefinitionContext { + var p = new(MultiAuditDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_multiAuditDefinition + + return p +} + +func (s *MultiAuditDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *MultiAuditDefinitionContext) AllSingleAuditDefinition() []ISingleAuditDefinitionContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ISingleAuditDefinitionContext)(nil)).Elem()) + var tst = make([]ISingleAuditDefinitionContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(ISingleAuditDefinitionContext) + } + } + + return tst +} + +func (s *MultiAuditDefinitionContext) SingleAuditDefinition(i int) ISingleAuditDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ISingleAuditDefinitionContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(ISingleAuditDefinitionContext) +} + +func (s *MultiAuditDefinitionContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *MultiAuditDefinitionContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *MultiAuditDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MultiAuditDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *MultiAuditDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitMultiAuditDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) MultiAuditDefinition() (localctx IMultiAuditDefinitionContext) { + localctx = NewMultiAuditDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 68, RDLStatementParserRULE_multiAuditDefinition) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(444) + p.SingleAuditDefinition() + } + p.SetState(449) + p.GetErrorHandler().Sync(p) + _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 35, p.GetParserRuleContext()) + + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(445) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(446) + p.SingleAuditDefinition() + } + + + } + p.SetState(451) + p.GetErrorHandler().Sync(p) + _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 35, p.GetParserRuleContext()) + } + + + + return localctx +} + + +// ISingleAuditDefinitionContext is an interface to support dynamic dispatch. +type ISingleAuditDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsSingleAuditDefinitionContext differentiates from other interfaces. + IsSingleAuditDefinitionContext() +} + +type SingleAuditDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySingleAuditDefinitionContext() *SingleAuditDefinitionContext { + var p = new(SingleAuditDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_singleAuditDefinition + return p +} + +func (*SingleAuditDefinitionContext) IsSingleAuditDefinitionContext() {} + +func NewSingleAuditDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SingleAuditDefinitionContext { + var p = new(SingleAuditDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_singleAuditDefinition + + return p +} + +func (s *SingleAuditDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *SingleAuditDefinitionContext) AlgorithmDefinition() IAlgorithmDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmDefinitionContext) +} + +func (s *SingleAuditDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SingleAuditDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *SingleAuditDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitSingleAuditDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) SingleAuditDefinition() (localctx ISingleAuditDefinitionContext) { + localctx = NewSingleAuditDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 70, RDLStatementParserRULE_singleAuditDefinition) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(452) + p.AlgorithmDefinition() + } + + + + return localctx +} + + +// IAuditAllowHintDisableContext is an interface to support dynamic dispatch. +type IAuditAllowHintDisableContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAuditAllowHintDisableContext differentiates from other interfaces. + IsAuditAllowHintDisableContext() +} + +type AuditAllowHintDisableContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAuditAllowHintDisableContext() *AuditAllowHintDisableContext { + var p = new(AuditAllowHintDisableContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_auditAllowHintDisable + return p +} + +func (*AuditAllowHintDisableContext) IsAuditAllowHintDisableContext() {} + +func NewAuditAllowHintDisableContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AuditAllowHintDisableContext { + var p = new(AuditAllowHintDisableContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_auditAllowHintDisable + + return p +} + +func (s *AuditAllowHintDisableContext) GetParser() antlr.Parser { return s.parser } + +func (s *AuditAllowHintDisableContext) TRUE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTRUE, 0) +} + +func (s *AuditAllowHintDisableContext) FALSE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserFALSE, 0) +} + +func (s *AuditAllowHintDisableContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AuditAllowHintDisableContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *AuditAllowHintDisableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAuditAllowHintDisable(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) AuditAllowHintDisable() (localctx IAuditAllowHintDisableContext) { + localctx = NewAuditAllowHintDisableContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 72, RDLStatementParserRULE_auditAllowHintDisable) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(454) + _la = p.GetTokenStream().LA(1) + + if !(_la == RDLStatementParserTRUE || _la == RDLStatementParserFALSE) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + + + return localctx +} + + +// IColumnNameContext is an interface to support dynamic dispatch. +type IColumnNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsColumnNameContext differentiates from other interfaces. + IsColumnNameContext() +} + +type ColumnNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyColumnNameContext() *ColumnNameContext { + var p = new(ColumnNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_columnName + return p +} + +func (*ColumnNameContext) IsColumnNameContext() {} + +func NewColumnNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ColumnNameContext { + var p = new(ColumnNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_columnName + + return p +} + +func (s *ColumnNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *ColumnNameContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *ColumnNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ColumnNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *ColumnNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitColumnName(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) ColumnName() (localctx IColumnNameContext) { + localctx = NewColumnNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 74, RDLStatementParserRULE_columnName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(456) + p.Match(RDLStatementParserIDENTIFIER_) + } + + + + return localctx +} + + +// ITableReferenceRuleDefinitionContext is an interface to support dynamic dispatch. +type ITableReferenceRuleDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsTableReferenceRuleDefinitionContext differentiates from other interfaces. + IsTableReferenceRuleDefinitionContext() +} + +type TableReferenceRuleDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTableReferenceRuleDefinitionContext() *TableReferenceRuleDefinitionContext { + var p = new(TableReferenceRuleDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_tableReferenceRuleDefinition + return p +} + +func (*TableReferenceRuleDefinitionContext) IsTableReferenceRuleDefinitionContext() {} + +func NewTableReferenceRuleDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TableReferenceRuleDefinitionContext { + var p = new(TableReferenceRuleDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_tableReferenceRuleDefinition + + return p +} + +func (s *TableReferenceRuleDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *TableReferenceRuleDefinitionContext) RuleName() IRuleNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IRuleNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IRuleNameContext) +} + +func (s *TableReferenceRuleDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *TableReferenceRuleDefinitionContext) AllTableName() []ITableNameContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ITableNameContext)(nil)).Elem()) + var tst = make([]ITableNameContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(ITableNameContext) + } + } + + return tst +} + +func (s *TableReferenceRuleDefinitionContext) TableName(i int) ITableNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableNameContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(ITableNameContext) +} + +func (s *TableReferenceRuleDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *TableReferenceRuleDefinitionContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *TableReferenceRuleDefinitionContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *TableReferenceRuleDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableReferenceRuleDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *TableReferenceRuleDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitTableReferenceRuleDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) TableReferenceRuleDefinition() (localctx ITableReferenceRuleDefinitionContext) { + localctx = NewTableReferenceRuleDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 76, RDLStatementParserRULE_tableReferenceRuleDefinition) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(458) + p.RuleName() + } + { + p.SetState(459) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(460) + p.TableName() + } + p.SetState(465) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(461) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(462) + p.TableName() + } + + + p.SetState(467) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(468) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IStrategyTypeContext is an interface to support dynamic dispatch. +type IStrategyTypeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsStrategyTypeContext differentiates from other interfaces. + IsStrategyTypeContext() +} + +type StrategyTypeContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyStrategyTypeContext() *StrategyTypeContext { + var p = new(StrategyTypeContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_strategyType + return p +} + +func (*StrategyTypeContext) IsStrategyTypeContext() {} + +func NewStrategyTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StrategyTypeContext { + var p = new(StrategyTypeContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_strategyType + + return p +} + +func (s *StrategyTypeContext) GetParser() antlr.Parser { return s.parser } + +func (s *StrategyTypeContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *StrategyTypeContext) BuildInStrategyType() IBuildInStrategyTypeContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IBuildInStrategyTypeContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IBuildInStrategyTypeContext) +} + +func (s *StrategyTypeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *StrategyTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *StrategyTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitStrategyType(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) StrategyType() (localctx IStrategyTypeContext) { + localctx = NewStrategyTypeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 78, RDLStatementParserRULE_strategyType) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.SetState(472) + p.GetErrorHandler().Sync(p) + + switch p.GetTokenStream().LA(1) { + case RDLStatementParserSTRING_: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(470) + p.Match(RDLStatementParserSTRING_) + } + + + case RDLStatementParserHINT, RDLStatementParserSTANDARD, RDLStatementParserCOMPLEX, RDLStatementParserNONE: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(471) + p.BuildInStrategyType() + } + + + + default: + panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + } + + + return localctx +} + + +// IBuildInStrategyTypeContext is an interface to support dynamic dispatch. +type IBuildInStrategyTypeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsBuildInStrategyTypeContext differentiates from other interfaces. + IsBuildInStrategyTypeContext() +} + +type BuildInStrategyTypeContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBuildInStrategyTypeContext() *BuildInStrategyTypeContext { + var p = new(BuildInStrategyTypeContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_buildInStrategyType + return p +} + +func (*BuildInStrategyTypeContext) IsBuildInStrategyTypeContext() {} + +func NewBuildInStrategyTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BuildInStrategyTypeContext { + var p = new(BuildInStrategyTypeContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_buildInStrategyType + + return p +} + +func (s *BuildInStrategyTypeContext) GetParser() antlr.Parser { return s.parser } + +func (s *BuildInStrategyTypeContext) STANDARD() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTANDARD, 0) +} + +func (s *BuildInStrategyTypeContext) COMPLEX() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMPLEX, 0) +} + +func (s *BuildInStrategyTypeContext) HINT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserHINT, 0) +} + +func (s *BuildInStrategyTypeContext) NONE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNONE, 0) +} + +func (s *BuildInStrategyTypeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BuildInStrategyTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *BuildInStrategyTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitBuildInStrategyType(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) BuildInStrategyType() (localctx IBuildInStrategyTypeContext) { + localctx = NewBuildInStrategyTypeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 80, RDLStatementParserRULE_buildInStrategyType) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(474) + _la = p.GetTokenStream().LA(1) + + if !(_la == RDLStatementParserHINT || ((((_la - 110)) & -(0x1f+1)) == 0 && ((1 << uint((_la - 110))) & ((1 << (RDLStatementParserSTANDARD - 110)) | (1 << (RDLStatementParserCOMPLEX - 110)) | (1 << (RDLStatementParserNONE - 110)))) != 0)) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + + + return localctx +} + + +// IIfExistsContext is an interface to support dynamic dispatch. +type IIfExistsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsIfExistsContext differentiates from other interfaces. + IsIfExistsContext() +} + +type IfExistsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIfExistsContext() *IfExistsContext { + var p = new(IfExistsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_ifExists + return p +} + +func (*IfExistsContext) IsIfExistsContext() {} + +func NewIfExistsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfExistsContext { + var p = new(IfExistsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_ifExists + + return p +} + +func (s *IfExistsContext) GetParser() antlr.Parser { return s.parser } + +func (s *IfExistsContext) IF() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIF, 0) +} + +func (s *IfExistsContext) EXISTS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEXISTS, 0) +} + +func (s *IfExistsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IfExistsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *IfExistsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitIfExists(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) IfExists() (localctx IIfExistsContext) { + localctx = NewIfExistsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 82, RDLStatementParserRULE_ifExists) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(476) + p.Match(RDLStatementParserIF) + } + { + p.SetState(477) + p.Match(RDLStatementParserEXISTS) + } + + + + return localctx +} + + +// IIfNotExistsContext is an interface to support dynamic dispatch. +type IIfNotExistsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsIfNotExistsContext differentiates from other interfaces. + IsIfNotExistsContext() +} + +type IfNotExistsContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIfNotExistsContext() *IfNotExistsContext { + var p = new(IfNotExistsContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_ifNotExists + return p +} + +func (*IfNotExistsContext) IsIfNotExistsContext() {} + +func NewIfNotExistsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfNotExistsContext { + var p = new(IfNotExistsContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_ifNotExists + + return p +} + +func (s *IfNotExistsContext) GetParser() antlr.Parser { return s.parser } + +func (s *IfNotExistsContext) IF() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIF, 0) +} + +func (s *IfNotExistsContext) NOT() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNOT, 0) +} + +func (s *IfNotExistsContext) EXISTS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEXISTS, 0) +} + +func (s *IfNotExistsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IfNotExistsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *IfNotExistsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitIfNotExists(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) IfNotExists() (localctx IIfNotExistsContext) { + localctx = NewIfNotExistsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 84, RDLStatementParserRULE_ifNotExists) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(479) + p.Match(RDLStatementParserIF) + } + { + p.SetState(480) + p.Match(RDLStatementParserNOT) + } + { + p.SetState(481) + p.Match(RDLStatementParserEXISTS) + } + + + + return localctx +} + + +// 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) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_literal + return p +} + +func (*LiteralContext) IsLiteralContext() {} + +func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext { + var p = new(LiteralContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_literal + + return p +} + +func (s *LiteralContext) GetParser() antlr.Parser { return s.parser } + +func (s *LiteralContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *LiteralContext) INT_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserINT_, 0) +} + +func (s *LiteralContext) MINUS_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMINUS_, 0) +} + +func (s *LiteralContext) TRUE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTRUE, 0) +} + +func (s *LiteralContext) FALSE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserFALSE, 0) +} + +func (s *LiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *LiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitLiteral(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) Literal() (localctx ILiteralContext) { + localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 86, RDLStatementParserRULE_literal) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.SetState(490) + p.GetErrorHandler().Sync(p) + + switch p.GetTokenStream().LA(1) { + case RDLStatementParserSTRING_: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(483) + p.Match(RDLStatementParserSTRING_) + } + + + case RDLStatementParserMINUS_, RDLStatementParserINT_: + p.EnterOuterAlt(localctx, 2) + p.SetState(485) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserMINUS_ { + { + p.SetState(484) + p.Match(RDLStatementParserMINUS_) + } + + } + { + p.SetState(487) + p.Match(RDLStatementParserINT_) + } + + + case RDLStatementParserTRUE: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(488) + p.Match(RDLStatementParserTRUE) + } + + + case RDLStatementParserFALSE: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(489) + p.Match(RDLStatementParserFALSE) + } + + + + default: + panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + } + + + return localctx +} + + +// IAlgorithmDefinitionContext is an interface to support dynamic dispatch. +type IAlgorithmDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlgorithmDefinitionContext differentiates from other interfaces. + IsAlgorithmDefinitionContext() +} + +type AlgorithmDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlgorithmDefinitionContext() *AlgorithmDefinitionContext { + var p = new(AlgorithmDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_algorithmDefinition + return p +} + +func (*AlgorithmDefinitionContext) IsAlgorithmDefinitionContext() {} + +func NewAlgorithmDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlgorithmDefinitionContext { + var p = new(AlgorithmDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_algorithmDefinition + + return p +} + +func (s *AlgorithmDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlgorithmDefinitionContext) TYPE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserTYPE, 0) +} + +func (s *AlgorithmDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *AlgorithmDefinitionContext) NAME() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNAME, 0) +} + +func (s *AlgorithmDefinitionContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *AlgorithmDefinitionContext) AlgorithmTypeName() IAlgorithmTypeNameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAlgorithmTypeNameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAlgorithmTypeNameContext) +} + +func (s *AlgorithmDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *AlgorithmDefinitionContext) COMMA_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, 0) +} + +func (s *AlgorithmDefinitionContext) PropertiesDefinition() IPropertiesDefinitionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertiesDefinitionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IPropertiesDefinitionContext) +} + +func (s *AlgorithmDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlgorithmDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *AlgorithmDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlgorithmDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) AlgorithmDefinition() (localctx IAlgorithmDefinitionContext) { + localctx = NewAlgorithmDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 88, RDLStatementParserRULE_algorithmDefinition) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(492) + p.Match(RDLStatementParserTYPE) + } + { + p.SetState(493) + p.Match(RDLStatementParserLP_) + } + { + p.SetState(494) + p.Match(RDLStatementParserNAME) + } + { + p.SetState(495) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(496) + p.AlgorithmTypeName() + } + p.SetState(499) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserCOMMA_ { + { + p.SetState(497) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(498) + p.PropertiesDefinition() + } + + } + { + p.SetState(501) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IAlgorithmTypeNameContext is an interface to support dynamic dispatch. +type IAlgorithmTypeNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAlgorithmTypeNameContext differentiates from other interfaces. + IsAlgorithmTypeNameContext() +} + +type AlgorithmTypeNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAlgorithmTypeNameContext() *AlgorithmTypeNameContext { + var p = new(AlgorithmTypeNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_algorithmTypeName + return p +} + +func (*AlgorithmTypeNameContext) IsAlgorithmTypeNameContext() {} + +func NewAlgorithmTypeNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AlgorithmTypeNameContext { + var p = new(AlgorithmTypeNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_algorithmTypeName + + return p +} + +func (s *AlgorithmTypeNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *AlgorithmTypeNameContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *AlgorithmTypeNameContext) BuildInShardingAlgorithmType() IBuildInShardingAlgorithmTypeContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IBuildInShardingAlgorithmTypeContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IBuildInShardingAlgorithmTypeContext) +} + +func (s *AlgorithmTypeNameContext) BuildInKeyGenerateAlgorithmType() IBuildInKeyGenerateAlgorithmTypeContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IBuildInKeyGenerateAlgorithmTypeContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IBuildInKeyGenerateAlgorithmTypeContext) +} + +func (s *AlgorithmTypeNameContext) BuildInShardingAuditAlgorithmType() IBuildInShardingAuditAlgorithmTypeContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IBuildInShardingAuditAlgorithmTypeContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IBuildInShardingAuditAlgorithmTypeContext) +} + +func (s *AlgorithmTypeNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AlgorithmTypeNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *AlgorithmTypeNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitAlgorithmTypeName(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) AlgorithmTypeName() (localctx IAlgorithmTypeNameContext) { + localctx = NewAlgorithmTypeNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 90, RDLStatementParserRULE_algorithmTypeName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.SetState(507) + p.GetErrorHandler().Sync(p) + + switch p.GetTokenStream().LA(1) { + case RDLStatementParserSTRING_: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(503) + p.Match(RDLStatementParserSTRING_) + } + + + case RDLStatementParserMOD, RDLStatementParserCOSID_MOD, RDLStatementParserHASH_MOD, RDLStatementParserVOLUME_RANGE, RDLStatementParserBOUNDARY_RANGE, RDLStatementParserAUTO_INTERVAL, RDLStatementParserINLINE, RDLStatementParserINTERVAL, RDLStatementParserCOSID_INTERVAL, RDLStatementParserCOSID_INTERVAL_SNOWFLAKE, RDLStatementParserCOMPLEX_INLINE, RDLStatementParserHINT_INLINE, RDLStatementParserCLASS_BASED: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(504) + p.BuildInShardingAlgorithmType() + } + + + case RDLStatementParserSNOWFLAKE, RDLStatementParserNANOID, RDLStatementParserUUID, RDLStatementParserCOSID, RDLStatementParserCOSID_SNOWFLAKE: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(505) + p.BuildInKeyGenerateAlgorithmType() + } + + + case RDLStatementParserDML_SHARDING_CONDITIONS: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(506) + p.BuildInShardingAuditAlgorithmType() + } + + + + default: + panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + } + + + return localctx +} + + +// IBuildInShardingAlgorithmTypeContext is an interface to support dynamic dispatch. +type IBuildInShardingAlgorithmTypeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsBuildInShardingAlgorithmTypeContext differentiates from other interfaces. + IsBuildInShardingAlgorithmTypeContext() +} + +type BuildInShardingAlgorithmTypeContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBuildInShardingAlgorithmTypeContext() *BuildInShardingAlgorithmTypeContext { + var p = new(BuildInShardingAlgorithmTypeContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_buildInShardingAlgorithmType + return p +} + +func (*BuildInShardingAlgorithmTypeContext) IsBuildInShardingAlgorithmTypeContext() {} + +func NewBuildInShardingAlgorithmTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BuildInShardingAlgorithmTypeContext { + var p = new(BuildInShardingAlgorithmTypeContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_buildInShardingAlgorithmType + + return p +} + +func (s *BuildInShardingAlgorithmTypeContext) GetParser() antlr.Parser { return s.parser } + +func (s *BuildInShardingAlgorithmTypeContext) MOD() antlr.TerminalNode { + return s.GetToken(RDLStatementParserMOD, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) HASH_MOD() antlr.TerminalNode { + return s.GetToken(RDLStatementParserHASH_MOD, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) VOLUME_RANGE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserVOLUME_RANGE, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) BOUNDARY_RANGE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserBOUNDARY_RANGE, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) AUTO_INTERVAL() antlr.TerminalNode { + return s.GetToken(RDLStatementParserAUTO_INTERVAL, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) INLINE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserINLINE, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) INTERVAL() antlr.TerminalNode { + return s.GetToken(RDLStatementParserINTERVAL, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) COSID_MOD() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOSID_MOD, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) COSID_INTERVAL() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOSID_INTERVAL, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) COSID_INTERVAL_SNOWFLAKE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOSID_INTERVAL_SNOWFLAKE, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) COMPLEX_INLINE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMPLEX_INLINE, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) HINT_INLINE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserHINT_INLINE, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) CLASS_BASED() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCLASS_BASED, 0) +} + +func (s *BuildInShardingAlgorithmTypeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BuildInShardingAlgorithmTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *BuildInShardingAlgorithmTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitBuildInShardingAlgorithmType(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) BuildInShardingAlgorithmType() (localctx IBuildInShardingAlgorithmTypeContext) { + localctx = NewBuildInShardingAlgorithmTypeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 92, RDLStatementParserRULE_buildInShardingAlgorithmType) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(509) + _la = p.GetTokenStream().LA(1) + + if !(((((_la - 92)) & -(0x1f+1)) == 0 && ((1 << uint((_la - 92))) & ((1 << (RDLStatementParserMOD - 92)) | (1 << (RDLStatementParserCOSID_MOD - 92)) | (1 << (RDLStatementParserHASH_MOD - 92)) | (1 << (RDLStatementParserVOLUME_RANGE - 92)) | (1 << (RDLStatementParserBOUNDARY_RANGE - 92)) | (1 << (RDLStatementParserAUTO_INTERVAL - 92)) | (1 << (RDLStatementParserINLINE - 92)) | (1 << (RDLStatementParserINTERVAL - 92)) | (1 << (RDLStatementParserCOSID_INTERVAL - 92)) | (1 << (RDLStatementParserCOSID_INTERVAL_SNOWFLAKE - 92)) | (1 << (RDLStatementParserCOMPLEX_INLINE - 92)) | (1 << (RDLStatementParserHINT_INLINE - 92)) | (1 << (RDLStatementParserCLASS_BASED - 92)))) != 0)) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + + + return localctx +} + + +// IBuildInKeyGenerateAlgorithmTypeContext is an interface to support dynamic dispatch. +type IBuildInKeyGenerateAlgorithmTypeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsBuildInKeyGenerateAlgorithmTypeContext differentiates from other interfaces. + IsBuildInKeyGenerateAlgorithmTypeContext() +} + +type BuildInKeyGenerateAlgorithmTypeContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBuildInKeyGenerateAlgorithmTypeContext() *BuildInKeyGenerateAlgorithmTypeContext { + var p = new(BuildInKeyGenerateAlgorithmTypeContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_buildInKeyGenerateAlgorithmType + return p +} + +func (*BuildInKeyGenerateAlgorithmTypeContext) IsBuildInKeyGenerateAlgorithmTypeContext() {} + +func NewBuildInKeyGenerateAlgorithmTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BuildInKeyGenerateAlgorithmTypeContext { + var p = new(BuildInKeyGenerateAlgorithmTypeContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_buildInKeyGenerateAlgorithmType + + return p +} + +func (s *BuildInKeyGenerateAlgorithmTypeContext) GetParser() antlr.Parser { return s.parser } + +func (s *BuildInKeyGenerateAlgorithmTypeContext) SNOWFLAKE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSNOWFLAKE, 0) +} + +func (s *BuildInKeyGenerateAlgorithmTypeContext) NANOID() antlr.TerminalNode { + return s.GetToken(RDLStatementParserNANOID, 0) +} + +func (s *BuildInKeyGenerateAlgorithmTypeContext) UUID() antlr.TerminalNode { + return s.GetToken(RDLStatementParserUUID, 0) +} + +func (s *BuildInKeyGenerateAlgorithmTypeContext) COSID() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOSID, 0) +} + +func (s *BuildInKeyGenerateAlgorithmTypeContext) COSID_SNOWFLAKE() antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOSID_SNOWFLAKE, 0) +} + +func (s *BuildInKeyGenerateAlgorithmTypeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BuildInKeyGenerateAlgorithmTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *BuildInKeyGenerateAlgorithmTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitBuildInKeyGenerateAlgorithmType(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) BuildInKeyGenerateAlgorithmType() (localctx IBuildInKeyGenerateAlgorithmTypeContext) { + localctx = NewBuildInKeyGenerateAlgorithmTypeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 94, RDLStatementParserRULE_buildInKeyGenerateAlgorithmType) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(511) + _la = p.GetTokenStream().LA(1) + + if !(((((_la - 105)) & -(0x1f+1)) == 0 && ((1 << uint((_la - 105))) & ((1 << (RDLStatementParserSNOWFLAKE - 105)) | (1 << (RDLStatementParserNANOID - 105)) | (1 << (RDLStatementParserUUID - 105)) | (1 << (RDLStatementParserCOSID - 105)) | (1 << (RDLStatementParserCOSID_SNOWFLAKE - 105)))) != 0)) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + + + return localctx +} + + +// IBuildInShardingAuditAlgorithmTypeContext is an interface to support dynamic dispatch. +type IBuildInShardingAuditAlgorithmTypeContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsBuildInShardingAuditAlgorithmTypeContext differentiates from other interfaces. + IsBuildInShardingAuditAlgorithmTypeContext() +} + +type BuildInShardingAuditAlgorithmTypeContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBuildInShardingAuditAlgorithmTypeContext() *BuildInShardingAuditAlgorithmTypeContext { + var p = new(BuildInShardingAuditAlgorithmTypeContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_buildInShardingAuditAlgorithmType + return p +} + +func (*BuildInShardingAuditAlgorithmTypeContext) IsBuildInShardingAuditAlgorithmTypeContext() {} + +func NewBuildInShardingAuditAlgorithmTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BuildInShardingAuditAlgorithmTypeContext { + var p = new(BuildInShardingAuditAlgorithmTypeContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_buildInShardingAuditAlgorithmType + + return p +} + +func (s *BuildInShardingAuditAlgorithmTypeContext) GetParser() antlr.Parser { return s.parser } + +func (s *BuildInShardingAuditAlgorithmTypeContext) DML_SHARDING_CONDITIONS() antlr.TerminalNode { + return s.GetToken(RDLStatementParserDML_SHARDING_CONDITIONS, 0) +} + +func (s *BuildInShardingAuditAlgorithmTypeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BuildInShardingAuditAlgorithmTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *BuildInShardingAuditAlgorithmTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitBuildInShardingAuditAlgorithmType(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) BuildInShardingAuditAlgorithmType() (localctx IBuildInShardingAuditAlgorithmTypeContext) { + localctx = NewBuildInShardingAuditAlgorithmTypeContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 96, RDLStatementParserRULE_buildInShardingAuditAlgorithmType) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(513) + p.Match(RDLStatementParserDML_SHARDING_CONDITIONS) + } + + + + return localctx +} + + +// IPropertiesDefinitionContext is an interface to support dynamic dispatch. +type IPropertiesDefinitionContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsPropertiesDefinitionContext differentiates from other interfaces. + IsPropertiesDefinitionContext() +} + +type PropertiesDefinitionContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyPropertiesDefinitionContext() *PropertiesDefinitionContext { + var p = new(PropertiesDefinitionContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_propertiesDefinition + return p +} + +func (*PropertiesDefinitionContext) IsPropertiesDefinitionContext() {} + +func NewPropertiesDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PropertiesDefinitionContext { + var p = new(PropertiesDefinitionContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_propertiesDefinition + + return p +} + +func (s *PropertiesDefinitionContext) GetParser() antlr.Parser { return s.parser } + +func (s *PropertiesDefinitionContext) PROPERTIES() antlr.TerminalNode { + return s.GetToken(RDLStatementParserPROPERTIES, 0) +} + +func (s *PropertiesDefinitionContext) LP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserLP_, 0) +} + +func (s *PropertiesDefinitionContext) RP_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserRP_, 0) +} + +func (s *PropertiesDefinitionContext) Properties() IPropertiesContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertiesContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IPropertiesContext) +} + +func (s *PropertiesDefinitionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PropertiesDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *PropertiesDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitPropertiesDefinition(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) PropertiesDefinition() (localctx IPropertiesDefinitionContext) { + localctx = NewPropertiesDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 98, RDLStatementParserRULE_propertiesDefinition) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(515) + p.Match(RDLStatementParserPROPERTIES) + } + { + p.SetState(516) + p.Match(RDLStatementParserLP_) + } + p.SetState(518) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + if _la == RDLStatementParserSTRING_ { + { + p.SetState(517) + p.Properties() + } + + } + { + p.SetState(520) + p.Match(RDLStatementParserRP_) + } + + + + return localctx +} + + +// IPropertiesContext is an interface to support dynamic dispatch. +type IPropertiesContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsPropertiesContext differentiates from other interfaces. + IsPropertiesContext() +} + +type PropertiesContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyPropertiesContext() *PropertiesContext { + var p = new(PropertiesContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_properties + return p +} + +func (*PropertiesContext) IsPropertiesContext() {} + +func NewPropertiesContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PropertiesContext { + var p = new(PropertiesContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_properties + + return p +} + +func (s *PropertiesContext) GetParser() antlr.Parser { return s.parser } + +func (s *PropertiesContext) AllProperty() []IPropertyContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IPropertyContext)(nil)).Elem()) + var tst = make([]IPropertyContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IPropertyContext) + } + } + + return tst +} + +func (s *PropertiesContext) Property(i int) IPropertyContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertyContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IPropertyContext) +} + +func (s *PropertiesContext) AllCOMMA_() []antlr.TerminalNode { + return s.GetTokens(RDLStatementParserCOMMA_) +} + +func (s *PropertiesContext) COMMA_(i int) antlr.TerminalNode { + return s.GetToken(RDLStatementParserCOMMA_, i) +} + +func (s *PropertiesContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PropertiesContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *PropertiesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitProperties(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) Properties() (localctx IPropertiesContext) { + localctx = NewPropertiesContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 100, RDLStatementParserRULE_properties) + var _la int + + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(522) + p.Property() + } + p.SetState(527) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + + for _la == RDLStatementParserCOMMA_ { + { + p.SetState(523) + p.Match(RDLStatementParserCOMMA_) + } + { + p.SetState(524) + p.Property() + } + + + p.SetState(529) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + } + + + + return localctx +} + + +// IPropertyContext is an interface to support dynamic dispatch. +type IPropertyContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // GetKey returns the key token. + GetKey() antlr.Token + + + // SetKey sets the key token. + SetKey(antlr.Token) + + + // GetValue returns the value rule contexts. + GetValue() ILiteralContext + + + // SetValue sets the value rule contexts. + SetValue(ILiteralContext) + + + // IsPropertyContext differentiates from other interfaces. + IsPropertyContext() +} + +type PropertyContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser + key antlr.Token + value ILiteralContext +} + +func NewEmptyPropertyContext() *PropertyContext { + var p = new(PropertyContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_property + return p +} + +func (*PropertyContext) IsPropertyContext() {} + +func NewPropertyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PropertyContext { + var p = new(PropertyContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_property + + return p +} + +func (s *PropertyContext) GetParser() antlr.Parser { return s.parser } + +func (s *PropertyContext) GetKey() antlr.Token { return s.key } + + +func (s *PropertyContext) SetKey(v antlr.Token) { s.key = v } + + +func (s *PropertyContext) GetValue() ILiteralContext { return s.value } + + +func (s *PropertyContext) SetValue(v ILiteralContext) { s.value = v } + + +func (s *PropertyContext) EQ_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserEQ_, 0) +} + +func (s *PropertyContext) STRING_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserSTRING_, 0) +} + +func (s *PropertyContext) Literal() ILiteralContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*ILiteralContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(ILiteralContext) +} + +func (s *PropertyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PropertyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *PropertyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitProperty(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) Property() (localctx IPropertyContext) { + localctx = NewPropertyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 102, RDLStatementParserRULE_property) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(530) + + var _m = p.Match(RDLStatementParserSTRING_) + + localctx.(*PropertyContext).key = _m + } + { + p.SetState(531) + p.Match(RDLStatementParserEQ_) + } + { + p.SetState(532) + + var _x = p.Literal() + + + localctx.(*PropertyContext).value = _x + } + + + + return localctx +} + + +// ITableNameContext is an interface to support dynamic dispatch. +type ITableNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsTableNameContext differentiates from other interfaces. + IsTableNameContext() +} + +type TableNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTableNameContext() *TableNameContext { + var p = new(TableNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_tableName + return p +} + +func (*TableNameContext) IsTableNameContext() {} + +func NewTableNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TableNameContext { + var p = new(TableNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_tableName + + return p +} + +func (s *TableNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *TableNameContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *TableNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TableNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *TableNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitTableName(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) TableName() (localctx ITableNameContext) { + localctx = NewTableNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 104, RDLStatementParserRULE_tableName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(534) + p.Match(RDLStatementParserIDENTIFIER_) + } + + + + return localctx +} + + +// IShardingAlgorithmNameContext is an interface to support dynamic dispatch. +type IShardingAlgorithmNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsShardingAlgorithmNameContext differentiates from other interfaces. + IsShardingAlgorithmNameContext() +} + +type ShardingAlgorithmNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShardingAlgorithmNameContext() *ShardingAlgorithmNameContext { + var p = new(ShardingAlgorithmNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_shardingAlgorithmName + return p +} + +func (*ShardingAlgorithmNameContext) IsShardingAlgorithmNameContext() {} + +func NewShardingAlgorithmNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShardingAlgorithmNameContext { + var p = new(ShardingAlgorithmNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_shardingAlgorithmName + + return p +} + +func (s *ShardingAlgorithmNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShardingAlgorithmNameContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *ShardingAlgorithmNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShardingAlgorithmNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *ShardingAlgorithmNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitShardingAlgorithmName(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) ShardingAlgorithmName() (localctx IShardingAlgorithmNameContext) { + localctx = NewShardingAlgorithmNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 106, RDLStatementParserRULE_shardingAlgorithmName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(536) + p.Match(RDLStatementParserIDENTIFIER_) + } + + + + return localctx +} + + +// IRuleNameContext is an interface to support dynamic dispatch. +type IRuleNameContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsRuleNameContext differentiates from other interfaces. + IsRuleNameContext() +} + +type RuleNameContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyRuleNameContext() *RuleNameContext { + var p = new(RuleNameContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = RDLStatementParserRULE_ruleName + return p +} + +func (*RuleNameContext) IsRuleNameContext() {} + +func NewRuleNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RuleNameContext { + var p = new(RuleNameContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = RDLStatementParserRULE_ruleName + + return p +} + +func (s *RuleNameContext) GetParser() antlr.Parser { return s.parser } + +func (s *RuleNameContext) IDENTIFIER_() antlr.TerminalNode { + return s.GetToken(RDLStatementParserIDENTIFIER_, 0) +} + +func (s *RuleNameContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *RuleNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + + +func (s *RuleNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case RDLStatementVisitor: + return t.VisitRuleName(s) + + default: + return t.VisitChildren(s) + } +} + + + + +func (p *RDLStatementParser) RuleName() (localctx IRuleNameContext) { + localctx = NewRuleNameContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 108, RDLStatementParserRULE_ruleName) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(538) + p.Match(RDLStatementParserIDENTIFIER_) + } + + + + return localctx +} + + diff --git a/shardingsphere-operator/pkg/distsql/visitor_parser/sharding/rdlstatement_visitor.go b/shardingsphere-operator/pkg/distsql/visitor_parser/sharding/rdlstatement_visitor.go new file mode 100644 index 00000000..96ff1cd2 --- /dev/null +++ b/shardingsphere-operator/pkg/distsql/visitor_parser/sharding/rdlstatement_visitor.go @@ -0,0 +1,192 @@ +// Code generated from RDLStatement.g4 by ANTLR 4.8. DO NOT EDIT. + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package parser // RDLStatement + +import "github.com/antlr/antlr4/runtime/Go/antlr" + +// A complete Visitor for a parse tree produced by RDLStatementParser. +type RDLStatementVisitor interface { + antlr.ParseTreeVisitor + + // Visit a parse tree produced by RDLStatementParser#createShardingTableRule. + VisitCreateShardingTableRule(ctx *CreateShardingTableRuleContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#alterShardingTableRule. + VisitAlterShardingTableRule(ctx *AlterShardingTableRuleContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#dropShardingTableRule. + VisitDropShardingTableRule(ctx *DropShardingTableRuleContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#createShardingTableReferenceRule. + VisitCreateShardingTableReferenceRule(ctx *CreateShardingTableReferenceRuleContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#alterShardingTableReferenceRule. + VisitAlterShardingTableReferenceRule(ctx *AlterShardingTableReferenceRuleContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#dropShardingTableReferenceRule. + VisitDropShardingTableReferenceRule(ctx *DropShardingTableReferenceRuleContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#createBroadcastTableRule. + VisitCreateBroadcastTableRule(ctx *CreateBroadcastTableRuleContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#dropBroadcastTableRule. + VisitDropBroadcastTableRule(ctx *DropBroadcastTableRuleContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#dropShardingAlgorithm. + VisitDropShardingAlgorithm(ctx *DropShardingAlgorithmContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#createDefaultShardingStrategy. + VisitCreateDefaultShardingStrategy(ctx *CreateDefaultShardingStrategyContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#alterDefaultShardingStrategy. + VisitAlterDefaultShardingStrategy(ctx *AlterDefaultShardingStrategyContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#dropDefaultShardingStrategy. + VisitDropDefaultShardingStrategy(ctx *DropDefaultShardingStrategyContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#dropShardingKeyGenerator. + VisitDropShardingKeyGenerator(ctx *DropShardingKeyGeneratorContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#dropShardingAuditor. + VisitDropShardingAuditor(ctx *DropShardingAuditorContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#shardingTableRuleDefinition. + VisitShardingTableRuleDefinition(ctx *ShardingTableRuleDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#shardingAutoTableRule. + VisitShardingAutoTableRule(ctx *ShardingAutoTableRuleContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#shardingTableRule. + VisitShardingTableRule(ctx *ShardingTableRuleContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#keyGeneratorName. + VisitKeyGeneratorName(ctx *KeyGeneratorNameContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#auditorDefinition. + VisitAuditorDefinition(ctx *AuditorDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#auditorName. + VisitAuditorName(ctx *AuditorNameContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#storageUnits. + VisitStorageUnits(ctx *StorageUnitsContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#storageUnit. + VisitStorageUnit(ctx *StorageUnitContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#dataNodes. + VisitDataNodes(ctx *DataNodesContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#dataNode. + VisitDataNode(ctx *DataNodeContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#autoShardingColumnDefinition. + VisitAutoShardingColumnDefinition(ctx *AutoShardingColumnDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#shardingColumnDefinition. + VisitShardingColumnDefinition(ctx *ShardingColumnDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#shardingColumn. + VisitShardingColumn(ctx *ShardingColumnContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#shardingColumns. + VisitShardingColumns(ctx *ShardingColumnsContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#shardingAlgorithm. + VisitShardingAlgorithm(ctx *ShardingAlgorithmContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#shardingStrategy. + VisitShardingStrategy(ctx *ShardingStrategyContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#databaseStrategy. + VisitDatabaseStrategy(ctx *DatabaseStrategyContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#tableStrategy. + VisitTableStrategy(ctx *TableStrategyContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#keyGenerateDefinition. + VisitKeyGenerateDefinition(ctx *KeyGenerateDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#auditDefinition. + VisitAuditDefinition(ctx *AuditDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#multiAuditDefinition. + VisitMultiAuditDefinition(ctx *MultiAuditDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#singleAuditDefinition. + VisitSingleAuditDefinition(ctx *SingleAuditDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#auditAllowHintDisable. + VisitAuditAllowHintDisable(ctx *AuditAllowHintDisableContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#columnName. + VisitColumnName(ctx *ColumnNameContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#tableReferenceRuleDefinition. + VisitTableReferenceRuleDefinition(ctx *TableReferenceRuleDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#strategyType. + VisitStrategyType(ctx *StrategyTypeContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#buildInStrategyType. + VisitBuildInStrategyType(ctx *BuildInStrategyTypeContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#ifExists. + VisitIfExists(ctx *IfExistsContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#ifNotExists. + VisitIfNotExists(ctx *IfNotExistsContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#literal. + VisitLiteral(ctx *LiteralContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#algorithmDefinition. + VisitAlgorithmDefinition(ctx *AlgorithmDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#algorithmTypeName. + VisitAlgorithmTypeName(ctx *AlgorithmTypeNameContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#buildInShardingAlgorithmType. + VisitBuildInShardingAlgorithmType(ctx *BuildInShardingAlgorithmTypeContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#buildInKeyGenerateAlgorithmType. + VisitBuildInKeyGenerateAlgorithmType(ctx *BuildInKeyGenerateAlgorithmTypeContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#buildInShardingAuditAlgorithmType. + VisitBuildInShardingAuditAlgorithmType(ctx *BuildInShardingAuditAlgorithmTypeContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#propertiesDefinition. + VisitPropertiesDefinition(ctx *PropertiesDefinitionContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#properties. + VisitProperties(ctx *PropertiesContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#property. + VisitProperty(ctx *PropertyContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#tableName. + VisitTableName(ctx *TableNameContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#shardingAlgorithmName. + VisitShardingAlgorithmName(ctx *ShardingAlgorithmNameContext) interface{} + + // Visit a parse tree produced by RDLStatementParser#ruleName. + VisitRuleName(ctx *RuleNameContext) interface{} +}