MySqlParser.java
// $ANTLR 3.5.2 org/argouml/language/sql/reveng/MySql.g 2024-12-21 19:52:03
package org.argouml.language.sql.reveng;
import org.argouml.language.sql.TableDefinition;
import org.argouml.language.sql.ColumnDefinition;
import org.argouml.language.sql.ForeignKeyDefinition;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings("all")
public class MySqlParser extends Parser {
public static final String[] tokenNames = new String[] {
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "COMMA", "DIGIT", "DOT", "ID",
"LEFT_PAREN", "LETTER", "ML_COMMENT", "NUMBER", "PROTECT_CHAR", "QUOTED_TEXT",
"RIGHT_PAREN", "SEMICOLON", "SL_COMMENT", "VAR_MYSQL", "WS", "'='", "'AUTO_INCREMENT'",
"'BTREE'", "'CASCADE'", "'CHARSET'", "'COMMENT'", "'CONSTRAINT'", "'CREATE'",
"'CURRENT_TIMESTAMP'", "'DEFAULT'", "'DELETE'", "'DROP'", "'ENGINE'",
"'EXISTS'", "'FOREIGN'", "'FULL'", "'HASH'", "'IF'", "'INDEX'", "'KEY'",
"'MATCH'", "'NO ACTION'", "'NOT'", "'NULL'", "'ON'", "'PARTIAL'", "'PRIMARY'",
"'REFERENCES'", "'RESTRICT'", "'SET DEFAULT'", "'SET'", "'TABLE'", "'UNIQUE'",
"'UNSIGNED'", "'UPDATE'", "'ZEROFILL'"
};
public static final int EOF=-1;
public static final int T__19=19;
public static final int T__20=20;
public static final int T__21=21;
public static final int T__22=22;
public static final int T__23=23;
public static final int T__24=24;
public static final int T__25=25;
public static final int T__26=26;
public static final int T__27=27;
public static final int T__28=28;
public static final int T__29=29;
public static final int T__30=30;
public static final int T__31=31;
public static final int T__32=32;
public static final int T__33=33;
public static final int T__34=34;
public static final int T__35=35;
public static final int T__36=36;
public static final int T__37=37;
public static final int T__38=38;
public static final int T__39=39;
public static final int T__40=40;
public static final int T__41=41;
public static final int T__42=42;
public static final int T__43=43;
public static final int T__44=44;
public static final int T__45=45;
public static final int T__46=46;
public static final int T__47=47;
public static final int T__48=48;
public static final int T__49=49;
public static final int T__50=50;
public static final int T__51=51;
public static final int T__52=52;
public static final int T__53=53;
public static final int T__54=54;
public static final int COMMA=4;
public static final int DIGIT=5;
public static final int DOT=6;
public static final int ID=7;
public static final int LEFT_PAREN=8;
public static final int LETTER=9;
public static final int ML_COMMENT=10;
public static final int NUMBER=11;
public static final int PROTECT_CHAR=12;
public static final int QUOTED_TEXT=13;
public static final int RIGHT_PAREN=14;
public static final int SEMICOLON=15;
public static final int SL_COMMENT=16;
public static final int VAR_MYSQL=17;
public static final int WS=18;
// delegates
public Parser[] getDelegates() {
return new Parser[] {};
}
// delegators
public MySqlParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public MySqlParser(TokenStream input, RecognizerSharedState state) {
super(input, state);
}
@Override public String[] getTokenNames() { return MySqlParser.tokenNames; }
@Override public String getGrammarFileName() { return "org/argouml/language/sql/reveng/MySql.g"; }
private Lexer _lexer = null;
private Modeller _modeller;
boolean readSpace = false;
public Modeller getModeller() {
return _modeller;
}
public void setModeller(Modeller modeller) {
_modeller = modeller;
}
// $ANTLR start "dump_read"
// org/argouml/language/sql/reveng/MySql.g:55:1: dump_read[Modeller modeller, Lexer lexer] : ( dumpComment | drop_table_statement | create_table_statement | set_statement )* ;
public final void dump_read(Modeller modeller, Lexer lexer) throws RecognitionException {
setModeller(modeller);
_lexer = lexer;
try {
// org/argouml/language/sql/reveng/MySql.g:61:2: ( ( dumpComment | drop_table_statement | create_table_statement | set_statement )* )
// org/argouml/language/sql/reveng/MySql.g:62:2: ( dumpComment | drop_table_statement | create_table_statement | set_statement )*
{
// org/argouml/language/sql/reveng/MySql.g:62:2: ( dumpComment | drop_table_statement | create_table_statement | set_statement )*
loop1:
while (true) {
int alt1=5;
switch ( input.LA(1) ) {
case ML_COMMENT:
case SL_COMMENT:
{
alt1=1;
}
break;
case 30:
{
alt1=2;
}
break;
case 26:
{
alt1=3;
}
break;
case 49:
{
alt1=4;
}
break;
}
switch (alt1) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:62:5: dumpComment
{
pushFollow(FOLLOW_dumpComment_in_dump_read57);
dumpComment();
state._fsp--;
}
break;
case 2 :
// org/argouml/language/sql/reveng/MySql.g:63:4: drop_table_statement
{
pushFollow(FOLLOW_drop_table_statement_in_dump_read62);
drop_table_statement();
state._fsp--;
}
break;
case 3 :
// org/argouml/language/sql/reveng/MySql.g:64:4: create_table_statement
{
pushFollow(FOLLOW_create_table_statement_in_dump_read67);
create_table_statement();
state._fsp--;
}
break;
case 4 :
// org/argouml/language/sql/reveng/MySql.g:65:4: set_statement
{
pushFollow(FOLLOW_set_statement_in_dump_read72);
set_statement();
state._fsp--;
}
break;
default :
break loop1;
}
}
getModeller().generateModele();
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "dump_read"
// $ANTLR start "dumpComment"
// org/argouml/language/sql/reveng/MySql.g:73:1: dumpComment : ( SL_COMMENT | ML_COMMENT ( ';' )? );
public final void dumpComment() throws RecognitionException {
try {
// org/argouml/language/sql/reveng/MySql.g:73:12: ( SL_COMMENT | ML_COMMENT ( ';' )? )
int alt3=2;
int LA3_0 = input.LA(1);
if ( (LA3_0==SL_COMMENT) ) {
alt3=1;
}
else if ( (LA3_0==ML_COMMENT) ) {
alt3=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 3, 0, input);
throw nvae;
}
switch (alt3) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:74:2: SL_COMMENT
{
match(input,SL_COMMENT,FOLLOW_SL_COMMENT_in_dumpComment99);
}
break;
case 2 :
// org/argouml/language/sql/reveng/MySql.g:75:4: ML_COMMENT ( ';' )?
{
match(input,ML_COMMENT,FOLLOW_ML_COMMENT_in_dumpComment104);
// org/argouml/language/sql/reveng/MySql.g:75:15: ( ';' )?
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0==SEMICOLON) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:75:16: ';'
{
match(input,SEMICOLON,FOLLOW_SEMICOLON_in_dumpComment107);
}
break;
}
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "dumpComment"
// $ANTLR start "set_statement"
// org/argouml/language/sql/reveng/MySql.g:78:1: set_statement : 'SET' ( VAR_MYSQL | ID ) '=' ( VAR_MYSQL | ID ) ;
public final void set_statement() throws RecognitionException {
try {
// org/argouml/language/sql/reveng/MySql.g:78:14: ( 'SET' ( VAR_MYSQL | ID ) '=' ( VAR_MYSQL | ID ) )
// org/argouml/language/sql/reveng/MySql.g:79:2: 'SET' ( VAR_MYSQL | ID ) '=' ( VAR_MYSQL | ID )
{
match(input,49,FOLLOW_49_in_set_statement118);
if ( input.LA(1)==ID||input.LA(1)==VAR_MYSQL ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
match(input,19,FOLLOW_19_in_set_statement128);
if ( input.LA(1)==ID||input.LA(1)==VAR_MYSQL ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "set_statement"
// $ANTLR start "drop_table_statement"
// org/argouml/language/sql/reveng/MySql.g:82:1: drop_table_statement : 'DROP' 'TABLE' 'IF' 'EXISTS' ( PROTECT_CHAR )? table_name ( PROTECT_CHAR )? SEMICOLON ;
public final void drop_table_statement() throws RecognitionException {
try {
// org/argouml/language/sql/reveng/MySql.g:82:22: ( 'DROP' 'TABLE' 'IF' 'EXISTS' ( PROTECT_CHAR )? table_name ( PROTECT_CHAR )? SEMICOLON )
// org/argouml/language/sql/reveng/MySql.g:83:2: 'DROP' 'TABLE' 'IF' 'EXISTS' ( PROTECT_CHAR )? table_name ( PROTECT_CHAR )? SEMICOLON
{
match(input,30,FOLLOW_30_in_drop_table_statement146);
match(input,50,FOLLOW_50_in_drop_table_statement148);
match(input,36,FOLLOW_36_in_drop_table_statement150);
match(input,32,FOLLOW_32_in_drop_table_statement152);
// org/argouml/language/sql/reveng/MySql.g:83:31: ( PROTECT_CHAR )?
int alt4=2;
int LA4_0 = input.LA(1);
if ( (LA4_0==PROTECT_CHAR) ) {
alt4=1;
}
switch (alt4) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:83:32: PROTECT_CHAR
{
match(input,PROTECT_CHAR,FOLLOW_PROTECT_CHAR_in_drop_table_statement155);
}
break;
}
pushFollow(FOLLOW_table_name_in_drop_table_statement159);
table_name();
state._fsp--;
// org/argouml/language/sql/reveng/MySql.g:83:58: ( PROTECT_CHAR )?
int alt5=2;
int LA5_0 = input.LA(1);
if ( (LA5_0==PROTECT_CHAR) ) {
alt5=1;
}
switch (alt5) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:83:59: PROTECT_CHAR
{
match(input,PROTECT_CHAR,FOLLOW_PROTECT_CHAR_in_drop_table_statement162);
}
break;
}
match(input,SEMICOLON,FOLLOW_SEMICOLON_in_drop_table_statement166);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "drop_table_statement"
// $ANTLR start "create_table_statement"
// org/argouml/language/sql/reveng/MySql.g:85:1: create_table_statement : 'CREATE' 'TABLE' ( PROTECT_CHAR )? table_name ( PROTECT_CHAR )? create_definition_list[table] table_options[table] SEMICOLON ;
public final void create_table_statement() throws RecognitionException {
ParserRuleReturnScope table_name1 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:85:24: ( 'CREATE' 'TABLE' ( PROTECT_CHAR )? table_name ( PROTECT_CHAR )? create_definition_list[table] table_options[table] SEMICOLON )
// org/argouml/language/sql/reveng/MySql.g:86:2: 'CREATE' 'TABLE' ( PROTECT_CHAR )? table_name ( PROTECT_CHAR )? create_definition_list[table] table_options[table] SEMICOLON
{
match(input,26,FOLLOW_26_in_create_table_statement178);
match(input,50,FOLLOW_50_in_create_table_statement180);
// org/argouml/language/sql/reveng/MySql.g:87:8: ( PROTECT_CHAR )?
int alt6=2;
int LA6_0 = input.LA(1);
if ( (LA6_0==PROTECT_CHAR) ) {
alt6=1;
}
switch (alt6) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:87:9: PROTECT_CHAR
{
match(input,PROTECT_CHAR,FOLLOW_PROTECT_CHAR_in_create_table_statement190);
}
break;
}
pushFollow(FOLLOW_table_name_in_create_table_statement194);
table_name1=table_name();
state._fsp--;
// org/argouml/language/sql/reveng/MySql.g:87:35: ( PROTECT_CHAR )?
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0==PROTECT_CHAR) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:87:36: PROTECT_CHAR
{
match(input,PROTECT_CHAR,FOLLOW_PROTECT_CHAR_in_create_table_statement197);
}
break;
}
TableDefinition table = getModeller().getTableFromName((table_name1!=null?input.toString(table_name1.start,table_name1.stop):null));
pushFollow(FOLLOW_create_definition_list_in_create_table_statement223);
create_definition_list(table);
state._fsp--;
pushFollow(FOLLOW_table_options_in_create_table_statement239);
table_options(table);
state._fsp--;
match(input,SEMICOLON,FOLLOW_SEMICOLON_in_create_table_statement283);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "create_table_statement"
public static class table_name_return extends ParserRuleReturnScope {
};
// $ANTLR start "table_name"
// org/argouml/language/sql/reveng/MySql.g:98:1: table_name : ( schema DOT )? table ;
public final MySqlParser.table_name_return table_name() throws RecognitionException {
MySqlParser.table_name_return retval = new MySqlParser.table_name_return();
retval.start = input.LT(1);
try {
// org/argouml/language/sql/reveng/MySql.g:99:6: ( ( schema DOT )? table )
// org/argouml/language/sql/reveng/MySql.g:99:10: ( schema DOT )? table
{
// org/argouml/language/sql/reveng/MySql.g:99:10: ( schema DOT )?
int alt8=2;
int LA8_0 = input.LA(1);
if ( (LA8_0==ID) ) {
int LA8_1 = input.LA(2);
if ( (LA8_1==DOT) ) {
alt8=1;
}
}
switch (alt8) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:99:11: schema DOT
{
pushFollow(FOLLOW_schema_in_table_name300);
schema();
state._fsp--;
match(input,DOT,FOLLOW_DOT_in_table_name302);
}
break;
}
pushFollow(FOLLOW_table_in_table_name306);
table();
state._fsp--;
}
retval.stop = input.LT(-1);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "table_name"
// $ANTLR start "create_definition_list"
// org/argouml/language/sql/reveng/MySql.g:102:1: create_definition_list[TableDefinition table] : LEFT_PAREN create_definition[table] ( COMMA create_definition[table] )* RIGHT_PAREN ;
public final void create_definition_list(TableDefinition table) throws RecognitionException {
try {
// org/argouml/language/sql/reveng/MySql.g:103:5: ( LEFT_PAREN create_definition[table] ( COMMA create_definition[table] )* RIGHT_PAREN )
// org/argouml/language/sql/reveng/MySql.g:103:7: LEFT_PAREN create_definition[table] ( COMMA create_definition[table] )* RIGHT_PAREN
{
match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_create_definition_list326);
pushFollow(FOLLOW_create_definition_in_create_definition_list328);
create_definition(table);
state._fsp--;
// org/argouml/language/sql/reveng/MySql.g:103:43: ( COMMA create_definition[table] )*
loop9:
while (true) {
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0==COMMA) ) {
alt9=1;
}
switch (alt9) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:103:44: COMMA create_definition[table]
{
match(input,COMMA,FOLLOW_COMMA_in_create_definition_list332);
pushFollow(FOLLOW_create_definition_in_create_definition_list334);
create_definition(table);
state._fsp--;
}
break;
default :
break loop9;
}
}
match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_create_definition_list341);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "create_definition_list"
// $ANTLR start "table_options"
// org/argouml/language/sql/reveng/MySql.g:106:1: table_options[TableDefinition table] : ( 'ENGINE' '=' ID )? ( 'AUTO_INCREMENT' '=' NUMBER )? ( 'DEFAULT' 'CHARSET' '=' ID )? ( 'COMMENT' '=' text_quoted )? ;
public final void table_options(TableDefinition table) throws RecognitionException {
String text_quoted2 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:106:38: ( ( 'ENGINE' '=' ID )? ( 'AUTO_INCREMENT' '=' NUMBER )? ( 'DEFAULT' 'CHARSET' '=' ID )? ( 'COMMENT' '=' text_quoted )? )
// org/argouml/language/sql/reveng/MySql.g:107:5: ( 'ENGINE' '=' ID )? ( 'AUTO_INCREMENT' '=' NUMBER )? ( 'DEFAULT' 'CHARSET' '=' ID )? ( 'COMMENT' '=' text_quoted )?
{
// org/argouml/language/sql/reveng/MySql.g:107:5: ( 'ENGINE' '=' ID )?
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0==31) ) {
alt10=1;
}
switch (alt10) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:107:6: 'ENGINE' '=' ID
{
match(input,31,FOLLOW_31_in_table_options357);
match(input,19,FOLLOW_19_in_table_options359);
match(input,ID,FOLLOW_ID_in_table_options361);
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:108:5: ( 'AUTO_INCREMENT' '=' NUMBER )?
int alt11=2;
int LA11_0 = input.LA(1);
if ( (LA11_0==20) ) {
alt11=1;
}
switch (alt11) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:108:6: 'AUTO_INCREMENT' '=' NUMBER
{
match(input,20,FOLLOW_20_in_table_options370);
match(input,19,FOLLOW_19_in_table_options372);
match(input,NUMBER,FOLLOW_NUMBER_in_table_options374);
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:109:5: ( 'DEFAULT' 'CHARSET' '=' ID )?
int alt12=2;
int LA12_0 = input.LA(1);
if ( (LA12_0==28) ) {
alt12=1;
}
switch (alt12) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:109:6: 'DEFAULT' 'CHARSET' '=' ID
{
match(input,28,FOLLOW_28_in_table_options383);
match(input,23,FOLLOW_23_in_table_options385);
match(input,19,FOLLOW_19_in_table_options387);
match(input,ID,FOLLOW_ID_in_table_options389);
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:110:5: ( 'COMMENT' '=' text_quoted )?
int alt13=2;
int LA13_0 = input.LA(1);
if ( (LA13_0==24) ) {
alt13=1;
}
switch (alt13) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:110:6: 'COMMENT' '=' text_quoted
{
match(input,24,FOLLOW_24_in_table_options398);
match(input,19,FOLLOW_19_in_table_options400);
pushFollow(FOLLOW_text_quoted_in_table_options402);
text_quoted2=text_quoted();
state._fsp--;
table.setComment(text_quoted2);
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "table_options"
// $ANTLR start "create_definition"
// org/argouml/language/sql/reveng/MySql.g:113:1: create_definition[TableDefinition table] : ( ( 'KEY' | 'INDEX' ) index_name ( index_type )? columns_list_name | constraint_def[table] | column_name data_type_def[col] );
public final void create_definition(TableDefinition table) throws RecognitionException {
String column_name3 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:113:42: ( ( 'KEY' | 'INDEX' ) index_name ( index_type )? columns_list_name | constraint_def[table] | column_name data_type_def[col] )
int alt15=3;
switch ( input.LA(1) ) {
case 37:
case 38:
{
alt15=1;
}
break;
case 25:
case 33:
case 45:
case 51:
{
alt15=2;
}
break;
case ID:
case PROTECT_CHAR:
{
alt15=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 15, 0, input);
throw nvae;
}
switch (alt15) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:114:9: ( 'KEY' | 'INDEX' ) index_name ( index_type )? columns_list_name
{
if ( (input.LA(1) >= 37 && input.LA(1) <= 38) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
pushFollow(FOLLOW_index_name_in_create_definition431);
index_name();
state._fsp--;
// org/argouml/language/sql/reveng/MySql.g:114:36: ( index_type )?
int alt14=2;
int LA14_0 = input.LA(1);
if ( (LA14_0==21||LA14_0==35) ) {
alt14=1;
}
switch (alt14) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:114:37: index_type
{
pushFollow(FOLLOW_index_type_in_create_definition434);
index_type();
state._fsp--;
}
break;
}
pushFollow(FOLLOW_columns_list_name_in_create_definition438);
columns_list_name();
state._fsp--;
}
break;
case 2 :
// org/argouml/language/sql/reveng/MySql.g:115:11: constraint_def[table]
{
pushFollow(FOLLOW_constraint_def_in_create_definition450);
constraint_def(table);
state._fsp--;
}
break;
case 3 :
// org/argouml/language/sql/reveng/MySql.g:117:10: column_name data_type_def[col]
{
pushFollow(FOLLOW_column_name_in_create_definition472);
column_name3=column_name();
state._fsp--;
ColumnDefinition col = ColumnDefinition.findOrCreateColumnDefinition(table, column_name3);
pushFollow(FOLLOW_data_type_def_in_create_definition476);
data_type_def(col);
state._fsp--;
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "create_definition"
// $ANTLR start "text_quoted"
// org/argouml/language/sql/reveng/MySql.g:122:1: text_quoted returns [String value] : QUOTED_TEXT ;
public final String text_quoted() throws RecognitionException {
String value = null;
Token QUOTED_TEXT4=null;
try {
// org/argouml/language/sql/reveng/MySql.g:122:36: ( QUOTED_TEXT )
// org/argouml/language/sql/reveng/MySql.g:123:2: QUOTED_TEXT
{
int iStartToken = input.LT(1).getTokenIndex();
QUOTED_TEXT4=(Token)match(input,QUOTED_TEXT,FOLLOW_QUOTED_TEXT_in_text_quoted494);
value = (QUOTED_TEXT4!=null?QUOTED_TEXT4.getText():null);
value = value.substring(1);
value = value.substring(0, value.length() -1 );
value = value.replaceAll("''","'");
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return value;
}
// $ANTLR end "text_quoted"
// $ANTLR start "text_quoted_keep"
// org/argouml/language/sql/reveng/MySql.g:135:1: text_quoted_keep returns [String value] : QUOTED_TEXT ;
public final String text_quoted_keep() throws RecognitionException {
String value = null;
Token QUOTED_TEXT5=null;
try {
// org/argouml/language/sql/reveng/MySql.g:135:41: ( QUOTED_TEXT )
// org/argouml/language/sql/reveng/MySql.g:136:2: QUOTED_TEXT
{
int iStartToken = input.LT(1).getTokenIndex();
QUOTED_TEXT5=(Token)match(input,QUOTED_TEXT,FOLLOW_QUOTED_TEXT_in_text_quoted_keep514);
value = (QUOTED_TEXT5!=null?QUOTED_TEXT5.getText():null);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return value;
}
// $ANTLR end "text_quoted_keep"
// $ANTLR start "constraint_def"
// org/argouml/language/sql/reveng/MySql.g:145:1: constraint_def[TableDefinition table] returns [String constrName] : ( 'CONSTRAINT' symbol )? ( constraint_unique | constraint_fk[table, constrName] | constraint_pk[table, constrName] ) ;
public final String constraint_def(TableDefinition table) throws RecognitionException {
String constrName = null;
String symbol6 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:145:68: ( ( 'CONSTRAINT' symbol )? ( constraint_unique | constraint_fk[table, constrName] | constraint_pk[table, constrName] ) )
// org/argouml/language/sql/reveng/MySql.g:146:3: ( 'CONSTRAINT' symbol )? ( constraint_unique | constraint_fk[table, constrName] | constraint_pk[table, constrName] )
{
// org/argouml/language/sql/reveng/MySql.g:146:3: ( 'CONSTRAINT' symbol )?
int alt16=2;
int LA16_0 = input.LA(1);
if ( (LA16_0==25) ) {
alt16=1;
}
switch (alt16) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:146:4: 'CONSTRAINT' symbol
{
match(input,25,FOLLOW_25_in_constraint_def536);
pushFollow(FOLLOW_symbol_in_constraint_def538);
symbol6=symbol();
state._fsp--;
constrName = symbol6;
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:152:3: ( constraint_unique | constraint_fk[table, constrName] | constraint_pk[table, constrName] )
int alt17=3;
switch ( input.LA(1) ) {
case 51:
{
alt17=1;
}
break;
case 33:
{
alt17=2;
}
break;
case 45:
{
alt17=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 17, 0, input);
throw nvae;
}
switch (alt17) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:153:3: constraint_unique
{
pushFollow(FOLLOW_constraint_unique_in_constraint_def561);
constraint_unique();
state._fsp--;
}
break;
case 2 :
// org/argouml/language/sql/reveng/MySql.g:154:5: constraint_fk[table, constrName]
{
pushFollow(FOLLOW_constraint_fk_in_constraint_def568);
constraint_fk(table, constrName);
state._fsp--;
}
break;
case 3 :
// org/argouml/language/sql/reveng/MySql.g:155:5: constraint_pk[table, constrName]
{
pushFollow(FOLLOW_constraint_pk_in_constraint_def575);
constraint_pk(table, constrName);
state._fsp--;
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return constrName;
}
// $ANTLR end "constraint_def"
// $ANTLR start "constraint_unique"
// org/argouml/language/sql/reveng/MySql.g:159:1: constraint_unique : 'UNIQUE' ( 'INDEX' | 'KEY' )? ( index_name )? ( index_type )? columns_list_name ;
public final void constraint_unique() throws RecognitionException {
try {
// org/argouml/language/sql/reveng/MySql.g:159:19: ( 'UNIQUE' ( 'INDEX' | 'KEY' )? ( index_name )? ( index_type )? columns_list_name )
// org/argouml/language/sql/reveng/MySql.g:160:2: 'UNIQUE' ( 'INDEX' | 'KEY' )? ( index_name )? ( index_type )? columns_list_name
{
match(input,51,FOLLOW_51_in_constraint_unique592);
// org/argouml/language/sql/reveng/MySql.g:160:11: ( 'INDEX' | 'KEY' )?
int alt18=2;
int LA18_0 = input.LA(1);
if ( ((LA18_0 >= 37 && LA18_0 <= 38)) ) {
alt18=1;
}
switch (alt18) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:
{
if ( (input.LA(1) >= 37 && input.LA(1) <= 38) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:160:30: ( index_name )?
int alt19=2;
int LA19_0 = input.LA(1);
if ( (LA19_0==LEFT_PAREN) ) {
int LA19_1 = input.LA(2);
if ( (LA19_1==PROTECT_CHAR) ) {
int LA19_4 = input.LA(3);
if ( (LA19_4==ID) ) {
switch ( input.LA(4) ) {
case PROTECT_CHAR:
{
int LA19_6 = input.LA(5);
if ( (LA19_6==RIGHT_PAREN) ) {
int LA19_7 = input.LA(6);
if ( (LA19_7==LEFT_PAREN||LA19_7==21||LA19_7==35) ) {
alt19=1;
}
}
else if ( (LA19_6==LEFT_PAREN||LA19_6==21||LA19_6==35) ) {
alt19=1;
}
}
break;
case RIGHT_PAREN:
{
int LA19_7 = input.LA(5);
if ( (LA19_7==LEFT_PAREN||LA19_7==21||LA19_7==35) ) {
alt19=1;
}
}
break;
case LEFT_PAREN:
case 21:
case 35:
{
alt19=1;
}
break;
}
}
}
else if ( (LA19_1==ID) ) {
switch ( input.LA(3) ) {
case PROTECT_CHAR:
{
int LA19_6 = input.LA(4);
if ( (LA19_6==RIGHT_PAREN) ) {
int LA19_7 = input.LA(5);
if ( (LA19_7==LEFT_PAREN||LA19_7==21||LA19_7==35) ) {
alt19=1;
}
}
else if ( (LA19_6==LEFT_PAREN||LA19_6==21||LA19_6==35) ) {
alt19=1;
}
}
break;
case RIGHT_PAREN:
{
int LA19_7 = input.LA(4);
if ( (LA19_7==LEFT_PAREN||LA19_7==21||LA19_7==35) ) {
alt19=1;
}
}
break;
case LEFT_PAREN:
case 21:
case 35:
{
alt19=1;
}
break;
}
}
}
else if ( (LA19_0==ID||LA19_0==PROTECT_CHAR) ) {
alt19=1;
}
switch (alt19) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:160:31: index_name
{
pushFollow(FOLLOW_index_name_in_constraint_unique604);
index_name();
state._fsp--;
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:160:44: ( index_type )?
int alt20=2;
int LA20_0 = input.LA(1);
if ( (LA20_0==21||LA20_0==35) ) {
alt20=1;
}
switch (alt20) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:160:45: index_type
{
pushFollow(FOLLOW_index_type_in_constraint_unique609);
index_type();
state._fsp--;
}
break;
}
pushFollow(FOLLOW_columns_list_name_in_constraint_unique614);
columns_list_name();
state._fsp--;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "constraint_unique"
// $ANTLR start "constraint_fk"
// org/argouml/language/sql/reveng/MySql.g:162:1: constraint_fk[TableDefinition table, String constrName] : 'FOREIGN' 'KEY' ( symbol )? columns_list_name reference_definition[fk] ;
public final void constraint_fk(TableDefinition table, String constrName) throws RecognitionException {
List<String> columns_list_name7 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:162:58: ( 'FOREIGN' 'KEY' ( symbol )? columns_list_name reference_definition[fk] )
// org/argouml/language/sql/reveng/MySql.g:163:2: 'FOREIGN' 'KEY' ( symbol )? columns_list_name reference_definition[fk]
{
match(input,33,FOLLOW_33_in_constraint_fk625);
match(input,38,FOLLOW_38_in_constraint_fk627);
// org/argouml/language/sql/reveng/MySql.g:163:18: ( symbol )?
int alt21=2;
int LA21_0 = input.LA(1);
if ( (LA21_0==ID||LA21_0==PROTECT_CHAR) ) {
alt21=1;
}
switch (alt21) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:163:19: symbol
{
pushFollow(FOLLOW_symbol_in_constraint_fk630);
symbol();
state._fsp--;
}
break;
}
ForeignKeyDefinition fk = new ForeignKeyDefinition(table);
fk.setForeignKeyName(constrName);
pushFollow(FOLLOW_columns_list_name_in_constraint_fk638);
columns_list_name7=columns_list_name();
state._fsp--;
for(String colName : columns_list_name7) {
fk.addColumnDefinition(colName);
}
pushFollow(FOLLOW_reference_definition_in_constraint_fk644);
reference_definition(fk);
state._fsp--;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "constraint_fk"
// $ANTLR start "constraint_pk"
// org/argouml/language/sql/reveng/MySql.g:177:1: constraint_pk[TableDefinition table, String constrName] : 'PRIMARY' 'KEY' ( index_type )? columns_list_name ;
public final void constraint_pk(TableDefinition table, String constrName) throws RecognitionException {
List<String> columns_list_name8 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:177:58: ( 'PRIMARY' 'KEY' ( index_type )? columns_list_name )
// org/argouml/language/sql/reveng/MySql.g:178:2: 'PRIMARY' 'KEY' ( index_type )? columns_list_name
{
match(input,45,FOLLOW_45_in_constraint_pk657);
match(input,38,FOLLOW_38_in_constraint_pk659);
// org/argouml/language/sql/reveng/MySql.g:178:18: ( index_type )?
int alt22=2;
int LA22_0 = input.LA(1);
if ( (LA22_0==21||LA22_0==35) ) {
alt22=1;
}
switch (alt22) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:178:19: index_type
{
pushFollow(FOLLOW_index_type_in_constraint_pk662);
index_type();
state._fsp--;
}
break;
}
pushFollow(FOLLOW_columns_list_name_in_constraint_pk666);
columns_list_name8=columns_list_name();
state._fsp--;
for(String colName : columns_list_name8) {
table.addPrimaryKeyField(colName);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "constraint_pk"
// $ANTLR start "reference_definition"
// org/argouml/language/sql/reveng/MySql.g:186:1: reference_definition[ForeignKeyDefinition fk] : 'REFERENCES' tbl_name columns_list_name ( 'MATCH' ( 'FULL' | 'PARTIAL' ) )? ( 'ON' ( 'DELETE' | 'UPDATE' ) reference_option )* ;
public final void reference_definition(ForeignKeyDefinition fk) throws RecognitionException {
String tbl_name9 =null;
List<String> columns_list_name10 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:186:48: ( 'REFERENCES' tbl_name columns_list_name ( 'MATCH' ( 'FULL' | 'PARTIAL' ) )? ( 'ON' ( 'DELETE' | 'UPDATE' ) reference_option )* )
// org/argouml/language/sql/reveng/MySql.g:187:2: 'REFERENCES' tbl_name columns_list_name ( 'MATCH' ( 'FULL' | 'PARTIAL' ) )? ( 'ON' ( 'DELETE' | 'UPDATE' ) reference_option )*
{
match(input,46,FOLLOW_46_in_reference_definition681);
pushFollow(FOLLOW_tbl_name_in_reference_definition683);
tbl_name9=tbl_name();
state._fsp--;
TableDefinition tableRef = getModeller().getTableFromName(tbl_name9);
fk.setReferencesTable(tableRef);
pushFollow(FOLLOW_columns_list_name_in_reference_definition690);
columns_list_name10=columns_list_name();
state._fsp--;
for(String colName : columns_list_name10) {
fk.addReferencesColumn(colName);
}
// org/argouml/language/sql/reveng/MySql.g:200:2: ( 'MATCH' ( 'FULL' | 'PARTIAL' ) )?
int alt23=2;
int LA23_0 = input.LA(1);
if ( (LA23_0==39) ) {
alt23=1;
}
switch (alt23) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:200:3: 'MATCH' ( 'FULL' | 'PARTIAL' )
{
match(input,39,FOLLOW_39_in_reference_definition699);
if ( input.LA(1)==34||input.LA(1)==44 ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:201:2: ( 'ON' ( 'DELETE' | 'UPDATE' ) reference_option )*
loop24:
while (true) {
int alt24=2;
int LA24_0 = input.LA(1);
if ( (LA24_0==43) ) {
alt24=1;
}
switch (alt24) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:201:3: 'ON' ( 'DELETE' | 'UPDATE' ) reference_option
{
match(input,43,FOLLOW_43_in_reference_definition714);
if ( input.LA(1)==29||input.LA(1)==53 ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
pushFollow(FOLLOW_reference_option_in_reference_definition724);
reference_option();
state._fsp--;
}
break;
default :
break loop24;
}
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "reference_definition"
// $ANTLR start "reference_option"
// org/argouml/language/sql/reveng/MySql.g:205:1: reference_option : ( 'RESTRICT' | 'CASCADE' | 'SET' 'NULL' | 'NO ACTION' | 'SET DEFAULT' );
public final void reference_option() throws RecognitionException {
try {
// org/argouml/language/sql/reveng/MySql.g:205:18: ( 'RESTRICT' | 'CASCADE' | 'SET' 'NULL' | 'NO ACTION' | 'SET DEFAULT' )
int alt25=5;
switch ( input.LA(1) ) {
case 47:
{
alt25=1;
}
break;
case 22:
{
alt25=2;
}
break;
case 49:
{
alt25=3;
}
break;
case 40:
{
alt25=4;
}
break;
case 48:
{
alt25=5;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 25, 0, input);
throw nvae;
}
switch (alt25) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:206:2: 'RESTRICT'
{
match(input,47,FOLLOW_47_in_reference_option739);
}
break;
case 2 :
// org/argouml/language/sql/reveng/MySql.g:206:15: 'CASCADE'
{
match(input,22,FOLLOW_22_in_reference_option743);
}
break;
case 3 :
// org/argouml/language/sql/reveng/MySql.g:206:27: 'SET' 'NULL'
{
match(input,49,FOLLOW_49_in_reference_option747);
match(input,42,FOLLOW_42_in_reference_option749);
}
break;
case 4 :
// org/argouml/language/sql/reveng/MySql.g:206:42: 'NO ACTION'
{
match(input,40,FOLLOW_40_in_reference_option753);
}
break;
case 5 :
// org/argouml/language/sql/reveng/MySql.g:206:56: 'SET DEFAULT'
{
match(input,48,FOLLOW_48_in_reference_option757);
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "reference_option"
// $ANTLR start "columns_list_name"
// org/argouml/language/sql/reveng/MySql.g:209:1: columns_list_name returns [List<String> listColumn] : LEFT_PAREN c1= column_name ( COMMA c2= column_name )* RIGHT_PAREN ;
public final List<String> columns_list_name() throws RecognitionException {
List<String> listColumn = null;
String c1 =null;
String c2 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:209:52: ( LEFT_PAREN c1= column_name ( COMMA c2= column_name )* RIGHT_PAREN )
// org/argouml/language/sql/reveng/MySql.g:211:2: LEFT_PAREN c1= column_name ( COMMA c2= column_name )* RIGHT_PAREN
{
match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_columns_list_name772);
pushFollow(FOLLOW_column_name_in_columns_list_name776);
c1=column_name();
state._fsp--;
listColumn = new ArrayList<String>();
listColumn.add(c1);
// org/argouml/language/sql/reveng/MySql.g:216:2: ( COMMA c2= column_name )*
loop26:
while (true) {
int alt26=2;
int LA26_0 = input.LA(1);
if ( (LA26_0==COMMA) ) {
alt26=1;
}
switch (alt26) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:217:3: COMMA c2= column_name
{
match(input,COMMA,FOLLOW_COMMA_in_columns_list_name788);
pushFollow(FOLLOW_column_name_in_columns_list_name792);
c2=column_name();
state._fsp--;
listColumn.add(c2);
}
break;
default :
break loop26;
}
}
match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_columns_list_name800);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return listColumn;
}
// $ANTLR end "columns_list_name"
// $ANTLR start "column_name"
// org/argouml/language/sql/reveng/MySql.g:223:1: column_name returns [String cn] : name_with_esc ;
public final String column_name() throws RecognitionException {
String cn = null;
String name_with_esc11 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:223:33: ( name_with_esc )
// org/argouml/language/sql/reveng/MySql.g:224:2: name_with_esc
{
pushFollow(FOLLOW_name_with_esc_in_column_name815);
name_with_esc11=name_with_esc();
state._fsp--;
cn = name_with_esc11;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return cn;
}
// $ANTLR end "column_name"
// $ANTLR start "tbl_name"
// org/argouml/language/sql/reveng/MySql.g:227:1: tbl_name returns [String name] : name_with_esc ;
public final String tbl_name() throws RecognitionException {
String name = null;
String name_with_esc12 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:227:32: ( name_with_esc )
// org/argouml/language/sql/reveng/MySql.g:228:5: name_with_esc
{
pushFollow(FOLLOW_name_with_esc_in_tbl_name838);
name_with_esc12=name_with_esc();
state._fsp--;
name = name_with_esc12;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return name;
}
// $ANTLR end "tbl_name"
// $ANTLR start "data_type_def"
// org/argouml/language/sql/reveng/MySql.g:231:1: data_type_def[ColumnDefinition col] : data_type ( data_length )? ( 'UNSIGNED' )? ( 'ZEROFILL' )? ( 'NOT' 'NULL' | 'NULL' )? ( 'DEFAULT' default_statement[col] )? ( 'AUTO_INCREMENT' )? ( 'PRIMARY' 'KEY' | 'KEY' )? ( 'COMMENT' text_quoted )? ;
public final void data_type_def(ColumnDefinition col) throws RecognitionException {
ParserRuleReturnScope data_type13 =null;
ParserRuleReturnScope data_length14 =null;
String text_quoted15 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:231:38: ( data_type ( data_length )? ( 'UNSIGNED' )? ( 'ZEROFILL' )? ( 'NOT' 'NULL' | 'NULL' )? ( 'DEFAULT' default_statement[col] )? ( 'AUTO_INCREMENT' )? ( 'PRIMARY' 'KEY' | 'KEY' )? ( 'COMMENT' text_quoted )? )
// org/argouml/language/sql/reveng/MySql.g:232:5: data_type ( data_length )? ( 'UNSIGNED' )? ( 'ZEROFILL' )? ( 'NOT' 'NULL' | 'NULL' )? ( 'DEFAULT' default_statement[col] )? ( 'AUTO_INCREMENT' )? ( 'PRIMARY' 'KEY' | 'KEY' )? ( 'COMMENT' text_quoted )?
{
pushFollow(FOLLOW_data_type_in_data_type_def855);
data_type13=data_type();
state._fsp--;
col.setDatatype((data_type13!=null?input.toString(data_type13.start,data_type13.stop):null));
// org/argouml/language/sql/reveng/MySql.g:233:6: ( data_length )?
int alt27=2;
int LA27_0 = input.LA(1);
if ( (LA27_0==LEFT_PAREN) ) {
alt27=1;
}
switch (alt27) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:233:7: data_length
{
pushFollow(FOLLOW_data_length_in_data_type_def866);
data_length14=data_length();
state._fsp--;
}
break;
}
col.setLength((data_length14!=null?((MySqlParser.data_length_return)data_length14).len:null));
col.setNbDecimal((data_length14!=null?((MySqlParser.data_length_return)data_length14).decimal:null));//can be null
// org/argouml/language/sql/reveng/MySql.g:237:6: ( 'UNSIGNED' )?
int alt28=2;
int LA28_0 = input.LA(1);
if ( (LA28_0==52) ) {
alt28=1;
}
switch (alt28) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:237:8: 'UNSIGNED'
{
match(input,52,FOLLOW_52_in_data_type_def879);
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:239:6: ( 'ZEROFILL' )?
int alt29=2;
int LA29_0 = input.LA(1);
if ( (LA29_0==54) ) {
alt29=1;
}
switch (alt29) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:239:8: 'ZEROFILL'
{
match(input,54,FOLLOW_54_in_data_type_def899);
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:240:6: ( 'NOT' 'NULL' | 'NULL' )?
int alt30=3;
int LA30_0 = input.LA(1);
if ( (LA30_0==41) ) {
alt30=1;
}
else if ( (LA30_0==42) ) {
alt30=2;
}
switch (alt30) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:240:8: 'NOT' 'NULL'
{
match(input,41,FOLLOW_41_in_data_type_def914);
match(input,42,FOLLOW_42_in_data_type_def916);
col.setNullable(false);
}
break;
case 2 :
// org/argouml/language/sql/reveng/MySql.g:243:9: 'NULL'
{
match(input,42,FOLLOW_42_in_data_type_def929);
col.setNullable(true);
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:247:6: ( 'DEFAULT' default_statement[col] )?
int alt31=2;
int LA31_0 = input.LA(1);
if ( (LA31_0==28) ) {
alt31=1;
}
switch (alt31) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:247:8: 'DEFAULT' default_statement[col]
{
match(input,28,FOLLOW_28_in_data_type_def949);
pushFollow(FOLLOW_default_statement_in_data_type_def951);
default_statement(col);
state._fsp--;
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:249:6: ( 'AUTO_INCREMENT' )?
int alt32=2;
int LA32_0 = input.LA(1);
if ( (LA32_0==20) ) {
alt32=1;
}
switch (alt32) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:249:8: 'AUTO_INCREMENT'
{
match(input,20,FOLLOW_20_in_data_type_def971);
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:250:6: ( 'PRIMARY' 'KEY' | 'KEY' )?
int alt33=3;
int LA33_0 = input.LA(1);
if ( (LA33_0==45) ) {
alt33=1;
}
else if ( (LA33_0==38) ) {
alt33=2;
}
switch (alt33) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:250:8: 'PRIMARY' 'KEY'
{
match(input,45,FOLLOW_45_in_data_type_def985);
match(input,38,FOLLOW_38_in_data_type_def987);
}
break;
case 2 :
// org/argouml/language/sql/reveng/MySql.g:250:27: 'KEY'
{
match(input,38,FOLLOW_38_in_data_type_def992);
}
break;
}
// org/argouml/language/sql/reveng/MySql.g:251:6: ( 'COMMENT' text_quoted )?
int alt34=2;
int LA34_0 = input.LA(1);
if ( (LA34_0==24) ) {
alt34=1;
}
switch (alt34) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:251:8: 'COMMENT' text_quoted
{
match(input,24,FOLLOW_24_in_data_type_def1005);
pushFollow(FOLLOW_text_quoted_in_data_type_def1007);
text_quoted15=text_quoted();
state._fsp--;
col.setComment(text_quoted15);
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "data_type_def"
// $ANTLR start "default_statement"
// org/argouml/language/sql/reveng/MySql.g:255:1: default_statement[ColumnDefinition col] : ( 'NULL' | 'CURRENT_TIMESTAMP' ( 'ON' 'UPDATE' 'CURRENT_TIMESTAMP' )? | text_quoted_keep );
public final void default_statement(ColumnDefinition col) throws RecognitionException {
String text_quoted_keep16 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:255:41: ( 'NULL' | 'CURRENT_TIMESTAMP' ( 'ON' 'UPDATE' 'CURRENT_TIMESTAMP' )? | text_quoted_keep )
int alt36=3;
switch ( input.LA(1) ) {
case 42:
{
alt36=1;
}
break;
case 27:
{
alt36=2;
}
break;
case QUOTED_TEXT:
{
alt36=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 36, 0, input);
throw nvae;
}
switch (alt36) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:256:2: 'NULL'
{
match(input,42,FOLLOW_42_in_default_statement1026);
col.setDefaultValue("NULL");
}
break;
case 2 :
// org/argouml/language/sql/reveng/MySql.g:259:4: 'CURRENT_TIMESTAMP' ( 'ON' 'UPDATE' 'CURRENT_TIMESTAMP' )?
{
match(input,27,FOLLOW_27_in_default_statement1033);
// org/argouml/language/sql/reveng/MySql.g:259:24: ( 'ON' 'UPDATE' 'CURRENT_TIMESTAMP' )?
int alt35=2;
int LA35_0 = input.LA(1);
if ( (LA35_0==43) ) {
alt35=1;
}
switch (alt35) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:259:25: 'ON' 'UPDATE' 'CURRENT_TIMESTAMP'
{
match(input,43,FOLLOW_43_in_default_statement1036);
match(input,53,FOLLOW_53_in_default_statement1038);
match(input,27,FOLLOW_27_in_default_statement1040);
}
break;
}
col.setDefaultValue("CURRENT_TIMESTAMP");
}
break;
case 3 :
// org/argouml/language/sql/reveng/MySql.g:262:4: text_quoted_keep
{
pushFollow(FOLLOW_text_quoted_keep_in_default_statement1049);
text_quoted_keep16=text_quoted_keep();
state._fsp--;
col.setDefaultValue(text_quoted_keep16);
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "default_statement"
public static class data_length_return extends ParserRuleReturnScope {
public Integer len;
public Integer decimal;
};
// $ANTLR start "data_length"
// org/argouml/language/sql/reveng/MySql.g:267:1: data_length returns [Integer len, Integer decimal] : LEFT_PAREN i1= NUMBER ( COMMA i2= NUMBER )? RIGHT_PAREN ;
public final MySqlParser.data_length_return data_length() throws RecognitionException {
MySqlParser.data_length_return retval = new MySqlParser.data_length_return();
retval.start = input.LT(1);
Token i1=null;
Token i2=null;
try {
// org/argouml/language/sql/reveng/MySql.g:267:52: ( LEFT_PAREN i1= NUMBER ( COMMA i2= NUMBER )? RIGHT_PAREN )
// org/argouml/language/sql/reveng/MySql.g:268:6: LEFT_PAREN i1= NUMBER ( COMMA i2= NUMBER )? RIGHT_PAREN
{
match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_data_length1070);
i1=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_data_length1074);
// org/argouml/language/sql/reveng/MySql.g:268:27: ( COMMA i2= NUMBER )?
int alt37=2;
int LA37_0 = input.LA(1);
if ( (LA37_0==COMMA) ) {
alt37=1;
}
switch (alt37) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:268:28: COMMA i2= NUMBER
{
match(input,COMMA,FOLLOW_COMMA_in_data_length1077);
i2=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_data_length1081);
retval.decimal = Integer.valueOf((i2!=null?i2.getText():null));
}
break;
}
match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_data_length1088);
retval.len = Integer.valueOf((i1!=null?i1.getText():null));
}
retval.stop = input.LT(-1);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "data_length"
// $ANTLR start "schema"
// org/argouml/language/sql/reveng/MySql.g:271:1: schema : ID ;
public final void schema() throws RecognitionException {
try {
// org/argouml/language/sql/reveng/MySql.g:271:8: ( ID )
// org/argouml/language/sql/reveng/MySql.g:271:10: ID
{
match(input,ID,FOLLOW_ID_in_schema1104);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "schema"
// $ANTLR start "table"
// org/argouml/language/sql/reveng/MySql.g:272:1: table : ID ;
public final void table() throws RecognitionException {
try {
// org/argouml/language/sql/reveng/MySql.g:272:7: ( ID )
// org/argouml/language/sql/reveng/MySql.g:272:9: ID
{
match(input,ID,FOLLOW_ID_in_table1111);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "table"
public static class data_type_return extends ParserRuleReturnScope {
};
// $ANTLR start "data_type"
// org/argouml/language/sql/reveng/MySql.g:273:1: data_type : ID ;
public final MySqlParser.data_type_return data_type() throws RecognitionException {
MySqlParser.data_type_return retval = new MySqlParser.data_type_return();
retval.start = input.LT(1);
try {
// org/argouml/language/sql/reveng/MySql.g:273:11: ( ID )
// org/argouml/language/sql/reveng/MySql.g:273:13: ID
{
match(input,ID,FOLLOW_ID_in_data_type1119);
}
retval.stop = input.LT(-1);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "data_type"
// $ANTLR start "index_name"
// org/argouml/language/sql/reveng/MySql.g:274:1: index_name returns [String name] : ( LEFT_PAREN )? name_with_esc ( RIGHT_PAREN )? ;
public final String index_name() throws RecognitionException {
String name = null;
String name_with_esc17 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:274:34: ( ( LEFT_PAREN )? name_with_esc ( RIGHT_PAREN )? )
// org/argouml/language/sql/reveng/MySql.g:275:2: ( LEFT_PAREN )? name_with_esc ( RIGHT_PAREN )?
{
// org/argouml/language/sql/reveng/MySql.g:275:2: ( LEFT_PAREN )?
int alt38=2;
int LA38_0 = input.LA(1);
if ( (LA38_0==LEFT_PAREN) ) {
alt38=1;
}
switch (alt38) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:275:3: LEFT_PAREN
{
match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_index_name1132);
}
break;
}
pushFollow(FOLLOW_name_with_esc_in_index_name1136);
name_with_esc17=name_with_esc();
state._fsp--;
name = name_with_esc17;
// org/argouml/language/sql/reveng/MySql.g:275:62: ( RIGHT_PAREN )?
int alt39=2;
int LA39_0 = input.LA(1);
if ( (LA39_0==RIGHT_PAREN) ) {
alt39=1;
}
switch (alt39) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:275:63: RIGHT_PAREN
{
match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_index_name1141);
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return name;
}
// $ANTLR end "index_name"
// $ANTLR start "index_type"
// org/argouml/language/sql/reveng/MySql.g:277:1: index_type : ( 'BTREE' | 'HASH' );
public final void index_type() throws RecognitionException {
try {
// org/argouml/language/sql/reveng/MySql.g:277:12: ( 'BTREE' | 'HASH' )
// org/argouml/language/sql/reveng/MySql.g:
{
if ( input.LA(1)==21||input.LA(1)==35 ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "index_type"
// $ANTLR start "symbol"
// org/argouml/language/sql/reveng/MySql.g:279:1: symbol returns [String name] : name_with_esc ;
public final String symbol() throws RecognitionException {
String name = null;
String name_with_esc18 =null;
try {
// org/argouml/language/sql/reveng/MySql.g:279:30: ( name_with_esc )
// org/argouml/language/sql/reveng/MySql.g:280:2: name_with_esc
{
pushFollow(FOLLOW_name_with_esc_in_symbol1170);
name_with_esc18=name_with_esc();
state._fsp--;
name = name_with_esc18;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return name;
}
// $ANTLR end "symbol"
// $ANTLR start "name_with_esc"
// org/argouml/language/sql/reveng/MySql.g:283:1: name_with_esc returns [String name] : ( PROTECT_CHAR )? ID ( PROTECT_CHAR )? ;
public final String name_with_esc() throws RecognitionException {
String name = null;
Token ID19=null;
try {
// org/argouml/language/sql/reveng/MySql.g:283:37: ( ( PROTECT_CHAR )? ID ( PROTECT_CHAR )? )
// org/argouml/language/sql/reveng/MySql.g:284:2: ( PROTECT_CHAR )? ID ( PROTECT_CHAR )?
{
// org/argouml/language/sql/reveng/MySql.g:284:2: ( PROTECT_CHAR )?
int alt40=2;
int LA40_0 = input.LA(1);
if ( (LA40_0==PROTECT_CHAR) ) {
alt40=1;
}
switch (alt40) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:284:3: PROTECT_CHAR
{
match(input,PROTECT_CHAR,FOLLOW_PROTECT_CHAR_in_name_with_esc1189);
}
break;
}
ID19=(Token)match(input,ID,FOLLOW_ID_in_name_with_esc1193);
name = String.valueOf((ID19!=null?ID19.getText():null));
// org/argouml/language/sql/reveng/MySql.g:284:58: ( PROTECT_CHAR )?
int alt41=2;
int LA41_0 = input.LA(1);
if ( (LA41_0==PROTECT_CHAR) ) {
alt41=1;
}
switch (alt41) {
case 1 :
// org/argouml/language/sql/reveng/MySql.g:284:59: PROTECT_CHAR
{
match(input,PROTECT_CHAR,FOLLOW_PROTECT_CHAR_in_name_with_esc1198);
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return name;
}
// $ANTLR end "name_with_esc"
// Delegated rules
public static final BitSet FOLLOW_dumpComment_in_dump_read57 = new BitSet(new long[]{0x0002000044010402L});
public static final BitSet FOLLOW_drop_table_statement_in_dump_read62 = new BitSet(new long[]{0x0002000044010402L});
public static final BitSet FOLLOW_create_table_statement_in_dump_read67 = new BitSet(new long[]{0x0002000044010402L});
public static final BitSet FOLLOW_set_statement_in_dump_read72 = new BitSet(new long[]{0x0002000044010402L});
public static final BitSet FOLLOW_SL_COMMENT_in_dumpComment99 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ML_COMMENT_in_dumpComment104 = new BitSet(new long[]{0x0000000000008002L});
public static final BitSet FOLLOW_SEMICOLON_in_dumpComment107 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_49_in_set_statement118 = new BitSet(new long[]{0x0000000000020080L});
public static final BitSet FOLLOW_set_in_set_statement120 = new BitSet(new long[]{0x0000000000080000L});
public static final BitSet FOLLOW_19_in_set_statement128 = new BitSet(new long[]{0x0000000000020080L});
public static final BitSet FOLLOW_set_in_set_statement130 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_30_in_drop_table_statement146 = new BitSet(new long[]{0x0004000000000000L});
public static final BitSet FOLLOW_50_in_drop_table_statement148 = new BitSet(new long[]{0x0000001000000000L});
public static final BitSet FOLLOW_36_in_drop_table_statement150 = new BitSet(new long[]{0x0000000100000000L});
public static final BitSet FOLLOW_32_in_drop_table_statement152 = new BitSet(new long[]{0x0000000000001080L});
public static final BitSet FOLLOW_PROTECT_CHAR_in_drop_table_statement155 = new BitSet(new long[]{0x0000000000000080L});
public static final BitSet FOLLOW_table_name_in_drop_table_statement159 = new BitSet(new long[]{0x0000000000009000L});
public static final BitSet FOLLOW_PROTECT_CHAR_in_drop_table_statement162 = new BitSet(new long[]{0x0000000000008000L});
public static final BitSet FOLLOW_SEMICOLON_in_drop_table_statement166 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_26_in_create_table_statement178 = new BitSet(new long[]{0x0004000000000000L});
public static final BitSet FOLLOW_50_in_create_table_statement180 = new BitSet(new long[]{0x0000000000001080L});
public static final BitSet FOLLOW_PROTECT_CHAR_in_create_table_statement190 = new BitSet(new long[]{0x0000000000000080L});
public static final BitSet FOLLOW_table_name_in_create_table_statement194 = new BitSet(new long[]{0x0000000000001100L});
public static final BitSet FOLLOW_PROTECT_CHAR_in_create_table_statement197 = new BitSet(new long[]{0x0000000000000100L});
public static final BitSet FOLLOW_create_definition_list_in_create_table_statement223 = new BitSet(new long[]{0x0000000091108000L});
public static final BitSet FOLLOW_table_options_in_create_table_statement239 = new BitSet(new long[]{0x0000000000008000L});
public static final BitSet FOLLOW_SEMICOLON_in_create_table_statement283 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_schema_in_table_name300 = new BitSet(new long[]{0x0000000000000040L});
public static final BitSet FOLLOW_DOT_in_table_name302 = new BitSet(new long[]{0x0000000000000080L});
public static final BitSet FOLLOW_table_in_table_name306 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LEFT_PAREN_in_create_definition_list326 = new BitSet(new long[]{0x0008206202001080L});
public static final BitSet FOLLOW_create_definition_in_create_definition_list328 = new BitSet(new long[]{0x0000000000004010L});
public static final BitSet FOLLOW_COMMA_in_create_definition_list332 = new BitSet(new long[]{0x0008206202001080L});
public static final BitSet FOLLOW_create_definition_in_create_definition_list334 = new BitSet(new long[]{0x0000000000004010L});
public static final BitSet FOLLOW_RIGHT_PAREN_in_create_definition_list341 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_31_in_table_options357 = new BitSet(new long[]{0x0000000000080000L});
public static final BitSet FOLLOW_19_in_table_options359 = new BitSet(new long[]{0x0000000000000080L});
public static final BitSet FOLLOW_ID_in_table_options361 = new BitSet(new long[]{0x0000000011100002L});
public static final BitSet FOLLOW_20_in_table_options370 = new BitSet(new long[]{0x0000000000080000L});
public static final BitSet FOLLOW_19_in_table_options372 = new BitSet(new long[]{0x0000000000000800L});
public static final BitSet FOLLOW_NUMBER_in_table_options374 = new BitSet(new long[]{0x0000000011000002L});
public static final BitSet FOLLOW_28_in_table_options383 = new BitSet(new long[]{0x0000000000800000L});
public static final BitSet FOLLOW_23_in_table_options385 = new BitSet(new long[]{0x0000000000080000L});
public static final BitSet FOLLOW_19_in_table_options387 = new BitSet(new long[]{0x0000000000000080L});
public static final BitSet FOLLOW_ID_in_table_options389 = new BitSet(new long[]{0x0000000001000002L});
public static final BitSet FOLLOW_24_in_table_options398 = new BitSet(new long[]{0x0000000000080000L});
public static final BitSet FOLLOW_19_in_table_options400 = new BitSet(new long[]{0x0000000000002000L});
public static final BitSet FOLLOW_text_quoted_in_table_options402 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_set_in_create_definition425 = new BitSet(new long[]{0x0000000000001180L});
public static final BitSet FOLLOW_index_name_in_create_definition431 = new BitSet(new long[]{0x0000000800200100L});
public static final BitSet FOLLOW_index_type_in_create_definition434 = new BitSet(new long[]{0x0000000000000100L});
public static final BitSet FOLLOW_columns_list_name_in_create_definition438 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_constraint_def_in_create_definition450 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_column_name_in_create_definition472 = new BitSet(new long[]{0x0000000000000080L});
public static final BitSet FOLLOW_data_type_def_in_create_definition476 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_QUOTED_TEXT_in_text_quoted494 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_QUOTED_TEXT_in_text_quoted_keep514 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_25_in_constraint_def536 = new BitSet(new long[]{0x0000000000001080L});
public static final BitSet FOLLOW_symbol_in_constraint_def538 = new BitSet(new long[]{0x0008200200000000L});
public static final BitSet FOLLOW_constraint_unique_in_constraint_def561 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_constraint_fk_in_constraint_def568 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_constraint_pk_in_constraint_def575 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_51_in_constraint_unique592 = new BitSet(new long[]{0x0000006800201180L});
public static final BitSet FOLLOW_index_name_in_constraint_unique604 = new BitSet(new long[]{0x0000000800200100L});
public static final BitSet FOLLOW_index_type_in_constraint_unique609 = new BitSet(new long[]{0x0000000000000100L});
public static final BitSet FOLLOW_columns_list_name_in_constraint_unique614 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_33_in_constraint_fk625 = new BitSet(new long[]{0x0000004000000000L});
public static final BitSet FOLLOW_38_in_constraint_fk627 = new BitSet(new long[]{0x0000000000001180L});
public static final BitSet FOLLOW_symbol_in_constraint_fk630 = new BitSet(new long[]{0x0000000000000100L});
public static final BitSet FOLLOW_columns_list_name_in_constraint_fk638 = new BitSet(new long[]{0x0000400000000000L});
public static final BitSet FOLLOW_reference_definition_in_constraint_fk644 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_45_in_constraint_pk657 = new BitSet(new long[]{0x0000004000000000L});
public static final BitSet FOLLOW_38_in_constraint_pk659 = new BitSet(new long[]{0x0000000800200100L});
public static final BitSet FOLLOW_index_type_in_constraint_pk662 = new BitSet(new long[]{0x0000000000000100L});
public static final BitSet FOLLOW_columns_list_name_in_constraint_pk666 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_46_in_reference_definition681 = new BitSet(new long[]{0x0000000000001080L});
public static final BitSet FOLLOW_tbl_name_in_reference_definition683 = new BitSet(new long[]{0x0000000000000100L});
public static final BitSet FOLLOW_columns_list_name_in_reference_definition690 = new BitSet(new long[]{0x0000088000000002L});
public static final BitSet FOLLOW_39_in_reference_definition699 = new BitSet(new long[]{0x0000100400000000L});
public static final BitSet FOLLOW_set_in_reference_definition701 = new BitSet(new long[]{0x0000080000000002L});
public static final BitSet FOLLOW_43_in_reference_definition714 = new BitSet(new long[]{0x0020000020000000L});
public static final BitSet FOLLOW_set_in_reference_definition716 = new BitSet(new long[]{0x0003810000400000L});
public static final BitSet FOLLOW_reference_option_in_reference_definition724 = new BitSet(new long[]{0x0000080000000002L});
public static final BitSet FOLLOW_47_in_reference_option739 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_22_in_reference_option743 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_49_in_reference_option747 = new BitSet(new long[]{0x0000040000000000L});
public static final BitSet FOLLOW_42_in_reference_option749 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_40_in_reference_option753 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_48_in_reference_option757 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LEFT_PAREN_in_columns_list_name772 = new BitSet(new long[]{0x0000000000001080L});
public static final BitSet FOLLOW_column_name_in_columns_list_name776 = new BitSet(new long[]{0x0000000000004010L});
public static final BitSet FOLLOW_COMMA_in_columns_list_name788 = new BitSet(new long[]{0x0000000000001080L});
public static final BitSet FOLLOW_column_name_in_columns_list_name792 = new BitSet(new long[]{0x0000000000004010L});
public static final BitSet FOLLOW_RIGHT_PAREN_in_columns_list_name800 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_name_with_esc_in_column_name815 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_name_with_esc_in_tbl_name838 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_data_type_in_data_type_def855 = new BitSet(new long[]{0x0050264011100102L});
public static final BitSet FOLLOW_data_length_in_data_type_def866 = new BitSet(new long[]{0x0050264011100002L});
public static final BitSet FOLLOW_52_in_data_type_def879 = new BitSet(new long[]{0x0040264011100002L});
public static final BitSet FOLLOW_54_in_data_type_def899 = new BitSet(new long[]{0x0000264011100002L});
public static final BitSet FOLLOW_41_in_data_type_def914 = new BitSet(new long[]{0x0000040000000000L});
public static final BitSet FOLLOW_42_in_data_type_def916 = new BitSet(new long[]{0x0000204011100002L});
public static final BitSet FOLLOW_42_in_data_type_def929 = new BitSet(new long[]{0x0000204011100002L});
public static final BitSet FOLLOW_28_in_data_type_def949 = new BitSet(new long[]{0x0000040008002000L});
public static final BitSet FOLLOW_default_statement_in_data_type_def951 = new BitSet(new long[]{0x0000204001100002L});
public static final BitSet FOLLOW_20_in_data_type_def971 = new BitSet(new long[]{0x0000204001000002L});
public static final BitSet FOLLOW_45_in_data_type_def985 = new BitSet(new long[]{0x0000004000000000L});
public static final BitSet FOLLOW_38_in_data_type_def987 = new BitSet(new long[]{0x0000000001000002L});
public static final BitSet FOLLOW_38_in_data_type_def992 = new BitSet(new long[]{0x0000000001000002L});
public static final BitSet FOLLOW_24_in_data_type_def1005 = new BitSet(new long[]{0x0000000000002000L});
public static final BitSet FOLLOW_text_quoted_in_data_type_def1007 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_42_in_default_statement1026 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_27_in_default_statement1033 = new BitSet(new long[]{0x0000080000000002L});
public static final BitSet FOLLOW_43_in_default_statement1036 = new BitSet(new long[]{0x0020000000000000L});
public static final BitSet FOLLOW_53_in_default_statement1038 = new BitSet(new long[]{0x0000000008000000L});
public static final BitSet FOLLOW_27_in_default_statement1040 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_text_quoted_keep_in_default_statement1049 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LEFT_PAREN_in_data_length1070 = new BitSet(new long[]{0x0000000000000800L});
public static final BitSet FOLLOW_NUMBER_in_data_length1074 = new BitSet(new long[]{0x0000000000004010L});
public static final BitSet FOLLOW_COMMA_in_data_length1077 = new BitSet(new long[]{0x0000000000000800L});
public static final BitSet FOLLOW_NUMBER_in_data_length1081 = new BitSet(new long[]{0x0000000000004000L});
public static final BitSet FOLLOW_RIGHT_PAREN_in_data_length1088 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ID_in_schema1104 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ID_in_table1111 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ID_in_data_type1119 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LEFT_PAREN_in_index_name1132 = new BitSet(new long[]{0x0000000000001080L});
public static final BitSet FOLLOW_name_with_esc_in_index_name1136 = new BitSet(new long[]{0x0000000000004002L});
public static final BitSet FOLLOW_RIGHT_PAREN_in_index_name1141 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_name_with_esc_in_symbol1170 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_PROTECT_CHAR_in_name_with_esc1189 = new BitSet(new long[]{0x0000000000000080L});
public static final BitSet FOLLOW_ID_in_name_with_esc1193 = new BitSet(new long[]{0x0000000000001002L});
public static final BitSet FOLLOW_PROTECT_CHAR_in_name_with_esc1198 = new BitSet(new long[]{0x0000000000000002L});
}