Author: mic...@jb... Date: 2006-05-09 07:11:22 -0400 (Tue, 09 May 2006) New Revision: 4152 Added: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/lang/function_arrays.drl Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/RuleParser.java labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/RuleParserLexer.java labs/jbossrules/trunk/drools-compiler/src/main/resources/org/drools/lang/drl.g labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/lang/RuleParserTest.java Log: JBRULES-262 Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/RuleParser.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/RuleParser.java 2006-05-09 09:55:35 UTC (rev 4151) +++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/lang/RuleParser.java 2006-05-09 11:11:22 UTC (rev 4152) @@ -1,4 +1,4 @@ -// $ANTLR 3.0ea8 C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g 2006-05-09 10:21:45 +// $ANTLR 3.0ea8 C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g 2006-05-09 20:55:12 package org.drools.lang; import java.util.List; @@ -15,7 +15,7 @@ public class RuleParser extends Parser { public static final String[] tokenNames = new String[] { - "<invalid>", "<EOR>", "<DOWN>", "<UP>", "EOL", "ID", "INT", "BOOL", "STRING", "FLOAT", "MISC", "WS", "SH_STYLE_SINGLE_LINE_COMMENT", "C_STYLE_SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", "\';\'", "\'package\'", "\'import\'", "\'.\'", "\'.*\'", "\'expander\'", "\'global\'", "\'function\'", "\'(\'", "\',\'", "\')\'", "\'{\'", "\'}\'", "\'query\'", "\'end\'", "\'rule\'", "\'when\'", "\':\'", "\'then\'", "\'attributes\'", "\'salience\'", "\'no-loop\'", "\'auto-focus\'", "\'xor-group\'", "\'agenda-group\'", "\'duration\'", "\'or\'", "\'==\'", "\'>\'", "\'>=\'", "\'<\'", "\'<=\'", "\'!=\'", "\'contains\'", "\'matches\'", "\'excludes\'", "\'null\'", "\'->\'", "\'||\'", "\'and\'", "\'&&\'", "\'exists\'", "\'not\'", "\'eval\'", "\'use\'" + "<invalid>", "<EOR>", "<DOWN>", "<UP>", "EOL", "ID", "INT", "BOOL", "STRING", "FLOAT", "MISC", "WS", "SH_STYLE_SINGLE_LINE_COMMENT", "C_STYLE_SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", "\';\'", "\'package\'", "\'import\'", "\'.\'", "\'.*\'", "\'expander\'", "\'global\'", "\'function\'", "\'(\'", "\',\'", "\')\'", "\'{\'", "\'}\'", "\'query\'", "\'end\'", "\'rule\'", "\'when\'", "\':\'", "\'then\'", "\'attributes\'", "\'salience\'", "\'no-loop\'", "\'auto-focus\'", "\'xor-group\'", "\'agenda-group\'", "\'duration\'", "\'or\'", "\'==\'", "\'>\'", "\'>=\'", "\'<\'", "\'<=\'", "\'!=\'", "\'contains\'", "\'matches\'", "\'excludes\'", "\'null\'", "\'->\'", "\'||\'", "\'and\'", "\'&&\'", "\'exists\'", "\'not\'", "\'eval\'", "\'[\'", "\']\'", "\'use\'" }; public static final int BOOL=7; public static final int INT=6; @@ -901,14 +901,15 @@ // $ANTLR start function - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:331:1: function : 'function' opt_eol (retType= dotted_name )? opt_eol name= ID opt_eol '(' opt_eol ( (paramType= dotted_name )? opt_eol paramName= ID opt_eol ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= ID opt_eol )* )? ')' opt_eol '{' body= curly_chunk '}' opt_eol ; + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:331:1: function : 'function' opt_eol (retType= dotted_name )? opt_eol name= ID opt_eol '(' opt_eol ( (paramType= dotted_name )? opt_eol paramName= argument opt_eol ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= argument opt_eol )* )? ')' opt_eol '{' body= curly_chunk '}' opt_eol ; public void function() throws RecognitionException { Token name=null; - Token paramName=null; String retType = null; String paramType = null; + String paramName = null; + String body = null; @@ -916,8 +917,8 @@ FunctionDescr f = null; try { - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:336:17: ( 'function' opt_eol (retType= dotted_name )? opt_eol name= ID opt_eol '(' opt_eol ( (paramType= dotted_name )? opt_eol paramName= ID opt_eol ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= ID opt_eol )* )? ')' opt_eol '{' body= curly_chunk '}' opt_eol ) - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:336:17: 'function' opt_eol (retType= dotted_name )? opt_eol name= ID opt_eol '(' opt_eol ( (paramType= dotted_name )? opt_eol paramName= ID opt_eol ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= ID opt_eol )* )? ')' opt_eol '{' body= curly_chunk '}' opt_eol + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:336:17: ( 'function' opt_eol (retType= dotted_name )? opt_eol name= ID opt_eol '(' opt_eol ( (paramType= dotted_name )? opt_eol paramName= argument opt_eol ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= argument opt_eol )* )? ')' opt_eol '{' body= curly_chunk '}' opt_eol ) + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:336:17: 'function' opt_eol (retType= dotted_name )? opt_eol name= ID opt_eol '(' opt_eol ( (paramType= dotted_name )? opt_eol paramName= argument opt_eol ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= argument opt_eol )* )? ')' opt_eol '{' body= curly_chunk '}' opt_eol { match(input,22,FOLLOW_22_in_function362); following.push(FOLLOW_opt_eol_in_function364); @@ -960,7 +961,7 @@ opt_eol(); following.pop(); - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:342:25: ( (paramType= dotted_name )? opt_eol paramName= ID opt_eol ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= ID opt_eol )* )? + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:342:25: ( (paramType= dotted_name )? opt_eol paramName= argument opt_eol ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= argument opt_eol )* )? int alt16=2; int LA16_0 = input.LA(1); if ( (LA16_0>=EOL && LA16_0<=ID)||LA16_0==15 ) { @@ -971,13 +972,13 @@ } else { NoViableAltException nvae = - new NoViableAltException("342:25: ( (paramType= dotted_name )? opt_eol paramName= ID opt_eol ( \',\' opt_eol (paramType= dotted_name )? opt_eol paramName= ID opt_eol )* )?", 16, 0, input); + new NoViableAltException("342:25: ( (paramType= dotted_name )? opt_eol paramName= argument opt_eol ( \',\' opt_eol (paramType= dotted_name )? opt_eol paramName= argument opt_eol )* )?", 16, 0, input); throw nvae; } switch (alt16) { case 1 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:342:33: (paramType= dotted_name )? opt_eol paramName= ID opt_eol ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= ID opt_eol )* + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:342:33: (paramType= dotted_name )? opt_eol paramName= argument opt_eol ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= argument opt_eol )* { // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:342:33: (paramType= dotted_name )? int alt13=2; @@ -1000,16 +1001,18 @@ opt_eol(); following.pop(); - paramName=(Token)input.LT(1); - match(input,ID,FOLLOW_ID_in_function408); + following.push(FOLLOW_argument_in_function408); + paramName=argument(); + following.pop(); + following.push(FOLLOW_opt_eol_in_function410); opt_eol(); following.pop(); - f.addParameter( paramType, paramName.getText() ); + f.addParameter( paramType, paramName ); - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:346:33: ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= ID opt_eol )* + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:346:33: ( ',' opt_eol (paramType= dotted_name )? opt_eol paramName= argument opt_eol )* loop15: do { int alt15=2; @@ -1021,7 +1024,7 @@ switch (alt15) { case 1 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:346:41: ',' opt_eol (paramType= dotted_name )? opt_eol paramName= ID opt_eol + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:346:41: ',' opt_eol (paramType= dotted_name )? opt_eol paramName= argument opt_eol { match(input,24,FOLLOW_24_in_function424); following.push(FOLLOW_opt_eol_in_function426); @@ -1049,14 +1052,16 @@ opt_eol(); following.pop(); - paramName=(Token)input.LT(1); - match(input,ID,FOLLOW_ID_in_function439); + following.push(FOLLOW_argument_in_function439); + paramName=argument(); + following.pop(); + following.push(FOLLOW_opt_eol_in_function441); opt_eol(); following.pop(); - f.addParameter( paramType, paramName.getText() ); + f.addParameter( paramType, paramName ); } @@ -1315,6 +1320,8 @@ case 54: case 55: case 59: + case 60: + case 61: alt17=1; break; default: @@ -1517,7 +1524,7 @@ throw nvae; } } - else if ( (LA19_0>=EOL && LA19_0<=31)||(LA19_0>=33 && LA19_0<=59) ) { + else if ( (LA19_0>=EOL && LA19_0<=31)||(LA19_0>=33 && LA19_0<=61) ) { alt19=2; } else { @@ -1730,6 +1737,8 @@ case 54: case 55: case 59: + case 60: + case 61: alt20=1; break; default: @@ -1803,7 +1812,7 @@ if ( LA22_0==32 ) { alt22=1; } - else if ( (LA22_0>=EOL && LA22_0<=31)||(LA22_0>=33 && LA22_0<=59) ) { + else if ( (LA22_0>=EOL && LA22_0<=31)||(LA22_0>=33 && LA22_0<=61) ) { alt22=2; } else { @@ -1835,7 +1844,7 @@ if ( LA23_0==29 ) { alt23=2; } - else if ( (LA23_0>=EOL && LA23_0<=28)||(LA23_0>=30 && LA23_0<=59) ) { + else if ( (LA23_0>=EOL && LA23_0<=28)||(LA23_0>=30 && LA23_0<=61) ) { alt23=1; } @@ -2976,6 +2985,8 @@ case 57: case 58: case 59: + case 60: + case 61: alt43=1; break; case 15: @@ -4100,6 +4111,8 @@ case 57: case 58: case 59: + case 60: + case 61: alt55=2; break; @@ -4244,6 +4257,8 @@ case 57: case 58: case 59: + case 60: + case 61: alt56=2; break; @@ -4388,6 +4403,8 @@ case 57: case 58: case 59: + case 60: + case 61: alt57=2; break; @@ -4937,7 +4954,7 @@ // $ANTLR start dotted_name - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:973:1: dotted_name returns [String name] : id= ID ( '.' id= ID )* ; + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:973:1: dotted_name returns [String name] : id= ID ( '.' id= ID )* ( '[' ']' )* ; public String dotted_name() throws RecognitionException { String name; Token id=null; @@ -4946,8 +4963,8 @@ name = null; try { - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:978:17: (id= ID ( '.' id= ID )* ) - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:978:17: id= ID ( '.' id= ID )* + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:978:17: (id= ID ( '.' id= ID )* ( '[' ']' )* ) + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:978:17: id= ID ( '.' id= ID )* ( '[' ']' )* { id=(Token)input.LT(1); match(input,ID,FOLLOW_ID_in_dotted_name2754); @@ -4979,7 +4996,33 @@ } } while (true); + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:978:99: ( '[' ']' )* + loop64: + do { + int alt64=2; + int LA64_0 = input.LA(1); + if ( LA64_0==59 ) { + alt64=1; + } + + switch (alt64) { + case 1 : + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:978:101: '[' ']' + { + match(input,59,FOLLOW_59_in_dotted_name2773); + match(input,60,FOLLOW_60_in_dotted_name2775); + name = name + "[]"; + + } + break; + + default : + break loop64; + } + } while (true); + + } } @@ -4994,8 +5037,65 @@ // $ANTLR end dotted_name + // $ANTLR start argument + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:981:1: argument returns [String name] : id= ID ( '[' ']' )* ; + public String argument() throws RecognitionException { + String name; + Token id=null; + + + name = null; + + try { + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:986:17: (id= ID ( '[' ']' )* ) + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:986:17: id= ID ( '[' ']' )* + { + id=(Token)input.LT(1); + match(input,ID,FOLLOW_ID_in_argument2805); + name=id.getText(); + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:986:46: ( '[' ']' )* + loop65: + do { + int alt65=2; + int LA65_0 = input.LA(1); + if ( LA65_0==59 ) { + alt65=1; + } + + + switch (alt65) { + case 1 : + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:986:48: '[' ']' + { + match(input,59,FOLLOW_59_in_argument2811); + match(input,60,FOLLOW_60_in_argument2813); + name = name + "[]"; + + } + break; + + default : + break loop65; + } + } while (true); + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + } + return name; + } + // $ANTLR end argument + + // $ANTLR start word - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:982:1: word returns [String word] : (id= ID | 'import' | 'use' | 'rule' | 'query' | 'salience' | 'no-loop' | 'when' | 'then' | 'end' | str= STRING ); + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:990:1: word returns [String word] : (id= ID | 'import' | 'use' | 'rule' | 'query' | 'salience' | 'no-loop' | 'when' | 'then' | 'end' | str= STRING ); public String word() throws RecognitionException { String word; Token id=null; @@ -5005,136 +5105,136 @@ word = null; try { - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:986:17: (id= ID | 'import' | 'use' | 'rule' | 'query' | 'salience' | 'no-loop' | 'when' | 'then' | 'end' | str= STRING ) - int alt64=11; + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:994:17: (id= ID | 'import' | 'use' | 'rule' | 'query' | 'salience' | 'no-loop' | 'when' | 'then' | 'end' | str= STRING ) + int alt66=11; switch ( input.LA(1) ) { case ID: - alt64=1; + alt66=1; break; case 17: - alt64=2; + alt66=2; break; - case 59: - alt64=3; + case 61: + alt66=3; break; case 30: - alt64=4; + alt66=4; break; case 28: - alt64=5; + alt66=5; break; case 35: - alt64=6; + alt66=6; break; case 36: - alt64=7; + alt66=7; break; case 31: - alt64=8; + alt66=8; break; case 33: - alt64=9; + alt66=9; break; case 29: - alt64=10; + alt66=10; break; case STRING: - alt64=11; + alt66=11; break; default: NoViableAltException nvae = - new NoViableAltException("982:1: word returns [String word] : (id= ID | \'import\' | \'use\' | \'rule\' | \'query\' | \'salience\' | \'no-loop\' | \'when\' | \'then\' | \'end\' | str= STRING );", 64, 0, input); + new NoViableAltException("990:1: word returns [String word] : (id= ID | \'import\' | \'use\' | \'rule\' | \'query\' | \'salience\' | \'no-loop\' | \'when\' | \'then\' | \'end\' | str= STRING );", 66, 0, input); throw nvae; } - switch (alt64) { + switch (alt66) { case 1 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:986:17: id= ID + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:994:17: id= ID { id=(Token)input.LT(1); - match(input,ID,FOLLOW_ID_in_word2794); + match(input,ID,FOLLOW_ID_in_word2841); word=id.getText(); } break; case 2 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:987:17: 'import' + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:995:17: 'import' { - match(input,17,FOLLOW_17_in_word2806); + match(input,17,FOLLOW_17_in_word2853); word="import"; } break; case 3 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:988:17: 'use' + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:996:17: 'use' { - match(input,59,FOLLOW_59_in_word2815); + match(input,61,FOLLOW_61_in_word2862); word="use"; } break; case 4 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:989:17: 'rule' + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:997:17: 'rule' { - match(input,30,FOLLOW_30_in_word2827); + match(input,30,FOLLOW_30_in_word2874); word="rule"; } break; case 5 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:990:17: 'query' + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:998:17: 'query' { - match(input,28,FOLLOW_28_in_word2838); + match(input,28,FOLLOW_28_in_word2885); word="query"; } break; case 6 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:991:17: 'salience' + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:999:17: 'salience' { - match(input,35,FOLLOW_35_in_word2848); + match(input,35,FOLLOW_35_in_word2895); word="salience"; } break; case 7 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:992:17: 'no-loop' + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:1000:17: 'no-loop' { - match(input,36,FOLLOW_36_in_word2856); + match(input,36,FOLLOW_36_in_word2903); word="no-loop"; } break; case 8 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:993:17: 'when' + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:1001:17: 'when' { - match(input,31,FOLLOW_31_in_word2864); + match(input,31,FOLLOW_31_in_word2911); word="when"; } break; case 9 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:994:17: 'then' + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:1002:17: 'then' { - match(input,33,FOLLOW_33_in_word2875); + match(input,33,FOLLOW_33_in_word2922); word="then"; } break; case 10 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:995:17: 'end' + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:1003:17: 'end' { - match(input,29,FOLLOW_29_in_word2886); + match(input,29,FOLLOW_29_in_word2933); word="end"; } break; case 11 : - // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:996:17: str= STRING + // C:\Projects\jboss-rules-new\drools-compiler\src\main\resources\org\drools\lang\drl.g:1004:17: str= STRING { str=(Token)input.LT(1); - match(input,STRING,FOLLOW_STRING_in_word2900); + match(input,STRING,FOLLOW_STRING_in_word2947); word=getString(str); } @@ -5159,20 +5259,20 @@ return predict(input, s0); } DFA.State s1 = new DFA.State() {{alt=4;}}; + DFA.State s3 = new DFA.State() {{alt=1;}}; DFA.State s4 = new DFA.State() {{alt=2;}}; - DFA.State s3 = new DFA.State() {{alt=1;}}; DFA.State s2 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { - case 28: - return s4; + case 30: + return s3; case EOL: case 15: return s2; - case 30: - return s3; + case 28: + return s4; default: NoViableAltException nvae = @@ -5241,23 +5341,53 @@ throw nvae; } }; - DFA.State s17 = new DFA.State() {{alt=1;}}; - DFA.State s24 = new DFA.State() { + DFA.State s18 = new DFA.State() {{alt=1;}}; + DFA.State s27 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { - int LA4_24 = input.LA(1); - if ( LA4_24==ID ) {return s17;} - if ( LA4_24==18 ) {return s16;} + int LA4_27 = input.LA(1); + if ( LA4_27==ID ) {return s18;} + if ( LA4_27==59 ) {return s17;} NoViableAltException nvae = - new NoViableAltException("", 4, 24, input); + new NoViableAltException("", 4, 27, input); throw nvae; } }; + DFA.State s17 = new DFA.State() { + public DFA.State transition(IntStream input) throws RecognitionException { + int LA4_17 = input.LA(1); + if ( LA4_17==60 ) {return s27;} + + NoViableAltException nvae = + new NoViableAltException("", 4, 17, input); + + throw nvae; + } + }; + DFA.State s26 = new DFA.State() { + public DFA.State transition(IntStream input) throws RecognitionException { + switch ( input.LA(1) ) { + case 59: + return s17; + + case ID: + return s18; + + case 18: + return s16; + + default: + NoViableAltException nvae = + new NoViableAltException("", 4, 26, input); + + throw nvae; } + } + }; DFA.State s16 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { int LA4_16 = input.LA(1); - if ( LA4_16==ID ) {return s24;} + if ( LA4_16==ID ) {return s26;} NoViableAltException nvae = new NoViableAltException("", 4, 16, input); @@ -5267,14 +5397,21 @@ }; DFA.State s11 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { - int LA4_11 = input.LA(1); - if ( LA4_11==18 ) {return s16;} - if ( LA4_11==ID ) {return s17;} + switch ( input.LA(1) ) { + case 18: + return s16; - NoViableAltException nvae = - new NoViableAltException("", 4, 11, input); + case 59: + return s17; - throw nvae; + case ID: + return s18; + + default: + NoViableAltException nvae = + new NoViableAltException("", 4, 11, input); + + throw nvae; } } }; DFA.State s5 = new DFA.State() { @@ -5288,18 +5425,17 @@ throw nvae; } }; - DFA.State s71 = new DFA.State() {{alt=1;}}; - DFA.State s84 = new DFA.State() {{alt=1;}}; - DFA.State s93 = new DFA.State() {{alt=1;}}; - DFA.State s100 = new DFA.State() {{alt=1;}}; - DFA.State s101 = new DFA.State() { + DFA.State s105 = new DFA.State() {{alt=1;}}; + DFA.State s114 = new DFA.State() {{alt=1;}}; + DFA.State s120 = new DFA.State() {{alt=1;}}; + DFA.State s122 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 27: - return s100; + return s120; case 26: - return s99; + return s121; case EOL: case ID: @@ -5355,24 +5491,26 @@ case 57: case 58: case 59: - return s101; + case 60: + case 61: + return s122; default: NoViableAltException nvae = - new NoViableAltException("", 4, 101, input); + new NoViableAltException("", 4, 122, input); throw nvae; } } }; - DFA.State s99 = new DFA.State() { + DFA.State s121 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { + case 27: + return s120; + case 26: - return s99; + return s121; - case 27: - return s100; - case EOL: case ID: case INT: @@ -5427,24 +5565,26 @@ case 57: case 58: case 59: - return s101; + case 60: + case 61: + return s122; default: NoViableAltException nvae = - new NoViableAltException("", 4, 99, input); + new NoViableAltException("", 4, 121, input); throw nvae; } } }; - DFA.State s94 = new DFA.State() { + DFA.State s115 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { + case 27: + return s120; + case 26: - return s99; + return s121; - case 27: - return s100; - case EOL: case ID: case INT: @@ -5499,23 +5639,25 @@ case 57: case 58: case 59: - return s101; + case 60: + case 61: + return s122; default: NoViableAltException nvae = - new NoViableAltException("", 4, 94, input); + new NoViableAltException("", 4, 115, input); throw nvae; } } }; - DFA.State s95 = new DFA.State() { + DFA.State s116 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 27: - return s93; + return s114; case 26: - return s94; + return s115; case EOL: case ID: @@ -5571,23 +5713,25 @@ case 57: case 58: case 59: - return s95; + case 60: + case 61: + return s116; default: NoViableAltException nvae = - new NoViableAltException("", 4, 95, input); + new NoViableAltException("", 4, 116, input); throw nvae; } } }; - DFA.State s85 = new DFA.State() { + DFA.State s106 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 27: - return s93; + return s114; case 26: - return s94; + return s115; case EOL: case ID: @@ -5643,23 +5787,25 @@ case 57: case 58: case 59: - return s95; + case 60: + case 61: + return s116; default: NoViableAltException nvae = - new NoViableAltException("", 4, 85, input); + new NoViableAltException("", 4, 106, input); throw nvae; } } }; - DFA.State s86 = new DFA.State() { + DFA.State s107 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 27: - return s84; + return s105; case 26: - return s85; + return s106; case EOL: case ID: @@ -5715,23 +5861,25 @@ case 57: case 58: case 59: - return s86; + case 60: + case 61: + return s107; default: NoViableAltException nvae = - new NoViableAltException("", 4, 86, input); + new NoViableAltException("", 4, 107, input); throw nvae; } } }; - DFA.State s72 = new DFA.State() { + DFA.State s87 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 27: - return s84; + return s105; case 26: - return s85; + return s106; case EOL: case ID: @@ -5787,23 +5935,26 @@ case 57: case 58: case 59: - return s86; + case 60: + case 61: + return s107; default: NoViableAltException nvae = - new NoViableAltException("", 4, 72, input); + new NoViableAltException("", 4, 87, input); throw nvae; } } }; - DFA.State s73 = new DFA.State() { + DFA.State s88 = new DFA.State() {{alt=1;}}; + DFA.State s89 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 27: - return s71; + return s88; case 26: - return s72; + return s87; case EOL: case ID: @@ -5859,24 +6010,26 @@ case 57: case 58: case 59: - return s73; + case 60: + case 61: + return s89; default: NoViableAltException nvae = - new NoViableAltException("", 4, 73, input); + new NoViableAltException("", 4, 89, input); throw nvae; } } }; - DFA.State s58 = new DFA.State() { + DFA.State s67 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { + case 26: + return s87; + case 27: - return s71; + return s88; - case 26: - return s72; - case EOL: case ID: case INT: @@ -5931,24 +6084,26 @@ case 57: case 58: case 59: - return s73; + case 60: + case 61: + return s89; default: NoViableAltException nvae = - new NoViableAltException("", 4, 58, input); + new NoViableAltException("", 4, 67, input); throw nvae; } } }; - DFA.State s59 = new DFA.State() {{alt=1;}}; - DFA.State s60 = new DFA.State() { + DFA.State s68 = new DFA.State() {{alt=1;}}; + DFA.State s69 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 27: - return s59; + return s68; case 26: - return s58; + return s67; case EOL: case ID: @@ -6004,23 +6159,25 @@ case 57: case 58: case 59: - return s60; + case 60: + case 61: + return s69; default: NoViableAltException nvae = - new NoViableAltException("", 4, 60, input); + new NoViableAltException("", 4, 69, input); throw nvae; } } }; - DFA.State s46 = new DFA.State() { + DFA.State s53 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 26: - return s58; + return s67; case 27: - return s59; + return s68; case EOL: case ID: @@ -6076,321 +6233,406 @@ case 57: case 58: case 59: - return s60; + case 60: + case 61: + return s69; default: NoViableAltException nvae = - new NoViableAltException("", 4, 46, input); + new NoViableAltException("", 4, 53, input); throw nvae; } } }; - DFA.State s45 = new DFA.State() { + DFA.State s52 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { - int LA4_45 = input.LA(1); - if ( LA4_45==26 ) {return s46;} - if ( LA4_45==EOL||LA4_45==15 ) {return s45;} + int LA4_52 = input.LA(1); + if ( LA4_52==26 ) {return s53;} + if ( LA4_52==EOL||LA4_52==15 ) {return s52;} NoViableAltException nvae = - new NoViableAltException("", 4, 45, input); + new NoViableAltException("", 4, 52, input); throw nvae; } }; - DFA.State s32 = new DFA.State() { + DFA.State s35 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { - int LA4_32 = input.LA(1); - if ( LA4_32==EOL||LA4_32==15 ) {return s45;} - if ( LA4_32==26 ) {return s46;} + int LA4_35 = input.LA(1); + if ( LA4_35==EOL||LA4_35==15 ) {return s52;} + if ( LA4_35==26 ) {return s53;} NoViableAltException nvae = - new NoViableAltException("", 4, 32, input); + new NoViableAltException("", 4, 35, input); throw nvae; } }; - DFA.State s81 = new DFA.State() { + DFA.State s60 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { + case 24: + return s50; + case 25: - return s32; + return s35; + case EOL: + case 15: + return s60; + + default: + NoViableAltException nvae = + new NoViableAltException("", 4, 60, input); + + throw nvae; } + } + }; + DFA.State s75 = new DFA.State() { + public DFA.State transition(IntStream input) throws RecognitionException { + switch ( input.LA(1) ) { + case EOL: + case 15: + return s60; + case 24: - return s43; + return s50; + case 25: + return s35; + + case 59: + return s59; + + default: + NoViableAltException nvae = + new NoViableAltException("", 4, 75, input); + + throw nvae; } + } + }; + DFA.State s59 = new DFA.State() { + public DFA.State transition(IntStream input) throws RecognitionException { + int LA4_59 = input.LA(1); + if ( LA4_59==60 ) {return s75;} + + NoViableAltException nvae = + new NoViableAltException("", 4, 59, input); + + throw nvae; + } + }; + DFA.State s102 = new DFA.State() { + public DFA.State transition(IntStream input) throws RecognitionException { + switch ( input.LA(1) ) { + case 25: + return s35; + + case 24: + return s50; + case EOL: case 15: - return s81; + return s102; default: NoViableAltException nvae = - new NoViableAltException("", 4, 81, input); + new NoViableAltException("", 4, 102, input); throw nvae; } } }; - DFA.State s68 = new DFA.State() { + DFA.State s84 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { + case 59: + return s59; + case EOL: case 15: - return s81; + return s102; case 25: - return s32; + return s35; case 24: - return s43; + return s50; default: NoViableAltException nvae = - new NoViableAltException("", 4, 68, input); + new NoViableAltException("", 4, 84, input); throw nvae; } } }; - DFA.State s67 = new DFA.State() { + DFA.State s83 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 25: - return s32; + return s35; case 24: - return s43; + return s50; case EOL: case 15: - return s67; + return s83; case ID: - return s68; + return s84; default: NoViableAltException nvae = - new NoViableAltException("", 4, 67, input); + new NoViableAltException("", 4, 83, input); throw nvae; } } }; - DFA.State s55 = new DFA.State() { + DFA.State s64 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 18: return s16; + case 59: + return s47; + case EOL: case 15: - return s67; + return s83; case ID: - return s68; + return s84; case 25: - return s32; + return s35; case 24: - return s43; + return s50; default: NoViableAltException nvae = - new NoViableAltException("", 4, 55, input); + new NoViableAltException("", 4, 64, input); throw nvae; } } }; - DFA.State s54 = new DFA.State() { + DFA.State s63 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { - int LA4_54 = input.LA(1); - if ( LA4_54==ID ) {return s55;} - if ( LA4_54==EOL||LA4_54==15 ) {return s54;} + int LA4_63 = input.LA(1); + if ( LA4_63==ID ) {return s64;} + if ( LA4_63==EOL||LA4_63==15 ) {return s63;} NoViableAltException nvae = - new NoViableAltException("", 4, 54, input); + new NoViableAltException("", 4, 63, input); throw nvae; } }; - DFA.State s43 = new DFA.State() { + DFA.State s50 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { - int LA4_43 = input.LA(1); - if ( LA4_43==EOL||LA4_43==15 ) {return s54;} - if ( LA4_43==ID ) {return s55;} + int LA4_50 = input.LA(1); + if ( LA4_50==EOL||LA4_50==15 ) {return s63;} + if ( LA4_50==ID ) {return s64;} NoViableAltException nvae = - new NoViableAltException("", 4, 43, input); + new NoViableAltException("", 4, 50, input); throw nvae; } }; - DFA.State s51 = new DFA.State() { + DFA.State s49 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { + case 59: + return s59; + + case EOL: + case 15: + return s60; + case 24: - return s43; + return s50; case 25: - return s32; + return s35; - case EOL: - case 15: - return s51; - default: NoViableAltException nvae = - new NoViableAltException("", 4, 51, input); + new NoViableAltException("", 4, 49, input); throw nvae; } } }; - DFA.State s42 = new DFA.State() { + DFA.State s48 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { + case 24: + return s50; + + case 25: + return s35; + case EOL: case 15: - return s51; + return s48; - case 24: - return s43; + case ID: + return s49; - case 25: - return s32; - default: NoViableAltException nvae = - new NoViableAltException("", 4, 42, input); + new NoViableAltException("", 4, 48, input); throw nvae; } } }; - DFA.State s41 = new DFA.State() { + DFA.State s54 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { - case 24: - return s43; - - case 25: - return s32; - case EOL: case 15: - return s41; + return s48; case ID: - return s42; + return s49; + case 59: + return s47; + + case 24: + return s50; + + case 25: + return s35; + default: NoViableAltException nvae = - new NoViableAltException("", 4, 41, input); + new NoViableAltException("", 4, 54, input); throw nvae; } } }; - DFA.State s31 = new DFA.State() { + DFA.State s47 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { + int LA4_47 = input.LA(1); + if ( LA4_47==60 ) {return s54;} + + NoViableAltException nvae = + new NoViableAltException("", 4, 47, input); + + throw nvae; + } + }; + DFA.State s34 = new DFA.State() { + public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 18: return s16; + case 59: + return s47; + case EOL: case 15: - return s41; + return s48; case ID: - return s42; + return s49; case 24: - return s43; + return s50; case 25: - return s32; + return s35; default: NoViableAltException nvae = - new NoViableAltException("", 4, 31, input); + new NoViableAltException("", 4, 34, input); throw nvae; } } }; - DFA.State s30 = new DFA.State() { + DFA.State s33 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case ID: - return s31; + return s34; case EOL: case 15: - return s30; + return s33; case 25: - return s32; + return s35; default: NoViableAltException nvae = - new NoViableAltException("", 4, 30, input); + new NoViableAltException("", 4, 33, input); throw nvae; } } }; - DFA.State s23 = new DFA.State() { + DFA.State s25 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case EOL: case 15: - return s30; + return s33; case ID: - return s31; + return s34; case 25: - return s32; + return s35; default: NoViableAltException nvae = - new NoViableAltException("", 4, 23, input); + new NoViableAltException("", 4, 25, input); throw nvae; } } }; - DFA.State s28 = new DFA.State() { + DFA.State s31 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { - int LA4_28 = input.LA(1); - if ( LA4_28==23 ) {return s23;} - if ( LA4_28==EOL||LA4_28==15 ) {return s28;} + int LA4_31 = input.LA(1); + if ( LA4_31==23 ) {return s25;} + if ( LA4_31==EOL||LA4_31==15 ) {return s31;} NoViableAltException nvae = - new NoViableAltException("", 4, 28, input); + new NoViableAltException("", 4, 31, input); throw nvae; } }; - DFA.State s22 = new DFA.State() { + DFA.State s24 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { - int LA4_22 = input.LA(1); - if ( LA4_22==EOL||LA4_22==15 ) {return s28;} - if ( LA4_22==23 ) {return s23;} + int LA4_24 = input.LA(1); + if ( LA4_24==EOL||LA4_24==15 ) {return s31;} + if ( LA4_24==23 ) {return s25;} NoViableAltException nvae = - new NoViableAltException("", 4, 22, input); + new NoViableAltException("", 4, 24, input); throw nvae; } }; - DFA.State s21 = new DFA.State() { + DFA.State s23 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case 23: - return s23; + return s25; case EOL: case 15: - return s21; + return s23; case ID: - return s22; + return s24; default: NoViableAltException nvae = - new NoViableAltException("", 4, 21, input); + new NoViableAltException("", 4, 23, input); throw nvae; } } @@ -6401,15 +6643,18 @@ case 18: return s16; + case 59: + return s17; + case EOL: case 15: - return s21; + return s23; case ID: - return s22; + return s24; case 23: - return s23; + return s25; default: NoViableAltException nvae = @@ -6477,20 +6722,20 @@ public int predict(IntStream input) throws RecognitionException { return predict(input, s0); } + DFA.State s5 = new DFA.State() {{alt=1;}}; DFA.State s2 = new DFA.State() {{alt=2;}}; - DFA.State s5 = new DFA.State() {{alt=1;}}; DFA.State s3 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { - case 23: - return s2; + case ID: + return s5; case EOL: case 15: return s3; - case ID: - return s5; + case 23: + return s2; default: NoViableAltException nvae = @@ -6511,6 +6756,7 @@ case ID: case 18: + case 59: return s5; default: @@ -6539,15 +6785,39 @@ } DFA.State s3 = new DFA.State() {{alt=1;}}; DFA.State s2 = new DFA.State() {{alt=2;}}; - DFA.State s4 = new DFA.State() { + DFA.State s5 = new DFA.State() { public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { + case ID: + return s3; + + case EOL: + case 15: + return s5; + case 24: case 25: return s2; + default: + NoViableAltException nvae = + new NoViableAltException("", 13, 5, input); + + throw nvae; } + } + }; + DFA.State s9 = new DFA.State() { + public DFA.State transition(IntStream input) throws RecognitionException { + switch ( input.LA(1) ) { case EOL: case 15: + return s5; + + case 24: + case 25: + return s2; + + case 59: return s4; case ID: @@ -6555,11 +6825,22 @@ default: NoViableAltException nvae = - new NoViableAltException("", 13, 4, input); + new NoViableAltException("", 13, 9, input); throw nvae; } } }; + ... [truncated message content] |