]> gerrit.simantics Code Review - simantics/platform.git/blob
94df985e056289b8bea1f4446509c17002de3f56
[simantics/platform.git] /
1 // $ANTLR 3.3 Nov 30, 2010 12:50:56 src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g 2011-12-19 14:53:14
2  package org.simantics.graph.compiler.internal.parsing; 
3
4 import org.antlr.runtime.*;
5 import java.util.Stack;
6 import java.util.List;
7 import java.util.ArrayList;
8 import java.util.Map;
9 import java.util.HashMap;
10
11 import org.antlr.runtime.tree.*;
12
13 @SuppressWarnings("unused")
14 public class GraphParser extends Parser {
15     public static final String[] tokenNames = new String[] {
16         "<invalid>", "<EOR>", "<DOWN>", "<UP>", "INDENT", "DEDENT", "FILE", "RESOURCE", "PROPERTY", "VARIABLE", "EMBEDDED_VALUE", "EMBEDDED_TYPE", "TEMPLATE_INSTANCE", "TEMPLATE_DEFINITION", "BLANK", "REF", "EQUALS", "INSTANCE_OF", "INHERITS", "SUBRELATION_OF", "HAS_DOMAIN", "HAS_RANGE", "DOMAIN_OF", "REQUIRES_VALUE_TYPE", "TYPE_DEFINITIONS", "TYPE_DEFINITION", "UNION_TYPE", "RECORD_TYPE", "TUPLE_TYPE", "ARRAY_TYPE", "TYPE_REFERENCE", "TYPE_ANNOTATION", "TYPE_COMPONENT", "VALUE_DEFINITIONS", "VALUE_DEFINITION", "NO_VALUE", "VARIANT", "ARRAY", "TUPLE", "TAGGED_VALUE", "RECORD", "MAP", "ASSIGNMENT", "TRUE", "FALSE", "ID", "COMMENT", "WS", "LPAREN", "RPAREN", "LBRACKET", "RBRACKET", "LCURLY", "RCURLY", "INT", "INT_RANGE", "FLOAT", "RANGE", "NEWLINE", "EXPONENT", "ESC_SEQ", "STRING", "URI", "HEX_DIGIT", "UNICODE_ESC", "'@'", "'.'", "'<T'", "'<R'", "'<--'", "'-->'", "'==>'", "'>--'", "':'", "'='", "'%'", "'$'", "'|'", "','", "'true'", "'false'"
17     };
18     public static final int EOF=-1;
19     public static final int T__65=65;
20     public static final int T__66=66;
21     public static final int T__67=67;
22     public static final int T__68=68;
23     public static final int T__69=69;
24     public static final int T__70=70;
25     public static final int T__71=71;
26     public static final int T__72=72;
27     public static final int T__73=73;
28     public static final int T__74=74;
29     public static final int T__75=75;
30     public static final int T__76=76;
31     public static final int T__77=77;
32     public static final int T__78=78;
33     public static final int T__79=79;
34     public static final int T__80=80;
35     public static final int INDENT=4;
36     public static final int DEDENT=5;
37     public static final int FILE=6;
38     public static final int RESOURCE=7;
39     public static final int PROPERTY=8;
40     public static final int VARIABLE=9;
41     public static final int EMBEDDED_VALUE=10;
42     public static final int EMBEDDED_TYPE=11;
43     public static final int TEMPLATE_INSTANCE=12;
44     public static final int TEMPLATE_DEFINITION=13;
45     public static final int BLANK=14;
46     public static final int REF=15;
47     public static final int EQUALS=16;
48     public static final int INSTANCE_OF=17;
49     public static final int INHERITS=18;
50     public static final int SUBRELATION_OF=19;
51     public static final int HAS_DOMAIN=20;
52     public static final int HAS_RANGE=21;
53     public static final int DOMAIN_OF=22;
54     public static final int REQUIRES_VALUE_TYPE=23;
55     public static final int TYPE_DEFINITIONS=24;
56     public static final int TYPE_DEFINITION=25;
57     public static final int UNION_TYPE=26;
58     public static final int RECORD_TYPE=27;
59     public static final int TUPLE_TYPE=28;
60     public static final int ARRAY_TYPE=29;
61     public static final int TYPE_REFERENCE=30;
62     public static final int TYPE_ANNOTATION=31;
63     public static final int TYPE_COMPONENT=32;
64     public static final int VALUE_DEFINITIONS=33;
65     public static final int VALUE_DEFINITION=34;
66     public static final int NO_VALUE=35;
67     public static final int VARIANT=36;
68     public static final int ARRAY=37;
69     public static final int TUPLE=38;
70     public static final int TAGGED_VALUE=39;
71     public static final int RECORD=40;
72     public static final int MAP=41;
73     public static final int ASSIGNMENT=42;
74     public static final int TRUE=43;
75     public static final int FALSE=44;
76     public static final int ID=45;
77     public static final int COMMENT=46;
78     public static final int WS=47;
79     public static final int LPAREN=48;
80     public static final int RPAREN=49;
81     public static final int LBRACKET=50;
82     public static final int RBRACKET=51;
83     public static final int LCURLY=52;
84     public static final int RCURLY=53;
85     public static final int INT=54;
86     public static final int INT_RANGE=55;
87     public static final int FLOAT=56;
88     public static final int RANGE=57;
89     public static final int NEWLINE=58;
90     public static final int EXPONENT=59;
91     public static final int ESC_SEQ=60;
92     public static final int STRING=61;
93     public static final int URI=62;
94     public static final int HEX_DIGIT=63;
95     public static final int UNICODE_ESC=64;
96
97     // delegates
98     // delegators
99
100
101         public GraphParser(TokenStream input) {
102             this(input, new RecognizerSharedState());
103         }
104         public GraphParser(TokenStream input, RecognizerSharedState state) {
105             super(input, state);
106              
107         }
108         
109     protected TreeAdaptor adaptor = new CommonTreeAdaptor();
110
111     public void setTreeAdaptor(TreeAdaptor adaptor) {
112         this.adaptor = adaptor;
113     }
114     public TreeAdaptor getTreeAdaptor() {
115         return adaptor;
116     }
117
118     public String[] getTokenNames() { return GraphParser.tokenNames; }
119     public String getGrammarFileName() { return "src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g"; }
120
121
122     public static class file_return extends ParserRuleReturnScope {
123         CommonTree tree;
124         public Object getTree() { return tree; }
125     };
126
127     // $ANTLR start "file"
128     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:1: file : ( NEWLINE )? ( resourceDefinitions )? EOF -> ^( FILE ( resourceDefinitions )? ) ;
129     public final GraphParser.file_return file() throws RecognitionException {
130         GraphParser.file_return retval = new GraphParser.file_return();
131         retval.start = input.LT(1);
132
133         CommonTree root_0 = null;
134
135         Token NEWLINE1=null;
136         Token EOF3=null;
137         GraphParser.resourceDefinitions_return resourceDefinitions2 = null;
138
139
140         CommonTree NEWLINE1_tree=null;
141         CommonTree EOF3_tree=null;
142         RewriteRuleTokenStream stream_NEWLINE=new RewriteRuleTokenStream(adaptor,"token NEWLINE");
143         RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
144         RewriteRuleSubtreeStream stream_resourceDefinitions=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinitions");
145         try {
146             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:6: ( ( NEWLINE )? ( resourceDefinitions )? EOF -> ^( FILE ( resourceDefinitions )? ) )
147             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:8: ( NEWLINE )? ( resourceDefinitions )? EOF
148             {
149             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:8: ( NEWLINE )?
150             int alt1=2;
151             int LA1_0 = input.LA(1);
152
153             if ( (LA1_0==NEWLINE) ) {
154                 alt1=1;
155             }
156             switch (alt1) {
157                 case 1 :
158                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:8: NEWLINE
159                     {
160                     NEWLINE1=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_file1230); if (state.failed) return retval; 
161                     if ( state.backtracking==0 ) stream_NEWLINE.add(NEWLINE1);
162
163
164                     }
165                     break;
166
167             }
168
169             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:17: ( resourceDefinitions )?
170             int alt2=2;
171             int LA2_0 = input.LA(1);
172
173             if ( (LA2_0==ID||LA2_0==LPAREN||LA2_0==LBRACKET||LA2_0==LCURLY||LA2_0==INT||LA2_0==FLOAT||(LA2_0>=STRING && LA2_0<=URI)||LA2_0==65||(LA2_0>=75 && LA2_0<=76)||(LA2_0>=79 && LA2_0<=80)) ) {
174                 alt2=1;
175             }
176             switch (alt2) {
177                 case 1 :
178                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:17: resourceDefinitions
179                     {
180                     pushFollow(FOLLOW_resourceDefinitions_in_file1233);
181                     resourceDefinitions2=resourceDefinitions();
182
183                     state._fsp--;
184                     if (state.failed) return retval;
185                     if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions2.getTree());
186
187                     }
188                     break;
189
190             }
191
192             EOF3=(Token)match(input,EOF,FOLLOW_EOF_in_file1236); if (state.failed) return retval; 
193             if ( state.backtracking==0 ) stream_EOF.add(EOF3);
194
195
196
197             // AST REWRITE
198             // elements: resourceDefinitions
199             // token labels: 
200             // rule labels: retval
201             // token list labels: 
202             // rule list labels: 
203             // wildcard labels: 
204             if ( state.backtracking==0 ) {
205             retval.tree = root_0;
206             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
207
208             root_0 = (CommonTree)adaptor.nil();
209             // 224:42: -> ^( FILE ( resourceDefinitions )? )
210             {
211                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:45: ^( FILE ( resourceDefinitions )? )
212                 {
213                 CommonTree root_1 = (CommonTree)adaptor.nil();
214                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(FILE, "FILE"), root_1);
215
216                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:52: ( resourceDefinitions )?
217                 if ( stream_resourceDefinitions.hasNext() ) {
218                     adaptor.addChild(root_1, stream_resourceDefinitions.nextTree());
219
220                 }
221                 stream_resourceDefinitions.reset();
222
223                 adaptor.addChild(root_0, root_1);
224                 }
225
226             }
227
228             retval.tree = root_0;}
229             }
230
231             retval.stop = input.LT(-1);
232
233             if ( state.backtracking==0 ) {
234
235             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
236             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
237             }
238         }
239         catch (RecognitionException re) {
240             reportError(re);
241             recover(input,re);
242         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
243
244         }
245         finally {
246         }
247         return retval;
248     }
249     // $ANTLR end "file"
250
251     public static class resourceDefinitions_return extends ParserRuleReturnScope {
252         CommonTree tree;
253         public Object getTree() { return tree; }
254     };
255
256     // $ANTLR start "resourceDefinitions"
257     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:226:1: resourceDefinitions : resourceDefinition ( NEWLINE resourceDefinition )* ;
258     public final GraphParser.resourceDefinitions_return resourceDefinitions() throws RecognitionException {
259         GraphParser.resourceDefinitions_return retval = new GraphParser.resourceDefinitions_return();
260         retval.start = input.LT(1);
261
262         CommonTree root_0 = null;
263
264         Token NEWLINE5=null;
265         GraphParser.resourceDefinition_return resourceDefinition4 = null;
266
267         GraphParser.resourceDefinition_return resourceDefinition6 = null;
268
269
270         CommonTree NEWLINE5_tree=null;
271
272         try {
273             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:227:6: ( resourceDefinition ( NEWLINE resourceDefinition )* )
274             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:227:8: resourceDefinition ( NEWLINE resourceDefinition )*
275             {
276             root_0 = (CommonTree)adaptor.nil();
277
278             pushFollow(FOLLOW_resourceDefinition_in_resourceDefinitions1260);
279             resourceDefinition4=resourceDefinition();
280
281             state._fsp--;
282             if (state.failed) return retval;
283             if ( state.backtracking==0 ) adaptor.addChild(root_0, resourceDefinition4.getTree());
284             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:227:27: ( NEWLINE resourceDefinition )*
285             loop3:
286             do {
287                 int alt3=2;
288                 int LA3_0 = input.LA(1);
289
290                 if ( (LA3_0==NEWLINE) ) {
291                     alt3=1;
292                 }
293
294
295                 switch (alt3) {
296                 case 1 :
297                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:227:28: NEWLINE resourceDefinition
298                     {
299                     NEWLINE5=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_resourceDefinitions1263); if (state.failed) return retval;
300                     pushFollow(FOLLOW_resourceDefinition_in_resourceDefinitions1266);
301                     resourceDefinition6=resourceDefinition();
302
303                     state._fsp--;
304                     if (state.failed) return retval;
305                     if ( state.backtracking==0 ) adaptor.addChild(root_0, resourceDefinition6.getTree());
306
307                     }
308                     break;
309
310                 default :
311                     break loop3;
312                 }
313             } while (true);
314
315
316             }
317
318             retval.stop = input.LT(-1);
319
320             if ( state.backtracking==0 ) {
321
322             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
323             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
324             }
325         }
326         catch (RecognitionException re) {
327             reportError(re);
328             recover(input,re);
329         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
330
331         }
332         finally {
333         }
334         return retval;
335     }
336     // $ANTLR end "resourceDefinitions"
337
338     public static class resourceDefinition_return extends ParserRuleReturnScope {
339         CommonTree tree;
340         public Object getTree() { return tree; }
341     };
342
343     // $ANTLR start "resourceDefinition"
344     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:230:1: resourceDefinition : ( resource ( localProperty )* ( INDENT property ( NEWLINE property )* DEDENT )? -> ^( RESOURCE resource ( localProperty )* ( property )* ) | template -> ^( RESOURCE ^( BLANK template ) template ) );
345     public final GraphParser.resourceDefinition_return resourceDefinition() throws RecognitionException {
346         GraphParser.resourceDefinition_return retval = new GraphParser.resourceDefinition_return();
347         retval.start = input.LT(1);
348
349         CommonTree root_0 = null;
350
351         Token INDENT9=null;
352         Token NEWLINE11=null;
353         Token DEDENT13=null;
354         GraphParser.resource_return resource7 = null;
355
356         GraphParser.localProperty_return localProperty8 = null;
357
358         GraphParser.property_return property10 = null;
359
360         GraphParser.property_return property12 = null;
361
362         GraphParser.template_return template14 = null;
363
364
365         CommonTree INDENT9_tree=null;
366         CommonTree NEWLINE11_tree=null;
367         CommonTree DEDENT13_tree=null;
368         RewriteRuleTokenStream stream_DEDENT=new RewriteRuleTokenStream(adaptor,"token DEDENT");
369         RewriteRuleTokenStream stream_NEWLINE=new RewriteRuleTokenStream(adaptor,"token NEWLINE");
370         RewriteRuleTokenStream stream_INDENT=new RewriteRuleTokenStream(adaptor,"token INDENT");
371         RewriteRuleSubtreeStream stream_template=new RewriteRuleSubtreeStream(adaptor,"rule template");
372         RewriteRuleSubtreeStream stream_resource=new RewriteRuleSubtreeStream(adaptor,"rule resource");
373         RewriteRuleSubtreeStream stream_property=new RewriteRuleSubtreeStream(adaptor,"rule property");
374         RewriteRuleSubtreeStream stream_localProperty=new RewriteRuleSubtreeStream(adaptor,"rule localProperty");
375         try {
376             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:231:5: ( resource ( localProperty )* ( INDENT property ( NEWLINE property )* DEDENT )? -> ^( RESOURCE resource ( localProperty )* ( property )* ) | template -> ^( RESOURCE ^( BLANK template ) template ) )
377             int alt7=2;
378             int LA7_0 = input.LA(1);
379
380             if ( (LA7_0==ID||LA7_0==LPAREN||LA7_0==LBRACKET||LA7_0==LCURLY||LA7_0==INT||LA7_0==FLOAT||(LA7_0>=STRING && LA7_0<=URI)||(LA7_0>=75 && LA7_0<=76)||(LA7_0>=79 && LA7_0<=80)) ) {
381                 alt7=1;
382             }
383             else if ( (LA7_0==65) ) {
384                 alt7=2;
385             }
386             else {
387                 if (state.backtracking>0) {state.failed=true; return retval;}
388                 NoViableAltException nvae =
389                     new NoViableAltException("", 7, 0, input);
390
391                 throw nvae;
392             }
393             switch (alt7) {
394                 case 1 :
395                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:231:7: resource ( localProperty )* ( INDENT property ( NEWLINE property )* DEDENT )?
396                     {
397                     pushFollow(FOLLOW_resource_in_resourceDefinition1300);
398                     resource7=resource();
399
400                     state._fsp--;
401                     if (state.failed) return retval;
402                     if ( state.backtracking==0 ) stream_resource.add(resource7.getTree());
403                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:232:7: ( localProperty )*
404                     loop4:
405                     do {
406                         int alt4=2;
407                         int LA4_0 = input.LA(1);
408
409                         if ( (LA4_0==ID||LA4_0==URI||(LA4_0>=67 && LA4_0<=75)) ) {
410                             alt4=1;
411                         }
412
413
414                         switch (alt4) {
415                         case 1 :
416                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:232:7: localProperty
417                             {
418                             pushFollow(FOLLOW_localProperty_in_resourceDefinition1308);
419                             localProperty8=localProperty();
420
421                             state._fsp--;
422                             if (state.failed) return retval;
423                             if ( state.backtracking==0 ) stream_localProperty.add(localProperty8.getTree());
424
425                             }
426                             break;
427
428                         default :
429                             break loop4;
430                         }
431                     } while (true);
432
433                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:233:7: ( INDENT property ( NEWLINE property )* DEDENT )?
434                     int alt6=2;
435                     int LA6_0 = input.LA(1);
436
437                     if ( (LA6_0==INDENT) ) {
438                         alt6=1;
439                     }
440                     switch (alt6) {
441                         case 1 :
442                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:233:8: INDENT property ( NEWLINE property )* DEDENT
443                             {
444                             INDENT9=(Token)match(input,INDENT,FOLLOW_INDENT_in_resourceDefinition1318); if (state.failed) return retval; 
445                             if ( state.backtracking==0 ) stream_INDENT.add(INDENT9);
446
447                             pushFollow(FOLLOW_property_in_resourceDefinition1320);
448                             property10=property();
449
450                             state._fsp--;
451                             if (state.failed) return retval;
452                             if ( state.backtracking==0 ) stream_property.add(property10.getTree());
453                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:233:24: ( NEWLINE property )*
454                             loop5:
455                             do {
456                                 int alt5=2;
457                                 int LA5_0 = input.LA(1);
458
459                                 if ( (LA5_0==NEWLINE) ) {
460                                     alt5=1;
461                                 }
462
463
464                                 switch (alt5) {
465                                 case 1 :
466                                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:233:25: NEWLINE property
467                                     {
468                                     NEWLINE11=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_resourceDefinition1323); if (state.failed) return retval; 
469                                     if ( state.backtracking==0 ) stream_NEWLINE.add(NEWLINE11);
470
471                                     pushFollow(FOLLOW_property_in_resourceDefinition1325);
472                                     property12=property();
473
474                                     state._fsp--;
475                                     if (state.failed) return retval;
476                                     if ( state.backtracking==0 ) stream_property.add(property12.getTree());
477
478                                     }
479                                     break;
480
481                                 default :
482                                     break loop5;
483                                 }
484                             } while (true);
485
486                             DEDENT13=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_resourceDefinition1329); if (state.failed) return retval; 
487                             if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT13);
488
489
490                             }
491                             break;
492
493                     }
494
495
496
497                     // AST REWRITE
498                     // elements: property, localProperty, resource
499                     // token labels: 
500                     // rule labels: retval
501                     // token list labels: 
502                     // rule list labels: 
503                     // wildcard labels: 
504                     if ( state.backtracking==0 ) {
505                     retval.tree = root_0;
506                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
507
508                     root_0 = (CommonTree)adaptor.nil();
509                     // 234:5: -> ^( RESOURCE resource ( localProperty )* ( property )* )
510                     {
511                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:234:8: ^( RESOURCE resource ( localProperty )* ( property )* )
512                         {
513                         CommonTree root_1 = (CommonTree)adaptor.nil();
514                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RESOURCE, "RESOURCE"), root_1);
515
516                         adaptor.addChild(root_1, stream_resource.nextTree());
517                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:234:28: ( localProperty )*
518                         while ( stream_localProperty.hasNext() ) {
519                             adaptor.addChild(root_1, stream_localProperty.nextTree());
520
521                         }
522                         stream_localProperty.reset();
523                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:234:43: ( property )*
524                         while ( stream_property.hasNext() ) {
525                             adaptor.addChild(root_1, stream_property.nextTree());
526
527                         }
528                         stream_property.reset();
529
530                         adaptor.addChild(root_0, root_1);
531                         }
532
533                     }
534
535                     retval.tree = root_0;}
536                     }
537                     break;
538                 case 2 :
539                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:235:7: template
540                     {
541                     pushFollow(FOLLOW_template_in_resourceDefinition1358);
542                     template14=template();
543
544                     state._fsp--;
545                     if (state.failed) return retval;
546                     if ( state.backtracking==0 ) stream_template.add(template14.getTree());
547
548
549                     // AST REWRITE
550                     // elements: template, template
551                     // token labels: 
552                     // rule labels: retval
553                     // token list labels: 
554                     // rule list labels: 
555                     // wildcard labels: 
556                     if ( state.backtracking==0 ) {
557                     retval.tree = root_0;
558                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
559
560                     root_0 = (CommonTree)adaptor.nil();
561                     // 235:16: -> ^( RESOURCE ^( BLANK template ) template )
562                     {
563                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:235:19: ^( RESOURCE ^( BLANK template ) template )
564                         {
565                         CommonTree root_1 = (CommonTree)adaptor.nil();
566                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RESOURCE, "RESOURCE"), root_1);
567
568                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:235:30: ^( BLANK template )
569                         {
570                         CommonTree root_2 = (CommonTree)adaptor.nil();
571                         root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(BLANK, "BLANK"), root_2);
572
573                         adaptor.addChild(root_2, stream_template.nextTree());
574
575                         adaptor.addChild(root_1, root_2);
576                         }
577                         adaptor.addChild(root_1, stream_template.nextTree());
578
579                         adaptor.addChild(root_0, root_1);
580                         }
581
582                     }
583
584                     retval.tree = root_0;}
585                     }
586                     break;
587
588             }
589             retval.stop = input.LT(-1);
590
591             if ( state.backtracking==0 ) {
592
593             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
594             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
595             }
596         }
597         catch (RecognitionException re) {
598             reportError(re);
599             recover(input,re);
600         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
601
602         }
603         finally {
604         }
605         return retval;
606     }
607     // $ANTLR end "resourceDefinition"
608
609     public static class localProperty_return extends ParserRuleReturnScope {
610         CommonTree tree;
611         public Object getTree() { return tree; }
612     };
613
614     // $ANTLR start "localProperty"
615     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:238:1: localProperty : relation resource -> ^( PROPERTY relation ^( RESOURCE resource ) ) ;
616     public final GraphParser.localProperty_return localProperty() throws RecognitionException {
617         GraphParser.localProperty_return retval = new GraphParser.localProperty_return();
618         retval.start = input.LT(1);
619
620         CommonTree root_0 = null;
621
622         GraphParser.relation_return relation15 = null;
623
624         GraphParser.resource_return resource16 = null;
625
626
627         RewriteRuleSubtreeStream stream_relation=new RewriteRuleSubtreeStream(adaptor,"rule relation");
628         RewriteRuleSubtreeStream stream_resource=new RewriteRuleSubtreeStream(adaptor,"rule resource");
629         try {
630             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:239:5: ( relation resource -> ^( PROPERTY relation ^( RESOURCE resource ) ) )
631             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:239:7: relation resource
632             {
633             pushFollow(FOLLOW_relation_in_localProperty1393);
634             relation15=relation();
635
636             state._fsp--;
637             if (state.failed) return retval;
638             if ( state.backtracking==0 ) stream_relation.add(relation15.getTree());
639             pushFollow(FOLLOW_resource_in_localProperty1395);
640             resource16=resource();
641
642             state._fsp--;
643             if (state.failed) return retval;
644             if ( state.backtracking==0 ) stream_resource.add(resource16.getTree());
645
646
647             // AST REWRITE
648             // elements: resource, relation
649             // token labels: 
650             // rule labels: retval
651             // token list labels: 
652             // rule list labels: 
653             // wildcard labels: 
654             if ( state.backtracking==0 ) {
655             retval.tree = root_0;
656             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
657
658             root_0 = (CommonTree)adaptor.nil();
659             // 240:5: -> ^( PROPERTY relation ^( RESOURCE resource ) )
660             {
661                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:240:8: ^( PROPERTY relation ^( RESOURCE resource ) )
662                 {
663                 CommonTree root_1 = (CommonTree)adaptor.nil();
664                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PROPERTY, "PROPERTY"), root_1);
665
666                 adaptor.addChild(root_1, stream_relation.nextTree());
667                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:240:28: ^( RESOURCE resource )
668                 {
669                 CommonTree root_2 = (CommonTree)adaptor.nil();
670                 root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RESOURCE, "RESOURCE"), root_2);
671
672                 adaptor.addChild(root_2, stream_resource.nextTree());
673
674                 adaptor.addChild(root_1, root_2);
675                 }
676
677                 adaptor.addChild(root_0, root_1);
678                 }
679
680             }
681
682             retval.tree = root_0;}
683             }
684
685             retval.stop = input.LT(-1);
686
687             if ( state.backtracking==0 ) {
688
689             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
690             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
691             }
692         }
693         catch (RecognitionException re) {
694             reportError(re);
695             recover(input,re);
696         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
697
698         }
699         finally {
700         }
701         return retval;
702     }
703     // $ANTLR end "localProperty"
704
705     public static class property_return extends ParserRuleReturnScope {
706         CommonTree tree;
707         public Object getTree() { return tree; }
708     };
709
710     // $ANTLR start "property"
711     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:243:1: property : ( relation ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) ) | template );
712     public final GraphParser.property_return property() throws RecognitionException {
713         GraphParser.property_return retval = new GraphParser.property_return();
714         retval.start = input.LT(1);
715
716         CommonTree root_0 = null;
717
718         Token INDENT19=null;
719         Token DEDENT21=null;
720         GraphParser.relation_return relation17 = null;
721
722         GraphParser.resourceDefinition_return resourceDefinition18 = null;
723
724         GraphParser.resourceDefinitions_return resourceDefinitions20 = null;
725
726         GraphParser.template_return template22 = null;
727
728
729         CommonTree INDENT19_tree=null;
730         CommonTree DEDENT21_tree=null;
731         RewriteRuleTokenStream stream_DEDENT=new RewriteRuleTokenStream(adaptor,"token DEDENT");
732         RewriteRuleTokenStream stream_INDENT=new RewriteRuleTokenStream(adaptor,"token INDENT");
733         RewriteRuleSubtreeStream stream_resourceDefinition=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinition");
734         RewriteRuleSubtreeStream stream_relation=new RewriteRuleSubtreeStream(adaptor,"rule relation");
735         RewriteRuleSubtreeStream stream_resourceDefinitions=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinitions");
736         try {
737             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:244:5: ( relation ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) ) | template )
738             int alt9=2;
739             int LA9_0 = input.LA(1);
740
741             if ( (LA9_0==ID||LA9_0==URI||(LA9_0>=67 && LA9_0<=75)) ) {
742                 alt9=1;
743             }
744             else if ( (LA9_0==65) ) {
745                 alt9=2;
746             }
747             else {
748                 if (state.backtracking>0) {state.failed=true; return retval;}
749                 NoViableAltException nvae =
750                     new NoViableAltException("", 9, 0, input);
751
752                 throw nvae;
753             }
754             switch (alt9) {
755                 case 1 :
756                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:244:7: relation ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) )
757                     {
758                     pushFollow(FOLLOW_relation_in_property1434);
759                     relation17=relation();
760
761                     state._fsp--;
762                     if (state.failed) return retval;
763                     if ( state.backtracking==0 ) stream_relation.add(relation17.getTree());
764                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:245:7: ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) )
765                     int alt8=2;
766                     int LA8_0 = input.LA(1);
767
768                     if ( (LA8_0==ID||LA8_0==LPAREN||LA8_0==LBRACKET||LA8_0==LCURLY||LA8_0==INT||LA8_0==FLOAT||(LA8_0>=STRING && LA8_0<=URI)||LA8_0==65||(LA8_0>=75 && LA8_0<=76)||(LA8_0>=79 && LA8_0<=80)) ) {
769                         alt8=1;
770                     }
771                     else if ( (LA8_0==INDENT) ) {
772                         alt8=2;
773                     }
774                     else {
775                         if (state.backtracking>0) {state.failed=true; return retval;}
776                         NoViableAltException nvae =
777                             new NoViableAltException("", 8, 0, input);
778
779                         throw nvae;
780                     }
781                     switch (alt8) {
782                         case 1 :
783                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:245:9: resourceDefinition
784                             {
785                             pushFollow(FOLLOW_resourceDefinition_in_property1444);
786                             resourceDefinition18=resourceDefinition();
787
788                             state._fsp--;
789                             if (state.failed) return retval;
790                             if ( state.backtracking==0 ) stream_resourceDefinition.add(resourceDefinition18.getTree());
791
792
793                             // AST REWRITE
794                             // elements: relation, resourceDefinition
795                             // token labels: 
796                             // rule labels: retval
797                             // token list labels: 
798                             // rule list labels: 
799                             // wildcard labels: 
800                             if ( state.backtracking==0 ) {
801                             retval.tree = root_0;
802                             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
803
804                             root_0 = (CommonTree)adaptor.nil();
805                             // 245:28: -> ^( PROPERTY relation resourceDefinition )
806                             {
807                                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:245:31: ^( PROPERTY relation resourceDefinition )
808                                 {
809                                 CommonTree root_1 = (CommonTree)adaptor.nil();
810                                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PROPERTY, "PROPERTY"), root_1);
811
812                                 adaptor.addChild(root_1, stream_relation.nextTree());
813                                 adaptor.addChild(root_1, stream_resourceDefinition.nextTree());
814
815                                 adaptor.addChild(root_0, root_1);
816                                 }
817
818                             }
819
820                             retval.tree = root_0;}
821                             }
822                             break;
823                         case 2 :
824                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:246:9: INDENT resourceDefinitions DEDENT
825                             {
826                             INDENT19=(Token)match(input,INDENT,FOLLOW_INDENT_in_property1464); if (state.failed) return retval; 
827                             if ( state.backtracking==0 ) stream_INDENT.add(INDENT19);
828
829                             pushFollow(FOLLOW_resourceDefinitions_in_property1466);
830                             resourceDefinitions20=resourceDefinitions();
831
832                             state._fsp--;
833                             if (state.failed) return retval;
834                             if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions20.getTree());
835                             DEDENT21=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_property1468); if (state.failed) return retval; 
836                             if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT21);
837
838
839
840                             // AST REWRITE
841                             // elements: relation, resourceDefinitions
842                             // token labels: 
843                             // rule labels: retval
844                             // token list labels: 
845                             // rule list labels: 
846                             // wildcard labels: 
847                             if ( state.backtracking==0 ) {
848                             retval.tree = root_0;
849                             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
850
851                             root_0 = (CommonTree)adaptor.nil();
852                             // 246:43: -> ^( PROPERTY relation resourceDefinitions )
853                             {
854                                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:246:46: ^( PROPERTY relation resourceDefinitions )
855                                 {
856                                 CommonTree root_1 = (CommonTree)adaptor.nil();
857                                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PROPERTY, "PROPERTY"), root_1);
858
859                                 adaptor.addChild(root_1, stream_relation.nextTree());
860                                 adaptor.addChild(root_1, stream_resourceDefinitions.nextTree());
861
862                                 adaptor.addChild(root_0, root_1);
863                                 }
864
865                             }
866
867                             retval.tree = root_0;}
868                             }
869                             break;
870
871                     }
872
873
874                     }
875                     break;
876                 case 2 :
877                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:248:7: template
878                     {
879                     root_0 = (CommonTree)adaptor.nil();
880
881                     pushFollow(FOLLOW_template_in_property1494);
882                     template22=template();
883
884                     state._fsp--;
885                     if (state.failed) return retval;
886                     if ( state.backtracking==0 ) adaptor.addChild(root_0, template22.getTree());
887
888                     }
889                     break;
890
891             }
892             retval.stop = input.LT(-1);
893
894             if ( state.backtracking==0 ) {
895
896             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
897             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
898             }
899         }
900         catch (RecognitionException re) {
901             reportError(re);
902             recover(input,re);
903         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
904
905         }
906         finally {
907         }
908         return retval;
909     }
910     // $ANTLR end "property"
911
912     public static class template_return extends ParserRuleReturnScope {
913         CommonTree tree;
914         public Object getTree() { return tree; }
915     };
916
917     // $ANTLR start "template"
918     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:251:1: template : '@' ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) ) ;
919     public final GraphParser.template_return template() throws RecognitionException {
920         GraphParser.template_return retval = new GraphParser.template_return();
921         retval.start = input.LT(1);
922
923         CommonTree root_0 = null;
924
925         Token char_literal23=null;
926         Token ID24=null;
927         Token INDENT26=null;
928         Token DEDENT28=null;
929         Token INDENT30=null;
930         Token DEDENT32=null;
931         GraphParser.resource_return resource25 = null;
932
933         GraphParser.resourceDefinitions_return resourceDefinitions27 = null;
934
935         GraphParser.resource_return resource29 = null;
936
937         GraphParser.resourceDefinitions_return resourceDefinitions31 = null;
938
939
940         CommonTree char_literal23_tree=null;
941         CommonTree ID24_tree=null;
942         CommonTree INDENT26_tree=null;
943         CommonTree DEDENT28_tree=null;
944         CommonTree INDENT30_tree=null;
945         CommonTree DEDENT32_tree=null;
946         RewriteRuleTokenStream stream_DEDENT=new RewriteRuleTokenStream(adaptor,"token DEDENT");
947         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
948         RewriteRuleTokenStream stream_65=new RewriteRuleTokenStream(adaptor,"token 65");
949         RewriteRuleTokenStream stream_INDENT=new RewriteRuleTokenStream(adaptor,"token INDENT");
950         RewriteRuleSubtreeStream stream_resource=new RewriteRuleSubtreeStream(adaptor,"rule resource");
951         RewriteRuleSubtreeStream stream_resourceDefinitions=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinitions");
952         try {
953             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:252:5: ( '@' ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) ) )
954             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:252:7: '@' ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) )
955             {
956             char_literal23=(Token)match(input,65,FOLLOW_65_in_template1515); if (state.failed) return retval; 
957             if ( state.backtracking==0 ) stream_65.add(char_literal23);
958
959             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:253:5: ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) )
960             int alt13=2;
961             alt13 = dfa13.predict(input);
962             switch (alt13) {
963                 case 1 :
964                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:253:7: {...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT
965                     {
966                     if ( !((input.LT(1).getText().equals("template"))) ) {
967                         if (state.backtracking>0) {state.failed=true; return retval;}
968                         throw new FailedPredicateException(input, "template", "input.LT(1).getText().equals(\"template\")");
969                     }
970                     ID24=(Token)match(input,ID,FOLLOW_ID_in_template1533); if (state.failed) return retval; 
971                     if ( state.backtracking==0 ) stream_ID.add(ID24);
972
973                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:254:10: ( resource )+
974                     int cnt10=0;
975                     loop10:
976                     do {
977                         int alt10=2;
978                         int LA10_0 = input.LA(1);
979
980                         if ( (LA10_0==ID||LA10_0==LPAREN||LA10_0==LBRACKET||LA10_0==LCURLY||LA10_0==INT||LA10_0==FLOAT||(LA10_0>=STRING && LA10_0<=URI)||(LA10_0>=75 && LA10_0<=76)||(LA10_0>=79 && LA10_0<=80)) ) {
981                             alt10=1;
982                         }
983
984
985                         switch (alt10) {
986                         case 1 :
987                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:254:10: resource
988                             {
989                             pushFollow(FOLLOW_resource_in_template1535);
990                             resource25=resource();
991
992                             state._fsp--;
993                             if (state.failed) return retval;
994                             if ( state.backtracking==0 ) stream_resource.add(resource25.getTree());
995
996                             }
997                             break;
998
999                         default :
1000                             if ( cnt10 >= 1 ) break loop10;
1001                             if (state.backtracking>0) {state.failed=true; return retval;}
1002                                 EarlyExitException eee =
1003                                     new EarlyExitException(10, input);
1004                                 throw eee;
1005                         }
1006                         cnt10++;
1007                     } while (true);
1008
1009                     INDENT26=(Token)match(input,INDENT,FOLLOW_INDENT_in_template1545); if (state.failed) return retval; 
1010                     if ( state.backtracking==0 ) stream_INDENT.add(INDENT26);
1011
1012                     pushFollow(FOLLOW_resourceDefinitions_in_template1547);
1013                     resourceDefinitions27=resourceDefinitions();
1014
1015                     state._fsp--;
1016                     if (state.failed) return retval;
1017                     if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions27.getTree());
1018                     DEDENT28=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_template1549); if (state.failed) return retval; 
1019                     if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT28);
1020
1021
1022
1023                     // AST REWRITE
1024                     // elements: resourceDefinitions, resource
1025                     // token labels: 
1026                     // rule labels: retval
1027                     // token list labels: 
1028                     // rule list labels: 
1029                     // wildcard labels: 
1030                     if ( state.backtracking==0 ) {
1031                     retval.tree = root_0;
1032                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1033
1034                     root_0 = (CommonTree)adaptor.nil();
1035                     // 256:7: -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions )
1036                     {
1037                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:256:10: ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions )
1038                         {
1039                         CommonTree root_1 = (CommonTree)adaptor.nil();
1040                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TEMPLATE_DEFINITION, "TEMPLATE_DEFINITION"), root_1);
1041
1042                         if ( !(stream_resource.hasNext()) ) {
1043                             throw new RewriteEarlyExitException();
1044                         }
1045                         while ( stream_resource.hasNext() ) {
1046                             adaptor.addChild(root_1, stream_resource.nextTree());
1047
1048                         }
1049                         stream_resource.reset();
1050                         adaptor.addChild(root_1, stream_resourceDefinitions.nextTree());
1051
1052                         adaptor.addChild(root_0, root_1);
1053                         }
1054
1055                     }
1056
1057                     retval.tree = root_0;}
1058                     }
1059                     break;
1060                 case 2 :
1061                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:257:7: ( resource )+ ( INDENT resourceDefinitions DEDENT )?
1062                     {
1063                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:257:7: ( resource )+
1064                     int cnt11=0;
1065                     loop11:
1066                     do {
1067                         int alt11=2;
1068                         int LA11_0 = input.LA(1);
1069
1070                         if ( (LA11_0==ID||LA11_0==LPAREN||LA11_0==LBRACKET||LA11_0==LCURLY||LA11_0==INT||LA11_0==FLOAT||(LA11_0>=STRING && LA11_0<=URI)||(LA11_0>=75 && LA11_0<=76)||(LA11_0>=79 && LA11_0<=80)) ) {
1071                             alt11=1;
1072                         }
1073
1074
1075                         switch (alt11) {
1076                         case 1 :
1077                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:257:7: resource
1078                             {
1079                             pushFollow(FOLLOW_resource_in_template1574);
1080                             resource29=resource();
1081
1082                             state._fsp--;
1083                             if (state.failed) return retval;
1084                             if ( state.backtracking==0 ) stream_resource.add(resource29.getTree());
1085
1086                             }
1087                             break;
1088
1089                         default :
1090                             if ( cnt11 >= 1 ) break loop11;
1091                             if (state.backtracking>0) {state.failed=true; return retval;}
1092                                 EarlyExitException eee =
1093                                     new EarlyExitException(11, input);
1094                                 throw eee;
1095                         }
1096                         cnt11++;
1097                     } while (true);
1098
1099                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:258:7: ( INDENT resourceDefinitions DEDENT )?
1100                     int alt12=2;
1101                     int LA12_0 = input.LA(1);
1102
1103                     if ( (LA12_0==INDENT) ) {
1104                         alt12=1;
1105                     }
1106                     switch (alt12) {
1107                         case 1 :
1108                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:258:8: INDENT resourceDefinitions DEDENT
1109                             {
1110                             INDENT30=(Token)match(input,INDENT,FOLLOW_INDENT_in_template1585); if (state.failed) return retval; 
1111                             if ( state.backtracking==0 ) stream_INDENT.add(INDENT30);
1112
1113                             pushFollow(FOLLOW_resourceDefinitions_in_template1587);
1114                             resourceDefinitions31=resourceDefinitions();
1115
1116                             state._fsp--;
1117                             if (state.failed) return retval;
1118                             if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions31.getTree());
1119                             DEDENT32=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_template1589); if (state.failed) return retval; 
1120                             if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT32);
1121
1122
1123                             }
1124                             break;
1125
1126                     }
1127
1128
1129
1130                     // AST REWRITE
1131                     // elements: resource, resourceDefinitions
1132                     // token labels: 
1133                     // rule labels: retval
1134                     // token list labels: 
1135                     // rule list labels: 
1136                     // wildcard labels: 
1137                     if ( state.backtracking==0 ) {
1138                     retval.tree = root_0;
1139                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1140
1141                     root_0 = (CommonTree)adaptor.nil();
1142                     // 259:7: -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? )
1143                     {
1144                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:259:10: ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? )
1145                         {
1146                         CommonTree root_1 = (CommonTree)adaptor.nil();
1147                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TEMPLATE_INSTANCE, "TEMPLATE_INSTANCE"), root_1);
1148
1149                         if ( !(stream_resource.hasNext()) ) {
1150                             throw new RewriteEarlyExitException();
1151                         }
1152                         while ( stream_resource.hasNext() ) {
1153                             adaptor.addChild(root_1, stream_resource.nextTree());
1154
1155                         }
1156                         stream_resource.reset();
1157                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:259:40: ( resourceDefinitions )?
1158                         if ( stream_resourceDefinitions.hasNext() ) {
1159                             adaptor.addChild(root_1, stream_resourceDefinitions.nextTree());
1160
1161                         }
1162                         stream_resourceDefinitions.reset();
1163
1164                         adaptor.addChild(root_0, root_1);
1165                         }
1166
1167                     }
1168
1169                     retval.tree = root_0;}
1170                     }
1171                     break;
1172
1173             }
1174
1175
1176             }
1177
1178             retval.stop = input.LT(-1);
1179
1180             if ( state.backtracking==0 ) {
1181
1182             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
1183             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
1184             }
1185         }
1186         catch (RecognitionException re) {
1187             reportError(re);
1188             recover(input,re);
1189         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
1190
1191         }
1192         finally {
1193         }
1194         return retval;
1195     }
1196     // $ANTLR end "template"
1197
1198     public static class relation_return extends ParserRuleReturnScope {
1199         CommonTree tree;
1200         public Object getTree() { return tree; }
1201     };
1202
1203     // $ANTLR start "relation"
1204     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:267:1: relation : ( ( ID -> ID ) ( '.' ID -> ^( REF $relation ID ) )* | URI | '<T' -> INHERITS | '<R' -> SUBRELATION_OF | '<--' -> HAS_DOMAIN | '-->' -> HAS_RANGE | '==>' -> REQUIRES_VALUE_TYPE | '>--' -> DOMAIN_OF | ':' -> INSTANCE_OF | '=' -> EQUALS | '%' ID -> ^( VARIABLE ID ) );
1205     public final GraphParser.relation_return relation() throws RecognitionException {
1206         GraphParser.relation_return retval = new GraphParser.relation_return();
1207         retval.start = input.LT(1);
1208
1209         CommonTree root_0 = null;
1210
1211         Token ID33=null;
1212         Token char_literal34=null;
1213         Token ID35=null;
1214         Token URI36=null;
1215         Token string_literal37=null;
1216         Token string_literal38=null;
1217         Token string_literal39=null;
1218         Token string_literal40=null;
1219         Token string_literal41=null;
1220         Token string_literal42=null;
1221         Token char_literal43=null;
1222         Token char_literal44=null;
1223         Token char_literal45=null;
1224         Token ID46=null;
1225
1226         CommonTree ID33_tree=null;
1227         CommonTree char_literal34_tree=null;
1228         CommonTree ID35_tree=null;
1229         CommonTree URI36_tree=null;
1230         CommonTree string_literal37_tree=null;
1231         CommonTree string_literal38_tree=null;
1232         CommonTree string_literal39_tree=null;
1233         CommonTree string_literal40_tree=null;
1234         CommonTree string_literal41_tree=null;
1235         CommonTree string_literal42_tree=null;
1236         CommonTree char_literal43_tree=null;
1237         CommonTree char_literal44_tree=null;
1238         CommonTree char_literal45_tree=null;
1239         CommonTree ID46_tree=null;
1240         RewriteRuleTokenStream stream_67=new RewriteRuleTokenStream(adaptor,"token 67");
1241         RewriteRuleTokenStream stream_66=new RewriteRuleTokenStream(adaptor,"token 66");
1242         RewriteRuleTokenStream stream_69=new RewriteRuleTokenStream(adaptor,"token 69");
1243         RewriteRuleTokenStream stream_68=new RewriteRuleTokenStream(adaptor,"token 68");
1244         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
1245         RewriteRuleTokenStream stream_70=new RewriteRuleTokenStream(adaptor,"token 70");
1246         RewriteRuleTokenStream stream_71=new RewriteRuleTokenStream(adaptor,"token 71");
1247         RewriteRuleTokenStream stream_72=new RewriteRuleTokenStream(adaptor,"token 72");
1248         RewriteRuleTokenStream stream_73=new RewriteRuleTokenStream(adaptor,"token 73");
1249         RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74");
1250         RewriteRuleTokenStream stream_75=new RewriteRuleTokenStream(adaptor,"token 75");
1251
1252         try {
1253             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:268:5: ( ( ID -> ID ) ( '.' ID -> ^( REF $relation ID ) )* | URI | '<T' -> INHERITS | '<R' -> SUBRELATION_OF | '<--' -> HAS_DOMAIN | '-->' -> HAS_RANGE | '==>' -> REQUIRES_VALUE_TYPE | '>--' -> DOMAIN_OF | ':' -> INSTANCE_OF | '=' -> EQUALS | '%' ID -> ^( VARIABLE ID ) )
1254             int alt15=11;
1255             switch ( input.LA(1) ) {
1256             case ID:
1257                 {
1258                 alt15=1;
1259                 }
1260                 break;
1261             case URI:
1262                 {
1263                 alt15=2;
1264                 }
1265                 break;
1266             case 67:
1267                 {
1268                 alt15=3;
1269                 }
1270                 break;
1271             case 68:
1272                 {
1273                 alt15=4;
1274                 }
1275                 break;
1276             case 69:
1277                 {
1278                 alt15=5;
1279                 }
1280                 break;
1281             case 70:
1282                 {
1283                 alt15=6;
1284                 }
1285                 break;
1286             case 71:
1287                 {
1288                 alt15=7;
1289                 }
1290                 break;
1291             case 72:
1292                 {
1293                 alt15=8;
1294                 }
1295                 break;
1296             case 73:
1297                 {
1298                 alt15=9;
1299                 }
1300                 break;
1301             case 74:
1302                 {
1303                 alt15=10;
1304                 }
1305                 break;
1306             case 75:
1307                 {
1308                 alt15=11;
1309                 }
1310                 break;
1311             default:
1312                 if (state.backtracking>0) {state.failed=true; return retval;}
1313                 NoViableAltException nvae =
1314                     new NoViableAltException("", 15, 0, input);
1315
1316                 throw nvae;
1317             }
1318
1319             switch (alt15) {
1320                 case 1 :
1321                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:268:7: ( ID -> ID ) ( '.' ID -> ^( REF $relation ID ) )*
1322                     {
1323                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:268:7: ( ID -> ID )
1324                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:268:9: ID
1325                     {
1326                     ID33=(Token)match(input,ID,FOLLOW_ID_in_relation1643); if (state.failed) return retval; 
1327                     if ( state.backtracking==0 ) stream_ID.add(ID33);
1328
1329
1330
1331                     // AST REWRITE
1332                     // elements: ID
1333                     // token labels: 
1334                     // rule labels: retval
1335                     // token list labels: 
1336                     // rule list labels: 
1337                     // wildcard labels: 
1338                     if ( state.backtracking==0 ) {
1339                     retval.tree = root_0;
1340                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1341
1342                     root_0 = (CommonTree)adaptor.nil();
1343                     // 268:12: -> ID
1344                     {
1345                         adaptor.addChild(root_0, stream_ID.nextNode());
1346
1347                     }
1348
1349                     retval.tree = root_0;}
1350                     }
1351
1352                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:269:7: ( '.' ID -> ^( REF $relation ID ) )*
1353                     loop14:
1354                     do {
1355                         int alt14=2;
1356                         int LA14_0 = input.LA(1);
1357
1358                         if ( (LA14_0==66) ) {
1359                             alt14=1;
1360                         }
1361
1362
1363                         switch (alt14) {
1364                         case 1 :
1365                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:269:8: '.' ID
1366                             {
1367                             char_literal34=(Token)match(input,66,FOLLOW_66_in_relation1658); if (state.failed) return retval; 
1368                             if ( state.backtracking==0 ) stream_66.add(char_literal34);
1369
1370                             ID35=(Token)match(input,ID,FOLLOW_ID_in_relation1660); if (state.failed) return retval; 
1371                             if ( state.backtracking==0 ) stream_ID.add(ID35);
1372
1373
1374
1375                             // AST REWRITE
1376                             // elements: ID, relation
1377                             // token labels: 
1378                             // rule labels: retval
1379                             // token list labels: 
1380                             // rule list labels: 
1381                             // wildcard labels: 
1382                             if ( state.backtracking==0 ) {
1383                             retval.tree = root_0;
1384                             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1385
1386                             root_0 = (CommonTree)adaptor.nil();
1387                             // 269:15: -> ^( REF $relation ID )
1388                             {
1389                                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:269:18: ^( REF $relation ID )
1390                                 {
1391                                 CommonTree root_1 = (CommonTree)adaptor.nil();
1392                                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REF, "REF"), root_1);
1393
1394                                 adaptor.addChild(root_1, stream_retval.nextTree());
1395                                 adaptor.addChild(root_1, stream_ID.nextNode());
1396
1397                                 adaptor.addChild(root_0, root_1);
1398                                 }
1399
1400                             }
1401
1402                             retval.tree = root_0;}
1403                             }
1404                             break;
1405
1406                         default :
1407                             break loop14;
1408                         }
1409                     } while (true);
1410
1411
1412                     }
1413                     break;
1414                 case 2 :
1415                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:270:7: URI
1416                     {
1417                     root_0 = (CommonTree)adaptor.nil();
1418
1419                     URI36=(Token)match(input,URI,FOLLOW_URI_in_relation1681); if (state.failed) return retval;
1420                     if ( state.backtracking==0 ) {
1421                     URI36_tree = (CommonTree)adaptor.create(URI36);
1422                     adaptor.addChild(root_0, URI36_tree);
1423                     }
1424
1425                     }
1426                     break;
1427                 case 3 :
1428                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:271:7: '<T'
1429                     {
1430                     string_literal37=(Token)match(input,67,FOLLOW_67_in_relation1689); if (state.failed) return retval; 
1431                     if ( state.backtracking==0 ) stream_67.add(string_literal37);
1432
1433
1434
1435                     // AST REWRITE
1436                     // elements: 
1437                     // token labels: 
1438                     // rule labels: retval
1439                     // token list labels: 
1440                     // rule list labels: 
1441                     // wildcard labels: 
1442                     if ( state.backtracking==0 ) {
1443                     retval.tree = root_0;
1444                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1445
1446                     root_0 = (CommonTree)adaptor.nil();
1447                     // 271:12: -> INHERITS
1448                     {
1449                         adaptor.addChild(root_0, (CommonTree)adaptor.create(INHERITS, "INHERITS"));
1450
1451                     }
1452
1453                     retval.tree = root_0;}
1454                     }
1455                     break;
1456                 case 4 :
1457                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:272:7: '<R'
1458                     {
1459                     string_literal38=(Token)match(input,68,FOLLOW_68_in_relation1701); if (state.failed) return retval; 
1460                     if ( state.backtracking==0 ) stream_68.add(string_literal38);
1461
1462
1463
1464                     // AST REWRITE
1465                     // elements: 
1466                     // token labels: 
1467                     // rule labels: retval
1468                     // token list labels: 
1469                     // rule list labels: 
1470                     // wildcard labels: 
1471                     if ( state.backtracking==0 ) {
1472                     retval.tree = root_0;
1473                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1474
1475                     root_0 = (CommonTree)adaptor.nil();
1476                     // 272:12: -> SUBRELATION_OF
1477                     {
1478                         adaptor.addChild(root_0, (CommonTree)adaptor.create(SUBRELATION_OF, "SUBRELATION_OF"));
1479
1480                     }
1481
1482                     retval.tree = root_0;}
1483                     }
1484                     break;
1485                 case 5 :
1486                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:273:7: '<--'
1487                     {
1488                     string_literal39=(Token)match(input,69,FOLLOW_69_in_relation1713); if (state.failed) return retval; 
1489                     if ( state.backtracking==0 ) stream_69.add(string_literal39);
1490
1491
1492
1493                     // AST REWRITE
1494                     // elements: 
1495                     // token labels: 
1496                     // rule labels: retval
1497                     // token list labels: 
1498                     // rule list labels: 
1499                     // wildcard labels: 
1500                     if ( state.backtracking==0 ) {
1501                     retval.tree = root_0;
1502                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1503
1504                     root_0 = (CommonTree)adaptor.nil();
1505                     // 273:13: -> HAS_DOMAIN
1506                     {
1507                         adaptor.addChild(root_0, (CommonTree)adaptor.create(HAS_DOMAIN, "HAS_DOMAIN"));
1508
1509                     }
1510
1511                     retval.tree = root_0;}
1512                     }
1513                     break;
1514                 case 6 :
1515                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:274:7: '-->'
1516                     {
1517                     string_literal40=(Token)match(input,70,FOLLOW_70_in_relation1725); if (state.failed) return retval; 
1518                     if ( state.backtracking==0 ) stream_70.add(string_literal40);
1519
1520
1521
1522                     // AST REWRITE
1523                     // elements: 
1524                     // token labels: 
1525                     // rule labels: retval
1526                     // token list labels: 
1527                     // rule list labels: 
1528                     // wildcard labels: 
1529                     if ( state.backtracking==0 ) {
1530                     retval.tree = root_0;
1531                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1532
1533                     root_0 = (CommonTree)adaptor.nil();
1534                     // 274:13: -> HAS_RANGE
1535                     {
1536                         adaptor.addChild(root_0, (CommonTree)adaptor.create(HAS_RANGE, "HAS_RANGE"));
1537
1538                     }
1539
1540                     retval.tree = root_0;}
1541                     }
1542                     break;
1543                 case 7 :
1544                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:275:7: '==>'
1545                     {
1546                     string_literal41=(Token)match(input,71,FOLLOW_71_in_relation1737); if (state.failed) return retval; 
1547                     if ( state.backtracking==0 ) stream_71.add(string_literal41);
1548
1549
1550
1551                     // AST REWRITE
1552                     // elements: 
1553                     // token labels: 
1554                     // rule labels: retval
1555                     // token list labels: 
1556                     // rule list labels: 
1557                     // wildcard labels: 
1558                     if ( state.backtracking==0 ) {
1559                     retval.tree = root_0;
1560                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1561
1562                     root_0 = (CommonTree)adaptor.nil();
1563                     // 275:13: -> REQUIRES_VALUE_TYPE
1564                     {
1565                         adaptor.addChild(root_0, (CommonTree)adaptor.create(REQUIRES_VALUE_TYPE, "REQUIRES_VALUE_TYPE"));
1566
1567                     }
1568
1569                     retval.tree = root_0;}
1570                     }
1571                     break;
1572                 case 8 :
1573                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:276:7: '>--'
1574                     {
1575                     string_literal42=(Token)match(input,72,FOLLOW_72_in_relation1749); if (state.failed) return retval; 
1576                     if ( state.backtracking==0 ) stream_72.add(string_literal42);
1577
1578
1579
1580                     // AST REWRITE
1581                     // elements: 
1582                     // token labels: 
1583                     // rule labels: retval
1584                     // token list labels: 
1585                     // rule list labels: 
1586                     // wildcard labels: 
1587                     if ( state.backtracking==0 ) {
1588                     retval.tree = root_0;
1589                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1590
1591                     root_0 = (CommonTree)adaptor.nil();
1592                     // 276:13: -> DOMAIN_OF
1593                     {
1594                         adaptor.addChild(root_0, (CommonTree)adaptor.create(DOMAIN_OF, "DOMAIN_OF"));
1595
1596                     }
1597
1598                     retval.tree = root_0;}
1599                     }
1600                     break;
1601                 case 9 :
1602                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:277:7: ':'
1603                     {
1604                     char_literal43=(Token)match(input,73,FOLLOW_73_in_relation1765); if (state.failed) return retval; 
1605                     if ( state.backtracking==0 ) stream_73.add(char_literal43);
1606
1607
1608
1609                     // AST REWRITE
1610                     // elements: 
1611                     // token labels: 
1612                     // rule labels: retval
1613                     // token list labels: 
1614                     // rule list labels: 
1615                     // wildcard labels: 
1616                     if ( state.backtracking==0 ) {
1617                     retval.tree = root_0;
1618                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1619
1620                     root_0 = (CommonTree)adaptor.nil();
1621                     // 277:11: -> INSTANCE_OF
1622                     {
1623                         adaptor.addChild(root_0, (CommonTree)adaptor.create(INSTANCE_OF, "INSTANCE_OF"));
1624
1625                     }
1626
1627                     retval.tree = root_0;}
1628                     }
1629                     break;
1630                 case 10 :
1631                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:278:7: '='
1632                     {
1633                     char_literal44=(Token)match(input,74,FOLLOW_74_in_relation1777); if (state.failed) return retval; 
1634                     if ( state.backtracking==0 ) stream_74.add(char_literal44);
1635
1636
1637
1638                     // AST REWRITE
1639                     // elements: 
1640                     // token labels: 
1641                     // rule labels: retval
1642                     // token list labels: 
1643                     // rule list labels: 
1644                     // wildcard labels: 
1645                     if ( state.backtracking==0 ) {
1646                     retval.tree = root_0;
1647                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1648
1649                     root_0 = (CommonTree)adaptor.nil();
1650                     // 278:11: -> EQUALS
1651                     {
1652                         adaptor.addChild(root_0, (CommonTree)adaptor.create(EQUALS, "EQUALS"));
1653
1654                     }
1655
1656                     retval.tree = root_0;}
1657                     }
1658                     break;
1659                 case 11 :
1660                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:279:7: '%' ID
1661                     {
1662                     char_literal45=(Token)match(input,75,FOLLOW_75_in_relation1789); if (state.failed) return retval; 
1663                     if ( state.backtracking==0 ) stream_75.add(char_literal45);
1664
1665                     ID46=(Token)match(input,ID,FOLLOW_ID_in_relation1791); if (state.failed) return retval; 
1666                     if ( state.backtracking==0 ) stream_ID.add(ID46);
1667
1668
1669
1670                     // AST REWRITE
1671                     // elements: ID
1672                     // token labels: 
1673                     // rule labels: retval
1674                     // token list labels: 
1675                     // rule list labels: 
1676                     // wildcard labels: 
1677                     if ( state.backtracking==0 ) {
1678                     retval.tree = root_0;
1679                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1680
1681                     root_0 = (CommonTree)adaptor.nil();
1682                     // 279:14: -> ^( VARIABLE ID )
1683                     {
1684                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:279:17: ^( VARIABLE ID )
1685                         {
1686                         CommonTree root_1 = (CommonTree)adaptor.nil();
1687                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIABLE, "VARIABLE"), root_1);
1688
1689                         adaptor.addChild(root_1, stream_ID.nextNode());
1690
1691                         adaptor.addChild(root_0, root_1);
1692                         }
1693
1694                     }
1695
1696                     retval.tree = root_0;}
1697                     }
1698                     break;
1699
1700             }
1701             retval.stop = input.LT(-1);
1702
1703             if ( state.backtracking==0 ) {
1704
1705             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
1706             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
1707             }
1708         }
1709         catch (RecognitionException re) {
1710             reportError(re);
1711             recover(input,re);
1712         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
1713
1714         }
1715         finally {
1716         }
1717         return retval;
1718     }
1719     // $ANTLR end "relation"
1720
1721     public static class resource_return extends ParserRuleReturnScope {
1722         CommonTree tree;
1723         public Object getTree() { return tree; }
1724     };
1725
1726     // $ANTLR start "resource"
1727     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:282:1: resource : ( ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )* | URI | simpleValue -> ^( EMBEDDED_VALUE simpleValue ) | '$' basicType -> ^( EMBEDDED_TYPE basicType ) | '%' ID -> ^( VARIABLE ID ) );
1728     public final GraphParser.resource_return resource() throws RecognitionException {
1729         GraphParser.resource_return retval = new GraphParser.resource_return();
1730         retval.start = input.LT(1);
1731
1732         CommonTree root_0 = null;
1733
1734         Token ID47=null;
1735         Token ID48=null;
1736         Token char_literal49=null;
1737         Token ID50=null;
1738         Token STRING51=null;
1739         Token URI52=null;
1740         Token char_literal54=null;
1741         Token char_literal56=null;
1742         Token ID57=null;
1743         GraphParser.simpleValue_return simpleValue53 = null;
1744
1745         GraphParser.basicType_return basicType55 = null;
1746
1747
1748         CommonTree ID47_tree=null;
1749         CommonTree ID48_tree=null;
1750         CommonTree char_literal49_tree=null;
1751         CommonTree ID50_tree=null;
1752         CommonTree STRING51_tree=null;
1753         CommonTree URI52_tree=null;
1754         CommonTree char_literal54_tree=null;
1755         CommonTree char_literal56_tree=null;
1756         CommonTree ID57_tree=null;
1757         RewriteRuleTokenStream stream_66=new RewriteRuleTokenStream(adaptor,"token 66");
1758         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
1759         RewriteRuleTokenStream stream_75=new RewriteRuleTokenStream(adaptor,"token 75");
1760         RewriteRuleTokenStream stream_STRING=new RewriteRuleTokenStream(adaptor,"token STRING");
1761         RewriteRuleTokenStream stream_76=new RewriteRuleTokenStream(adaptor,"token 76");
1762         RewriteRuleSubtreeStream stream_basicType=new RewriteRuleSubtreeStream(adaptor,"rule basicType");
1763         RewriteRuleSubtreeStream stream_simpleValue=new RewriteRuleSubtreeStream(adaptor,"rule simpleValue");
1764         try {
1765             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:283:5: ( ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )* | URI | simpleValue -> ^( EMBEDDED_VALUE simpleValue ) | '$' basicType -> ^( EMBEDDED_TYPE basicType ) | '%' ID -> ^( VARIABLE ID ) )
1766             int alt19=5;
1767             switch ( input.LA(1) ) {
1768             case ID:
1769                 {
1770                 alt19=1;
1771                 }
1772                 break;
1773             case URI:
1774                 {
1775                 alt19=2;
1776                 }
1777                 break;
1778             case LPAREN:
1779             case LBRACKET:
1780             case LCURLY:
1781             case INT:
1782             case FLOAT:
1783             case STRING:
1784             case 79:
1785             case 80:
1786                 {
1787                 alt19=3;
1788                 }
1789                 break;
1790             case 76:
1791                 {
1792                 alt19=4;
1793                 }
1794                 break;
1795             case 75:
1796                 {
1797                 alt19=5;
1798                 }
1799                 break;
1800             default:
1801                 if (state.backtracking>0) {state.failed=true; return retval;}
1802                 NoViableAltException nvae =
1803                     new NoViableAltException("", 19, 0, input);
1804
1805                 throw nvae;
1806             }
1807
1808             switch (alt19) {
1809                 case 1 :
1810                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:283:7: ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )*
1811                     {
1812                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:283:7: ({...}? => ID -> ^( BLANK ID ) | ID -> ID )
1813                     int alt16=2;
1814                     int LA16_0 = input.LA(1);
1815
1816                     if ( (LA16_0==ID) ) {
1817                         int LA16_1 = input.LA(2);
1818
1819                         if ( ((input.LT(1).getText().equals("_"))) ) {
1820                             alt16=1;
1821                         }
1822                         else if ( (true) ) {
1823                             alt16=2;
1824                         }
1825                         else {
1826                             if (state.backtracking>0) {state.failed=true; return retval;}
1827                             NoViableAltException nvae =
1828                                 new NoViableAltException("", 16, 1, input);
1829
1830                             throw nvae;
1831                         }
1832                     }
1833                     else {
1834                         if (state.backtracking>0) {state.failed=true; return retval;}
1835                         NoViableAltException nvae =
1836                             new NoViableAltException("", 16, 0, input);
1837
1838                         throw nvae;
1839                     }
1840                     switch (alt16) {
1841                         case 1 :
1842                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:283:9: {...}? => ID
1843                             {
1844                             if ( !((input.LT(1).getText().equals("_"))) ) {
1845                                 if (state.backtracking>0) {state.failed=true; return retval;}
1846                                 throw new FailedPredicateException(input, "resource", "input.LT(1).getText().equals(\"_\")");
1847                             }
1848                             ID47=(Token)match(input,ID,FOLLOW_ID_in_resource1821); if (state.failed) return retval; 
1849                             if ( state.backtracking==0 ) stream_ID.add(ID47);
1850
1851
1852
1853                             // AST REWRITE
1854                             // elements: ID
1855                             // token labels: 
1856                             // rule labels: retval
1857                             // token list labels: 
1858                             // rule list labels: 
1859                             // wildcard labels: 
1860                             if ( state.backtracking==0 ) {
1861                             retval.tree = root_0;
1862                             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1863
1864                             root_0 = (CommonTree)adaptor.nil();
1865                             // 283:51: -> ^( BLANK ID )
1866                             {
1867                                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:283:54: ^( BLANK ID )
1868                                 {
1869                                 CommonTree root_1 = (CommonTree)adaptor.nil();
1870                                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(BLANK, "BLANK"), root_1);
1871
1872                                 adaptor.addChild(root_1, stream_ID.nextNode());
1873
1874                                 adaptor.addChild(root_0, root_1);
1875                                 }
1876
1877                             }
1878
1879                             retval.tree = root_0;}
1880                             }
1881                             break;
1882                         case 2 :
1883                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:284:9: ID
1884                             {
1885                             ID48=(Token)match(input,ID,FOLLOW_ID_in_resource1840); if (state.failed) return retval; 
1886                             if ( state.backtracking==0 ) stream_ID.add(ID48);
1887
1888
1889
1890                             // AST REWRITE
1891                             // elements: ID
1892                             // token labels: 
1893                             // rule labels: retval
1894                             // token list labels: 
1895                             // rule list labels: 
1896                             // wildcard labels: 
1897                             if ( state.backtracking==0 ) {
1898                             retval.tree = root_0;
1899                             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1900
1901                             root_0 = (CommonTree)adaptor.nil();
1902                             // 284:12: -> ID
1903                             {
1904                                 adaptor.addChild(root_0, stream_ID.nextNode());
1905
1906                             }
1907
1908                             retval.tree = root_0;}
1909                             }
1910                             break;
1911
1912                     }
1913
1914                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:285:7: ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )*
1915                     loop18:
1916                     do {
1917                         int alt18=2;
1918                         int LA18_0 = input.LA(1);
1919
1920                         if ( (LA18_0==66) ) {
1921                             alt18=1;
1922                         }
1923
1924
1925                         switch (alt18) {
1926                         case 1 :
1927                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:285:8: '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) )
1928                             {
1929                             char_literal49=(Token)match(input,66,FOLLOW_66_in_resource1855); if (state.failed) return retval; 
1930                             if ( state.backtracking==0 ) stream_66.add(char_literal49);
1931
1932                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:285:12: ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) )
1933                             int alt17=2;
1934                             int LA17_0 = input.LA(1);
1935
1936                             if ( (LA17_0==ID) ) {
1937                                 alt17=1;
1938                             }
1939                             else if ( (LA17_0==STRING) ) {
1940                                 alt17=2;
1941                             }
1942                             else {
1943                                 if (state.backtracking>0) {state.failed=true; return retval;}
1944                                 NoViableAltException nvae =
1945                                     new NoViableAltException("", 17, 0, input);
1946
1947                                 throw nvae;
1948                             }
1949                             switch (alt17) {
1950                                 case 1 :
1951                                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:285:13: ID
1952                                     {
1953                                     ID50=(Token)match(input,ID,FOLLOW_ID_in_resource1858); if (state.failed) return retval; 
1954                                     if ( state.backtracking==0 ) stream_ID.add(ID50);
1955
1956
1957
1958                                     // AST REWRITE
1959                                     // elements: ID, resource
1960                                     // token labels: 
1961                                     // rule labels: retval
1962                                     // token list labels: 
1963                                     // rule list labels: 
1964                                     // wildcard labels: 
1965                                     if ( state.backtracking==0 ) {
1966                                     retval.tree = root_0;
1967                                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1968
1969                                     root_0 = (CommonTree)adaptor.nil();
1970                                     // 285:16: -> ^( REF $resource ID )
1971                                     {
1972                                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:285:19: ^( REF $resource ID )
1973                                         {
1974                                         CommonTree root_1 = (CommonTree)adaptor.nil();
1975                                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REF, "REF"), root_1);
1976
1977                                         adaptor.addChild(root_1, stream_retval.nextTree());
1978                                         adaptor.addChild(root_1, stream_ID.nextNode());
1979
1980                                         adaptor.addChild(root_0, root_1);
1981                                         }
1982
1983                                     }
1984
1985                                     retval.tree = root_0;}
1986                                     }
1987                                     break;
1988                                 case 2 :
1989                                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:286:13: STRING
1990                                     {
1991                                     STRING51=(Token)match(input,STRING,FOLLOW_STRING_in_resource1883); if (state.failed) return retval; 
1992                                     if ( state.backtracking==0 ) stream_STRING.add(STRING51);
1993
1994
1995
1996                                     // AST REWRITE
1997                                     // elements: STRING, resource
1998                                     // token labels: 
1999                                     // rule labels: retval
2000                                     // token list labels: 
2001                                     // rule list labels: 
2002                                     // wildcard labels: 
2003                                     if ( state.backtracking==0 ) {
2004                                     retval.tree = root_0;
2005                                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2006
2007                                     root_0 = (CommonTree)adaptor.nil();
2008                                     // 286:20: -> ^( REF $resource STRING )
2009                                     {
2010                                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:286:23: ^( REF $resource STRING )
2011                                         {
2012                                         CommonTree root_1 = (CommonTree)adaptor.nil();
2013                                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REF, "REF"), root_1);
2014
2015                                         adaptor.addChild(root_1, stream_retval.nextTree());
2016                                         adaptor.addChild(root_1, stream_STRING.nextNode());
2017
2018                                         adaptor.addChild(root_0, root_1);
2019                                         }
2020
2021                                     }
2022
2023                                     retval.tree = root_0;}
2024                                     }
2025                                     break;
2026
2027                             }
2028
2029
2030                             }
2031                             break;
2032
2033                         default :
2034                             break loop18;
2035                         }
2036                     } while (true);
2037
2038
2039                     }
2040                     break;
2041                 case 2 :
2042                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:289:7: URI
2043                     {
2044                     root_0 = (CommonTree)adaptor.nil();
2045
2046                     URI52=(Token)match(input,URI,FOLLOW_URI_in_resource1924); if (state.failed) return retval;
2047                     if ( state.backtracking==0 ) {
2048                     URI52_tree = (CommonTree)adaptor.create(URI52);
2049                     adaptor.addChild(root_0, URI52_tree);
2050                     }
2051
2052                     }
2053                     break;
2054                 case 3 :
2055                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:290:7: simpleValue
2056                     {
2057                     pushFollow(FOLLOW_simpleValue_in_resource1932);
2058                     simpleValue53=simpleValue();
2059
2060                     state._fsp--;
2061                     if (state.failed) return retval;
2062                     if ( state.backtracking==0 ) stream_simpleValue.add(simpleValue53.getTree());
2063
2064
2065                     // AST REWRITE
2066                     // elements: simpleValue
2067                     // token labels: 
2068                     // rule labels: retval
2069                     // token list labels: 
2070                     // rule list labels: 
2071                     // wildcard labels: 
2072                     if ( state.backtracking==0 ) {
2073                     retval.tree = root_0;
2074                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2075
2076                     root_0 = (CommonTree)adaptor.nil();
2077                     // 290:19: -> ^( EMBEDDED_VALUE simpleValue )
2078                     {
2079                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:290:22: ^( EMBEDDED_VALUE simpleValue )
2080                         {
2081                         CommonTree root_1 = (CommonTree)adaptor.nil();
2082                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(EMBEDDED_VALUE, "EMBEDDED_VALUE"), root_1);
2083
2084                         adaptor.addChild(root_1, stream_simpleValue.nextTree());
2085
2086                         adaptor.addChild(root_0, root_1);
2087                         }
2088
2089                     }
2090
2091                     retval.tree = root_0;}
2092                     }
2093                     break;
2094                 case 4 :
2095                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:291:7: '$' basicType
2096                     {
2097                     char_literal54=(Token)match(input,76,FOLLOW_76_in_resource1948); if (state.failed) return retval; 
2098                     if ( state.backtracking==0 ) stream_76.add(char_literal54);
2099
2100                     pushFollow(FOLLOW_basicType_in_resource1950);
2101                     basicType55=basicType();
2102
2103                     state._fsp--;
2104                     if (state.failed) return retval;
2105                     if ( state.backtracking==0 ) stream_basicType.add(basicType55.getTree());
2106
2107
2108                     // AST REWRITE
2109                     // elements: basicType
2110                     // token labels: 
2111                     // rule labels: retval
2112                     // token list labels: 
2113                     // rule list labels: 
2114                     // wildcard labels: 
2115                     if ( state.backtracking==0 ) {
2116                     retval.tree = root_0;
2117                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2118
2119                     root_0 = (CommonTree)adaptor.nil();
2120                     // 291:21: -> ^( EMBEDDED_TYPE basicType )
2121                     {
2122                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:291:24: ^( EMBEDDED_TYPE basicType )
2123                         {
2124                         CommonTree root_1 = (CommonTree)adaptor.nil();
2125                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(EMBEDDED_TYPE, "EMBEDDED_TYPE"), root_1);
2126
2127                         adaptor.addChild(root_1, stream_basicType.nextTree());
2128
2129                         adaptor.addChild(root_0, root_1);
2130                         }
2131
2132                     }
2133
2134                     retval.tree = root_0;}
2135                     }
2136                     break;
2137                 case 5 :
2138                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:292:7: '%' ID
2139                     {
2140                     char_literal56=(Token)match(input,75,FOLLOW_75_in_resource1966); if (state.failed) return retval; 
2141                     if ( state.backtracking==0 ) stream_75.add(char_literal56);
2142
2143                     ID57=(Token)match(input,ID,FOLLOW_ID_in_resource1968); if (state.failed) return retval; 
2144                     if ( state.backtracking==0 ) stream_ID.add(ID57);
2145
2146
2147
2148                     // AST REWRITE
2149                     // elements: ID
2150                     // token labels: 
2151                     // rule labels: retval
2152                     // token list labels: 
2153                     // rule list labels: 
2154                     // wildcard labels: 
2155                     if ( state.backtracking==0 ) {
2156                     retval.tree = root_0;
2157                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2158
2159                     root_0 = (CommonTree)adaptor.nil();
2160                     // 292:14: -> ^( VARIABLE ID )
2161                     {
2162                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:292:17: ^( VARIABLE ID )
2163                         {
2164                         CommonTree root_1 = (CommonTree)adaptor.nil();
2165                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIABLE, "VARIABLE"), root_1);
2166
2167                         adaptor.addChild(root_1, stream_ID.nextNode());
2168
2169                         adaptor.addChild(root_0, root_1);
2170                         }
2171
2172                     }
2173
2174                     retval.tree = root_0;}
2175                     }
2176                     break;
2177
2178             }
2179             retval.stop = input.LT(-1);
2180
2181             if ( state.backtracking==0 ) {
2182
2183             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2184             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2185             }
2186         }
2187         catch (RecognitionException re) {
2188             reportError(re);
2189             recover(input,re);
2190         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
2191
2192         }
2193         finally {
2194         }
2195         return retval;
2196     }
2197     // $ANTLR end "resource"
2198
2199     public static class type_return extends ParserRuleReturnScope {
2200         CommonTree tree;
2201         public Object getTree() { return tree; }
2202     };
2203
2204     // $ANTLR start "type"
2205     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:306:1: type : ( arrayType | unionType );
2206     public final GraphParser.type_return type() throws RecognitionException {
2207         GraphParser.type_return retval = new GraphParser.type_return();
2208         retval.start = input.LT(1);
2209
2210         CommonTree root_0 = null;
2211
2212         GraphParser.arrayType_return arrayType58 = null;
2213
2214         GraphParser.unionType_return unionType59 = null;
2215
2216
2217
2218         try {
2219             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:307:5: ( arrayType | unionType )
2220             int alt20=2;
2221             int LA20_0 = input.LA(1);
2222
2223             if ( (LA20_0==ID||LA20_0==LPAREN||LA20_0==LCURLY) ) {
2224                 alt20=1;
2225             }
2226             else if ( (LA20_0==77) ) {
2227                 alt20=2;
2228             }
2229             else {
2230                 if (state.backtracking>0) {state.failed=true; return retval;}
2231                 NoViableAltException nvae =
2232                     new NoViableAltException("", 20, 0, input);
2233
2234                 throw nvae;
2235             }
2236             switch (alt20) {
2237                 case 1 :
2238                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:307:7: arrayType
2239                     {
2240                     root_0 = (CommonTree)adaptor.nil();
2241
2242                     pushFollow(FOLLOW_arrayType_in_type2004);
2243                     arrayType58=arrayType();
2244
2245                     state._fsp--;
2246                     if (state.failed) return retval;
2247                     if ( state.backtracking==0 ) adaptor.addChild(root_0, arrayType58.getTree());
2248
2249                     }
2250                     break;
2251                 case 2 :
2252                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:308:7: unionType
2253                     {
2254                     root_0 = (CommonTree)adaptor.nil();
2255
2256                     pushFollow(FOLLOW_unionType_in_type2012);
2257                     unionType59=unionType();
2258
2259                     state._fsp--;
2260                     if (state.failed) return retval;
2261                     if ( state.backtracking==0 ) adaptor.addChild(root_0, unionType59.getTree());
2262
2263                     }
2264                     break;
2265
2266             }
2267             retval.stop = input.LT(-1);
2268
2269             if ( state.backtracking==0 ) {
2270
2271             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2272             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2273             }
2274         }
2275         catch (RecognitionException re) {
2276             reportError(re);
2277             recover(input,re);
2278         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
2279
2280         }
2281         finally {
2282         }
2283         return retval;
2284     }
2285     // $ANTLR end "type"
2286
2287     public static class unionType_return extends ParserRuleReturnScope {
2288         CommonTree tree;
2289         public Object getTree() { return tree; }
2290     };
2291
2292     // $ANTLR start "unionType"
2293     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:311:1: unionType : ( '|' unionComponent )+ -> ^( UNION_TYPE ( unionComponent )+ ) ;
2294     public final GraphParser.unionType_return unionType() throws RecognitionException {
2295         GraphParser.unionType_return retval = new GraphParser.unionType_return();
2296         retval.start = input.LT(1);
2297
2298         CommonTree root_0 = null;
2299
2300         Token char_literal60=null;
2301         GraphParser.unionComponent_return unionComponent61 = null;
2302
2303
2304         CommonTree char_literal60_tree=null;
2305         RewriteRuleTokenStream stream_77=new RewriteRuleTokenStream(adaptor,"token 77");
2306         RewriteRuleSubtreeStream stream_unionComponent=new RewriteRuleSubtreeStream(adaptor,"rule unionComponent");
2307         try {
2308             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:312:5: ( ( '|' unionComponent )+ -> ^( UNION_TYPE ( unionComponent )+ ) )
2309             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:313:6: ( '|' unionComponent )+
2310             {
2311             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:313:6: ( '|' unionComponent )+
2312             int cnt21=0;
2313             loop21:
2314             do {
2315                 int alt21=2;
2316                 int LA21_0 = input.LA(1);
2317
2318                 if ( (LA21_0==77) ) {
2319                     alt21=1;
2320                 }
2321
2322
2323                 switch (alt21) {
2324                 case 1 :
2325                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:313:7: '|' unionComponent
2326                     {
2327                     char_literal60=(Token)match(input,77,FOLLOW_77_in_unionType2041); if (state.failed) return retval; 
2328                     if ( state.backtracking==0 ) stream_77.add(char_literal60);
2329
2330                     pushFollow(FOLLOW_unionComponent_in_unionType2043);
2331                     unionComponent61=unionComponent();
2332
2333                     state._fsp--;
2334                     if (state.failed) return retval;
2335                     if ( state.backtracking==0 ) stream_unionComponent.add(unionComponent61.getTree());
2336
2337                     }
2338                     break;
2339
2340                 default :
2341                     if ( cnt21 >= 1 ) break loop21;
2342                     if (state.backtracking>0) {state.failed=true; return retval;}
2343                         EarlyExitException eee =
2344                             new EarlyExitException(21, input);
2345                         throw eee;
2346                 }
2347                 cnt21++;
2348             } while (true);
2349
2350
2351
2352             // AST REWRITE
2353             // elements: unionComponent
2354             // token labels: 
2355             // rule labels: retval
2356             // token list labels: 
2357             // rule list labels: 
2358             // wildcard labels: 
2359             if ( state.backtracking==0 ) {
2360             retval.tree = root_0;
2361             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2362
2363             root_0 = (CommonTree)adaptor.nil();
2364             // 314:5: -> ^( UNION_TYPE ( unionComponent )+ )
2365             {
2366                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:314:8: ^( UNION_TYPE ( unionComponent )+ )
2367                 {
2368                 CommonTree root_1 = (CommonTree)adaptor.nil();
2369                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNION_TYPE, "UNION_TYPE"), root_1);
2370
2371                 if ( !(stream_unionComponent.hasNext()) ) {
2372                     throw new RewriteEarlyExitException();
2373                 }
2374                 while ( stream_unionComponent.hasNext() ) {
2375                     adaptor.addChild(root_1, stream_unionComponent.nextTree());
2376
2377                 }
2378                 stream_unionComponent.reset();
2379
2380                 adaptor.addChild(root_0, root_1);
2381                 }
2382
2383             }
2384
2385             retval.tree = root_0;}
2386             }
2387
2388             retval.stop = input.LT(-1);
2389
2390             if ( state.backtracking==0 ) {
2391
2392             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2393             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2394             }
2395         }
2396         catch (RecognitionException re) {
2397             reportError(re);
2398             recover(input,re);
2399         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
2400
2401         }
2402         finally {
2403         }
2404         return retval;
2405     }
2406     // $ANTLR end "unionType"
2407
2408     public static class unionComponent_return extends ParserRuleReturnScope {
2409         CommonTree tree;
2410         public Object getTree() { return tree; }
2411     };
2412
2413     // $ANTLR start "unionComponent"
2414     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:1: unionComponent : ID ( ( arrayType )=> arrayType )? -> ^( TYPE_COMPONENT ID ( arrayType )? ) ;
2415     public final GraphParser.unionComponent_return unionComponent() throws RecognitionException {
2416         GraphParser.unionComponent_return retval = new GraphParser.unionComponent_return();
2417         retval.start = input.LT(1);
2418
2419         CommonTree root_0 = null;
2420
2421         Token ID62=null;
2422         GraphParser.arrayType_return arrayType63 = null;
2423
2424
2425         CommonTree ID62_tree=null;
2426         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
2427         RewriteRuleSubtreeStream stream_arrayType=new RewriteRuleSubtreeStream(adaptor,"rule arrayType");
2428         try {
2429             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:16: ( ID ( ( arrayType )=> arrayType )? -> ^( TYPE_COMPONENT ID ( arrayType )? ) )
2430             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:18: ID ( ( arrayType )=> arrayType )?
2431             {
2432             ID62=(Token)match(input,ID,FOLLOW_ID_in_unionComponent2071); if (state.failed) return retval; 
2433             if ( state.backtracking==0 ) stream_ID.add(ID62);
2434
2435             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:21: ( ( arrayType )=> arrayType )?
2436             int alt22=2;
2437             alt22 = dfa22.predict(input);
2438             switch (alt22) {
2439                 case 1 :
2440                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:22: ( arrayType )=> arrayType
2441                     {
2442                     pushFollow(FOLLOW_arrayType_in_unionComponent2080);
2443                     arrayType63=arrayType();
2444
2445                     state._fsp--;
2446                     if (state.failed) return retval;
2447                     if ( state.backtracking==0 ) stream_arrayType.add(arrayType63.getTree());
2448
2449                     }
2450                     break;
2451
2452             }
2453
2454
2455
2456             // AST REWRITE
2457             // elements: ID, arrayType
2458             // token labels: 
2459             // rule labels: retval
2460             // token list labels: 
2461             // rule list labels: 
2462             // wildcard labels: 
2463             if ( state.backtracking==0 ) {
2464             retval.tree = root_0;
2465             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2466
2467             root_0 = (CommonTree)adaptor.nil();
2468             // 317:49: -> ^( TYPE_COMPONENT ID ( arrayType )? )
2469             {
2470                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:52: ^( TYPE_COMPONENT ID ( arrayType )? )
2471                 {
2472                 CommonTree root_1 = (CommonTree)adaptor.nil();
2473                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_COMPONENT, "TYPE_COMPONENT"), root_1);
2474
2475                 adaptor.addChild(root_1, stream_ID.nextNode());
2476                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:72: ( arrayType )?
2477                 if ( stream_arrayType.hasNext() ) {
2478                     adaptor.addChild(root_1, stream_arrayType.nextTree());
2479
2480                 }
2481                 stream_arrayType.reset();
2482
2483                 adaptor.addChild(root_0, root_1);
2484                 }
2485
2486             }
2487
2488             retval.tree = root_0;}
2489             }
2490
2491             retval.stop = input.LT(-1);
2492
2493             if ( state.backtracking==0 ) {
2494
2495             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2496             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2497             }
2498         }
2499         catch (RecognitionException re) {
2500             reportError(re);
2501             recover(input,re);
2502         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
2503
2504         }
2505         finally {
2506         }
2507         return retval;
2508     }
2509     // $ANTLR end "unionComponent"
2510
2511     public static class arrayType_return extends ParserRuleReturnScope {
2512         CommonTree tree;
2513         public Object getTree() { return tree; }
2514     };
2515
2516     // $ANTLR start "arrayType"
2517     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:319:1: arrayType : ( basicType -> basicType ) ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )* ;
2518     public final GraphParser.arrayType_return arrayType() throws RecognitionException {
2519         GraphParser.arrayType_return retval = new GraphParser.arrayType_return();
2520         retval.start = input.LT(1);
2521
2522         CommonTree root_0 = null;
2523
2524         Token LBRACKET65=null;
2525         Token RBRACKET67=null;
2526         GraphParser.basicType_return basicType64 = null;
2527
2528         GraphParser.arrayLength_return arrayLength66 = null;
2529
2530
2531         CommonTree LBRACKET65_tree=null;
2532         CommonTree RBRACKET67_tree=null;
2533         RewriteRuleTokenStream stream_LBRACKET=new RewriteRuleTokenStream(adaptor,"token LBRACKET");
2534         RewriteRuleTokenStream stream_RBRACKET=new RewriteRuleTokenStream(adaptor,"token RBRACKET");
2535         RewriteRuleSubtreeStream stream_arrayLength=new RewriteRuleSubtreeStream(adaptor,"rule arrayLength");
2536         RewriteRuleSubtreeStream stream_basicType=new RewriteRuleSubtreeStream(adaptor,"rule basicType");
2537         try {
2538             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:320:5: ( ( basicType -> basicType ) ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )* )
2539             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:320:7: ( basicType -> basicType ) ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )*
2540             {
2541             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:320:7: ( basicType -> basicType )
2542             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:320:8: basicType
2543             {
2544             pushFollow(FOLLOW_basicType_in_arrayType2108);
2545             basicType64=basicType();
2546
2547             state._fsp--;
2548             if (state.failed) return retval;
2549             if ( state.backtracking==0 ) stream_basicType.add(basicType64.getTree());
2550
2551
2552             // AST REWRITE
2553             // elements: basicType
2554             // token labels: 
2555             // rule labels: retval
2556             // token list labels: 
2557             // rule list labels: 
2558             // wildcard labels: 
2559             if ( state.backtracking==0 ) {
2560             retval.tree = root_0;
2561             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2562
2563             root_0 = (CommonTree)adaptor.nil();
2564             // 320:18: -> basicType
2565             {
2566                 adaptor.addChild(root_0, stream_basicType.nextTree());
2567
2568             }
2569
2570             retval.tree = root_0;}
2571             }
2572
2573             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:7: ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )*
2574             loop24:
2575             do {
2576                 int alt24=2;
2577                 int LA24_0 = input.LA(1);
2578
2579                 if ( (LA24_0==LBRACKET) ) {
2580                     alt24=1;
2581                 }
2582
2583
2584                 switch (alt24) {
2585                 case 1 :
2586                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:8: LBRACKET ( arrayLength )? RBRACKET
2587                     {
2588                     LBRACKET65=(Token)match(input,LBRACKET,FOLLOW_LBRACKET_in_arrayType2122); if (state.failed) return retval; 
2589                     if ( state.backtracking==0 ) stream_LBRACKET.add(LBRACKET65);
2590
2591                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:17: ( arrayLength )?
2592                     int alt23=2;
2593                     int LA23_0 = input.LA(1);
2594
2595                     if ( ((LA23_0>=INT && LA23_0<=INT_RANGE)) ) {
2596                         alt23=1;
2597                     }
2598                     switch (alt23) {
2599                         case 1 :
2600                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:17: arrayLength
2601                             {
2602                             pushFollow(FOLLOW_arrayLength_in_arrayType2124);
2603                             arrayLength66=arrayLength();
2604
2605                             state._fsp--;
2606                             if (state.failed) return retval;
2607                             if ( state.backtracking==0 ) stream_arrayLength.add(arrayLength66.getTree());
2608
2609                             }
2610                             break;
2611
2612                     }
2613
2614                     RBRACKET67=(Token)match(input,RBRACKET,FOLLOW_RBRACKET_in_arrayType2127); if (state.failed) return retval; 
2615                     if ( state.backtracking==0 ) stream_RBRACKET.add(RBRACKET67);
2616
2617
2618
2619                     // AST REWRITE
2620                     // elements: arrayType, arrayLength
2621                     // token labels: 
2622                     // rule labels: retval
2623                     // token list labels: 
2624                     // rule list labels: 
2625                     // wildcard labels: 
2626                     if ( state.backtracking==0 ) {
2627                     retval.tree = root_0;
2628                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2629
2630                     root_0 = (CommonTree)adaptor.nil();
2631                     // 321:39: -> ^( ARRAY_TYPE $arrayType ( arrayLength )? )
2632                     {
2633                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:42: ^( ARRAY_TYPE $arrayType ( arrayLength )? )
2634                         {
2635                         CommonTree root_1 = (CommonTree)adaptor.nil();
2636                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ARRAY_TYPE, "ARRAY_TYPE"), root_1);
2637
2638                         adaptor.addChild(root_1, stream_retval.nextTree());
2639                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:66: ( arrayLength )?
2640                         if ( stream_arrayLength.hasNext() ) {
2641                             adaptor.addChild(root_1, stream_arrayLength.nextTree());
2642
2643                         }
2644                         stream_arrayLength.reset();
2645
2646                         adaptor.addChild(root_0, root_1);
2647                         }
2648
2649                     }
2650
2651                     retval.tree = root_0;}
2652                     }
2653                     break;
2654
2655                 default :
2656                     break loop24;
2657                 }
2658             } while (true);
2659
2660
2661             }
2662
2663             retval.stop = input.LT(-1);
2664
2665             if ( state.backtracking==0 ) {
2666
2667             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2668             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2669             }
2670         }
2671         catch (RecognitionException re) {
2672             reportError(re);
2673             recover(input,re);
2674         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
2675
2676         }
2677         finally {
2678         }
2679         return retval;
2680     }
2681     // $ANTLR end "arrayType"
2682
2683     public static class arrayLength_return extends ParserRuleReturnScope {
2684         CommonTree tree;
2685         public Object getTree() { return tree; }
2686     };
2687
2688     // $ANTLR start "arrayLength"
2689     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:323:1: arrayLength : ( INT | INT_RANGE );
2690     public final GraphParser.arrayLength_return arrayLength() throws RecognitionException {
2691         GraphParser.arrayLength_return retval = new GraphParser.arrayLength_return();
2692         retval.start = input.LT(1);
2693
2694         CommonTree root_0 = null;
2695
2696         Token set68=null;
2697
2698         CommonTree set68_tree=null;
2699
2700         try {
2701             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:324:5: ( INT | INT_RANGE )
2702             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:
2703             {
2704             root_0 = (CommonTree)adaptor.nil();
2705
2706             set68=(Token)input.LT(1);
2707             if ( (input.LA(1)>=INT && input.LA(1)<=INT_RANGE) ) {
2708                 input.consume();
2709                 if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set68));
2710                 state.errorRecovery=false;state.failed=false;
2711             }
2712             else {
2713                 if (state.backtracking>0) {state.failed=true; return retval;}
2714                 MismatchedSetException mse = new MismatchedSetException(null,input);
2715                 throw mse;
2716             }
2717
2718
2719             }
2720
2721             retval.stop = input.LT(-1);
2722
2723             if ( state.backtracking==0 ) {
2724
2725             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2726             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2727             }
2728         }
2729         catch (RecognitionException re) {
2730             reportError(re);
2731             recover(input,re);
2732         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
2733
2734         }
2735         finally {
2736         }
2737         return retval;
2738     }
2739     // $ANTLR end "arrayLength"
2740
2741     public static class basicType_return extends ParserRuleReturnScope {
2742         CommonTree tree;
2743         public Object getTree() { return tree; }
2744     };
2745
2746     // $ANTLR start "basicType"
2747     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:328:1: basicType : ( tupleType | recordType | typeReference );
2748     public final GraphParser.basicType_return basicType() throws RecognitionException {
2749         GraphParser.basicType_return retval = new GraphParser.basicType_return();
2750         retval.start = input.LT(1);
2751
2752         CommonTree root_0 = null;
2753
2754         GraphParser.tupleType_return tupleType69 = null;
2755
2756         GraphParser.recordType_return recordType70 = null;
2757
2758         GraphParser.typeReference_return typeReference71 = null;
2759
2760
2761
2762         try {
2763             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:329:5: ( tupleType | recordType | typeReference )
2764             int alt25=3;
2765             switch ( input.LA(1) ) {
2766             case LPAREN:
2767                 {
2768                 alt25=1;
2769                 }
2770                 break;
2771             case LCURLY:
2772                 {
2773                 alt25=2;
2774                 }
2775                 break;
2776             case ID:
2777                 {
2778                 alt25=3;
2779                 }
2780                 break;
2781             default:
2782                 if (state.backtracking>0) {state.failed=true; return retval;}
2783                 NoViableAltException nvae =
2784                     new NoViableAltException("", 25, 0, input);
2785
2786                 throw nvae;
2787             }
2788
2789             switch (alt25) {
2790                 case 1 :
2791                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:329:7: tupleType
2792                     {
2793                     root_0 = (CommonTree)adaptor.nil();
2794
2795                     pushFollow(FOLLOW_tupleType_in_basicType2181);
2796                     tupleType69=tupleType();
2797
2798                     state._fsp--;
2799                     if (state.failed) return retval;
2800                     if ( state.backtracking==0 ) adaptor.addChild(root_0, tupleType69.getTree());
2801
2802                     }
2803                     break;
2804                 case 2 :
2805                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:330:7: recordType
2806                     {
2807                     root_0 = (CommonTree)adaptor.nil();
2808
2809                     pushFollow(FOLLOW_recordType_in_basicType2189);
2810                     recordType70=recordType();
2811
2812                     state._fsp--;
2813                     if (state.failed) return retval;
2814                     if ( state.backtracking==0 ) adaptor.addChild(root_0, recordType70.getTree());
2815
2816                     }
2817                     break;
2818                 case 3 :
2819                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:331:7: typeReference
2820                     {
2821                     root_0 = (CommonTree)adaptor.nil();
2822
2823                     pushFollow(FOLLOW_typeReference_in_basicType2197);
2824                     typeReference71=typeReference();
2825
2826                     state._fsp--;
2827                     if (state.failed) return retval;
2828                     if ( state.backtracking==0 ) adaptor.addChild(root_0, typeReference71.getTree());
2829
2830                     }
2831                     break;
2832
2833             }
2834             retval.stop = input.LT(-1);
2835
2836             if ( state.backtracking==0 ) {
2837
2838             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2839             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2840             }
2841         }
2842         catch (RecognitionException re) {
2843             reportError(re);
2844             recover(input,re);
2845         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
2846
2847         }
2848         finally {
2849         }
2850         return retval;
2851     }
2852     // $ANTLR end "basicType"
2853
2854     public static class tupleType_return extends ParserRuleReturnScope {
2855         CommonTree tree;
2856         public Object getTree() { return tree; }
2857     };
2858
2859     // $ANTLR start "tupleType"
2860     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:334:1: tupleType : LPAREN ( type ( ',' type )* )? RPAREN -> ^( TUPLE_TYPE ( type )* ) ;
2861     public final GraphParser.tupleType_return tupleType() throws RecognitionException {
2862         GraphParser.tupleType_return retval = new GraphParser.tupleType_return();
2863         retval.start = input.LT(1);
2864
2865         CommonTree root_0 = null;
2866
2867         Token LPAREN72=null;
2868         Token char_literal74=null;
2869         Token RPAREN76=null;
2870         GraphParser.type_return type73 = null;
2871
2872         GraphParser.type_return type75 = null;
2873
2874
2875         CommonTree LPAREN72_tree=null;
2876         CommonTree char_literal74_tree=null;
2877         CommonTree RPAREN76_tree=null;
2878         RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78");
2879         RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
2880         RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
2881         RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type");
2882         try {
2883             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:5: ( LPAREN ( type ( ',' type )* )? RPAREN -> ^( TUPLE_TYPE ( type )* ) )
2884             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:7: LPAREN ( type ( ',' type )* )? RPAREN
2885             {
2886             LPAREN72=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_tupleType2219); if (state.failed) return retval; 
2887             if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN72);
2888
2889             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:14: ( type ( ',' type )* )?
2890             int alt27=2;
2891             int LA27_0 = input.LA(1);
2892
2893             if ( (LA27_0==ID||LA27_0==LPAREN||LA27_0==LCURLY||LA27_0==77) ) {
2894                 alt27=1;
2895             }
2896             switch (alt27) {
2897                 case 1 :
2898                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:15: type ( ',' type )*
2899                     {
2900                     pushFollow(FOLLOW_type_in_tupleType2222);
2901                     type73=type();
2902
2903                     state._fsp--;
2904                     if (state.failed) return retval;
2905                     if ( state.backtracking==0 ) stream_type.add(type73.getTree());
2906                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:20: ( ',' type )*
2907                     loop26:
2908                     do {
2909                         int alt26=2;
2910                         int LA26_0 = input.LA(1);
2911
2912                         if ( (LA26_0==78) ) {
2913                             alt26=1;
2914                         }
2915
2916
2917                         switch (alt26) {
2918                         case 1 :
2919                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:21: ',' type
2920                             {
2921                             char_literal74=(Token)match(input,78,FOLLOW_78_in_tupleType2225); if (state.failed) return retval; 
2922                             if ( state.backtracking==0 ) stream_78.add(char_literal74);
2923
2924                             pushFollow(FOLLOW_type_in_tupleType2227);
2925                             type75=type();
2926
2927                             state._fsp--;
2928                             if (state.failed) return retval;
2929                             if ( state.backtracking==0 ) stream_type.add(type75.getTree());
2930
2931                             }
2932                             break;
2933
2934                         default :
2935                             break loop26;
2936                         }
2937                     } while (true);
2938
2939
2940                     }
2941                     break;
2942
2943             }
2944
2945             RPAREN76=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_tupleType2233); if (state.failed) return retval; 
2946             if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN76);
2947
2948
2949
2950             // AST REWRITE
2951             // elements: type
2952             // token labels: 
2953             // rule labels: retval
2954             // token list labels: 
2955             // rule list labels: 
2956             // wildcard labels: 
2957             if ( state.backtracking==0 ) {
2958             retval.tree = root_0;
2959             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2960
2961             root_0 = (CommonTree)adaptor.nil();
2962             // 336:5: -> ^( TUPLE_TYPE ( type )* )
2963             {
2964                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:336:8: ^( TUPLE_TYPE ( type )* )
2965                 {
2966                 CommonTree root_1 = (CommonTree)adaptor.nil();
2967                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TUPLE_TYPE, "TUPLE_TYPE"), root_1);
2968
2969                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:336:21: ( type )*
2970                 while ( stream_type.hasNext() ) {
2971                     adaptor.addChild(root_1, stream_type.nextTree());
2972
2973                 }
2974                 stream_type.reset();
2975
2976                 adaptor.addChild(root_0, root_1);
2977                 }
2978
2979             }
2980
2981             retval.tree = root_0;}
2982             }
2983
2984             retval.stop = input.LT(-1);
2985
2986             if ( state.backtracking==0 ) {
2987
2988             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2989             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2990             }
2991         }
2992         catch (RecognitionException re) {
2993             reportError(re);
2994             recover(input,re);
2995         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
2996
2997         }
2998         finally {
2999         }
3000         return retval;
3001     }
3002     // $ANTLR end "tupleType"
3003
3004     public static class recordType_return extends ParserRuleReturnScope {
3005         CommonTree tree;
3006         public Object getTree() { return tree; }
3007     };
3008
3009     // $ANTLR start "recordType"
3010     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:339:1: recordType : LCURLY ( component ( ',' component )* )? RCURLY -> ^( RECORD_TYPE ( component )* ) ;
3011     public final GraphParser.recordType_return recordType() throws RecognitionException {
3012         GraphParser.recordType_return retval = new GraphParser.recordType_return();
3013         retval.start = input.LT(1);
3014
3015         CommonTree root_0 = null;
3016
3017         Token LCURLY77=null;
3018         Token char_literal79=null;
3019         Token RCURLY81=null;
3020         GraphParser.component_return component78 = null;
3021
3022         GraphParser.component_return component80 = null;
3023
3024
3025         CommonTree LCURLY77_tree=null;
3026         CommonTree char_literal79_tree=null;
3027         CommonTree RCURLY81_tree=null;
3028         RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78");
3029         RewriteRuleTokenStream stream_LCURLY=new RewriteRuleTokenStream(adaptor,"token LCURLY");
3030         RewriteRuleTokenStream stream_RCURLY=new RewriteRuleTokenStream(adaptor,"token RCURLY");
3031         RewriteRuleSubtreeStream stream_component=new RewriteRuleSubtreeStream(adaptor,"rule component");
3032         try {
3033             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:5: ( LCURLY ( component ( ',' component )* )? RCURLY -> ^( RECORD_TYPE ( component )* ) )
3034             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:7: LCURLY ( component ( ',' component )* )? RCURLY
3035             {
3036             LCURLY77=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_recordType2266); if (state.failed) return retval; 
3037             if ( state.backtracking==0 ) stream_LCURLY.add(LCURLY77);
3038
3039             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:14: ( component ( ',' component )* )?
3040             int alt29=2;
3041             int LA29_0 = input.LA(1);
3042
3043             if ( (LA29_0==ID) ) {
3044                 alt29=1;
3045             }
3046             switch (alt29) {
3047                 case 1 :
3048                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:15: component ( ',' component )*
3049                     {
3050                     pushFollow(FOLLOW_component_in_recordType2269);
3051                     component78=component();
3052
3053                     state._fsp--;
3054                     if (state.failed) return retval;
3055                     if ( state.backtracking==0 ) stream_component.add(component78.getTree());
3056                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:25: ( ',' component )*
3057                     loop28:
3058                     do {
3059                         int alt28=2;
3060                         int LA28_0 = input.LA(1);
3061
3062                         if ( (LA28_0==78) ) {
3063                             alt28=1;
3064                         }
3065
3066
3067                         switch (alt28) {
3068                         case 1 :
3069                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:26: ',' component
3070                             {
3071                             char_literal79=(Token)match(input,78,FOLLOW_78_in_recordType2272); if (state.failed) return retval; 
3072                             if ( state.backtracking==0 ) stream_78.add(char_literal79);
3073
3074                             pushFollow(FOLLOW_component_in_recordType2274);
3075                             component80=component();
3076
3077                             state._fsp--;
3078                             if (state.failed) return retval;
3079                             if ( state.backtracking==0 ) stream_component.add(component80.getTree());
3080
3081                             }
3082                             break;
3083
3084                         default :
3085                             break loop28;
3086                         }
3087                     } while (true);
3088
3089
3090                     }
3091                     break;
3092
3093             }
3094
3095             RCURLY81=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_recordType2280); if (state.failed) return retval; 
3096             if ( state.backtracking==0 ) stream_RCURLY.add(RCURLY81);
3097
3098
3099
3100             // AST REWRITE
3101             // elements: component
3102             // token labels: 
3103             // rule labels: retval
3104             // token list labels: 
3105             // rule list labels: 
3106             // wildcard labels: 
3107             if ( state.backtracking==0 ) {
3108             retval.tree = root_0;
3109             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
3110
3111             root_0 = (CommonTree)adaptor.nil();
3112             // 341:5: -> ^( RECORD_TYPE ( component )* )
3113             {
3114                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:341:8: ^( RECORD_TYPE ( component )* )
3115                 {
3116                 CommonTree root_1 = (CommonTree)adaptor.nil();
3117                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RECORD_TYPE, "RECORD_TYPE"), root_1);
3118
3119                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:341:22: ( component )*
3120                 while ( stream_component.hasNext() ) {
3121                     adaptor.addChild(root_1, stream_component.nextTree());
3122
3123                 }
3124                 stream_component.reset();
3125
3126                 adaptor.addChild(root_0, root_1);
3127                 }
3128
3129             }
3130
3131             retval.tree = root_0;}
3132             }
3133
3134             retval.stop = input.LT(-1);
3135
3136             if ( state.backtracking==0 ) {
3137
3138             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3139             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3140             }
3141         }
3142         catch (RecognitionException re) {
3143             reportError(re);
3144             recover(input,re);
3145         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
3146
3147         }
3148         finally {
3149         }
3150         return retval;
3151     }
3152     // $ANTLR end "recordType"
3153
3154     public static class component_return extends ParserRuleReturnScope {
3155         CommonTree tree;
3156         public Object getTree() { return tree; }
3157     };
3158
3159     // $ANTLR start "component"
3160     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:344:1: component : ID ':' type -> ^( TYPE_COMPONENT ID type ) ;
3161     public final GraphParser.component_return component() throws RecognitionException {
3162         GraphParser.component_return retval = new GraphParser.component_return();
3163         retval.start = input.LT(1);
3164
3165         CommonTree root_0 = null;
3166
3167         Token ID82=null;
3168         Token char_literal83=null;
3169         GraphParser.type_return type84 = null;
3170
3171
3172         CommonTree ID82_tree=null;
3173         CommonTree char_literal83_tree=null;
3174         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
3175         RewriteRuleTokenStream stream_73=new RewriteRuleTokenStream(adaptor,"token 73");
3176         RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type");
3177         try {
3178             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:345:5: ( ID ':' type -> ^( TYPE_COMPONENT ID type ) )
3179             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:345:7: ID ':' type
3180             {
3181             ID82=(Token)match(input,ID,FOLLOW_ID_in_component2312); if (state.failed) return retval; 
3182             if ( state.backtracking==0 ) stream_ID.add(ID82);
3183
3184             char_literal83=(Token)match(input,73,FOLLOW_73_in_component2314); if (state.failed) return retval; 
3185             if ( state.backtracking==0 ) stream_73.add(char_literal83);
3186
3187             pushFollow(FOLLOW_type_in_component2316);
3188             type84=type();
3189
3190             state._fsp--;
3191             if (state.failed) return retval;
3192             if ( state.backtracking==0 ) stream_type.add(type84.getTree());
3193
3194
3195             // AST REWRITE
3196             // elements: type, ID
3197             // token labels: 
3198             // rule labels: retval
3199             // token list labels: 
3200             // rule list labels: 
3201             // wildcard labels: 
3202             if ( state.backtracking==0 ) {
3203             retval.tree = root_0;
3204             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
3205
3206             root_0 = (CommonTree)adaptor.nil();
3207             // 346:5: -> ^( TYPE_COMPONENT ID type )
3208             {
3209                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:346:8: ^( TYPE_COMPONENT ID type )
3210                 {
3211                 CommonTree root_1 = (CommonTree)adaptor.nil();
3212                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_COMPONENT, "TYPE_COMPONENT"), root_1);
3213
3214                 adaptor.addChild(root_1, stream_ID.nextNode());
3215                 adaptor.addChild(root_1, stream_type.nextTree());
3216
3217                 adaptor.addChild(root_0, root_1);
3218                 }
3219
3220             }
3221
3222             retval.tree = root_0;}
3223             }
3224
3225             retval.stop = input.LT(-1);
3226
3227             if ( state.backtracking==0 ) {
3228
3229             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3230             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3231             }
3232         }
3233         catch (RecognitionException re) {
3234             reportError(re);
3235             recover(input,re);
3236         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
3237
3238         }
3239         finally {
3240         }
3241         return retval;
3242     }
3243     // $ANTLR end "component"
3244
3245     public static class typeReference_return extends ParserRuleReturnScope {
3246         CommonTree tree;
3247         public Object getTree() { return tree; }
3248     };
3249
3250     // $ANTLR start "typeReference"
3251     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:349:1: typeReference : ID ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )? -> ^( TYPE_REFERENCE ID ( parameter )* ) ;
3252     public final GraphParser.typeReference_return typeReference() throws RecognitionException {
3253         GraphParser.typeReference_return retval = new GraphParser.typeReference_return();
3254         retval.start = input.LT(1);
3255
3256         CommonTree root_0 = null;
3257
3258         Token ID85=null;
3259         Token LPAREN86=null;
3260         Token char_literal88=null;
3261         Token RPAREN90=null;
3262         GraphParser.parameter_return parameter87 = null;
3263
3264         GraphParser.parameter_return parameter89 = null;
3265
3266
3267         CommonTree ID85_tree=null;
3268         CommonTree LPAREN86_tree=null;
3269         CommonTree char_literal88_tree=null;
3270         CommonTree RPAREN90_tree=null;
3271         RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78");
3272         RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
3273         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
3274         RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
3275         RewriteRuleSubtreeStream stream_parameter=new RewriteRuleSubtreeStream(adaptor,"rule parameter");
3276         try {
3277             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:5: ( ID ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )? -> ^( TYPE_REFERENCE ID ( parameter )* ) )
3278             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:7: ID ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )?
3279             {
3280             ID85=(Token)match(input,ID,FOLLOW_ID_in_typeReference2350); if (state.failed) return retval; 
3281             if ( state.backtracking==0 ) stream_ID.add(ID85);
3282
3283             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:10: ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )?
3284             int alt31=2;
3285             alt31 = dfa31.predict(input);
3286             switch (alt31) {
3287                 case 1 :
3288                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:11: ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN
3289                     {
3290                     LPAREN86=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_typeReference2358); if (state.failed) return retval; 
3291                     if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN86);
3292
3293                     pushFollow(FOLLOW_parameter_in_typeReference2360);
3294                     parameter87=parameter();
3295
3296                     state._fsp--;
3297                     if (state.failed) return retval;
3298                     if ( state.backtracking==0 ) stream_parameter.add(parameter87.getTree());
3299                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:39: ( ',' parameter )*
3300                     loop30:
3301                     do {
3302                         int alt30=2;
3303                         int LA30_0 = input.LA(1);
3304
3305                         if ( (LA30_0==78) ) {
3306                             alt30=1;
3307                         }
3308
3309
3310                         switch (alt30) {
3311                         case 1 :
3312                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:40: ',' parameter
3313                             {
3314                             char_literal88=(Token)match(input,78,FOLLOW_78_in_typeReference2363); if (state.failed) return retval; 
3315                             if ( state.backtracking==0 ) stream_78.add(char_literal88);
3316
3317                             pushFollow(FOLLOW_parameter_in_typeReference2365);
3318                             parameter89=parameter();
3319
3320                             state._fsp--;
3321                             if (state.failed) return retval;
3322                             if ( state.backtracking==0 ) stream_parameter.add(parameter89.getTree());
3323
3324                             }
3325                             break;
3326
3327                         default :
3328                             break loop30;
3329                         }
3330                     } while (true);
3331
3332                     RPAREN90=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_typeReference2369); if (state.failed) return retval; 
3333                     if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN90);
3334
3335
3336                     }
3337                     break;
3338
3339             }
3340
3341
3342
3343             // AST REWRITE
3344             // elements: ID, parameter
3345             // token labels: 
3346             // rule labels: retval
3347             // token list labels: 
3348             // rule list labels: 
3349             // wildcard labels: 
3350             if ( state.backtracking==0 ) {
3351             retval.tree = root_0;
3352             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
3353
3354             root_0 = (CommonTree)adaptor.nil();
3355             // 351:5: -> ^( TYPE_REFERENCE ID ( parameter )* )
3356             {
3357                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:351:8: ^( TYPE_REFERENCE ID ( parameter )* )
3358                 {
3359                 CommonTree root_1 = (CommonTree)adaptor.nil();
3360                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_REFERENCE, "TYPE_REFERENCE"), root_1);
3361
3362                 adaptor.addChild(root_1, stream_ID.nextNode());
3363                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:351:28: ( parameter )*
3364                 while ( stream_parameter.hasNext() ) {
3365                     adaptor.addChild(root_1, stream_parameter.nextTree());
3366
3367                 }
3368                 stream_parameter.reset();
3369
3370                 adaptor.addChild(root_0, root_1);
3371                 }
3372
3373             }
3374
3375             retval.tree = root_0;}
3376             }
3377
3378             retval.stop = input.LT(-1);
3379
3380             if ( state.backtracking==0 ) {
3381
3382             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3383             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3384             }
3385         }
3386         catch (RecognitionException re) {
3387             reportError(re);
3388             recover(input,re);
3389         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
3390
3391         }
3392         finally {
3393         }
3394         return retval;
3395     }
3396     // $ANTLR end "typeReference"
3397
3398     public static class parameter_return extends ParserRuleReturnScope {
3399         CommonTree tree;
3400         public Object getTree() { return tree; }
3401     };
3402
3403     // $ANTLR start "parameter"
3404     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:354:1: parameter : ( ID '=' parameterValue -> ^( TYPE_ANNOTATION ID parameterValue ) | type );
3405     public final GraphParser.parameter_return parameter() throws RecognitionException {
3406         GraphParser.parameter_return retval = new GraphParser.parameter_return();
3407         retval.start = input.LT(1);
3408
3409         CommonTree root_0 = null;
3410
3411         Token ID91=null;
3412         Token char_literal92=null;
3413         GraphParser.parameterValue_return parameterValue93 = null;
3414
3415         GraphParser.type_return type94 = null;
3416
3417
3418         CommonTree ID91_tree=null;
3419         CommonTree char_literal92_tree=null;
3420         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
3421         RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74");
3422         RewriteRuleSubtreeStream stream_parameterValue=new RewriteRuleSubtreeStream(adaptor,"rule parameterValue");
3423         try {
3424             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:355:5: ( ID '=' parameterValue -> ^( TYPE_ANNOTATION ID parameterValue ) | type )
3425             int alt32=2;
3426             int LA32_0 = input.LA(1);
3427
3428             if ( (LA32_0==ID) ) {
3429                 int LA32_1 = input.LA(2);
3430
3431                 if ( (LA32_1==74) ) {
3432                     alt32=1;
3433                 }
3434                 else if ( ((LA32_1>=LPAREN && LA32_1<=LBRACKET)||LA32_1==78) ) {
3435                     alt32=2;
3436                 }
3437                 else {
3438                     if (state.backtracking>0) {state.failed=true; return retval;}
3439                     NoViableAltException nvae =
3440                         new NoViableAltException("", 32, 1, input);
3441
3442                     throw nvae;
3443                 }
3444             }
3445             else if ( (LA32_0==LPAREN||LA32_0==LCURLY||LA32_0==77) ) {
3446                 alt32=2;
3447             }
3448             else {
3449                 if (state.backtracking>0) {state.failed=true; return retval;}
3450                 NoViableAltException nvae =
3451                     new NoViableAltException("", 32, 0, input);
3452
3453                 throw nvae;
3454             }
3455             switch (alt32) {
3456                 case 1 :
3457                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:355:7: ID '=' parameterValue
3458                     {
3459                     ID91=(Token)match(input,ID,FOLLOW_ID_in_parameter2405); if (state.failed) return retval; 
3460                     if ( state.backtracking==0 ) stream_ID.add(ID91);
3461
3462                     char_literal92=(Token)match(input,74,FOLLOW_74_in_parameter2407); if (state.failed) return retval; 
3463                     if ( state.backtracking==0 ) stream_74.add(char_literal92);
3464
3465                     pushFollow(FOLLOW_parameterValue_in_parameter2409);
3466                     parameterValue93=parameterValue();
3467
3468                     state._fsp--;
3469                     if (state.failed) return retval;
3470                     if ( state.backtracking==0 ) stream_parameterValue.add(parameterValue93.getTree());
3471
3472
3473                     // AST REWRITE
3474                     // elements: ID, parameterValue
3475                     // token labels: 
3476                     // rule labels: retval
3477                     // token list labels: 
3478                     // rule list labels: 
3479                     // wildcard labels: 
3480                     if ( state.backtracking==0 ) {
3481                     retval.tree = root_0;
3482                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
3483
3484                     root_0 = (CommonTree)adaptor.nil();
3485                     // 355:29: -> ^( TYPE_ANNOTATION ID parameterValue )
3486                     {
3487                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:355:32: ^( TYPE_ANNOTATION ID parameterValue )
3488                         {
3489                         CommonTree root_1 = (CommonTree)adaptor.nil();
3490                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_ANNOTATION, "TYPE_ANNOTATION"), root_1);
3491
3492                         adaptor.addChild(root_1, stream_ID.nextNode());
3493                         adaptor.addChild(root_1, stream_parameterValue.nextTree());
3494
3495                         adaptor.addChild(root_0, root_1);
3496                         }
3497
3498                     }
3499
3500                     retval.tree = root_0;}
3501                     }
3502                     break;
3503                 case 2 :
3504                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:356:7: type
3505                     {
3506                     root_0 = (CommonTree)adaptor.nil();
3507
3508                     pushFollow(FOLLOW_type_in_parameter2427);
3509                     type94=type();
3510
3511                     state._fsp--;
3512                     if (state.failed) return retval;
3513                     if ( state.backtracking==0 ) adaptor.addChild(root_0, type94.getTree());
3514
3515                     }
3516                     break;
3517
3518             }
3519             retval.stop = input.LT(-1);
3520
3521             if ( state.backtracking==0 ) {
3522
3523             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3524             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3525             }
3526         }
3527         catch (RecognitionException re) {
3528             reportError(re);
3529             recover(input,re);
3530         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
3531
3532         }
3533         finally {
3534         }
3535         return retval;
3536     }
3537     // $ANTLR end "parameter"
3538
3539     public static class parameterValue_return extends ParserRuleReturnScope {
3540         CommonTree tree;
3541         public Object getTree() { return tree; }
3542     };
3543
3544     // $ANTLR start "parameterValue"
3545     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:359:1: parameterValue : ( string | boolean_ | number | rangePar -> ^( RANGE rangePar ) );
3546     public final GraphParser.parameterValue_return parameterValue() throws RecognitionException {
3547         GraphParser.parameterValue_return retval = new GraphParser.parameterValue_return();
3548         retval.start = input.LT(1);
3549
3550         CommonTree root_0 = null;
3551
3552         GraphParser.string_return string95 = null;
3553
3554         GraphParser.boolean__return boolean_96 = null;
3555
3556         GraphParser.number_return number97 = null;
3557
3558         GraphParser.rangePar_return rangePar98 = null;
3559
3560
3561         RewriteRuleSubtreeStream stream_rangePar=new RewriteRuleSubtreeStream(adaptor,"rule rangePar");
3562         try {
3563             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:360:5: ( string | boolean_ | number | rangePar -> ^( RANGE rangePar ) )
3564             int alt33=4;
3565             switch ( input.LA(1) ) {
3566             case STRING:
3567                 {
3568                 alt33=1;
3569                 }
3570                 break;
3571             case 79:
3572             case 80:
3573                 {
3574                 alt33=2;
3575                 }
3576                 break;
3577             case INT:
3578             case FLOAT:
3579                 {
3580                 alt33=3;
3581                 }
3582                 break;
3583             case LPAREN:
3584             case LBRACKET:
3585                 {
3586                 alt33=4;
3587                 }
3588                 break;
3589             default:
3590                 if (state.backtracking>0) {state.failed=true; return retval;}
3591                 NoViableAltException nvae =
3592                     new NoViableAltException("", 33, 0, input);
3593
3594                 throw nvae;
3595             }
3596
3597             switch (alt33) {
3598                 case 1 :
3599                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:360:7: string
3600                     {
3601                     root_0 = (CommonTree)adaptor.nil();
3602
3603                     pushFollow(FOLLOW_string_in_parameterValue2446);
3604                     string95=string();
3605
3606                     state._fsp--;
3607                     if (state.failed) return retval;
3608                     if ( state.backtracking==0 ) adaptor.addChild(root_0, string95.getTree());
3609
3610                     }
3611                     break;
3612                 case 2 :
3613                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:361:7: boolean_
3614                     {
3615                     root_0 = (CommonTree)adaptor.nil();
3616
3617                     pushFollow(FOLLOW_boolean__in_parameterValue2454);
3618                     boolean_96=boolean_();
3619
3620                     state._fsp--;
3621                     if (state.failed) return retval;
3622                     if ( state.backtracking==0 ) adaptor.addChild(root_0, boolean_96.getTree());
3623
3624                     }
3625                     break;
3626                 case 3 :
3627                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:362:7: number
3628                     {
3629                     root_0 = (CommonTree)adaptor.nil();
3630
3631                     pushFollow(FOLLOW_number_in_parameterValue2462);
3632                     number97=number();
3633
3634                     state._fsp--;
3635                     if (state.failed) return retval;
3636                     if ( state.backtracking==0 ) adaptor.addChild(root_0, number97.getTree());
3637
3638                     }
3639                     break;
3640                 case 4 :
3641                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:363:7: rangePar
3642                     {
3643                     pushFollow(FOLLOW_rangePar_in_parameterValue2470);
3644                     rangePar98=rangePar();
3645
3646                     state._fsp--;
3647                     if (state.failed) return retval;
3648                     if ( state.backtracking==0 ) stream_rangePar.add(rangePar98.getTree());
3649
3650
3651                     // AST REWRITE
3652                     // elements: rangePar
3653                     // token labels: 
3654                     // rule labels: retval
3655                     // token list labels: 
3656                     // rule list labels: 
3657                     // wildcard labels: 
3658                     if ( state.backtracking==0 ) {
3659                     retval.tree = root_0;
3660                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
3661
3662                     root_0 = (CommonTree)adaptor.nil();
3663                     // 363:16: -> ^( RANGE rangePar )
3664                     {
3665                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:363:19: ^( RANGE rangePar )
3666                         {
3667                         CommonTree root_1 = (CommonTree)adaptor.nil();
3668                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RANGE, "RANGE"), root_1);
3669
3670                         adaptor.addChild(root_1, stream_rangePar.nextTree());
3671
3672                         adaptor.addChild(root_0, root_1);
3673                         }
3674
3675                     }
3676
3677                     retval.tree = root_0;}
3678                     }
3679                     break;
3680
3681             }
3682             retval.stop = input.LT(-1);
3683
3684             if ( state.backtracking==0 ) {
3685
3686             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3687             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3688             }
3689         }
3690         catch (RecognitionException re) {
3691             reportError(re);
3692             recover(input,re);
3693         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
3694
3695         }
3696         finally {
3697         }
3698         return retval;
3699     }
3700     // $ANTLR end "parameterValue"
3701
3702     public static class rangePar_return extends ParserRuleReturnScope {
3703         CommonTree tree;
3704         public Object getTree() { return tree; }
3705     };
3706
3707     // $ANTLR start "rangePar"
3708     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:366:1: rangePar : ( LBRACKET | LPAREN ) range ( RBRACKET | RPAREN ) ;
3709     public final GraphParser.rangePar_return rangePar() throws RecognitionException {
3710         GraphParser.rangePar_return retval = new GraphParser.rangePar_return();
3711         retval.start = input.LT(1);
3712
3713         CommonTree root_0 = null;
3714
3715         Token set99=null;
3716         Token set101=null;
3717         GraphParser.range_return range100 = null;
3718
3719
3720         CommonTree set99_tree=null;
3721         CommonTree set101_tree=null;
3722
3723         try {
3724             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:366:10: ( ( LBRACKET | LPAREN ) range ( RBRACKET | RPAREN ) )
3725             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:366:12: ( LBRACKET | LPAREN ) range ( RBRACKET | RPAREN )
3726             {
3727             root_0 = (CommonTree)adaptor.nil();
3728
3729             set99=(Token)input.LT(1);
3730             if ( input.LA(1)==LPAREN||input.LA(1)==LBRACKET ) {
3731                 input.consume();
3732                 if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set99));
3733                 state.errorRecovery=false;state.failed=false;
3734             }
3735             else {
3736                 if (state.backtracking>0) {state.failed=true; return retval;}
3737                 MismatchedSetException mse = new MismatchedSetException(null,input);
3738                 throw mse;
3739             }
3740
3741             pushFollow(FOLLOW_range_in_rangePar2507);
3742             range100=range();
3743
3744             state._fsp--;
3745             if (state.failed) return retval;
3746             if ( state.backtracking==0 ) adaptor.addChild(root_0, range100.getTree());
3747             set101=(Token)input.LT(1);
3748             if ( input.LA(1)==RPAREN||input.LA(1)==RBRACKET ) {
3749                 input.consume();
3750                 if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set101));
3751                 state.errorRecovery=false;state.failed=false;
3752             }
3753             else {
3754                 if (state.backtracking>0) {state.failed=true; return retval;}
3755                 MismatchedSetException mse = new MismatchedSetException(null,input);
3756                 throw mse;
3757             }
3758
3759
3760             }
3761
3762             retval.stop = input.LT(-1);
3763
3764             if ( state.backtracking==0 ) {
3765
3766             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3767             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3768             }
3769         }
3770         catch (RecognitionException re) {
3771             reportError(re);
3772             recover(input,re);
3773         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
3774
3775         }
3776         finally {
3777         }
3778         return retval;
3779     }
3780     // $ANTLR end "rangePar"
3781
3782     public static class range_return extends ParserRuleReturnScope {
3783         CommonTree tree;
3784         public Object getTree() { return tree; }
3785     };
3786
3787     // $ANTLR start "range"
3788     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:368:1: range : ( number | RANGE | INT_RANGE );
3789     public final GraphParser.range_return range() throws RecognitionException {
3790         GraphParser.range_return retval = new GraphParser.range_return();
3791         retval.start = input.LT(1);
3792
3793         CommonTree root_0 = null;
3794
3795         Token RANGE103=null;
3796         Token INT_RANGE104=null;
3797         GraphParser.number_return number102 = null;
3798
3799
3800         CommonTree RANGE103_tree=null;
3801         CommonTree INT_RANGE104_tree=null;
3802
3803         try {
3804             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:369:5: ( number | RANGE | INT_RANGE )
3805             int alt34=3;
3806             switch ( input.LA(1) ) {
3807             case INT:
3808             case FLOAT:
3809                 {
3810                 alt34=1;
3811                 }
3812                 break;
3813             case RANGE:
3814                 {
3815                 alt34=2;
3816                 }
3817                 break;
3818             case INT_RANGE:
3819                 {
3820                 alt34=3;
3821                 }
3822                 break;
3823             default:
3824                 if (state.backtracking>0) {state.failed=true; return retval;}
3825                 NoViableAltException nvae =
3826                     new NoViableAltException("", 34, 0, input);
3827
3828                 throw nvae;
3829             }
3830
3831             switch (alt34) {
3832                 case 1 :
3833                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:369:7: number
3834                     {
3835                     root_0 = (CommonTree)adaptor.nil();
3836
3837                     pushFollow(FOLLOW_number_in_range2536);
3838                     number102=number();
3839
3840                     state._fsp--;
3841                     if (state.failed) return retval;
3842                     if ( state.backtracking==0 ) adaptor.addChild(root_0, number102.getTree());
3843
3844                     }
3845                     break;
3846                 case 2 :
3847                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:370:7: RANGE
3848                     {
3849                     root_0 = (CommonTree)adaptor.nil();
3850
3851                     RANGE103=(Token)match(input,RANGE,FOLLOW_RANGE_in_range2544); if (state.failed) return retval;
3852                     if ( state.backtracking==0 ) {
3853                     RANGE103_tree = (CommonTree)adaptor.create(RANGE103);
3854                     adaptor.addChild(root_0, RANGE103_tree);
3855                     }
3856
3857                     }
3858                     break;
3859                 case 3 :
3860                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:371:7: INT_RANGE
3861                     {
3862                     root_0 = (CommonTree)adaptor.nil();
3863
3864                     INT_RANGE104=(Token)match(input,INT_RANGE,FOLLOW_INT_RANGE_in_range2552); if (state.failed) return retval;
3865                     if ( state.backtracking==0 ) {
3866                     INT_RANGE104_tree = (CommonTree)adaptor.create(INT_RANGE104);
3867                     adaptor.addChild(root_0, INT_RANGE104_tree);
3868                     }
3869
3870                     }
3871                     break;
3872
3873             }
3874             retval.stop = input.LT(-1);
3875
3876             if ( state.backtracking==0 ) {
3877
3878             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3879             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3880             }
3881         }
3882         catch (RecognitionException re) {
3883             reportError(re);
3884             recover(input,re);
3885         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
3886
3887         }
3888         finally {
3889         }
3890         return retval;
3891     }
3892     // $ANTLR end "range"
3893
3894     public static class number_return extends ParserRuleReturnScope {
3895         CommonTree tree;
3896         public Object getTree() { return tree; }
3897     };
3898
3899     // $ANTLR start "number"
3900     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:374:1: number : ( INT | FLOAT );
3901     public final GraphParser.number_return number() throws RecognitionException {
3902         GraphParser.number_return retval = new GraphParser.number_return();
3903         retval.start = input.LT(1);
3904
3905         CommonTree root_0 = null;
3906
3907         Token set105=null;
3908
3909         CommonTree set105_tree=null;
3910
3911         try {
3912             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:375:5: ( INT | FLOAT )
3913             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:
3914             {
3915             root_0 = (CommonTree)adaptor.nil();
3916
3917             set105=(Token)input.LT(1);
3918             if ( input.LA(1)==INT||input.LA(1)==FLOAT ) {
3919                 input.consume();
3920                 if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set105));
3921                 state.errorRecovery=false;state.failed=false;
3922             }
3923             else {
3924                 if (state.backtracking>0) {state.failed=true; return retval;}
3925                 MismatchedSetException mse = new MismatchedSetException(null,input);
3926                 throw mse;
3927             }
3928
3929
3930             }
3931
3932             retval.stop = input.LT(-1);
3933
3934             if ( state.backtracking==0 ) {
3935
3936             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3937             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3938             }
3939         }
3940         catch (RecognitionException re) {
3941             reportError(re);
3942             recover(input,re);
3943         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
3944
3945         }
3946         finally {
3947         }
3948         return retval;
3949     }
3950     // $ANTLR end "number"
3951
3952     public static class string_return extends ParserRuleReturnScope {
3953         CommonTree tree;
3954         public Object getTree() { return tree; }
3955     };
3956
3957     // $ANTLR start "string"
3958     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:379:1: string : STRING ;
3959     public final GraphParser.string_return string() throws RecognitionException {
3960         GraphParser.string_return retval = new GraphParser.string_return();
3961         retval.start = input.LT(1);
3962
3963         CommonTree root_0 = null;
3964
3965         Token STRING106=null;
3966
3967         CommonTree STRING106_tree=null;
3968
3969         try {
3970             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:380:5: ( STRING )
3971             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:380:7: STRING
3972             {
3973             root_0 = (CommonTree)adaptor.nil();
3974
3975             STRING106=(Token)match(input,STRING,FOLLOW_STRING_in_string2606); if (state.failed) return retval;
3976             if ( state.backtracking==0 ) {
3977             STRING106_tree = (CommonTree)adaptor.create(STRING106);
3978             adaptor.addChild(root_0, STRING106_tree);
3979             }
3980
3981             }
3982
3983             retval.stop = input.LT(-1);
3984
3985             if ( state.backtracking==0 ) {
3986
3987             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3988             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3989             }
3990         }
3991         catch (RecognitionException re) {
3992             reportError(re);
3993             recover(input,re);
3994         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
3995
3996         }
3997         finally {
3998         }
3999         return retval;
4000     }
4001     // $ANTLR end "string"
4002
4003     public static class boolean__return extends ParserRuleReturnScope {
4004         CommonTree tree;
4005         public Object getTree() { return tree; }
4006     };
4007
4008     // $ANTLR start "boolean_"
4009     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:383:1: boolean_ : ( 'true' -> TRUE | 'false' -> FALSE );
4010     public final GraphParser.boolean__return boolean_() throws RecognitionException {
4011         GraphParser.boolean__return retval = new GraphParser.boolean__return();
4012         retval.start = input.LT(1);
4013
4014         CommonTree root_0 = null;
4015
4016         Token string_literal107=null;
4017         Token string_literal108=null;
4018
4019         CommonTree string_literal107_tree=null;
4020         CommonTree string_literal108_tree=null;
4021         RewriteRuleTokenStream stream_79=new RewriteRuleTokenStream(adaptor,"token 79");
4022         RewriteRuleTokenStream stream_80=new RewriteRuleTokenStream(adaptor,"token 80");
4023
4024         try {
4025             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:384:5: ( 'true' -> TRUE | 'false' -> FALSE )
4026             int alt35=2;
4027             int LA35_0 = input.LA(1);
4028
4029             if ( (LA35_0==79) ) {
4030                 alt35=1;
4031             }
4032             else if ( (LA35_0==80) ) {
4033                 alt35=2;
4034             }
4035             else {
4036                 if (state.backtracking>0) {state.failed=true; return retval;}
4037                 NoViableAltException nvae =
4038                     new NoViableAltException("", 35, 0, input);
4039
4040                 throw nvae;
4041             }
4042             switch (alt35) {
4043                 case 1 :
4044                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:384:7: 'true'
4045                     {
4046                     string_literal107=(Token)match(input,79,FOLLOW_79_in_boolean_2627); if (state.failed) return retval; 
4047                     if ( state.backtracking==0 ) stream_79.add(string_literal107);
4048
4049
4050
4051                     // AST REWRITE
4052                     // elements: 
4053                     // token labels: 
4054                     // rule labels: retval
4055                     // token list labels: 
4056                     // rule list labels: 
4057                     // wildcard labels: 
4058                     if ( state.backtracking==0 ) {
4059                     retval.tree = root_0;
4060                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4061
4062                     root_0 = (CommonTree)adaptor.nil();
4063                     // 384:14: -> TRUE
4064                     {
4065                         adaptor.addChild(root_0, (CommonTree)adaptor.create(TRUE, "TRUE"));
4066
4067                     }
4068
4069                     retval.tree = root_0;}
4070                     }
4071                     break;
4072                 case 2 :
4073                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:385:7: 'false'
4074                     {
4075                     string_literal108=(Token)match(input,80,FOLLOW_80_in_boolean_2639); if (state.failed) return retval; 
4076                     if ( state.backtracking==0 ) stream_80.add(string_literal108);
4077
4078
4079
4080                     // AST REWRITE
4081                     // elements: 
4082                     // token labels: 
4083                     // rule labels: retval
4084                     // token list labels: 
4085                     // rule list labels: 
4086                     // wildcard labels: 
4087                     if ( state.backtracking==0 ) {
4088                     retval.tree = root_0;
4089                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4090
4091                     root_0 = (CommonTree)adaptor.nil();
4092                     // 385:15: -> FALSE
4093                     {
4094                         adaptor.addChild(root_0, (CommonTree)adaptor.create(FALSE, "FALSE"));
4095
4096                     }
4097
4098                     retval.tree = root_0;}
4099                     }
4100                     break;
4101
4102             }
4103             retval.stop = input.LT(-1);
4104
4105             if ( state.backtracking==0 ) {
4106
4107             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4108             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4109             }
4110         }
4111         catch (RecognitionException re) {
4112             reportError(re);
4113             recover(input,re);
4114         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
4115
4116         }
4117         finally {
4118         }
4119         return retval;
4120     }
4121     // $ANTLR end "boolean_"
4122
4123     public static class valueDefinitions_return extends ParserRuleReturnScope {
4124         CommonTree tree;
4125         public Object getTree() { return tree; }
4126     };
4127
4128     // $ANTLR start "valueDefinitions"
4129     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:1: valueDefinitions : ( valueDefinition )* -> ^( VALUE_DEFINITIONS ( valueDefinition )* ) ;
4130     public final GraphParser.valueDefinitions_return valueDefinitions() throws RecognitionException {
4131         GraphParser.valueDefinitions_return retval = new GraphParser.valueDefinitions_return();
4132         retval.start = input.LT(1);
4133
4134         CommonTree root_0 = null;
4135
4136         GraphParser.valueDefinition_return valueDefinition109 = null;
4137
4138
4139         RewriteRuleSubtreeStream stream_valueDefinition=new RewriteRuleSubtreeStream(adaptor,"rule valueDefinition");
4140         try {
4141             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:18: ( ( valueDefinition )* -> ^( VALUE_DEFINITIONS ( valueDefinition )* ) )
4142             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:20: ( valueDefinition )*
4143             {
4144             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:20: ( valueDefinition )*
4145             loop36:
4146             do {
4147                 int alt36=2;
4148                 int LA36_0 = input.LA(1);
4149
4150                 if ( (LA36_0==ID) ) {
4151                     alt36=1;
4152                 }
4153
4154
4155                 switch (alt36) {
4156                 case 1 :
4157                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:20: valueDefinition
4158                     {
4159                     pushFollow(FOLLOW_valueDefinition_in_valueDefinitions2660);
4160                     valueDefinition109=valueDefinition();
4161
4162                     state._fsp--;
4163                     if (state.failed) return retval;
4164                     if ( state.backtracking==0 ) stream_valueDefinition.add(valueDefinition109.getTree());
4165
4166                     }
4167                     break;
4168
4169                 default :
4170                     break loop36;
4171                 }
4172             } while (true);
4173
4174
4175
4176             // AST REWRITE
4177             // elements: valueDefinition
4178             // token labels: 
4179             // rule labels: retval
4180             // token list labels: 
4181             // rule list labels: 
4182             // wildcard labels: 
4183             if ( state.backtracking==0 ) {
4184             retval.tree = root_0;
4185             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4186
4187             root_0 = (CommonTree)adaptor.nil();
4188             // 392:37: -> ^( VALUE_DEFINITIONS ( valueDefinition )* )
4189             {
4190                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:40: ^( VALUE_DEFINITIONS ( valueDefinition )* )
4191                 {
4192                 CommonTree root_1 = (CommonTree)adaptor.nil();
4193                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VALUE_DEFINITIONS, "VALUE_DEFINITIONS"), root_1);
4194
4195                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:60: ( valueDefinition )*
4196                 while ( stream_valueDefinition.hasNext() ) {
4197                     adaptor.addChild(root_1, stream_valueDefinition.nextTree());
4198
4199                 }
4200                 stream_valueDefinition.reset();
4201
4202                 adaptor.addChild(root_0, root_1);
4203                 }
4204
4205             }
4206
4207             retval.tree = root_0;}
4208             }
4209
4210             retval.stop = input.LT(-1);
4211
4212             if ( state.backtracking==0 ) {
4213
4214             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4215             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4216             }
4217         }
4218         catch (RecognitionException re) {
4219             reportError(re);
4220             recover(input,re);
4221         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
4222
4223         }
4224         finally {
4225         }
4226         return retval;
4227     }
4228     // $ANTLR end "valueDefinitions"
4229
4230     public static class valueDefinition_return extends ParserRuleReturnScope {
4231         CommonTree tree;
4232         public Object getTree() { return tree; }
4233     };
4234
4235     // $ANTLR start "valueDefinition"
4236     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:394:1: valueDefinition : ID ':' type '=' value -> ^( VALUE_DEFINITION ID type value ) ;
4237     public final GraphParser.valueDefinition_return valueDefinition() throws RecognitionException {
4238         GraphParser.valueDefinition_return retval = new GraphParser.valueDefinition_return();
4239         retval.start = input.LT(1);
4240
4241         CommonTree root_0 = null;
4242
4243         Token ID110=null;
4244         Token char_literal111=null;
4245         Token char_literal113=null;
4246         GraphParser.type_return type112 = null;
4247
4248         GraphParser.value_return value114 = null;
4249
4250
4251         CommonTree ID110_tree=null;
4252         CommonTree char_literal111_tree=null;
4253         CommonTree char_literal113_tree=null;
4254         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
4255         RewriteRuleTokenStream stream_73=new RewriteRuleTokenStream(adaptor,"token 73");
4256         RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74");
4257         RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value");
4258         RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type");
4259         try {
4260             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:395:5: ( ID ':' type '=' value -> ^( VALUE_DEFINITION ID type value ) )
4261             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:395:7: ID ':' type '=' value
4262             {
4263             ID110=(Token)match(input,ID,FOLLOW_ID_in_valueDefinition2683); if (state.failed) return retval; 
4264             if ( state.backtracking==0 ) stream_ID.add(ID110);
4265
4266             char_literal111=(Token)match(input,73,FOLLOW_73_in_valueDefinition2685); if (state.failed) return retval; 
4267             if ( state.backtracking==0 ) stream_73.add(char_literal111);
4268
4269             pushFollow(FOLLOW_type_in_valueDefinition2687);
4270             type112=type();
4271
4272             state._fsp--;
4273             if (state.failed) return retval;
4274             if ( state.backtracking==0 ) stream_type.add(type112.getTree());
4275             char_literal113=(Token)match(input,74,FOLLOW_74_in_valueDefinition2689); if (state.failed) return retval; 
4276             if ( state.backtracking==0 ) stream_74.add(char_literal113);
4277
4278             pushFollow(FOLLOW_value_in_valueDefinition2691);
4279             value114=value();
4280
4281             state._fsp--;
4282             if (state.failed) return retval;
4283             if ( state.backtracking==0 ) stream_value.add(value114.getTree());
4284
4285
4286             // AST REWRITE
4287             // elements: value, type, ID
4288             // token labels: 
4289             // rule labels: retval
4290             // token list labels: 
4291             // rule list labels: 
4292             // wildcard labels: 
4293             if ( state.backtracking==0 ) {
4294             retval.tree = root_0;
4295             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4296
4297             root_0 = (CommonTree)adaptor.nil();
4298             // 396:5: -> ^( VALUE_DEFINITION ID type value )
4299             {
4300                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:396:8: ^( VALUE_DEFINITION ID type value )
4301                 {
4302                 CommonTree root_1 = (CommonTree)adaptor.nil();
4303                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VALUE_DEFINITION, "VALUE_DEFINITION"), root_1);
4304
4305                 adaptor.addChild(root_1, stream_ID.nextNode());
4306                 adaptor.addChild(root_1, stream_type.nextTree());
4307                 adaptor.addChild(root_1, stream_value.nextTree());
4308
4309                 adaptor.addChild(root_0, root_1);
4310                 }
4311
4312             }
4313
4314             retval.tree = root_0;}
4315             }
4316
4317             retval.stop = input.LT(-1);
4318
4319             if ( state.backtracking==0 ) {
4320
4321             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4322             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4323             }
4324         }
4325         catch (RecognitionException re) {
4326             reportError(re);
4327             recover(input,re);
4328         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
4329
4330         }
4331         finally {
4332         }
4333         return retval;
4334     }
4335     // $ANTLR end "valueDefinition"
4336
4337     public static class value_return extends ParserRuleReturnScope {
4338         CommonTree tree;
4339         public Object getTree() { return tree; }
4340     };
4341
4342     // $ANTLR start "value"
4343     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:399:1: value : ( basicValue -> basicValue ) ( ':' type -> ^( VARIANT type $value) )* ;
4344     public final GraphParser.value_return value() throws RecognitionException {
4345         GraphParser.value_return retval = new GraphParser.value_return();
4346         retval.start = input.LT(1);
4347
4348         CommonTree root_0 = null;
4349
4350         Token char_literal116=null;
4351         GraphParser.basicValue_return basicValue115 = null;
4352
4353         GraphParser.type_return type117 = null;
4354
4355
4356         CommonTree char_literal116_tree=null;
4357         RewriteRuleTokenStream stream_73=new RewriteRuleTokenStream(adaptor,"token 73");
4358         RewriteRuleSubtreeStream stream_basicValue=new RewriteRuleSubtreeStream(adaptor,"rule basicValue");
4359         RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type");
4360         try {
4361             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:400:5: ( ( basicValue -> basicValue ) ( ':' type -> ^( VARIANT type $value) )* )
4362             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:400:7: ( basicValue -> basicValue ) ( ':' type -> ^( VARIANT type $value) )*
4363             {
4364             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:400:7: ( basicValue -> basicValue )
4365             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:400:8: basicValue
4366             {
4367             pushFollow(FOLLOW_basicValue_in_value2727);
4368             basicValue115=basicValue();
4369
4370             state._fsp--;
4371             if (state.failed) return retval;
4372             if ( state.backtracking==0 ) stream_basicValue.add(basicValue115.getTree());
4373
4374
4375             // AST REWRITE
4376             // elements: basicValue
4377             // token labels: 
4378             // rule labels: retval
4379             // token list labels: 
4380             // rule list labels: 
4381             // wildcard labels: 
4382             if ( state.backtracking==0 ) {
4383             retval.tree = root_0;
4384             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4385
4386             root_0 = (CommonTree)adaptor.nil();
4387             // 400:19: -> basicValue
4388             {
4389                 adaptor.addChild(root_0, stream_basicValue.nextTree());
4390
4391             }
4392
4393             retval.tree = root_0;}
4394             }
4395
4396             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:401:7: ( ':' type -> ^( VARIANT type $value) )*
4397             loop37:
4398             do {
4399                 int alt37=2;
4400                 int LA37_0 = input.LA(1);
4401
4402                 if ( (LA37_0==73) ) {
4403                     alt37=1;
4404                 }
4405
4406
4407                 switch (alt37) {
4408                 case 1 :
4409                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:401:8: ':' type
4410                     {
4411                     char_literal116=(Token)match(input,73,FOLLOW_73_in_value2741); if (state.failed) return retval; 
4412                     if ( state.backtracking==0 ) stream_73.add(char_literal116);
4413
4414                     pushFollow(FOLLOW_type_in_value2743);
4415                     type117=type();
4416
4417                     state._fsp--;
4418                     if (state.failed) return retval;
4419                     if ( state.backtracking==0 ) stream_type.add(type117.getTree());
4420
4421
4422                     // AST REWRITE
4423                     // elements: value, type
4424                     // token labels: 
4425                     // rule labels: retval
4426                     // token list labels: 
4427                     // rule list labels: 
4428                     // wildcard labels: 
4429                     if ( state.backtracking==0 ) {
4430                     retval.tree = root_0;
4431                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4432
4433                     root_0 = (CommonTree)adaptor.nil();
4434                     // 401:17: -> ^( VARIANT type $value)
4435                     {
4436                         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:401:20: ^( VARIANT type $value)
4437                         {
4438                         CommonTree root_1 = (CommonTree)adaptor.nil();
4439                         root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIANT, "VARIANT"), root_1);
4440
4441                         adaptor.addChild(root_1, stream_type.nextTree());
4442                         adaptor.addChild(root_1, stream_retval.nextTree());
4443
4444                         adaptor.addChild(root_0, root_1);
4445                         }
4446
4447                     }
4448
4449                     retval.tree = root_0;}
4450                     }
4451                     break;
4452
4453                 default :
4454                     break loop37;
4455                 }
4456             } while (true);
4457
4458
4459             }
4460
4461             retval.stop = input.LT(-1);
4462
4463             if ( state.backtracking==0 ) {
4464
4465             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4466             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4467             }
4468         }
4469         catch (RecognitionException re) {
4470             reportError(re);
4471             recover(input,re);
4472         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
4473
4474         }
4475         finally {
4476         }
4477         return retval;
4478     }
4479     // $ANTLR end "value"
4480
4481     public static class basicValue_return extends ParserRuleReturnScope {
4482         CommonTree tree;
4483         public Object getTree() { return tree; }
4484     };
4485
4486     // $ANTLR start "basicValue"
4487     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:404:1: basicValue : ( simpleValue | map | {...}? ID -> NO_VALUE | taggedValue );
4488     public final GraphParser.basicValue_return basicValue() throws RecognitionException {
4489         GraphParser.basicValue_return retval = new GraphParser.basicValue_return();
4490         retval.start = input.LT(1);
4491
4492         CommonTree root_0 = null;
4493
4494         Token ID120=null;
4495         GraphParser.simpleValue_return simpleValue118 = null;
4496
4497         GraphParser.map_return map119 = null;
4498
4499         GraphParser.taggedValue_return taggedValue121 = null;
4500
4501
4502         CommonTree ID120_tree=null;
4503         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
4504
4505         try {
4506             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:405:5: ( simpleValue | map | {...}? ID -> NO_VALUE | taggedValue )
4507             int alt38=4;
4508             int LA38_0 = input.LA(1);
4509
4510             if ( (LA38_0==LPAREN||LA38_0==LBRACKET||LA38_0==LCURLY||LA38_0==INT||LA38_0==FLOAT||LA38_0==STRING||(LA38_0>=79 && LA38_0<=80)) ) {
4511                 alt38=1;
4512             }
4513             else if ( (LA38_0==ID) ) {
4514                 int LA38_2 = input.LA(2);
4515
4516                 if ( (LA38_2==LCURLY) && ((input.LT(1).getText().equals("map")))) {
4517                     alt38=2;
4518                 }
4519                 else if ( ((input.LT(1).getText().equals("null"))) ) {
4520                     alt38=3;
4521                 }
4522                 else if ( (true) ) {
4523                     alt38=4;
4524                 }
4525                 else {
4526                     if (state.backtracking>0) {state.failed=true; return retval;}
4527                     NoViableAltException nvae =
4528                         new NoViableAltException("", 38, 2, input);
4529
4530                     throw nvae;
4531                 }
4532             }
4533             else {
4534                 if (state.backtracking>0) {state.failed=true; return retval;}
4535                 NoViableAltException nvae =
4536                     new NoViableAltException("", 38, 0, input);
4537
4538                 throw nvae;
4539             }
4540             switch (alt38) {
4541                 case 1 :
4542                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:405:7: simpleValue
4543                     {
4544                     root_0 = (CommonTree)adaptor.nil();
4545
4546                     pushFollow(FOLLOW_simpleValue_in_basicValue2775);
4547                     simpleValue118=simpleValue();
4548
4549                     state._fsp--;
4550                     if (state.failed) return retval;
4551                     if ( state.backtracking==0 ) adaptor.addChild(root_0, simpleValue118.getTree());
4552
4553                     }
4554                     break;
4555                 case 2 :
4556                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:406:7: map
4557                     {
4558                     root_0 = (CommonTree)adaptor.nil();
4559
4560                     pushFollow(FOLLOW_map_in_basicValue2783);
4561                     map119=map();
4562
4563                     state._fsp--;
4564                     if (state.failed) return retval;
4565                     if ( state.backtracking==0 ) adaptor.addChild(root_0, map119.getTree());
4566
4567                     }
4568                     break;
4569                 case 3 :
4570                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:407:7: {...}? ID
4571                     {
4572                     if ( !((input.LT(1).getText().equals("null"))) ) {
4573                         if (state.backtracking>0) {state.failed=true; return retval;}
4574                         throw new FailedPredicateException(input, "basicValue", "input.LT(1).getText().equals(\"null\")");
4575                     }
4576                     ID120=(Token)match(input,ID,FOLLOW_ID_in_basicValue2793); if (state.failed) return retval; 
4577                     if ( state.backtracking==0 ) stream_ID.add(ID120);
4578
4579
4580
4581                     // AST REWRITE
4582                     // elements: 
4583                     // token labels: 
4584                     // rule labels: retval
4585                     // token list labels: 
4586                     // rule list labels: 
4587                     // wildcard labels: 
4588                     if ( state.backtracking==0 ) {
4589                     retval.tree = root_0;
4590                     RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4591
4592                     root_0 = (CommonTree)adaptor.nil();
4593                     // 407:50: -> NO_VALUE
4594                     {
4595                         adaptor.addChild(root_0, (CommonTree)adaptor.create(NO_VALUE, "NO_VALUE"));
4596
4597                     }
4598
4599                     retval.tree = root_0;}
4600                     }
4601                     break;
4602                 case 4 :
4603                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:408:7: taggedValue
4604                     {
4605                     root_0 = (CommonTree)adaptor.nil();
4606
4607                     pushFollow(FOLLOW_taggedValue_in_basicValue2805);
4608                     taggedValue121=taggedValue();
4609
4610                     state._fsp--;
4611                     if (state.failed) return retval;
4612                     if ( state.backtracking==0 ) adaptor.addChild(root_0, taggedValue121.getTree());
4613
4614                     }
4615                     break;
4616
4617             }
4618             retval.stop = input.LT(-1);
4619
4620             if ( state.backtracking==0 ) {
4621
4622             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4623             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4624             }
4625         }
4626         catch (RecognitionException re) {
4627             reportError(re);
4628             recover(input,re);
4629         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
4630
4631         }
4632         finally {
4633         }
4634         return retval;
4635     }
4636     // $ANTLR end "basicValue"
4637
4638     public static class simpleValue_return extends ParserRuleReturnScope {
4639         CommonTree tree;
4640         public Object getTree() { return tree; }
4641     };
4642
4643     // $ANTLR start "simpleValue"
4644     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:411:1: simpleValue : ( string | number | boolean_ | array | tuple | record );
4645     public final GraphParser.simpleValue_return simpleValue() throws RecognitionException {
4646         GraphParser.simpleValue_return retval = new GraphParser.simpleValue_return();
4647         retval.start = input.LT(1);
4648
4649         CommonTree root_0 = null;
4650
4651         GraphParser.string_return string122 = null;
4652
4653         GraphParser.number_return number123 = null;
4654
4655         GraphParser.boolean__return boolean_124 = null;
4656
4657         GraphParser.array_return array125 = null;
4658
4659         GraphParser.tuple_return tuple126 = null;
4660
4661         GraphParser.record_return record127 = null;
4662
4663
4664
4665         try {
4666             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:412:5: ( string | number | boolean_ | array | tuple | record )
4667             int alt39=6;
4668             switch ( input.LA(1) ) {
4669             case STRING:
4670                 {
4671                 alt39=1;
4672                 }
4673                 break;
4674             case INT:
4675             case FLOAT:
4676                 {
4677                 alt39=2;
4678                 }
4679                 break;
4680             case 79:
4681             case 80:
4682                 {
4683                 alt39=3;
4684                 }
4685                 break;
4686             case LBRACKET:
4687                 {
4688                 alt39=4;
4689                 }
4690                 break;
4691             case LPAREN:
4692                 {
4693                 alt39=5;
4694                 }
4695                 break;
4696             case LCURLY:
4697                 {
4698                 alt39=6;
4699                 }
4700                 break;
4701             default:
4702                 if (state.backtracking>0) {state.failed=true; return retval;}
4703                 NoViableAltException nvae =
4704                     new NoViableAltException("", 39, 0, input);
4705
4706                 throw nvae;
4707             }
4708
4709             switch (alt39) {
4710                 case 1 :
4711                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:412:7: string
4712                     {
4713                     root_0 = (CommonTree)adaptor.nil();
4714
4715                     pushFollow(FOLLOW_string_in_simpleValue2830);
4716                     string122=string();
4717
4718                     state._fsp--;
4719                     if (state.failed) return retval;
4720                     if ( state.backtracking==0 ) adaptor.addChild(root_0, string122.getTree());
4721
4722                     }
4723                     break;
4724                 case 2 :
4725                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:413:7: number
4726                     {
4727                     root_0 = (CommonTree)adaptor.nil();
4728
4729                     pushFollow(FOLLOW_number_in_simpleValue2838);
4730                     number123=number();
4731
4732                     state._fsp--;
4733                     if (state.failed) return retval;
4734                     if ( state.backtracking==0 ) adaptor.addChild(root_0, number123.getTree());
4735
4736                     }
4737                     break;
4738                 case 3 :
4739                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:414:7: boolean_
4740                     {
4741                     root_0 = (CommonTree)adaptor.nil();
4742
4743                     pushFollow(FOLLOW_boolean__in_simpleValue2846);
4744                     boolean_124=boolean_();
4745
4746                     state._fsp--;
4747                     if (state.failed) return retval;
4748                     if ( state.backtracking==0 ) adaptor.addChild(root_0, boolean_124.getTree());
4749
4750                     }
4751                     break;
4752                 case 4 :
4753                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:415:7: array
4754                     {
4755                     root_0 = (CommonTree)adaptor.nil();
4756
4757                     pushFollow(FOLLOW_array_in_simpleValue2854);
4758                     array125=array();
4759
4760                     state._fsp--;
4761                     if (state.failed) return retval;
4762                     if ( state.backtracking==0 ) adaptor.addChild(root_0, array125.getTree());
4763
4764                     }
4765                     break;
4766                 case 5 :
4767                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:416:7: tuple
4768                     {
4769                     root_0 = (CommonTree)adaptor.nil();
4770
4771                     pushFollow(FOLLOW_tuple_in_simpleValue2862);
4772                     tuple126=tuple();
4773
4774                     state._fsp--;
4775                     if (state.failed) return retval;
4776                     if ( state.backtracking==0 ) adaptor.addChild(root_0, tuple126.getTree());
4777
4778                     }
4779                     break;
4780                 case 6 :
4781                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:417:7: record
4782                     {
4783                     root_0 = (CommonTree)adaptor.nil();
4784
4785                     pushFollow(FOLLOW_record_in_simpleValue2870);
4786                     record127=record();
4787
4788                     state._fsp--;
4789                     if (state.failed) return retval;
4790                     if ( state.backtracking==0 ) adaptor.addChild(root_0, record127.getTree());
4791
4792                     }
4793                     break;
4794
4795             }
4796             retval.stop = input.LT(-1);
4797
4798             if ( state.backtracking==0 ) {
4799
4800             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4801             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4802             }
4803         }
4804         catch (RecognitionException re) {
4805             reportError(re);
4806             recover(input,re);
4807         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
4808
4809         }
4810         finally {
4811         }
4812         return retval;
4813     }
4814     // $ANTLR end "simpleValue"
4815
4816     public static class array_return extends ParserRuleReturnScope {
4817         CommonTree tree;
4818         public Object getTree() { return tree; }
4819     };
4820
4821     // $ANTLR start "array"
4822     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:420:1: array : LBRACKET ( value ( ',' value )* )? RBRACKET -> ^( ARRAY ( value )* ) ;
4823     public final GraphParser.array_return array() throws RecognitionException {
4824         GraphParser.array_return retval = new GraphParser.array_return();
4825         retval.start = input.LT(1);
4826
4827         CommonTree root_0 = null;
4828
4829         Token LBRACKET128=null;
4830         Token char_literal130=null;
4831         Token RBRACKET132=null;
4832         GraphParser.value_return value129 = null;
4833
4834         GraphParser.value_return value131 = null;
4835
4836
4837         CommonTree LBRACKET128_tree=null;
4838         CommonTree char_literal130_tree=null;
4839         CommonTree RBRACKET132_tree=null;
4840         RewriteRuleTokenStream stream_LBRACKET=new RewriteRuleTokenStream(adaptor,"token LBRACKET");
4841         RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78");
4842         RewriteRuleTokenStream stream_RBRACKET=new RewriteRuleTokenStream(adaptor,"token RBRACKET");
4843         RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value");
4844         try {
4845             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:5: ( LBRACKET ( value ( ',' value )* )? RBRACKET -> ^( ARRAY ( value )* ) )
4846             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:7: LBRACKET ( value ( ',' value )* )? RBRACKET
4847             {
4848             LBRACKET128=(Token)match(input,LBRACKET,FOLLOW_LBRACKET_in_array2891); if (state.failed) return retval; 
4849             if ( state.backtracking==0 ) stream_LBRACKET.add(LBRACKET128);
4850
4851             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:16: ( value ( ',' value )* )?
4852             int alt41=2;
4853             int LA41_0 = input.LA(1);
4854
4855             if ( (LA41_0==ID||LA41_0==LPAREN||LA41_0==LBRACKET||LA41_0==LCURLY||LA41_0==INT||LA41_0==FLOAT||LA41_0==STRING||(LA41_0>=79 && LA41_0<=80)) ) {
4856                 alt41=1;
4857             }
4858             switch (alt41) {
4859                 case 1 :
4860                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:17: value ( ',' value )*
4861                     {
4862                     pushFollow(FOLLOW_value_in_array2894);
4863                     value129=value();
4864
4865                     state._fsp--;
4866                     if (state.failed) return retval;
4867                     if ( state.backtracking==0 ) stream_value.add(value129.getTree());
4868                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:23: ( ',' value )*
4869                     loop40:
4870                     do {
4871                         int alt40=2;
4872                         int LA40_0 = input.LA(1);
4873
4874                         if ( (LA40_0==78) ) {
4875                             alt40=1;
4876                         }
4877
4878
4879                         switch (alt40) {
4880                         case 1 :
4881                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:24: ',' value
4882                             {
4883                             char_literal130=(Token)match(input,78,FOLLOW_78_in_array2897); if (state.failed) return retval; 
4884                             if ( state.backtracking==0 ) stream_78.add(char_literal130);
4885
4886                             pushFollow(FOLLOW_value_in_array2899);
4887                             value131=value();
4888
4889                             state._fsp--;
4890                             if (state.failed) return retval;
4891                             if ( state.backtracking==0 ) stream_value.add(value131.getTree());
4892
4893                             }
4894                             break;
4895
4896                         default :
4897                             break loop40;
4898                         }
4899                     } while (true);
4900
4901
4902                     }
4903                     break;
4904
4905             }
4906
4907             RBRACKET132=(Token)match(input,RBRACKET,FOLLOW_RBRACKET_in_array2905); if (state.failed) return retval; 
4908             if ( state.backtracking==0 ) stream_RBRACKET.add(RBRACKET132);
4909
4910
4911
4912             // AST REWRITE
4913             // elements: value
4914             // token labels: 
4915             // rule labels: retval
4916             // token list labels: 
4917             // rule list labels: 
4918             // wildcard labels: 
4919             if ( state.backtracking==0 ) {
4920             retval.tree = root_0;
4921             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4922
4923             root_0 = (CommonTree)adaptor.nil();
4924             // 422:5: -> ^( ARRAY ( value )* )
4925             {
4926                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:422:8: ^( ARRAY ( value )* )
4927                 {
4928                 CommonTree root_1 = (CommonTree)adaptor.nil();
4929                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ARRAY, "ARRAY"), root_1);
4930
4931                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:422:16: ( value )*
4932                 while ( stream_value.hasNext() ) {
4933                     adaptor.addChild(root_1, stream_value.nextTree());
4934
4935                 }
4936                 stream_value.reset();
4937
4938                 adaptor.addChild(root_0, root_1);
4939                 }
4940
4941             }
4942
4943             retval.tree = root_0;}
4944             }
4945
4946             retval.stop = input.LT(-1);
4947
4948             if ( state.backtracking==0 ) {
4949
4950             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4951             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4952             }
4953         }
4954         catch (RecognitionException re) {
4955             reportError(re);
4956             recover(input,re);
4957         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
4958
4959         }
4960         finally {
4961         }
4962         return retval;
4963     }
4964     // $ANTLR end "array"
4965
4966     public static class tuple_return extends ParserRuleReturnScope {
4967         CommonTree tree;
4968         public Object getTree() { return tree; }
4969     };
4970
4971     // $ANTLR start "tuple"
4972     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:425:1: tuple : LPAREN ( value ( ',' value )* )? RPAREN -> ^( TUPLE ( value )* ) ;
4973     public final GraphParser.tuple_return tuple() throws RecognitionException {
4974         GraphParser.tuple_return retval = new GraphParser.tuple_return();
4975         retval.start = input.LT(1);
4976
4977         CommonTree root_0 = null;
4978
4979         Token LPAREN133=null;
4980         Token char_literal135=null;
4981         Token RPAREN137=null;
4982         GraphParser.value_return value134 = null;
4983
4984         GraphParser.value_return value136 = null;
4985
4986
4987         CommonTree LPAREN133_tree=null;
4988         CommonTree char_literal135_tree=null;
4989         CommonTree RPAREN137_tree=null;
4990         RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78");
4991         RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
4992         RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
4993         RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value");
4994         try {
4995             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:5: ( LPAREN ( value ( ',' value )* )? RPAREN -> ^( TUPLE ( value )* ) )
4996             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:7: LPAREN ( value ( ',' value )* )? RPAREN
4997             {
4998             LPAREN133=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_tuple2937); if (state.failed) return retval; 
4999             if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN133);
5000
5001             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:14: ( value ( ',' value )* )?
5002             int alt43=2;
5003             int LA43_0 = input.LA(1);
5004
5005             if ( (LA43_0==ID||LA43_0==LPAREN||LA43_0==LBRACKET||LA43_0==LCURLY||LA43_0==INT||LA43_0==FLOAT||LA43_0==STRING||(LA43_0>=79 && LA43_0<=80)) ) {
5006                 alt43=1;
5007             }
5008             switch (alt43) {
5009                 case 1 :
5010                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:15: value ( ',' value )*
5011                     {
5012                     pushFollow(FOLLOW_value_in_tuple2940);
5013                     value134=value();
5014
5015                     state._fsp--;
5016                     if (state.failed) return retval;
5017                     if ( state.backtracking==0 ) stream_value.add(value134.getTree());
5018                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:21: ( ',' value )*
5019                     loop42:
5020                     do {
5021                         int alt42=2;
5022                         int LA42_0 = input.LA(1);
5023
5024                         if ( (LA42_0==78) ) {
5025                             alt42=1;
5026                         }
5027
5028
5029                         switch (alt42) {
5030                         case 1 :
5031                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:22: ',' value
5032                             {
5033                             char_literal135=(Token)match(input,78,FOLLOW_78_in_tuple2943); if (state.failed) return retval; 
5034                             if ( state.backtracking==0 ) stream_78.add(char_literal135);
5035
5036                             pushFollow(FOLLOW_value_in_tuple2945);
5037                             value136=value();
5038
5039                             state._fsp--;
5040                             if (state.failed) return retval;
5041                             if ( state.backtracking==0 ) stream_value.add(value136.getTree());
5042
5043                             }
5044                             break;
5045
5046                         default :
5047                             break loop42;
5048                         }
5049                     } while (true);
5050
5051
5052                     }
5053                     break;
5054
5055             }
5056
5057             RPAREN137=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_tuple2951); if (state.failed) return retval; 
5058             if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN137);
5059
5060
5061
5062             // AST REWRITE
5063             // elements: value
5064             // token labels: 
5065             // rule labels: retval
5066             // token list labels: 
5067             // rule list labels: 
5068             // wildcard labels: 
5069             if ( state.backtracking==0 ) {
5070             retval.tree = root_0;
5071             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5072
5073             root_0 = (CommonTree)adaptor.nil();
5074             // 427:5: -> ^( TUPLE ( value )* )
5075             {
5076                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:427:8: ^( TUPLE ( value )* )
5077                 {
5078                 CommonTree root_1 = (CommonTree)adaptor.nil();
5079                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TUPLE, "TUPLE"), root_1);
5080
5081                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:427:16: ( value )*
5082                 while ( stream_value.hasNext() ) {
5083                     adaptor.addChild(root_1, stream_value.nextTree());
5084
5085                 }
5086                 stream_value.reset();
5087
5088                 adaptor.addChild(root_0, root_1);
5089                 }
5090
5091             }
5092
5093             retval.tree = root_0;}
5094             }
5095
5096             retval.stop = input.LT(-1);
5097
5098             if ( state.backtracking==0 ) {
5099
5100             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5101             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5102             }
5103         }
5104         catch (RecognitionException re) {
5105             reportError(re);
5106             recover(input,re);
5107         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
5108
5109         }
5110         finally {
5111         }
5112         return retval;
5113     }
5114     // $ANTLR end "tuple"
5115
5116     public static class taggedValue_return extends ParserRuleReturnScope {
5117         CommonTree tree;
5118         public Object getTree() { return tree; }
5119     };
5120
5121     // $ANTLR start "taggedValue"
5122     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:430:1: taggedValue : ID ( simpleValue )? -> ^( TAGGED_VALUE ID ( simpleValue )? ) ;
5123     public final GraphParser.taggedValue_return taggedValue() throws RecognitionException {
5124         GraphParser.taggedValue_return retval = new GraphParser.taggedValue_return();
5125         retval.start = input.LT(1);
5126
5127         CommonTree root_0 = null;
5128
5129         Token ID138=null;
5130         GraphParser.simpleValue_return simpleValue139 = null;
5131
5132
5133         CommonTree ID138_tree=null;
5134         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
5135         RewriteRuleSubtreeStream stream_simpleValue=new RewriteRuleSubtreeStream(adaptor,"rule simpleValue");
5136         try {
5137             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:431:5: ( ID ( simpleValue )? -> ^( TAGGED_VALUE ID ( simpleValue )? ) )
5138             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:431:7: ID ( simpleValue )?
5139             {
5140             ID138=(Token)match(input,ID,FOLLOW_ID_in_taggedValue2983); if (state.failed) return retval; 
5141             if ( state.backtracking==0 ) stream_ID.add(ID138);
5142
5143             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:431:10: ( simpleValue )?
5144             int alt44=2;
5145             int LA44_0 = input.LA(1);
5146
5147             if ( (LA44_0==LPAREN||LA44_0==LBRACKET||LA44_0==LCURLY||LA44_0==INT||LA44_0==FLOAT||LA44_0==STRING||(LA44_0>=79 && LA44_0<=80)) ) {
5148                 alt44=1;
5149             }
5150             switch (alt44) {
5151                 case 1 :
5152                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:431:10: simpleValue
5153                     {
5154                     pushFollow(FOLLOW_simpleValue_in_taggedValue2985);
5155                     simpleValue139=simpleValue();
5156
5157                     state._fsp--;
5158                     if (state.failed) return retval;
5159                     if ( state.backtracking==0 ) stream_simpleValue.add(simpleValue139.getTree());
5160
5161                     }
5162                     break;
5163
5164             }
5165
5166
5167
5168             // AST REWRITE
5169             // elements: simpleValue, ID
5170             // token labels: 
5171             // rule labels: retval
5172             // token list labels: 
5173             // rule list labels: 
5174             // wildcard labels: 
5175             if ( state.backtracking==0 ) {
5176             retval.tree = root_0;
5177             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5178
5179             root_0 = (CommonTree)adaptor.nil();
5180             // 432:5: -> ^( TAGGED_VALUE ID ( simpleValue )? )
5181             {
5182                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:432:8: ^( TAGGED_VALUE ID ( simpleValue )? )
5183                 {
5184                 CommonTree root_1 = (CommonTree)adaptor.nil();
5185                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TAGGED_VALUE, "TAGGED_VALUE"), root_1);
5186
5187                 adaptor.addChild(root_1, stream_ID.nextNode());
5188                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:432:26: ( simpleValue )?
5189                 if ( stream_simpleValue.hasNext() ) {
5190                     adaptor.addChild(root_1, stream_simpleValue.nextTree());
5191
5192                 }
5193                 stream_simpleValue.reset();
5194
5195                 adaptor.addChild(root_0, root_1);
5196                 }
5197
5198             }
5199
5200             retval.tree = root_0;}
5201             }
5202
5203             retval.stop = input.LT(-1);
5204
5205             if ( state.backtracking==0 ) {
5206
5207             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5208             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5209             }
5210         }
5211         catch (RecognitionException re) {
5212             reportError(re);
5213             recover(input,re);
5214         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
5215
5216         }
5217         finally {
5218         }
5219         return retval;
5220     }
5221     // $ANTLR end "taggedValue"
5222
5223     public static class record_return extends ParserRuleReturnScope {
5224         CommonTree tree;
5225         public Object getTree() { return tree; }
5226     };
5227
5228     // $ANTLR start "record"
5229     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:435:1: record : LCURLY ( recordAssignment ( ',' recordAssignment )* )? RCURLY -> ^( RECORD ( recordAssignment )* ) ;
5230     public final GraphParser.record_return record() throws RecognitionException {
5231         GraphParser.record_return retval = new GraphParser.record_return();
5232         retval.start = input.LT(1);
5233
5234         CommonTree root_0 = null;
5235
5236         Token LCURLY140=null;
5237         Token char_literal142=null;
5238         Token RCURLY144=null;
5239         GraphParser.recordAssignment_return recordAssignment141 = null;
5240
5241         GraphParser.recordAssignment_return recordAssignment143 = null;
5242
5243
5244         CommonTree LCURLY140_tree=null;
5245         CommonTree char_literal142_tree=null;
5246         CommonTree RCURLY144_tree=null;
5247         RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78");
5248         RewriteRuleTokenStream stream_LCURLY=new RewriteRuleTokenStream(adaptor,"token LCURLY");
5249         RewriteRuleTokenStream stream_RCURLY=new RewriteRuleTokenStream(adaptor,"token RCURLY");
5250         RewriteRuleSubtreeStream stream_recordAssignment=new RewriteRuleSubtreeStream(adaptor,"rule recordAssignment");
5251         try {
5252             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:5: ( LCURLY ( recordAssignment ( ',' recordAssignment )* )? RCURLY -> ^( RECORD ( recordAssignment )* ) )
5253             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:7: LCURLY ( recordAssignment ( ',' recordAssignment )* )? RCURLY
5254             {
5255             LCURLY140=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_record3020); if (state.failed) return retval; 
5256             if ( state.backtracking==0 ) stream_LCURLY.add(LCURLY140);
5257
5258             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:14: ( recordAssignment ( ',' recordAssignment )* )?
5259             int alt46=2;
5260             int LA46_0 = input.LA(1);
5261
5262             if ( (LA46_0==ID) ) {
5263                 alt46=1;
5264             }
5265             switch (alt46) {
5266                 case 1 :
5267                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:15: recordAssignment ( ',' recordAssignment )*
5268                     {
5269                     pushFollow(FOLLOW_recordAssignment_in_record3023);
5270                     recordAssignment141=recordAssignment();
5271
5272                     state._fsp--;
5273                     if (state.failed) return retval;
5274                     if ( state.backtracking==0 ) stream_recordAssignment.add(recordAssignment141.getTree());
5275                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:32: ( ',' recordAssignment )*
5276                     loop45:
5277                     do {
5278                         int alt45=2;
5279                         int LA45_0 = input.LA(1);
5280
5281                         if ( (LA45_0==78) ) {
5282                             alt45=1;
5283                         }
5284
5285
5286                         switch (alt45) {
5287                         case 1 :
5288                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:33: ',' recordAssignment
5289                             {
5290                             char_literal142=(Token)match(input,78,FOLLOW_78_in_record3026); if (state.failed) return retval; 
5291                             if ( state.backtracking==0 ) stream_78.add(char_literal142);
5292
5293                             pushFollow(FOLLOW_recordAssignment_in_record3028);
5294                             recordAssignment143=recordAssignment();
5295
5296                             state._fsp--;
5297                             if (state.failed) return retval;
5298                             if ( state.backtracking==0 ) stream_recordAssignment.add(recordAssignment143.getTree());
5299
5300                             }
5301                             break;
5302
5303                         default :
5304                             break loop45;
5305                         }
5306                     } while (true);
5307
5308
5309                     }
5310                     break;
5311
5312             }
5313
5314             RCURLY144=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_record3034); if (state.failed) return retval; 
5315             if ( state.backtracking==0 ) stream_RCURLY.add(RCURLY144);
5316
5317
5318
5319             // AST REWRITE
5320             // elements: recordAssignment
5321             // token labels: 
5322             // rule labels: retval
5323             // token list labels: 
5324             // rule list labels: 
5325             // wildcard labels: 
5326             if ( state.backtracking==0 ) {
5327             retval.tree = root_0;
5328             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5329
5330             root_0 = (CommonTree)adaptor.nil();
5331             // 437:5: -> ^( RECORD ( recordAssignment )* )
5332             {
5333                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:437:8: ^( RECORD ( recordAssignment )* )
5334                 {
5335                 CommonTree root_1 = (CommonTree)adaptor.nil();
5336                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RECORD, "RECORD"), root_1);
5337
5338                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:437:17: ( recordAssignment )*
5339                 while ( stream_recordAssignment.hasNext() ) {
5340                     adaptor.addChild(root_1, stream_recordAssignment.nextTree());
5341
5342                 }
5343                 stream_recordAssignment.reset();
5344
5345                 adaptor.addChild(root_0, root_1);
5346                 }
5347
5348             }
5349
5350             retval.tree = root_0;}
5351             }
5352
5353             retval.stop = input.LT(-1);
5354
5355             if ( state.backtracking==0 ) {
5356
5357             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5358             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5359             }
5360         }
5361         catch (RecognitionException re) {
5362             reportError(re);
5363             recover(input,re);
5364         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
5365
5366         }
5367         finally {
5368         }
5369         return retval;
5370     }
5371     // $ANTLR end "record"
5372
5373     public static class recordAssignment_return extends ParserRuleReturnScope {
5374         CommonTree tree;
5375         public Object getTree() { return tree; }
5376     };
5377
5378     // $ANTLR start "recordAssignment"
5379     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:440:1: recordAssignment : ID '=' value -> ^( ASSIGNMENT ID value ) ;
5380     public final GraphParser.recordAssignment_return recordAssignment() throws RecognitionException {
5381         GraphParser.recordAssignment_return retval = new GraphParser.recordAssignment_return();
5382         retval.start = input.LT(1);
5383
5384         CommonTree root_0 = null;
5385
5386         Token ID145=null;
5387         Token char_literal146=null;
5388         GraphParser.value_return value147 = null;
5389
5390
5391         CommonTree ID145_tree=null;
5392         CommonTree char_literal146_tree=null;
5393         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
5394         RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74");
5395         RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value");
5396         try {
5397             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:441:5: ( ID '=' value -> ^( ASSIGNMENT ID value ) )
5398             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:441:7: ID '=' value
5399             {
5400             ID145=(Token)match(input,ID,FOLLOW_ID_in_recordAssignment3066); if (state.failed) return retval; 
5401             if ( state.backtracking==0 ) stream_ID.add(ID145);
5402
5403             char_literal146=(Token)match(input,74,FOLLOW_74_in_recordAssignment3068); if (state.failed) return retval; 
5404             if ( state.backtracking==0 ) stream_74.add(char_literal146);
5405
5406             pushFollow(FOLLOW_value_in_recordAssignment3070);
5407             value147=value();
5408
5409             state._fsp--;
5410             if (state.failed) return retval;
5411             if ( state.backtracking==0 ) stream_value.add(value147.getTree());
5412
5413
5414             // AST REWRITE
5415             // elements: ID, value
5416             // token labels: 
5417             // rule labels: retval
5418             // token list labels: 
5419             // rule list labels: 
5420             // wildcard labels: 
5421             if ( state.backtracking==0 ) {
5422             retval.tree = root_0;
5423             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5424
5425             root_0 = (CommonTree)adaptor.nil();
5426             // 442:5: -> ^( ASSIGNMENT ID value )
5427             {
5428                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:442:8: ^( ASSIGNMENT ID value )
5429                 {
5430                 CommonTree root_1 = (CommonTree)adaptor.nil();
5431                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ASSIGNMENT, "ASSIGNMENT"), root_1);
5432
5433                 adaptor.addChild(root_1, stream_ID.nextNode());
5434                 adaptor.addChild(root_1, stream_value.nextTree());
5435
5436                 adaptor.addChild(root_0, root_1);
5437                 }
5438
5439             }
5440
5441             retval.tree = root_0;}
5442             }
5443
5444             retval.stop = input.LT(-1);
5445
5446             if ( state.backtracking==0 ) {
5447
5448             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5449             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5450             }
5451         }
5452         catch (RecognitionException re) {
5453             reportError(re);
5454             recover(input,re);
5455         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
5456
5457         }
5458         finally {
5459         }
5460         return retval;
5461     }
5462     // $ANTLR end "recordAssignment"
5463
5464     public static class map_return extends ParserRuleReturnScope {
5465         CommonTree tree;
5466         public Object getTree() { return tree; }
5467     };
5468
5469     // $ANTLR start "map"
5470     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:1: map : {...}? => ID LCURLY ( mapAssignment ( ',' mapAssignment )* )? RCURLY -> ^( MAP ( mapAssignment )* ) ;
5471     public final GraphParser.map_return map() throws RecognitionException {
5472         GraphParser.map_return retval = new GraphParser.map_return();
5473         retval.start = input.LT(1);
5474
5475         CommonTree root_0 = null;
5476
5477         Token ID148=null;
5478         Token LCURLY149=null;
5479         Token char_literal151=null;
5480         Token RCURLY153=null;
5481         GraphParser.mapAssignment_return mapAssignment150 = null;
5482
5483         GraphParser.mapAssignment_return mapAssignment152 = null;
5484
5485
5486         CommonTree ID148_tree=null;
5487         CommonTree LCURLY149_tree=null;
5488         CommonTree char_literal151_tree=null;
5489         CommonTree RCURLY153_tree=null;
5490         RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78");
5491         RewriteRuleTokenStream stream_LCURLY=new RewriteRuleTokenStream(adaptor,"token LCURLY");
5492         RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
5493         RewriteRuleTokenStream stream_RCURLY=new RewriteRuleTokenStream(adaptor,"token RCURLY");
5494         RewriteRuleSubtreeStream stream_mapAssignment=new RewriteRuleSubtreeStream(adaptor,"rule mapAssignment");
5495         try {
5496             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:5: ({...}? => ID LCURLY ( mapAssignment ( ',' mapAssignment )* )? RCURLY -> ^( MAP ( mapAssignment )* ) )
5497             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:7: {...}? => ID LCURLY ( mapAssignment ( ',' mapAssignment )* )? RCURLY
5498             {
5499             if ( !((input.LT(1).getText().equals("map"))) ) {
5500                 if (state.backtracking>0) {state.failed=true; return retval;}
5501                 throw new FailedPredicateException(input, "map", "input.LT(1).getText().equals(\"map\")");
5502             }
5503             ID148=(Token)match(input,ID,FOLLOW_ID_in_map3100); if (state.failed) return retval; 
5504             if ( state.backtracking==0 ) stream_ID.add(ID148);
5505
5506             LCURLY149=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_map3102); if (state.failed) return retval; 
5507             if ( state.backtracking==0 ) stream_LCURLY.add(LCURLY149);
5508
5509             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:58: ( mapAssignment ( ',' mapAssignment )* )?
5510             int alt48=2;
5511             int LA48_0 = input.LA(1);
5512
5513             if ( (LA48_0==ID||LA48_0==LPAREN||LA48_0==LBRACKET||LA48_0==LCURLY||LA48_0==INT||LA48_0==FLOAT||LA48_0==STRING||(LA48_0>=79 && LA48_0<=80)) ) {
5514                 alt48=1;
5515             }
5516             switch (alt48) {
5517                 case 1 :
5518                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:59: mapAssignment ( ',' mapAssignment )*
5519                     {
5520                     pushFollow(FOLLOW_mapAssignment_in_map3105);
5521                     mapAssignment150=mapAssignment();
5522
5523                     state._fsp--;
5524                     if (state.failed) return retval;
5525                     if ( state.backtracking==0 ) stream_mapAssignment.add(mapAssignment150.getTree());
5526                     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:73: ( ',' mapAssignment )*
5527                     loop47:
5528                     do {
5529                         int alt47=2;
5530                         int LA47_0 = input.LA(1);
5531
5532                         if ( (LA47_0==78) ) {
5533                             alt47=1;
5534                         }
5535
5536
5537                         switch (alt47) {
5538                         case 1 :
5539                             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:74: ',' mapAssignment
5540                             {
5541                             char_literal151=(Token)match(input,78,FOLLOW_78_in_map3108); if (state.failed) return retval; 
5542                             if ( state.backtracking==0 ) stream_78.add(char_literal151);
5543
5544                             pushFollow(FOLLOW_mapAssignment_in_map3110);
5545                             mapAssignment152=mapAssignment();
5546
5547                             state._fsp--;
5548                             if (state.failed) return retval;
5549                             if ( state.backtracking==0 ) stream_mapAssignment.add(mapAssignment152.getTree());
5550
5551                             }
5552                             break;
5553
5554                         default :
5555                             break loop47;
5556                         }
5557                     } while (true);
5558
5559
5560                     }
5561                     break;
5562
5563             }
5564
5565             RCURLY153=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_map3116); if (state.failed) return retval; 
5566             if ( state.backtracking==0 ) stream_RCURLY.add(RCURLY153);
5567
5568
5569
5570             // AST REWRITE
5571             // elements: mapAssignment
5572             // token labels: 
5573             // rule labels: retval
5574             // token list labels: 
5575             // rule list labels: 
5576             // wildcard labels: 
5577             if ( state.backtracking==0 ) {
5578             retval.tree = root_0;
5579             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5580
5581             root_0 = (CommonTree)adaptor.nil();
5582             // 446:5: -> ^( MAP ( mapAssignment )* )
5583             {
5584                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:446:8: ^( MAP ( mapAssignment )* )
5585                 {
5586                 CommonTree root_1 = (CommonTree)adaptor.nil();
5587                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(MAP, "MAP"), root_1);
5588
5589                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:446:14: ( mapAssignment )*
5590                 while ( stream_mapAssignment.hasNext() ) {
5591                     adaptor.addChild(root_1, stream_mapAssignment.nextTree());
5592
5593                 }
5594                 stream_mapAssignment.reset();
5595
5596                 adaptor.addChild(root_0, root_1);
5597                 }
5598
5599             }
5600
5601             retval.tree = root_0;}
5602             }
5603
5604             retval.stop = input.LT(-1);
5605
5606             if ( state.backtracking==0 ) {
5607
5608             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5609             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5610             }
5611         }
5612         catch (RecognitionException re) {
5613             reportError(re);
5614             recover(input,re);
5615         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
5616
5617         }
5618         finally {
5619         }
5620         return retval;
5621     }
5622     // $ANTLR end "map"
5623
5624     public static class mapAssignment_return extends ParserRuleReturnScope {
5625         CommonTree tree;
5626         public Object getTree() { return tree; }
5627     };
5628
5629     // $ANTLR start "mapAssignment"
5630     // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:449:1: mapAssignment : value '=' value -> ^( ASSIGNMENT ( value )* ) ;
5631     public final GraphParser.mapAssignment_return mapAssignment() throws RecognitionException {
5632         GraphParser.mapAssignment_return retval = new GraphParser.mapAssignment_return();
5633         retval.start = input.LT(1);
5634
5635         CommonTree root_0 = null;
5636
5637         Token char_literal155=null;
5638         GraphParser.value_return value154 = null;
5639
5640         GraphParser.value_return value156 = null;
5641
5642
5643         CommonTree char_literal155_tree=null;
5644         RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74");
5645         RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value");
5646         try {
5647             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:450:5: ( value '=' value -> ^( ASSIGNMENT ( value )* ) )
5648             // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:450:7: value '=' value
5649             {
5650             pushFollow(FOLLOW_value_in_mapAssignment3148);
5651             value154=value();
5652
5653             state._fsp--;
5654             if (state.failed) return retval;
5655             if ( state.backtracking==0 ) stream_value.add(value154.getTree());
5656             char_literal155=(Token)match(input,74,FOLLOW_74_in_mapAssignment3150); if (state.failed) return retval; 
5657             if ( state.backtracking==0 ) stream_74.add(char_literal155);
5658
5659             pushFollow(FOLLOW_value_in_mapAssignment3152);
5660             value156=value();
5661
5662             state._fsp--;
5663             if (state.failed) return retval;
5664             if ( state.backtracking==0 ) stream_value.add(value156.getTree());
5665
5666
5667             // AST REWRITE
5668             // elements: value
5669             // token labels: 
5670             // rule labels: retval
5671             // token list labels: 
5672             // rule list labels: 
5673             // wildcard labels: 
5674             if ( state.backtracking==0 ) {
5675             retval.tree = root_0;
5676             RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5677
5678             root_0 = (CommonTree)adaptor.nil();
5679             // 451:5: -> ^( ASSIGNMENT ( value )* )
5680             {
5681                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:451:8: ^( ASSIGNMENT ( value )* )
5682                 {
5683                 CommonTree root_1 = (CommonTree)adaptor.nil();
5684                 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ASSIGNMENT, "ASSIGNMENT"), root_1);
5685
5686                 // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:451:21: ( value )*
5687                 while ( stream_value.hasNext() ) {
5688                     adaptor.addChild(root_1, stream_value.nextTree());
5689
5690                 }
5691                 stream_value.reset();
5692
5693                 adaptor.addChild(root_0, root_1);
5694                 }
5695
5696             }
5697
5698             retval.tree = root_0;}
5699             }
5700
5701             retval.stop = input.LT(-1);
5702
5703             if ( state.backtracking==0 ) {
5704
5705             retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5706             adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5707             }
5708         }
5709         catch (RecognitionException re) {
5710             reportError(re);
5711             recover(input,re);
5712         retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
5713
5714         }
5715         finally {
5716         }
5717         return retval;
5718     }
5719     // $ANTLR end "mapAssignment"
5720
5721     // $ANTLR start synpred1_Graph
5722     public final void synpred1_Graph_fragment() throws RecognitionException {   
5723         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:22: ( arrayType )
5724         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:23: arrayType
5725         {
5726         pushFollow(FOLLOW_arrayType_in_synpred1_Graph2075);
5727         arrayType();
5728
5729         state._fsp--;
5730         if (state.failed) return ;
5731
5732         }
5733     }
5734     // $ANTLR end synpred1_Graph
5735
5736     // $ANTLR start synpred2_Graph
5737     public final void synpred2_Graph_fragment() throws RecognitionException {   
5738         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:11: ( LPAREN )
5739         // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:12: LPAREN
5740         {
5741         match(input,LPAREN,FOLLOW_LPAREN_in_synpred2_Graph2354); if (state.failed) return ;
5742
5743         }
5744     }
5745     // $ANTLR end synpred2_Graph
5746
5747     // Delegated rules
5748
5749     public final boolean synpred1_Graph() {
5750         state.backtracking++;
5751         int start = input.mark();
5752         try {
5753             synpred1_Graph_fragment(); // can never throw exception
5754         } catch (RecognitionException re) {
5755             System.err.println("impossible: "+re);
5756         }
5757         boolean success = !state.failed;
5758         input.rewind(start);
5759         state.backtracking--;
5760         state.failed=false;
5761         return success;
5762     }
5763     public final boolean synpred2_Graph() {
5764         state.backtracking++;
5765         int start = input.mark();
5766         try {
5767             synpred2_Graph_fragment(); // can never throw exception
5768         } catch (RecognitionException re) {
5769             System.err.println("impossible: "+re);
5770         }
5771         boolean success = !state.failed;
5772         input.rewind(start);
5773         state.backtracking--;
5774         state.failed=false;
5775         return success;
5776     }
5777
5778
5779     protected DFA13 dfa13 = new DFA13(this);
5780     protected DFA22 dfa22 = new DFA22(this);
5781     protected DFA31 dfa31 = new DFA31(this);
5782     static final String DFA13_eotS =
5783         "\15\uffff";
5784     static final String DFA13_eofS =
5785         "\15\uffff";
5786     static final String DFA13_minS =
5787         "\1\55\1\0\13\uffff";
5788     static final String DFA13_maxS =
5789         "\1\120\1\0\13\uffff";
5790     static final String DFA13_acceptS =
5791         "\2\uffff\1\2\11\uffff\1\1";
5792     static final String DFA13_specialS =
5793         "\1\uffff\1\0\13\uffff}>";
5794     static final String[] DFA13_transitionS = {
5795             "\1\1\2\uffff\1\2\1\uffff\1\2\1\uffff\1\2\1\uffff\1\2\1\uffff"+
5796             "\1\2\4\uffff\2\2\14\uffff\2\2\2\uffff\2\2",
5797             "\1\uffff",
5798             "",
5799             "",
5800             "",
5801             "",
5802             "",
5803             "",
5804             "",
5805             "",
5806             "",
5807             "",
5808             ""
5809     };
5810
5811     static final short[] DFA13_eot = DFA.unpackEncodedString(DFA13_eotS);
5812     static final short[] DFA13_eof = DFA.unpackEncodedString(DFA13_eofS);
5813     static final char[] DFA13_min = DFA.unpackEncodedStringToUnsignedChars(DFA13_minS);
5814     static final char[] DFA13_max = DFA.unpackEncodedStringToUnsignedChars(DFA13_maxS);
5815     static final short[] DFA13_accept = DFA.unpackEncodedString(DFA13_acceptS);
5816     static final short[] DFA13_special = DFA.unpackEncodedString(DFA13_specialS);
5817     static final short[][] DFA13_transition;
5818
5819     static {
5820         int numStates = DFA13_transitionS.length;
5821         DFA13_transition = new short[numStates][];
5822         for (int i=0; i<numStates; i++) {
5823             DFA13_transition[i] = DFA.unpackEncodedString(DFA13_transitionS[i]);
5824         }
5825     }
5826
5827     class DFA13 extends DFA {
5828
5829         public DFA13(BaseRecognizer recognizer) {
5830             this.recognizer = recognizer;
5831             this.decisionNumber = 13;
5832             this.eot = DFA13_eot;
5833             this.eof = DFA13_eof;
5834             this.min = DFA13_min;
5835             this.max = DFA13_max;
5836             this.accept = DFA13_accept;
5837             this.special = DFA13_special;
5838             this.transition = DFA13_transition;
5839         }
5840         public String getDescription() {
5841             return "253:5: ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) )";
5842         }
5843         public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
5844             TokenStream input = (TokenStream)_input;
5845                 int _s = s;
5846             switch ( s ) {
5847                     case 0 : 
5848                         int LA13_1 = input.LA(1);
5849
5850                          
5851                         int index13_1 = input.index();
5852                         input.rewind();
5853                         s = -1;
5854                         if ( ((input.LT(1).getText().equals("template"))) ) {s = 12;}
5855
5856                         else if ( (true) ) {s = 2;}
5857
5858                          
5859                         input.seek(index13_1);
5860                         if ( s>=0 ) return s;
5861                         break;
5862             }
5863             if (state.backtracking>0) {state.failed=true; return -1;}
5864             NoViableAltException nvae =
5865                 new NoViableAltException(getDescription(), 13, _s, input);
5866             error(nvae);
5867             throw nvae;
5868         }
5869     }
5870     static final String DFA22_eotS =
5871         "\14\uffff";
5872     static final String DFA22_eofS =
5873         "\1\4\13\uffff";
5874     static final String DFA22_minS =
5875         "\1\55\2\uffff\1\0\10\uffff";
5876     static final String DFA22_maxS =
5877         "\1\116\2\uffff\1\0\10\uffff";
5878     static final String DFA22_acceptS =
5879         "\1\uffff\2\1\1\uffff\1\2\7\uffff";
5880     static final String DFA22_specialS =
5881         "\1\0\2\uffff\1\1\10\uffff}>";
5882     static final String[] DFA22_transitionS = {
5883             "\1\3\2\uffff\1\1\1\4\1\uffff\1\4\1\2\1\4\23\uffff\2\4\2\uffff"+
5884             "\2\4",
5885             "",
5886             "",
5887             "\1\uffff",
5888             "",
5889             "",
5890             "",
5891             "",
5892             "",
5893             "",
5894             "",
5895             ""
5896     };
5897
5898     static final short[] DFA22_eot = DFA.unpackEncodedString(DFA22_eotS);
5899     static final short[] DFA22_eof = DFA.unpackEncodedString(DFA22_eofS);
5900     static final char[] DFA22_min = DFA.unpackEncodedStringToUnsignedChars(DFA22_minS);
5901     static final char[] DFA22_max = DFA.unpackEncodedStringToUnsignedChars(DFA22_maxS);
5902     static final short[] DFA22_accept = DFA.unpackEncodedString(DFA22_acceptS);
5903     static final short[] DFA22_special = DFA.unpackEncodedString(DFA22_specialS);
5904     static final short[][] DFA22_transition;
5905
5906     static {
5907         int numStates = DFA22_transitionS.length;
5908         DFA22_transition = new short[numStates][];
5909         for (int i=0; i<numStates; i++) {
5910             DFA22_transition[i] = DFA.unpackEncodedString(DFA22_transitionS[i]);
5911         }
5912     }
5913
5914     class DFA22 extends DFA {
5915
5916         public DFA22(BaseRecognizer recognizer) {
5917             this.recognizer = recognizer;
5918             this.decisionNumber = 22;
5919             this.eot = DFA22_eot;
5920             this.eof = DFA22_eof;
5921             this.min = DFA22_min;
5922             this.max = DFA22_max;
5923             this.accept = DFA22_accept;
5924             this.special = DFA22_special;
5925             this.transition = DFA22_transition;
5926         }
5927         public String getDescription() {
5928             return "317:21: ( ( arrayType )=> arrayType )?";
5929         }
5930         public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
5931             TokenStream input = (TokenStream)_input;
5932                 int _s = s;
5933             switch ( s ) {
5934                     case 0 : 
5935                         int LA22_0 = input.LA(1);
5936
5937                          
5938                         int index22_0 = input.index();
5939                         input.rewind();
5940                         s = -1;
5941                         if ( (LA22_0==LPAREN) && (synpred1_Graph())) {s = 1;}
5942
5943                         else if ( (LA22_0==LCURLY) && (synpred1_Graph())) {s = 2;}
5944
5945                         else if ( (LA22_0==ID) ) {s = 3;}
5946
5947                         else if ( (LA22_0==EOF||LA22_0==RPAREN||LA22_0==RBRACKET||LA22_0==RCURLY||(LA22_0>=73 && LA22_0<=74)||(LA22_0>=77 && LA22_0<=78)) ) {s = 4;}
5948
5949                          
5950                         input.seek(index22_0);
5951                         if ( s>=0 ) return s;
5952                         break;
5953                     case 1 : 
5954                         int LA22_3 = input.LA(1);
5955
5956                          
5957                         int index22_3 = input.index();
5958                         input.rewind();
5959                         s = -1;
5960                         if ( (synpred1_Graph()) ) {s = 2;}
5961
5962                         else if ( (true) ) {s = 4;}
5963
5964                          
5965                         input.seek(index22_3);
5966                         if ( s>=0 ) return s;
5967                         break;
5968             }
5969             if (state.backtracking>0) {state.failed=true; return -1;}
5970             NoViableAltException nvae =
5971                 new NoViableAltException(getDescription(), 22, _s, input);
5972             error(nvae);
5973             throw nvae;
5974         }
5975     }
5976     static final String DFA31_eotS =
5977         "\36\uffff";
5978     static final String DFA31_eofS =
5979         "\1\2\35\uffff";
5980     static final String DFA31_minS =
5981         "\1\4\1\0\34\uffff";
5982     static final String DFA31_maxS =
5983         "\1\120\1\0\34\uffff";
5984     static final String DFA31_acceptS =
5985         "\2\uffff\1\2\32\uffff\1\1";
5986     static final String DFA31_specialS =
5987         "\1\uffff\1\0\34\uffff}>";
5988     static final String[] DFA31_transitionS = {
5989             "\2\2\47\uffff\1\2\2\uffff\1\1\6\2\1\uffff\1\2\1\uffff\1\2\2"+
5990             "\uffff\2\2\4\uffff\16\2",
5991             "\1\uffff",
5992             "",
5993             "",
5994             "",
5995             "",
5996             "",
5997             "",
5998             "",
5999             "",
6000             "",
6001             "",
6002             "",
6003             "",
6004             "",
6005             "",
6006             "",
6007             "",
6008             "",
6009             "",
6010             "",
6011             "",
6012             "",
6013             "",
6014             "",
6015             "",
6016             "",
6017             "",
6018             "",
6019             ""
6020     };
6021
6022     static final short[] DFA31_eot = DFA.unpackEncodedString(DFA31_eotS);
6023     static final short[] DFA31_eof = DFA.unpackEncodedString(DFA31_eofS);
6024     static final char[] DFA31_min = DFA.unpackEncodedStringToUnsignedChars(DFA31_minS);
6025     static final char[] DFA31_max = DFA.unpackEncodedStringToUnsignedChars(DFA31_maxS);
6026     static final short[] DFA31_accept = DFA.unpackEncodedString(DFA31_acceptS);
6027     static final short[] DFA31_special = DFA.unpackEncodedString(DFA31_specialS);
6028     static final short[][] DFA31_transition;
6029
6030     static {
6031         int numStates = DFA31_transitionS.length;
6032         DFA31_transition = new short[numStates][];
6033         for (int i=0; i<numStates; i++) {
6034             DFA31_transition[i] = DFA.unpackEncodedString(DFA31_transitionS[i]);
6035         }
6036     }
6037
6038     class DFA31 extends DFA {
6039
6040         public DFA31(BaseRecognizer recognizer) {
6041             this.recognizer = recognizer;
6042             this.decisionNumber = 31;
6043             this.eot = DFA31_eot;
6044             this.eof = DFA31_eof;
6045             this.min = DFA31_min;
6046             this.max = DFA31_max;
6047             this.accept = DFA31_accept;
6048             this.special = DFA31_special;
6049             this.transition = DFA31_transition;
6050         }
6051         public String getDescription() {
6052             return "350:10: ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )?";
6053         }
6054         public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
6055             TokenStream input = (TokenStream)_input;
6056                 int _s = s;
6057             switch ( s ) {
6058                     case 0 : 
6059                         int LA31_1 = input.LA(1);
6060
6061                          
6062                         int index31_1 = input.index();
6063                         input.rewind();
6064                         s = -1;
6065                         if ( (synpred2_Graph()) ) {s = 29;}
6066
6067                         else if ( (true) ) {s = 2;}
6068
6069                          
6070                         input.seek(index31_1);
6071                         if ( s>=0 ) return s;
6072                         break;
6073             }
6074             if (state.backtracking>0) {state.failed=true; return -1;}
6075             NoViableAltException nvae =
6076                 new NoViableAltException(getDescription(), 31, _s, input);
6077             error(nvae);
6078             throw nvae;
6079         }
6080     }
6081  
6082
6083     public static final BitSet FOLLOW_NEWLINE_in_file1230 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019802L});
6084     public static final BitSet FOLLOW_resourceDefinitions_in_file1233 = new BitSet(new long[]{0x0000000000000000L});
6085     public static final BitSet FOLLOW_EOF_in_file1236 = new BitSet(new long[]{0x0000000000000002L});
6086     public static final BitSet FOLLOW_resourceDefinition_in_resourceDefinitions1260 = new BitSet(new long[]{0x0400000000000002L});
6087     public static final BitSet FOLLOW_NEWLINE_in_resourceDefinitions1263 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019802L});
6088     public static final BitSet FOLLOW_resourceDefinition_in_resourceDefinitions1266 = new BitSet(new long[]{0x0400000000000002L});
6089     public static final BitSet FOLLOW_resource_in_resourceDefinition1300 = new BitSet(new long[]{0x4000200000000012L,0x0000000000000FF8L});
6090     public static final BitSet FOLLOW_localProperty_in_resourceDefinition1308 = new BitSet(new long[]{0x4000200000000012L,0x0000000000000FF8L});
6091     public static final BitSet FOLLOW_INDENT_in_resourceDefinition1318 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019FFAL});
6092     public static final BitSet FOLLOW_property_in_resourceDefinition1320 = new BitSet(new long[]{0x0400000000000020L});
6093     public static final BitSet FOLLOW_NEWLINE_in_resourceDefinition1323 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019FFAL});
6094     public static final BitSet FOLLOW_property_in_resourceDefinition1325 = new BitSet(new long[]{0x0400000000000020L});
6095     public static final BitSet FOLLOW_DEDENT_in_resourceDefinition1329 = new BitSet(new long[]{0x0000000000000002L});
6096     public static final BitSet FOLLOW_template_in_resourceDefinition1358 = new BitSet(new long[]{0x0000000000000002L});
6097     public static final BitSet FOLLOW_relation_in_localProperty1393 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019800L});
6098     public static final BitSet FOLLOW_resource_in_localProperty1395 = new BitSet(new long[]{0x0000000000000002L});
6099     public static final BitSet FOLLOW_relation_in_property1434 = new BitSet(new long[]{0x6155200000000010L,0x0000000000019802L});
6100     public static final BitSet FOLLOW_resourceDefinition_in_property1444 = new BitSet(new long[]{0x0000000000000002L});
6101     public static final BitSet FOLLOW_INDENT_in_property1464 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019802L});
6102     public static final BitSet FOLLOW_resourceDefinitions_in_property1466 = new BitSet(new long[]{0x0000000000000020L});
6103     public static final BitSet FOLLOW_DEDENT_in_property1468 = new BitSet(new long[]{0x0000000000000002L});
6104     public static final BitSet FOLLOW_template_in_property1494 = new BitSet(new long[]{0x0000000000000002L});
6105     public static final BitSet FOLLOW_65_in_template1515 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019800L});
6106     public static final BitSet FOLLOW_ID_in_template1533 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019800L});
6107     public static final BitSet FOLLOW_resource_in_template1535 = new BitSet(new long[]{0x6155200000000010L,0x0000000000019800L});
6108     public static final BitSet FOLLOW_INDENT_in_template1545 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019802L});
6109     public static final BitSet FOLLOW_resourceDefinitions_in_template1547 = new BitSet(new long[]{0x0000000000000020L});
6110     public static final BitSet FOLLOW_DEDENT_in_template1549 = new BitSet(new long[]{0x0000000000000002L});
6111     public static final BitSet FOLLOW_resource_in_template1574 = new BitSet(new long[]{0x6155200000000012L,0x0000000000019800L});
6112     public static final BitSet FOLLOW_INDENT_in_template1585 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019802L});
6113     public static final BitSet FOLLOW_resourceDefinitions_in_template1587 = new BitSet(new long[]{0x0000000000000020L});
6114     public static final BitSet FOLLOW_DEDENT_in_template1589 = new BitSet(new long[]{0x0000000000000002L});
6115     public static final BitSet FOLLOW_ID_in_relation1643 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L});
6116     public static final BitSet FOLLOW_66_in_relation1658 = new BitSet(new long[]{0x0000200000000000L});
6117     public static final BitSet FOLLOW_ID_in_relation1660 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L});
6118     public static final BitSet FOLLOW_URI_in_relation1681 = new BitSet(new long[]{0x0000000000000002L});
6119     public static final BitSet FOLLOW_67_in_relation1689 = new BitSet(new long[]{0x0000000000000002L});
6120     public static final BitSet FOLLOW_68_in_relation1701 = new BitSet(new long[]{0x0000000000000002L});
6121     public static final BitSet FOLLOW_69_in_relation1713 = new BitSet(new long[]{0x0000000000000002L});
6122     public static final BitSet FOLLOW_70_in_relation1725 = new BitSet(new long[]{0x0000000000000002L});
6123     public static final BitSet FOLLOW_71_in_relation1737 = new BitSet(new long[]{0x0000000000000002L});
6124     public static final BitSet FOLLOW_72_in_relation1749 = new BitSet(new long[]{0x0000000000000002L});
6125     public static final BitSet FOLLOW_73_in_relation1765 = new BitSet(new long[]{0x0000000000000002L});
6126     public static final BitSet FOLLOW_74_in_relation1777 = new BitSet(new long[]{0x0000000000000002L});
6127     public static final BitSet FOLLOW_75_in_relation1789 = new BitSet(new long[]{0x0000200000000000L});
6128     public static final BitSet FOLLOW_ID_in_relation1791 = new BitSet(new long[]{0x0000000000000002L});
6129     public static final BitSet FOLLOW_ID_in_resource1821 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L});
6130     public static final BitSet FOLLOW_ID_in_resource1840 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L});
6131     public static final BitSet FOLLOW_66_in_resource1855 = new BitSet(new long[]{0x2000200000000000L});
6132     public static final BitSet FOLLOW_ID_in_resource1858 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L});
6133     public static final BitSet FOLLOW_STRING_in_resource1883 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L});
6134     public static final BitSet FOLLOW_URI_in_resource1924 = new BitSet(new long[]{0x0000000000000002L});
6135     public static final BitSet FOLLOW_simpleValue_in_resource1932 = new BitSet(new long[]{0x0000000000000002L});
6136     public static final BitSet FOLLOW_76_in_resource1948 = new BitSet(new long[]{0x0011200000000000L});
6137     public static final BitSet FOLLOW_basicType_in_resource1950 = new BitSet(new long[]{0x0000000000000002L});
6138     public static final BitSet FOLLOW_75_in_resource1966 = new BitSet(new long[]{0x0000200000000000L});
6139     public static final BitSet FOLLOW_ID_in_resource1968 = new BitSet(new long[]{0x0000000000000002L});
6140     public static final BitSet FOLLOW_arrayType_in_type2004 = new BitSet(new long[]{0x0000000000000002L});
6141     public static final BitSet FOLLOW_unionType_in_type2012 = new BitSet(new long[]{0x0000000000000002L});
6142     public static final BitSet FOLLOW_77_in_unionType2041 = new BitSet(new long[]{0x0000200000000000L});
6143     public static final BitSet FOLLOW_unionComponent_in_unionType2043 = new BitSet(new long[]{0x0000000000000002L,0x0000000000002000L});
6144     public static final BitSet FOLLOW_ID_in_unionComponent2071 = new BitSet(new long[]{0x0011200000000002L});
6145     public static final BitSet FOLLOW_arrayType_in_unionComponent2080 = new BitSet(new long[]{0x0000000000000002L});
6146     public static final BitSet FOLLOW_basicType_in_arrayType2108 = new BitSet(new long[]{0x0004000000000002L});
6147     public static final BitSet FOLLOW_LBRACKET_in_arrayType2122 = new BitSet(new long[]{0x00C8000000000000L});
6148     public static final BitSet FOLLOW_arrayLength_in_arrayType2124 = new BitSet(new long[]{0x0008000000000000L});
6149     public static final BitSet FOLLOW_RBRACKET_in_arrayType2127 = new BitSet(new long[]{0x0004000000000002L});
6150     public static final BitSet FOLLOW_set_in_arrayLength0 = new BitSet(new long[]{0x0000000000000002L});
6151     public static final BitSet FOLLOW_tupleType_in_basicType2181 = new BitSet(new long[]{0x0000000000000002L});
6152     public static final BitSet FOLLOW_recordType_in_basicType2189 = new BitSet(new long[]{0x0000000000000002L});
6153     public static final BitSet FOLLOW_typeReference_in_basicType2197 = new BitSet(new long[]{0x0000000000000002L});
6154     public static final BitSet FOLLOW_LPAREN_in_tupleType2219 = new BitSet(new long[]{0x0013200000000000L,0x0000000000002000L});
6155     public static final BitSet FOLLOW_type_in_tupleType2222 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L});
6156     public static final BitSet FOLLOW_78_in_tupleType2225 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L});
6157     public static final BitSet FOLLOW_type_in_tupleType2227 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L});
6158     public static final BitSet FOLLOW_RPAREN_in_tupleType2233 = new BitSet(new long[]{0x0000000000000002L});
6159     public static final BitSet FOLLOW_LCURLY_in_recordType2266 = new BitSet(new long[]{0x0020200000000000L});
6160     public static final BitSet FOLLOW_component_in_recordType2269 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L});
6161     public static final BitSet FOLLOW_78_in_recordType2272 = new BitSet(new long[]{0x0000200000000000L});
6162     public static final BitSet FOLLOW_component_in_recordType2274 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L});
6163     public static final BitSet FOLLOW_RCURLY_in_recordType2280 = new BitSet(new long[]{0x0000000000000002L});
6164     public static final BitSet FOLLOW_ID_in_component2312 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000200L});
6165     public static final BitSet FOLLOW_73_in_component2314 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L});
6166     public static final BitSet FOLLOW_type_in_component2316 = new BitSet(new long[]{0x0000000000000002L});
6167     public static final BitSet FOLLOW_ID_in_typeReference2350 = new BitSet(new long[]{0x0001000000000002L});
6168     public static final BitSet FOLLOW_LPAREN_in_typeReference2358 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L});
6169     public static final BitSet FOLLOW_parameter_in_typeReference2360 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L});
6170     public static final BitSet FOLLOW_78_in_typeReference2363 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L});
6171     public static final BitSet FOLLOW_parameter_in_typeReference2365 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L});
6172     public static final BitSet FOLLOW_RPAREN_in_typeReference2369 = new BitSet(new long[]{0x0000000000000002L});
6173     public static final BitSet FOLLOW_ID_in_parameter2405 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L});
6174     public static final BitSet FOLLOW_74_in_parameter2407 = new BitSet(new long[]{0x2145000000000000L,0x0000000000018000L});
6175     public static final BitSet FOLLOW_parameterValue_in_parameter2409 = new BitSet(new long[]{0x0000000000000002L});
6176     public static final BitSet FOLLOW_type_in_parameter2427 = new BitSet(new long[]{0x0000000000000002L});
6177     public static final BitSet FOLLOW_string_in_parameterValue2446 = new BitSet(new long[]{0x0000000000000002L});
6178     public static final BitSet FOLLOW_boolean__in_parameterValue2454 = new BitSet(new long[]{0x0000000000000002L});
6179     public static final BitSet FOLLOW_number_in_parameterValue2462 = new BitSet(new long[]{0x0000000000000002L});
6180     public static final BitSet FOLLOW_rangePar_in_parameterValue2470 = new BitSet(new long[]{0x0000000000000002L});
6181     public static final BitSet FOLLOW_set_in_rangePar2499 = new BitSet(new long[]{0x03C0000000000000L});
6182     public static final BitSet FOLLOW_range_in_rangePar2507 = new BitSet(new long[]{0x000A000000000000L});
6183     public static final BitSet FOLLOW_set_in_rangePar2509 = new BitSet(new long[]{0x0000000000000002L});
6184     public static final BitSet FOLLOW_number_in_range2536 = new BitSet(new long[]{0x0000000000000002L});
6185     public static final BitSet FOLLOW_RANGE_in_range2544 = new BitSet(new long[]{0x0000000000000002L});
6186     public static final BitSet FOLLOW_INT_RANGE_in_range2552 = new BitSet(new long[]{0x0000000000000002L});
6187     public static final BitSet FOLLOW_set_in_number0 = new BitSet(new long[]{0x0000000000000002L});
6188     public static final BitSet FOLLOW_STRING_in_string2606 = new BitSet(new long[]{0x0000000000000002L});
6189     public static final BitSet FOLLOW_79_in_boolean_2627 = new BitSet(new long[]{0x0000000000000002L});
6190     public static final BitSet FOLLOW_80_in_boolean_2639 = new BitSet(new long[]{0x0000000000000002L});
6191     public static final BitSet FOLLOW_valueDefinition_in_valueDefinitions2660 = new BitSet(new long[]{0x0000200000000002L});
6192     public static final BitSet FOLLOW_ID_in_valueDefinition2683 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000200L});
6193     public static final BitSet FOLLOW_73_in_valueDefinition2685 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L});
6194     public static final BitSet FOLLOW_type_in_valueDefinition2687 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L});
6195     public static final BitSet FOLLOW_74_in_valueDefinition2689 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L});
6196     public static final BitSet FOLLOW_value_in_valueDefinition2691 = new BitSet(new long[]{0x0000000000000002L});
6197     public static final BitSet FOLLOW_basicValue_in_value2727 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000200L});
6198     public static final BitSet FOLLOW_73_in_value2741 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L});
6199     public static final BitSet FOLLOW_type_in_value2743 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000200L});
6200     public static final BitSet FOLLOW_simpleValue_in_basicValue2775 = new BitSet(new long[]{0x0000000000000002L});
6201     public static final BitSet FOLLOW_map_in_basicValue2783 = new BitSet(new long[]{0x0000000000000002L});
6202     public static final BitSet FOLLOW_ID_in_basicValue2793 = new BitSet(new long[]{0x0000000000000002L});
6203     public static final BitSet FOLLOW_taggedValue_in_basicValue2805 = new BitSet(new long[]{0x0000000000000002L});
6204     public static final BitSet FOLLOW_string_in_simpleValue2830 = new BitSet(new long[]{0x0000000000000002L});
6205     public static final BitSet FOLLOW_number_in_simpleValue2838 = new BitSet(new long[]{0x0000000000000002L});
6206     public static final BitSet FOLLOW_boolean__in_simpleValue2846 = new BitSet(new long[]{0x0000000000000002L});
6207     public static final BitSet FOLLOW_array_in_simpleValue2854 = new BitSet(new long[]{0x0000000000000002L});
6208     public static final BitSet FOLLOW_tuple_in_simpleValue2862 = new BitSet(new long[]{0x0000000000000002L});
6209     public static final BitSet FOLLOW_record_in_simpleValue2870 = new BitSet(new long[]{0x0000000000000002L});
6210     public static final BitSet FOLLOW_LBRACKET_in_array2891 = new BitSet(new long[]{0x215D200000000000L,0x0000000000018000L});
6211     public static final BitSet FOLLOW_value_in_array2894 = new BitSet(new long[]{0x0008000000000000L,0x0000000000004000L});
6212     public static final BitSet FOLLOW_78_in_array2897 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L});
6213     public static final BitSet FOLLOW_value_in_array2899 = new BitSet(new long[]{0x0008000000000000L,0x0000000000004000L});
6214     public static final BitSet FOLLOW_RBRACKET_in_array2905 = new BitSet(new long[]{0x0000000000000002L});
6215     public static final BitSet FOLLOW_LPAREN_in_tuple2937 = new BitSet(new long[]{0x2157200000000000L,0x0000000000018000L});
6216     public static final BitSet FOLLOW_value_in_tuple2940 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L});
6217     public static final BitSet FOLLOW_78_in_tuple2943 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L});
6218     public static final BitSet FOLLOW_value_in_tuple2945 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L});
6219     public static final BitSet FOLLOW_RPAREN_in_tuple2951 = new BitSet(new long[]{0x0000000000000002L});
6220     public static final BitSet FOLLOW_ID_in_taggedValue2983 = new BitSet(new long[]{0x2155000000000002L,0x0000000000018000L});
6221     public static final BitSet FOLLOW_simpleValue_in_taggedValue2985 = new BitSet(new long[]{0x0000000000000002L});
6222     public static final BitSet FOLLOW_LCURLY_in_record3020 = new BitSet(new long[]{0x0020200000000000L});
6223     public static final BitSet FOLLOW_recordAssignment_in_record3023 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L});
6224     public static final BitSet FOLLOW_78_in_record3026 = new BitSet(new long[]{0x0000200000000000L});
6225     public static final BitSet FOLLOW_recordAssignment_in_record3028 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L});
6226     public static final BitSet FOLLOW_RCURLY_in_record3034 = new BitSet(new long[]{0x0000000000000002L});
6227     public static final BitSet FOLLOW_ID_in_recordAssignment3066 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L});
6228     public static final BitSet FOLLOW_74_in_recordAssignment3068 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L});
6229     public static final BitSet FOLLOW_value_in_recordAssignment3070 = new BitSet(new long[]{0x0000000000000002L});
6230     public static final BitSet FOLLOW_ID_in_map3100 = new BitSet(new long[]{0x0010000000000000L});
6231     public static final BitSet FOLLOW_LCURLY_in_map3102 = new BitSet(new long[]{0x2175200000000000L,0x0000000000018000L});
6232     public static final BitSet FOLLOW_mapAssignment_in_map3105 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L});
6233     public static final BitSet FOLLOW_78_in_map3108 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L});
6234     public static final BitSet FOLLOW_mapAssignment_in_map3110 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L});
6235     public static final BitSet FOLLOW_RCURLY_in_map3116 = new BitSet(new long[]{0x0000000000000002L});
6236     public static final BitSet FOLLOW_value_in_mapAssignment3148 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L});
6237     public static final BitSet FOLLOW_74_in_mapAssignment3150 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L});
6238     public static final BitSet FOLLOW_value_in_mapAssignment3152 = new BitSet(new long[]{0x0000000000000002L});
6239     public static final BitSet FOLLOW_arrayType_in_synpred1_Graph2075 = new BitSet(new long[]{0x0000000000000002L});
6240     public static final BitSet FOLLOW_LPAREN_in_synpred2_Graph2354 = new BitSet(new long[]{0x0000000000000002L});
6241
6242 }