1 | // $ANTLR 3.3 Nov 30, 2010 12:50:56 FELIX.g 2011-08-17 12:18:11 |
2 | |
3 | package felix.parser; |
4 | import tuffy.mln.*; |
5 | import tuffy.util.*; |
6 | import felix.dstruct.*; |
7 | import tuffy.ra.*; |
8 | import felix.util.FelixConfig; |
9 | |
10 | |
11 | import org.antlr.runtime.*; |
12 | import java.util.Stack; |
13 | import java.util.List; |
14 | import java.util.ArrayList; |
15 | import java.util.Map; |
16 | import java.util.HashMap; |
17 | |
18 | import org.antlr.runtime.tree.*; |
19 | |
20 | public class FELIXParser extends Parser { |
21 | public static final String[] tokenNames = new String[] { |
22 | "<invalid>", "<EOR>", "<DOWN>", "<UP>", "WS", "COMMENT", "NOT", "PLUS", "MINUS", "ASTERISK", "PERIOD", "EXIST", "IMPLIES", "ESC", "STRING", "HEXDIGIT", "INTEGER", "FLOAT", "NUMBER", "EXPONENT", "ID", "JDBCDEP", "HDFSDEP", "CODE", "'**'", "'@'", "'('", "','", "')'", "'{'", "'@MAPINIT'", "'}@'", "'@MAP'", "'<xml'", "'>'", "'on'", "'@REDUCEINIT'", "'@REDUCE'", "'}'", "'<~db~'", "'/'", "'FUNCTIONAL DEPENDENCY'", "'FD'", "':'", "';'", "'->'", "'[Label]'", "'[+Label]'", "'[Label+]'", "'#'", "'$'", "':-'", "'['", "']'", "'priorProb'", "'='", "':='", "'~'", "'<='", "'<-'", "'<->'", "'<@'", "'<~'", "'<!-'", "'<CLASS-'", "'<TAG-'", "'<@-'", "'<@='", "'<@~'", "'v'", "'||'", "'OR'", "'&&'", "'AND'", "'NOT'", "'<>'", "'<'", "'>='", "'!='", "'%'", "'&'", "'|'", "'^'", "'<<'", "'>>'" |
23 | }; |
24 | public static final int EOF=-1; |
25 | public static final int T__24=24; |
26 | public static final int T__25=25; |
27 | public static final int T__26=26; |
28 | public static final int T__27=27; |
29 | public static final int T__28=28; |
30 | public static final int T__29=29; |
31 | public static final int T__30=30; |
32 | public static final int T__31=31; |
33 | public static final int T__32=32; |
34 | public static final int T__33=33; |
35 | public static final int T__34=34; |
36 | public static final int T__35=35; |
37 | public static final int T__36=36; |
38 | public static final int T__37=37; |
39 | public static final int T__38=38; |
40 | public static final int T__39=39; |
41 | public static final int T__40=40; |
42 | public static final int T__41=41; |
43 | public static final int T__42=42; |
44 | public static final int T__43=43; |
45 | public static final int T__44=44; |
46 | public static final int T__45=45; |
47 | public static final int T__46=46; |
48 | public static final int T__47=47; |
49 | public static final int T__48=48; |
50 | public static final int T__49=49; |
51 | public static final int T__50=50; |
52 | public static final int T__51=51; |
53 | public static final int T__52=52; |
54 | public static final int T__53=53; |
55 | public static final int T__54=54; |
56 | public static final int T__55=55; |
57 | public static final int T__56=56; |
58 | public static final int T__57=57; |
59 | public static final int T__58=58; |
60 | public static final int T__59=59; |
61 | public static final int T__60=60; |
62 | public static final int T__61=61; |
63 | public static final int T__62=62; |
64 | public static final int T__63=63; |
65 | public static final int T__64=64; |
66 | public static final int T__65=65; |
67 | public static final int T__66=66; |
68 | public static final int T__67=67; |
69 | public static final int T__68=68; |
70 | public static final int T__69=69; |
71 | public static final int T__70=70; |
72 | public static final int T__71=71; |
73 | public static final int T__72=72; |
74 | public static final int T__73=73; |
75 | public static final int T__74=74; |
76 | public static final int T__75=75; |
77 | public static final int T__76=76; |
78 | public static final int T__77=77; |
79 | public static final int T__78=78; |
80 | public static final int T__79=79; |
81 | public static final int T__80=80; |
82 | public static final int T__81=81; |
83 | public static final int T__82=82; |
84 | public static final int T__83=83; |
85 | public static final int T__84=84; |
86 | public static final int WS=4; |
87 | public static final int COMMENT=5; |
88 | public static final int NOT=6; |
89 | public static final int PLUS=7; |
90 | public static final int MINUS=8; |
91 | public static final int ASTERISK=9; |
92 | public static final int PERIOD=10; |
93 | public static final int EXIST=11; |
94 | public static final int IMPLIES=12; |
95 | public static final int ESC=13; |
96 | public static final int STRING=14; |
97 | public static final int HEXDIGIT=15; |
98 | public static final int INTEGER=16; |
99 | public static final int FLOAT=17; |
100 | public static final int NUMBER=18; |
101 | public static final int EXPONENT=19; |
102 | public static final int ID=20; |
103 | public static final int JDBCDEP=21; |
104 | public static final int HDFSDEP=22; |
105 | public static final int CODE=23; |
106 | |
107 | // delegates |
108 | // delegators |
109 | |
110 | |
111 | public FELIXParser(TokenStream input) { |
112 | this(input, new RecognizerSharedState()); |
113 | } |
114 | public FELIXParser(TokenStream input, RecognizerSharedState state) { |
115 | super(input, state); |
116 | this.state.ruleMemo = new HashMap[165+1]; |
117 | |
118 | |
119 | } |
120 | |
121 | protected TreeAdaptor adaptor = new CommonTreeAdaptor(); |
122 | |
123 | public void setTreeAdaptor(TreeAdaptor adaptor) { |
124 | this.adaptor = adaptor; |
125 | } |
126 | public TreeAdaptor getTreeAdaptor() { |
127 | return adaptor; |
128 | } |
129 | |
130 | public String[] getTokenNames() { return FELIXParser.tokenNames; } |
131 | public String getGrammarFileName() { return "FELIX.g"; } |
132 | |
133 | |
134 | FelixQuery ml; |
135 | private String clauseName = null; |
136 | private boolean clauseLabelTrailing = false; |
137 | private FelixPredicate curPred = null; |
138 | |
139 | public long lineOffset = 0; |
140 | |
141 | private void die(String msg) { |
142 | ExceptionMan.die(msg); |
143 | } |
144 | |
145 | protected Object recoverFromMismatchedToken(IntStream input, int ttype, |
146 | BitSet follow) throws RecognitionException { |
147 | throw new MismatchedTokenException(ttype, input); |
148 | } |
149 | |
150 | public void emitErrorMessage(String msg) { |
151 | die(msg); |
152 | } |
153 | |
154 | |
155 | public static class definitions_return extends ParserRuleReturnScope { |
156 | Object tree; |
157 | public Object getTree() { return tree; } |
158 | }; |
159 | |
160 | // $ANTLR start "definitions" |
161 | // FELIX.g:322:1: definitions : schemaList ruleList EOF ; |
162 | public final FELIXParser.definitions_return definitions() throws RecognitionException { |
163 | FELIXParser.definitions_return retval = new FELIXParser.definitions_return(); |
164 | retval.start = input.LT(1); |
165 | int definitions_StartIndex = input.index(); |
166 | Object root_0 = null; |
167 | |
168 | Token EOF3=null; |
169 | FELIXParser.schemaList_return schemaList1 = null; |
170 | |
171 | FELIXParser.ruleList_return ruleList2 = null; |
172 | |
173 | |
174 | Object EOF3_tree=null; |
175 | |
176 | try { |
177 | if ( state.backtracking>0 && alreadyParsedRule(input, 1) ) { return retval; } |
178 | // FELIX.g:323:3: ( schemaList ruleList EOF ) |
179 | // FELIX.g:324:3: schemaList ruleList EOF |
180 | { |
181 | root_0 = (Object)adaptor.nil(); |
182 | |
183 | pushFollow(FOLLOW_schemaList_in_definitions1617); |
184 | schemaList1=schemaList(); |
185 | |
186 | state._fsp--; |
187 | if (state.failed) return retval; |
188 | if ( state.backtracking==0 ) adaptor.addChild(root_0, schemaList1.getTree()); |
189 | pushFollow(FOLLOW_ruleList_in_definitions1619); |
190 | ruleList2=ruleList(); |
191 | |
192 | state._fsp--; |
193 | if (state.failed) return retval; |
194 | if ( state.backtracking==0 ) adaptor.addChild(root_0, ruleList2.getTree()); |
195 | EOF3=(Token)match(input,EOF,FOLLOW_EOF_in_definitions1621); if (state.failed) return retval; |
196 | if ( state.backtracking==0 ) { |
197 | EOF3_tree = (Object)adaptor.create(EOF3); |
198 | adaptor.addChild(root_0, EOF3_tree); |
199 | } |
200 | |
201 | } |
202 | |
203 | retval.stop = input.LT(-1); |
204 | |
205 | if ( state.backtracking==0 ) { |
206 | |
207 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
208 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
209 | } |
210 | } |
211 | catch (RecognitionException re) { |
212 | reportError(re); |
213 | recover(input,re); |
214 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
215 | |
216 | } |
217 | finally { |
218 | if ( state.backtracking>0 ) { memoize(input, 1, definitions_StartIndex); } |
219 | } |
220 | return retval; |
221 | } |
222 | // $ANTLR end "definitions" |
223 | |
224 | public static class schemaList_return extends ParserRuleReturnScope { |
225 | Object tree; |
226 | public Object getTree() { return tree; } |
227 | }; |
228 | |
229 | // $ANTLR start "schemaList" |
230 | // FELIX.g:327:1: schemaList : ( schema | schemaConstraint )* ; |
231 | public final FELIXParser.schemaList_return schemaList() throws RecognitionException { |
232 | FELIXParser.schemaList_return retval = new FELIXParser.schemaList_return(); |
233 | retval.start = input.LT(1); |
234 | int schemaList_StartIndex = input.index(); |
235 | Object root_0 = null; |
236 | |
237 | FELIXParser.schema_return schema4 = null; |
238 | |
239 | FELIXParser.schemaConstraint_return schemaConstraint5 = null; |
240 | |
241 | |
242 | |
243 | try { |
244 | if ( state.backtracking>0 && alreadyParsedRule(input, 2) ) { return retval; } |
245 | // FELIX.g:328:3: ( ( schema | schemaConstraint )* ) |
246 | // FELIX.g:329:3: ( schema | schemaConstraint )* |
247 | { |
248 | root_0 = (Object)adaptor.nil(); |
249 | |
250 | // FELIX.g:329:3: ( schema | schemaConstraint )* |
251 | loop1: |
252 | do { |
253 | int alt1=3; |
254 | alt1 = dfa1.predict(input); |
255 | switch (alt1) { |
256 | case 1 : |
257 | // FELIX.g:330:5: schema |
258 | { |
259 | pushFollow(FOLLOW_schema_in_schemaList1642); |
260 | schema4=schema(); |
261 | |
262 | state._fsp--; |
263 | if (state.failed) return retval; |
264 | if ( state.backtracking==0 ) adaptor.addChild(root_0, schema4.getTree()); |
265 | |
266 | } |
267 | break; |
268 | case 2 : |
269 | // FELIX.g:331:7: schemaConstraint |
270 | { |
271 | pushFollow(FOLLOW_schemaConstraint_in_schemaList1650); |
272 | schemaConstraint5=schemaConstraint(); |
273 | |
274 | state._fsp--; |
275 | if (state.failed) return retval; |
276 | if ( state.backtracking==0 ) adaptor.addChild(root_0, schemaConstraint5.getTree()); |
277 | |
278 | } |
279 | break; |
280 | |
281 | default : |
282 | break loop1; |
283 | } |
284 | } while (true); |
285 | |
286 | |
287 | } |
288 | |
289 | retval.stop = input.LT(-1); |
290 | |
291 | if ( state.backtracking==0 ) { |
292 | |
293 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
294 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
295 | } |
296 | } |
297 | catch (RecognitionException re) { |
298 | reportError(re); |
299 | recover(input,re); |
300 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
301 | |
302 | } |
303 | finally { |
304 | if ( state.backtracking>0 ) { memoize(input, 2, schemaList_StartIndex); } |
305 | } |
306 | return retval; |
307 | } |
308 | // $ANTLR end "schemaList" |
309 | |
310 | public static class schema_return extends ParserRuleReturnScope { |
311 | Object tree; |
312 | public Object getTree() { return tree; } |
313 | }; |
314 | |
315 | // $ANTLR start "schema" |
316 | // FELIX.g:335:1: schema : (du= '+' )? (aa= '**' | a1= ASTERISK )? (vt= '@' )? pname= ID (a2= ASTERISK )? '(' types+= predArg ( ',' types+= predArg )* ')' ( (dep= HDFSDEP )? (jdbcdep= JDBCDEP )? '{' ( '@MAPINIT' '{' (mapinit+= CODE )+ '}@' )? ( '@MAP' ( '<xml' xmltag= ID '>' )? ( 'on' mapinput= ID )? '{' (maps+= CODE )+ '}@' )? ( '@REDUCEINIT' '{' (reduceinit+= CODE )+ '}@' )? ( '@REDUCE' ( 'on' '(' reducekey= ID ',' reducevalue= ID ')' )? '{' (reduces+= CODE )+ '}@' )? '}' )? ( '<~db~' dbschema= ID '/' dbtable= ID )? ; |
317 | public final FELIXParser.schema_return schema() throws RecognitionException { |
318 | FELIXParser.schema_return retval = new FELIXParser.schema_return(); |
319 | retval.start = input.LT(1); |
320 | int schema_StartIndex = input.index(); |
321 | Object root_0 = null; |
322 | |
323 | Token du=null; |
324 | Token aa=null; |
325 | Token a1=null; |
326 | Token vt=null; |
327 | Token pname=null; |
328 | Token a2=null; |
329 | Token dep=null; |
330 | Token jdbcdep=null; |
331 | Token xmltag=null; |
332 | Token mapinput=null; |
333 | Token reducekey=null; |
334 | Token reducevalue=null; |
335 | Token dbschema=null; |
336 | Token dbtable=null; |
337 | Token char_literal6=null; |
338 | Token char_literal7=null; |
339 | Token char_literal8=null; |
340 | Token char_literal9=null; |
341 | Token string_literal10=null; |
342 | Token char_literal11=null; |
343 | Token string_literal12=null; |
344 | Token string_literal13=null; |
345 | Token string_literal14=null; |
346 | Token char_literal15=null; |
347 | Token string_literal16=null; |
348 | Token char_literal17=null; |
349 | Token string_literal18=null; |
350 | Token string_literal19=null; |
351 | Token char_literal20=null; |
352 | Token string_literal21=null; |
353 | Token string_literal22=null; |
354 | Token string_literal23=null; |
355 | Token char_literal24=null; |
356 | Token char_literal25=null; |
357 | Token char_literal26=null; |
358 | Token char_literal27=null; |
359 | Token string_literal28=null; |
360 | Token char_literal29=null; |
361 | Token string_literal30=null; |
362 | Token char_literal31=null; |
363 | Token mapinit=null; |
364 | Token maps=null; |
365 | Token reduceinit=null; |
366 | Token reduces=null; |
367 | List list_mapinit=null; |
368 | List list_maps=null; |
369 | List list_reduceinit=null; |
370 | List list_reduces=null; |
371 | List list_types=null; |
372 | RuleReturnScope types = null; |
373 | Object du_tree=null; |
374 | Object aa_tree=null; |
375 | Object a1_tree=null; |
376 | Object vt_tree=null; |
377 | Object pname_tree=null; |
378 | Object a2_tree=null; |
379 | Object dep_tree=null; |
380 | Object jdbcdep_tree=null; |
381 | Object xmltag_tree=null; |
382 | Object mapinput_tree=null; |
383 | Object reducekey_tree=null; |
384 | Object reducevalue_tree=null; |
385 | Object dbschema_tree=null; |
386 | Object dbtable_tree=null; |
387 | Object char_literal6_tree=null; |
388 | Object char_literal7_tree=null; |
389 | Object char_literal8_tree=null; |
390 | Object char_literal9_tree=null; |
391 | Object string_literal10_tree=null; |
392 | Object char_literal11_tree=null; |
393 | Object string_literal12_tree=null; |
394 | Object string_literal13_tree=null; |
395 | Object string_literal14_tree=null; |
396 | Object char_literal15_tree=null; |
397 | Object string_literal16_tree=null; |
398 | Object char_literal17_tree=null; |
399 | Object string_literal18_tree=null; |
400 | Object string_literal19_tree=null; |
401 | Object char_literal20_tree=null; |
402 | Object string_literal21_tree=null; |
403 | Object string_literal22_tree=null; |
404 | Object string_literal23_tree=null; |
405 | Object char_literal24_tree=null; |
406 | Object char_literal25_tree=null; |
407 | Object char_literal26_tree=null; |
408 | Object char_literal27_tree=null; |
409 | Object string_literal28_tree=null; |
410 | Object char_literal29_tree=null; |
411 | Object string_literal30_tree=null; |
412 | Object char_literal31_tree=null; |
413 | Object mapinit_tree=null; |
414 | Object maps_tree=null; |
415 | Object reduceinit_tree=null; |
416 | Object reduces_tree=null; |
417 | |
418 | try { |
419 | if ( state.backtracking>0 && alreadyParsedRule(input, 3) ) { return retval; } |
420 | // FELIX.g:336:3: ( (du= '+' )? (aa= '**' | a1= ASTERISK )? (vt= '@' )? pname= ID (a2= ASTERISK )? '(' types+= predArg ( ',' types+= predArg )* ')' ( (dep= HDFSDEP )? (jdbcdep= JDBCDEP )? '{' ( '@MAPINIT' '{' (mapinit+= CODE )+ '}@' )? ( '@MAP' ( '<xml' xmltag= ID '>' )? ( 'on' mapinput= ID )? '{' (maps+= CODE )+ '}@' )? ( '@REDUCEINIT' '{' (reduceinit+= CODE )+ '}@' )? ( '@REDUCE' ( 'on' '(' reducekey= ID ',' reducevalue= ID ')' )? '{' (reduces+= CODE )+ '}@' )? '}' )? ( '<~db~' dbschema= ID '/' dbtable= ID )? ) |
421 | // FELIX.g:337:3: (du= '+' )? (aa= '**' | a1= ASTERISK )? (vt= '@' )? pname= ID (a2= ASTERISK )? '(' types+= predArg ( ',' types+= predArg )* ')' ( (dep= HDFSDEP )? (jdbcdep= JDBCDEP )? '{' ( '@MAPINIT' '{' (mapinit+= CODE )+ '}@' )? ( '@MAP' ( '<xml' xmltag= ID '>' )? ( 'on' mapinput= ID )? '{' (maps+= CODE )+ '}@' )? ( '@REDUCEINIT' '{' (reduceinit+= CODE )+ '}@' )? ( '@REDUCE' ( 'on' '(' reducekey= ID ',' reducevalue= ID ')' )? '{' (reduces+= CODE )+ '}@' )? '}' )? ( '<~db~' dbschema= ID '/' dbtable= ID )? |
422 | { |
423 | root_0 = (Object)adaptor.nil(); |
424 | |
425 | // FELIX.g:337:3: (du= '+' )? |
426 | int alt2=2; |
427 | int LA2_0 = input.LA(1); |
428 | |
429 | if ( (LA2_0==PLUS) ) { |
430 | alt2=1; |
431 | } |
432 | switch (alt2) { |
433 | case 1 : |
434 | // FELIX.g:337:4: du= '+' |
435 | { |
436 | du=(Token)match(input,PLUS,FOLLOW_PLUS_in_schema1673); if (state.failed) return retval; |
437 | if ( state.backtracking==0 ) { |
438 | du_tree = (Object)adaptor.create(du); |
439 | adaptor.addChild(root_0, du_tree); |
440 | } |
441 | |
442 | } |
443 | break; |
444 | |
445 | } |
446 | |
447 | // FELIX.g:338:3: (aa= '**' | a1= ASTERISK )? |
448 | int alt3=3; |
449 | int LA3_0 = input.LA(1); |
450 | |
451 | if ( (LA3_0==24) ) { |
452 | alt3=1; |
453 | } |
454 | else if ( (LA3_0==ASTERISK) ) { |
455 | alt3=2; |
456 | } |
457 | switch (alt3) { |
458 | case 1 : |
459 | // FELIX.g:339:5: aa= '**' |
460 | { |
461 | aa=(Token)match(input,24,FOLLOW_24_in_schema1687); if (state.failed) return retval; |
462 | if ( state.backtracking==0 ) { |
463 | aa_tree = (Object)adaptor.create(aa); |
464 | adaptor.addChild(root_0, aa_tree); |
465 | } |
466 | |
467 | } |
468 | break; |
469 | case 2 : |
470 | // FELIX.g:340:7: a1= ASTERISK |
471 | { |
472 | a1=(Token)match(input,ASTERISK,FOLLOW_ASTERISK_in_schema1697); if (state.failed) return retval; |
473 | if ( state.backtracking==0 ) { |
474 | a1_tree = (Object)adaptor.create(a1); |
475 | adaptor.addChild(root_0, a1_tree); |
476 | } |
477 | |
478 | } |
479 | break; |
480 | |
481 | } |
482 | |
483 | // FELIX.g:342:3: (vt= '@' )? |
484 | int alt4=2; |
485 | int LA4_0 = input.LA(1); |
486 | |
487 | if ( (LA4_0==25) ) { |
488 | alt4=1; |
489 | } |
490 | switch (alt4) { |
491 | case 1 : |
492 | // FELIX.g:342:4: vt= '@' |
493 | { |
494 | vt=(Token)match(input,25,FOLLOW_25_in_schema1709); if (state.failed) return retval; |
495 | if ( state.backtracking==0 ) { |
496 | vt_tree = (Object)adaptor.create(vt); |
497 | adaptor.addChild(root_0, vt_tree); |
498 | } |
499 | |
500 | } |
501 | break; |
502 | |
503 | } |
504 | |
505 | pname=(Token)match(input,ID,FOLLOW_ID_in_schema1715); if (state.failed) return retval; |
506 | if ( state.backtracking==0 ) { |
507 | pname_tree = (Object)adaptor.create(pname); |
508 | adaptor.addChild(root_0, pname_tree); |
509 | } |
510 | // FELIX.g:342:24: (a2= ASTERISK )? |
511 | int alt5=2; |
512 | int LA5_0 = input.LA(1); |
513 | |
514 | if ( (LA5_0==ASTERISK) ) { |
515 | alt5=1; |
516 | } |
517 | switch (alt5) { |
518 | case 1 : |
519 | // FELIX.g:0:0: a2= ASTERISK |
520 | { |
521 | a2=(Token)match(input,ASTERISK,FOLLOW_ASTERISK_in_schema1719); if (state.failed) return retval; |
522 | if ( state.backtracking==0 ) { |
523 | a2_tree = (Object)adaptor.create(a2); |
524 | adaptor.addChild(root_0, a2_tree); |
525 | } |
526 | |
527 | } |
528 | break; |
529 | |
530 | } |
531 | |
532 | if ( state.backtracking==0 ) { |
533 | |
534 | boolean cwa = (a1 != null || aa != null); |
535 | boolean eqrel = (a2 != null); |
536 | //Predicate pred = new Predicate(ml, (pname!=null?pname.getText():null), cwa); |
537 | FelixPredicate pred = new FelixPredicate((pname!=null?pname.getText():null), cwa); |
538 | if (aa != null) |
539 | pred.setCompeletelySpecified(true); |
540 | //if(eqrel) pred.isDedupalogHead = true; |
541 | //if(vt != null){ |
542 | // if((vt!=null?vt.getText():null).equals("@")) pred.isInMem = true; |
543 | //} |
544 | //if(du != null){ |
545 | // if((du!=null?du.getText():null).equals("+")) pred.toDump = true; |
546 | //} |
547 | curPred = pred; |
548 | |
549 | } |
550 | char_literal6=(Token)match(input,26,FOLLOW_26_in_schema1761); if (state.failed) return retval; |
551 | if ( state.backtracking==0 ) { |
552 | char_literal6_tree = (Object)adaptor.create(char_literal6); |
553 | adaptor.addChild(root_0, char_literal6_tree); |
554 | } |
555 | pushFollow(FOLLOW_predArg_in_schema1765); |
556 | types=predArg(); |
557 | |
558 | state._fsp--; |
559 | if (state.failed) return retval; |
560 | if ( state.backtracking==0 ) adaptor.addChild(root_0, types.getTree()); |
561 | if (list_types==null) list_types=new ArrayList(); |
562 | list_types.add(types.getTree()); |
563 | |
564 | // FELIX.g:359:22: ( ',' types+= predArg )* |
565 | loop6: |
566 | do { |
567 | int alt6=2; |
568 | int LA6_0 = input.LA(1); |
569 | |
570 | if ( (LA6_0==27) ) { |
571 | alt6=1; |
572 | } |
573 | |
574 | |
575 | switch (alt6) { |
576 | case 1 : |
577 | // FELIX.g:359:23: ',' types+= predArg |
578 | { |
579 | char_literal7=(Token)match(input,27,FOLLOW_27_in_schema1768); if (state.failed) return retval; |
580 | if ( state.backtracking==0 ) { |
581 | char_literal7_tree = (Object)adaptor.create(char_literal7); |
582 | adaptor.addChild(root_0, char_literal7_tree); |
583 | } |
584 | pushFollow(FOLLOW_predArg_in_schema1772); |
585 | types=predArg(); |
586 | |
587 | state._fsp--; |
588 | if (state.failed) return retval; |
589 | if ( state.backtracking==0 ) adaptor.addChild(root_0, types.getTree()); |
590 | if (list_types==null) list_types=new ArrayList(); |
591 | list_types.add(types.getTree()); |
592 | |
593 | |
594 | } |
595 | break; |
596 | |
597 | default : |
598 | break loop6; |
599 | } |
600 | } while (true); |
601 | |
602 | char_literal8=(Token)match(input,28,FOLLOW_28_in_schema1776); if (state.failed) return retval; |
603 | if ( state.backtracking==0 ) { |
604 | char_literal8_tree = (Object)adaptor.create(char_literal8); |
605 | adaptor.addChild(root_0, char_literal8_tree); |
606 | } |
607 | // FELIX.g:360:3: ( (dep= HDFSDEP )? (jdbcdep= JDBCDEP )? '{' ( '@MAPINIT' '{' (mapinit+= CODE )+ '}@' )? ( '@MAP' ( '<xml' xmltag= ID '>' )? ( 'on' mapinput= ID )? '{' (maps+= CODE )+ '}@' )? ( '@REDUCEINIT' '{' (reduceinit+= CODE )+ '}@' )? ( '@REDUCE' ( 'on' '(' reducekey= ID ',' reducevalue= ID ')' )? '{' (reduces+= CODE )+ '}@' )? '}' )? |
608 | int alt20=2; |
609 | int LA20_0 = input.LA(1); |
610 | |
611 | if ( ((LA20_0>=JDBCDEP && LA20_0<=HDFSDEP)||LA20_0==29) ) { |
612 | alt20=1; |
613 | } |
614 | switch (alt20) { |
615 | case 1 : |
616 | // FELIX.g:361:5: (dep= HDFSDEP )? (jdbcdep= JDBCDEP )? '{' ( '@MAPINIT' '{' (mapinit+= CODE )+ '}@' )? ( '@MAP' ( '<xml' xmltag= ID '>' )? ( 'on' mapinput= ID )? '{' (maps+= CODE )+ '}@' )? ( '@REDUCEINIT' '{' (reduceinit+= CODE )+ '}@' )? ( '@REDUCE' ( 'on' '(' reducekey= ID ',' reducevalue= ID ')' )? '{' (reduces+= CODE )+ '}@' )? '}' |
617 | { |
618 | // FELIX.g:361:5: (dep= HDFSDEP )? |
619 | int alt7=2; |
620 | int LA7_0 = input.LA(1); |
621 | |
622 | if ( (LA7_0==HDFSDEP) ) { |
623 | alt7=1; |
624 | } |
625 | switch (alt7) { |
626 | case 1 : |
627 | // FELIX.g:361:6: dep= HDFSDEP |
628 | { |
629 | dep=(Token)match(input,HDFSDEP,FOLLOW_HDFSDEP_in_schema1789); if (state.failed) return retval; |
630 | if ( state.backtracking==0 ) { |
631 | dep_tree = (Object)adaptor.create(dep); |
632 | adaptor.addChild(root_0, dep_tree); |
633 | } |
634 | |
635 | } |
636 | break; |
637 | |
638 | } |
639 | |
640 | // FELIX.g:361:20: (jdbcdep= JDBCDEP )? |
641 | int alt8=2; |
642 | int LA8_0 = input.LA(1); |
643 | |
644 | if ( (LA8_0==JDBCDEP) ) { |
645 | alt8=1; |
646 | } |
647 | switch (alt8) { |
648 | case 1 : |
649 | // FELIX.g:361:21: jdbcdep= JDBCDEP |
650 | { |
651 | jdbcdep=(Token)match(input,JDBCDEP,FOLLOW_JDBCDEP_in_schema1796); if (state.failed) return retval; |
652 | if ( state.backtracking==0 ) { |
653 | jdbcdep_tree = (Object)adaptor.create(jdbcdep); |
654 | adaptor.addChild(root_0, jdbcdep_tree); |
655 | } |
656 | |
657 | } |
658 | break; |
659 | |
660 | } |
661 | |
662 | char_literal9=(Token)match(input,29,FOLLOW_29_in_schema1800); if (state.failed) return retval; |
663 | if ( state.backtracking==0 ) { |
664 | char_literal9_tree = (Object)adaptor.create(char_literal9); |
665 | adaptor.addChild(root_0, char_literal9_tree); |
666 | } |
667 | // FELIX.g:361:43: ( '@MAPINIT' '{' (mapinit+= CODE )+ '}@' )? |
668 | int alt10=2; |
669 | int LA10_0 = input.LA(1); |
670 | |
671 | if ( (LA10_0==30) ) { |
672 | alt10=1; |
673 | } |
674 | switch (alt10) { |
675 | case 1 : |
676 | // FELIX.g:361:44: '@MAPINIT' '{' (mapinit+= CODE )+ '}@' |
677 | { |
678 | string_literal10=(Token)match(input,30,FOLLOW_30_in_schema1803); if (state.failed) return retval; |
679 | if ( state.backtracking==0 ) { |
680 | string_literal10_tree = (Object)adaptor.create(string_literal10); |
681 | adaptor.addChild(root_0, string_literal10_tree); |
682 | } |
683 | char_literal11=(Token)match(input,29,FOLLOW_29_in_schema1805); if (state.failed) return retval; |
684 | if ( state.backtracking==0 ) { |
685 | char_literal11_tree = (Object)adaptor.create(char_literal11); |
686 | adaptor.addChild(root_0, char_literal11_tree); |
687 | } |
688 | // FELIX.g:361:59: (mapinit+= CODE )+ |
689 | int cnt9=0; |
690 | loop9: |
691 | do { |
692 | int alt9=2; |
693 | int LA9_0 = input.LA(1); |
694 | |
695 | if ( (LA9_0==CODE) ) { |
696 | alt9=1; |
697 | } |
698 | |
699 | |
700 | switch (alt9) { |
701 | case 1 : |
702 | // FELIX.g:361:60: mapinit+= CODE |
703 | { |
704 | mapinit=(Token)match(input,CODE,FOLLOW_CODE_in_schema1810); if (state.failed) return retval; |
705 | if ( state.backtracking==0 ) { |
706 | mapinit_tree = (Object)adaptor.create(mapinit); |
707 | adaptor.addChild(root_0, mapinit_tree); |
708 | } |
709 | if (list_mapinit==null) list_mapinit=new ArrayList(); |
710 | list_mapinit.add(mapinit); |
711 | |
712 | |
713 | } |
714 | break; |
715 | |
716 | default : |
717 | if ( cnt9 >= 1 ) break loop9; |
718 | if (state.backtracking>0) {state.failed=true; return retval;} |
719 | EarlyExitException eee = |
720 | new EarlyExitException(9, input); |
721 | throw eee; |
722 | } |
723 | cnt9++; |
724 | } while (true); |
725 | |
726 | string_literal12=(Token)match(input,31,FOLLOW_31_in_schema1814); if (state.failed) return retval; |
727 | if ( state.backtracking==0 ) { |
728 | string_literal12_tree = (Object)adaptor.create(string_literal12); |
729 | adaptor.addChild(root_0, string_literal12_tree); |
730 | } |
731 | |
732 | } |
733 | break; |
734 | |
735 | } |
736 | |
737 | // FELIX.g:362:5: ( '@MAP' ( '<xml' xmltag= ID '>' )? ( 'on' mapinput= ID )? '{' (maps+= CODE )+ '}@' )? |
738 | int alt14=2; |
739 | int LA14_0 = input.LA(1); |
740 | |
741 | if ( (LA14_0==32) ) { |
742 | alt14=1; |
743 | } |
744 | switch (alt14) { |
745 | case 1 : |
746 | // FELIX.g:363:7: '@MAP' ( '<xml' xmltag= ID '>' )? ( 'on' mapinput= ID )? '{' (maps+= CODE )+ '}@' |
747 | { |
748 | string_literal13=(Token)match(input,32,FOLLOW_32_in_schema1830); if (state.failed) return retval; |
749 | if ( state.backtracking==0 ) { |
750 | string_literal13_tree = (Object)adaptor.create(string_literal13); |
751 | adaptor.addChild(root_0, string_literal13_tree); |
752 | } |
753 | // FELIX.g:363:14: ( '<xml' xmltag= ID '>' )? |
754 | int alt11=2; |
755 | int LA11_0 = input.LA(1); |
756 | |
757 | if ( (LA11_0==33) ) { |
758 | alt11=1; |
759 | } |
760 | switch (alt11) { |
761 | case 1 : |
762 | // FELIX.g:363:15: '<xml' xmltag= ID '>' |
763 | { |
764 | string_literal14=(Token)match(input,33,FOLLOW_33_in_schema1833); if (state.failed) return retval; |
765 | if ( state.backtracking==0 ) { |
766 | string_literal14_tree = (Object)adaptor.create(string_literal14); |
767 | adaptor.addChild(root_0, string_literal14_tree); |
768 | } |
769 | xmltag=(Token)match(input,ID,FOLLOW_ID_in_schema1837); if (state.failed) return retval; |
770 | if ( state.backtracking==0 ) { |
771 | xmltag_tree = (Object)adaptor.create(xmltag); |
772 | adaptor.addChild(root_0, xmltag_tree); |
773 | } |
774 | char_literal15=(Token)match(input,34,FOLLOW_34_in_schema1839); if (state.failed) return retval; |
775 | if ( state.backtracking==0 ) { |
776 | char_literal15_tree = (Object)adaptor.create(char_literal15); |
777 | adaptor.addChild(root_0, char_literal15_tree); |
778 | } |
779 | |
780 | } |
781 | break; |
782 | |
783 | } |
784 | |
785 | // FELIX.g:363:38: ( 'on' mapinput= ID )? |
786 | int alt12=2; |
787 | int LA12_0 = input.LA(1); |
788 | |
789 | if ( (LA12_0==35) ) { |
790 | alt12=1; |
791 | } |
792 | switch (alt12) { |
793 | case 1 : |
794 | // FELIX.g:363:39: 'on' mapinput= ID |
795 | { |
796 | string_literal16=(Token)match(input,35,FOLLOW_35_in_schema1844); if (state.failed) return retval; |
797 | if ( state.backtracking==0 ) { |
798 | string_literal16_tree = (Object)adaptor.create(string_literal16); |
799 | adaptor.addChild(root_0, string_literal16_tree); |
800 | } |
801 | mapinput=(Token)match(input,ID,FOLLOW_ID_in_schema1848); if (state.failed) return retval; |
802 | if ( state.backtracking==0 ) { |
803 | mapinput_tree = (Object)adaptor.create(mapinput); |
804 | adaptor.addChild(root_0, mapinput_tree); |
805 | } |
806 | |
807 | } |
808 | break; |
809 | |
810 | } |
811 | |
812 | char_literal17=(Token)match(input,29,FOLLOW_29_in_schema1852); if (state.failed) return retval; |
813 | if ( state.backtracking==0 ) { |
814 | char_literal17_tree = (Object)adaptor.create(char_literal17); |
815 | adaptor.addChild(root_0, char_literal17_tree); |
816 | } |
817 | // FELIX.g:363:62: (maps+= CODE )+ |
818 | int cnt13=0; |
819 | loop13: |
820 | do { |
821 | int alt13=2; |
822 | int LA13_0 = input.LA(1); |
823 | |
824 | if ( (LA13_0==CODE) ) { |
825 | alt13=1; |
826 | } |
827 | |
828 | |
829 | switch (alt13) { |
830 | case 1 : |
831 | // FELIX.g:363:63: maps+= CODE |
832 | { |
833 | maps=(Token)match(input,CODE,FOLLOW_CODE_in_schema1857); if (state.failed) return retval; |
834 | if ( state.backtracking==0 ) { |
835 | maps_tree = (Object)adaptor.create(maps); |
836 | adaptor.addChild(root_0, maps_tree); |
837 | } |
838 | if (list_maps==null) list_maps=new ArrayList(); |
839 | list_maps.add(maps); |
840 | |
841 | |
842 | } |
843 | break; |
844 | |
845 | default : |
846 | if ( cnt13 >= 1 ) break loop13; |
847 | if (state.backtracking>0) {state.failed=true; return retval;} |
848 | EarlyExitException eee = |
849 | new EarlyExitException(13, input); |
850 | throw eee; |
851 | } |
852 | cnt13++; |
853 | } while (true); |
854 | |
855 | string_literal18=(Token)match(input,31,FOLLOW_31_in_schema1861); if (state.failed) return retval; |
856 | if ( state.backtracking==0 ) { |
857 | string_literal18_tree = (Object)adaptor.create(string_literal18); |
858 | adaptor.addChild(root_0, string_literal18_tree); |
859 | } |
860 | |
861 | } |
862 | break; |
863 | |
864 | } |
865 | |
866 | // FELIX.g:365:5: ( '@REDUCEINIT' '{' (reduceinit+= CODE )+ '}@' )? |
867 | int alt16=2; |
868 | int LA16_0 = input.LA(1); |
869 | |
870 | if ( (LA16_0==36) ) { |
871 | alt16=1; |
872 | } |
873 | switch (alt16) { |
874 | case 1 : |
875 | // FELIX.g:365:6: '@REDUCEINIT' '{' (reduceinit+= CODE )+ '}@' |
876 | { |
877 | string_literal19=(Token)match(input,36,FOLLOW_36_in_schema1875); if (state.failed) return retval; |
878 | if ( state.backtracking==0 ) { |
879 | string_literal19_tree = (Object)adaptor.create(string_literal19); |
880 | adaptor.addChild(root_0, string_literal19_tree); |
881 | } |
882 | char_literal20=(Token)match(input,29,FOLLOW_29_in_schema1877); if (state.failed) return retval; |
883 | if ( state.backtracking==0 ) { |
884 | char_literal20_tree = (Object)adaptor.create(char_literal20); |
885 | adaptor.addChild(root_0, char_literal20_tree); |
886 | } |
887 | // FELIX.g:365:24: (reduceinit+= CODE )+ |
888 | int cnt15=0; |
889 | loop15: |
890 | do { |
891 | int alt15=2; |
892 | int LA15_0 = input.LA(1); |
893 | |
894 | if ( (LA15_0==CODE) ) { |
895 | alt15=1; |
896 | } |
897 | |
898 | |
899 | switch (alt15) { |
900 | case 1 : |
901 | // FELIX.g:365:25: reduceinit+= CODE |
902 | { |
903 | reduceinit=(Token)match(input,CODE,FOLLOW_CODE_in_schema1882); if (state.failed) return retval; |
904 | if ( state.backtracking==0 ) { |
905 | reduceinit_tree = (Object)adaptor.create(reduceinit); |
906 | adaptor.addChild(root_0, reduceinit_tree); |
907 | } |
908 | if (list_reduceinit==null) list_reduceinit=new ArrayList(); |
909 | list_reduceinit.add(reduceinit); |
910 | |
911 | |
912 | } |
913 | break; |
914 | |
915 | default : |
916 | if ( cnt15 >= 1 ) break loop15; |
917 | if (state.backtracking>0) {state.failed=true; return retval;} |
918 | EarlyExitException eee = |
919 | new EarlyExitException(15, input); |
920 | throw eee; |
921 | } |
922 | cnt15++; |
923 | } while (true); |
924 | |
925 | string_literal21=(Token)match(input,31,FOLLOW_31_in_schema1886); if (state.failed) return retval; |
926 | if ( state.backtracking==0 ) { |
927 | string_literal21_tree = (Object)adaptor.create(string_literal21); |
928 | adaptor.addChild(root_0, string_literal21_tree); |
929 | } |
930 | |
931 | } |
932 | break; |
933 | |
934 | } |
935 | |
936 | // FELIX.g:366:5: ( '@REDUCE' ( 'on' '(' reducekey= ID ',' reducevalue= ID ')' )? '{' (reduces+= CODE )+ '}@' )? |
937 | int alt19=2; |
938 | int LA19_0 = input.LA(1); |
939 | |
940 | if ( (LA19_0==37) ) { |
941 | alt19=1; |
942 | } |
943 | switch (alt19) { |
944 | case 1 : |
945 | // FELIX.g:367:7: '@REDUCE' ( 'on' '(' reducekey= ID ',' reducevalue= ID ')' )? '{' (reduces+= CODE )+ '}@' |
946 | { |
947 | string_literal22=(Token)match(input,37,FOLLOW_37_in_schema1902); if (state.failed) return retval; |
948 | if ( state.backtracking==0 ) { |
949 | string_literal22_tree = (Object)adaptor.create(string_literal22); |
950 | adaptor.addChild(root_0, string_literal22_tree); |
951 | } |
952 | // FELIX.g:367:17: ( 'on' '(' reducekey= ID ',' reducevalue= ID ')' )? |
953 | int alt17=2; |
954 | int LA17_0 = input.LA(1); |
955 | |
956 | if ( (LA17_0==35) ) { |
957 | alt17=1; |
958 | } |
959 | switch (alt17) { |
960 | case 1 : |
961 | // FELIX.g:367:18: 'on' '(' reducekey= ID ',' reducevalue= ID ')' |
962 | { |
963 | string_literal23=(Token)match(input,35,FOLLOW_35_in_schema1905); if (state.failed) return retval; |
964 | if ( state.backtracking==0 ) { |
965 | string_literal23_tree = (Object)adaptor.create(string_literal23); |
966 | adaptor.addChild(root_0, string_literal23_tree); |
967 | } |
968 | char_literal24=(Token)match(input,26,FOLLOW_26_in_schema1907); if (state.failed) return retval; |
969 | if ( state.backtracking==0 ) { |
970 | char_literal24_tree = (Object)adaptor.create(char_literal24); |
971 | adaptor.addChild(root_0, char_literal24_tree); |
972 | } |
973 | reducekey=(Token)match(input,ID,FOLLOW_ID_in_schema1911); if (state.failed) return retval; |
974 | if ( state.backtracking==0 ) { |
975 | reducekey_tree = (Object)adaptor.create(reducekey); |
976 | adaptor.addChild(root_0, reducekey_tree); |
977 | } |
978 | char_literal25=(Token)match(input,27,FOLLOW_27_in_schema1913); if (state.failed) return retval; |
979 | if ( state.backtracking==0 ) { |
980 | char_literal25_tree = (Object)adaptor.create(char_literal25); |
981 | adaptor.addChild(root_0, char_literal25_tree); |
982 | } |
983 | reducevalue=(Token)match(input,ID,FOLLOW_ID_in_schema1917); if (state.failed) return retval; |
984 | if ( state.backtracking==0 ) { |
985 | reducevalue_tree = (Object)adaptor.create(reducevalue); |
986 | adaptor.addChild(root_0, reducevalue_tree); |
987 | } |
988 | char_literal26=(Token)match(input,28,FOLLOW_28_in_schema1919); if (state.failed) return retval; |
989 | if ( state.backtracking==0 ) { |
990 | char_literal26_tree = (Object)adaptor.create(char_literal26); |
991 | adaptor.addChild(root_0, char_literal26_tree); |
992 | } |
993 | |
994 | } |
995 | break; |
996 | |
997 | } |
998 | |
999 | char_literal27=(Token)match(input,29,FOLLOW_29_in_schema1923); if (state.failed) return retval; |
1000 | if ( state.backtracking==0 ) { |
1001 | char_literal27_tree = (Object)adaptor.create(char_literal27); |
1002 | adaptor.addChild(root_0, char_literal27_tree); |
1003 | } |
1004 | // FELIX.g:367:69: (reduces+= CODE )+ |
1005 | int cnt18=0; |
1006 | loop18: |
1007 | do { |
1008 | int alt18=2; |
1009 | int LA18_0 = input.LA(1); |
1010 | |
1011 | if ( (LA18_0==CODE) ) { |
1012 | alt18=1; |
1013 | } |
1014 | |
1015 | |
1016 | switch (alt18) { |
1017 | case 1 : |
1018 | // FELIX.g:367:70: reduces+= CODE |
1019 | { |
1020 | reduces=(Token)match(input,CODE,FOLLOW_CODE_in_schema1928); if (state.failed) return retval; |
1021 | if ( state.backtracking==0 ) { |
1022 | reduces_tree = (Object)adaptor.create(reduces); |
1023 | adaptor.addChild(root_0, reduces_tree); |
1024 | } |
1025 | if (list_reduces==null) list_reduces=new ArrayList(); |
1026 | list_reduces.add(reduces); |
1027 | |
1028 | |
1029 | } |
1030 | break; |
1031 | |
1032 | default : |
1033 | if ( cnt18 >= 1 ) break loop18; |
1034 | if (state.backtracking>0) {state.failed=true; return retval;} |
1035 | EarlyExitException eee = |
1036 | new EarlyExitException(18, input); |
1037 | throw eee; |
1038 | } |
1039 | cnt18++; |
1040 | } while (true); |
1041 | |
1042 | string_literal28=(Token)match(input,31,FOLLOW_31_in_schema1932); if (state.failed) return retval; |
1043 | if ( state.backtracking==0 ) { |
1044 | string_literal28_tree = (Object)adaptor.create(string_literal28); |
1045 | adaptor.addChild(root_0, string_literal28_tree); |
1046 | } |
1047 | |
1048 | } |
1049 | break; |
1050 | |
1051 | } |
1052 | |
1053 | char_literal29=(Token)match(input,38,FOLLOW_38_in_schema1945); if (state.failed) return retval; |
1054 | if ( state.backtracking==0 ) { |
1055 | char_literal29_tree = (Object)adaptor.create(char_literal29); |
1056 | adaptor.addChild(root_0, char_literal29_tree); |
1057 | } |
1058 | |
1059 | } |
1060 | break; |
1061 | |
1062 | } |
1063 | |
1064 | // FELIX.g:371:3: ( '<~db~' dbschema= ID '/' dbtable= ID )? |
1065 | int alt21=2; |
1066 | int LA21_0 = input.LA(1); |
1067 | |
1068 | if ( (LA21_0==39) ) { |
1069 | alt21=1; |
1070 | } |
1071 | switch (alt21) { |
1072 | case 1 : |
1073 | // FELIX.g:372:5: '<~db~' dbschema= ID '/' dbtable= ID |
1074 | { |
1075 | string_literal30=(Token)match(input,39,FOLLOW_39_in_schema1960); if (state.failed) return retval; |
1076 | if ( state.backtracking==0 ) { |
1077 | string_literal30_tree = (Object)adaptor.create(string_literal30); |
1078 | adaptor.addChild(root_0, string_literal30_tree); |
1079 | } |
1080 | dbschema=(Token)match(input,ID,FOLLOW_ID_in_schema1964); if (state.failed) return retval; |
1081 | if ( state.backtracking==0 ) { |
1082 | dbschema_tree = (Object)adaptor.create(dbschema); |
1083 | adaptor.addChild(root_0, dbschema_tree); |
1084 | } |
1085 | char_literal31=(Token)match(input,40,FOLLOW_40_in_schema1966); if (state.failed) return retval; |
1086 | if ( state.backtracking==0 ) { |
1087 | char_literal31_tree = (Object)adaptor.create(char_literal31); |
1088 | adaptor.addChild(root_0, char_literal31_tree); |
1089 | } |
1090 | dbtable=(Token)match(input,ID,FOLLOW_ID_in_schema1970); if (state.failed) return retval; |
1091 | if ( state.backtracking==0 ) { |
1092 | dbtable_tree = (Object)adaptor.create(dbtable); |
1093 | adaptor.addChild(root_0, dbtable_tree); |
1094 | } |
1095 | |
1096 | } |
1097 | break; |
1098 | |
1099 | } |
1100 | |
1101 | if ( state.backtracking==0 ) { |
1102 | |
1103 | curPred.sealDefinition(); |
1104 | ml.addFelixPredicate(curPred); |
1105 | |
1106 | if(dbschema != null && dbtable != null){ |
1107 | curPred.loadFromDatabase = true; |
1108 | curPred.loadingSchema = (dbschema!=null?dbschema.getText():null); |
1109 | curPred.loadingTable = (dbtable!=null?dbtable.getText():null); |
1110 | } |
1111 | |
1112 | |
1113 | if (dep != null || jdbcdep != null) { |
1114 | curPred.needExtractFeatures = true; |
1115 | //curPred.dependencyName = $depname.text; |
1116 | |
1117 | if(dep != null){ |
1118 | curPred.dependencyFile = (dep!=null?dep.getText():null); |
1119 | } |
1120 | |
1121 | if(jdbcdep != null){ |
1122 | curPred.jdbcdep = (jdbcdep!=null?jdbcdep.getText():null); |
1123 | } |
1124 | |
1125 | |
1126 | |
1127 | if (mapinput != null) { |
1128 | curPred.mapinputvar = (mapinput!=null?mapinput.getText():null); |
1129 | } |
1130 | |
1131 | if (reducekey != null) { |
1132 | curPred.reduceinputkeyvar = (reducekey!=null?reducekey.getText():null); |
1133 | } |
1134 | |
1135 | if (reducevalue != null) { |
1136 | curPred.reduceinputvaluesvar = (reducevalue!=null?reducevalue.getText():null); |
1137 | } |
1138 | |
1139 | if (list_mapinit != null) { |
1140 | ArrayList<Token> det = (ArrayList<Token>) (list_mapinit); |
1141 | ArrayList<String> dets = new ArrayList<String>(); |
1142 | for (Token t : det) { |
1143 | String s = t.getText(); |
1144 | dets.add(s); |
1145 | } |
1146 | curPred.mapinitScript = StringMan.join("\n", dets); |
1147 | } |
1148 | |
1149 | if (list_reduceinit != null) { |
1150 | ArrayList<Token> det = (ArrayList<Token>) (list_reduceinit); |
1151 | ArrayList<String> dets = new ArrayList<String>(); |
1152 | for (Token t : det) { |
1153 | String s = t.getText(); |
1154 | dets.add(s); |
1155 | } |
1156 | curPred.reduceinitScript = StringMan.join("\n", dets); |
1157 | } |
1158 | |
1159 | if (list_maps != null) { |
1160 | ArrayList<Token> det = (ArrayList<Token>) (list_maps); |
1161 | ArrayList<String> dets = new ArrayList<String>(); |
1162 | for (Token t : det) { |
1163 | String s = t.getText(); |
1164 | dets.add(s); |
1165 | } |
1166 | curPred.mapScript = StringMan.join("\n", dets); |
1167 | } |
1168 | |
1169 | if (list_reduces != null) { |
1170 | ArrayList<Token> det = (ArrayList<Token>) (list_reduces); |
1171 | ArrayList<String> dets = new ArrayList<String>(); |
1172 | for (Token t : det) { |
1173 | String s = t.getText(); |
1174 | dets.add(s); |
1175 | } |
1176 | curPred.reduceScript = StringMan.join("\n", dets); |
1177 | } |
1178 | |
1179 | if (xmltag != null) { |
1180 | curPred.xmltag = (xmltag!=null?xmltag.getText():null); |
1181 | } |
1182 | |
1183 | |
1184 | |
1185 | } |
1186 | |
1187 | } |
1188 | |
1189 | } |
1190 | |
1191 | retval.stop = input.LT(-1); |
1192 | |
1193 | if ( state.backtracking==0 ) { |
1194 | |
1195 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
1196 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
1197 | } |
1198 | } |
1199 | catch (RecognitionException re) { |
1200 | reportError(re); |
1201 | recover(input,re); |
1202 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
1203 | |
1204 | } |
1205 | finally { |
1206 | if ( state.backtracking>0 ) { memoize(input, 3, schema_StartIndex); } |
1207 | } |
1208 | return retval; |
1209 | } |
1210 | // $ANTLR end "schema" |
1211 | |
1212 | public static class predArg_return extends ParserRuleReturnScope { |
1213 | Object tree; |
1214 | public Object getTree() { return tree; } |
1215 | }; |
1216 | |
1217 | // $ANTLR start "predArg" |
1218 | // FELIX.g:462:1: predArg : type= ID (name= ID )? (uni= '!' )? ; |
1219 | public final FELIXParser.predArg_return predArg() throws RecognitionException { |
1220 | FELIXParser.predArg_return retval = new FELIXParser.predArg_return(); |
1221 | retval.start = input.LT(1); |
1222 | int predArg_StartIndex = input.index(); |
1223 | Object root_0 = null; |
1224 | |
1225 | Token type=null; |
1226 | Token name=null; |
1227 | Token uni=null; |
1228 | |
1229 | Object type_tree=null; |
1230 | Object name_tree=null; |
1231 | Object uni_tree=null; |
1232 | |
1233 | try { |
1234 | if ( state.backtracking>0 && alreadyParsedRule(input, 4) ) { return retval; } |
1235 | // FELIX.g:463:3: (type= ID (name= ID )? (uni= '!' )? ) |
1236 | // FELIX.g:464:3: type= ID (name= ID )? (uni= '!' )? |
1237 | { |
1238 | root_0 = (Object)adaptor.nil(); |
1239 | |
1240 | type=(Token)match(input,ID,FOLLOW_ID_in_predArg2000); if (state.failed) return retval; |
1241 | if ( state.backtracking==0 ) { |
1242 | type_tree = (Object)adaptor.create(type); |
1243 | adaptor.addChild(root_0, type_tree); |
1244 | } |
1245 | // FELIX.g:464:11: (name= ID )? |
1246 | int alt22=2; |
1247 | int LA22_0 = input.LA(1); |
1248 | |
1249 | if ( (LA22_0==ID) ) { |
1250 | alt22=1; |
1251 | } |
1252 | switch (alt22) { |
1253 | case 1 : |
1254 | // FELIX.g:464:12: name= ID |
1255 | { |
1256 | name=(Token)match(input,ID,FOLLOW_ID_in_predArg2005); if (state.failed) return retval; |
1257 | if ( state.backtracking==0 ) { |
1258 | name_tree = (Object)adaptor.create(name); |
1259 | adaptor.addChild(root_0, name_tree); |
1260 | } |
1261 | |
1262 | } |
1263 | break; |
1264 | |
1265 | } |
1266 | |
1267 | // FELIX.g:464:25: (uni= '!' )? |
1268 | int alt23=2; |
1269 | int LA23_0 = input.LA(1); |
1270 | |
1271 | if ( (LA23_0==NOT) ) { |
1272 | alt23=1; |
1273 | } |
1274 | switch (alt23) { |
1275 | case 1 : |
1276 | // FELIX.g:0:0: uni= '!' |
1277 | { |
1278 | uni=(Token)match(input,NOT,FOLLOW_NOT_in_predArg2011); if (state.failed) return retval; |
1279 | if ( state.backtracking==0 ) { |
1280 | uni_tree = (Object)adaptor.create(uni); |
1281 | adaptor.addChild(root_0, uni_tree); |
1282 | } |
1283 | |
1284 | } |
1285 | break; |
1286 | |
1287 | } |
1288 | |
1289 | if ( state.backtracking==0 ) { |
1290 | |
1291 | Type t = ml.getOrCreateTypeByName((type!=null?type.getText():null)); |
1292 | String nm = null; |
1293 | if (name != null) |
1294 | nm = (name!=null?name.getText():null); |
1295 | curPred.appendArgument(t, nm); |
1296 | if (uni != null) { |
1297 | curPred.addDependentAttrPosition(curPred.arity() - 1); |
1298 | } |
1299 | |
1300 | } |
1301 | |
1302 | } |
1303 | |
1304 | retval.stop = input.LT(-1); |
1305 | |
1306 | if ( state.backtracking==0 ) { |
1307 | |
1308 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
1309 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
1310 | } |
1311 | } |
1312 | catch (RecognitionException re) { |
1313 | reportError(re); |
1314 | recover(input,re); |
1315 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
1316 | |
1317 | } |
1318 | finally { |
1319 | if ( state.backtracking>0 ) { memoize(input, 4, predArg_StartIndex); } |
1320 | } |
1321 | return retval; |
1322 | } |
1323 | // $ANTLR end "predArg" |
1324 | |
1325 | public static class schemaConstraint_return extends ParserRuleReturnScope { |
1326 | Object tree; |
1327 | public Object getTree() { return tree; } |
1328 | }; |
1329 | |
1330 | // $ANTLR start "schemaConstraint" |
1331 | // FELIX.g:477:1: schemaConstraint : functionalDependency ; |
1332 | public final FELIXParser.schemaConstraint_return schemaConstraint() throws RecognitionException { |
1333 | FELIXParser.schemaConstraint_return retval = new FELIXParser.schemaConstraint_return(); |
1334 | retval.start = input.LT(1); |
1335 | int schemaConstraint_StartIndex = input.index(); |
1336 | Object root_0 = null; |
1337 | |
1338 | FELIXParser.functionalDependency_return functionalDependency32 = null; |
1339 | |
1340 | |
1341 | |
1342 | try { |
1343 | if ( state.backtracking>0 && alreadyParsedRule(input, 5) ) { return retval; } |
1344 | // FELIX.g:478:3: ( functionalDependency ) |
1345 | // FELIX.g:479:3: functionalDependency |
1346 | { |
1347 | root_0 = (Object)adaptor.nil(); |
1348 | |
1349 | pushFollow(FOLLOW_functionalDependency_in_schemaConstraint2060); |
1350 | functionalDependency32=functionalDependency(); |
1351 | |
1352 | state._fsp--; |
1353 | if (state.failed) return retval; |
1354 | if ( state.backtracking==0 ) adaptor.addChild(root_0, functionalDependency32.getTree()); |
1355 | |
1356 | } |
1357 | |
1358 | retval.stop = input.LT(-1); |
1359 | |
1360 | if ( state.backtracking==0 ) { |
1361 | |
1362 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
1363 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
1364 | } |
1365 | } |
1366 | catch (RecognitionException re) { |
1367 | reportError(re); |
1368 | recover(input,re); |
1369 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
1370 | |
1371 | } |
1372 | finally { |
1373 | if ( state.backtracking>0 ) { memoize(input, 5, schemaConstraint_StartIndex); } |
1374 | } |
1375 | return retval; |
1376 | } |
1377 | // $ANTLR end "schemaConstraint" |
1378 | |
1379 | public static class functionalDependency_return extends ParserRuleReturnScope { |
1380 | Object tree; |
1381 | public Object getTree() { return tree; } |
1382 | }; |
1383 | |
1384 | // $ANTLR start "functionalDependency" |
1385 | // FELIX.g:482:1: functionalDependency : ( 'FUNCTIONAL DEPENDENCY' | 'FD' ) ':' functionalDependencyItem ( ';' functionalDependencyItem )* ; |
1386 | public final FELIXParser.functionalDependency_return functionalDependency() throws RecognitionException { |
1387 | FELIXParser.functionalDependency_return retval = new FELIXParser.functionalDependency_return(); |
1388 | retval.start = input.LT(1); |
1389 | int functionalDependency_StartIndex = input.index(); |
1390 | Object root_0 = null; |
1391 | |
1392 | Token set33=null; |
1393 | Token char_literal34=null; |
1394 | Token char_literal36=null; |
1395 | FELIXParser.functionalDependencyItem_return functionalDependencyItem35 = null; |
1396 | |
1397 | FELIXParser.functionalDependencyItem_return functionalDependencyItem37 = null; |
1398 | |
1399 | |
1400 | Object set33_tree=null; |
1401 | Object char_literal34_tree=null; |
1402 | Object char_literal36_tree=null; |
1403 | |
1404 | try { |
1405 | if ( state.backtracking>0 && alreadyParsedRule(input, 6) ) { return retval; } |
1406 | // FELIX.g:483:3: ( ( 'FUNCTIONAL DEPENDENCY' | 'FD' ) ':' functionalDependencyItem ( ';' functionalDependencyItem )* ) |
1407 | // FELIX.g:484:3: ( 'FUNCTIONAL DEPENDENCY' | 'FD' ) ':' functionalDependencyItem ( ';' functionalDependencyItem )* |
1408 | { |
1409 | root_0 = (Object)adaptor.nil(); |
1410 | |
1411 | set33=(Token)input.LT(1); |
1412 | if ( (input.LA(1)>=41 && input.LA(1)<=42) ) { |
1413 | input.consume(); |
1414 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set33)); |
1415 | state.errorRecovery=false;state.failed=false; |
1416 | } |
1417 | else { |
1418 | if (state.backtracking>0) {state.failed=true; return retval;} |
1419 | MismatchedSetException mse = new MismatchedSetException(null,input); |
1420 | throw mse; |
1421 | } |
1422 | |
1423 | char_literal34=(Token)match(input,43,FOLLOW_43_in_functionalDependency2097); if (state.failed) return retval; |
1424 | if ( state.backtracking==0 ) { |
1425 | char_literal34_tree = (Object)adaptor.create(char_literal34); |
1426 | adaptor.addChild(root_0, char_literal34_tree); |
1427 | } |
1428 | pushFollow(FOLLOW_functionalDependencyItem_in_functionalDependency2099); |
1429 | functionalDependencyItem35=functionalDependencyItem(); |
1430 | |
1431 | state._fsp--; |
1432 | if (state.failed) return retval; |
1433 | if ( state.backtracking==0 ) adaptor.addChild(root_0, functionalDependencyItem35.getTree()); |
1434 | // FELIX.g:488:32: ( ';' functionalDependencyItem )* |
1435 | loop24: |
1436 | do { |
1437 | int alt24=2; |
1438 | int LA24_0 = input.LA(1); |
1439 | |
1440 | if ( (LA24_0==44) ) { |
1441 | alt24=1; |
1442 | } |
1443 | |
1444 | |
1445 | switch (alt24) { |
1446 | case 1 : |
1447 | // FELIX.g:488:33: ';' functionalDependencyItem |
1448 | { |
1449 | char_literal36=(Token)match(input,44,FOLLOW_44_in_functionalDependency2102); if (state.failed) return retval; |
1450 | if ( state.backtracking==0 ) { |
1451 | char_literal36_tree = (Object)adaptor.create(char_literal36); |
1452 | adaptor.addChild(root_0, char_literal36_tree); |
1453 | } |
1454 | pushFollow(FOLLOW_functionalDependencyItem_in_functionalDependency2104); |
1455 | functionalDependencyItem37=functionalDependencyItem(); |
1456 | |
1457 | state._fsp--; |
1458 | if (state.failed) return retval; |
1459 | if ( state.backtracking==0 ) adaptor.addChild(root_0, functionalDependencyItem37.getTree()); |
1460 | |
1461 | } |
1462 | break; |
1463 | |
1464 | default : |
1465 | break loop24; |
1466 | } |
1467 | } while (true); |
1468 | |
1469 | if ( state.backtracking==0 ) { |
1470 | |
1471 | UIMan.warn("The feature of functional dependency " |
1472 | + "is still in development; use at your own risk."); |
1473 | |
1474 | } |
1475 | |
1476 | } |
1477 | |
1478 | retval.stop = input.LT(-1); |
1479 | |
1480 | if ( state.backtracking==0 ) { |
1481 | |
1482 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
1483 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
1484 | } |
1485 | } |
1486 | catch (RecognitionException re) { |
1487 | reportError(re); |
1488 | recover(input,re); |
1489 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
1490 | |
1491 | } |
1492 | finally { |
1493 | if ( state.backtracking>0 ) { memoize(input, 6, functionalDependency_StartIndex); } |
1494 | } |
1495 | return retval; |
1496 | } |
1497 | // $ANTLR end "functionalDependency" |
1498 | |
1499 | public static class functionalDependencyItem_return extends ParserRuleReturnScope { |
1500 | Object tree; |
1501 | public Object getTree() { return tree; } |
1502 | }; |
1503 | |
1504 | // $ANTLR start "functionalDependencyItem" |
1505 | // FELIX.g:495:1: functionalDependencyItem : pa+= ID ( ',' pa+= ID )* '->' sa= ID ; |
1506 | public final FELIXParser.functionalDependencyItem_return functionalDependencyItem() throws RecognitionException { |
1507 | FELIXParser.functionalDependencyItem_return retval = new FELIXParser.functionalDependencyItem_return(); |
1508 | retval.start = input.LT(1); |
1509 | int functionalDependencyItem_StartIndex = input.index(); |
1510 | Object root_0 = null; |
1511 | |
1512 | Token sa=null; |
1513 | Token char_literal38=null; |
1514 | Token string_literal39=null; |
1515 | Token pa=null; |
1516 | List list_pa=null; |
1517 | |
1518 | Object sa_tree=null; |
1519 | Object char_literal38_tree=null; |
1520 | Object string_literal39_tree=null; |
1521 | Object pa_tree=null; |
1522 | |
1523 | try { |
1524 | if ( state.backtracking>0 && alreadyParsedRule(input, 7) ) { return retval; } |
1525 | // FELIX.g:496:3: (pa+= ID ( ',' pa+= ID )* '->' sa= ID ) |
1526 | // FELIX.g:497:3: pa+= ID ( ',' pa+= ID )* '->' sa= ID |
1527 | { |
1528 | root_0 = (Object)adaptor.nil(); |
1529 | |
1530 | pa=(Token)match(input,ID,FOLLOW_ID_in_functionalDependencyItem2189); if (state.failed) return retval; |
1531 | if ( state.backtracking==0 ) { |
1532 | pa_tree = (Object)adaptor.create(pa); |
1533 | adaptor.addChild(root_0, pa_tree); |
1534 | } |
1535 | if (list_pa==null) list_pa=new ArrayList(); |
1536 | list_pa.add(pa); |
1537 | |
1538 | // FELIX.g:497:10: ( ',' pa+= ID )* |
1539 | loop25: |
1540 | do { |
1541 | int alt25=2; |
1542 | int LA25_0 = input.LA(1); |
1543 | |
1544 | if ( (LA25_0==27) ) { |
1545 | alt25=1; |
1546 | } |
1547 | |
1548 | |
1549 | switch (alt25) { |
1550 | case 1 : |
1551 | // FELIX.g:497:11: ',' pa+= ID |
1552 | { |
1553 | char_literal38=(Token)match(input,27,FOLLOW_27_in_functionalDependencyItem2192); if (state.failed) return retval; |
1554 | if ( state.backtracking==0 ) { |
1555 | char_literal38_tree = (Object)adaptor.create(char_literal38); |
1556 | adaptor.addChild(root_0, char_literal38_tree); |
1557 | } |
1558 | pa=(Token)match(input,ID,FOLLOW_ID_in_functionalDependencyItem2196); if (state.failed) return retval; |
1559 | if ( state.backtracking==0 ) { |
1560 | pa_tree = (Object)adaptor.create(pa); |
1561 | adaptor.addChild(root_0, pa_tree); |
1562 | } |
1563 | if (list_pa==null) list_pa=new ArrayList(); |
1564 | list_pa.add(pa); |
1565 | |
1566 | |
1567 | } |
1568 | break; |
1569 | |
1570 | default : |
1571 | break loop25; |
1572 | } |
1573 | } while (true); |
1574 | |
1575 | string_literal39=(Token)match(input,45,FOLLOW_45_in_functionalDependencyItem2200); if (state.failed) return retval; |
1576 | if ( state.backtracking==0 ) { |
1577 | string_literal39_tree = (Object)adaptor.create(string_literal39); |
1578 | adaptor.addChild(root_0, string_literal39_tree); |
1579 | } |
1580 | sa=(Token)match(input,ID,FOLLOW_ID_in_functionalDependencyItem2204); if (state.failed) return retval; |
1581 | if ( state.backtracking==0 ) { |
1582 | sa_tree = (Object)adaptor.create(sa); |
1583 | adaptor.addChild(root_0, sa_tree); |
1584 | } |
1585 | if ( state.backtracking==0 ) { |
1586 | |
1587 | ArrayList<Token> det = (ArrayList<Token>) (list_pa); |
1588 | ArrayList<String> dets = new ArrayList<String>(); |
1589 | for (Token t : det) { |
1590 | String s = t.getText(); |
1591 | dets.add(s); |
1592 | } |
1593 | String dep = sa.getText(); |
1594 | curPred.addFunctionalDependency(dets, dep); |
1595 | |
1596 | } |
1597 | |
1598 | } |
1599 | |
1600 | retval.stop = input.LT(-1); |
1601 | |
1602 | if ( state.backtracking==0 ) { |
1603 | |
1604 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
1605 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
1606 | } |
1607 | } |
1608 | catch (RecognitionException re) { |
1609 | reportError(re); |
1610 | recover(input,re); |
1611 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
1612 | |
1613 | } |
1614 | finally { |
1615 | if ( state.backtracking>0 ) { memoize(input, 7, functionalDependencyItem_StartIndex); } |
1616 | } |
1617 | return retval; |
1618 | } |
1619 | // $ANTLR end "functionalDependencyItem" |
1620 | |
1621 | public static class ruleList_return extends ParserRuleReturnScope { |
1622 | Object tree; |
1623 | public Object getTree() { return tree; } |
1624 | }; |
1625 | |
1626 | // $ANTLR start "ruleList" |
1627 | // FELIX.g:510:1: ruleList : ( mlnRule | scopingRule | datalogRule | clusteringRule )* ; |
1628 | public final FELIXParser.ruleList_return ruleList() throws RecognitionException { |
1629 | FELIXParser.ruleList_return retval = new FELIXParser.ruleList_return(); |
1630 | retval.start = input.LT(1); |
1631 | int ruleList_StartIndex = input.index(); |
1632 | Object root_0 = null; |
1633 | |
1634 | FELIXParser.mlnRule_return mlnRule40 = null; |
1635 | |
1636 | FELIXParser.scopingRule_return scopingRule41 = null; |
1637 | |
1638 | FELIXParser.datalogRule_return datalogRule42 = null; |
1639 | |
1640 | FELIXParser.clusteringRule_return clusteringRule43 = null; |
1641 | |
1642 | |
1643 | |
1644 | try { |
1645 | if ( state.backtracking>0 && alreadyParsedRule(input, 8) ) { return retval; } |
1646 | // FELIX.g:511:3: ( ( mlnRule | scopingRule | datalogRule | clusteringRule )* ) |
1647 | // FELIX.g:512:3: ( mlnRule | scopingRule | datalogRule | clusteringRule )* |
1648 | { |
1649 | root_0 = (Object)adaptor.nil(); |
1650 | |
1651 | // FELIX.g:512:3: ( mlnRule | scopingRule | datalogRule | clusteringRule )* |
1652 | loop26: |
1653 | do { |
1654 | int alt26=5; |
1655 | alt26 = dfa26.predict(input); |
1656 | switch (alt26) { |
1657 | case 1 : |
1658 | // FELIX.g:513:5: mlnRule |
1659 | { |
1660 | pushFollow(FOLLOW_mlnRule_in_ruleList2262); |
1661 | mlnRule40=mlnRule(); |
1662 | |
1663 | state._fsp--; |
1664 | if (state.failed) return retval; |
1665 | if ( state.backtracking==0 ) adaptor.addChild(root_0, mlnRule40.getTree()); |
1666 | |
1667 | } |
1668 | break; |
1669 | case 2 : |
1670 | // FELIX.g:514:7: scopingRule |
1671 | { |
1672 | pushFollow(FOLLOW_scopingRule_in_ruleList2270); |
1673 | scopingRule41=scopingRule(); |
1674 | |
1675 | state._fsp--; |
1676 | if (state.failed) return retval; |
1677 | if ( state.backtracking==0 ) adaptor.addChild(root_0, scopingRule41.getTree()); |
1678 | |
1679 | } |
1680 | break; |
1681 | case 3 : |
1682 | // FELIX.g:515:7: datalogRule |
1683 | { |
1684 | pushFollow(FOLLOW_datalogRule_in_ruleList2278); |
1685 | datalogRule42=datalogRule(); |
1686 | |
1687 | state._fsp--; |
1688 | if (state.failed) return retval; |
1689 | if ( state.backtracking==0 ) adaptor.addChild(root_0, datalogRule42.getTree()); |
1690 | |
1691 | } |
1692 | break; |
1693 | case 4 : |
1694 | // FELIX.g:516:7: clusteringRule |
1695 | { |
1696 | pushFollow(FOLLOW_clusteringRule_in_ruleList2286); |
1697 | clusteringRule43=clusteringRule(); |
1698 | |
1699 | state._fsp--; |
1700 | if (state.failed) return retval; |
1701 | if ( state.backtracking==0 ) adaptor.addChild(root_0, clusteringRule43.getTree()); |
1702 | |
1703 | } |
1704 | break; |
1705 | |
1706 | default : |
1707 | break loop26; |
1708 | } |
1709 | } while (true); |
1710 | |
1711 | |
1712 | } |
1713 | |
1714 | retval.stop = input.LT(-1); |
1715 | |
1716 | if ( state.backtracking==0 ) { |
1717 | |
1718 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
1719 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
1720 | } |
1721 | } |
1722 | catch (RecognitionException re) { |
1723 | reportError(re); |
1724 | recover(input,re); |
1725 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
1726 | |
1727 | } |
1728 | finally { |
1729 | if ( state.backtracking>0 ) { memoize(input, 8, ruleList_StartIndex); } |
1730 | } |
1731 | return retval; |
1732 | } |
1733 | // $ANTLR end "ruleList" |
1734 | |
1735 | public static class mlnRule_return extends ParserRuleReturnScope { |
1736 | Object tree; |
1737 | public Object getTree() { return tree; } |
1738 | }; |
1739 | |
1740 | // $ANTLR start "mlnRule" |
1741 | // FELIX.g:520:1: mlnRule : (tag= ( '[Label]' | '[+Label]' | '[Label+]' ) STRING )? ( softRule | hardRule ) ; |
1742 | public final FELIXParser.mlnRule_return mlnRule() throws RecognitionException { |
1743 | FELIXParser.mlnRule_return retval = new FELIXParser.mlnRule_return(); |
1744 | retval.start = input.LT(1); |
1745 | int mlnRule_StartIndex = input.index(); |
1746 | Object root_0 = null; |
1747 | |
1748 | Token tag=null; |
1749 | Token STRING44=null; |
1750 | FELIXParser.softRule_return softRule45 = null; |
1751 | |
1752 | FELIXParser.hardRule_return hardRule46 = null; |
1753 | |
1754 | |
1755 | Object tag_tree=null; |
1756 | Object STRING44_tree=null; |
1757 | |
1758 | try { |
1759 | if ( state.backtracking>0 && alreadyParsedRule(input, 9) ) { return retval; } |
1760 | // FELIX.g:521:3: ( (tag= ( '[Label]' | '[+Label]' | '[Label+]' ) STRING )? ( softRule | hardRule ) ) |
1761 | // FELIX.g:522:3: (tag= ( '[Label]' | '[+Label]' | '[Label+]' ) STRING )? ( softRule | hardRule ) |
1762 | { |
1763 | root_0 = (Object)adaptor.nil(); |
1764 | |
1765 | // FELIX.g:522:3: (tag= ( '[Label]' | '[+Label]' | '[Label+]' ) STRING )? |
1766 | int alt27=2; |
1767 | int LA27_0 = input.LA(1); |
1768 | |
1769 | if ( ((LA27_0>=46 && LA27_0<=48)) ) { |
1770 | alt27=1; |
1771 | } |
1772 | switch (alt27) { |
1773 | case 1 : |
1774 | // FELIX.g:523:5: tag= ( '[Label]' | '[+Label]' | '[Label+]' ) STRING |
1775 | { |
1776 | tag=(Token)input.LT(1); |
1777 | if ( (input.LA(1)>=46 && input.LA(1)<=48) ) { |
1778 | input.consume(); |
1779 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(tag)); |
1780 | state.errorRecovery=false;state.failed=false; |
1781 | } |
1782 | else { |
1783 | if (state.backtracking>0) {state.failed=true; return retval;} |
1784 | MismatchedSetException mse = new MismatchedSetException(null,input); |
1785 | throw mse; |
1786 | } |
1787 | |
1788 | STRING44=(Token)match(input,STRING,FOLLOW_STRING_in_mlnRule2359); if (state.failed) return retval; |
1789 | if ( state.backtracking==0 ) { |
1790 | STRING44_tree = (Object)adaptor.create(STRING44); |
1791 | adaptor.addChild(root_0, STRING44_tree); |
1792 | } |
1793 | if ( state.backtracking==0 ) { |
1794 | |
1795 | clauseName = STRING44.getText(); |
1796 | String t = (tag!=null?tag.getText():null); |
1797 | if (t != null && t.contains("+")) { |
1798 | clauseLabelTrailing = true; |
1799 | } else { |
1800 | clauseLabelTrailing = false; |
1801 | } |
1802 | |
1803 | } |
1804 | |
1805 | } |
1806 | break; |
1807 | |
1808 | } |
1809 | |
1810 | // FELIX.g:540:3: ( softRule | hardRule ) |
1811 | int alt28=2; |
1812 | switch ( input.LA(1) ) { |
1813 | case NUMBER: |
1814 | { |
1815 | alt28=1; |
1816 | } |
1817 | break; |
1818 | case ID: |
1819 | { |
1820 | int LA28_2 = input.LA(2); |
1821 | |
1822 | if ( (LA28_2==43) ) { |
1823 | alt28=1; |
1824 | } |
1825 | else if ( (LA28_2==26) ) { |
1826 | alt28=2; |
1827 | } |
1828 | else { |
1829 | if (state.backtracking>0) {state.failed=true; return retval;} |
1830 | NoViableAltException nvae = |
1831 | new NoViableAltException("", 28, 2, input); |
1832 | |
1833 | throw nvae; |
1834 | } |
1835 | } |
1836 | break; |
1837 | case NOT: |
1838 | case PLUS: |
1839 | case EXIST: |
1840 | { |
1841 | alt28=2; |
1842 | } |
1843 | break; |
1844 | default: |
1845 | if (state.backtracking>0) {state.failed=true; return retval;} |
1846 | NoViableAltException nvae = |
1847 | new NoViableAltException("", 28, 0, input); |
1848 | |
1849 | throw nvae; |
1850 | } |
1851 | |
1852 | switch (alt28) { |
1853 | case 1 : |
1854 | // FELIX.g:541:5: softRule |
1855 | { |
1856 | pushFollow(FOLLOW_softRule_in_mlnRule2388); |
1857 | softRule45=softRule(); |
1858 | |
1859 | state._fsp--; |
1860 | if (state.failed) return retval; |
1861 | if ( state.backtracking==0 ) adaptor.addChild(root_0, softRule45.getTree()); |
1862 | |
1863 | } |
1864 | break; |
1865 | case 2 : |
1866 | // FELIX.g:542:7: hardRule |
1867 | { |
1868 | pushFollow(FOLLOW_hardRule_in_mlnRule2396); |
1869 | hardRule46=hardRule(); |
1870 | |
1871 | state._fsp--; |
1872 | if (state.failed) return retval; |
1873 | if ( state.backtracking==0 ) adaptor.addChild(root_0, hardRule46.getTree()); |
1874 | |
1875 | } |
1876 | break; |
1877 | |
1878 | } |
1879 | |
1880 | |
1881 | } |
1882 | |
1883 | retval.stop = input.LT(-1); |
1884 | |
1885 | if ( state.backtracking==0 ) { |
1886 | |
1887 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
1888 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
1889 | } |
1890 | } |
1891 | catch (RecognitionException re) { |
1892 | reportError(re); |
1893 | recover(input,re); |
1894 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
1895 | |
1896 | } |
1897 | finally { |
1898 | if ( state.backtracking>0 ) { memoize(input, 9, mlnRule_StartIndex); } |
1899 | } |
1900 | return retval; |
1901 | } |
1902 | // $ANTLR end "mlnRule" |
1903 | |
1904 | public static class softRule_return extends ParserRuleReturnScope { |
1905 | public FelixClause c; |
1906 | Object tree; |
1907 | public Object getTree() { return tree; } |
1908 | }; |
1909 | |
1910 | // $ANTLR start "softRule" |
1911 | // FELIX.g:546:1: softRule returns [FelixClause c] : (weight= NUMBER fc= foclause | warg= ID ':' fc= foclause ); |
1912 | public final FELIXParser.softRule_return softRule() throws RecognitionException { |
1913 | FELIXParser.softRule_return retval = new FELIXParser.softRule_return(); |
1914 | retval.start = input.LT(1); |
1915 | int softRule_StartIndex = input.index(); |
1916 | Object root_0 = null; |
1917 | |
1918 | Token weight=null; |
1919 | Token warg=null; |
1920 | Token char_literal47=null; |
1921 | FELIXParser.foclause_return fc = null; |
1922 | |
1923 | |
1924 | Object weight_tree=null; |
1925 | Object warg_tree=null; |
1926 | Object char_literal47_tree=null; |
1927 | |
1928 | try { |
1929 | if ( state.backtracking>0 && alreadyParsedRule(input, 10) ) { return retval; } |
1930 | // FELIX.g:547:3: (weight= NUMBER fc= foclause | warg= ID ':' fc= foclause ) |
1931 | int alt29=2; |
1932 | int LA29_0 = input.LA(1); |
1933 | |
1934 | if ( (LA29_0==NUMBER) ) { |
1935 | alt29=1; |
1936 | } |
1937 | else if ( (LA29_0==ID) ) { |
1938 | alt29=2; |
1939 | } |
1940 | else { |
1941 | if (state.backtracking>0) {state.failed=true; return retval;} |
1942 | NoViableAltException nvae = |
1943 | new NoViableAltException("", 29, 0, input); |
1944 | |
1945 | throw nvae; |
1946 | } |
1947 | switch (alt29) { |
1948 | case 1 : |
1949 | // FELIX.g:548:3: weight= NUMBER fc= foclause |
1950 | { |
1951 | root_0 = (Object)adaptor.nil(); |
1952 | |
1953 | weight=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_softRule2421); if (state.failed) return retval; |
1954 | if ( state.backtracking==0 ) { |
1955 | weight_tree = (Object)adaptor.create(weight); |
1956 | adaptor.addChild(root_0, weight_tree); |
1957 | } |
1958 | pushFollow(FOLLOW_foclause_in_softRule2425); |
1959 | fc=foclause(); |
1960 | |
1961 | state._fsp--; |
1962 | if (state.failed) return retval; |
1963 | if ( state.backtracking==0 ) adaptor.addChild(root_0, fc.getTree()); |
1964 | if ( state.backtracking==0 ) { |
1965 | |
1966 | retval.c = (fc!=null?fc.c:null); |
1967 | retval.c.setWeight(Double.parseDouble((weight!=null?weight.getText():null))); |
1968 | ml.addFelixClause(retval.c); |
1969 | retval.c.addSpecText(input.toString(retval.start,input.LT(-1))); |
1970 | |
1971 | } |
1972 | |
1973 | } |
1974 | break; |
1975 | case 2 : |
1976 | // FELIX.g:555:5: warg= ID ':' fc= foclause |
1977 | { |
1978 | root_0 = (Object)adaptor.nil(); |
1979 | |
1980 | warg=(Token)match(input,ID,FOLLOW_ID_in_softRule2464); if (state.failed) return retval; |
1981 | if ( state.backtracking==0 ) { |
1982 | warg_tree = (Object)adaptor.create(warg); |
1983 | adaptor.addChild(root_0, warg_tree); |
1984 | } |
1985 | char_literal47=(Token)match(input,43,FOLLOW_43_in_softRule2466); if (state.failed) return retval; |
1986 | if ( state.backtracking==0 ) { |
1987 | char_literal47_tree = (Object)adaptor.create(char_literal47); |
1988 | adaptor.addChild(root_0, char_literal47_tree); |
1989 | } |
1990 | pushFollow(FOLLOW_foclause_in_softRule2470); |
1991 | fc=foclause(); |
1992 | |
1993 | state._fsp--; |
1994 | if (state.failed) return retval; |
1995 | if ( state.backtracking==0 ) adaptor.addChild(root_0, fc.getTree()); |
1996 | if ( state.backtracking==0 ) { |
1997 | |
1998 | retval.c = (fc!=null?fc.c:null); |
1999 | retval.c.setWeight(1); |
2000 | retval.c.setVarWeight((warg!=null?warg.getText():null)); |
2001 | ml.addFelixClause(retval.c); |
2002 | retval.c.addSpecText(input.toString(retval.start,input.LT(-1))); |
2003 | |
2004 | } |
2005 | |
2006 | } |
2007 | break; |
2008 | |
2009 | } |
2010 | retval.stop = input.LT(-1); |
2011 | |
2012 | if ( state.backtracking==0 ) { |
2013 | |
2014 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
2015 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
2016 | } |
2017 | } |
2018 | catch (RecognitionException re) { |
2019 | reportError(re); |
2020 | recover(input,re); |
2021 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
2022 | |
2023 | } |
2024 | finally { |
2025 | if ( state.backtracking>0 ) { memoize(input, 10, softRule_StartIndex); } |
2026 | } |
2027 | return retval; |
2028 | } |
2029 | // $ANTLR end "softRule" |
2030 | |
2031 | public static class hardRule_return extends ParserRuleReturnScope { |
2032 | public FelixClause c; |
2033 | Object tree; |
2034 | public Object getTree() { return tree; } |
2035 | }; |
2036 | |
2037 | // $ANTLR start "hardRule" |
2038 | // FELIX.g:565:1: hardRule returns [FelixClause c] : fc= foclause PERIOD ; |
2039 | public final FELIXParser.hardRule_return hardRule() throws RecognitionException { |
2040 | FELIXParser.hardRule_return retval = new FELIXParser.hardRule_return(); |
2041 | retval.start = input.LT(1); |
2042 | int hardRule_StartIndex = input.index(); |
2043 | Object root_0 = null; |
2044 | |
2045 | Token PERIOD48=null; |
2046 | FELIXParser.foclause_return fc = null; |
2047 | |
2048 | |
2049 | Object PERIOD48_tree=null; |
2050 | |
2051 | try { |
2052 | if ( state.backtracking>0 && alreadyParsedRule(input, 11) ) { return retval; } |
2053 | // FELIX.g:566:3: (fc= foclause PERIOD ) |
2054 | // FELIX.g:567:3: fc= foclause PERIOD |
2055 | { |
2056 | root_0 = (Object)adaptor.nil(); |
2057 | |
2058 | pushFollow(FOLLOW_foclause_in_hardRule2522); |
2059 | fc=foclause(); |
2060 | |
2061 | state._fsp--; |
2062 | if (state.failed) return retval; |
2063 | if ( state.backtracking==0 ) adaptor.addChild(root_0, fc.getTree()); |
2064 | PERIOD48=(Token)match(input,PERIOD,FOLLOW_PERIOD_in_hardRule2524); if (state.failed) return retval; |
2065 | if ( state.backtracking==0 ) { |
2066 | PERIOD48_tree = (Object)adaptor.create(PERIOD48); |
2067 | adaptor.addChild(root_0, PERIOD48_tree); |
2068 | } |
2069 | if ( state.backtracking==0 ) { |
2070 | |
2071 | retval.c = (fc!=null?fc.c:null); |
2072 | retval.c.setHardWeight(); |
2073 | ml.addFelixClause(retval.c); |
2074 | retval.c.addSpecText(input.toString(retval.start,input.LT(-1))); |
2075 | |
2076 | } |
2077 | |
2078 | } |
2079 | |
2080 | retval.stop = input.LT(-1); |
2081 | |
2082 | if ( state.backtracking==0 ) { |
2083 | |
2084 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
2085 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
2086 | } |
2087 | } |
2088 | catch (RecognitionException re) { |
2089 | reportError(re); |
2090 | recover(input,re); |
2091 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
2092 | |
2093 | } |
2094 | finally { |
2095 | if ( state.backtracking>0 ) { memoize(input, 11, hardRule_StartIndex); } |
2096 | } |
2097 | return retval; |
2098 | } |
2099 | // $ANTLR end "hardRule" |
2100 | |
2101 | public static class functionalAtom_return extends ParserRuleReturnScope { |
2102 | public AtomEx cond; |
2103 | Object tree; |
2104 | public Object getTree() { return tree; } |
2105 | }; |
2106 | |
2107 | // $ANTLR start "functionalAtom" |
2108 | // FELIX.g:576:1: functionalAtom returns [AtomEx cond] : func= ID '(' e1= expression ( ',' ep= expression )* ')' ; |
2109 | public final FELIXParser.functionalAtom_return functionalAtom() throws RecognitionException { |
2110 | FELIXParser.functionalAtom_return retval = new FELIXParser.functionalAtom_return(); |
2111 | retval.start = input.LT(1); |
2112 | int functionalAtom_StartIndex = input.index(); |
2113 | Object root_0 = null; |
2114 | |
2115 | Token func=null; |
2116 | Token char_literal49=null; |
2117 | Token char_literal50=null; |
2118 | Token char_literal51=null; |
2119 | FELIXParser.expression_return e1 = null; |
2120 | |
2121 | FELIXParser.expression_return ep = null; |
2122 | |
2123 | |
2124 | Object func_tree=null; |
2125 | Object char_literal49_tree=null; |
2126 | Object char_literal50_tree=null; |
2127 | Object char_literal51_tree=null; |
2128 | |
2129 | try { |
2130 | if ( state.backtracking>0 && alreadyParsedRule(input, 12) ) { return retval; } |
2131 | // FELIX.g:577:3: (func= ID '(' e1= expression ( ',' ep= expression )* ')' ) |
2132 | // FELIX.g:578:3: func= ID '(' e1= expression ( ',' ep= expression )* ')' |
2133 | { |
2134 | root_0 = (Object)adaptor.nil(); |
2135 | |
2136 | func=(Token)match(input,ID,FOLLOW_ID_in_functionalAtom2569); if (state.failed) return retval; |
2137 | if ( state.backtracking==0 ) { |
2138 | func_tree = (Object)adaptor.create(func); |
2139 | adaptor.addChild(root_0, func_tree); |
2140 | } |
2141 | if ( state.backtracking==0 ) { |
2142 | |
2143 | Predicate p = ml.getPredByName((func!=null?func.getText():null)); |
2144 | if (p == null) |
2145 | die("Line #" + func.getLine() + ": undefined predicate: " + (func!=null?func.getText():null)); |
2146 | retval.cond = new AtomEx(p); |
2147 | |
2148 | } |
2149 | char_literal49=(Token)match(input,26,FOLLOW_26_in_functionalAtom2586); if (state.failed) return retval; |
2150 | if ( state.backtracking==0 ) { |
2151 | char_literal49_tree = (Object)adaptor.create(char_literal49); |
2152 | adaptor.addChild(root_0, char_literal49_tree); |
2153 | } |
2154 | pushFollow(FOLLOW_expression_in_functionalAtom2590); |
2155 | e1=expression(); |
2156 | |
2157 | state._fsp--; |
2158 | if (state.failed) return retval; |
2159 | if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree()); |
2160 | if ( state.backtracking==0 ) { |
2161 | |
2162 | retval.cond.appendTerm((e1!=null?e1.expr:null)); |
2163 | |
2164 | } |
2165 | // FELIX.g:589:3: ( ',' ep= expression )* |
2166 | loop30: |
2167 | do { |
2168 | int alt30=2; |
2169 | int LA30_0 = input.LA(1); |
2170 | |
2171 | if ( (LA30_0==27) ) { |
2172 | alt30=1; |
2173 | } |
2174 | |
2175 | |
2176 | switch (alt30) { |
2177 | case 1 : |
2178 | // FELIX.g:589:4: ',' ep= expression |
2179 | { |
2180 | char_literal50=(Token)match(input,27,FOLLOW_27_in_functionalAtom2618); if (state.failed) return retval; |
2181 | if ( state.backtracking==0 ) { |
2182 | char_literal50_tree = (Object)adaptor.create(char_literal50); |
2183 | adaptor.addChild(root_0, char_literal50_tree); |
2184 | } |
2185 | pushFollow(FOLLOW_expression_in_functionalAtom2622); |
2186 | ep=expression(); |
2187 | |
2188 | state._fsp--; |
2189 | if (state.failed) return retval; |
2190 | if ( state.backtracking==0 ) adaptor.addChild(root_0, ep.getTree()); |
2191 | if ( state.backtracking==0 ) { |
2192 | |
2193 | retval.cond.appendTerm((ep!=null?ep.expr:null)); |
2194 | |
2195 | } |
2196 | |
2197 | } |
2198 | break; |
2199 | |
2200 | default : |
2201 | break loop30; |
2202 | } |
2203 | } while (true); |
2204 | |
2205 | char_literal51=(Token)match(input,28,FOLLOW_28_in_functionalAtom2650); if (state.failed) return retval; |
2206 | if ( state.backtracking==0 ) { |
2207 | char_literal51_tree = (Object)adaptor.create(char_literal51); |
2208 | adaptor.addChild(root_0, char_literal51_tree); |
2209 | } |
2210 | |
2211 | } |
2212 | |
2213 | retval.stop = input.LT(-1); |
2214 | |
2215 | if ( state.backtracking==0 ) { |
2216 | |
2217 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
2218 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
2219 | } |
2220 | } |
2221 | catch (RecognitionException re) { |
2222 | reportError(re); |
2223 | recover(input,re); |
2224 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
2225 | |
2226 | } |
2227 | finally { |
2228 | if ( state.backtracking>0 ) { memoize(input, 12, functionalAtom_StartIndex); } |
2229 | } |
2230 | return retval; |
2231 | } |
2232 | // $ANTLR end "functionalAtom" |
2233 | |
2234 | public static class datalogRule_return extends ParserRuleReturnScope { |
2235 | public ConjunctiveQuery cq = new ConjunctiveQuery();; |
2236 | Object tree; |
2237 | public Object getTree() { return tree; } |
2238 | }; |
2239 | |
2240 | // $ANTLR start "datalogRule" |
2241 | // FELIX.g:595:1: datalogRule returns [ConjunctiveQuery cq = new ConjunctiveQuery();] : (vt= ( '@' | '#' ) )? (st= '$' )? head= literal ':-' body0= literal ( ',' bodyp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? PERIOD ; |
2242 | public final FELIXParser.datalogRule_return datalogRule() throws RecognitionException { |
2243 | FELIXParser.datalogRule_return retval = new FELIXParser.datalogRule_return(); |
2244 | retval.start = input.LT(1); |
2245 | int datalogRule_StartIndex = input.index(); |
2246 | Object root_0 = null; |
2247 | |
2248 | Token vt=null; |
2249 | Token st=null; |
2250 | Token string_literal52=null; |
2251 | Token char_literal53=null; |
2252 | Token char_literal54=null; |
2253 | Token char_literal55=null; |
2254 | Token char_literal56=null; |
2255 | Token char_literal57=null; |
2256 | Token PERIOD58=null; |
2257 | FELIXParser.literal_return head = null; |
2258 | |
2259 | FELIXParser.literal_return body0 = null; |
2260 | |
2261 | FELIXParser.literal_return bodyp = null; |
2262 | |
2263 | FELIXParser.mathComparison_return mc = null; |
2264 | |
2265 | FELIXParser.boolExpression_return be = null; |
2266 | |
2267 | |
2268 | Object vt_tree=null; |
2269 | Object st_tree=null; |
2270 | Object string_literal52_tree=null; |
2271 | Object char_literal53_tree=null; |
2272 | Object char_literal54_tree=null; |
2273 | Object char_literal55_tree=null; |
2274 | Object char_literal56_tree=null; |
2275 | Object char_literal57_tree=null; |
2276 | Object PERIOD58_tree=null; |
2277 | |
2278 | try { |
2279 | if ( state.backtracking>0 && alreadyParsedRule(input, 13) ) { return retval; } |
2280 | // FELIX.g:596:3: ( (vt= ( '@' | '#' ) )? (st= '$' )? head= literal ':-' body0= literal ( ',' bodyp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? PERIOD ) |
2281 | // FELIX.g:597:3: (vt= ( '@' | '#' ) )? (st= '$' )? head= literal ':-' body0= literal ( ',' bodyp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? PERIOD |
2282 | { |
2283 | root_0 = (Object)adaptor.nil(); |
2284 | |
2285 | // FELIX.g:597:3: (vt= ( '@' | '#' ) )? |
2286 | int alt31=2; |
2287 | int LA31_0 = input.LA(1); |
2288 | |
2289 | if ( (LA31_0==25||LA31_0==49) ) { |
2290 | alt31=1; |
2291 | } |
2292 | switch (alt31) { |
2293 | case 1 : |
2294 | // FELIX.g:598:5: vt= ( '@' | '#' ) |
2295 | { |
2296 | vt=(Token)input.LT(1); |
2297 | if ( input.LA(1)==25||input.LA(1)==49 ) { |
2298 | input.consume(); |
2299 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(vt)); |
2300 | state.errorRecovery=false;state.failed=false; |
2301 | } |
2302 | else { |
2303 | if (state.backtracking>0) {state.failed=true; return retval;} |
2304 | MismatchedSetException mse = new MismatchedSetException(null,input); |
2305 | throw mse; |
2306 | } |
2307 | |
2308 | |
2309 | } |
2310 | break; |
2311 | |
2312 | } |
2313 | |
2314 | // FELIX.g:604:3: (st= '$' )? |
2315 | int alt32=2; |
2316 | int LA32_0 = input.LA(1); |
2317 | |
2318 | if ( (LA32_0==50) ) { |
2319 | alt32=1; |
2320 | } |
2321 | switch (alt32) { |
2322 | case 1 : |
2323 | // FELIX.g:604:4: st= '$' |
2324 | { |
2325 | st=(Token)match(input,50,FOLLOW_50_in_datalogRule2718); if (state.failed) return retval; |
2326 | if ( state.backtracking==0 ) { |
2327 | st_tree = (Object)adaptor.create(st); |
2328 | adaptor.addChild(root_0, st_tree); |
2329 | } |
2330 | |
2331 | } |
2332 | break; |
2333 | |
2334 | } |
2335 | |
2336 | pushFollow(FOLLOW_literal_in_datalogRule2724); |
2337 | head=literal(); |
2338 | |
2339 | state._fsp--; |
2340 | if (state.failed) return retval; |
2341 | if ( state.backtracking==0 ) adaptor.addChild(root_0, head.getTree()); |
2342 | if ( state.backtracking==0 ) { |
2343 | |
2344 | retval.cq.setHead((head!=null?head.lit:null)); |
2345 | |
2346 | } |
2347 | string_literal52=(Token)match(input,51,FOLLOW_51_in_datalogRule2756); if (state.failed) return retval; |
2348 | if ( state.backtracking==0 ) { |
2349 | string_literal52_tree = (Object)adaptor.create(string_literal52); |
2350 | adaptor.addChild(root_0, string_literal52_tree); |
2351 | } |
2352 | pushFollow(FOLLOW_literal_in_datalogRule2760); |
2353 | body0=literal(); |
2354 | |
2355 | state._fsp--; |
2356 | if (state.failed) return retval; |
2357 | if ( state.backtracking==0 ) adaptor.addChild(root_0, body0.getTree()); |
2358 | if ( state.backtracking==0 ) { |
2359 | |
2360 | if ((body0!=null?body0.lit:null) != null) { |
2361 | retval.cq.addBodyLit((body0!=null?body0.lit:null)); |
2362 | } |
2363 | |
2364 | } |
2365 | // FELIX.g:614:3: ( ',' bodyp= literal )* |
2366 | loop33: |
2367 | do { |
2368 | int alt33=2; |
2369 | alt33 = dfa33.predict(input); |
2370 | switch (alt33) { |
2371 | case 1 : |
2372 | // FELIX.g:614:4: ',' bodyp= literal |
2373 | { |
2374 | char_literal53=(Token)match(input,27,FOLLOW_27_in_datalogRule2789); if (state.failed) return retval; |
2375 | if ( state.backtracking==0 ) { |
2376 | char_literal53_tree = (Object)adaptor.create(char_literal53); |
2377 | adaptor.addChild(root_0, char_literal53_tree); |
2378 | } |
2379 | pushFollow(FOLLOW_literal_in_datalogRule2793); |
2380 | bodyp=literal(); |
2381 | |
2382 | state._fsp--; |
2383 | if (state.failed) return retval; |
2384 | if ( state.backtracking==0 ) adaptor.addChild(root_0, bodyp.getTree()); |
2385 | if ( state.backtracking==0 ) { |
2386 | |
2387 | if ((bodyp!=null?bodyp.lit:null) != null) { |
2388 | retval.cq.addBodyLit((bodyp!=null?bodyp.lit:null)); |
2389 | } |
2390 | |
2391 | } |
2392 | |
2393 | } |
2394 | break; |
2395 | |
2396 | default : |
2397 | break loop33; |
2398 | } |
2399 | } while (true); |
2400 | |
2401 | // FELIX.g:619:26: ( ',' mc= mathComparison )* |
2402 | loop34: |
2403 | do { |
2404 | int alt34=2; |
2405 | int LA34_0 = input.LA(1); |
2406 | |
2407 | if ( (LA34_0==27) ) { |
2408 | int LA34_1 = input.LA(2); |
2409 | |
2410 | if ( (LA34_1==STRING||LA34_1==NUMBER||LA34_1==ID||LA34_1==26||LA34_1==57) ) { |
2411 | alt34=1; |
2412 | } |
2413 | |
2414 | |
2415 | } |
2416 | |
2417 | |
2418 | switch (alt34) { |
2419 | case 1 : |
2420 | // FELIX.g:619:27: ',' mc= mathComparison |
2421 | { |
2422 | char_literal54=(Token)match(input,27,FOLLOW_27_in_datalogRule2822); if (state.failed) return retval; |
2423 | if ( state.backtracking==0 ) { |
2424 | char_literal54_tree = (Object)adaptor.create(char_literal54); |
2425 | adaptor.addChild(root_0, char_literal54_tree); |
2426 | } |
2427 | pushFollow(FOLLOW_mathComparison_in_datalogRule2826); |
2428 | mc=mathComparison(); |
2429 | |
2430 | state._fsp--; |
2431 | if (state.failed) return retval; |
2432 | if ( state.backtracking==0 ) adaptor.addChild(root_0, mc.getTree()); |
2433 | if ( state.backtracking==0 ) { |
2434 | |
2435 | retval.cq.addConstraint((mc!=null?mc.expr:null)); |
2436 | |
2437 | } |
2438 | |
2439 | } |
2440 | break; |
2441 | |
2442 | default : |
2443 | break loop34; |
2444 | } |
2445 | } while (true); |
2446 | |
2447 | // FELIX.g:622:53: ( ',' '[' be= boolExpression ']' )? |
2448 | int alt35=2; |
2449 | int LA35_0 = input.LA(1); |
2450 | |
2451 | if ( (LA35_0==27) ) { |
2452 | alt35=1; |
2453 | } |
2454 | switch (alt35) { |
2455 | case 1 : |
2456 | // FELIX.g:622:54: ',' '[' be= boolExpression ']' |
2457 | { |
2458 | char_literal55=(Token)match(input,27,FOLLOW_27_in_datalogRule2882); if (state.failed) return retval; |
2459 | if ( state.backtracking==0 ) { |
2460 | char_literal55_tree = (Object)adaptor.create(char_literal55); |
2461 | adaptor.addChild(root_0, char_literal55_tree); |
2462 | } |
2463 | char_literal56=(Token)match(input,52,FOLLOW_52_in_datalogRule2884); if (state.failed) return retval; |
2464 | if ( state.backtracking==0 ) { |
2465 | char_literal56_tree = (Object)adaptor.create(char_literal56); |
2466 | adaptor.addChild(root_0, char_literal56_tree); |
2467 | } |
2468 | pushFollow(FOLLOW_boolExpression_in_datalogRule2888); |
2469 | be=boolExpression(); |
2470 | |
2471 | state._fsp--; |
2472 | if (state.failed) return retval; |
2473 | if ( state.backtracking==0 ) adaptor.addChild(root_0, be.getTree()); |
2474 | if ( state.backtracking==0 ) { |
2475 | |
2476 | retval.cq.addConstraint((be!=null?be.be:null)); |
2477 | |
2478 | } |
2479 | char_literal57=(Token)match(input,53,FOLLOW_53_in_datalogRule2976); if (state.failed) return retval; |
2480 | if ( state.backtracking==0 ) { |
2481 | char_literal57_tree = (Object)adaptor.create(char_literal57); |
2482 | adaptor.addChild(root_0, char_literal57_tree); |
2483 | } |
2484 | |
2485 | } |
2486 | break; |
2487 | |
2488 | } |
2489 | |
2490 | PERIOD58=(Token)match(input,PERIOD,FOLLOW_PERIOD_in_datalogRule2980); if (state.failed) return retval; |
2491 | if ( state.backtracking==0 ) { |
2492 | PERIOD58_tree = (Object)adaptor.create(PERIOD58); |
2493 | adaptor.addChild(root_0, PERIOD58_tree); |
2494 | } |
2495 | if ( state.backtracking==0 ) { |
2496 | |
2497 | if (st != null) { |
2498 | if ((st!=null?st.getText():null).equals("$")) |
2499 | retval.cq.isView = true; |
2500 | } |
2501 | if (vt != null) { |
2502 | ExceptionMan |
2503 | .die("Intermediate Rule and Postproc Rule are not supported in FELIX! " |
2504 | + retval.cq); |
2505 | // if((vt!=null?vt.getText():null).equals("@")) ml.registerPostprocRule(retval.cq); |
2506 | // else if((vt!=null?vt.getText():null).equals("#")){ |
2507 | // // ml.registerDatalogRule(retval.cq); |
2508 | // ml.registerIntermediateRule(retval.cq); |
2509 | // } |
2510 | } else { |
2511 | ml.addDatalogRule(retval.cq); |
2512 | } |
2513 | |
2514 | } |
2515 | |
2516 | } |
2517 | |
2518 | retval.stop = input.LT(-1); |
2519 | |
2520 | if ( state.backtracking==0 ) { |
2521 | |
2522 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
2523 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
2524 | } |
2525 | } |
2526 | catch (RecognitionException re) { |
2527 | reportError(re); |
2528 | recover(input,re); |
2529 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
2530 | |
2531 | } |
2532 | finally { |
2533 | if ( state.backtracking>0 ) { memoize(input, 13, datalogRule_StartIndex); } |
2534 | } |
2535 | return retval; |
2536 | } |
2537 | // $ANTLR end "datalogRule" |
2538 | |
2539 | public static class scopingRule_return extends ParserRuleReturnScope { |
2540 | public ConjunctiveQuery cq = new ConjunctiveQuery();; |
2541 | Object tree; |
2542 | public Object getTree() { return tree; } |
2543 | }; |
2544 | |
2545 | // $ANTLR start "scopingRule" |
2546 | // FELIX.g:647:1: scopingRule returns [ConjunctiveQuery cq = new ConjunctiveQuery();] : ( '[' 'priorProb' '=' prior= NUMBER ']' )? head= literal ':=' body0= literal ( ',' bodyp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? PERIOD ; |
2547 | public final FELIXParser.scopingRule_return scopingRule() throws RecognitionException { |
2548 | FELIXParser.scopingRule_return retval = new FELIXParser.scopingRule_return(); |
2549 | retval.start = input.LT(1); |
2550 | int scopingRule_StartIndex = input.index(); |
2551 | Object root_0 = null; |
2552 | |
2553 | Token prior=null; |
2554 | Token char_literal59=null; |
2555 | Token string_literal60=null; |
2556 | Token char_literal61=null; |
2557 | Token char_literal62=null; |
2558 | Token string_literal63=null; |
2559 | Token char_literal64=null; |
2560 | Token char_literal65=null; |
2561 | Token char_literal66=null; |
2562 | Token char_literal67=null; |
2563 | Token char_literal68=null; |
2564 | Token PERIOD69=null; |
2565 | FELIXParser.literal_return head = null; |
2566 | |
2567 | FELIXParser.literal_return body0 = null; |
2568 | |
2569 | FELIXParser.literal_return bodyp = null; |
2570 | |
2571 | FELIXParser.mathComparison_return mc = null; |
2572 | |
2573 | FELIXParser.boolExpression_return be = null; |
2574 | |
2575 | |
2576 | Object prior_tree=null; |
2577 | Object char_literal59_tree=null; |
2578 | Object string_literal60_tree=null; |
2579 | Object char_literal61_tree=null; |
2580 | Object char_literal62_tree=null; |
2581 | Object string_literal63_tree=null; |
2582 | Object char_literal64_tree=null; |
2583 | Object char_literal65_tree=null; |
2584 | Object char_literal66_tree=null; |
2585 | Object char_literal67_tree=null; |
2586 | Object char_literal68_tree=null; |
2587 | Object PERIOD69_tree=null; |
2588 | |
2589 | try { |
2590 | if ( state.backtracking>0 && alreadyParsedRule(input, 14) ) { return retval; } |
2591 | // FELIX.g:648:3: ( ( '[' 'priorProb' '=' prior= NUMBER ']' )? head= literal ':=' body0= literal ( ',' bodyp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? PERIOD ) |
2592 | // FELIX.g:649:3: ( '[' 'priorProb' '=' prior= NUMBER ']' )? head= literal ':=' body0= literal ( ',' bodyp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? PERIOD |
2593 | { |
2594 | root_0 = (Object)adaptor.nil(); |
2595 | |
2596 | // FELIX.g:649:3: ( '[' 'priorProb' '=' prior= NUMBER ']' )? |
2597 | int alt36=2; |
2598 | int LA36_0 = input.LA(1); |
2599 | |
2600 | if ( (LA36_0==52) ) { |
2601 | alt36=1; |
2602 | } |
2603 | switch (alt36) { |
2604 | case 1 : |
2605 | // FELIX.g:649:4: '[' 'priorProb' '=' prior= NUMBER ']' |
2606 | { |
2607 | char_literal59=(Token)match(input,52,FOLLOW_52_in_scopingRule3020); if (state.failed) return retval; |
2608 | if ( state.backtracking==0 ) { |
2609 | char_literal59_tree = (Object)adaptor.create(char_literal59); |
2610 | adaptor.addChild(root_0, char_literal59_tree); |
2611 | } |
2612 | string_literal60=(Token)match(input,54,FOLLOW_54_in_scopingRule3022); if (state.failed) return retval; |
2613 | if ( state.backtracking==0 ) { |
2614 | string_literal60_tree = (Object)adaptor.create(string_literal60); |
2615 | adaptor.addChild(root_0, string_literal60_tree); |
2616 | } |
2617 | char_literal61=(Token)match(input,55,FOLLOW_55_in_scopingRule3024); if (state.failed) return retval; |
2618 | if ( state.backtracking==0 ) { |
2619 | char_literal61_tree = (Object)adaptor.create(char_literal61); |
2620 | adaptor.addChild(root_0, char_literal61_tree); |
2621 | } |
2622 | prior=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_scopingRule3028); if (state.failed) return retval; |
2623 | if ( state.backtracking==0 ) { |
2624 | prior_tree = (Object)adaptor.create(prior); |
2625 | adaptor.addChild(root_0, prior_tree); |
2626 | } |
2627 | char_literal62=(Token)match(input,53,FOLLOW_53_in_scopingRule3030); if (state.failed) return retval; |
2628 | if ( state.backtracking==0 ) { |
2629 | char_literal62_tree = (Object)adaptor.create(char_literal62); |
2630 | adaptor.addChild(root_0, char_literal62_tree); |
2631 | } |
2632 | |
2633 | } |
2634 | break; |
2635 | |
2636 | } |
2637 | |
2638 | pushFollow(FOLLOW_literal_in_scopingRule3036); |
2639 | head=literal(); |
2640 | |
2641 | state._fsp--; |
2642 | if (state.failed) return retval; |
2643 | if ( state.backtracking==0 ) adaptor.addChild(root_0, head.getTree()); |
2644 | if ( state.backtracking==0 ) { |
2645 | |
2646 | retval.cq.setHead((head!=null?head.lit:null)); |
2647 | |
2648 | } |
2649 | string_literal63=(Token)match(input,56,FOLLOW_56_in_scopingRule3098); if (state.failed) return retval; |
2650 | if ( state.backtracking==0 ) { |
2651 | string_literal63_tree = (Object)adaptor.create(string_literal63); |
2652 | adaptor.addChild(root_0, string_literal63_tree); |
2653 | } |
2654 | pushFollow(FOLLOW_literal_in_scopingRule3102); |
2655 | body0=literal(); |
2656 | |
2657 | state._fsp--; |
2658 | if (state.failed) return retval; |
2659 | if ( state.backtracking==0 ) adaptor.addChild(root_0, body0.getTree()); |
2660 | if ( state.backtracking==0 ) { |
2661 | |
2662 | if ((body0!=null?body0.lit:null) != null) { |
2663 | retval.cq.addBodyLit((body0!=null?body0.lit:null)); |
2664 | } |
2665 | |
2666 | } |
2667 | // FELIX.g:659:3: ( ',' bodyp= literal )* |
2668 | loop37: |
2669 | do { |
2670 | int alt37=2; |
2671 | alt37 = dfa37.predict(input); |
2672 | switch (alt37) { |
2673 | case 1 : |
2674 | // FELIX.g:659:4: ',' bodyp= literal |
2675 | { |
2676 | char_literal64=(Token)match(input,27,FOLLOW_27_in_scopingRule3131); if (state.failed) return retval; |
2677 | if ( state.backtracking==0 ) { |
2678 | char_literal64_tree = (Object)adaptor.create(char_literal64); |
2679 | adaptor.addChild(root_0, char_literal64_tree); |
2680 | } |
2681 | pushFollow(FOLLOW_literal_in_scopingRule3135); |
2682 | bodyp=literal(); |
2683 | |
2684 | state._fsp--; |
2685 | if (state.failed) return retval; |
2686 | if ( state.backtracking==0 ) adaptor.addChild(root_0, bodyp.getTree()); |
2687 | if ( state.backtracking==0 ) { |
2688 | |
2689 | if ((bodyp!=null?bodyp.lit:null) != null) { |
2690 | retval.cq.addBodyLit((bodyp!=null?bodyp.lit:null)); |
2691 | } |
2692 | |
2693 | } |
2694 | |
2695 | } |
2696 | break; |
2697 | |
2698 | default : |
2699 | break loop37; |
2700 | } |
2701 | } while (true); |
2702 | |
2703 | // FELIX.g:664:26: ( ',' mc= mathComparison )* |
2704 | loop38: |
2705 | do { |
2706 | int alt38=2; |
2707 | int LA38_0 = input.LA(1); |
2708 | |
2709 | if ( (LA38_0==27) ) { |
2710 | int LA38_1 = input.LA(2); |
2711 | |
2712 | if ( (LA38_1==STRING||LA38_1==NUMBER||LA38_1==ID||LA38_1==26||LA38_1==57) ) { |
2713 | alt38=1; |
2714 | } |
2715 | |
2716 | |
2717 | } |
2718 | |
2719 | |
2720 | switch (alt38) { |
2721 | case 1 : |
2722 | // FELIX.g:664:27: ',' mc= mathComparison |
2723 | { |
2724 | char_literal65=(Token)match(input,27,FOLLOW_27_in_scopingRule3164); if (state.failed) return retval; |
2725 | if ( state.backtracking==0 ) { |
2726 | char_literal65_tree = (Object)adaptor.create(char_literal65); |
2727 | adaptor.addChild(root_0, char_literal65_tree); |
2728 | } |
2729 | pushFollow(FOLLOW_mathComparison_in_scopingRule3168); |
2730 | mc=mathComparison(); |
2731 | |
2732 | state._fsp--; |
2733 | if (state.failed) return retval; |
2734 | if ( state.backtracking==0 ) adaptor.addChild(root_0, mc.getTree()); |
2735 | if ( state.backtracking==0 ) { |
2736 | |
2737 | retval.cq.addConstraint((mc!=null?mc.expr:null)); |
2738 | |
2739 | } |
2740 | |
2741 | } |
2742 | break; |
2743 | |
2744 | default : |
2745 | break loop38; |
2746 | } |
2747 | } while (true); |
2748 | |
2749 | // FELIX.g:667:53: ( ',' '[' be= boolExpression ']' )? |
2750 | int alt39=2; |
2751 | int LA39_0 = input.LA(1); |
2752 | |
2753 | if ( (LA39_0==27) ) { |
2754 | alt39=1; |
2755 | } |
2756 | switch (alt39) { |
2757 | case 1 : |
2758 | // FELIX.g:667:54: ',' '[' be= boolExpression ']' |
2759 | { |
2760 | char_literal66=(Token)match(input,27,FOLLOW_27_in_scopingRule3224); if (state.failed) return retval; |
2761 | if ( state.backtracking==0 ) { |
2762 | char_literal66_tree = (Object)adaptor.create(char_literal66); |
2763 | adaptor.addChild(root_0, char_literal66_tree); |
2764 | } |
2765 | char_literal67=(Token)match(input,52,FOLLOW_52_in_scopingRule3226); if (state.failed) return retval; |
2766 | if ( state.backtracking==0 ) { |
2767 | char_literal67_tree = (Object)adaptor.create(char_literal67); |
2768 | adaptor.addChild(root_0, char_literal67_tree); |
2769 | } |
2770 | pushFollow(FOLLOW_boolExpression_in_scopingRule3230); |
2771 | be=boolExpression(); |
2772 | |
2773 | state._fsp--; |
2774 | if (state.failed) return retval; |
2775 | if ( state.backtracking==0 ) adaptor.addChild(root_0, be.getTree()); |
2776 | if ( state.backtracking==0 ) { |
2777 | |
2778 | retval.cq.addConstraint((be!=null?be.be:null)); |
2779 | |
2780 | } |
2781 | char_literal68=(Token)match(input,53,FOLLOW_53_in_scopingRule3318); if (state.failed) return retval; |
2782 | if ( state.backtracking==0 ) { |
2783 | char_literal68_tree = (Object)adaptor.create(char_literal68); |
2784 | adaptor.addChild(root_0, char_literal68_tree); |
2785 | } |
2786 | |
2787 | } |
2788 | break; |
2789 | |
2790 | } |
2791 | |
2792 | PERIOD69=(Token)match(input,PERIOD,FOLLOW_PERIOD_in_scopingRule3322); if (state.failed) return retval; |
2793 | if ( state.backtracking==0 ) { |
2794 | PERIOD69_tree = (Object)adaptor.create(PERIOD69); |
2795 | adaptor.addChild(root_0, PERIOD69_tree); |
2796 | } |
2797 | if ( state.backtracking==0 ) { |
2798 | |
2799 | if (prior != null) { |
2800 | double pr = Double.parseDouble((prior!=null?prior.getText():null)); |
2801 | if (pr > 1 || pr < 0) { |
2802 | die("Line #" + (lineOffset + prior.getLine()) + ": " + (prior!=null?prior.getText():null) |
2803 | + " - probabilities of soft evidence should be in [0,1]"); |
2804 | } else { |
2805 | retval.cq.setNewTuplePrior(pr); |
2806 | } |
2807 | } |
2808 | ml.addScopingRule(retval.cq); |
2809 | |
2810 | } |
2811 | |
2812 | } |
2813 | |
2814 | retval.stop = input.LT(-1); |
2815 | |
2816 | if ( state.backtracking==0 ) { |
2817 | |
2818 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
2819 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
2820 | } |
2821 | } |
2822 | catch (RecognitionException re) { |
2823 | reportError(re); |
2824 | recover(input,re); |
2825 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
2826 | |
2827 | } |
2828 | finally { |
2829 | if ( state.backtracking>0 ) { memoize(input, 14, scopingRule_StartIndex); } |
2830 | } |
2831 | return retval; |
2832 | } |
2833 | // $ANTLR end "scopingRule" |
2834 | |
2835 | public static class clusteringRule_return extends ParserRuleReturnScope { |
2836 | public ConjunctiveQuery cq = new ConjunctiveQuery();; |
2837 | Object tree; |
2838 | public Object getTree() { return tree; } |
2839 | }; |
2840 | |
2841 | // $ANTLR start "clusteringRule" |
2842 | // FELIX.g:686:1: clusteringRule returns [ConjunctiveQuery cq = new ConjunctiveQuery();] : (weight= NUMBER )? (et= '~' )? (st= '*' )? (vt= '$' )? head= literal conn= ( '<=' | '<-' | '<->' | '<@' | '<~' | '<!-' | '<CLASS-' | '<TAG-' | '<@-' | '<@=' | '<@~' ) body0= literal ( ',' bodyp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? PERIOD ; |
2843 | public final FELIXParser.clusteringRule_return clusteringRule() throws RecognitionException { |
2844 | FELIXParser.clusteringRule_return retval = new FELIXParser.clusteringRule_return(); |
2845 | retval.start = input.LT(1); |
2846 | int clusteringRule_StartIndex = input.index(); |
2847 | Object root_0 = null; |
2848 | |
2849 | Token weight=null; |
2850 | Token et=null; |
2851 | Token st=null; |
2852 | Token vt=null; |
2853 | Token conn=null; |
2854 | Token char_literal70=null; |
2855 | Token char_literal71=null; |
2856 | Token char_literal72=null; |
2857 | Token char_literal73=null; |
2858 | Token char_literal74=null; |
2859 | Token PERIOD75=null; |
2860 | FELIXParser.literal_return head = null; |
2861 | |
2862 | FELIXParser.literal_return body0 = null; |
2863 | |
2864 | FELIXParser.literal_return bodyp = null; |
2865 | |
2866 | FELIXParser.mathComparison_return mc = null; |
2867 | |
2868 | FELIXParser.boolExpression_return be = null; |
2869 | |
2870 | |
2871 | Object weight_tree=null; |
2872 | Object et_tree=null; |
2873 | Object st_tree=null; |
2874 | Object vt_tree=null; |
2875 | Object conn_tree=null; |
2876 | Object char_literal70_tree=null; |
2877 | Object char_literal71_tree=null; |
2878 | Object char_literal72_tree=null; |
2879 | Object char_literal73_tree=null; |
2880 | Object char_literal74_tree=null; |
2881 | Object PERIOD75_tree=null; |
2882 | |
2883 | try { |
2884 | if ( state.backtracking>0 && alreadyParsedRule(input, 15) ) { return retval; } |
2885 | // FELIX.g:687:3: ( (weight= NUMBER )? (et= '~' )? (st= '*' )? (vt= '$' )? head= literal conn= ( '<=' | '<-' | '<->' | '<@' | '<~' | '<!-' | '<CLASS-' | '<TAG-' | '<@-' | '<@=' | '<@~' ) body0= literal ( ',' bodyp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? PERIOD ) |
2886 | // FELIX.g:688:3: (weight= NUMBER )? (et= '~' )? (st= '*' )? (vt= '$' )? head= literal conn= ( '<=' | '<-' | '<->' | '<@' | '<~' | '<!-' | '<CLASS-' | '<TAG-' | '<@-' | '<@=' | '<@~' ) body0= literal ( ',' bodyp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? PERIOD |
2887 | { |
2888 | root_0 = (Object)adaptor.nil(); |
2889 | |
2890 | // FELIX.g:688:9: (weight= NUMBER )? |
2891 | int alt40=2; |
2892 | int LA40_0 = input.LA(1); |
2893 | |
2894 | if ( (LA40_0==NUMBER) ) { |
2895 | alt40=1; |
2896 | } |
2897 | switch (alt40) { |
2898 | case 1 : |
2899 | // FELIX.g:0:0: weight= NUMBER |
2900 | { |
2901 | weight=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_clusteringRule3363); if (state.failed) return retval; |
2902 | if ( state.backtracking==0 ) { |
2903 | weight_tree = (Object)adaptor.create(weight); |
2904 | adaptor.addChild(root_0, weight_tree); |
2905 | } |
2906 | |
2907 | } |
2908 | break; |
2909 | |
2910 | } |
2911 | |
2912 | // FELIX.g:688:18: (et= '~' )? |
2913 | int alt41=2; |
2914 | int LA41_0 = input.LA(1); |
2915 | |
2916 | if ( (LA41_0==57) ) { |
2917 | alt41=1; |
2918 | } |
2919 | switch (alt41) { |
2920 | case 1 : |
2921 | // FELIX.g:688:19: et= '~' |
2922 | { |
2923 | et=(Token)match(input,57,FOLLOW_57_in_clusteringRule3369); if (state.failed) return retval; |
2924 | if ( state.backtracking==0 ) { |
2925 | et_tree = (Object)adaptor.create(et); |
2926 | adaptor.addChild(root_0, et_tree); |
2927 | } |
2928 | |
2929 | } |
2930 | break; |
2931 | |
2932 | } |
2933 | |
2934 | // FELIX.g:688:28: (st= '*' )? |
2935 | int alt42=2; |
2936 | int LA42_0 = input.LA(1); |
2937 | |
2938 | if ( (LA42_0==ASTERISK) ) { |
2939 | alt42=1; |
2940 | } |
2941 | switch (alt42) { |
2942 | case 1 : |
2943 | // FELIX.g:688:29: st= '*' |
2944 | { |
2945 | st=(Token)match(input,ASTERISK,FOLLOW_ASTERISK_in_clusteringRule3376); if (state.failed) return retval; |
2946 | if ( state.backtracking==0 ) { |
2947 | st_tree = (Object)adaptor.create(st); |
2948 | adaptor.addChild(root_0, st_tree); |
2949 | } |
2950 | |
2951 | } |
2952 | break; |
2953 | |
2954 | } |
2955 | |
2956 | // FELIX.g:688:38: (vt= '$' )? |
2957 | int alt43=2; |
2958 | int LA43_0 = input.LA(1); |
2959 | |
2960 | if ( (LA43_0==50) ) { |
2961 | alt43=1; |
2962 | } |
2963 | switch (alt43) { |
2964 | case 1 : |
2965 | // FELIX.g:688:39: vt= '$' |
2966 | { |
2967 | vt=(Token)match(input,50,FOLLOW_50_in_clusteringRule3383); if (state.failed) return retval; |
2968 | if ( state.backtracking==0 ) { |
2969 | vt_tree = (Object)adaptor.create(vt); |
2970 | adaptor.addChild(root_0, vt_tree); |
2971 | } |
2972 | |
2973 | } |
2974 | break; |
2975 | |
2976 | } |
2977 | |
2978 | pushFollow(FOLLOW_literal_in_clusteringRule3389); |
2979 | head=literal(); |
2980 | |
2981 | state._fsp--; |
2982 | if (state.failed) return retval; |
2983 | if ( state.backtracking==0 ) adaptor.addChild(root_0, head.getTree()); |
2984 | if ( state.backtracking==0 ) { |
2985 | |
2986 | retval.cq.setHead((head!=null?head.lit:null)); |
2987 | |
2988 | } |
2989 | conn=(Token)input.LT(1); |
2990 | if ( (input.LA(1)>=58 && input.LA(1)<=68) ) { |
2991 | input.consume(); |
2992 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(conn)); |
2993 | state.errorRecovery=false;state.failed=false; |
2994 | } |
2995 | else { |
2996 | if (state.backtracking>0) {state.failed=true; return retval;} |
2997 | MismatchedSetException mse = new MismatchedSetException(null,input); |
2998 | throw mse; |
2999 | } |
3000 | |
3001 | pushFollow(FOLLOW_literal_in_clusteringRule3557); |
3002 | body0=literal(); |
3003 | |
3004 | state._fsp--; |
3005 | if (state.failed) return retval; |
3006 | if ( state.backtracking==0 ) adaptor.addChild(root_0, body0.getTree()); |
3007 | if ( state.backtracking==0 ) { |
3008 | |
3009 | if ((body0!=null?body0.lit:null) != null) { |
3010 | retval.cq.addBodyLit((body0!=null?body0.lit:null)); |
3011 | } |
3012 | |
3013 | } |
3014 | // FELIX.g:712:3: ( ',' bodyp= literal )* |
3015 | loop44: |
3016 | do { |
3017 | int alt44=2; |
3018 | alt44 = dfa44.predict(input); |
3019 | switch (alt44) { |
3020 | case 1 : |
3021 | // FELIX.g:712:4: ',' bodyp= literal |
3022 | { |
3023 | char_literal70=(Token)match(input,27,FOLLOW_27_in_clusteringRule3581); if (state.failed) return retval; |
3024 | if ( state.backtracking==0 ) { |
3025 | char_literal70_tree = (Object)adaptor.create(char_literal70); |
3026 | adaptor.addChild(root_0, char_literal70_tree); |
3027 | } |
3028 | pushFollow(FOLLOW_literal_in_clusteringRule3585); |
3029 | bodyp=literal(); |
3030 | |
3031 | state._fsp--; |
3032 | if (state.failed) return retval; |
3033 | if ( state.backtracking==0 ) adaptor.addChild(root_0, bodyp.getTree()); |
3034 | if ( state.backtracking==0 ) { |
3035 | |
3036 | if ((bodyp!=null?bodyp.lit:null) != null) { |
3037 | retval.cq.addBodyLit((bodyp!=null?bodyp.lit:null)); |
3038 | } |
3039 | |
3040 | } |
3041 | |
3042 | } |
3043 | break; |
3044 | |
3045 | default : |
3046 | break loop44; |
3047 | } |
3048 | } while (true); |
3049 | |
3050 | // FELIX.g:717:26: ( ',' mc= mathComparison )* |
3051 | loop45: |
3052 | do { |
3053 | int alt45=2; |
3054 | int LA45_0 = input.LA(1); |
3055 | |
3056 | if ( (LA45_0==27) ) { |
3057 | int LA45_1 = input.LA(2); |
3058 | |
3059 | if ( (LA45_1==STRING||LA45_1==NUMBER||LA45_1==ID||LA45_1==26||LA45_1==57) ) { |
3060 | alt45=1; |
3061 | } |
3062 | |
3063 | |
3064 | } |
3065 | |
3066 | |
3067 | switch (alt45) { |
3068 | case 1 : |
3069 | // FELIX.g:717:27: ',' mc= mathComparison |
3070 | { |
3071 | char_literal71=(Token)match(input,27,FOLLOW_27_in_clusteringRule3614); if (state.failed) return retval; |
3072 | if ( state.backtracking==0 ) { |
3073 | char_literal71_tree = (Object)adaptor.create(char_literal71); |
3074 | adaptor.addChild(root_0, char_literal71_tree); |
3075 | } |
3076 | pushFollow(FOLLOW_mathComparison_in_clusteringRule3618); |
3077 | mc=mathComparison(); |
3078 | |
3079 | state._fsp--; |
3080 | if (state.failed) return retval; |
3081 | if ( state.backtracking==0 ) adaptor.addChild(root_0, mc.getTree()); |
3082 | if ( state.backtracking==0 ) { |
3083 | |
3084 | retval.cq.addConstraint((mc!=null?mc.expr:null)); |
3085 | |
3086 | } |
3087 | |
3088 | } |
3089 | break; |
3090 | |
3091 | default : |
3092 | break loop45; |
3093 | } |
3094 | } while (true); |
3095 | |
3096 | // FELIX.g:720:53: ( ',' '[' be= boolExpression ']' )? |
3097 | int alt46=2; |
3098 | int LA46_0 = input.LA(1); |
3099 | |
3100 | if ( (LA46_0==27) ) { |
3101 | alt46=1; |
3102 | } |
3103 | switch (alt46) { |
3104 | case 1 : |
3105 | // FELIX.g:720:54: ',' '[' be= boolExpression ']' |
3106 | { |
3107 | char_literal72=(Token)match(input,27,FOLLOW_27_in_clusteringRule3674); if (state.failed) return retval; |
3108 | if ( state.backtracking==0 ) { |
3109 | char_literal72_tree = (Object)adaptor.create(char_literal72); |
3110 | adaptor.addChild(root_0, char_literal72_tree); |
3111 | } |
3112 | char_literal73=(Token)match(input,52,FOLLOW_52_in_clusteringRule3676); if (state.failed) return retval; |
3113 | if ( state.backtracking==0 ) { |
3114 | char_literal73_tree = (Object)adaptor.create(char_literal73); |
3115 | adaptor.addChild(root_0, char_literal73_tree); |
3116 | } |
3117 | pushFollow(FOLLOW_boolExpression_in_clusteringRule3680); |
3118 | be=boolExpression(); |
3119 | |
3120 | state._fsp--; |
3121 | if (state.failed) return retval; |
3122 | if ( state.backtracking==0 ) adaptor.addChild(root_0, be.getTree()); |
3123 | if ( state.backtracking==0 ) { |
3124 | |
3125 | retval.cq.addConstraint((be!=null?be.be:null)); |
3126 | |
3127 | } |
3128 | char_literal74=(Token)match(input,53,FOLLOW_53_in_clusteringRule3768); if (state.failed) return retval; |
3129 | if ( state.backtracking==0 ) { |
3130 | char_literal74_tree = (Object)adaptor.create(char_literal74); |
3131 | adaptor.addChild(root_0, char_literal74_tree); |
3132 | } |
3133 | |
3134 | } |
3135 | break; |
3136 | |
3137 | } |
3138 | |
3139 | PERIOD75=(Token)match(input,PERIOD,FOLLOW_PERIOD_in_clusteringRule3772); if (state.failed) return retval; |
3140 | if ( state.backtracking==0 ) { |
3141 | PERIOD75_tree = (Object)adaptor.create(PERIOD75); |
3142 | adaptor.addChild(root_0, PERIOD75_tree); |
3143 | } |
3144 | if ( state.backtracking==0 ) { |
3145 | |
3146 | if ((conn!=null?conn.getText():null).equals("<=")) { |
3147 | retval.cq.type = ConjunctiveQuery.CLUSTERING_RULE_TYPE.HARD; |
3148 | } else if ((conn!=null?conn.getText():null).equals("<-")) { |
3149 | retval.cq.type = ConjunctiveQuery.CLUSTERING_RULE_TYPE.SOFT_INCOMPLETE; |
3150 | } else if ((conn!=null?conn.getText():null).equals("<->")) { |
3151 | retval.cq.type = ConjunctiveQuery.CLUSTERING_RULE_TYPE.SOFT_COMPLETE; |
3152 | } else if ((conn!=null?conn.getText():null).equals("<@~")) { |
3153 | retval.cq.type = ConjunctiveQuery.CLUSTERING_RULE_TYPE.COULD_LINK_CLIQUE; |
3154 | } else if ((conn!=null?conn.getText():null).equals("<@=")) { |
3155 | retval.cq.type = ConjunctiveQuery.CLUSTERING_RULE_TYPE.MUST_LINK_CLIQUE; |
3156 | } else if ((conn!=null?conn.getText():null).equals("<@-")) { |
3157 | retval.cq.type = ConjunctiveQuery.CLUSTERING_RULE_TYPE.WOULD_LINK_CLIQUE; |
3158 | } else if ((conn!=null?conn.getText():null).equals("<~")) { |
3159 | retval.cq.type = ConjunctiveQuery.CLUSTERING_RULE_TYPE.COULD_LINK_PAIRWISE; |
3160 | } else if ((conn!=null?conn.getText():null).equals("<!-")) { |
3161 | retval.cq.type = ConjunctiveQuery.CLUSTERING_RULE_TYPE.NODE_LIST; |
3162 | } else if ((conn!=null?conn.getText():null).equals("<CLASS-")) { |
3163 | retval.cq.type = ConjunctiveQuery.CLUSTERING_RULE_TYPE.NODE_CLASS; |
3164 | } else if ((conn!=null?conn.getText():null).equals("<TAG-")) { |
3165 | retval.cq.type = ConjunctiveQuery.CLUSTERING_RULE_TYPE.CLASS_TAGS; |
3166 | } |
3167 | if ((weight!=null?weight.getText():null) != null) { |
3168 | retval.cq.setWeight(Double.parseDouble((weight!=null?weight.getText():null))); |
3169 | } |
3170 | |
3171 | if (vt != null) { |
3172 | if ((vt!=null?vt.getText():null).equals("$")) |
3173 | retval.cq.isView = true; |
3174 | } |
3175 | |
3176 | if (st != null) { |
3177 | if ((st!=null?st.getText():null).equals("*")) |
3178 | retval.cq.isStatic = true; |
3179 | } |
3180 | |
3181 | if (et != null) { |
3182 | if ((et!=null?et.getText():null).equals("~")) |
3183 | retval.cq.isFictitious = true; |
3184 | } |
3185 | |
3186 | ml.registerClusteringRule(retval.cq); |
3187 | UIMan.warn("Clustering Rules will be ignored if the head predicate is not recognized as coref predicate: " |
3188 | + retval.cq); |
3189 | |
3190 | } |
3191 | |
3192 | } |
3193 | |
3194 | retval.stop = input.LT(-1); |
3195 | |
3196 | if ( state.backtracking==0 ) { |
3197 | |
3198 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
3199 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
3200 | } |
3201 | } |
3202 | catch (RecognitionException re) { |
3203 | reportError(re); |
3204 | recover(input,re); |
3205 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
3206 | |
3207 | } |
3208 | finally { |
3209 | if ( state.backtracking>0 ) { memoize(input, 15, clusteringRule_StartIndex); } |
3210 | } |
3211 | return retval; |
3212 | } |
3213 | // $ANTLR end "clusteringRule" |
3214 | |
3215 | public static class foclause_return extends ParserRuleReturnScope { |
3216 | public FelixClause c = new FelixClause(); |
3217 | Object tree; |
3218 | public Object getTree() { return tree; } |
3219 | }; |
3220 | |
3221 | // $ANTLR start "foclause" |
3222 | // FELIX.g:772:1: foclause returns [FelixClause c = new FelixClause()] : (exq= existQuan )? (ant0= literal ( ',' antp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? IMPLIES )? lit0= literal ( 'v' litp= literal )* ( 'v' mc= mathComparison )* ( 'v' '[' sbe= boolExpression ']' )? ; |
3223 | public final FELIXParser.foclause_return foclause() throws RecognitionException { |
3224 | FELIXParser.foclause_return retval = new FELIXParser.foclause_return(); |
3225 | retval.start = input.LT(1); |
3226 | int foclause_StartIndex = input.index(); |
3227 | Object root_0 = null; |
3228 | |
3229 | Token char_literal76=null; |
3230 | Token char_literal77=null; |
3231 | Token char_literal78=null; |
3232 | Token char_literal79=null; |
3233 | Token char_literal80=null; |
3234 | Token IMPLIES81=null; |
3235 | Token char_literal82=null; |
3236 | Token char_literal83=null; |
3237 | Token char_literal84=null; |
3238 | Token char_literal85=null; |
3239 | Token char_literal86=null; |
3240 | FELIXParser.existQuan_return exq = null; |
3241 | |
3242 | FELIXParser.literal_return ant0 = null; |
3243 | |
3244 | FELIXParser.literal_return antp = null; |
3245 | |
3246 | FELIXParser.mathComparison_return mc = null; |
3247 | |
3248 | FELIXParser.boolExpression_return be = null; |
3249 | |
3250 | FELIXParser.literal_return lit0 = null; |
3251 | |
3252 | FELIXParser.literal_return litp = null; |
3253 | |
3254 | FELIXParser.boolExpression_return sbe = null; |
3255 | |
3256 | |
3257 | Object char_literal76_tree=null; |
3258 | Object char_literal77_tree=null; |
3259 | Object char_literal78_tree=null; |
3260 | Object char_literal79_tree=null; |
3261 | Object char_literal80_tree=null; |
3262 | Object IMPLIES81_tree=null; |
3263 | Object char_literal82_tree=null; |
3264 | Object char_literal83_tree=null; |
3265 | Object char_literal84_tree=null; |
3266 | Object char_literal85_tree=null; |
3267 | Object char_literal86_tree=null; |
3268 | |
3269 | try { |
3270 | if ( state.backtracking>0 && alreadyParsedRule(input, 16) ) { return retval; } |
3271 | // FELIX.g:773:3: ( (exq= existQuan )? (ant0= literal ( ',' antp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? IMPLIES )? lit0= literal ( 'v' litp= literal )* ( 'v' mc= mathComparison )* ( 'v' '[' sbe= boolExpression ']' )? ) |
3272 | // FELIX.g:774:3: (exq= existQuan )? (ant0= literal ( ',' antp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? IMPLIES )? lit0= literal ( 'v' litp= literal )* ( 'v' mc= mathComparison )* ( 'v' '[' sbe= boolExpression ']' )? |
3273 | { |
3274 | root_0 = (Object)adaptor.nil(); |
3275 | |
3276 | // FELIX.g:774:6: (exq= existQuan )? |
3277 | int alt47=2; |
3278 | int LA47_0 = input.LA(1); |
3279 | |
3280 | if ( (LA47_0==EXIST) ) { |
3281 | alt47=1; |
3282 | } |
3283 | switch (alt47) { |
3284 | case 1 : |
3285 | // FELIX.g:0:0: exq= existQuan |
3286 | { |
3287 | pushFollow(FOLLOW_existQuan_in_foclause3813); |
3288 | exq=existQuan(); |
3289 | |
3290 | state._fsp--; |
3291 | if (state.failed) return retval; |
3292 | if ( state.backtracking==0 ) adaptor.addChild(root_0, exq.getTree()); |
3293 | |
3294 | } |
3295 | break; |
3296 | |
3297 | } |
3298 | |
3299 | // FELIX.g:775:3: (ant0= literal ( ',' antp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? IMPLIES )? |
3300 | int alt51=2; |
3301 | alt51 = dfa51.predict(input); |
3302 | switch (alt51) { |
3303 | case 1 : |
3304 | // FELIX.g:776:5: ant0= literal ( ',' antp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? IMPLIES |
3305 | { |
3306 | pushFollow(FOLLOW_literal_in_foclause3826); |
3307 | ant0=literal(); |
3308 | |
3309 | state._fsp--; |
3310 | if (state.failed) return retval; |
3311 | if ( state.backtracking==0 ) adaptor.addChild(root_0, ant0.getTree()); |
3312 | if ( state.backtracking==0 ) { |
3313 | |
3314 | if ((ant0!=null?ant0.lit:null) != null) { |
3315 | (ant0!=null?ant0.lit:null).flipSense(); |
3316 | retval.c.addLiteral((ant0!=null?ant0.lit:null)); |
3317 | } |
3318 | |
3319 | } |
3320 | // FELIX.g:783:5: ( ',' antp= literal )* |
3321 | loop48: |
3322 | do { |
3323 | int alt48=2; |
3324 | alt48 = dfa48.predict(input); |
3325 | switch (alt48) { |
3326 | case 1 : |
3327 | // FELIX.g:783:6: ',' antp= literal |
3328 | { |
3329 | char_literal76=(Token)match(input,27,FOLLOW_27_in_foclause3853); if (state.failed) return retval; |
3330 | if ( state.backtracking==0 ) { |
3331 | char_literal76_tree = (Object)adaptor.create(char_literal76); |
3332 | adaptor.addChild(root_0, char_literal76_tree); |
3333 | } |
3334 | pushFollow(FOLLOW_literal_in_foclause3857); |
3335 | antp=literal(); |
3336 | |
3337 | state._fsp--; |
3338 | if (state.failed) return retval; |
3339 | if ( state.backtracking==0 ) adaptor.addChild(root_0, antp.getTree()); |
3340 | if ( state.backtracking==0 ) { |
3341 | |
3342 | if ((antp!=null?antp.lit:null) != null) { |
3343 | (antp!=null?antp.lit:null).flipSense(); |
3344 | retval.c.addLiteral((antp!=null?antp.lit:null)); |
3345 | } |
3346 | |
3347 | } |
3348 | |
3349 | } |
3350 | break; |
3351 | |
3352 | default : |
3353 | break loop48; |
3354 | } |
3355 | } while (true); |
3356 | |
3357 | // FELIX.g:789:27: ( ',' mc= mathComparison )* |
3358 | loop49: |
3359 | do { |
3360 | int alt49=2; |
3361 | int LA49_0 = input.LA(1); |
3362 | |
3363 | if ( (LA49_0==27) ) { |
3364 | int LA49_1 = input.LA(2); |
3365 | |
3366 | if ( (LA49_1==STRING||LA49_1==NUMBER||LA49_1==ID||LA49_1==26||LA49_1==57) ) { |
3367 | alt49=1; |
3368 | } |
3369 | |
3370 | |
3371 | } |
3372 | |
3373 | |
3374 | switch (alt49) { |
3375 | case 1 : |
3376 | // FELIX.g:789:28: ',' mc= mathComparison |
3377 | { |
3378 | char_literal77=(Token)match(input,27,FOLLOW_27_in_foclause3887); if (state.failed) return retval; |
3379 | if ( state.backtracking==0 ) { |
3380 | char_literal77_tree = (Object)adaptor.create(char_literal77); |
3381 | adaptor.addChild(root_0, char_literal77_tree); |
3382 | } |
3383 | pushFollow(FOLLOW_mathComparison_in_foclause3891); |
3384 | mc=mathComparison(); |
3385 | |
3386 | state._fsp--; |
3387 | if (state.failed) return retval; |
3388 | if ( state.backtracking==0 ) adaptor.addChild(root_0, mc.getTree()); |
3389 | if ( state.backtracking==0 ) { |
3390 | |
3391 | retval.c.addConstraint((mc!=null?mc.expr:null)); |
3392 | |
3393 | } |
3394 | |
3395 | } |
3396 | break; |
3397 | |
3398 | default : |
3399 | break loop49; |
3400 | } |
3401 | } while (true); |
3402 | |
3403 | // FELIX.g:792:54: ( ',' '[' be= boolExpression ']' )? |
3404 | int alt50=2; |
3405 | int LA50_0 = input.LA(1); |
3406 | |
3407 | if ( (LA50_0==27) ) { |
3408 | alt50=1; |
3409 | } |
3410 | switch (alt50) { |
3411 | case 1 : |
3412 | // FELIX.g:792:55: ',' '[' be= boolExpression ']' |
3413 | { |
3414 | char_literal78=(Token)match(input,27,FOLLOW_27_in_foclause3948); if (state.failed) return retval; |
3415 | if ( state.backtracking==0 ) { |
3416 | char_literal78_tree = (Object)adaptor.create(char_literal78); |
3417 | adaptor.addChild(root_0, char_literal78_tree); |
3418 | } |
3419 | char_literal79=(Token)match(input,52,FOLLOW_52_in_foclause3950); if (state.failed) return retval; |
3420 | if ( state.backtracking==0 ) { |
3421 | char_literal79_tree = (Object)adaptor.create(char_literal79); |
3422 | adaptor.addChild(root_0, char_literal79_tree); |
3423 | } |
3424 | pushFollow(FOLLOW_boolExpression_in_foclause3954); |
3425 | be=boolExpression(); |
3426 | |
3427 | state._fsp--; |
3428 | if (state.failed) return retval; |
3429 | if ( state.backtracking==0 ) adaptor.addChild(root_0, be.getTree()); |
3430 | if ( state.backtracking==0 ) { |
3431 | |
3432 | retval.c.addConstraint((be!=null?be.be:null)); |
3433 | |
3434 | } |
3435 | char_literal80=(Token)match(input,53,FOLLOW_53_in_foclause4045); if (state.failed) return retval; |
3436 | if ( state.backtracking==0 ) { |
3437 | char_literal80_tree = (Object)adaptor.create(char_literal80); |
3438 | adaptor.addChild(root_0, char_literal80_tree); |
3439 | } |
3440 | |
3441 | } |
3442 | break; |
3443 | |
3444 | } |
3445 | |
3446 | IMPLIES81=(Token)match(input,IMPLIES,FOLLOW_IMPLIES_in_foclause4049); if (state.failed) return retval; |
3447 | if ( state.backtracking==0 ) { |
3448 | IMPLIES81_tree = (Object)adaptor.create(IMPLIES81); |
3449 | adaptor.addChild(root_0, IMPLIES81_tree); |
3450 | } |
3451 | |
3452 | } |
3453 | break; |
3454 | |
3455 | } |
3456 | |
3457 | pushFollow(FOLLOW_literal_in_foclause4060); |
3458 | lit0=literal(); |
3459 | |
3460 | state._fsp--; |
3461 | if (state.failed) return retval; |
3462 | if ( state.backtracking==0 ) adaptor.addChild(root_0, lit0.getTree()); |
3463 | if ( state.backtracking==0 ) { |
3464 | |
3465 | retval.c.addLiteral((lit0!=null?lit0.lit:null)); |
3466 | |
3467 | } |
3468 | // FELIX.g:802:3: ( 'v' litp= literal )* |
3469 | loop52: |
3470 | do { |
3471 | int alt52=2; |
3472 | alt52 = dfa52.predict(input); |
3473 | switch (alt52) { |
3474 | case 1 : |
3475 | // FELIX.g:802:4: 'v' litp= literal |
3476 | { |
3477 | char_literal82=(Token)match(input,69,FOLLOW_69_in_foclause4083); if (state.failed) return retval; |
3478 | if ( state.backtracking==0 ) { |
3479 | char_literal82_tree = (Object)adaptor.create(char_literal82); |
3480 | adaptor.addChild(root_0, char_literal82_tree); |
3481 | } |
3482 | pushFollow(FOLLOW_literal_in_foclause4087); |
3483 | litp=literal(); |
3484 | |
3485 | state._fsp--; |
3486 | if (state.failed) return retval; |
3487 | if ( state.backtracking==0 ) adaptor.addChild(root_0, litp.getTree()); |
3488 | if ( state.backtracking==0 ) { |
3489 | |
3490 | retval.c.addLiteral((litp!=null?litp.lit:null)); |
3491 | |
3492 | } |
3493 | |
3494 | } |
3495 | break; |
3496 | |
3497 | default : |
3498 | break loop52; |
3499 | } |
3500 | } while (true); |
3501 | |
3502 | // FELIX.g:805:25: ( 'v' mc= mathComparison )* |
3503 | loop53: |
3504 | do { |
3505 | int alt53=2; |
3506 | int LA53_0 = input.LA(1); |
3507 | |
3508 | if ( (LA53_0==69) ) { |
3509 | int LA53_1 = input.LA(2); |
3510 | |
3511 | if ( (LA53_1==STRING||LA53_1==NUMBER||LA53_1==ID||LA53_1==26||LA53_1==57) ) { |
3512 | alt53=1; |
3513 | } |
3514 | |
3515 | |
3516 | } |
3517 | |
3518 | |
3519 | switch (alt53) { |
3520 | case 1 : |
3521 | // FELIX.g:805:26: 'v' mc= mathComparison |
3522 | { |
3523 | char_literal83=(Token)match(input,69,FOLLOW_69_in_foclause4115); if (state.failed) return retval; |
3524 | if ( state.backtracking==0 ) { |
3525 | char_literal83_tree = (Object)adaptor.create(char_literal83); |
3526 | adaptor.addChild(root_0, char_literal83_tree); |
3527 | } |
3528 | pushFollow(FOLLOW_mathComparison_in_foclause4119); |
3529 | mc=mathComparison(); |
3530 | |
3531 | state._fsp--; |
3532 | if (state.failed) return retval; |
3533 | if ( state.backtracking==0 ) adaptor.addChild(root_0, mc.getTree()); |
3534 | if ( state.backtracking==0 ) { |
3535 | |
3536 | retval.c.addConstraint(Expression.not((mc!=null?mc.expr:null))); |
3537 | |
3538 | } |
3539 | |
3540 | } |
3541 | break; |
3542 | |
3543 | default : |
3544 | break loop53; |
3545 | } |
3546 | } while (true); |
3547 | |
3548 | // FELIX.g:808:52: ( 'v' '[' sbe= boolExpression ']' )? |
3549 | int alt54=2; |
3550 | int LA54_0 = input.LA(1); |
3551 | |
3552 | if ( (LA54_0==69) ) { |
3553 | alt54=1; |
3554 | } |
3555 | switch (alt54) { |
3556 | case 1 : |
3557 | // FELIX.g:808:53: 'v' '[' sbe= boolExpression ']' |
3558 | { |
3559 | char_literal84=(Token)match(input,69,FOLLOW_69_in_foclause4174); if (state.failed) return retval; |
3560 | if ( state.backtracking==0 ) { |
3561 | char_literal84_tree = (Object)adaptor.create(char_literal84); |
3562 | adaptor.addChild(root_0, char_literal84_tree); |
3563 | } |
3564 | char_literal85=(Token)match(input,52,FOLLOW_52_in_foclause4176); if (state.failed) return retval; |
3565 | if ( state.backtracking==0 ) { |
3566 | char_literal85_tree = (Object)adaptor.create(char_literal85); |
3567 | adaptor.addChild(root_0, char_literal85_tree); |
3568 | } |
3569 | pushFollow(FOLLOW_boolExpression_in_foclause4180); |
3570 | sbe=boolExpression(); |
3571 | |
3572 | state._fsp--; |
3573 | if (state.failed) return retval; |
3574 | if ( state.backtracking==0 ) adaptor.addChild(root_0, sbe.getTree()); |
3575 | if ( state.backtracking==0 ) { |
3576 | |
3577 | retval.c.addConstraint(Expression.not((sbe!=null?sbe.be:null))); |
3578 | |
3579 | } |
3580 | char_literal86=(Token)match(input,53,FOLLOW_53_in_foclause4268); if (state.failed) return retval; |
3581 | if ( state.backtracking==0 ) { |
3582 | char_literal86_tree = (Object)adaptor.create(char_literal86); |
3583 | adaptor.addChild(root_0, char_literal86_tree); |
3584 | } |
3585 | |
3586 | } |
3587 | break; |
3588 | |
3589 | } |
3590 | |
3591 | if ( state.backtracking==0 ) { |
3592 | |
3593 | if (exq != null) { |
3594 | for (String v : exq.vars) { |
3595 | retval.c.addExistentialVariable(v); |
3596 | } |
3597 | } |
3598 | retval.c.addUserProvidedName(clauseName); |
3599 | if (!clauseLabelTrailing) |
3600 | clauseName = null; |
3601 | |
3602 | } |
3603 | |
3604 | } |
3605 | |
3606 | retval.stop = input.LT(-1); |
3607 | |
3608 | if ( state.backtracking==0 ) { |
3609 | |
3610 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
3611 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
3612 | } |
3613 | } |
3614 | catch (RecognitionException re) { |
3615 | reportError(re); |
3616 | recover(input,re); |
3617 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
3618 | |
3619 | } |
3620 | finally { |
3621 | if ( state.backtracking>0 ) { memoize(input, 16, foclause_StartIndex); } |
3622 | } |
3623 | return retval; |
3624 | } |
3625 | // $ANTLR end "foclause" |
3626 | |
3627 | public static class existQuan_return extends ParserRuleReturnScope { |
3628 | public ArrayList<String> vars = new ArrayList<String>(); |
3629 | Object tree; |
3630 | public Object getTree() { return tree; } |
3631 | }; |
3632 | |
3633 | // $ANTLR start "existQuan" |
3634 | // FELIX.g:825:1: existQuan returns [ArrayList<String> vars = new ArrayList<String>()] : EXIST v0= ID ( ',' vp= ID )* ; |
3635 | public final FELIXParser.existQuan_return existQuan() throws RecognitionException { |
3636 | FELIXParser.existQuan_return retval = new FELIXParser.existQuan_return(); |
3637 | retval.start = input.LT(1); |
3638 | int existQuan_StartIndex = input.index(); |
3639 | Object root_0 = null; |
3640 | |
3641 | Token v0=null; |
3642 | Token vp=null; |
3643 | Token EXIST87=null; |
3644 | Token char_literal88=null; |
3645 | |
3646 | Object v0_tree=null; |
3647 | Object vp_tree=null; |
3648 | Object EXIST87_tree=null; |
3649 | Object char_literal88_tree=null; |
3650 | |
3651 | try { |
3652 | if ( state.backtracking>0 && alreadyParsedRule(input, 17) ) { return retval; } |
3653 | // FELIX.g:826:3: ( EXIST v0= ID ( ',' vp= ID )* ) |
3654 | // FELIX.g:827:3: EXIST v0= ID ( ',' vp= ID )* |
3655 | { |
3656 | root_0 = (Object)adaptor.nil(); |
3657 | |
3658 | EXIST87=(Token)match(input,EXIST,FOLLOW_EXIST_in_existQuan4302); if (state.failed) return retval; |
3659 | if ( state.backtracking==0 ) { |
3660 | EXIST87_tree = (Object)adaptor.create(EXIST87); |
3661 | adaptor.addChild(root_0, EXIST87_tree); |
3662 | } |
3663 | v0=(Token)match(input,ID,FOLLOW_ID_in_existQuan4306); if (state.failed) return retval; |
3664 | if ( state.backtracking==0 ) { |
3665 | v0_tree = (Object)adaptor.create(v0); |
3666 | adaptor.addChild(root_0, v0_tree); |
3667 | } |
3668 | if ( state.backtracking==0 ) { |
3669 | |
3670 | retval.vars.add((v0!=null?v0.getText():null)); |
3671 | |
3672 | } |
3673 | // FELIX.g:831:3: ( ',' vp= ID )* |
3674 | loop55: |
3675 | do { |
3676 | int alt55=2; |
3677 | int LA55_0 = input.LA(1); |
3678 | |
3679 | if ( (LA55_0==27) ) { |
3680 | alt55=1; |
3681 | } |
3682 | |
3683 | |
3684 | switch (alt55) { |
3685 | case 1 : |
3686 | // FELIX.g:831:4: ',' vp= ID |
3687 | { |
3688 | char_literal88=(Token)match(input,27,FOLLOW_27_in_existQuan4328); if (state.failed) return retval; |
3689 | if ( state.backtracking==0 ) { |
3690 | char_literal88_tree = (Object)adaptor.create(char_literal88); |
3691 | adaptor.addChild(root_0, char_literal88_tree); |
3692 | } |
3693 | vp=(Token)match(input,ID,FOLLOW_ID_in_existQuan4332); if (state.failed) return retval; |
3694 | if ( state.backtracking==0 ) { |
3695 | vp_tree = (Object)adaptor.create(vp); |
3696 | adaptor.addChild(root_0, vp_tree); |
3697 | } |
3698 | if ( state.backtracking==0 ) { |
3699 | |
3700 | retval.vars.add((vp!=null?vp.getText():null)); |
3701 | |
3702 | } |
3703 | |
3704 | } |
3705 | break; |
3706 | |
3707 | default : |
3708 | break loop55; |
3709 | } |
3710 | } while (true); |
3711 | |
3712 | |
3713 | } |
3714 | |
3715 | retval.stop = input.LT(-1); |
3716 | |
3717 | if ( state.backtracking==0 ) { |
3718 | |
3719 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
3720 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
3721 | } |
3722 | } |
3723 | catch (RecognitionException re) { |
3724 | reportError(re); |
3725 | recover(input,re); |
3726 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
3727 | |
3728 | } |
3729 | finally { |
3730 | if ( state.backtracking>0 ) { memoize(input, 17, existQuan_StartIndex); } |
3731 | } |
3732 | return retval; |
3733 | } |
3734 | // $ANTLR end "existQuan" |
3735 | |
3736 | public static class expression_return extends ParserRuleReturnScope { |
3737 | public Expression expr; |
3738 | Object tree; |
3739 | public Object getTree() { return tree; } |
3740 | }; |
3741 | |
3742 | // $ANTLR start "expression" |
3743 | // FELIX.g:837:1: expression returns [Expression expr] : be= mathExpression ; |
3744 | public final FELIXParser.expression_return expression() throws RecognitionException { |
3745 | FELIXParser.expression_return retval = new FELIXParser.expression_return(); |
3746 | retval.start = input.LT(1); |
3747 | int expression_StartIndex = input.index(); |
3748 | Object root_0 = null; |
3749 | |
3750 | FELIXParser.mathExpression_return be = null; |
3751 | |
3752 | |
3753 | |
3754 | try { |
3755 | if ( state.backtracking>0 && alreadyParsedRule(input, 18) ) { return retval; } |
3756 | // FELIX.g:838:3: (be= mathExpression ) |
3757 | // FELIX.g:839:3: be= mathExpression |
3758 | { |
3759 | root_0 = (Object)adaptor.nil(); |
3760 | |
3761 | pushFollow(FOLLOW_mathExpression_in_expression4371); |
3762 | be=mathExpression(); |
3763 | |
3764 | state._fsp--; |
3765 | if (state.failed) return retval; |
3766 | if ( state.backtracking==0 ) adaptor.addChild(root_0, be.getTree()); |
3767 | |
3768 | } |
3769 | |
3770 | retval.stop = input.LT(-1); |
3771 | |
3772 | if ( state.backtracking==0 ) { |
3773 | |
3774 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
3775 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
3776 | } |
3777 | } |
3778 | catch (RecognitionException re) { |
3779 | reportError(re); |
3780 | recover(input,re); |
3781 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
3782 | |
3783 | } |
3784 | finally { |
3785 | if ( state.backtracking>0 ) { memoize(input, 18, expression_StartIndex); } |
3786 | } |
3787 | return retval; |
3788 | } |
3789 | // $ANTLR end "expression" |
3790 | |
3791 | public static class boolExpression_return extends ParserRuleReturnScope { |
3792 | public Expression be; |
3793 | Object tree; |
3794 | public Object getTree() { return tree; } |
3795 | }; |
3796 | |
3797 | // $ANTLR start "boolExpression" |
3798 | // FELIX.g:842:1: boolExpression returns [Expression be] : c0= boolConjunction ( ( '||' | 'OR' ) cp= boolConjunction )* ; |
3799 | public final FELIXParser.boolExpression_return boolExpression() throws RecognitionException { |
3800 | FELIXParser.boolExpression_return retval = new FELIXParser.boolExpression_return(); |
3801 | retval.start = input.LT(1); |
3802 | int boolExpression_StartIndex = input.index(); |
3803 | Object root_0 = null; |
3804 | |
3805 | Token set89=null; |
3806 | FELIXParser.boolConjunction_return c0 = null; |
3807 | |
3808 | FELIXParser.boolConjunction_return cp = null; |
3809 | |
3810 | |
3811 | Object set89_tree=null; |
3812 | |
3813 | try { |
3814 | if ( state.backtracking>0 && alreadyParsedRule(input, 19) ) { return retval; } |
3815 | // FELIX.g:843:3: (c0= boolConjunction ( ( '||' | 'OR' ) cp= boolConjunction )* ) |
3816 | // FELIX.g:844:3: c0= boolConjunction ( ( '||' | 'OR' ) cp= boolConjunction )* |
3817 | { |
3818 | root_0 = (Object)adaptor.nil(); |
3819 | |
3820 | pushFollow(FOLLOW_boolConjunction_in_boolExpression4392); |
3821 | c0=boolConjunction(); |
3822 | |
3823 | state._fsp--; |
3824 | if (state.failed) return retval; |
3825 | if ( state.backtracking==0 ) adaptor.addChild(root_0, c0.getTree()); |
3826 | if ( state.backtracking==0 ) { |
3827 | |
3828 | retval.be = (c0!=null?c0.be:null); |
3829 | |
3830 | } |
3831 | // FELIX.g:848:3: ( ( '||' | 'OR' ) cp= boolConjunction )* |
3832 | loop56: |
3833 | do { |
3834 | int alt56=2; |
3835 | int LA56_0 = input.LA(1); |
3836 | |
3837 | if ( ((LA56_0>=70 && LA56_0<=71)) ) { |
3838 | alt56=1; |
3839 | } |
3840 | |
3841 | |
3842 | switch (alt56) { |
3843 | case 1 : |
3844 | // FELIX.g:849:5: ( '||' | 'OR' ) cp= boolConjunction |
3845 | { |
3846 | set89=(Token)input.LT(1); |
3847 | if ( (input.LA(1)>=70 && input.LA(1)<=71) ) { |
3848 | input.consume(); |
3849 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set89)); |
3850 | state.errorRecovery=false;state.failed=false; |
3851 | } |
3852 | else { |
3853 | if (state.backtracking>0) {state.failed=true; return retval;} |
3854 | MismatchedSetException mse = new MismatchedSetException(null,input); |
3855 | throw mse; |
3856 | } |
3857 | |
3858 | pushFollow(FOLLOW_boolConjunction_in_boolExpression4458); |
3859 | cp=boolConjunction(); |
3860 | |
3861 | state._fsp--; |
3862 | if (state.failed) return retval; |
3863 | if ( state.backtracking==0 ) adaptor.addChild(root_0, cp.getTree()); |
3864 | if ( state.backtracking==0 ) { |
3865 | |
3866 | Expression enew = new Expression(Function.OR); |
3867 | enew.addArgument(retval.be); |
3868 | enew.addArgument((cp!=null?cp.be:null)); |
3869 | retval.be = enew; |
3870 | |
3871 | } |
3872 | |
3873 | } |
3874 | break; |
3875 | |
3876 | default : |
3877 | break loop56; |
3878 | } |
3879 | } while (true); |
3880 | |
3881 | |
3882 | } |
3883 | |
3884 | retval.stop = input.LT(-1); |
3885 | |
3886 | if ( state.backtracking==0 ) { |
3887 | |
3888 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
3889 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
3890 | } |
3891 | } |
3892 | catch (RecognitionException re) { |
3893 | reportError(re); |
3894 | recover(input,re); |
3895 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
3896 | |
3897 | } |
3898 | finally { |
3899 | if ( state.backtracking>0 ) { memoize(input, 19, boolExpression_StartIndex); } |
3900 | } |
3901 | return retval; |
3902 | } |
3903 | // $ANTLR end "boolExpression" |
3904 | |
3905 | public static class boolConjunction_return extends ParserRuleReturnScope { |
3906 | public Expression be; |
3907 | Object tree; |
3908 | public Object getTree() { return tree; } |
3909 | }; |
3910 | |
3911 | // $ANTLR start "boolConjunction" |
3912 | // FELIX.g:863:1: boolConjunction returns [Expression be] : c0= boolConjunctionElement ( ( '&&' | 'AND' ) cp= boolConjunctionElement )* ; |
3913 | public final FELIXParser.boolConjunction_return boolConjunction() throws RecognitionException { |
3914 | FELIXParser.boolConjunction_return retval = new FELIXParser.boolConjunction_return(); |
3915 | retval.start = input.LT(1); |
3916 | int boolConjunction_StartIndex = input.index(); |
3917 | Object root_0 = null; |
3918 | |
3919 | Token set90=null; |
3920 | FELIXParser.boolConjunctionElement_return c0 = null; |
3921 | |
3922 | FELIXParser.boolConjunctionElement_return cp = null; |
3923 | |
3924 | |
3925 | Object set90_tree=null; |
3926 | |
3927 | try { |
3928 | if ( state.backtracking>0 && alreadyParsedRule(input, 20) ) { return retval; } |
3929 | // FELIX.g:864:3: (c0= boolConjunctionElement ( ( '&&' | 'AND' ) cp= boolConjunctionElement )* ) |
3930 | // FELIX.g:865:3: c0= boolConjunctionElement ( ( '&&' | 'AND' ) cp= boolConjunctionElement )* |
3931 | { |
3932 | root_0 = (Object)adaptor.nil(); |
3933 | |
3934 | pushFollow(FOLLOW_boolConjunctionElement_in_boolConjunction4510); |
3935 | c0=boolConjunctionElement(); |
3936 | |
3937 | state._fsp--; |
3938 | if (state.failed) return retval; |
3939 | if ( state.backtracking==0 ) adaptor.addChild(root_0, c0.getTree()); |
3940 | if ( state.backtracking==0 ) { |
3941 | |
3942 | retval.be = (c0!=null?c0.be:null); |
3943 | |
3944 | } |
3945 | // FELIX.g:869:3: ( ( '&&' | 'AND' ) cp= boolConjunctionElement )* |
3946 | loop57: |
3947 | do { |
3948 | int alt57=2; |
3949 | int LA57_0 = input.LA(1); |
3950 | |
3951 | if ( ((LA57_0>=72 && LA57_0<=73)) ) { |
3952 | alt57=1; |
3953 | } |
3954 | |
3955 | |
3956 | switch (alt57) { |
3957 | case 1 : |
3958 | // FELIX.g:870:5: ( '&&' | 'AND' ) cp= boolConjunctionElement |
3959 | { |
3960 | set90=(Token)input.LT(1); |
3961 | if ( (input.LA(1)>=72 && input.LA(1)<=73) ) { |
3962 | input.consume(); |
3963 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set90)); |
3964 | state.errorRecovery=false;state.failed=false; |
3965 | } |
3966 | else { |
3967 | if (state.backtracking>0) {state.failed=true; return retval;} |
3968 | MismatchedSetException mse = new MismatchedSetException(null,input); |
3969 | throw mse; |
3970 | } |
3971 | |
3972 | pushFollow(FOLLOW_boolConjunctionElement_in_boolConjunction4583); |
3973 | cp=boolConjunctionElement(); |
3974 | |
3975 | state._fsp--; |
3976 | if (state.failed) return retval; |
3977 | if ( state.backtracking==0 ) adaptor.addChild(root_0, cp.getTree()); |
3978 | if ( state.backtracking==0 ) { |
3979 | |
3980 | Expression enew = new Expression(Function.AND); |
3981 | enew.addArgument(retval.be); |
3982 | enew.addArgument((cp!=null?cp.be:null)); |
3983 | retval.be = enew; |
3984 | |
3985 | } |
3986 | |
3987 | } |
3988 | break; |
3989 | |
3990 | default : |
3991 | break loop57; |
3992 | } |
3993 | } while (true); |
3994 | |
3995 | |
3996 | } |
3997 | |
3998 | retval.stop = input.LT(-1); |
3999 | |
4000 | if ( state.backtracking==0 ) { |
4001 | |
4002 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
4003 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
4004 | } |
4005 | } |
4006 | catch (RecognitionException re) { |
4007 | reportError(re); |
4008 | recover(input,re); |
4009 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
4010 | |
4011 | } |
4012 | finally { |
4013 | if ( state.backtracking>0 ) { memoize(input, 20, boolConjunction_StartIndex); } |
4014 | } |
4015 | return retval; |
4016 | } |
4017 | // $ANTLR end "boolConjunction" |
4018 | |
4019 | public static class boolConjunctionElement_return extends ParserRuleReturnScope { |
4020 | public Expression be; |
4021 | Object tree; |
4022 | public Object getTree() { return tree; } |
4023 | }; |
4024 | |
4025 | // $ANTLR start "boolConjunctionElement" |
4026 | // FELIX.g:884:1: boolConjunctionElement returns [Expression be] : ( (negc= ( '!' | 'NOT' ) )? (mc= mathComparison | fe= funcExpression ) | (negb= ( '!' | 'NOT' ) )? '(' b= boolExpression ')' ); |
4027 | public final FELIXParser.boolConjunctionElement_return boolConjunctionElement() throws RecognitionException { |
4028 | FELIXParser.boolConjunctionElement_return retval = new FELIXParser.boolConjunctionElement_return(); |
4029 | retval.start = input.LT(1); |
4030 | int boolConjunctionElement_StartIndex = input.index(); |
4031 | Object root_0 = null; |
4032 | |
4033 | Token negc=null; |
4034 | Token negb=null; |
4035 | Token char_literal91=null; |
4036 | Token char_literal92=null; |
4037 | FELIXParser.mathComparison_return mc = null; |
4038 | |
4039 | FELIXParser.funcExpression_return fe = null; |
4040 | |
4041 | FELIXParser.boolExpression_return b = null; |
4042 | |
4043 | |
4044 | Object negc_tree=null; |
4045 | Object negb_tree=null; |
4046 | Object char_literal91_tree=null; |
4047 | Object char_literal92_tree=null; |
4048 | |
4049 | try { |
4050 | if ( state.backtracking>0 && alreadyParsedRule(input, 21) ) { return retval; } |
4051 | // FELIX.g:885:3: ( (negc= ( '!' | 'NOT' ) )? (mc= mathComparison | fe= funcExpression ) | (negb= ( '!' | 'NOT' ) )? '(' b= boolExpression ')' ) |
4052 | int alt61=2; |
4053 | switch ( input.LA(1) ) { |
4054 | case NOT: |
4055 | case 74: |
4056 | { |
4057 | int LA61_1 = input.LA(2); |
4058 | |
4059 | if ( (synpred83_FELIX()) ) { |
4060 | alt61=1; |
4061 | } |
4062 | else if ( (true) ) { |
4063 | alt61=2; |
4064 | } |
4065 | else { |
4066 | if (state.backtracking>0) {state.failed=true; return retval;} |
4067 | NoViableAltException nvae = |
4068 | new NoViableAltException("", 61, 1, input); |
4069 | |
4070 | throw nvae; |
4071 | } |
4072 | } |
4073 | break; |
4074 | case STRING: |
4075 | case NUMBER: |
4076 | case ID: |
4077 | case 57: |
4078 | { |
4079 | alt61=1; |
4080 | } |
4081 | break; |
4082 | case 26: |
4083 | { |
4084 | int LA61_5 = input.LA(2); |
4085 | |
4086 | if ( (synpred83_FELIX()) ) { |
4087 | alt61=1; |
4088 | } |
4089 | else if ( (true) ) { |
4090 | alt61=2; |
4091 | } |
4092 | else { |
4093 | if (state.backtracking>0) {state.failed=true; return retval;} |
4094 | NoViableAltException nvae = |
4095 | new NoViableAltException("", 61, 5, input); |
4096 | |
4097 | throw nvae; |
4098 | } |
4099 | } |
4100 | break; |
4101 | default: |
4102 | if (state.backtracking>0) {state.failed=true; return retval;} |
4103 | NoViableAltException nvae = |
4104 | new NoViableAltException("", 61, 0, input); |
4105 | |
4106 | throw nvae; |
4107 | } |
4108 | |
4109 | switch (alt61) { |
4110 | case 1 : |
4111 | // FELIX.g:886:3: (negc= ( '!' | 'NOT' ) )? (mc= mathComparison | fe= funcExpression ) |
4112 | { |
4113 | root_0 = (Object)adaptor.nil(); |
4114 | |
4115 | // FELIX.g:886:7: (negc= ( '!' | 'NOT' ) )? |
4116 | int alt58=2; |
4117 | int LA58_0 = input.LA(1); |
4118 | |
4119 | if ( (LA58_0==NOT||LA58_0==74) ) { |
4120 | alt58=1; |
4121 | } |
4122 | switch (alt58) { |
4123 | case 1 : |
4124 | // FELIX.g:0:0: negc= ( '!' | 'NOT' ) |
4125 | { |
4126 | negc=(Token)input.LT(1); |
4127 | if ( input.LA(1)==NOT||input.LA(1)==74 ) { |
4128 | input.consume(); |
4129 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(negc)); |
4130 | state.errorRecovery=false;state.failed=false; |
4131 | } |
4132 | else { |
4133 | if (state.backtracking>0) {state.failed=true; return retval;} |
4134 | MismatchedSetException mse = new MismatchedSetException(null,input); |
4135 | throw mse; |
4136 | } |
4137 | |
4138 | |
4139 | } |
4140 | break; |
4141 | |
4142 | } |
4143 | |
4144 | // FELIX.g:892:3: (mc= mathComparison | fe= funcExpression ) |
4145 | int alt59=2; |
4146 | int LA59_0 = input.LA(1); |
4147 | |
4148 | if ( (LA59_0==ID) ) { |
4149 | int LA59_1 = input.LA(2); |
4150 | |
4151 | if ( (synpred82_FELIX()) ) { |
4152 | alt59=1; |
4153 | } |
4154 | else if ( (true) ) { |
4155 | alt59=2; |
4156 | } |
4157 | else { |
4158 | if (state.backtracking>0) {state.failed=true; return retval;} |
4159 | NoViableAltException nvae = |
4160 | new NoViableAltException("", 59, 1, input); |
4161 | |
4162 | throw nvae; |
4163 | } |
4164 | } |
4165 | else if ( (LA59_0==STRING||LA59_0==NUMBER||LA59_0==26||LA59_0==57) ) { |
4166 | alt59=1; |
4167 | } |
4168 | else { |
4169 | if (state.backtracking>0) {state.failed=true; return retval;} |
4170 | NoViableAltException nvae = |
4171 | new NoViableAltException("", 59, 0, input); |
4172 | |
4173 | throw nvae; |
4174 | } |
4175 | switch (alt59) { |
4176 | case 1 : |
4177 | // FELIX.g:893:5: mc= mathComparison |
4178 | { |
4179 | pushFollow(FOLLOW_mathComparison_in_boolConjunctionElement4677); |
4180 | mc=mathComparison(); |
4181 | |
4182 | state._fsp--; |
4183 | if (state.failed) return retval; |
4184 | if ( state.backtracking==0 ) adaptor.addChild(root_0, mc.getTree()); |
4185 | if ( state.backtracking==0 ) { |
4186 | |
4187 | retval.be = (mc!=null?mc.expr:null); |
4188 | |
4189 | } |
4190 | |
4191 | } |
4192 | break; |
4193 | case 2 : |
4194 | // FELIX.g:897:7: fe= funcExpression |
4195 | { |
4196 | pushFollow(FOLLOW_funcExpression_in_boolConjunctionElement4712); |
4197 | fe=funcExpression(); |
4198 | |
4199 | state._fsp--; |
4200 | if (state.failed) return retval; |
4201 | if ( state.backtracking==0 ) adaptor.addChild(root_0, fe.getTree()); |
4202 | if ( state.backtracking==0 ) { |
4203 | |
4204 | retval.be = (fe!=null?fe.expr:null); |
4205 | |
4206 | } |
4207 | |
4208 | } |
4209 | break; |
4210 | |
4211 | } |
4212 | |
4213 | if ( state.backtracking==0 ) { |
4214 | |
4215 | if (negc != null) { |
4216 | Expression enew = new Expression(Function.NOT); |
4217 | enew.addArgument(retval.be); |
4218 | retval.be = enew; |
4219 | } |
4220 | |
4221 | } |
4222 | |
4223 | } |
4224 | break; |
4225 | case 2 : |
4226 | // FELIX.g:910:5: (negb= ( '!' | 'NOT' ) )? '(' b= boolExpression ')' |
4227 | { |
4228 | root_0 = (Object)adaptor.nil(); |
4229 | |
4230 | // FELIX.g:910:9: (negb= ( '!' | 'NOT' ) )? |
4231 | int alt60=2; |
4232 | int LA60_0 = input.LA(1); |
4233 | |
4234 | if ( (LA60_0==NOT||LA60_0==74) ) { |
4235 | alt60=1; |
4236 | } |
4237 | switch (alt60) { |
4238 | case 1 : |
4239 | // FELIX.g:0:0: negb= ( '!' | 'NOT' ) |
4240 | { |
4241 | negb=(Token)input.LT(1); |
4242 | if ( input.LA(1)==NOT||input.LA(1)==74 ) { |
4243 | input.consume(); |
4244 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(negb)); |
4245 | state.errorRecovery=false;state.failed=false; |
4246 | } |
4247 | else { |
4248 | if (state.backtracking>0) {state.failed=true; return retval;} |
4249 | MismatchedSetException mse = new MismatchedSetException(null,input); |
4250 | throw mse; |
4251 | } |
4252 | |
4253 | |
4254 | } |
4255 | break; |
4256 | |
4257 | } |
4258 | |
4259 | char_literal91=(Token)match(input,26,FOLLOW_26_in_boolConjunctionElement4784); if (state.failed) return retval; |
4260 | if ( state.backtracking==0 ) { |
4261 | char_literal91_tree = (Object)adaptor.create(char_literal91); |
4262 | adaptor.addChild(root_0, char_literal91_tree); |
4263 | } |
4264 | pushFollow(FOLLOW_boolExpression_in_boolConjunctionElement4788); |
4265 | b=boolExpression(); |
4266 | |
4267 | state._fsp--; |
4268 | if (state.failed) return retval; |
4269 | if ( state.backtracking==0 ) adaptor.addChild(root_0, b.getTree()); |
4270 | char_literal92=(Token)match(input,28,FOLLOW_28_in_boolConjunctionElement4790); if (state.failed) return retval; |
4271 | if ( state.backtracking==0 ) { |
4272 | char_literal92_tree = (Object)adaptor.create(char_literal92); |
4273 | adaptor.addChild(root_0, char_literal92_tree); |
4274 | } |
4275 | if ( state.backtracking==0 ) { |
4276 | |
4277 | retval.be = (b!=null?b.be:null); |
4278 | if (negb != null) { |
4279 | Expression enew = new Expression(Function.NOT); |
4280 | enew.addArgument(retval.be); |
4281 | retval.be = enew; |
4282 | } |
4283 | |
4284 | } |
4285 | |
4286 | } |
4287 | break; |
4288 | |
4289 | } |
4290 | retval.stop = input.LT(-1); |
4291 | |
4292 | if ( state.backtracking==0 ) { |
4293 | |
4294 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
4295 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
4296 | } |
4297 | } |
4298 | catch (RecognitionException re) { |
4299 | reportError(re); |
4300 | recover(input,re); |
4301 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
4302 | |
4303 | } |
4304 | finally { |
4305 | if ( state.backtracking>0 ) { memoize(input, 21, boolConjunctionElement_StartIndex); } |
4306 | } |
4307 | return retval; |
4308 | } |
4309 | // $ANTLR end "boolConjunctionElement" |
4310 | |
4311 | public static class mathComparison_return extends ParserRuleReturnScope { |
4312 | public Expression expr; |
4313 | Object tree; |
4314 | public Object getTree() { return tree; } |
4315 | }; |
4316 | |
4317 | // $ANTLR start "mathComparison" |
4318 | // FELIX.g:926:1: mathComparison returns [Expression expr] : e1= mathExpression op= ( '=' | '<>' | '<' | '<=' | '>' | '>=' | '!=' ) e2= mathExpression ; |
4319 | public final FELIXParser.mathComparison_return mathComparison() throws RecognitionException { |
4320 | FELIXParser.mathComparison_return retval = new FELIXParser.mathComparison_return(); |
4321 | retval.start = input.LT(1); |
4322 | int mathComparison_StartIndex = input.index(); |
4323 | Object root_0 = null; |
4324 | |
4325 | Token op=null; |
4326 | FELIXParser.mathExpression_return e1 = null; |
4327 | |
4328 | FELIXParser.mathExpression_return e2 = null; |
4329 | |
4330 | |
4331 | Object op_tree=null; |
4332 | |
4333 | try { |
4334 | if ( state.backtracking>0 && alreadyParsedRule(input, 22) ) { return retval; } |
4335 | // FELIX.g:927:3: (e1= mathExpression op= ( '=' | '<>' | '<' | '<=' | '>' | '>=' | '!=' ) e2= mathExpression ) |
4336 | // FELIX.g:928:3: e1= mathExpression op= ( '=' | '<>' | '<' | '<=' | '>' | '>=' | '!=' ) e2= mathExpression |
4337 | { |
4338 | root_0 = (Object)adaptor.nil(); |
4339 | |
4340 | pushFollow(FOLLOW_mathExpression_in_mathComparison4841); |
4341 | e1=mathExpression(); |
4342 | |
4343 | state._fsp--; |
4344 | if (state.failed) return retval; |
4345 | if ( state.backtracking==0 ) adaptor.addChild(root_0, e1.getTree()); |
4346 | op=(Token)input.LT(1); |
4347 | if ( input.LA(1)==34||input.LA(1)==55||input.LA(1)==58||(input.LA(1)>=75 && input.LA(1)<=78) ) { |
4348 | input.consume(); |
4349 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op)); |
4350 | state.errorRecovery=false;state.failed=false; |
4351 | } |
4352 | else { |
4353 | if (state.backtracking>0) {state.failed=true; return retval;} |
4354 | MismatchedSetException mse = new MismatchedSetException(null,input); |
4355 | throw mse; |
4356 | } |
4357 | |
4358 | pushFollow(FOLLOW_mathExpression_in_mathComparison4912); |
4359 | e2=mathExpression(); |
4360 | |
4361 | state._fsp--; |
4362 | if (state.failed) return retval; |
4363 | if ( state.backtracking==0 ) adaptor.addChild(root_0, e2.getTree()); |
4364 | if ( state.backtracking==0 ) { |
4365 | |
4366 | Function f = Function.getBuiltInFunctionByName((op!=null?op.getText():null)); |
4367 | retval.expr = new Expression(f); |
4368 | retval.expr.addArgument((e1!=null?e1.expr:null)); |
4369 | retval.expr.addArgument((e2!=null?e2.expr:null)); |
4370 | |
4371 | } |
4372 | |
4373 | } |
4374 | |
4375 | retval.stop = input.LT(-1); |
4376 | |
4377 | if ( state.backtracking==0 ) { |
4378 | |
4379 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
4380 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
4381 | } |
4382 | } |
4383 | catch (RecognitionException re) { |
4384 | reportError(re); |
4385 | recover(input,re); |
4386 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
4387 | |
4388 | } |
4389 | finally { |
4390 | if ( state.backtracking>0 ) { memoize(input, 22, mathComparison_StartIndex); } |
4391 | } |
4392 | return retval; |
4393 | } |
4394 | // $ANTLR end "mathComparison" |
4395 | |
4396 | public static class mathExpression_return extends ParserRuleReturnScope { |
4397 | public Expression expr; |
4398 | Object tree; |
4399 | public Object getTree() { return tree; } |
4400 | }; |
4401 | |
4402 | // $ANTLR start "mathExpression" |
4403 | // FELIX.g:947:1: mathExpression returns [Expression expr] : t0= mathTerm (op= ( '+' | '-' | '%' ) tp= mathTerm )* ; |
4404 | public final FELIXParser.mathExpression_return mathExpression() throws RecognitionException { |
4405 | FELIXParser.mathExpression_return retval = new FELIXParser.mathExpression_return(); |
4406 | retval.start = input.LT(1); |
4407 | int mathExpression_StartIndex = input.index(); |
4408 | Object root_0 = null; |
4409 | |
4410 | Token op=null; |
4411 | FELIXParser.mathTerm_return t0 = null; |
4412 | |
4413 | FELIXParser.mathTerm_return tp = null; |
4414 | |
4415 | |
4416 | Object op_tree=null; |
4417 | |
4418 | try { |
4419 | if ( state.backtracking>0 && alreadyParsedRule(input, 23) ) { return retval; } |
4420 | // FELIX.g:948:3: (t0= mathTerm (op= ( '+' | '-' | '%' ) tp= mathTerm )* ) |
4421 | // FELIX.g:949:3: t0= mathTerm (op= ( '+' | '-' | '%' ) tp= mathTerm )* |
4422 | { |
4423 | root_0 = (Object)adaptor.nil(); |
4424 | |
4425 | pushFollow(FOLLOW_mathTerm_in_mathExpression4956); |
4426 | t0=mathTerm(); |
4427 | |
4428 | state._fsp--; |
4429 | if (state.failed) return retval; |
4430 | if ( state.backtracking==0 ) adaptor.addChild(root_0, t0.getTree()); |
4431 | if ( state.backtracking==0 ) { |
4432 | |
4433 | retval.expr = (t0!=null?t0.expr:null); |
4434 | |
4435 | } |
4436 | // FELIX.g:953:3: (op= ( '+' | '-' | '%' ) tp= mathTerm )* |
4437 | loop62: |
4438 | do { |
4439 | int alt62=2; |
4440 | alt62 = dfa62.predict(input); |
4441 | switch (alt62) { |
4442 | case 1 : |
4443 | // FELIX.g:954:5: op= ( '+' | '-' | '%' ) tp= mathTerm |
4444 | { |
4445 | op=(Token)input.LT(1); |
4446 | if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS)||input.LA(1)==79 ) { |
4447 | input.consume(); |
4448 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op)); |
4449 | state.errorRecovery=false;state.failed=false; |
4450 | } |
4451 | else { |
4452 | if (state.backtracking>0) {state.failed=true; return retval;} |
4453 | MismatchedSetException mse = new MismatchedSetException(null,input); |
4454 | throw mse; |
4455 | } |
4456 | |
4457 | pushFollow(FOLLOW_mathTerm_in_mathExpression5032); |
4458 | tp=mathTerm(); |
4459 | |
4460 | state._fsp--; |
4461 | if (state.failed) return retval; |
4462 | if ( state.backtracking==0 ) adaptor.addChild(root_0, tp.getTree()); |
4463 | if ( state.backtracking==0 ) { |
4464 | |
4465 | Expression enew = null; |
4466 | if((op!=null?op.getText():null).equals("+")){ |
4467 | enew = new Expression(Function.Add); |
4468 | }else if((op!=null?op.getText():null).equals("-")){ |
4469 | enew = new Expression(Function.Subtract); |
4470 | }else if((op!=null?op.getText():null).equals("%")){ |
4471 | enew = new Expression(Function.Modulo); |
4472 | } |
4473 | enew.addArgument(retval.expr); |
4474 | enew.addArgument((tp!=null?tp.expr:null)); |
4475 | retval.expr = enew; |
4476 | |
4477 | } |
4478 | |
4479 | } |
4480 | break; |
4481 | |
4482 | default : |
4483 | break loop62; |
4484 | } |
4485 | } while (true); |
4486 | |
4487 | |
4488 | } |
4489 | |
4490 | retval.stop = input.LT(-1); |
4491 | |
4492 | if ( state.backtracking==0 ) { |
4493 | |
4494 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
4495 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
4496 | } |
4497 | } |
4498 | catch (RecognitionException re) { |
4499 | reportError(re); |
4500 | recover(input,re); |
4501 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
4502 | |
4503 | } |
4504 | finally { |
4505 | if ( state.backtracking>0 ) { memoize(input, 23, mathExpression_StartIndex); } |
4506 | } |
4507 | return retval; |
4508 | } |
4509 | // $ANTLR end "mathExpression" |
4510 | |
4511 | public static class mathTerm_return extends ParserRuleReturnScope { |
4512 | public Expression expr; |
4513 | Object tree; |
4514 | public Object getTree() { return tree; } |
4515 | }; |
4516 | |
4517 | // $ANTLR start "mathTerm" |
4518 | // FELIX.g:977:1: mathTerm returns [Expression expr] : t0= mathFactor (op= ( '*' | '/' | '&' | '|' | '^' | '<<' | '>>' ) tp= mathFactor )* ; |
4519 | public final FELIXParser.mathTerm_return mathTerm() throws RecognitionException { |
4520 | FELIXParser.mathTerm_return retval = new FELIXParser.mathTerm_return(); |
4521 | retval.start = input.LT(1); |
4522 | int mathTerm_StartIndex = input.index(); |
4523 | Object root_0 = null; |
4524 | |
4525 | Token op=null; |
4526 | FELIXParser.mathFactor_return t0 = null; |
4527 | |
4528 | FELIXParser.mathFactor_return tp = null; |
4529 | |
4530 | |
4531 | Object op_tree=null; |
4532 | |
4533 | try { |
4534 | if ( state.backtracking>0 && alreadyParsedRule(input, 24) ) { return retval; } |
4535 | // FELIX.g:978:3: (t0= mathFactor (op= ( '*' | '/' | '&' | '|' | '^' | '<<' | '>>' ) tp= mathFactor )* ) |
4536 | // FELIX.g:979:3: t0= mathFactor (op= ( '*' | '/' | '&' | '|' | '^' | '<<' | '>>' ) tp= mathFactor )* |
4537 | { |
4538 | root_0 = (Object)adaptor.nil(); |
4539 | |
4540 | pushFollow(FOLLOW_mathFactor_in_mathTerm5077); |
4541 | t0=mathFactor(); |
4542 | |
4543 | state._fsp--; |
4544 | if (state.failed) return retval; |
4545 | if ( state.backtracking==0 ) adaptor.addChild(root_0, t0.getTree()); |
4546 | if ( state.backtracking==0 ) { |
4547 | |
4548 | retval.expr = (t0!=null?t0.expr:null); |
4549 | |
4550 | } |
4551 | // FELIX.g:983:3: (op= ( '*' | '/' | '&' | '|' | '^' | '<<' | '>>' ) tp= mathFactor )* |
4552 | loop63: |
4553 | do { |
4554 | int alt63=2; |
4555 | alt63 = dfa63.predict(input); |
4556 | switch (alt63) { |
4557 | case 1 : |
4558 | // FELIX.g:984:5: op= ( '*' | '/' | '&' | '|' | '^' | '<<' | '>>' ) tp= mathFactor |
4559 | { |
4560 | op=(Token)input.LT(1); |
4561 | if ( input.LA(1)==ASTERISK||input.LA(1)==40||(input.LA(1)>=80 && input.LA(1)<=84) ) { |
4562 | input.consume(); |
4563 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(op)); |
4564 | state.errorRecovery=false;state.failed=false; |
4565 | } |
4566 | else { |
4567 | if (state.backtracking>0) {state.failed=true; return retval;} |
4568 | MismatchedSetException mse = new MismatchedSetException(null,input); |
4569 | throw mse; |
4570 | } |
4571 | |
4572 | pushFollow(FOLLOW_mathFactor_in_mathTerm5195); |
4573 | tp=mathFactor(); |
4574 | |
4575 | state._fsp--; |
4576 | if (state.failed) return retval; |
4577 | if ( state.backtracking==0 ) adaptor.addChild(root_0, tp.getTree()); |
4578 | if ( state.backtracking==0 ) { |
4579 | |
4580 | Expression enew = null; |
4581 | if ((op!=null?op.getText():null).equals("*")) { |
4582 | enew = new Expression(Function.Multiply); |
4583 | } else if ((op!=null?op.getText():null).equals("/")) { |
4584 | enew = new Expression(Function.Divide); |
4585 | } else if ((op!=null?op.getText():null).equals("&")) { |
4586 | enew = new Expression(Function.BitAnd); |
4587 | } else if ((op!=null?op.getText():null).equals("|")) { |
4588 | enew = new Expression(Function.BitOr); |
4589 | } else if ((op!=null?op.getText():null).equals("^")) { |
4590 | enew = new Expression(Function.BitXor); |
4591 | } else if ((op!=null?op.getText():null).equals("<<")) { |
4592 | enew = new Expression(Function.BitShiftLeft); |
4593 | } else if ((op!=null?op.getText():null).equals(">>")) { |
4594 | enew = new Expression(Function.BitShiftRight); |
4595 | } |
4596 | enew.addArgument(retval.expr); |
4597 | enew.addArgument((tp!=null?tp.expr:null)); |
4598 | retval.expr = enew; |
4599 | |
4600 | } |
4601 | |
4602 | } |
4603 | break; |
4604 | |
4605 | default : |
4606 | break loop63; |
4607 | } |
4608 | } while (true); |
4609 | |
4610 | |
4611 | } |
4612 | |
4613 | retval.stop = input.LT(-1); |
4614 | |
4615 | if ( state.backtracking==0 ) { |
4616 | |
4617 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
4618 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
4619 | } |
4620 | } |
4621 | catch (RecognitionException re) { |
4622 | reportError(re); |
4623 | recover(input,re); |
4624 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
4625 | |
4626 | } |
4627 | finally { |
4628 | if ( state.backtracking>0 ) { memoize(input, 24, mathTerm_StartIndex); } |
4629 | } |
4630 | return retval; |
4631 | } |
4632 | // $ANTLR end "mathTerm" |
4633 | |
4634 | public static class mathFactor_return extends ParserRuleReturnScope { |
4635 | public Expression expr; |
4636 | Object tree; |
4637 | public Object getTree() { return tree; } |
4638 | }; |
4639 | |
4640 | // $ANTLR start "mathFactor" |
4641 | // FELIX.g:1019:1: mathFactor returns [Expression expr] : (fe= funcExpression | ae= atomicExpression | '(' ee= mathExpression ')' | '~' mf= mathFactor ) (fact= '!' )? ; |
4642 | public final FELIXParser.mathFactor_return mathFactor() throws RecognitionException { |
4643 | FELIXParser.mathFactor_return retval = new FELIXParser.mathFactor_return(); |
4644 | retval.start = input.LT(1); |
4645 | int mathFactor_StartIndex = input.index(); |
4646 | Object root_0 = null; |
4647 | |
4648 | Token fact=null; |
4649 | Token char_literal93=null; |
4650 | Token char_literal94=null; |
4651 | Token char_literal95=null; |
4652 | FELIXParser.funcExpression_return fe = null; |
4653 | |
4654 | FELIXParser.atomicExpression_return ae = null; |
4655 | |
4656 | FELIXParser.mathExpression_return ee = null; |
4657 | |
4658 | FELIXParser.mathFactor_return mf = null; |
4659 | |
4660 | |
4661 | Object fact_tree=null; |
4662 | Object char_literal93_tree=null; |
4663 | Object char_literal94_tree=null; |
4664 | Object char_literal95_tree=null; |
4665 | |
4666 | try { |
4667 | if ( state.backtracking>0 && alreadyParsedRule(input, 25) ) { return retval; } |
4668 | // FELIX.g:1020:3: ( (fe= funcExpression | ae= atomicExpression | '(' ee= mathExpression ')' | '~' mf= mathFactor ) (fact= '!' )? ) |
4669 | // FELIX.g:1021:3: (fe= funcExpression | ae= atomicExpression | '(' ee= mathExpression ')' | '~' mf= mathFactor ) (fact= '!' )? |
4670 | { |
4671 | root_0 = (Object)adaptor.nil(); |
4672 | |
4673 | // FELIX.g:1021:3: (fe= funcExpression | ae= atomicExpression | '(' ee= mathExpression ')' | '~' mf= mathFactor ) |
4674 | int alt64=4; |
4675 | switch ( input.LA(1) ) { |
4676 | case ID: |
4677 | { |
4678 | int LA64_1 = input.LA(2); |
4679 | |
4680 | if ( (LA64_1==26) ) { |
4681 | alt64=1; |
4682 | } |
4683 | else if ( (LA64_1==EOF||(LA64_1>=NOT && LA64_1<=IMPLIES)||LA64_1==NUMBER||LA64_1==ID||LA64_1==25||(LA64_1>=27 && LA64_1<=28)||LA64_1==34||LA64_1==40||(LA64_1>=46 && LA64_1<=50)||(LA64_1>=52 && LA64_1<=53)||LA64_1==55||(LA64_1>=57 && LA64_1<=58)||(LA64_1>=69 && LA64_1<=73)||(LA64_1>=75 && LA64_1<=84)) ) { |
4684 | alt64=2; |
4685 | } |
4686 | else { |
4687 | if (state.backtracking>0) {state.failed=true; return retval;} |
4688 | NoViableAltException nvae = |
4689 | new NoViableAltException("", 64, 1, input); |
4690 | |
4691 | throw nvae; |
4692 | } |
4693 | } |
4694 | break; |
4695 | case STRING: |
4696 | case NUMBER: |
4697 | { |
4698 | alt64=2; |
4699 | } |
4700 | break; |
4701 | case 26: |
4702 | { |
4703 | alt64=3; |
4704 | } |
4705 | break; |
4706 | case 57: |
4707 | { |
4708 | alt64=4; |
4709 | } |
4710 | break; |
4711 | default: |
4712 | if (state.backtracking>0) {state.failed=true; return retval;} |
4713 | NoViableAltException nvae = |
4714 | new NoViableAltException("", 64, 0, input); |
4715 | |
4716 | throw nvae; |
4717 | } |
4718 | |
4719 | switch (alt64) { |
4720 | case 1 : |
4721 | // FELIX.g:1022:5: fe= funcExpression |
4722 | { |
4723 | pushFollow(FOLLOW_funcExpression_in_mathFactor5248); |
4724 | fe=funcExpression(); |
4725 | |
4726 | state._fsp--; |
4727 | if (state.failed) return retval; |
4728 | if ( state.backtracking==0 ) adaptor.addChild(root_0, fe.getTree()); |
4729 | if ( state.backtracking==0 ) { |
4730 | |
4731 | retval.expr = (fe!=null?fe.expr:null); |
4732 | |
4733 | } |
4734 | |
4735 | } |
4736 | break; |
4737 | case 2 : |
4738 | // FELIX.g:1026:7: ae= atomicExpression |
4739 | { |
4740 | pushFollow(FOLLOW_atomicExpression_in_mathFactor5283); |
4741 | ae=atomicExpression(); |
4742 | |
4743 | state._fsp--; |
4744 | if (state.failed) return retval; |
4745 | if ( state.backtracking==0 ) adaptor.addChild(root_0, ae.getTree()); |
4746 | if ( state.backtracking==0 ) { |
4747 | |
4748 | retval.expr = (ae!=null?ae.expr:null); |
4749 | |
4750 | } |
4751 | |
4752 | } |
4753 | break; |
4754 | case 3 : |
4755 | // FELIX.g:1030:7: '(' ee= mathExpression ')' |
4756 | { |
4757 | char_literal93=(Token)match(input,26,FOLLOW_26_in_mathFactor5320); if (state.failed) return retval; |
4758 | if ( state.backtracking==0 ) { |
4759 | char_literal93_tree = (Object)adaptor.create(char_literal93); |
4760 | adaptor.addChild(root_0, char_literal93_tree); |
4761 | } |
4762 | pushFollow(FOLLOW_mathExpression_in_mathFactor5324); |
4763 | ee=mathExpression(); |
4764 | |
4765 | state._fsp--; |
4766 | if (state.failed) return retval; |
4767 | if ( state.backtracking==0 ) adaptor.addChild(root_0, ee.getTree()); |
4768 | char_literal94=(Token)match(input,28,FOLLOW_28_in_mathFactor5326); if (state.failed) return retval; |
4769 | if ( state.backtracking==0 ) { |
4770 | char_literal94_tree = (Object)adaptor.create(char_literal94); |
4771 | adaptor.addChild(root_0, char_literal94_tree); |
4772 | } |
4773 | if ( state.backtracking==0 ) { |
4774 | |
4775 | retval.expr = (ee!=null?ee.expr:null); |
4776 | |
4777 | } |
4778 | |
4779 | } |
4780 | break; |
4781 | case 4 : |
4782 | // FELIX.g:1034:7: '~' mf= mathFactor |
4783 | { |
4784 | char_literal95=(Token)match(input,57,FOLLOW_57_in_mathFactor5369); if (state.failed) return retval; |
4785 | if ( state.backtracking==0 ) { |
4786 | char_literal95_tree = (Object)adaptor.create(char_literal95); |
4787 | adaptor.addChild(root_0, char_literal95_tree); |
4788 | } |
4789 | pushFollow(FOLLOW_mathFactor_in_mathFactor5373); |
4790 | mf=mathFactor(); |
4791 | |
4792 | state._fsp--; |
4793 | if (state.failed) return retval; |
4794 | if ( state.backtracking==0 ) adaptor.addChild(root_0, mf.getTree()); |
4795 | if ( state.backtracking==0 ) { |
4796 | |
4797 | Expression enew = new Expression(Function.BitNeg); |
4798 | enew.addArgument((mf!=null?mf.expr:null)); |
4799 | retval.expr = enew; |
4800 | |
4801 | } |
4802 | |
4803 | } |
4804 | break; |
4805 | |
4806 | } |
4807 | |
4808 | // FELIX.g:1041:7: (fact= '!' )? |
4809 | int alt65=2; |
4810 | int LA65_0 = input.LA(1); |
4811 | |
4812 | if ( (LA65_0==NOT) ) { |
4813 | int LA65_1 = input.LA(2); |
4814 | |
4815 | if ( (synpred106_FELIX()) ) { |
4816 | alt65=1; |
4817 | } |
4818 | } |
4819 | switch (alt65) { |
4820 | case 1 : |
4821 | // FELIX.g:0:0: fact= '!' |
4822 | { |
4823 | fact=(Token)match(input,NOT,FOLLOW_NOT_in_mathFactor5410); if (state.failed) return retval; |
4824 | if ( state.backtracking==0 ) { |
4825 | fact_tree = (Object)adaptor.create(fact); |
4826 | adaptor.addChild(root_0, fact_tree); |
4827 | } |
4828 | |
4829 | } |
4830 | break; |
4831 | |
4832 | } |
4833 | |
4834 | if ( state.backtracking==0 ) { |
4835 | |
4836 | if (fact != null) { |
4837 | Expression enew = new Expression(Function.Factorial); |
4838 | enew.addArgument(retval.expr); |
4839 | retval.expr = enew; |
4840 | } |
4841 | |
4842 | } |
4843 | |
4844 | } |
4845 | |
4846 | retval.stop = input.LT(-1); |
4847 | |
4848 | if ( state.backtracking==0 ) { |
4849 | |
4850 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
4851 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
4852 | } |
4853 | } |
4854 | catch (RecognitionException re) { |
4855 | reportError(re); |
4856 | recover(input,re); |
4857 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
4858 | |
4859 | } |
4860 | finally { |
4861 | if ( state.backtracking>0 ) { memoize(input, 25, mathFactor_StartIndex); } |
4862 | } |
4863 | return retval; |
4864 | } |
4865 | // $ANTLR end "mathFactor" |
4866 | |
4867 | public static class funcExpression_return extends ParserRuleReturnScope { |
4868 | public Expression expr; |
4869 | Object tree; |
4870 | public Object getTree() { return tree; } |
4871 | }; |
4872 | |
4873 | // $ANTLR start "funcExpression" |
4874 | // FELIX.g:1051:1: funcExpression returns [Expression expr] : func= ID '(' a0= funcArgument ( ',' ap= funcArgument )* ')' ; |
4875 | public final FELIXParser.funcExpression_return funcExpression() throws RecognitionException { |
4876 | FELIXParser.funcExpression_return retval = new FELIXParser.funcExpression_return(); |
4877 | retval.start = input.LT(1); |
4878 | int funcExpression_StartIndex = input.index(); |
4879 | Object root_0 = null; |
4880 | |
4881 | Token func=null; |
4882 | Token char_literal96=null; |
4883 | Token char_literal97=null; |
4884 | Token char_literal98=null; |
4885 | FELIXParser.funcArgument_return a0 = null; |
4886 | |
4887 | FELIXParser.funcArgument_return ap = null; |
4888 | |
4889 | |
4890 | Object func_tree=null; |
4891 | Object char_literal96_tree=null; |
4892 | Object char_literal97_tree=null; |
4893 | Object char_literal98_tree=null; |
4894 | |
4895 | try { |
4896 | if ( state.backtracking>0 && alreadyParsedRule(input, 26) ) { return retval; } |
4897 | // FELIX.g:1052:3: (func= ID '(' a0= funcArgument ( ',' ap= funcArgument )* ')' ) |
4898 | // FELIX.g:1053:3: func= ID '(' a0= funcArgument ( ',' ap= funcArgument )* ')' |
4899 | { |
4900 | root_0 = (Object)adaptor.nil(); |
4901 | |
4902 | func=(Token)match(input,ID,FOLLOW_ID_in_funcExpression5447); if (state.failed) return retval; |
4903 | if ( state.backtracking==0 ) { |
4904 | func_tree = (Object)adaptor.create(func); |
4905 | adaptor.addChild(root_0, func_tree); |
4906 | } |
4907 | if ( state.backtracking==0 ) { |
4908 | |
4909 | Function f = ml.getFunctionByName((func!=null?func.getText():null)); |
4910 | if (f == null) |
4911 | die("Line #" + func.getLine() + ": unknown function " + (func!=null?func.getText():null) |
4912 | + ". Are you putting a bool expression before a " |
4913 | + "regular literal in a rule? (HINT: You shouldn't.)"); |
4914 | retval.expr = new Expression(f); |
4915 | |
4916 | } |
4917 | char_literal96=(Token)match(input,26,FOLLOW_26_in_funcExpression5464); if (state.failed) return retval; |
4918 | if ( state.backtracking==0 ) { |
4919 | char_literal96_tree = (Object)adaptor.create(char_literal96); |
4920 | adaptor.addChild(root_0, char_literal96_tree); |
4921 | } |
4922 | pushFollow(FOLLOW_funcArgument_in_funcExpression5468); |
4923 | a0=funcArgument(); |
4924 | |
4925 | state._fsp--; |
4926 | if (state.failed) return retval; |
4927 | if ( state.backtracking==0 ) adaptor.addChild(root_0, a0.getTree()); |
4928 | if ( state.backtracking==0 ) { |
4929 | |
4930 | retval.expr.addArgument((a0!=null?a0.expr:null)); |
4931 | |
4932 | } |
4933 | // FELIX.g:1066:3: ( ',' ap= funcArgument )* |
4934 | loop66: |
4935 | do { |
4936 | int alt66=2; |
4937 | int LA66_0 = input.LA(1); |
4938 | |
4939 | if ( (LA66_0==27) ) { |
4940 | alt66=1; |
4941 | } |
4942 | |
4943 | |
4944 | switch (alt66) { |
4945 | case 1 : |
4946 | // FELIX.g:1066:4: ',' ap= funcArgument |
4947 | { |
4948 | char_literal97=(Token)match(input,27,FOLLOW_27_in_funcExpression5498); if (state.failed) return retval; |
4949 | if ( state.backtracking==0 ) { |
4950 | char_literal97_tree = (Object)adaptor.create(char_literal97); |
4951 | adaptor.addChild(root_0, char_literal97_tree); |
4952 | } |
4953 | pushFollow(FOLLOW_funcArgument_in_funcExpression5502); |
4954 | ap=funcArgument(); |
4955 | |
4956 | state._fsp--; |
4957 | if (state.failed) return retval; |
4958 | if ( state.backtracking==0 ) adaptor.addChild(root_0, ap.getTree()); |
4959 | if ( state.backtracking==0 ) { |
4960 | |
4961 | retval.expr.addArgument((ap!=null?ap.expr:null)); |
4962 | |
4963 | } |
4964 | |
4965 | } |
4966 | break; |
4967 | |
4968 | default : |
4969 | break loop66; |
4970 | } |
4971 | } while (true); |
4972 | |
4973 | char_literal98=(Token)match(input,28,FOLLOW_28_in_funcExpression5532); if (state.failed) return retval; |
4974 | if ( state.backtracking==0 ) { |
4975 | char_literal98_tree = (Object)adaptor.create(char_literal98); |
4976 | adaptor.addChild(root_0, char_literal98_tree); |
4977 | } |
4978 | |
4979 | } |
4980 | |
4981 | retval.stop = input.LT(-1); |
4982 | |
4983 | if ( state.backtracking==0 ) { |
4984 | |
4985 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
4986 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
4987 | } |
4988 | } |
4989 | catch (RecognitionException re) { |
4990 | reportError(re); |
4991 | recover(input,re); |
4992 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
4993 | |
4994 | } |
4995 | finally { |
4996 | if ( state.backtracking>0 ) { memoize(input, 26, funcExpression_StartIndex); } |
4997 | } |
4998 | return retval; |
4999 | } |
5000 | // $ANTLR end "funcExpression" |
5001 | |
5002 | public static class funcArgument_return extends ParserRuleReturnScope { |
5003 | public Expression expr; |
5004 | Object tree; |
5005 | public Object getTree() { return tree; } |
5006 | }; |
5007 | |
5008 | // $ANTLR start "funcArgument" |
5009 | // FELIX.g:1072:1: funcArgument returns [Expression expr] : (be= boolExpression | me= mathExpression | fe= funcExpression | ae= atomicExpression ); |
5010 | public final FELIXParser.funcArgument_return funcArgument() throws RecognitionException { |
5011 | FELIXParser.funcArgument_return retval = new FELIXParser.funcArgument_return(); |
5012 | retval.start = input.LT(1); |
5013 | int funcArgument_StartIndex = input.index(); |
5014 | Object root_0 = null; |
5015 | |
5016 | FELIXParser.boolExpression_return be = null; |
5017 | |
5018 | FELIXParser.mathExpression_return me = null; |
5019 | |
5020 | FELIXParser.funcExpression_return fe = null; |
5021 | |
5022 | FELIXParser.atomicExpression_return ae = null; |
5023 | |
5024 | |
5025 | |
5026 | try { |
5027 | if ( state.backtracking>0 && alreadyParsedRule(input, 27) ) { return retval; } |
5028 | // FELIX.g:1073:3: (be= boolExpression | me= mathExpression | fe= funcExpression | ae= atomicExpression ) |
5029 | int alt67=4; |
5030 | alt67 = dfa67.predict(input); |
5031 | switch (alt67) { |
5032 | case 1 : |
5033 | // FELIX.g:1074:3: be= boolExpression |
5034 | { |
5035 | root_0 = (Object)adaptor.nil(); |
5036 | |
5037 | pushFollow(FOLLOW_boolExpression_in_funcArgument5553); |
5038 | be=boolExpression(); |
5039 | |
5040 | state._fsp--; |
5041 | if (state.failed) return retval; |
5042 | if ( state.backtracking==0 ) adaptor.addChild(root_0, be.getTree()); |
5043 | if ( state.backtracking==0 ) { |
5044 | |
5045 | retval.expr = (be!=null?be.be:null); |
5046 | |
5047 | } |
5048 | |
5049 | } |
5050 | break; |
5051 | case 2 : |
5052 | // FELIX.g:1078:5: me= mathExpression |
5053 | { |
5054 | root_0 = (Object)adaptor.nil(); |
5055 | |
5056 | pushFollow(FOLLOW_mathExpression_in_funcArgument5584); |
5057 | me=mathExpression(); |
5058 | |
5059 | state._fsp--; |
5060 | if (state.failed) return retval; |
5061 | if ( state.backtracking==0 ) adaptor.addChild(root_0, me.getTree()); |
5062 | if ( state.backtracking==0 ) { |
5063 | |
5064 | retval.expr = (me!=null?me.expr:null); |
5065 | |
5066 | } |
5067 | |
5068 | } |
5069 | break; |
5070 | case 3 : |
5071 | // FELIX.g:1082:5: fe= funcExpression |
5072 | { |
5073 | root_0 = (Object)adaptor.nil(); |
5074 | |
5075 | pushFollow(FOLLOW_funcExpression_in_funcArgument5617); |
5076 | fe=funcExpression(); |
5077 | |
5078 | state._fsp--; |
5079 | if (state.failed) return retval; |
5080 | if ( state.backtracking==0 ) adaptor.addChild(root_0, fe.getTree()); |
5081 | if ( state.backtracking==0 ) { |
5082 | |
5083 | retval.expr = (fe!=null?fe.expr:null); |
5084 | |
5085 | } |
5086 | |
5087 | } |
5088 | break; |
5089 | case 4 : |
5090 | // FELIX.g:1086:5: ae= atomicExpression |
5091 | { |
5092 | root_0 = (Object)adaptor.nil(); |
5093 | |
5094 | pushFollow(FOLLOW_atomicExpression_in_funcArgument5650); |
5095 | ae=atomicExpression(); |
5096 | |
5097 | state._fsp--; |
5098 | if (state.failed) return retval; |
5099 | if ( state.backtracking==0 ) adaptor.addChild(root_0, ae.getTree()); |
5100 | if ( state.backtracking==0 ) { |
5101 | |
5102 | retval.expr = (ae!=null?ae.expr:null); |
5103 | |
5104 | } |
5105 | |
5106 | } |
5107 | break; |
5108 | |
5109 | } |
5110 | retval.stop = input.LT(-1); |
5111 | |
5112 | if ( state.backtracking==0 ) { |
5113 | |
5114 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
5115 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
5116 | } |
5117 | } |
5118 | catch (RecognitionException re) { |
5119 | reportError(re); |
5120 | recover(input,re); |
5121 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
5122 | |
5123 | } |
5124 | finally { |
5125 | if ( state.backtracking>0 ) { memoize(input, 27, funcArgument_StartIndex); } |
5126 | } |
5127 | return retval; |
5128 | } |
5129 | // $ANTLR end "funcArgument" |
5130 | |
5131 | public static class atomicExpression_return extends ParserRuleReturnScope { |
5132 | public Expression expr; |
5133 | Object tree; |
5134 | public Object getTree() { return tree; } |
5135 | }; |
5136 | |
5137 | // $ANTLR start "atomicExpression" |
5138 | // FELIX.g:1092:1: atomicExpression returns [Expression expr] : (num= NUMBER | str= STRING | id= ID ); |
5139 | public final FELIXParser.atomicExpression_return atomicExpression() throws RecognitionException { |
5140 | FELIXParser.atomicExpression_return retval = new FELIXParser.atomicExpression_return(); |
5141 | retval.start = input.LT(1); |
5142 | int atomicExpression_StartIndex = input.index(); |
5143 | Object root_0 = null; |
5144 | |
5145 | Token num=null; |
5146 | Token str=null; |
5147 | Token id=null; |
5148 | |
5149 | Object num_tree=null; |
5150 | Object str_tree=null; |
5151 | Object id_tree=null; |
5152 | |
5153 | try { |
5154 | if ( state.backtracking>0 && alreadyParsedRule(input, 28) ) { return retval; } |
5155 | // FELIX.g:1093:3: (num= NUMBER | str= STRING | id= ID ) |
5156 | int alt68=3; |
5157 | switch ( input.LA(1) ) { |
5158 | case NUMBER: |
5159 | { |
5160 | alt68=1; |
5161 | } |
5162 | break; |
5163 | case STRING: |
5164 | { |
5165 | alt68=2; |
5166 | } |
5167 | break; |
5168 | case ID: |
5169 | { |
5170 | alt68=3; |
5171 | } |
5172 | break; |
5173 | default: |
5174 | if (state.backtracking>0) {state.failed=true; return retval;} |
5175 | NoViableAltException nvae = |
5176 | new NoViableAltException("", 68, 0, input); |
5177 | |
5178 | throw nvae; |
5179 | } |
5180 | |
5181 | switch (alt68) { |
5182 | case 1 : |
5183 | // FELIX.g:1094:3: num= NUMBER |
5184 | { |
5185 | root_0 = (Object)adaptor.nil(); |
5186 | |
5187 | num=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_atomicExpression5698); if (state.failed) return retval; |
5188 | if ( state.backtracking==0 ) { |
5189 | num_tree = (Object)adaptor.create(num); |
5190 | adaptor.addChild(root_0, num_tree); |
5191 | } |
5192 | if ( state.backtracking==0 ) { |
5193 | |
5194 | try { |
5195 | int n = Integer.parseInt((num!=null?num.getText():null)); |
5196 | retval.expr = Expression.exprConstInteger(n); |
5197 | } catch (NumberFormatException e) { |
5198 | retval.expr = Expression.exprConstNum(Double.parseDouble((num!=null?num.getText():null))); |
5199 | } |
5200 | |
5201 | } |
5202 | |
5203 | } |
5204 | break; |
5205 | case 2 : |
5206 | // FELIX.g:1103:5: str= STRING |
5207 | { |
5208 | root_0 = (Object)adaptor.nil(); |
5209 | |
5210 | str=(Token)match(input,STRING,FOLLOW_STRING_in_atomicExpression5722); if (state.failed) return retval; |
5211 | if ( state.backtracking==0 ) { |
5212 | str_tree = (Object)adaptor.create(str); |
5213 | adaptor.addChild(root_0, str_tree); |
5214 | } |
5215 | if ( state.backtracking==0 ) { |
5216 | |
5217 | String s = (str!=null?str.getText():null); |
5218 | retval.expr = Expression.exprConstString(s); |
5219 | |
5220 | } |
5221 | |
5222 | } |
5223 | break; |
5224 | case 3 : |
5225 | // FELIX.g:1108:5: id= ID |
5226 | { |
5227 | root_0 = (Object)adaptor.nil(); |
5228 | |
5229 | id=(Token)match(input,ID,FOLLOW_ID_in_atomicExpression5748); if (state.failed) return retval; |
5230 | if ( state.backtracking==0 ) { |
5231 | id_tree = (Object)adaptor.create(id); |
5232 | adaptor.addChild(root_0, id_tree); |
5233 | } |
5234 | if ( state.backtracking==0 ) { |
5235 | |
5236 | String s = (id!=null?id.getText():null); |
5237 | String init = s.substring(0, 1); |
5238 | if (init.equals(init.toUpperCase())) { // a constant |
5239 | retval.expr = Expression.exprConstString(s); |
5240 | } else { |
5241 | retval.expr = Expression.exprVariableBinding(s); |
5242 | } |
5243 | |
5244 | } |
5245 | |
5246 | } |
5247 | break; |
5248 | |
5249 | } |
5250 | retval.stop = input.LT(-1); |
5251 | |
5252 | if ( state.backtracking==0 ) { |
5253 | |
5254 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
5255 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
5256 | } |
5257 | } |
5258 | catch (RecognitionException re) { |
5259 | reportError(re); |
5260 | recover(input,re); |
5261 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
5262 | |
5263 | } |
5264 | finally { |
5265 | if ( state.backtracking>0 ) { memoize(input, 28, atomicExpression_StartIndex); } |
5266 | } |
5267 | return retval; |
5268 | } |
5269 | // $ANTLR end "atomicExpression" |
5270 | |
5271 | public static class literal_return extends ParserRuleReturnScope { |
5272 | public Literal lit; |
5273 | Object tree; |
5274 | public Object getTree() { return tree; } |
5275 | }; |
5276 | |
5277 | // $ANTLR start "literal" |
5278 | // FELIX.g:1120:1: literal returns [Literal lit] : (pref= ( PLUS | NOT ) )? atom ; |
5279 | public final FELIXParser.literal_return literal() throws RecognitionException { |
5280 | FELIXParser.literal_return retval = new FELIXParser.literal_return(); |
5281 | retval.start = input.LT(1); |
5282 | int literal_StartIndex = input.index(); |
5283 | Object root_0 = null; |
5284 | |
5285 | Token pref=null; |
5286 | FELIXParser.atom_return atom99 = null; |
5287 | |
5288 | |
5289 | Object pref_tree=null; |
5290 | |
5291 | try { |
5292 | if ( state.backtracking>0 && alreadyParsedRule(input, 29) ) { return retval; } |
5293 | // FELIX.g:1121:3: ( (pref= ( PLUS | NOT ) )? atom ) |
5294 | // FELIX.g:1122:3: (pref= ( PLUS | NOT ) )? atom |
5295 | { |
5296 | root_0 = (Object)adaptor.nil(); |
5297 | |
5298 | // FELIX.g:1122:7: (pref= ( PLUS | NOT ) )? |
5299 | int alt69=2; |
5300 | int LA69_0 = input.LA(1); |
5301 | |
5302 | if ( ((LA69_0>=NOT && LA69_0<=PLUS)) ) { |
5303 | alt69=1; |
5304 | } |
5305 | switch (alt69) { |
5306 | case 1 : |
5307 | // FELIX.g:0:0: pref= ( PLUS | NOT ) |
5308 | { |
5309 | pref=(Token)input.LT(1); |
5310 | if ( (input.LA(1)>=NOT && input.LA(1)<=PLUS) ) { |
5311 | input.consume(); |
5312 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(pref)); |
5313 | state.errorRecovery=false;state.failed=false; |
5314 | } |
5315 | else { |
5316 | if (state.backtracking>0) {state.failed=true; return retval;} |
5317 | MismatchedSetException mse = new MismatchedSetException(null,input); |
5318 | throw mse; |
5319 | } |
5320 | |
5321 | |
5322 | } |
5323 | break; |
5324 | |
5325 | } |
5326 | |
5327 | pushFollow(FOLLOW_atom_in_literal5807); |
5328 | atom99=atom(); |
5329 | |
5330 | state._fsp--; |
5331 | if (state.failed) return retval; |
5332 | if ( state.backtracking==0 ) adaptor.addChild(root_0, atom99.getTree()); |
5333 | if ( state.backtracking==0 ) { |
5334 | |
5335 | retval.lit = (atom99!=null?atom99.lit:null); |
5336 | if (pref != null && retval.lit != null) { |
5337 | if ((pref!=null?pref.getText():null).equals("!")) |
5338 | retval.lit.setSense(false); |
5339 | else |
5340 | retval.lit.setCoversAllMaterializedTuples(true); |
5341 | } |
5342 | |
5343 | } |
5344 | |
5345 | } |
5346 | |
5347 | retval.stop = input.LT(-1); |
5348 | |
5349 | if ( state.backtracking==0 ) { |
5350 | |
5351 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
5352 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
5353 | } |
5354 | } |
5355 | catch (RecognitionException re) { |
5356 | reportError(re); |
5357 | recover(input,re); |
5358 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
5359 | |
5360 | } |
5361 | finally { |
5362 | if ( state.backtracking>0 ) { memoize(input, 29, literal_StartIndex); } |
5363 | } |
5364 | return retval; |
5365 | } |
5366 | // $ANTLR end "literal" |
5367 | |
5368 | public static class term_return extends ParserRuleReturnScope { |
5369 | public Term t; |
5370 | Object tree; |
5371 | public Object getTree() { return tree; } |
5372 | }; |
5373 | |
5374 | // $ANTLR start "term" |
5375 | // FELIX.g:1139:1: term returns [Term t] : ( ID | d= ( NUMBER | STRING ) ); |
5376 | public final FELIXParser.term_return term() throws RecognitionException { |
5377 | FELIXParser.term_return retval = new FELIXParser.term_return(); |
5378 | retval.start = input.LT(1); |
5379 | int term_StartIndex = input.index(); |
5380 | Object root_0 = null; |
5381 | |
5382 | Token d=null; |
5383 | Token ID100=null; |
5384 | |
5385 | Object d_tree=null; |
5386 | Object ID100_tree=null; |
5387 | |
5388 | try { |
5389 | if ( state.backtracking>0 && alreadyParsedRule(input, 30) ) { return retval; } |
5390 | // FELIX.g:1140:3: ( ID | d= ( NUMBER | STRING ) ) |
5391 | int alt70=2; |
5392 | int LA70_0 = input.LA(1); |
5393 | |
5394 | if ( (LA70_0==ID) ) { |
5395 | alt70=1; |
5396 | } |
5397 | else if ( (LA70_0==STRING||LA70_0==NUMBER) ) { |
5398 | alt70=2; |
5399 | } |
5400 | else { |
5401 | if (state.backtracking>0) {state.failed=true; return retval;} |
5402 | NoViableAltException nvae = |
5403 | new NoViableAltException("", 70, 0, input); |
5404 | |
5405 | throw nvae; |
5406 | } |
5407 | switch (alt70) { |
5408 | case 1 : |
5409 | // FELIX.g:1141:3: ID |
5410 | { |
5411 | root_0 = (Object)adaptor.nil(); |
5412 | |
5413 | ID100=(Token)match(input,ID,FOLLOW_ID_in_term5836); if (state.failed) return retval; |
5414 | if ( state.backtracking==0 ) { |
5415 | ID100_tree = (Object)adaptor.create(ID100); |
5416 | adaptor.addChild(root_0, ID100_tree); |
5417 | } |
5418 | if ( state.backtracking==0 ) { |
5419 | |
5420 | String s = (ID100!=null?ID100.getText():null); |
5421 | String init = s.substring(0, 1); |
5422 | if (init.equals(init.toUpperCase())) { // a constant |
5423 | Integer cid = ml.addConstant(s); |
5424 | retval.t = new Term(cid); |
5425 | } else { |
5426 | retval.t = new Term(s); |
5427 | } |
5428 | |
5429 | } |
5430 | |
5431 | } |
5432 | break; |
5433 | case 2 : |
5434 | // FELIX.g:1152:5: d= ( NUMBER | STRING ) |
5435 | { |
5436 | root_0 = (Object)adaptor.nil(); |
5437 | |
5438 | d=(Token)input.LT(1); |
5439 | if ( input.LA(1)==STRING||input.LA(1)==NUMBER ) { |
5440 | input.consume(); |
5441 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(d)); |
5442 | state.errorRecovery=false;state.failed=false; |
5443 | } |
5444 | else { |
5445 | if (state.backtracking>0) {state.failed=true; return retval;} |
5446 | MismatchedSetException mse = new MismatchedSetException(null,input); |
5447 | throw mse; |
5448 | } |
5449 | |
5450 | if ( state.backtracking==0 ) { |
5451 | |
5452 | String s = (d!=null?d.getText():null); |
5453 | Integer cid = ml.addConstant(s); |
5454 | retval.t = new Term(cid); |
5455 | |
5456 | } |
5457 | |
5458 | } |
5459 | break; |
5460 | |
5461 | } |
5462 | retval.stop = input.LT(-1); |
5463 | |
5464 | if ( state.backtracking==0 ) { |
5465 | |
5466 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
5467 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
5468 | } |
5469 | } |
5470 | catch (RecognitionException re) { |
5471 | reportError(re); |
5472 | recover(input,re); |
5473 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
5474 | |
5475 | } |
5476 | finally { |
5477 | if ( state.backtracking>0 ) { memoize(input, 30, term_StartIndex); } |
5478 | } |
5479 | return retval; |
5480 | } |
5481 | // $ANTLR end "term" |
5482 | |
5483 | public static class atom_return extends ParserRuleReturnScope { |
5484 | public Literal lit; |
5485 | Object tree; |
5486 | public Object getTree() { return tree; } |
5487 | }; |
5488 | |
5489 | // $ANTLR start "atom" |
5490 | // FELIX.g:1165:1: atom returns [Literal lit] : pred= ID '(' term1= term ( ',' termp= term )* ')' ; |
5491 | public final FELIXParser.atom_return atom() throws RecognitionException { |
5492 | FELIXParser.atom_return retval = new FELIXParser.atom_return(); |
5493 | retval.start = input.LT(1); |
5494 | int atom_StartIndex = input.index(); |
5495 | Object root_0 = null; |
5496 | |
5497 | Token pred=null; |
5498 | Token char_literal101=null; |
5499 | Token char_literal102=null; |
5500 | Token char_literal103=null; |
5501 | FELIXParser.term_return term1 = null; |
5502 | |
5503 | FELIXParser.term_return termp = null; |
5504 | |
5505 | |
5506 | Object pred_tree=null; |
5507 | Object char_literal101_tree=null; |
5508 | Object char_literal102_tree=null; |
5509 | Object char_literal103_tree=null; |
5510 | |
5511 | try { |
5512 | if ( state.backtracking>0 && alreadyParsedRule(input, 31) ) { return retval; } |
5513 | // FELIX.g:1166:3: (pred= ID '(' term1= term ( ',' termp= term )* ')' ) |
5514 | // FELIX.g:1167:3: pred= ID '(' term1= term ( ',' termp= term )* ')' |
5515 | { |
5516 | root_0 = (Object)adaptor.nil(); |
5517 | |
5518 | pred=(Token)match(input,ID,FOLLOW_ID_in_atom5902); if (state.failed) return retval; |
5519 | if ( state.backtracking==0 ) { |
5520 | pred_tree = (Object)adaptor.create(pred); |
5521 | adaptor.addChild(root_0, pred_tree); |
5522 | } |
5523 | char_literal101=(Token)match(input,26,FOLLOW_26_in_atom5904); if (state.failed) return retval; |
5524 | if ( state.backtracking==0 ) { |
5525 | char_literal101_tree = (Object)adaptor.create(char_literal101); |
5526 | adaptor.addChild(root_0, char_literal101_tree); |
5527 | } |
5528 | if ( state.backtracking==0 ) { |
5529 | |
5530 | Predicate p = ml.getPredByName((pred!=null?pred.getText():null)); |
5531 | if (p == null) |
5532 | die("Line #" + pred.getLine() + ": unknown predicate name - " + (pred!=null?pred.getText():null)); |
5533 | retval.lit = new Literal(p, true); |
5534 | |
5535 | } |
5536 | pushFollow(FOLLOW_term_in_atom5927); |
5537 | term1=term(); |
5538 | |
5539 | state._fsp--; |
5540 | if (state.failed) return retval; |
5541 | if ( state.backtracking==0 ) adaptor.addChild(root_0, term1.getTree()); |
5542 | if ( state.backtracking==0 ) { |
5543 | |
5544 | retval.lit.appendTerm((term1!=null?term1.t:null)); |
5545 | |
5546 | } |
5547 | // FELIX.g:1178:3: ( ',' termp= term )* |
5548 | loop71: |
5549 | do { |
5550 | int alt71=2; |
5551 | int LA71_0 = input.LA(1); |
5552 | |
5553 | if ( (LA71_0==27) ) { |
5554 | alt71=1; |
5555 | } |
5556 | |
5557 | |
5558 | switch (alt71) { |
5559 | case 1 : |
5560 | // FELIX.g:1178:4: ',' termp= term |
5561 | { |
5562 | char_literal102=(Token)match(input,27,FOLLOW_27_in_atom5948); if (state.failed) return retval; |
5563 | if ( state.backtracking==0 ) { |
5564 | char_literal102_tree = (Object)adaptor.create(char_literal102); |
5565 | adaptor.addChild(root_0, char_literal102_tree); |
5566 | } |
5567 | pushFollow(FOLLOW_term_in_atom5952); |
5568 | termp=term(); |
5569 | |
5570 | state._fsp--; |
5571 | if (state.failed) return retval; |
5572 | if ( state.backtracking==0 ) adaptor.addChild(root_0, termp.getTree()); |
5573 | if ( state.backtracking==0 ) { |
5574 | |
5575 | retval.lit.appendTerm((termp!=null?termp.t:null)); |
5576 | |
5577 | } |
5578 | |
5579 | } |
5580 | break; |
5581 | |
5582 | default : |
5583 | break loop71; |
5584 | } |
5585 | } while (true); |
5586 | |
5587 | char_literal103=(Token)match(input,28,FOLLOW_28_in_atom5977); if (state.failed) return retval; |
5588 | if ( state.backtracking==0 ) { |
5589 | char_literal103_tree = (Object)adaptor.create(char_literal103); |
5590 | adaptor.addChild(root_0, char_literal103_tree); |
5591 | } |
5592 | if ( state.backtracking==0 ) { |
5593 | |
5594 | Predicate p = retval.lit.getPred(); |
5595 | if (retval.lit.getTerms().size() != p.arity()) { |
5596 | die("Line #" + pred.getLine() + ": incorrect # of args (read " |
5597 | + retval.lit.getTerms().size() + " but expected " + p.arity() + ")" |
5598 | + " for pred " + p.getName()); |
5599 | } |
5600 | for (int i = 0; i < p.arity(); i++) { |
5601 | Type t = p.getTypeAt(i); |
5602 | Term term = retval.lit.getTerms().get(i); |
5603 | if (term.isConstant()) { |
5604 | t.addConstant(term.constant()); |
5605 | } |
5606 | } |
5607 | |
5608 | } |
5609 | |
5610 | } |
5611 | |
5612 | retval.stop = input.LT(-1); |
5613 | |
5614 | if ( state.backtracking==0 ) { |
5615 | |
5616 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
5617 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
5618 | } |
5619 | } |
5620 | catch (RecognitionException re) { |
5621 | reportError(re); |
5622 | recover(input,re); |
5623 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
5624 | |
5625 | } |
5626 | finally { |
5627 | if ( state.backtracking>0 ) { memoize(input, 31, atom_StartIndex); } |
5628 | } |
5629 | return retval; |
5630 | } |
5631 | // $ANTLR end "atom" |
5632 | |
5633 | public static class queryList_return extends ParserRuleReturnScope { |
5634 | Object tree; |
5635 | public Object getTree() { return tree; } |
5636 | }; |
5637 | |
5638 | // $ANTLR start "queryList" |
5639 | // FELIX.g:1199:1: queryList : ( query )+ EOF ; |
5640 | public final FELIXParser.queryList_return queryList() throws RecognitionException { |
5641 | FELIXParser.queryList_return retval = new FELIXParser.queryList_return(); |
5642 | retval.start = input.LT(1); |
5643 | int queryList_StartIndex = input.index(); |
5644 | Object root_0 = null; |
5645 | |
5646 | Token EOF105=null; |
5647 | FELIXParser.query_return query104 = null; |
5648 | |
5649 | |
5650 | Object EOF105_tree=null; |
5651 | |
5652 | try { |
5653 | if ( state.backtracking>0 && alreadyParsedRule(input, 32) ) { return retval; } |
5654 | // FELIX.g:1200:3: ( ( query )+ EOF ) |
5655 | // FELIX.g:1201:3: ( query )+ EOF |
5656 | { |
5657 | root_0 = (Object)adaptor.nil(); |
5658 | |
5659 | // FELIX.g:1201:3: ( query )+ |
5660 | int cnt72=0; |
5661 | loop72: |
5662 | do { |
5663 | int alt72=2; |
5664 | int LA72_0 = input.LA(1); |
5665 | |
5666 | if ( (LA72_0==ID) ) { |
5667 | alt72=1; |
5668 | } |
5669 | |
5670 | |
5671 | switch (alt72) { |
5672 | case 1 : |
5673 | // FELIX.g:0:0: query |
5674 | { |
5675 | pushFollow(FOLLOW_query_in_queryList6021); |
5676 | query104=query(); |
5677 | |
5678 | state._fsp--; |
5679 | if (state.failed) return retval; |
5680 | if ( state.backtracking==0 ) adaptor.addChild(root_0, query104.getTree()); |
5681 | |
5682 | } |
5683 | break; |
5684 | |
5685 | default : |
5686 | if ( cnt72 >= 1 ) break loop72; |
5687 | if (state.backtracking>0) {state.failed=true; return retval;} |
5688 | EarlyExitException eee = |
5689 | new EarlyExitException(72, input); |
5690 | throw eee; |
5691 | } |
5692 | cnt72++; |
5693 | } while (true); |
5694 | |
5695 | EOF105=(Token)match(input,EOF,FOLLOW_EOF_in_queryList6024); if (state.failed) return retval; |
5696 | if ( state.backtracking==0 ) { |
5697 | EOF105_tree = (Object)adaptor.create(EOF105); |
5698 | adaptor.addChild(root_0, EOF105_tree); |
5699 | } |
5700 | |
5701 | } |
5702 | |
5703 | retval.stop = input.LT(-1); |
5704 | |
5705 | if ( state.backtracking==0 ) { |
5706 | |
5707 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
5708 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
5709 | } |
5710 | } |
5711 | catch (RecognitionException re) { |
5712 | reportError(re); |
5713 | recover(input,re); |
5714 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
5715 | |
5716 | } |
5717 | finally { |
5718 | if ( state.backtracking>0 ) { memoize(input, 32, queryList_StartIndex); } |
5719 | } |
5720 | return retval; |
5721 | } |
5722 | // $ANTLR end "queryList" |
5723 | |
5724 | public static class query_return extends ParserRuleReturnScope { |
5725 | Object tree; |
5726 | public Object getTree() { return tree; } |
5727 | }; |
5728 | |
5729 | // $ANTLR start "query" |
5730 | // FELIX.g:1204:1: query : ( atom | ID ); |
5731 | public final FELIXParser.query_return query() throws RecognitionException { |
5732 | FELIXParser.query_return retval = new FELIXParser.query_return(); |
5733 | retval.start = input.LT(1); |
5734 | int query_StartIndex = input.index(); |
5735 | Object root_0 = null; |
5736 | |
5737 | Token ID107=null; |
5738 | FELIXParser.atom_return atom106 = null; |
5739 | |
5740 | |
5741 | Object ID107_tree=null; |
5742 | |
5743 | try { |
5744 | if ( state.backtracking>0 && alreadyParsedRule(input, 33) ) { return retval; } |
5745 | // FELIX.g:1205:3: ( atom | ID ) |
5746 | int alt73=2; |
5747 | int LA73_0 = input.LA(1); |
5748 | |
5749 | if ( (LA73_0==ID) ) { |
5750 | int LA73_1 = input.LA(2); |
5751 | |
5752 | if ( (LA73_1==26) ) { |
5753 | alt73=1; |
5754 | } |
5755 | else if ( (LA73_1==EOF||LA73_1==ID||LA73_1==27) ) { |
5756 | alt73=2; |
5757 | } |
5758 | else { |
5759 | if (state.backtracking>0) {state.failed=true; return retval;} |
5760 | NoViableAltException nvae = |
5761 | new NoViableAltException("", 73, 1, input); |
5762 | |
5763 | throw nvae; |
5764 | } |
5765 | } |
5766 | else { |
5767 | if (state.backtracking>0) {state.failed=true; return retval;} |
5768 | NoViableAltException nvae = |
5769 | new NoViableAltException("", 73, 0, input); |
5770 | |
5771 | throw nvae; |
5772 | } |
5773 | switch (alt73) { |
5774 | case 1 : |
5775 | // FELIX.g:1206:3: atom |
5776 | { |
5777 | root_0 = (Object)adaptor.nil(); |
5778 | |
5779 | pushFollow(FOLLOW_atom_in_query6039); |
5780 | atom106=atom(); |
5781 | |
5782 | state._fsp--; |
5783 | if (state.failed) return retval; |
5784 | if ( state.backtracking==0 ) adaptor.addChild(root_0, atom106.getTree()); |
5785 | if ( state.backtracking==0 ) { |
5786 | |
5787 | Atom q = (atom106!=null?atom106.lit:null).toAtom(Atom.AtomType.QUERY); |
5788 | (atom106!=null?atom106.lit:null).getPred().addQuery(q); |
5789 | |
5790 | } |
5791 | |
5792 | } |
5793 | break; |
5794 | case 2 : |
5795 | // FELIX.g:1211:5: ID |
5796 | { |
5797 | root_0 = (Object)adaptor.nil(); |
5798 | |
5799 | ID107=(Token)match(input,ID,FOLLOW_ID_in_query6055); if (state.failed) return retval; |
5800 | if ( state.backtracking==0 ) { |
5801 | ID107_tree = (Object)adaptor.create(ID107); |
5802 | adaptor.addChild(root_0, ID107_tree); |
5803 | } |
5804 | if ( state.backtracking==0 ) { |
5805 | |
5806 | FelixPredicate p = ml.getPredByName((ID107!=null?ID107.getText():null)); |
5807 | if (p == null) |
5808 | die("Line #" + ID107.getLine() + ": unknown predicate name - " + (ID107!=null?ID107.getText():null)); |
5809 | p.setAllQuery(); |
5810 | |
5811 | } |
5812 | |
5813 | } |
5814 | break; |
5815 | |
5816 | } |
5817 | retval.stop = input.LT(-1); |
5818 | |
5819 | if ( state.backtracking==0 ) { |
5820 | |
5821 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
5822 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
5823 | } |
5824 | } |
5825 | catch (RecognitionException re) { |
5826 | reportError(re); |
5827 | recover(input,re); |
5828 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
5829 | |
5830 | } |
5831 | finally { |
5832 | if ( state.backtracking>0 ) { memoize(input, 33, query_StartIndex); } |
5833 | } |
5834 | return retval; |
5835 | } |
5836 | // $ANTLR end "query" |
5837 | |
5838 | public static class queryCommaList_return extends ParserRuleReturnScope { |
5839 | Object tree; |
5840 | public Object getTree() { return tree; } |
5841 | }; |
5842 | |
5843 | // $ANTLR start "queryCommaList" |
5844 | // FELIX.g:1220:1: queryCommaList : query ( ',' query )* EOF ; |
5845 | public final FELIXParser.queryCommaList_return queryCommaList() throws RecognitionException { |
5846 | FELIXParser.queryCommaList_return retval = new FELIXParser.queryCommaList_return(); |
5847 | retval.start = input.LT(1); |
5848 | int queryCommaList_StartIndex = input.index(); |
5849 | Object root_0 = null; |
5850 | |
5851 | Token char_literal109=null; |
5852 | Token EOF111=null; |
5853 | FELIXParser.query_return query108 = null; |
5854 | |
5855 | FELIXParser.query_return query110 = null; |
5856 | |
5857 | |
5858 | Object char_literal109_tree=null; |
5859 | Object EOF111_tree=null; |
5860 | |
5861 | try { |
5862 | if ( state.backtracking>0 && alreadyParsedRule(input, 34) ) { return retval; } |
5863 | // FELIX.g:1221:3: ( query ( ',' query )* EOF ) |
5864 | // FELIX.g:1222:3: query ( ',' query )* EOF |
5865 | { |
5866 | root_0 = (Object)adaptor.nil(); |
5867 | |
5868 | pushFollow(FOLLOW_query_in_queryCommaList6080); |
5869 | query108=query(); |
5870 | |
5871 | state._fsp--; |
5872 | if (state.failed) return retval; |
5873 | if ( state.backtracking==0 ) adaptor.addChild(root_0, query108.getTree()); |
5874 | // FELIX.g:1222:9: ( ',' query )* |
5875 | loop74: |
5876 | do { |
5877 | int alt74=2; |
5878 | int LA74_0 = input.LA(1); |
5879 | |
5880 | if ( (LA74_0==27) ) { |
5881 | alt74=1; |
5882 | } |
5883 | |
5884 | |
5885 | switch (alt74) { |
5886 | case 1 : |
5887 | // FELIX.g:1222:10: ',' query |
5888 | { |
5889 | char_literal109=(Token)match(input,27,FOLLOW_27_in_queryCommaList6083); if (state.failed) return retval; |
5890 | if ( state.backtracking==0 ) { |
5891 | char_literal109_tree = (Object)adaptor.create(char_literal109); |
5892 | adaptor.addChild(root_0, char_literal109_tree); |
5893 | } |
5894 | pushFollow(FOLLOW_query_in_queryCommaList6085); |
5895 | query110=query(); |
5896 | |
5897 | state._fsp--; |
5898 | if (state.failed) return retval; |
5899 | if ( state.backtracking==0 ) adaptor.addChild(root_0, query110.getTree()); |
5900 | |
5901 | } |
5902 | break; |
5903 | |
5904 | default : |
5905 | break loop74; |
5906 | } |
5907 | } while (true); |
5908 | |
5909 | EOF111=(Token)match(input,EOF,FOLLOW_EOF_in_queryCommaList6089); if (state.failed) return retval; |
5910 | if ( state.backtracking==0 ) { |
5911 | EOF111_tree = (Object)adaptor.create(EOF111); |
5912 | adaptor.addChild(root_0, EOF111_tree); |
5913 | } |
5914 | |
5915 | } |
5916 | |
5917 | retval.stop = input.LT(-1); |
5918 | |
5919 | if ( state.backtracking==0 ) { |
5920 | |
5921 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
5922 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
5923 | } |
5924 | } |
5925 | catch (RecognitionException re) { |
5926 | reportError(re); |
5927 | recover(input,re); |
5928 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
5929 | |
5930 | } |
5931 | finally { |
5932 | if ( state.backtracking>0 ) { memoize(input, 34, queryCommaList_StartIndex); } |
5933 | } |
5934 | return retval; |
5935 | } |
5936 | // $ANTLR end "queryCommaList" |
5937 | |
5938 | public static class evidenceList_return extends ParserRuleReturnScope { |
5939 | Object tree; |
5940 | public Object getTree() { return tree; } |
5941 | }; |
5942 | |
5943 | // $ANTLR start "evidenceList" |
5944 | // FELIX.g:1225:1: evidenceList : ( evidence )+ EOF ; |
5945 | public final FELIXParser.evidenceList_return evidenceList() throws RecognitionException { |
5946 | FELIXParser.evidenceList_return retval = new FELIXParser.evidenceList_return(); |
5947 | retval.start = input.LT(1); |
5948 | int evidenceList_StartIndex = input.index(); |
5949 | Object root_0 = null; |
5950 | |
5951 | Token EOF113=null; |
5952 | FELIXParser.evidence_return evidence112 = null; |
5953 | |
5954 | |
5955 | Object EOF113_tree=null; |
5956 | |
5957 | try { |
5958 | if ( state.backtracking>0 && alreadyParsedRule(input, 35) ) { return retval; } |
5959 | // FELIX.g:1226:3: ( ( evidence )+ EOF ) |
5960 | // FELIX.g:1227:3: ( evidence )+ EOF |
5961 | { |
5962 | root_0 = (Object)adaptor.nil(); |
5963 | |
5964 | // FELIX.g:1227:3: ( evidence )+ |
5965 | int cnt75=0; |
5966 | loop75: |
5967 | do { |
5968 | int alt75=2; |
5969 | int LA75_0 = input.LA(1); |
5970 | |
5971 | if ( (LA75_0==NOT||LA75_0==NUMBER||LA75_0==ID) ) { |
5972 | alt75=1; |
5973 | } |
5974 | |
5975 | |
5976 | switch (alt75) { |
5977 | case 1 : |
5978 | // FELIX.g:0:0: evidence |
5979 | { |
5980 | pushFollow(FOLLOW_evidence_in_evidenceList6104); |
5981 | evidence112=evidence(); |
5982 | |
5983 | state._fsp--; |
5984 | if (state.failed) return retval; |
5985 | if ( state.backtracking==0 ) adaptor.addChild(root_0, evidence112.getTree()); |
5986 | |
5987 | } |
5988 | break; |
5989 | |
5990 | default : |
5991 | if ( cnt75 >= 1 ) break loop75; |
5992 | if (state.backtracking>0) {state.failed=true; return retval;} |
5993 | EarlyExitException eee = |
5994 | new EarlyExitException(75, input); |
5995 | throw eee; |
5996 | } |
5997 | cnt75++; |
5998 | } while (true); |
5999 | |
6000 | EOF113=(Token)match(input,EOF,FOLLOW_EOF_in_evidenceList6107); if (state.failed) return retval; |
6001 | if ( state.backtracking==0 ) { |
6002 | EOF113_tree = (Object)adaptor.create(EOF113); |
6003 | adaptor.addChild(root_0, EOF113_tree); |
6004 | } |
6005 | |
6006 | } |
6007 | |
6008 | retval.stop = input.LT(-1); |
6009 | |
6010 | if ( state.backtracking==0 ) { |
6011 | |
6012 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
6013 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
6014 | } |
6015 | } |
6016 | catch (RecognitionException re) { |
6017 | reportError(re); |
6018 | recover(input,re); |
6019 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
6020 | |
6021 | } |
6022 | finally { |
6023 | if ( state.backtracking>0 ) { memoize(input, 35, evidenceList_StartIndex); } |
6024 | } |
6025 | return retval; |
6026 | } |
6027 | // $ANTLR end "evidenceList" |
6028 | |
6029 | public static class evidence_return extends ParserRuleReturnScope { |
6030 | Object tree; |
6031 | public Object getTree() { return tree; } |
6032 | }; |
6033 | |
6034 | // $ANTLR start "evidence" |
6035 | // FELIX.g:1230:1: evidence : (prior= NUMBER )? ( NOT )? pred= ID '(' terms+= ( ID | NUMBER | STRING ) ( ',' terms+= ( ID | NUMBER | STRING ) )* ')' ; |
6036 | public final FELIXParser.evidence_return evidence() throws RecognitionException { |
6037 | FELIXParser.evidence_return retval = new FELIXParser.evidence_return(); |
6038 | retval.start = input.LT(1); |
6039 | int evidence_StartIndex = input.index(); |
6040 | Object root_0 = null; |
6041 | |
6042 | Token prior=null; |
6043 | Token pred=null; |
6044 | Token NOT114=null; |
6045 | Token char_literal115=null; |
6046 | Token char_literal116=null; |
6047 | Token char_literal117=null; |
6048 | Token terms=null; |
6049 | List list_terms=null; |
6050 | |
6051 | Object prior_tree=null; |
6052 | Object pred_tree=null; |
6053 | Object NOT114_tree=null; |
6054 | Object char_literal115_tree=null; |
6055 | Object char_literal116_tree=null; |
6056 | Object char_literal117_tree=null; |
6057 | Object terms_tree=null; |
6058 | |
6059 | try { |
6060 | if ( state.backtracking>0 && alreadyParsedRule(input, 36) ) { return retval; } |
6061 | // FELIX.g:1231:3: ( (prior= NUMBER )? ( NOT )? pred= ID '(' terms+= ( ID | NUMBER | STRING ) ( ',' terms+= ( ID | NUMBER | STRING ) )* ')' ) |
6062 | // FELIX.g:1232:3: (prior= NUMBER )? ( NOT )? pred= ID '(' terms+= ( ID | NUMBER | STRING ) ( ',' terms+= ( ID | NUMBER | STRING ) )* ')' |
6063 | { |
6064 | root_0 = (Object)adaptor.nil(); |
6065 | |
6066 | // FELIX.g:1232:8: (prior= NUMBER )? |
6067 | int alt76=2; |
6068 | int LA76_0 = input.LA(1); |
6069 | |
6070 | if ( (LA76_0==NUMBER) ) { |
6071 | alt76=1; |
6072 | } |
6073 | switch (alt76) { |
6074 | case 1 : |
6075 | // FELIX.g:0:0: prior= NUMBER |
6076 | { |
6077 | prior=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_evidence6124); if (state.failed) return retval; |
6078 | if ( state.backtracking==0 ) { |
6079 | prior_tree = (Object)adaptor.create(prior); |
6080 | adaptor.addChild(root_0, prior_tree); |
6081 | } |
6082 | |
6083 | } |
6084 | break; |
6085 | |
6086 | } |
6087 | |
6088 | // FELIX.g:1232:17: ( NOT )? |
6089 | int alt77=2; |
6090 | int LA77_0 = input.LA(1); |
6091 | |
6092 | if ( (LA77_0==NOT) ) { |
6093 | alt77=1; |
6094 | } |
6095 | switch (alt77) { |
6096 | case 1 : |
6097 | // FELIX.g:0:0: NOT |
6098 | { |
6099 | NOT114=(Token)match(input,NOT,FOLLOW_NOT_in_evidence6127); if (state.failed) return retval; |
6100 | if ( state.backtracking==0 ) { |
6101 | NOT114_tree = (Object)adaptor.create(NOT114); |
6102 | adaptor.addChild(root_0, NOT114_tree); |
6103 | } |
6104 | |
6105 | } |
6106 | break; |
6107 | |
6108 | } |
6109 | |
6110 | pred=(Token)match(input,ID,FOLLOW_ID_in_evidence6132); if (state.failed) return retval; |
6111 | if ( state.backtracking==0 ) { |
6112 | pred_tree = (Object)adaptor.create(pred); |
6113 | adaptor.addChild(root_0, pred_tree); |
6114 | } |
6115 | char_literal115=(Token)match(input,26,FOLLOW_26_in_evidence6134); if (state.failed) return retval; |
6116 | if ( state.backtracking==0 ) { |
6117 | char_literal115_tree = (Object)adaptor.create(char_literal115); |
6118 | adaptor.addChild(root_0, char_literal115_tree); |
6119 | } |
6120 | terms=(Token)input.LT(1); |
6121 | if ( input.LA(1)==STRING||input.LA(1)==NUMBER||input.LA(1)==ID ) { |
6122 | input.consume(); |
6123 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(terms)); |
6124 | state.errorRecovery=false;state.failed=false; |
6125 | } |
6126 | else { |
6127 | if (state.backtracking>0) {state.failed=true; return retval;} |
6128 | MismatchedSetException mse = new MismatchedSetException(null,input); |
6129 | throw mse; |
6130 | } |
6131 | |
6132 | if (list_terms==null) list_terms=new ArrayList(); |
6133 | list_terms.add(terms); |
6134 | |
6135 | // FELIX.g:1238:3: ( ',' terms+= ( ID | NUMBER | STRING ) )* |
6136 | loop78: |
6137 | do { |
6138 | int alt78=2; |
6139 | int LA78_0 = input.LA(1); |
6140 | |
6141 | if ( (LA78_0==27) ) { |
6142 | alt78=1; |
6143 | } |
6144 | |
6145 | |
6146 | switch (alt78) { |
6147 | case 1 : |
6148 | // FELIX.g:1239:5: ',' terms+= ( ID | NUMBER | STRING ) |
6149 | { |
6150 | char_literal116=(Token)match(input,27,FOLLOW_27_in_evidence6177); if (state.failed) return retval; |
6151 | if ( state.backtracking==0 ) { |
6152 | char_literal116_tree = (Object)adaptor.create(char_literal116); |
6153 | adaptor.addChild(root_0, char_literal116_tree); |
6154 | } |
6155 | terms=(Token)input.LT(1); |
6156 | if ( input.LA(1)==STRING||input.LA(1)==NUMBER||input.LA(1)==ID ) { |
6157 | input.consume(); |
6158 | if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(terms)); |
6159 | state.errorRecovery=false;state.failed=false; |
6160 | } |
6161 | else { |
6162 | if (state.backtracking>0) {state.failed=true; return retval;} |
6163 | MismatchedSetException mse = new MismatchedSetException(null,input); |
6164 | throw mse; |
6165 | } |
6166 | |
6167 | if (list_terms==null) list_terms=new ArrayList(); |
6168 | list_terms.add(terms); |
6169 | |
6170 | |
6171 | } |
6172 | break; |
6173 | |
6174 | default : |
6175 | break loop78; |
6176 | } |
6177 | } while (true); |
6178 | |
6179 | char_literal117=(Token)match(input,28,FOLLOW_28_in_evidence6229); if (state.failed) return retval; |
6180 | if ( state.backtracking==0 ) { |
6181 | char_literal117_tree = (Object)adaptor.create(char_literal117); |
6182 | adaptor.addChild(root_0, char_literal117_tree); |
6183 | } |
6184 | if ( state.backtracking==0 ) { |
6185 | |
6186 | Boolean truth = null; |
6187 | Double pr = null; |
6188 | if (prior != null) { |
6189 | pr = Double.parseDouble((prior!=null?prior.getText():null)); |
6190 | if (pr > 1 || pr < 0) { |
6191 | die("Line #" + (lineOffset + pred.getLine()) + ": " + (prior!=null?prior.getText():null) |
6192 | + " - probabilities of soft evidence should be in [0,1]"); |
6193 | } |
6194 | if (NOT114 != null) |
6195 | pr = 1 - pr; |
6196 | if (pr == 0 || pr == 1) { |
6197 | if (pr == 0) |
6198 | truth = false; |
6199 | else |
6200 | truth = true; |
6201 | pr = null; |
6202 | } |
6203 | } else { |
6204 | truth = (NOT114 == null); |
6205 | } |
6206 | FelixPredicate p = ml.getPredByName((pred!=null?pred.getText():null)); |
6207 | if (p == null) |
6208 | die("Line #" + (lineOffset + pred.getLine()) |
6209 | + ": unknown predicate name - " + (pred!=null?pred.getText():null)); |
6210 | ArrayList<String> args = new ArrayList<String>(); |
6211 | ArrayList<Token> ts = (ArrayList<Token>) (list_terms); |
6212 | if (ts.size() != p.arity()) |
6213 | die("Line #" + (lineOffset + pred.getLine()) + ": incorrect # args - " |
6214 | + input.toString(retval.start,input.LT(-1))); |
6215 | for (int i = 0; i < p.arity(); i++) { |
6216 | Token t = ts.get(i); |
6217 | Type type = p.getTypeAt(i); |
6218 | String s = t.getText(); |
6219 | if (type.isNonSymbolicType()) { |
6220 | args.add(s); |
6221 | } else { |
6222 | if(FelixConfig.mixturedLoading == true){ |
6223 | args.add(s); |
6224 | }else{ |
6225 | Integer cid = ml.getSymbolID(s, type); |
6226 | args.add(Integer.toString(cid)); |
6227 | } |
6228 | } |
6229 | } |
6230 | Atom gp = null; |
6231 | if (pr == null) { |
6232 | gp = new Atom(args, truth); |
6233 | } else { |
6234 | gp = new Atom(args, pr); |
6235 | } |
6236 | p.addEvidence(gp); |
6237 | gp = null; |
6238 | |
6239 | } |
6240 | |
6241 | } |
6242 | |
6243 | retval.stop = input.LT(-1); |
6244 | |
6245 | if ( state.backtracking==0 ) { |
6246 | |
6247 | retval.tree = (Object)adaptor.rulePostProcessing(root_0); |
6248 | adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); |
6249 | } |
6250 | } |
6251 | catch (RecognitionException re) { |
6252 | reportError(re); |
6253 | recover(input,re); |
6254 | retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); |
6255 | |
6256 | } |
6257 | finally { |
6258 | if ( state.backtracking>0 ) { memoize(input, 36, evidence_StartIndex); } |
6259 | } |
6260 | return retval; |
6261 | } |
6262 | // $ANTLR end "evidence" |
6263 | |
6264 | // $ANTLR start synpred71_FELIX |
6265 | public final void synpred71_FELIX_fragment() throws RecognitionException { |
6266 | FELIXParser.literal_return litp = null; |
6267 | |
6268 | |
6269 | // FELIX.g:802:4: ( 'v' litp= literal ) |
6270 | // FELIX.g:802:4: 'v' litp= literal |
6271 | { |
6272 | match(input,69,FOLLOW_69_in_synpred71_FELIX4083); if (state.failed) return ; |
6273 | pushFollow(FOLLOW_literal_in_synpred71_FELIX4087); |
6274 | litp=literal(); |
6275 | |
6276 | state._fsp--; |
6277 | if (state.failed) return ; |
6278 | |
6279 | } |
6280 | } |
6281 | // $ANTLR end synpred71_FELIX |
6282 | |
6283 | // $ANTLR start synpred82_FELIX |
6284 | public final void synpred82_FELIX_fragment() throws RecognitionException { |
6285 | FELIXParser.mathComparison_return mc = null; |
6286 | |
6287 | |
6288 | // FELIX.g:893:5: (mc= mathComparison ) |
6289 | // FELIX.g:893:5: mc= mathComparison |
6290 | { |
6291 | pushFollow(FOLLOW_mathComparison_in_synpred82_FELIX4677); |
6292 | mc=mathComparison(); |
6293 | |
6294 | state._fsp--; |
6295 | if (state.failed) return ; |
6296 | |
6297 | } |
6298 | } |
6299 | // $ANTLR end synpred82_FELIX |
6300 | |
6301 | // $ANTLR start synpred83_FELIX |
6302 | public final void synpred83_FELIX_fragment() throws RecognitionException { |
6303 | Token negc=null; |
6304 | FELIXParser.mathComparison_return mc = null; |
6305 | |
6306 | FELIXParser.funcExpression_return fe = null; |
6307 | |
6308 | |
6309 | // FELIX.g:886:3: ( (negc= ( '!' | 'NOT' ) )? (mc= mathComparison | fe= funcExpression ) ) |
6310 | // FELIX.g:886:3: (negc= ( '!' | 'NOT' ) )? (mc= mathComparison | fe= funcExpression ) |
6311 | { |
6312 | // FELIX.g:886:7: (negc= ( '!' | 'NOT' ) )? |
6313 | int alt102=2; |
6314 | int LA102_0 = input.LA(1); |
6315 | |
6316 | if ( (LA102_0==NOT||LA102_0==74) ) { |
6317 | alt102=1; |
6318 | } |
6319 | switch (alt102) { |
6320 | case 1 : |
6321 | // FELIX.g:0:0: negc= ( '!' | 'NOT' ) |
6322 | { |
6323 | negc=(Token)input.LT(1); |
6324 | if ( input.LA(1)==NOT||input.LA(1)==74 ) { |
6325 | input.consume(); |
6326 | state.errorRecovery=false;state.failed=false; |
6327 | } |
6328 | else { |
6329 | if (state.backtracking>0) {state.failed=true; return ;} |
6330 | MismatchedSetException mse = new MismatchedSetException(null,input); |
6331 | throw mse; |
6332 | } |
6333 | |
6334 | |
6335 | } |
6336 | break; |
6337 | |
6338 | } |
6339 | |
6340 | // FELIX.g:892:3: (mc= mathComparison | fe= funcExpression ) |
6341 | int alt103=2; |
6342 | int LA103_0 = input.LA(1); |
6343 | |
6344 | if ( (LA103_0==ID) ) { |
6345 | int LA103_1 = input.LA(2); |
6346 | |
6347 | if ( (synpred82_FELIX()) ) { |
6348 | alt103=1; |
6349 | } |
6350 | else if ( (true) ) { |
6351 | alt103=2; |
6352 | } |
6353 | else { |
6354 | if (state.backtracking>0) {state.failed=true; return ;} |
6355 | NoViableAltException nvae = |
6356 | new NoViableAltException("", 103, 1, input); |
6357 | |
6358 | throw nvae; |
6359 | } |
6360 | } |
6361 | else if ( (LA103_0==STRING||LA103_0==NUMBER||LA103_0==26||LA103_0==57) ) { |
6362 | alt103=1; |
6363 | } |
6364 | else { |
6365 | if (state.backtracking>0) {state.failed=true; return ;} |
6366 | NoViableAltException nvae = |
6367 | new NoViableAltException("", 103, 0, input); |
6368 | |
6369 | throw nvae; |
6370 | } |
6371 | switch (alt103) { |
6372 | case 1 : |
6373 | // FELIX.g:893:5: mc= mathComparison |
6374 | { |
6375 | pushFollow(FOLLOW_mathComparison_in_synpred83_FELIX4677); |
6376 | mc=mathComparison(); |
6377 | |
6378 | state._fsp--; |
6379 | if (state.failed) return ; |
6380 | |
6381 | } |
6382 | break; |
6383 | case 2 : |
6384 | // FELIX.g:897:7: fe= funcExpression |
6385 | { |
6386 | pushFollow(FOLLOW_funcExpression_in_synpred83_FELIX4712); |
6387 | fe=funcExpression(); |
6388 | |
6389 | state._fsp--; |
6390 | if (state.failed) return ; |
6391 | |
6392 | } |
6393 | break; |
6394 | |
6395 | } |
6396 | |
6397 | |
6398 | } |
6399 | } |
6400 | // $ANTLR end synpred83_FELIX |
6401 | |
6402 | // $ANTLR start synpred95_FELIX |
6403 | public final void synpred95_FELIX_fragment() throws RecognitionException { |
6404 | Token op=null; |
6405 | FELIXParser.mathTerm_return tp = null; |
6406 | |
6407 | |
6408 | // FELIX.g:954:5: (op= ( '+' | '-' | '%' ) tp= mathTerm ) |
6409 | // FELIX.g:954:5: op= ( '+' | '-' | '%' ) tp= mathTerm |
6410 | { |
6411 | op=(Token)input.LT(1); |
6412 | if ( (input.LA(1)>=PLUS && input.LA(1)<=MINUS)||input.LA(1)==79 ) { |
6413 | input.consume(); |
6414 | state.errorRecovery=false;state.failed=false; |
6415 | } |
6416 | else { |
6417 | if (state.backtracking>0) {state.failed=true; return ;} |
6418 | MismatchedSetException mse = new MismatchedSetException(null,input); |
6419 | throw mse; |
6420 | } |
6421 | |
6422 | pushFollow(FOLLOW_mathTerm_in_synpred95_FELIX5032); |
6423 | tp=mathTerm(); |
6424 | |
6425 | state._fsp--; |
6426 | if (state.failed) return ; |
6427 | |
6428 | } |
6429 | } |
6430 | // $ANTLR end synpred95_FELIX |
6431 | |
6432 | // $ANTLR start synpred102_FELIX |
6433 | public final void synpred102_FELIX_fragment() throws RecognitionException { |
6434 | Token op=null; |
6435 | FELIXParser.mathFactor_return tp = null; |
6436 | |
6437 | |
6438 | // FELIX.g:984:5: (op= ( '*' | '/' | '&' | '|' | '^' | '<<' | '>>' ) tp= mathFactor ) |
6439 | // FELIX.g:984:5: op= ( '*' | '/' | '&' | '|' | '^' | '<<' | '>>' ) tp= mathFactor |
6440 | { |
6441 | op=(Token)input.LT(1); |
6442 | if ( input.LA(1)==ASTERISK||input.LA(1)==40||(input.LA(1)>=80 && input.LA(1)<=84) ) { |
6443 | input.consume(); |
6444 | state.errorRecovery=false;state.failed=false; |
6445 | } |
6446 | else { |
6447 | if (state.backtracking>0) {state.failed=true; return ;} |
6448 | MismatchedSetException mse = new MismatchedSetException(null,input); |
6449 | throw mse; |
6450 | } |
6451 | |
6452 | pushFollow(FOLLOW_mathFactor_in_synpred102_FELIX5195); |
6453 | tp=mathFactor(); |
6454 | |
6455 | state._fsp--; |
6456 | if (state.failed) return ; |
6457 | |
6458 | } |
6459 | } |
6460 | // $ANTLR end synpred102_FELIX |
6461 | |
6462 | // $ANTLR start synpred106_FELIX |
6463 | public final void synpred106_FELIX_fragment() throws RecognitionException { |
6464 | Token fact=null; |
6465 | |
6466 | // FELIX.g:1041:7: (fact= '!' ) |
6467 | // FELIX.g:1041:7: fact= '!' |
6468 | { |
6469 | fact=(Token)match(input,NOT,FOLLOW_NOT_in_synpred106_FELIX5410); if (state.failed) return ; |
6470 | |
6471 | } |
6472 | } |
6473 | // $ANTLR end synpred106_FELIX |
6474 | |
6475 | // $ANTLR start synpred108_FELIX |
6476 | public final void synpred108_FELIX_fragment() throws RecognitionException { |
6477 | FELIXParser.boolExpression_return be = null; |
6478 | |
6479 | |
6480 | // FELIX.g:1074:3: (be= boolExpression ) |
6481 | // FELIX.g:1074:3: be= boolExpression |
6482 | { |
6483 | pushFollow(FOLLOW_boolExpression_in_synpred108_FELIX5553); |
6484 | be=boolExpression(); |
6485 | |
6486 | state._fsp--; |
6487 | if (state.failed) return ; |
6488 | |
6489 | } |
6490 | } |
6491 | // $ANTLR end synpred108_FELIX |
6492 | |
6493 | // $ANTLR start synpred109_FELIX |
6494 | public final void synpred109_FELIX_fragment() throws RecognitionException { |
6495 | FELIXParser.mathExpression_return me = null; |
6496 | |
6497 | |
6498 | // FELIX.g:1078:5: (me= mathExpression ) |
6499 | // FELIX.g:1078:5: me= mathExpression |
6500 | { |
6501 | pushFollow(FOLLOW_mathExpression_in_synpred109_FELIX5584); |
6502 | me=mathExpression(); |
6503 | |
6504 | state._fsp--; |
6505 | if (state.failed) return ; |
6506 | |
6507 | } |
6508 | } |
6509 | // $ANTLR end synpred109_FELIX |
6510 | |
6511 | // $ANTLR start synpred110_FELIX |
6512 | public final void synpred110_FELIX_fragment() throws RecognitionException { |
6513 | FELIXParser.funcExpression_return fe = null; |
6514 | |
6515 | |
6516 | // FELIX.g:1082:5: (fe= funcExpression ) |
6517 | // FELIX.g:1082:5: fe= funcExpression |
6518 | { |
6519 | pushFollow(FOLLOW_funcExpression_in_synpred110_FELIX5617); |
6520 | fe=funcExpression(); |
6521 | |
6522 | state._fsp--; |
6523 | if (state.failed) return ; |
6524 | |
6525 | } |
6526 | } |
6527 | // $ANTLR end synpred110_FELIX |
6528 | |
6529 | // Delegated rules |
6530 | |
6531 | public final boolean synpred109_FELIX() { |
6532 | state.backtracking++; |
6533 | int start = input.mark(); |
6534 | try { |
6535 | synpred109_FELIX_fragment(); // can never throw exception |
6536 | } catch (RecognitionException re) { |
6537 | System.err.println("impossible: "+re); |
6538 | } |
6539 | boolean success = !state.failed; |
6540 | input.rewind(start); |
6541 | state.backtracking--; |
6542 | state.failed=false; |
6543 | return success; |
6544 | } |
6545 | public final boolean synpred110_FELIX() { |
6546 | state.backtracking++; |
6547 | int start = input.mark(); |
6548 | try { |
6549 | synpred110_FELIX_fragment(); // can never throw exception |
6550 | } catch (RecognitionException re) { |
6551 | System.err.println("impossible: "+re); |
6552 | } |
6553 | boolean success = !state.failed; |
6554 | input.rewind(start); |
6555 | state.backtracking--; |
6556 | state.failed=false; |
6557 | return success; |
6558 | } |
6559 | public final boolean synpred106_FELIX() { |
6560 | state.backtracking++; |
6561 | int start = input.mark(); |
6562 | try { |
6563 | synpred106_FELIX_fragment(); // can never throw exception |
6564 | } catch (RecognitionException re) { |
6565 | System.err.println("impossible: "+re); |
6566 | } |
6567 | boolean success = !state.failed; |
6568 | input.rewind(start); |
6569 | state.backtracking--; |
6570 | state.failed=false; |
6571 | return success; |
6572 | } |
6573 | public final boolean synpred82_FELIX() { |
6574 | state.backtracking++; |
6575 | int start = input.mark(); |
6576 | try { |
6577 | synpred82_FELIX_fragment(); // can never throw exception |
6578 | } catch (RecognitionException re) { |
6579 | System.err.println("impossible: "+re); |
6580 | } |
6581 | boolean success = !state.failed; |
6582 | input.rewind(start); |
6583 | state.backtracking--; |
6584 | state.failed=false; |
6585 | return success; |
6586 | } |
6587 | public final boolean synpred71_FELIX() { |
6588 | state.backtracking++; |
6589 | int start = input.mark(); |
6590 | try { |
6591 | synpred71_FELIX_fragment(); // can never throw exception |
6592 | } catch (RecognitionException re) { |
6593 | System.err.println("impossible: "+re); |
6594 | } |
6595 | boolean success = !state.failed; |
6596 | input.rewind(start); |
6597 | state.backtracking--; |
6598 | state.failed=false; |
6599 | return success; |
6600 | } |
6601 | public final boolean synpred95_FELIX() { |
6602 | state.backtracking++; |
6603 | int start = input.mark(); |
6604 | try { |
6605 | synpred95_FELIX_fragment(); // can never throw exception |
6606 | } catch (RecognitionException re) { |
6607 | System.err.println("impossible: "+re); |
6608 | } |
6609 | boolean success = !state.failed; |
6610 | input.rewind(start); |
6611 | state.backtracking--; |
6612 | state.failed=false; |
6613 | return success; |
6614 | } |
6615 | public final boolean synpred102_FELIX() { |
6616 | state.backtracking++; |
6617 | int start = input.mark(); |
6618 | try { |
6619 | synpred102_FELIX_fragment(); // can never throw exception |
6620 | } catch (RecognitionException re) { |
6621 | System.err.println("impossible: "+re); |
6622 | } |
6623 | boolean success = !state.failed; |
6624 | input.rewind(start); |
6625 | state.backtracking--; |
6626 | state.failed=false; |
6627 | return success; |
6628 | } |
6629 | public final boolean synpred83_FELIX() { |
6630 | state.backtracking++; |
6631 | int start = input.mark(); |
6632 | try { |
6633 | synpred83_FELIX_fragment(); // can never throw exception |
6634 | } catch (RecognitionException re) { |
6635 | System.err.println("impossible: "+re); |
6636 | } |
6637 | boolean success = !state.failed; |
6638 | input.rewind(start); |
6639 | state.backtracking--; |
6640 | state.failed=false; |
6641 | return success; |
6642 | } |
6643 | public final boolean synpred108_FELIX() { |
6644 | state.backtracking++; |
6645 | int start = input.mark(); |
6646 | try { |
6647 | synpred108_FELIX_fragment(); // can never throw exception |
6648 | } catch (RecognitionException re) { |
6649 | System.err.println("impossible: "+re); |
6650 | } |
6651 | boolean success = !state.failed; |
6652 | input.rewind(start); |
6653 | state.backtracking--; |
6654 | state.failed=false; |
6655 | return success; |
6656 | } |
6657 | |
6658 | |
6659 | protected DFA1 dfa1 = new DFA1(this); |
6660 | protected DFA26 dfa26 = new DFA26(this); |
6661 | protected DFA33 dfa33 = new DFA33(this); |
6662 | protected DFA37 dfa37 = new DFA37(this); |
6663 | protected DFA44 dfa44 = new DFA44(this); |
6664 | protected DFA51 dfa51 = new DFA51(this); |
6665 | protected DFA48 dfa48 = new DFA48(this); |
6666 | protected DFA52 dfa52 = new DFA52(this); |
6667 | protected DFA62 dfa62 = new DFA62(this); |
6668 | protected DFA63 dfa63 = new DFA63(this); |
6669 | protected DFA67 dfa67 = new DFA67(this); |
6670 | static final String DFA1_eotS = |
6671 | "\32\uffff"; |
6672 | static final String DFA1_eofS = |
6673 | "\1\1\17\uffff\1\6\4\uffff\1\6\1\uffff\1\6\2\uffff"; |
6674 | static final String DFA1_minS = |
6675 | "\1\6\1\uffff\2\11\2\6\2\uffff\1\16\3\11\1\6\3\16\4\6\1\16\1\6\1"+ |
6676 | "\16\3\6"; |
6677 | static final String DFA1_maxS = |
6678 | "\1\71\1\uffff\1\53\1\31\2\62\2\uffff\1\24\3\32\1\34\3\24\1\105\3"+ |
6679 | "\34\1\24\1\71\1\24\1\104\2\34"; |
6680 | static final String DFA1_acceptS = |
6681 | "\1\uffff\1\3\4\uffff\1\1\1\2\22\uffff"; |
6682 | static final String DFA1_specialS = |
6683 | "\32\uffff}>"; |
6684 | static final String[] DFA1_transitionS = { |
6685 | "\1\1\1\3\1\uffff\1\5\1\uffff\1\1\6\uffff\1\1\1\uffff\1\2\3\uffff"+ |
6686 | "\1\6\1\4\17\uffff\2\7\3\uffff\5\1\1\uffff\1\1\4\uffff\1\1", |
6687 | "", |
6688 | "\1\6\20\uffff\1\10\20\uffff\1\1", |
6689 | "\1\6\12\uffff\1\11\3\uffff\2\6", |
6690 | "\2\1\14\uffff\1\12\35\uffff\1\1", |
6691 | "\2\1\14\uffff\1\13\4\uffff\1\6\30\uffff\1\1", |
6692 | "", |
6693 | "", |
6694 | "\1\1\3\uffff\1\1\1\uffff\1\14", |
6695 | "\1\6\20\uffff\1\10", |
6696 | "\1\6\20\uffff\1\15", |
6697 | "\1\6\20\uffff\1\16", |
6698 | "\1\6\15\uffff\1\6\6\uffff\1\17\1\20", |
6699 | "\1\1\3\uffff\1\1\1\uffff\1\21", |
6700 | "\1\1\3\uffff\1\1\1\uffff\1\22", |
6701 | "\1\1\3\uffff\1\1\1\uffff\1\23", |
6702 | "\2\6\1\uffff\1\6\1\1\1\6\1\1\5\uffff\1\6\1\uffff\3\6\1\uffff"+ |
6703 | "\2\6\1\uffff\1\1\1\uffff\1\6\11\uffff\1\6\1\uffff\2\6\3\uffff"+ |
6704 | "\5\6\1\1\1\6\3\uffff\1\1\1\6\14\1", |
6705 | "\1\6\15\uffff\1\6\6\uffff\1\24\1\25", |
6706 | "\1\6\15\uffff\1\6\6\uffff\1\26\1\27", |
6707 | "\1\6\15\uffff\1\6\6\uffff\1\17\1\20", |
6708 | "\1\1\3\uffff\1\1\1\uffff\1\30", |
6709 | "\2\6\1\uffff\1\6\1\uffff\1\6\6\uffff\1\6\1\uffff\3\6\1\uffff"+ |
6710 | "\2\6\3\uffff\1\6\11\uffff\1\6\1\uffff\2\6\3\uffff\5\6\1\1\1"+ |
6711 | "\6\4\uffff\1\6", |
6712 | "\1\1\3\uffff\1\1\1\uffff\1\31", |
6713 | "\2\6\1\uffff\1\6\1\uffff\1\6\6\uffff\1\6\1\uffff\3\6\1\uffff"+ |
6714 | "\2\6\3\uffff\1\6\11\uffff\1\6\1\uffff\2\6\3\uffff\5\6\1\uffff"+ |
6715 | "\1\6\4\uffff\1\6\13\1", |
6716 | "\1\6\15\uffff\1\6\6\uffff\1\24\1\25", |
6717 | "\1\6\15\uffff\1\6\6\uffff\1\26\1\27" |
6718 | }; |
6719 | |
6720 | static final short[] DFA1_eot = DFA.unpackEncodedString(DFA1_eotS); |
6721 | static final short[] DFA1_eof = DFA.unpackEncodedString(DFA1_eofS); |
6722 | static final char[] DFA1_min = DFA.unpackEncodedStringToUnsignedChars(DFA1_minS); |
6723 | static final char[] DFA1_max = DFA.unpackEncodedStringToUnsignedChars(DFA1_maxS); |
6724 | static final short[] DFA1_accept = DFA.unpackEncodedString(DFA1_acceptS); |
6725 | static final short[] DFA1_special = DFA.unpackEncodedString(DFA1_specialS); |
6726 | static final short[][] DFA1_transition; |
6727 | |
6728 | static { |
6729 | int numStates = DFA1_transitionS.length; |
6730 | DFA1_transition = new short[numStates][]; |
6731 | for (int i=0; i<numStates; i++) { |
6732 | DFA1_transition[i] = DFA.unpackEncodedString(DFA1_transitionS[i]); |
6733 | } |
6734 | } |
6735 | |
6736 | class DFA1 extends DFA { |
6737 | |
6738 | public DFA1(BaseRecognizer recognizer) { |
6739 | this.recognizer = recognizer; |
6740 | this.decisionNumber = 1; |
6741 | this.eot = DFA1_eot; |
6742 | this.eof = DFA1_eof; |
6743 | this.min = DFA1_min; |
6744 | this.max = DFA1_max; |
6745 | this.accept = DFA1_accept; |
6746 | this.special = DFA1_special; |
6747 | this.transition = DFA1_transition; |
6748 | } |
6749 | public String getDescription() { |
6750 | return "()* loopback of 329:3: ( schema | schemaConstraint )*"; |
6751 | } |
6752 | } |
6753 | static final String DFA26_eotS = |
6754 | "\44\uffff"; |
6755 | static final String DFA26_eofS = |
6756 | "\1\1\32\uffff\1\2\10\uffff"; |
6757 | static final String DFA26_minS = |
6758 | "\1\6\2\uffff\1\6\1\32\1\24\2\uffff\1\6\1\uffff\1\24\1\32\1\16\1"+ |
6759 | "\32\1\24\1\32\1\16\2\33\1\16\2\33\1\16\1\12\2\33\1\16\1\6\2\33\1"+ |
6760 | "\16\1\63\4\33"; |
6761 | static final String DFA26_maxS = |
6762 | "\1\71\2\uffff\1\71\1\53\1\24\2\uffff\1\24\1\uffff\1\24\1\32\1\24"+ |
6763 | "\1\32\1\24\1\32\1\24\2\34\1\24\2\34\1\24\1\105\2\34\1\24\1\105\2"+ |
6764 | "\34\1\24\1\104\4\34"; |
6765 | static final String DFA26_acceptS = |
6766 | "\1\uffff\1\5\1\1\3\uffff\1\2\1\3\1\uffff\1\4\32\uffff"; |
6767 | static final String DFA26_specialS = |
6768 | "\44\uffff}>"; |
6769 | static final String[] DFA26_transitionS = { |
6770 | "\2\5\1\uffff\1\11\1\uffff\1\2\6\uffff\1\3\1\uffff\1\4\4\uffff"+ |
6771 | "\1\7\24\uffff\3\2\1\7\1\10\1\uffff\1\6\4\uffff\1\11", |
6772 | "", |
6773 | "", |
6774 | "\2\12\1\uffff\1\11\1\uffff\1\2\10\uffff\1\13\35\uffff\1\11"+ |
6775 | "\6\uffff\1\11", |
6776 | "\1\14\20\uffff\1\2", |
6777 | "\1\15", |
6778 | "", |
6779 | "", |
6780 | "\2\16\14\uffff\1\17", |
6781 | "", |
6782 | "\1\13", |
6783 | "\1\20", |
6784 | "\1\22\3\uffff\1\22\1\uffff\1\21", |
6785 | "\1\14", |
6786 | "\1\17", |
6787 | "\1\23", |
6788 | "\1\25\3\uffff\1\25\1\uffff\1\24", |
6789 | "\1\26\1\27", |
6790 | "\1\26\1\27", |
6791 | "\1\31\3\uffff\1\31\1\uffff\1\30", |
6792 | "\1\32\1\33", |
6793 | "\1\32\1\33", |
6794 | "\1\35\3\uffff\1\35\1\uffff\1\34", |
6795 | "\1\2\1\uffff\1\2\16\uffff\1\2\27\uffff\1\7\4\uffff\1\6\1\uffff"+ |
6796 | "\13\11\1\2", |
6797 | "\1\36\1\37", |
6798 | "\1\36\1\37", |
6799 | "\1\41\3\uffff\1\41\1\uffff\1\40", |
6800 | "\2\2\1\uffff\1\2\1\uffff\2\2\5\uffff\1\2\1\uffff\1\2\4\uffff"+ |
6801 | "\1\2\1\uffff\1\2\22\uffff\5\2\1\uffff\1\2\4\uffff\1\2\13\11"+ |
6802 | "\1\2", |
6803 | "\1\26\1\27", |
6804 | "\1\26\1\27", |
6805 | "\1\43\3\uffff\1\43\1\uffff\1\42", |
6806 | "\1\7\6\uffff\13\11", |
6807 | "\1\32\1\33", |
6808 | "\1\32\1\33", |
6809 | "\1\36\1\37", |
6810 | "\1\36\1\37" |
6811 | }; |
6812 | |
6813 | static final short[] DFA26_eot = DFA.unpackEncodedString(DFA26_eotS); |
6814 | static final short[] DFA26_eof = DFA.unpackEncodedString(DFA26_eofS); |
6815 | static final char[] DFA26_min = DFA.unpackEncodedStringToUnsignedChars(DFA26_minS); |
6816 | static final char[] DFA26_max = DFA.unpackEncodedStringToUnsignedChars(DFA26_maxS); |
6817 | static final short[] DFA26_accept = DFA.unpackEncodedString(DFA26_acceptS); |
6818 | static final short[] DFA26_special = DFA.unpackEncodedString(DFA26_specialS); |
6819 | static final short[][] DFA26_transition; |
6820 | |
6821 | static { |
6822 | int numStates = DFA26_transitionS.length; |
6823 | DFA26_transition = new short[numStates][]; |
6824 | for (int i=0; i<numStates; i++) { |
6825 | DFA26_transition[i] = DFA.unpackEncodedString(DFA26_transitionS[i]); |
6826 | } |
6827 | } |
6828 | |
6829 | class DFA26 extends DFA { |
6830 | |
6831 | public DFA26(BaseRecognizer recognizer) { |
6832 | this.recognizer = recognizer; |
6833 | this.decisionNumber = 26; |
6834 | this.eot = DFA26_eot; |
6835 | this.eof = DFA26_eof; |
6836 | this.min = DFA26_min; |
6837 | this.max = DFA26_max; |
6838 | this.accept = DFA26_accept; |
6839 | this.special = DFA26_special; |
6840 | this.transition = DFA26_transition; |
6841 | } |
6842 | public String getDescription() { |
6843 | return "()* loopback of 512:3: ( mlnRule | scopingRule | datalogRule | clusteringRule )*"; |
6844 | } |
6845 | } |
6846 | static final String DFA33_eotS = |
6847 | "\16\uffff"; |
6848 | static final String DFA33_eofS = |
6849 | "\16\uffff"; |
6850 | static final String DFA33_minS = |
6851 | "\1\12\1\6\1\uffff\1\6\1\uffff\11\6"; |
6852 | static final String DFA33_maxS = |
6853 | "\1\33\1\71\1\uffff\1\124\1\uffff\1\112\3\124\1\112\4\124"; |
6854 | static final String DFA33_acceptS = |
6855 | "\2\uffff\1\2\1\uffff\1\1\11\uffff"; |
6856 | static final String DFA33_specialS = |
6857 | "\16\uffff}>"; |
6858 | static final String[] DFA33_transitionS = { |
6859 | "\1\2\20\uffff\1\1", |
6860 | "\2\4\6\uffff\1\2\3\uffff\1\2\1\uffff\1\3\5\uffff\1\2\31\uffff"+ |
6861 | "\1\2\4\uffff\1\2", |
6862 | "", |
6863 | "\4\2\20\uffff\1\5\7\uffff\1\2\5\uffff\1\2\16\uffff\1\2\2\uffff"+ |
6864 | "\1\2\20\uffff\12\2", |
6865 | "", |
6866 | "\1\2\7\uffff\1\10\3\uffff\1\7\1\uffff\1\6\5\uffff\1\2\36\uffff"+ |
6867 | "\1\2\20\uffff\1\2", |
6868 | "\4\2\20\uffff\1\2\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
6869 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
6870 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
6871 | "\2\2\uffff\1\2\20\uffff\12\2", |
6872 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
6873 | "\2\2\uffff\1\2\20\uffff\12\2", |
6874 | "\1\2\7\uffff\1\15\3\uffff\1\14\1\uffff\1\13\5\uffff\1\2\36"+ |
6875 | "\uffff\1\2\20\uffff\1\2", |
6876 | "\4\2\1\4\20\uffff\1\4\6\uffff\1\2\5\uffff\1\2\16\uffff\1\2"+ |
6877 | "\2\uffff\1\2\20\uffff\12\2", |
6878 | "\4\2\20\uffff\1\2\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
6879 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
6880 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
6881 | "\2\2\uffff\1\2\20\uffff\12\2", |
6882 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
6883 | "\2\2\uffff\1\2\20\uffff\12\2" |
6884 | }; |
6885 | |
6886 | static final short[] DFA33_eot = DFA.unpackEncodedString(DFA33_eotS); |
6887 | static final short[] DFA33_eof = DFA.unpackEncodedString(DFA33_eofS); |
6888 | static final char[] DFA33_min = DFA.unpackEncodedStringToUnsignedChars(DFA33_minS); |
6889 | static final char[] DFA33_max = DFA.unpackEncodedStringToUnsignedChars(DFA33_maxS); |
6890 | static final short[] DFA33_accept = DFA.unpackEncodedString(DFA33_acceptS); |
6891 | static final short[] DFA33_special = DFA.unpackEncodedString(DFA33_specialS); |
6892 | static final short[][] DFA33_transition; |
6893 | |
6894 | static { |
6895 | int numStates = DFA33_transitionS.length; |
6896 | DFA33_transition = new short[numStates][]; |
6897 | for (int i=0; i<numStates; i++) { |
6898 | DFA33_transition[i] = DFA.unpackEncodedString(DFA33_transitionS[i]); |
6899 | } |
6900 | } |
6901 | |
6902 | class DFA33 extends DFA { |
6903 | |
6904 | public DFA33(BaseRecognizer recognizer) { |
6905 | this.recognizer = recognizer; |
6906 | this.decisionNumber = 33; |
6907 | this.eot = DFA33_eot; |
6908 | this.eof = DFA33_eof; |
6909 | this.min = DFA33_min; |
6910 | this.max = DFA33_max; |
6911 | this.accept = DFA33_accept; |
6912 | this.special = DFA33_special; |
6913 | this.transition = DFA33_transition; |
6914 | } |
6915 | public String getDescription() { |
6916 | return "()* loopback of 614:3: ( ',' bodyp= literal )*"; |
6917 | } |
6918 | } |
6919 | static final String DFA37_eotS = |
6920 | "\16\uffff"; |
6921 | static final String DFA37_eofS = |
6922 | "\16\uffff"; |
6923 | static final String DFA37_minS = |
6924 | "\1\12\1\6\1\uffff\1\6\1\uffff\11\6"; |
6925 | static final String DFA37_maxS = |
6926 | "\1\33\1\71\1\uffff\1\124\1\uffff\1\112\3\124\1\112\4\124"; |
6927 | static final String DFA37_acceptS = |
6928 | "\2\uffff\1\2\1\uffff\1\1\11\uffff"; |
6929 | static final String DFA37_specialS = |
6930 | "\16\uffff}>"; |
6931 | static final String[] DFA37_transitionS = { |
6932 | "\1\2\20\uffff\1\1", |
6933 | "\2\4\6\uffff\1\2\3\uffff\1\2\1\uffff\1\3\5\uffff\1\2\31\uffff"+ |
6934 | "\1\2\4\uffff\1\2", |
6935 | "", |
6936 | "\4\2\20\uffff\1\5\7\uffff\1\2\5\uffff\1\2\16\uffff\1\2\2\uffff"+ |
6937 | "\1\2\20\uffff\12\2", |
6938 | "", |
6939 | "\1\2\7\uffff\1\10\3\uffff\1\7\1\uffff\1\6\5\uffff\1\2\36\uffff"+ |
6940 | "\1\2\20\uffff\1\2", |
6941 | "\4\2\20\uffff\1\2\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
6942 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
6943 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
6944 | "\2\2\uffff\1\2\20\uffff\12\2", |
6945 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
6946 | "\2\2\uffff\1\2\20\uffff\12\2", |
6947 | "\1\2\7\uffff\1\15\3\uffff\1\14\1\uffff\1\13\5\uffff\1\2\36"+ |
6948 | "\uffff\1\2\20\uffff\1\2", |
6949 | "\4\2\1\4\20\uffff\1\4\6\uffff\1\2\5\uffff\1\2\16\uffff\1\2"+ |
6950 | "\2\uffff\1\2\20\uffff\12\2", |
6951 | "\4\2\20\uffff\1\2\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
6952 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
6953 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
6954 | "\2\2\uffff\1\2\20\uffff\12\2", |
6955 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
6956 | "\2\2\uffff\1\2\20\uffff\12\2" |
6957 | }; |
6958 | |
6959 | static final short[] DFA37_eot = DFA.unpackEncodedString(DFA37_eotS); |
6960 | static final short[] DFA37_eof = DFA.unpackEncodedString(DFA37_eofS); |
6961 | static final char[] DFA37_min = DFA.unpackEncodedStringToUnsignedChars(DFA37_minS); |
6962 | static final char[] DFA37_max = DFA.unpackEncodedStringToUnsignedChars(DFA37_maxS); |
6963 | static final short[] DFA37_accept = DFA.unpackEncodedString(DFA37_acceptS); |
6964 | static final short[] DFA37_special = DFA.unpackEncodedString(DFA37_specialS); |
6965 | static final short[][] DFA37_transition; |
6966 | |
6967 | static { |
6968 | int numStates = DFA37_transitionS.length; |
6969 | DFA37_transition = new short[numStates][]; |
6970 | for (int i=0; i<numStates; i++) { |
6971 | DFA37_transition[i] = DFA.unpackEncodedString(DFA37_transitionS[i]); |
6972 | } |
6973 | } |
6974 | |
6975 | class DFA37 extends DFA { |
6976 | |
6977 | public DFA37(BaseRecognizer recognizer) { |
6978 | this.recognizer = recognizer; |
6979 | this.decisionNumber = 37; |
6980 | this.eot = DFA37_eot; |
6981 | this.eof = DFA37_eof; |
6982 | this.min = DFA37_min; |
6983 | this.max = DFA37_max; |
6984 | this.accept = DFA37_accept; |
6985 | this.special = DFA37_special; |
6986 | this.transition = DFA37_transition; |
6987 | } |
6988 | public String getDescription() { |
6989 | return "()* loopback of 659:3: ( ',' bodyp= literal )*"; |
6990 | } |
6991 | } |
6992 | static final String DFA44_eotS = |
6993 | "\16\uffff"; |
6994 | static final String DFA44_eofS = |
6995 | "\16\uffff"; |
6996 | static final String DFA44_minS = |
6997 | "\1\12\1\6\1\uffff\1\6\1\uffff\11\6"; |
6998 | static final String DFA44_maxS = |
6999 | "\1\33\1\71\1\uffff\1\124\1\uffff\1\112\3\124\1\112\4\124"; |
7000 | static final String DFA44_acceptS = |
7001 | "\2\uffff\1\2\1\uffff\1\1\11\uffff"; |
7002 | static final String DFA44_specialS = |
7003 | "\16\uffff}>"; |
7004 | static final String[] DFA44_transitionS = { |
7005 | "\1\2\20\uffff\1\1", |
7006 | "\2\4\6\uffff\1\2\3\uffff\1\2\1\uffff\1\3\5\uffff\1\2\31\uffff"+ |
7007 | "\1\2\4\uffff\1\2", |
7008 | "", |
7009 | "\4\2\20\uffff\1\5\7\uffff\1\2\5\uffff\1\2\16\uffff\1\2\2\uffff"+ |
7010 | "\1\2\20\uffff\12\2", |
7011 | "", |
7012 | "\1\2\7\uffff\1\10\3\uffff\1\7\1\uffff\1\6\5\uffff\1\2\36\uffff"+ |
7013 | "\1\2\20\uffff\1\2", |
7014 | "\4\2\20\uffff\1\2\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7015 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7016 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7017 | "\2\2\uffff\1\2\20\uffff\12\2", |
7018 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7019 | "\2\2\uffff\1\2\20\uffff\12\2", |
7020 | "\1\2\7\uffff\1\15\3\uffff\1\14\1\uffff\1\13\5\uffff\1\2\36"+ |
7021 | "\uffff\1\2\20\uffff\1\2", |
7022 | "\4\2\1\4\20\uffff\1\4\6\uffff\1\2\5\uffff\1\2\16\uffff\1\2"+ |
7023 | "\2\uffff\1\2\20\uffff\12\2", |
7024 | "\4\2\20\uffff\1\2\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7025 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7026 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7027 | "\2\2\uffff\1\2\20\uffff\12\2", |
7028 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7029 | "\2\2\uffff\1\2\20\uffff\12\2" |
7030 | }; |
7031 | |
7032 | static final short[] DFA44_eot = DFA.unpackEncodedString(DFA44_eotS); |
7033 | static final short[] DFA44_eof = DFA.unpackEncodedString(DFA44_eofS); |
7034 | static final char[] DFA44_min = DFA.unpackEncodedStringToUnsignedChars(DFA44_minS); |
7035 | static final char[] DFA44_max = DFA.unpackEncodedStringToUnsignedChars(DFA44_maxS); |
7036 | static final short[] DFA44_accept = DFA.unpackEncodedString(DFA44_acceptS); |
7037 | static final short[] DFA44_special = DFA.unpackEncodedString(DFA44_specialS); |
7038 | static final short[][] DFA44_transition; |
7039 | |
7040 | static { |
7041 | int numStates = DFA44_transitionS.length; |
7042 | DFA44_transition = new short[numStates][]; |
7043 | for (int i=0; i<numStates; i++) { |
7044 | DFA44_transition[i] = DFA.unpackEncodedString(DFA44_transitionS[i]); |
7045 | } |
7046 | } |
7047 | |
7048 | class DFA44 extends DFA { |
7049 | |
7050 | public DFA44(BaseRecognizer recognizer) { |
7051 | this.recognizer = recognizer; |
7052 | this.decisionNumber = 44; |
7053 | this.eot = DFA44_eot; |
7054 | this.eof = DFA44_eof; |
7055 | this.min = DFA44_min; |
7056 | this.max = DFA44_max; |
7057 | this.accept = DFA44_accept; |
7058 | this.special = DFA44_special; |
7059 | this.transition = DFA44_transition; |
7060 | } |
7061 | public String getDescription() { |
7062 | return "()* loopback of 712:3: ( ',' bodyp= literal )*"; |
7063 | } |
7064 | } |
7065 | static final String DFA51_eotS = |
7066 | "\14\uffff"; |
7067 | static final String DFA51_eofS = |
7068 | "\7\uffff\1\13\4\uffff"; |
7069 | static final String DFA51_minS = |
7070 | "\1\6\1\24\1\32\1\16\2\33\1\16\1\6\2\33\2\uffff"; |
7071 | static final String DFA51_maxS = |
7072 | "\2\24\1\32\1\24\2\34\1\24\1\105\2\34\2\uffff"; |
7073 | static final String DFA51_acceptS = |
7074 | "\12\uffff\1\1\1\2"; |
7075 | static final String DFA51_specialS = |
7076 | "\14\uffff}>"; |
7077 | static final String[] DFA51_transitionS = { |
7078 | "\2\1\14\uffff\1\2", |
7079 | "\1\2", |
7080 | "\1\3", |
7081 | "\1\5\3\uffff\1\5\1\uffff\1\4", |
7082 | "\1\6\1\7", |
7083 | "\1\6\1\7", |
7084 | "\1\11\3\uffff\1\11\1\uffff\1\10", |
7085 | "\2\13\1\uffff\3\13\1\12\5\uffff\1\13\1\uffff\1\13\4\uffff\1"+ |
7086 | "\13\1\uffff\1\12\22\uffff\5\13\1\uffff\1\13\4\uffff\1\13\13"+ |
7087 | "\uffff\1\13", |
7088 | "\1\6\1\7", |
7089 | "\1\6\1\7", |
7090 | "", |
7091 | "" |
7092 | }; |
7093 | |
7094 | static final short[] DFA51_eot = DFA.unpackEncodedString(DFA51_eotS); |
7095 | static final short[] DFA51_eof = DFA.unpackEncodedString(DFA51_eofS); |
7096 | static final char[] DFA51_min = DFA.unpackEncodedStringToUnsignedChars(DFA51_minS); |
7097 | static final char[] DFA51_max = DFA.unpackEncodedStringToUnsignedChars(DFA51_maxS); |
7098 | static final short[] DFA51_accept = DFA.unpackEncodedString(DFA51_acceptS); |
7099 | static final short[] DFA51_special = DFA.unpackEncodedString(DFA51_specialS); |
7100 | static final short[][] DFA51_transition; |
7101 | |
7102 | static { |
7103 | int numStates = DFA51_transitionS.length; |
7104 | DFA51_transition = new short[numStates][]; |
7105 | for (int i=0; i<numStates; i++) { |
7106 | DFA51_transition[i] = DFA.unpackEncodedString(DFA51_transitionS[i]); |
7107 | } |
7108 | } |
7109 | |
7110 | class DFA51 extends DFA { |
7111 | |
7112 | public DFA51(BaseRecognizer recognizer) { |
7113 | this.recognizer = recognizer; |
7114 | this.decisionNumber = 51; |
7115 | this.eot = DFA51_eot; |
7116 | this.eof = DFA51_eof; |
7117 | this.min = DFA51_min; |
7118 | this.max = DFA51_max; |
7119 | this.accept = DFA51_accept; |
7120 | this.special = DFA51_special; |
7121 | this.transition = DFA51_transition; |
7122 | } |
7123 | public String getDescription() { |
7124 | return "775:3: (ant0= literal ( ',' antp= literal )* ( ',' mc= mathComparison )* ( ',' '[' be= boolExpression ']' )? IMPLIES )?"; |
7125 | } |
7126 | } |
7127 | static final String DFA48_eotS = |
7128 | "\16\uffff"; |
7129 | static final String DFA48_eofS = |
7130 | "\16\uffff"; |
7131 | static final String DFA48_minS = |
7132 | "\1\14\1\6\1\uffff\1\6\1\uffff\11\6"; |
7133 | static final String DFA48_maxS = |
7134 | "\1\33\1\71\1\uffff\1\124\1\uffff\1\112\3\124\1\112\4\124"; |
7135 | static final String DFA48_acceptS = |
7136 | "\2\uffff\1\2\1\uffff\1\1\11\uffff"; |
7137 | static final String DFA48_specialS = |
7138 | "\16\uffff}>"; |
7139 | static final String[] DFA48_transitionS = { |
7140 | "\1\2\16\uffff\1\1", |
7141 | "\2\4\6\uffff\1\2\3\uffff\1\2\1\uffff\1\3\5\uffff\1\2\31\uffff"+ |
7142 | "\1\2\4\uffff\1\2", |
7143 | "", |
7144 | "\4\2\20\uffff\1\5\7\uffff\1\2\5\uffff\1\2\16\uffff\1\2\2\uffff"+ |
7145 | "\1\2\20\uffff\12\2", |
7146 | "", |
7147 | "\1\2\7\uffff\1\10\3\uffff\1\7\1\uffff\1\6\5\uffff\1\2\36\uffff"+ |
7148 | "\1\2\20\uffff\1\2", |
7149 | "\4\2\20\uffff\1\2\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7150 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7151 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7152 | "\2\2\uffff\1\2\20\uffff\12\2", |
7153 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7154 | "\2\2\uffff\1\2\20\uffff\12\2", |
7155 | "\1\2\7\uffff\1\15\3\uffff\1\14\1\uffff\1\13\5\uffff\1\2\36"+ |
7156 | "\uffff\1\2\20\uffff\1\2", |
7157 | "\4\2\2\uffff\1\4\16\uffff\1\4\6\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7158 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7159 | "\4\2\20\uffff\1\2\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7160 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7161 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7162 | "\2\2\uffff\1\2\20\uffff\12\2", |
7163 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7164 | "\2\2\uffff\1\2\20\uffff\12\2" |
7165 | }; |
7166 | |
7167 | static final short[] DFA48_eot = DFA.unpackEncodedString(DFA48_eotS); |
7168 | static final short[] DFA48_eof = DFA.unpackEncodedString(DFA48_eofS); |
7169 | static final char[] DFA48_min = DFA.unpackEncodedStringToUnsignedChars(DFA48_minS); |
7170 | static final char[] DFA48_max = DFA.unpackEncodedStringToUnsignedChars(DFA48_maxS); |
7171 | static final short[] DFA48_accept = DFA.unpackEncodedString(DFA48_acceptS); |
7172 | static final short[] DFA48_special = DFA.unpackEncodedString(DFA48_specialS); |
7173 | static final short[][] DFA48_transition; |
7174 | |
7175 | static { |
7176 | int numStates = DFA48_transitionS.length; |
7177 | DFA48_transition = new short[numStates][]; |
7178 | for (int i=0; i<numStates; i++) { |
7179 | DFA48_transition[i] = DFA.unpackEncodedString(DFA48_transitionS[i]); |
7180 | } |
7181 | } |
7182 | |
7183 | class DFA48 extends DFA { |
7184 | |
7185 | public DFA48(BaseRecognizer recognizer) { |
7186 | this.recognizer = recognizer; |
7187 | this.decisionNumber = 48; |
7188 | this.eot = DFA48_eot; |
7189 | this.eof = DFA48_eof; |
7190 | this.min = DFA48_min; |
7191 | this.max = DFA48_max; |
7192 | this.accept = DFA48_accept; |
7193 | this.special = DFA48_special; |
7194 | this.transition = DFA48_transition; |
7195 | } |
7196 | public String getDescription() { |
7197 | return "()* loopback of 783:5: ( ',' antp= literal )*"; |
7198 | } |
7199 | } |
7200 | static final String DFA52_eotS = |
7201 | "\61\uffff"; |
7202 | static final String DFA52_eofS = |
7203 | "\1\2\11\uffff\1\4\33\uffff\1\2\5\uffff\1\2\4\uffff"; |
7204 | static final String DFA52_minS = |
7205 | "\2\6\1\uffff\1\6\1\uffff\11\6\1\7\1\6\1\16\37\6\1\0"; |
7206 | static final String DFA52_maxS = |
7207 | "\1\105\1\71\1\uffff\1\124\1\uffff\1\112\3\124\1\112\5\124\2\71\2"+ |
7208 | "\124\2\112\6\124\1\112\1\124\1\112\4\124\1\71\4\124\1\112\3\124"+ |
7209 | "\1\112\4\124\1\0"; |
7210 | static final String DFA52_acceptS = |
7211 | "\2\uffff\1\2\1\uffff\1\1\54\uffff"; |
7212 | static final String DFA52_specialS = |
7213 | "\60\uffff\1\0}>"; |
7214 | static final String[] DFA52_transitionS = { |
7215 | "\2\2\1\uffff\3\2\6\uffff\1\2\1\uffff\1\2\4\uffff\1\2\24\uffff"+ |
7216 | "\5\2\1\uffff\1\2\4\uffff\1\2\13\uffff\1\1", |
7217 | "\2\4\6\uffff\1\2\3\uffff\1\2\1\uffff\1\3\5\uffff\1\2\31\uffff"+ |
7218 | "\1\2\4\uffff\1\2", |
7219 | "", |
7220 | "\4\2\20\uffff\1\5\7\uffff\1\2\5\uffff\1\2\16\uffff\1\2\2\uffff"+ |
7221 | "\1\2\20\uffff\12\2", |
7222 | "", |
7223 | "\1\2\7\uffff\1\10\3\uffff\1\7\1\uffff\1\6\5\uffff\1\2\36\uffff"+ |
7224 | "\1\2\20\uffff\1\2", |
7225 | "\4\2\20\uffff\1\2\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7226 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7227 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7228 | "\2\2\uffff\1\2\20\uffff\12\2", |
7229 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7230 | "\2\2\uffff\1\2\20\uffff\12\2", |
7231 | "\1\2\7\uffff\1\15\3\uffff\1\14\1\uffff\1\13\5\uffff\1\2\36"+ |
7232 | "\uffff\1\2\20\uffff\1\2", |
7233 | "\1\16\1\20\1\2\1\17\2\4\6\uffff\1\4\1\uffff\1\4\4\uffff\1\4"+ |
7234 | "\10\uffff\1\2\5\uffff\1\2\5\uffff\5\4\1\uffff\1\4\2\uffff\1"+ |
7235 | "\2\1\uffff\1\4\1\2\12\uffff\1\4\5\uffff\12\2", |
7236 | "\4\2\20\uffff\1\2\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7237 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7238 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7239 | "\2\2\uffff\1\2\20\uffff\12\2", |
7240 | "\4\2\21\uffff\1\11\1\12\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7241 | "\2\2\uffff\1\2\20\uffff\12\2", |
7242 | "\3\2\12\uffff\1\4\15\uffff\1\2\5\uffff\1\2\16\uffff\1\2\2\uffff"+ |
7243 | "\1\2\20\uffff\12\2", |
7244 | "\2\4\6\uffff\1\2\3\uffff\1\2\1\uffff\1\21\5\uffff\1\2\27\uffff"+ |
7245 | "\1\4\6\uffff\1\2", |
7246 | "\1\2\3\uffff\1\2\1\uffff\1\22\5\uffff\1\2\36\uffff\1\2", |
7247 | "\4\2\20\uffff\1\23\7\uffff\1\2\5\uffff\1\2\16\uffff\1\2\2\uffff"+ |
7248 | "\1\2\20\uffff\12\2", |
7249 | "\4\2\20\uffff\1\24\7\uffff\1\2\5\uffff\1\2\16\uffff\1\2\2\uffff"+ |
7250 | "\1\2\20\uffff\12\2", |
7251 | "\1\2\7\uffff\1\27\3\uffff\1\26\1\uffff\1\25\5\uffff\1\2\36"+ |
7252 | "\uffff\1\2\20\uffff\1\2", |
7253 | "\1\2\7\uffff\1\32\3\uffff\1\31\1\uffff\1\30\5\uffff\1\2\36"+ |
7254 | "\uffff\1\2\20\uffff\1\2", |
7255 | "\4\2\20\uffff\1\2\1\33\1\34\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7256 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7257 | "\4\2\21\uffff\1\33\1\34\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7258 | "\2\2\uffff\1\2\20\uffff\12\2", |
7259 | "\4\2\21\uffff\1\33\1\34\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7260 | "\2\2\uffff\1\2\20\uffff\12\2", |
7261 | "\4\2\20\uffff\1\2\1\35\1\36\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7262 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7263 | "\4\2\21\uffff\1\35\1\36\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7264 | "\2\2\uffff\1\2\20\uffff\12\2", |
7265 | "\4\2\21\uffff\1\35\1\36\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7266 | "\2\2\uffff\1\2\20\uffff\12\2", |
7267 | "\1\2\7\uffff\1\41\3\uffff\1\40\1\uffff\1\37\5\uffff\1\2\36"+ |
7268 | "\uffff\1\2\20\uffff\1\2", |
7269 | "\4\2\30\uffff\1\2\5\uffff\1\2\16\uffff\1\2\2\uffff\1\42\12"+ |
7270 | "\4\6\uffff\12\2", |
7271 | "\1\2\7\uffff\1\45\3\uffff\1\44\1\uffff\1\43\5\uffff\1\2\36"+ |
7272 | "\uffff\1\2\20\uffff\1\2", |
7273 | "\4\2\1\4\1\uffff\1\4\16\uffff\1\4\6\uffff\1\2\5\uffff\1\2\12"+ |
7274 | "\uffff\1\4\3\uffff\1\2\1\4\1\uffff\1\42\13\4\5\uffff\12\2", |
7275 | "\4\2\20\uffff\1\2\1\33\1\34\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7276 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7277 | "\4\2\21\uffff\1\33\1\34\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7278 | "\2\2\uffff\1\2\20\uffff\12\2", |
7279 | "\4\2\21\uffff\1\33\1\34\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7280 | "\2\2\uffff\1\2\20\uffff\12\2", |
7281 | "\2\4\6\uffff\1\2\3\uffff\1\2\1\uffff\1\46\5\uffff\1\2\36\uffff"+ |
7282 | "\1\2", |
7283 | "\4\2\20\uffff\1\2\1\35\1\36\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7284 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7285 | "\4\2\21\uffff\1\35\1\36\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7286 | "\2\2\uffff\1\2\20\uffff\12\2", |
7287 | "\4\2\21\uffff\1\35\1\36\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7288 | "\2\2\uffff\1\2\20\uffff\12\2", |
7289 | "\6\2\6\uffff\1\2\1\uffff\1\2\4\uffff\1\2\1\47\15\uffff\1\2"+ |
7290 | "\5\uffff\5\2\1\uffff\1\2\4\uffff\1\2\13\uffff\1\2\11\uffff\6"+ |
7291 | "\2", |
7292 | "\1\2\7\uffff\1\52\3\uffff\1\51\1\uffff\1\50\5\uffff\1\2\36"+ |
7293 | "\uffff\1\2\20\uffff\1\2", |
7294 | "\4\2\20\uffff\1\2\1\53\1\54\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7295 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7296 | "\4\2\21\uffff\1\53\1\54\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7297 | "\2\2\uffff\1\2\20\uffff\12\2", |
7298 | "\4\2\21\uffff\1\53\1\54\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7299 | "\2\2\uffff\1\2\20\uffff\12\2", |
7300 | "\1\2\7\uffff\1\57\3\uffff\1\56\1\uffff\1\55\5\uffff\1\2\36"+ |
7301 | "\uffff\1\2\20\uffff\1\2", |
7302 | "\4\2\1\60\1\2\6\uffff\1\2\1\uffff\1\2\4\uffff\1\2\1\uffff\1"+ |
7303 | "\4\14\uffff\1\2\5\uffff\5\2\1\uffff\1\2\4\uffff\1\2\13\uffff"+ |
7304 | "\1\2\11\uffff\6\2", |
7305 | "\4\2\20\uffff\1\2\1\53\1\54\5\uffff\1\2\5\uffff\1\2\16\uffff"+ |
7306 | "\1\2\2\uffff\1\2\20\uffff\12\2", |
7307 | "\4\2\21\uffff\1\53\1\54\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7308 | "\2\2\uffff\1\2\20\uffff\12\2", |
7309 | "\4\2\21\uffff\1\53\1\54\5\uffff\1\2\5\uffff\1\2\16\uffff\1"+ |
7310 | "\2\2\uffff\1\2\20\uffff\12\2", |
7311 | "\1\uffff" |
7312 | }; |
7313 | |
7314 | static final short[] DFA52_eot = DFA.unpackEncodedString(DFA52_eotS); |
7315 | static final short[] DFA52_eof = DFA.unpackEncodedString(DFA52_eofS); |
7316 | static final char[] DFA52_min = DFA.unpackEncodedStringToUnsignedChars(DFA52_minS); |
7317 | static final char[] DFA52_max = DFA.unpackEncodedStringToUnsignedChars(DFA52_maxS); |
7318 | static final short[] DFA52_accept = DFA.unpackEncodedString(DFA52_acceptS); |
7319 | static final short[] DFA52_special = DFA.unpackEncodedString(DFA52_specialS); |
7320 | static final short[][] DFA52_transition; |
7321 | |
7322 | static { |
7323 | int numStates = DFA52_transitionS.length; |
7324 | DFA52_transition = new short[numStates][]; |
7325 | for (int i=0; i<numStates; i++) { |
7326 | DFA52_transition[i] = DFA.unpackEncodedString(DFA52_transitionS[i]); |
7327 | } |
7328 | } |
7329 | |
7330 | class DFA52 extends DFA { |
7331 | |
7332 | public DFA52(BaseRecognizer recognizer) { |
7333 | this.recognizer = recognizer; |
7334 | this.decisionNumber = 52; |
7335 | this.eot = DFA52_eot; |
7336 | this.eof = DFA52_eof; |
7337 | this.min = DFA52_min; |
7338 | this.max = DFA52_max; |
7339 | this.accept = DFA52_accept; |
7340 | this.special = DFA52_special; |
7341 | this.transition = DFA52_transition; |
7342 | } |
7343 | public String getDescription() { |
7344 | return "()* loopback of 802:3: ( 'v' litp= literal )*"; |
7345 | } |
7346 | public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { |
7347 | TokenStream input = (TokenStream)_input; |
7348 | int _s = s; |
7349 | switch ( s ) { |
7350 | case 0 : |
7351 | int LA52_48 = input.LA(1); |
7352 | |
7353 | |
7354 | int index52_48 = input.index(); |
7355 | input.rewind(); |
7356 | s = -1; |
7357 | if ( (synpred71_FELIX()) ) {s = 4;} |
7358 | |
7359 | else if ( (true) ) {s = 2;} |
7360 | |
7361 | |
7362 | input.seek(index52_48); |
7363 | if ( s>=0 ) return s; |
7364 | break; |
7365 | } |
7366 | if (state.backtracking>0) {state.failed=true; return -1;} |
7367 | NoViableAltException nvae = |
7368 | new NoViableAltException(getDescription(), 52, _s, input); |
7369 | error(nvae); |
7370 | throw nvae; |
7371 | } |
7372 | } |
7373 | static final String DFA62_eotS = |
7374 | "\16\uffff"; |
7375 | static final String DFA62_eofS = |
7376 | "\1\1\3\uffff\1\3\11\uffff"; |
7377 | static final String DFA62_minS = |
7378 | "\1\6\1\uffff\1\16\1\uffff\6\6\1\0\3\6"; |
7379 | static final String DFA62_maxS = |
7380 | "\1\117\1\uffff\1\71\1\uffff\1\124\1\112\3\124\1\112\1\0\3\124"; |
7381 | static final String DFA62_acceptS = |
7382 | "\1\uffff\1\2\1\uffff\1\1\12\uffff"; |
7383 | static final String DFA62_specialS = |
7384 | "\12\uffff\1\0\3\uffff}>"; |
7385 | static final String[] DFA62_transitionS = { |
7386 | "\1\1\1\2\1\3\4\1\5\uffff\1\1\1\uffff\1\1\4\uffff\1\1\1\uffff"+ |
7387 | "\2\1\5\uffff\1\1\13\uffff\5\1\1\uffff\2\1\1\uffff\1\1\1\uffff"+ |
7388 | "\2\1\12\uffff\5\1\1\uffff\4\1\1\3", |
7389 | "", |
7390 | "\1\3\3\uffff\1\3\1\uffff\1\4\5\uffff\1\3\36\uffff\1\3", |
7391 | "", |
7392 | "\7\3\5\uffff\1\3\1\uffff\1\3\4\uffff\1\3\1\5\2\3\5\uffff\1"+ |
7393 | "\3\5\uffff\1\3\5\uffff\5\3\1\uffff\2\3\1\uffff\1\3\1\uffff\2"+ |
7394 | "\3\12\uffff\5\3\1\uffff\12\3", |
7395 | "\1\3\7\uffff\1\10\3\uffff\1\7\1\uffff\1\6\5\uffff\1\3\36\uffff"+ |
7396 | "\1\3\20\uffff\1\3", |
7397 | "\4\3\20\uffff\1\3\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff"+ |
7398 | "\1\3\2\uffff\1\3\20\uffff\12\3", |
7399 | "\4\3\21\uffff\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7400 | "\3\2\uffff\1\3\20\uffff\12\3", |
7401 | "\4\3\21\uffff\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7402 | "\3\2\uffff\1\3\20\uffff\12\3", |
7403 | "\1\3\7\uffff\1\15\3\uffff\1\14\1\uffff\1\13\5\uffff\1\3\36"+ |
7404 | "\uffff\1\3\20\uffff\1\3", |
7405 | "\1\uffff", |
7406 | "\4\3\20\uffff\1\3\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff"+ |
7407 | "\1\3\2\uffff\1\3\20\uffff\12\3", |
7408 | "\4\3\21\uffff\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7409 | "\3\2\uffff\1\3\20\uffff\12\3", |
7410 | "\4\3\21\uffff\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7411 | "\3\2\uffff\1\3\20\uffff\12\3" |
7412 | }; |
7413 | |
7414 | static final short[] DFA62_eot = DFA.unpackEncodedString(DFA62_eotS); |
7415 | static final short[] DFA62_eof = DFA.unpackEncodedString(DFA62_eofS); |
7416 | static final char[] DFA62_min = DFA.unpackEncodedStringToUnsignedChars(DFA62_minS); |
7417 | static final char[] DFA62_max = DFA.unpackEncodedStringToUnsignedChars(DFA62_maxS); |
7418 | static final short[] DFA62_accept = DFA.unpackEncodedString(DFA62_acceptS); |
7419 | static final short[] DFA62_special = DFA.unpackEncodedString(DFA62_specialS); |
7420 | static final short[][] DFA62_transition; |
7421 | |
7422 | static { |
7423 | int numStates = DFA62_transitionS.length; |
7424 | DFA62_transition = new short[numStates][]; |
7425 | for (int i=0; i<numStates; i++) { |
7426 | DFA62_transition[i] = DFA.unpackEncodedString(DFA62_transitionS[i]); |
7427 | } |
7428 | } |
7429 | |
7430 | class DFA62 extends DFA { |
7431 | |
7432 | public DFA62(BaseRecognizer recognizer) { |
7433 | this.recognizer = recognizer; |
7434 | this.decisionNumber = 62; |
7435 | this.eot = DFA62_eot; |
7436 | this.eof = DFA62_eof; |
7437 | this.min = DFA62_min; |
7438 | this.max = DFA62_max; |
7439 | this.accept = DFA62_accept; |
7440 | this.special = DFA62_special; |
7441 | this.transition = DFA62_transition; |
7442 | } |
7443 | public String getDescription() { |
7444 | return "()* loopback of 953:3: (op= ( '+' | '-' | '%' ) tp= mathTerm )*"; |
7445 | } |
7446 | public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { |
7447 | TokenStream input = (TokenStream)_input; |
7448 | int _s = s; |
7449 | switch ( s ) { |
7450 | case 0 : |
7451 | int LA62_10 = input.LA(1); |
7452 | |
7453 | |
7454 | int index62_10 = input.index(); |
7455 | input.rewind(); |
7456 | s = -1; |
7457 | if ( (synpred95_FELIX()) ) {s = 3;} |
7458 | |
7459 | else if ( (true) ) {s = 1;} |
7460 | |
7461 | |
7462 | input.seek(index62_10); |
7463 | if ( s>=0 ) return s; |
7464 | break; |
7465 | } |
7466 | if (state.backtracking>0) {state.failed=true; return -1;} |
7467 | NoViableAltException nvae = |
7468 | new NoViableAltException(getDescription(), 62, _s, input); |
7469 | error(nvae); |
7470 | throw nvae; |
7471 | } |
7472 | } |
7473 | static final String DFA63_eotS = |
7474 | "\31\uffff"; |
7475 | static final String DFA63_eofS = |
7476 | "\1\1\3\uffff\1\3\5\uffff\1\3\4\uffff\1\3\11\uffff"; |
7477 | static final String DFA63_minS = |
7478 | "\1\6\1\uffff\1\6\1\uffff\21\6\1\0\3\6"; |
7479 | static final String DFA63_maxS = |
7480 | "\1\124\1\uffff\1\71\1\uffff\1\124\1\112\3\124\1\112\4\124\1\71\1"+ |
7481 | "\124\1\112\3\124\1\112\1\0\3\124"; |
7482 | static final String DFA63_acceptS = |
7483 | "\1\uffff\1\2\1\uffff\1\1\25\uffff"; |
7484 | static final String DFA63_specialS = |
7485 | "\25\uffff\1\0\3\uffff}>"; |
7486 | static final String[] DFA63_transitionS = { |
7487 | "\3\1\1\2\3\1\5\uffff\1\1\1\uffff\1\1\4\uffff\1\1\1\uffff\2\1"+ |
7488 | "\5\uffff\1\1\5\uffff\1\3\5\uffff\5\1\1\uffff\2\1\1\uffff\1\1"+ |
7489 | "\1\uffff\2\1\12\uffff\5\1\1\uffff\5\1\5\3", |
7490 | "", |
7491 | "\2\1\6\uffff\1\3\3\uffff\1\3\1\uffff\1\4\5\uffff\1\3\27\uffff"+ |
7492 | "\1\1\6\uffff\1\3", |
7493 | "", |
7494 | "\7\3\5\uffff\1\3\1\uffff\1\3\4\uffff\1\3\1\5\2\3\5\uffff\1"+ |
7495 | "\3\5\uffff\1\3\5\uffff\5\3\1\uffff\2\3\1\uffff\1\3\1\uffff\2"+ |
7496 | "\3\12\uffff\5\3\1\uffff\12\3", |
7497 | "\1\3\7\uffff\1\10\3\uffff\1\7\1\uffff\1\6\5\uffff\1\3\36\uffff"+ |
7498 | "\1\3\20\uffff\1\3", |
7499 | "\4\3\20\uffff\1\3\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff"+ |
7500 | "\1\3\2\uffff\1\3\20\uffff\12\3", |
7501 | "\4\3\21\uffff\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7502 | "\3\2\uffff\1\3\20\uffff\12\3", |
7503 | "\4\3\21\uffff\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7504 | "\3\2\uffff\1\3\20\uffff\12\3", |
7505 | "\1\3\7\uffff\1\15\3\uffff\1\14\1\uffff\1\13\5\uffff\1\3\36"+ |
7506 | "\uffff\1\3\20\uffff\1\3", |
7507 | "\7\3\5\uffff\1\3\1\uffff\1\3\4\uffff\1\3\1\uffff\2\3\5\uffff"+ |
7508 | "\1\3\5\uffff\1\3\5\uffff\5\3\1\uffff\2\3\1\uffff\1\3\1\uffff"+ |
7509 | "\1\3\1\16\12\1\5\3\1\uffff\12\3", |
7510 | "\4\3\20\uffff\1\3\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff"+ |
7511 | "\1\3\2\uffff\1\3\20\uffff\12\3", |
7512 | "\4\3\21\uffff\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7513 | "\3\2\uffff\1\3\20\uffff\12\3", |
7514 | "\4\3\21\uffff\1\11\1\12\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7515 | "\3\2\uffff\1\3\20\uffff\12\3", |
7516 | "\2\1\6\uffff\1\3\3\uffff\1\3\1\uffff\1\17\5\uffff\1\3\36\uffff"+ |
7517 | "\1\3", |
7518 | "\7\3\5\uffff\1\3\1\uffff\1\3\4\uffff\1\3\1\20\2\3\13\uffff"+ |
7519 | "\1\3\5\uffff\5\3\1\uffff\2\3\3\uffff\1\3\13\uffff\5\3\5\uffff"+ |
7520 | "\6\3", |
7521 | "\1\3\7\uffff\1\23\3\uffff\1\22\1\uffff\1\21\5\uffff\1\3\36"+ |
7522 | "\uffff\1\3\20\uffff\1\3", |
7523 | "\4\3\20\uffff\1\3\1\24\1\25\5\uffff\1\3\5\uffff\1\3\16\uffff"+ |
7524 | "\1\3\2\uffff\1\3\20\uffff\12\3", |
7525 | "\4\3\21\uffff\1\24\1\25\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7526 | "\3\2\uffff\1\3\20\uffff\12\3", |
7527 | "\4\3\21\uffff\1\24\1\25\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7528 | "\3\2\uffff\1\3\20\uffff\12\3", |
7529 | "\1\3\7\uffff\1\30\3\uffff\1\27\1\uffff\1\26\5\uffff\1\3\36"+ |
7530 | "\uffff\1\3\20\uffff\1\3", |
7531 | "\1\uffff", |
7532 | "\4\3\20\uffff\1\3\1\24\1\25\5\uffff\1\3\5\uffff\1\3\16\uffff"+ |
7533 | "\1\3\2\uffff\1\3\20\uffff\12\3", |
7534 | "\4\3\21\uffff\1\24\1\25\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7535 | "\3\2\uffff\1\3\20\uffff\12\3", |
7536 | "\4\3\21\uffff\1\24\1\25\5\uffff\1\3\5\uffff\1\3\16\uffff\1"+ |
7537 | "\3\2\uffff\1\3\20\uffff\12\3" |
7538 | }; |
7539 | |
7540 | static final short[] DFA63_eot = DFA.unpackEncodedString(DFA63_eotS); |
7541 | static final short[] DFA63_eof = DFA.unpackEncodedString(DFA63_eofS); |
7542 | static final char[] DFA63_min = DFA.unpackEncodedStringToUnsignedChars(DFA63_minS); |
7543 | static final char[] DFA63_max = DFA.unpackEncodedStringToUnsignedChars(DFA63_maxS); |
7544 | static final short[] DFA63_accept = DFA.unpackEncodedString(DFA63_acceptS); |
7545 | static final short[] DFA63_special = DFA.unpackEncodedString(DFA63_specialS); |
7546 | static final short[][] DFA63_transition; |
7547 | |
7548 | static { |
7549 | int numStates = DFA63_transitionS.length; |
7550 | DFA63_transition = new short[numStates][]; |
7551 | for (int i=0; i<numStates; i++) { |
7552 | DFA63_transition[i] = DFA.unpackEncodedString(DFA63_transitionS[i]); |
7553 | } |
7554 | } |
7555 | |
7556 | class DFA63 extends DFA { |
7557 | |
7558 | public DFA63(BaseRecognizer recognizer) { |
7559 | this.recognizer = recognizer; |
7560 | this.decisionNumber = 63; |
7561 | this.eot = DFA63_eot; |
7562 | this.eof = DFA63_eof; |
7563 | this.min = DFA63_min; |
7564 | this.max = DFA63_max; |
7565 | this.accept = DFA63_accept; |
7566 | this.special = DFA63_special; |
7567 | this.transition = DFA63_transition; |
7568 | } |
7569 | public String getDescription() { |
7570 | return "()* loopback of 983:3: (op= ( '*' | '/' | '&' | '|' | '^' | '<<' | '>>' ) tp= mathFactor )*"; |
7571 | } |
7572 | public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { |
7573 | TokenStream input = (TokenStream)_input; |
7574 | int _s = s; |
7575 | switch ( s ) { |
7576 | case 0 : |
7577 | int LA63_21 = input.LA(1); |
7578 | |
7579 | |
7580 | int index63_21 = input.index(); |
7581 | input.rewind(); |
7582 | s = -1; |
7583 | if ( (synpred102_FELIX()) ) {s = 3;} |
7584 | |
7585 | else if ( (true) ) {s = 1;} |
7586 | |
7587 | |
7588 | input.seek(index63_21); |
7589 | if ( s>=0 ) return s; |
7590 | break; |
7591 | } |
7592 | if (state.backtracking>0) {state.failed=true; return -1;} |
7593 | NoViableAltException nvae = |
7594 | new NoViableAltException(getDescription(), 63, _s, input); |
7595 | error(nvae); |
7596 | throw nvae; |
7597 | } |
7598 | } |
7599 | static final String DFA67_eotS = |
7600 | "\12\uffff"; |
7601 | static final String DFA67_eofS = |
7602 | "\12\uffff"; |
7603 | static final String DFA67_minS = |
7604 | "\1\6\1\uffff\5\0\3\uffff"; |
7605 | static final String DFA67_maxS = |
7606 | "\1\112\1\uffff\5\0\3\uffff"; |
7607 | static final String DFA67_acceptS = |
7608 | "\1\uffff\1\1\5\uffff\1\2\1\3\1\4"; |
7609 | static final String DFA67_specialS = |
7610 | "\2\uffff\1\0\1\1\1\2\1\3\1\4\3\uffff}>"; |
7611 | static final String[] DFA67_transitionS = { |
7612 | "\1\1\7\uffff\1\4\3\uffff\1\3\1\uffff\1\2\5\uffff\1\5\36\uffff"+ |
7613 | "\1\6\20\uffff\1\1", |
7614 | "", |
7615 | "\1\uffff", |
7616 | "\1\uffff", |
7617 | "\1\uffff", |
7618 | "\1\uffff", |
7619 | "\1\uffff", |
7620 | "", |
7621 | "", |
7622 | "" |
7623 | }; |
7624 | |
7625 | static final short[] DFA67_eot = DFA.unpackEncodedString(DFA67_eotS); |
7626 | static final short[] DFA67_eof = DFA.unpackEncodedString(DFA67_eofS); |
7627 | static final char[] DFA67_min = DFA.unpackEncodedStringToUnsignedChars(DFA67_minS); |
7628 | static final char[] DFA67_max = DFA.unpackEncodedStringToUnsignedChars(DFA67_maxS); |
7629 | static final short[] DFA67_accept = DFA.unpackEncodedString(DFA67_acceptS); |
7630 | static final short[] DFA67_special = DFA.unpackEncodedString(DFA67_specialS); |
7631 | static final short[][] DFA67_transition; |
7632 | |
7633 | static { |
7634 | int numStates = DFA67_transitionS.length; |
7635 | DFA67_transition = new short[numStates][]; |
7636 | for (int i=0; i<numStates; i++) { |
7637 | DFA67_transition[i] = DFA.unpackEncodedString(DFA67_transitionS[i]); |
7638 | } |
7639 | } |
7640 | |
7641 | class DFA67 extends DFA { |
7642 | |
7643 | public DFA67(BaseRecognizer recognizer) { |
7644 | this.recognizer = recognizer; |
7645 | this.decisionNumber = 67; |
7646 | this.eot = DFA67_eot; |
7647 | this.eof = DFA67_eof; |
7648 | this.min = DFA67_min; |
7649 | this.max = DFA67_max; |
7650 | this.accept = DFA67_accept; |
7651 | this.special = DFA67_special; |
7652 | this.transition = DFA67_transition; |
7653 | } |
7654 | public String getDescription() { |
7655 | return "1072:1: funcArgument returns [Expression expr] : (be= boolExpression | me= mathExpression | fe= funcExpression | ae= atomicExpression );"; |
7656 | } |
7657 | public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { |
7658 | TokenStream input = (TokenStream)_input; |
7659 | int _s = s; |
7660 | switch ( s ) { |
7661 | case 0 : |
7662 | int LA67_2 = input.LA(1); |
7663 | |
7664 | |
7665 | int index67_2 = input.index(); |
7666 | input.rewind(); |
7667 | s = -1; |
7668 | if ( (synpred108_FELIX()) ) {s = 1;} |
7669 | |
7670 | else if ( (synpred109_FELIX()) ) {s = 7;} |
7671 | |
7672 | else if ( (synpred110_FELIX()) ) {s = 8;} |
7673 | |
7674 | else if ( (true) ) {s = 9;} |
7675 | |
7676 | |
7677 | input.seek(index67_2); |
7678 | if ( s>=0 ) return s; |
7679 | break; |
7680 | case 1 : |
7681 | int LA67_3 = input.LA(1); |
7682 | |
7683 | |
7684 | int index67_3 = input.index(); |
7685 | input.rewind(); |
7686 | s = -1; |
7687 | if ( (synpred108_FELIX()) ) {s = 1;} |
7688 | |
7689 | else if ( (synpred109_FELIX()) ) {s = 7;} |
7690 | |
7691 | else if ( (true) ) {s = 9;} |
7692 | |
7693 | |
7694 | input.seek(index67_3); |
7695 | if ( s>=0 ) return s; |
7696 | break; |
7697 | case 2 : |
7698 | int LA67_4 = input.LA(1); |
7699 | |
7700 | |
7701 | int index67_4 = input.index(); |
7702 | input.rewind(); |
7703 | s = -1; |
7704 | if ( (synpred108_FELIX()) ) {s = 1;} |
7705 | |
7706 | else if ( (synpred109_FELIX()) ) {s = 7;} |
7707 | |
7708 | else if ( (true) ) {s = 9;} |
7709 | |
7710 | |
7711 | input.seek(index67_4); |
7712 | if ( s>=0 ) return s; |
7713 | break; |
7714 | case 3 : |
7715 | int LA67_5 = input.LA(1); |
7716 | |
7717 | |
7718 | int index67_5 = input.index(); |
7719 | input.rewind(); |
7720 | s = -1; |
7721 | if ( (synpred108_FELIX()) ) {s = 1;} |
7722 | |
7723 | else if ( (synpred109_FELIX()) ) {s = 7;} |
7724 | |
7725 | |
7726 | input.seek(index67_5); |
7727 | if ( s>=0 ) return s; |
7728 | break; |
7729 | case 4 : |
7730 | int LA67_6 = input.LA(1); |
7731 | |
7732 | |
7733 | int index67_6 = input.index(); |
7734 | input.rewind(); |
7735 | s = -1; |
7736 | if ( (synpred108_FELIX()) ) {s = 1;} |
7737 | |
7738 | else if ( (synpred109_FELIX()) ) {s = 7;} |
7739 | |
7740 | |
7741 | input.seek(index67_6); |
7742 | if ( s>=0 ) return s; |
7743 | break; |
7744 | } |
7745 | if (state.backtracking>0) {state.failed=true; return -1;} |
7746 | NoViableAltException nvae = |
7747 | new NoViableAltException(getDescription(), 67, _s, input); |
7748 | error(nvae); |
7749 | throw nvae; |
7750 | } |
7751 | } |
7752 | |
7753 | |
7754 | public static final BitSet FOLLOW_schemaList_in_definitions1617 = new BitSet(new long[]{0x0217C00002140AC0L}); |
7755 | public static final BitSet FOLLOW_ruleList_in_definitions1619 = new BitSet(new long[]{0x0000000000000000L}); |
7756 | public static final BitSet FOLLOW_EOF_in_definitions1621 = new BitSet(new long[]{0x0000000000000002L}); |
7757 | public static final BitSet FOLLOW_schema_in_schemaList1642 = new BitSet(new long[]{0x0000060003100282L}); |
7758 | public static final BitSet FOLLOW_schemaConstraint_in_schemaList1650 = new BitSet(new long[]{0x0000060003100282L}); |
7759 | public static final BitSet FOLLOW_PLUS_in_schema1673 = new BitSet(new long[]{0x0000000003100200L}); |
7760 | public static final BitSet FOLLOW_24_in_schema1687 = new BitSet(new long[]{0x0000000002100000L}); |
7761 | public static final BitSet FOLLOW_ASTERISK_in_schema1697 = new BitSet(new long[]{0x0000000002100000L}); |
7762 | public static final BitSet FOLLOW_25_in_schema1709 = new BitSet(new long[]{0x0000000000100000L}); |
7763 | public static final BitSet FOLLOW_ID_in_schema1715 = new BitSet(new long[]{0x0000000004000200L}); |
7764 | public static final BitSet FOLLOW_ASTERISK_in_schema1719 = new BitSet(new long[]{0x0000000004000000L}); |
7765 | public static final BitSet FOLLOW_26_in_schema1761 = new BitSet(new long[]{0x0000000000100000L}); |
7766 | public static final BitSet FOLLOW_predArg_in_schema1765 = new BitSet(new long[]{0x0000000018000000L}); |
7767 | public static final BitSet FOLLOW_27_in_schema1768 = new BitSet(new long[]{0x0000000000100000L}); |
7768 | public static final BitSet FOLLOW_predArg_in_schema1772 = new BitSet(new long[]{0x0000000018000000L}); |
7769 | public static final BitSet FOLLOW_28_in_schema1776 = new BitSet(new long[]{0x0000008020600002L}); |
7770 | public static final BitSet FOLLOW_HDFSDEP_in_schema1789 = new BitSet(new long[]{0x0000000020200000L}); |
7771 | public static final BitSet FOLLOW_JDBCDEP_in_schema1796 = new BitSet(new long[]{0x0000000020000000L}); |
7772 | public static final BitSet FOLLOW_29_in_schema1800 = new BitSet(new long[]{0x0000007140000000L}); |
7773 | public static final BitSet FOLLOW_30_in_schema1803 = new BitSet(new long[]{0x0000000020000000L}); |
7774 | public static final BitSet FOLLOW_29_in_schema1805 = new BitSet(new long[]{0x0000000000800000L}); |
7775 | public static final BitSet FOLLOW_CODE_in_schema1810 = new BitSet(new long[]{0x0000000080800000L}); |
7776 | public static final BitSet FOLLOW_31_in_schema1814 = new BitSet(new long[]{0x0000007100000000L}); |
7777 | public static final BitSet FOLLOW_32_in_schema1830 = new BitSet(new long[]{0x0000000A20000000L}); |
7778 | public static final BitSet FOLLOW_33_in_schema1833 = new BitSet(new long[]{0x0000000000100000L}); |
7779 | public static final BitSet FOLLOW_ID_in_schema1837 = new BitSet(new long[]{0x0000000400000000L}); |
7780 | public static final BitSet FOLLOW_34_in_schema1839 = new BitSet(new long[]{0x0000000820000000L}); |
7781 | public static final BitSet FOLLOW_35_in_schema1844 = new BitSet(new long[]{0x0000000000100000L}); |
7782 | public static final BitSet FOLLOW_ID_in_schema1848 = new BitSet(new long[]{0x0000000020000000L}); |
7783 | public static final BitSet FOLLOW_29_in_schema1852 = new BitSet(new long[]{0x0000000000800000L}); |
7784 | public static final BitSet FOLLOW_CODE_in_schema1857 = new BitSet(new long[]{0x0000000080800000L}); |
7785 | public static final BitSet FOLLOW_31_in_schema1861 = new BitSet(new long[]{0x0000007000000000L}); |
7786 | public static final BitSet FOLLOW_36_in_schema1875 = new BitSet(new long[]{0x0000000020000000L}); |
7787 | public static final BitSet FOLLOW_29_in_schema1877 = new BitSet(new long[]{0x0000000000800000L}); |
7788 | public static final BitSet FOLLOW_CODE_in_schema1882 = new BitSet(new long[]{0x0000000080800000L}); |
7789 | public static final BitSet FOLLOW_31_in_schema1886 = new BitSet(new long[]{0x0000006000000000L}); |
7790 | public static final BitSet FOLLOW_37_in_schema1902 = new BitSet(new long[]{0x0000000820000000L}); |
7791 | public static final BitSet FOLLOW_35_in_schema1905 = new BitSet(new long[]{0x0000000004000000L}); |
7792 | public static final BitSet FOLLOW_26_in_schema1907 = new BitSet(new long[]{0x0000000000100000L}); |
7793 | public static final BitSet FOLLOW_ID_in_schema1911 = new BitSet(new long[]{0x0000000008000000L}); |
7794 | public static final BitSet FOLLOW_27_in_schema1913 = new BitSet(new long[]{0x0000000000100000L}); |
7795 | public static final BitSet FOLLOW_ID_in_schema1917 = new BitSet(new long[]{0x0000000010000000L}); |
7796 | public static final BitSet FOLLOW_28_in_schema1919 = new BitSet(new long[]{0x0000000020000000L}); |
7797 | public static final BitSet FOLLOW_29_in_schema1923 = new BitSet(new long[]{0x0000000000800000L}); |
7798 | public static final BitSet FOLLOW_CODE_in_schema1928 = new BitSet(new long[]{0x0000000080800000L}); |
7799 | public static final BitSet FOLLOW_31_in_schema1932 = new BitSet(new long[]{0x0000004000000000L}); |
7800 | public static final BitSet FOLLOW_38_in_schema1945 = new BitSet(new long[]{0x0000008000000002L}); |
7801 | public static final BitSet FOLLOW_39_in_schema1960 = new BitSet(new long[]{0x0000000000100000L}); |
7802 | public static final BitSet FOLLOW_ID_in_schema1964 = new BitSet(new long[]{0x0000010000000000L}); |
7803 | public static final BitSet FOLLOW_40_in_schema1966 = new BitSet(new long[]{0x0000000000100000L}); |
7804 | public static final BitSet FOLLOW_ID_in_schema1970 = new BitSet(new long[]{0x0000000000000002L}); |
7805 | public static final BitSet FOLLOW_ID_in_predArg2000 = new BitSet(new long[]{0x0000000000100042L}); |
7806 | public static final BitSet FOLLOW_ID_in_predArg2005 = new BitSet(new long[]{0x0000000000000042L}); |
7807 | public static final BitSet FOLLOW_NOT_in_predArg2011 = new BitSet(new long[]{0x0000000000000002L}); |
7808 | public static final BitSet FOLLOW_functionalDependency_in_schemaConstraint2060 = new BitSet(new long[]{0x0000000000000002L}); |
7809 | public static final BitSet FOLLOW_set_in_functionalDependency2075 = new BitSet(new long[]{0x0000080000000000L}); |
7810 | public static final BitSet FOLLOW_43_in_functionalDependency2097 = new BitSet(new long[]{0x0000000000100000L}); |
7811 | public static final BitSet FOLLOW_functionalDependencyItem_in_functionalDependency2099 = new BitSet(new long[]{0x0000100000000002L}); |
7812 | public static final BitSet FOLLOW_44_in_functionalDependency2102 = new BitSet(new long[]{0x0000000000100000L}); |
7813 | public static final BitSet FOLLOW_functionalDependencyItem_in_functionalDependency2104 = new BitSet(new long[]{0x0000100000000002L}); |
7814 | public static final BitSet FOLLOW_ID_in_functionalDependencyItem2189 = new BitSet(new long[]{0x0000200008000000L}); |
7815 | public static final BitSet FOLLOW_27_in_functionalDependencyItem2192 = new BitSet(new long[]{0x0000000000100000L}); |
7816 | public static final BitSet FOLLOW_ID_in_functionalDependencyItem2196 = new BitSet(new long[]{0x0000200008000000L}); |
7817 | public static final BitSet FOLLOW_45_in_functionalDependencyItem2200 = new BitSet(new long[]{0x0000000000100000L}); |
7818 | public static final BitSet FOLLOW_ID_in_functionalDependencyItem2204 = new BitSet(new long[]{0x0000000000000002L}); |
7819 | public static final BitSet FOLLOW_mlnRule_in_ruleList2262 = new BitSet(new long[]{0x0217C00002140AC2L}); |
7820 | public static final BitSet FOLLOW_scopingRule_in_ruleList2270 = new BitSet(new long[]{0x0217C00002140AC2L}); |
7821 | public static final BitSet FOLLOW_datalogRule_in_ruleList2278 = new BitSet(new long[]{0x0217C00002140AC2L}); |
7822 | public static final BitSet FOLLOW_clusteringRule_in_ruleList2286 = new BitSet(new long[]{0x0217C00002140AC2L}); |
7823 | public static final BitSet FOLLOW_set_in_mlnRule2319 = new BitSet(new long[]{0x0000000000004000L}); |
7824 | public static final BitSet FOLLOW_STRING_in_mlnRule2359 = new BitSet(new long[]{0x0001C000001408C0L}); |
7825 | public static final BitSet FOLLOW_softRule_in_mlnRule2388 = new BitSet(new long[]{0x0000000000000002L}); |
7826 | public static final BitSet FOLLOW_hardRule_in_mlnRule2396 = new BitSet(new long[]{0x0000000000000002L}); |
7827 | public static final BitSet FOLLOW_NUMBER_in_softRule2421 = new BitSet(new long[]{0x0001C000001408C0L}); |
7828 | public static final BitSet FOLLOW_foclause_in_softRule2425 = new BitSet(new long[]{0x0000000000000002L}); |
7829 | public static final BitSet FOLLOW_ID_in_softRule2464 = new BitSet(new long[]{0x0000080000000000L}); |
7830 | public static final BitSet FOLLOW_43_in_softRule2466 = new BitSet(new long[]{0x0001C000001408C0L}); |
7831 | public static final BitSet FOLLOW_foclause_in_softRule2470 = new BitSet(new long[]{0x0000000000000002L}); |
7832 | public static final BitSet FOLLOW_foclause_in_hardRule2522 = new BitSet(new long[]{0x0000000000000400L}); |
7833 | public static final BitSet FOLLOW_PERIOD_in_hardRule2524 = new BitSet(new long[]{0x0000000000000002L}); |
7834 | public static final BitSet FOLLOW_ID_in_functionalAtom2569 = new BitSet(new long[]{0x0000000004000000L}); |
7835 | public static final BitSet FOLLOW_26_in_functionalAtom2586 = new BitSet(new long[]{0x0200000004144000L}); |
7836 | public static final BitSet FOLLOW_expression_in_functionalAtom2590 = new BitSet(new long[]{0x0000000018000000L}); |
7837 | public static final BitSet FOLLOW_27_in_functionalAtom2618 = new BitSet(new long[]{0x0200000004144000L}); |
7838 | public static final BitSet FOLLOW_expression_in_functionalAtom2622 = new BitSet(new long[]{0x0000000018000000L}); |
7839 | public static final BitSet FOLLOW_28_in_functionalAtom2650 = new BitSet(new long[]{0x0000000000000002L}); |
7840 | public static final BitSet FOLLOW_set_in_datalogRule2682 = new BitSet(new long[]{0x00040000001000C0L}); |
7841 | public static final BitSet FOLLOW_50_in_datalogRule2718 = new BitSet(new long[]{0x00000000001000C0L}); |
7842 | public static final BitSet FOLLOW_literal_in_datalogRule2724 = new BitSet(new long[]{0x0008000000000000L}); |
7843 | public static final BitSet FOLLOW_51_in_datalogRule2756 = new BitSet(new long[]{0x00000000001000C0L}); |
7844 | public static final BitSet FOLLOW_literal_in_datalogRule2760 = new BitSet(new long[]{0x0000000008000400L}); |
7845 | public static final BitSet FOLLOW_27_in_datalogRule2789 = new BitSet(new long[]{0x00000000001000C0L}); |
7846 | public static final BitSet FOLLOW_literal_in_datalogRule2793 = new BitSet(new long[]{0x0000000008000400L}); |
7847 | public static final BitSet FOLLOW_27_in_datalogRule2822 = new BitSet(new long[]{0x0200000004144000L}); |
7848 | public static final BitSet FOLLOW_mathComparison_in_datalogRule2826 = new BitSet(new long[]{0x0000000008000400L}); |
7849 | public static final BitSet FOLLOW_27_in_datalogRule2882 = new BitSet(new long[]{0x0010000000000000L}); |
7850 | public static final BitSet FOLLOW_52_in_datalogRule2884 = new BitSet(new long[]{0x0200000004144040L,0x0000000000000400L}); |
7851 | public static final BitSet FOLLOW_boolExpression_in_datalogRule2888 = new BitSet(new long[]{0x0020000000000000L}); |
7852 | public static final BitSet FOLLOW_53_in_datalogRule2976 = new BitSet(new long[]{0x0000000000000400L}); |
7853 | public static final BitSet FOLLOW_PERIOD_in_datalogRule2980 = new BitSet(new long[]{0x0000000000000002L}); |
7854 | public static final BitSet FOLLOW_52_in_scopingRule3020 = new BitSet(new long[]{0x0040000000000000L}); |
7855 | public static final BitSet FOLLOW_54_in_scopingRule3022 = new BitSet(new long[]{0x0080000000000000L}); |
7856 | public static final BitSet FOLLOW_55_in_scopingRule3024 = new BitSet(new long[]{0x0000000000040000L}); |
7857 | public static final BitSet FOLLOW_NUMBER_in_scopingRule3028 = new BitSet(new long[]{0x0020000000000000L}); |
7858 | public static final BitSet FOLLOW_53_in_scopingRule3030 = new BitSet(new long[]{0x00000000001000C0L}); |
7859 | public static final BitSet FOLLOW_literal_in_scopingRule3036 = new BitSet(new long[]{0x0100000000000000L}); |
7860 | public static final BitSet FOLLOW_56_in_scopingRule3098 = new BitSet(new long[]{0x00000000001000C0L}); |
7861 | public static final BitSet FOLLOW_literal_in_scopingRule3102 = new BitSet(new long[]{0x0000000008000400L}); |
7862 | public static final BitSet FOLLOW_27_in_scopingRule3131 = new BitSet(new long[]{0x00000000001000C0L}); |
7863 | public static final BitSet FOLLOW_literal_in_scopingRule3135 = new BitSet(new long[]{0x0000000008000400L}); |
7864 | public static final BitSet FOLLOW_27_in_scopingRule3164 = new BitSet(new long[]{0x0200000004144000L}); |
7865 | public static final BitSet FOLLOW_mathComparison_in_scopingRule3168 = new BitSet(new long[]{0x0000000008000400L}); |
7866 | public static final BitSet FOLLOW_27_in_scopingRule3224 = new BitSet(new long[]{0x0010000000000000L}); |
7867 | public static final BitSet FOLLOW_52_in_scopingRule3226 = new BitSet(new long[]{0x0200000004144040L,0x0000000000000400L}); |
7868 | public static final BitSet FOLLOW_boolExpression_in_scopingRule3230 = new BitSet(new long[]{0x0020000000000000L}); |
7869 | public static final BitSet FOLLOW_53_in_scopingRule3318 = new BitSet(new long[]{0x0000000000000400L}); |
7870 | public static final BitSet FOLLOW_PERIOD_in_scopingRule3322 = new BitSet(new long[]{0x0000000000000002L}); |
7871 | public static final BitSet FOLLOW_NUMBER_in_clusteringRule3363 = new BitSet(new long[]{0x02040000001002C0L}); |
7872 | public static final BitSet FOLLOW_57_in_clusteringRule3369 = new BitSet(new long[]{0x00040000001002C0L}); |
7873 | public static final BitSet FOLLOW_ASTERISK_in_clusteringRule3376 = new BitSet(new long[]{0x00040000001000C0L}); |
7874 | public static final BitSet FOLLOW_50_in_clusteringRule3383 = new BitSet(new long[]{0x00000000001000C0L}); |
7875 | public static final BitSet FOLLOW_literal_in_clusteringRule3389 = new BitSet(new long[]{0xFC00000000000000L,0x000000000000001FL}); |
7876 | public static final BitSet FOLLOW_set_in_clusteringRule3461 = new BitSet(new long[]{0x00000000001000C0L}); |
7877 | public static final BitSet FOLLOW_literal_in_clusteringRule3557 = new BitSet(new long[]{0x0000000008000400L}); |
7878 | public static final BitSet FOLLOW_27_in_clusteringRule3581 = new BitSet(new long[]{0x00000000001000C0L}); |
7879 | public static final BitSet FOLLOW_literal_in_clusteringRule3585 = new BitSet(new long[]{0x0000000008000400L}); |
7880 | public static final BitSet FOLLOW_27_in_clusteringRule3614 = new BitSet(new long[]{0x0200000004144000L}); |
7881 | public static final BitSet FOLLOW_mathComparison_in_clusteringRule3618 = new BitSet(new long[]{0x0000000008000400L}); |
7882 | public static final BitSet FOLLOW_27_in_clusteringRule3674 = new BitSet(new long[]{0x0010000000000000L}); |
7883 | public static final BitSet FOLLOW_52_in_clusteringRule3676 = new BitSet(new long[]{0x0200000004144040L,0x0000000000000400L}); |
7884 | public static final BitSet FOLLOW_boolExpression_in_clusteringRule3680 = new BitSet(new long[]{0x0020000000000000L}); |
7885 | public static final BitSet FOLLOW_53_in_clusteringRule3768 = new BitSet(new long[]{0x0000000000000400L}); |
7886 | public static final BitSet FOLLOW_PERIOD_in_clusteringRule3772 = new BitSet(new long[]{0x0000000000000002L}); |
7887 | public static final BitSet FOLLOW_existQuan_in_foclause3813 = new BitSet(new long[]{0x00000000001000C0L}); |
7888 | public static final BitSet FOLLOW_literal_in_foclause3826 = new BitSet(new long[]{0x0000000008001000L}); |
7889 | public static final BitSet FOLLOW_27_in_foclause3853 = new BitSet(new long[]{0x00000000001000C0L}); |
7890 | public static final BitSet FOLLOW_literal_in_foclause3857 = new BitSet(new long[]{0x0000000008001000L}); |
7891 | public static final BitSet FOLLOW_27_in_foclause3887 = new BitSet(new long[]{0x0200000004144000L}); |
7892 | public static final BitSet FOLLOW_mathComparison_in_foclause3891 = new BitSet(new long[]{0x0000000008001000L}); |
7893 | public static final BitSet FOLLOW_27_in_foclause3948 = new BitSet(new long[]{0x0010000000000000L}); |
7894 | public static final BitSet FOLLOW_52_in_foclause3950 = new BitSet(new long[]{0x0200000004144040L,0x0000000000000400L}); |
7895 | public static final BitSet FOLLOW_boolExpression_in_foclause3954 = new BitSet(new long[]{0x0020000000000000L}); |
7896 | public static final BitSet FOLLOW_53_in_foclause4045 = new BitSet(new long[]{0x0000000000001000L}); |
7897 | public static final BitSet FOLLOW_IMPLIES_in_foclause4049 = new BitSet(new long[]{0x00000000001000C0L}); |
7898 | public static final BitSet FOLLOW_literal_in_foclause4060 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000020L}); |
7899 | public static final BitSet FOLLOW_69_in_foclause4083 = new BitSet(new long[]{0x00000000001000C0L}); |
7900 | public static final BitSet FOLLOW_literal_in_foclause4087 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000020L}); |
7901 | public static final BitSet FOLLOW_69_in_foclause4115 = new BitSet(new long[]{0x0200000004144000L}); |
7902 | public static final BitSet FOLLOW_mathComparison_in_foclause4119 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000020L}); |
7903 | public static final BitSet FOLLOW_69_in_foclause4174 = new BitSet(new long[]{0x0010000000000000L}); |
7904 | public static final BitSet FOLLOW_52_in_foclause4176 = new BitSet(new long[]{0x0200000004144040L,0x0000000000000400L}); |
7905 | public static final BitSet FOLLOW_boolExpression_in_foclause4180 = new BitSet(new long[]{0x0020000000000000L}); |
7906 | public static final BitSet FOLLOW_53_in_foclause4268 = new BitSet(new long[]{0x0000000000000002L}); |
7907 | public static final BitSet FOLLOW_EXIST_in_existQuan4302 = new BitSet(new long[]{0x0000000000100000L}); |
7908 | public static final BitSet FOLLOW_ID_in_existQuan4306 = new BitSet(new long[]{0x0000000008000002L}); |
7909 | public static final BitSet FOLLOW_27_in_existQuan4328 = new BitSet(new long[]{0x0000000000100000L}); |
7910 | public static final BitSet FOLLOW_ID_in_existQuan4332 = new BitSet(new long[]{0x0000000008000002L}); |
7911 | public static final BitSet FOLLOW_mathExpression_in_expression4371 = new BitSet(new long[]{0x0000000000000002L}); |
7912 | public static final BitSet FOLLOW_boolConjunction_in_boolExpression4392 = new BitSet(new long[]{0x0000000000000002L,0x00000000000000C0L}); |
7913 | public static final BitSet FOLLOW_set_in_boolExpression4426 = new BitSet(new long[]{0x0200000004144040L,0x0000000000000400L}); |
7914 | public static final BitSet FOLLOW_boolConjunction_in_boolExpression4458 = new BitSet(new long[]{0x0000000000000002L,0x00000000000000C0L}); |
7915 | public static final BitSet FOLLOW_boolConjunctionElement_in_boolConjunction4510 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000300L}); |
7916 | public static final BitSet FOLLOW_set_in_boolConjunction4551 = new BitSet(new long[]{0x0200000004144040L,0x0000000000000400L}); |
7917 | public static final BitSet FOLLOW_boolConjunctionElement_in_boolConjunction4583 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000300L}); |
7918 | public static final BitSet FOLLOW_set_in_boolConjunctionElement4645 = new BitSet(new long[]{0x0200000004144000L}); |
7919 | public static final BitSet FOLLOW_mathComparison_in_boolConjunctionElement4677 = new BitSet(new long[]{0x0000000000000002L}); |
7920 | public static final BitSet FOLLOW_funcExpression_in_boolConjunctionElement4712 = new BitSet(new long[]{0x0000000000000002L}); |
7921 | public static final BitSet FOLLOW_set_in_boolConjunctionElement4762 = new BitSet(new long[]{0x0000000004000000L}); |
7922 | public static final BitSet FOLLOW_26_in_boolConjunctionElement4784 = new BitSet(new long[]{0x0200000004144040L,0x0000000000000400L}); |
7923 | public static final BitSet FOLLOW_boolExpression_in_boolConjunctionElement4788 = new BitSet(new long[]{0x0000000010000000L}); |
7924 | public static final BitSet FOLLOW_28_in_boolConjunctionElement4790 = new BitSet(new long[]{0x0000000000000002L}); |
7925 | public static final BitSet FOLLOW_mathExpression_in_mathComparison4841 = new BitSet(new long[]{0x0480000400000000L,0x0000000000007800L}); |
7926 | public static final BitSet FOLLOW_set_in_mathComparison4848 = new BitSet(new long[]{0x0200000004144000L}); |
7927 | public static final BitSet FOLLOW_mathExpression_in_mathComparison4912 = new BitSet(new long[]{0x0000000000000002L}); |
7928 | public static final BitSet FOLLOW_mathTerm_in_mathExpression4956 = new BitSet(new long[]{0x0000000000000182L,0x0000000000008000L}); |
7929 | public static final BitSet FOLLOW_set_in_mathExpression4990 = new BitSet(new long[]{0x0200000004144000L}); |
7930 | public static final BitSet FOLLOW_mathTerm_in_mathExpression5032 = new BitSet(new long[]{0x0000000000000182L,0x0000000000008000L}); |
7931 | public static final BitSet FOLLOW_mathFactor_in_mathTerm5077 = new BitSet(new long[]{0x0000010000000202L,0x00000000001F0000L}); |
7932 | public static final BitSet FOLLOW_set_in_mathTerm5113 = new BitSet(new long[]{0x0200000004144000L}); |
7933 | public static final BitSet FOLLOW_mathFactor_in_mathTerm5195 = new BitSet(new long[]{0x0000010000000202L,0x00000000001F0000L}); |
7934 | public static final BitSet FOLLOW_funcExpression_in_mathFactor5248 = new BitSet(new long[]{0x0000000000000042L}); |
7935 | public static final BitSet FOLLOW_atomicExpression_in_mathFactor5283 = new BitSet(new long[]{0x0000000000000042L}); |
7936 | public static final BitSet FOLLOW_26_in_mathFactor5320 = new BitSet(new long[]{0x0200000004144000L}); |
7937 | public static final BitSet FOLLOW_mathExpression_in_mathFactor5324 = new BitSet(new long[]{0x0000000010000000L}); |
7938 | public static final BitSet FOLLOW_28_in_mathFactor5326 = new BitSet(new long[]{0x0000000000000042L}); |
7939 | public static final BitSet FOLLOW_57_in_mathFactor5369 = new BitSet(new long[]{0x0200000004144000L}); |
7940 | public static final BitSet FOLLOW_mathFactor_in_mathFactor5373 = new BitSet(new long[]{0x0000000000000042L}); |
7941 | public static final BitSet FOLLOW_NOT_in_mathFactor5410 = new BitSet(new long[]{0x0000000000000002L}); |
7942 | public static final BitSet FOLLOW_ID_in_funcExpression5447 = new BitSet(new long[]{0x0000000004000000L}); |
7943 | public static final BitSet FOLLOW_26_in_funcExpression5464 = new BitSet(new long[]{0x0200000004144040L,0x0000000000000400L}); |
7944 | public static final BitSet FOLLOW_funcArgument_in_funcExpression5468 = new BitSet(new long[]{0x0000000018000000L}); |
7945 | public static final BitSet FOLLOW_27_in_funcExpression5498 = new BitSet(new long[]{0x0200000004144040L,0x0000000000000400L}); |
7946 | public static final BitSet FOLLOW_funcArgument_in_funcExpression5502 = new BitSet(new long[]{0x0000000018000000L}); |
7947 | public static final BitSet FOLLOW_28_in_funcExpression5532 = new BitSet(new long[]{0x0000000000000002L}); |
7948 | public static final BitSet FOLLOW_boolExpression_in_funcArgument5553 = new BitSet(new long[]{0x0000000000000002L}); |
7949 | public static final BitSet FOLLOW_mathExpression_in_funcArgument5584 = new BitSet(new long[]{0x0000000000000002L}); |
7950 | public static final BitSet FOLLOW_funcExpression_in_funcArgument5617 = new BitSet(new long[]{0x0000000000000002L}); |
7951 | public static final BitSet FOLLOW_atomicExpression_in_funcArgument5650 = new BitSet(new long[]{0x0000000000000002L}); |
7952 | public static final BitSet FOLLOW_NUMBER_in_atomicExpression5698 = new BitSet(new long[]{0x0000000000000002L}); |
7953 | public static final BitSet FOLLOW_STRING_in_atomicExpression5722 = new BitSet(new long[]{0x0000000000000002L}); |
7954 | public static final BitSet FOLLOW_ID_in_atomicExpression5748 = new BitSet(new long[]{0x0000000000000002L}); |
7955 | public static final BitSet FOLLOW_set_in_literal5785 = new BitSet(new long[]{0x00000000001000C0L}); |
7956 | public static final BitSet FOLLOW_atom_in_literal5807 = new BitSet(new long[]{0x0000000000000002L}); |
7957 | public static final BitSet FOLLOW_ID_in_term5836 = new BitSet(new long[]{0x0000000000000002L}); |
7958 | public static final BitSet FOLLOW_set_in_term5855 = new BitSet(new long[]{0x0000000000000002L}); |
7959 | public static final BitSet FOLLOW_ID_in_atom5902 = new BitSet(new long[]{0x0000000004000000L}); |
7960 | public static final BitSet FOLLOW_26_in_atom5904 = new BitSet(new long[]{0x0000000000144000L}); |
7961 | public static final BitSet FOLLOW_term_in_atom5927 = new BitSet(new long[]{0x0000000018000000L}); |
7962 | public static final BitSet FOLLOW_27_in_atom5948 = new BitSet(new long[]{0x0000000000144000L}); |
7963 | public static final BitSet FOLLOW_term_in_atom5952 = new BitSet(new long[]{0x0000000018000000L}); |
7964 | public static final BitSet FOLLOW_28_in_atom5977 = new BitSet(new long[]{0x0000000000000002L}); |
7965 | public static final BitSet FOLLOW_query_in_queryList6021 = new BitSet(new long[]{0x00000000001000C0L}); |
7966 | public static final BitSet FOLLOW_EOF_in_queryList6024 = new BitSet(new long[]{0x0000000000000002L}); |
7967 | public static final BitSet FOLLOW_atom_in_query6039 = new BitSet(new long[]{0x0000000000000002L}); |
7968 | public static final BitSet FOLLOW_ID_in_query6055 = new BitSet(new long[]{0x0000000000000002L}); |
7969 | public static final BitSet FOLLOW_query_in_queryCommaList6080 = new BitSet(new long[]{0x0000000008000000L}); |
7970 | public static final BitSet FOLLOW_27_in_queryCommaList6083 = new BitSet(new long[]{0x00000000001000C0L}); |
7971 | public static final BitSet FOLLOW_query_in_queryCommaList6085 = new BitSet(new long[]{0x0000000008000000L}); |
7972 | public static final BitSet FOLLOW_EOF_in_queryCommaList6089 = new BitSet(new long[]{0x0000000000000002L}); |
7973 | public static final BitSet FOLLOW_evidence_in_evidenceList6104 = new BitSet(new long[]{0x0000000000140040L}); |
7974 | public static final BitSet FOLLOW_EOF_in_evidenceList6107 = new BitSet(new long[]{0x0000000000000002L}); |
7975 | public static final BitSet FOLLOW_NUMBER_in_evidence6124 = new BitSet(new long[]{0x0000000000100040L}); |
7976 | public static final BitSet FOLLOW_NOT_in_evidence6127 = new BitSet(new long[]{0x0000000000100000L}); |
7977 | public static final BitSet FOLLOW_ID_in_evidence6132 = new BitSet(new long[]{0x0000000004000000L}); |
7978 | public static final BitSet FOLLOW_26_in_evidence6134 = new BitSet(new long[]{0x0000000000144000L}); |
7979 | public static final BitSet FOLLOW_set_in_evidence6141 = new BitSet(new long[]{0x0000000018000000L}); |
7980 | public static final BitSet FOLLOW_27_in_evidence6177 = new BitSet(new long[]{0x0000000000144000L}); |
7981 | public static final BitSet FOLLOW_set_in_evidence6186 = new BitSet(new long[]{0x0000000018000000L}); |
7982 | public static final BitSet FOLLOW_28_in_evidence6229 = new BitSet(new long[]{0x0000000000000002L}); |
7983 | public static final BitSet FOLLOW_69_in_synpred71_FELIX4083 = new BitSet(new long[]{0x00000000001000C0L}); |
7984 | public static final BitSet FOLLOW_literal_in_synpred71_FELIX4087 = new BitSet(new long[]{0x0000000000000002L}); |
7985 | public static final BitSet FOLLOW_mathComparison_in_synpred82_FELIX4677 = new BitSet(new long[]{0x0000000000000002L}); |
7986 | public static final BitSet FOLLOW_set_in_synpred83_FELIX4645 = new BitSet(new long[]{0x0200000004144000L}); |
7987 | public static final BitSet FOLLOW_mathComparison_in_synpred83_FELIX4677 = new BitSet(new long[]{0x0000000000000002L}); |
7988 | public static final BitSet FOLLOW_funcExpression_in_synpred83_FELIX4712 = new BitSet(new long[]{0x0000000000000002L}); |
7989 | public static final BitSet FOLLOW_set_in_synpred95_FELIX4990 = new BitSet(new long[]{0x0200000004144000L}); |
7990 | public static final BitSet FOLLOW_mathTerm_in_synpred95_FELIX5032 = new BitSet(new long[]{0x0000000000000002L}); |
7991 | public static final BitSet FOLLOW_set_in_synpred102_FELIX5113 = new BitSet(new long[]{0x0200000004144000L}); |
7992 | public static final BitSet FOLLOW_mathFactor_in_synpred102_FELIX5195 = new BitSet(new long[]{0x0000000000000002L}); |
7993 | public static final BitSet FOLLOW_NOT_in_synpred106_FELIX5410 = new BitSet(new long[]{0x0000000000000002L}); |
7994 | public static final BitSet FOLLOW_boolExpression_in_synpred108_FELIX5553 = new BitSet(new long[]{0x0000000000000002L}); |
7995 | public static final BitSet FOLLOW_mathExpression_in_synpred109_FELIX5584 = new BitSet(new long[]{0x0000000000000002L}); |
7996 | public static final BitSet FOLLOW_funcExpression_in_synpred110_FELIX5617 = new BitSet(new long[]{0x0000000000000002L}); |
7997 | |
7998 | } |