sdl92Parser.py 980 KB
Newer Older
1
# $ANTLR 3.1.3 Mar 17, 2009 19:23:44 sdl92.g 2014-11-11 10:36:40
Maxime Perrotin's avatar
Maxime Perrotin committed
2
3
4
5
6
7
8
9
10
11
12
13
14

import sys
from antlr3 import *
from antlr3.compat import set, frozenset

from antlr3.tree import *



# for convenience in actions
HIDDEN = BaseRecognizer.HIDDEN

# token types
15
16
17
18
19
20
21
22
23
24
NUMBER_OF_INSTANCES=60
COMMENT2=210
MANTISSA=167
ROUTE=79
MOD=159
GROUND=44
PARAM=65
NOT=161
SEQOF=82
TEXTAREA_CONTENT=103
Maxime Perrotin's avatar
Maxime Perrotin committed
25
EOF=-1
dbarbera's avatar
dbarbera committed
26
ACTION=4
27
28
29
30
31
32
CREATE=148
IMPORT=171
FPAR=43
NEXTSTATE=59
RETURN=78
THIS=149
dbarbera's avatar
dbarbera committed
33
CHANNEL=13
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
VIAPATH=113
ENDCONNECTION=126
EXPORT=32
EQ=142
INFORMAL_TEXT=49
GEODE=175
D=184
E=187
F=194
GE=147
G=195
A=181
IMPLIES=152
B=203
C=185
L=186
M=191
N=182
O=196
TERMINATOR=100
H=197
I=193
J=204
ELSE=27
K=188
U=200
T=198
W=202
V=201
STOP=91
Q=211
INT=124
P=189
S=192
R=190
VALUE=109
Y=183
X=199
FI=35
Z=212
MINUS_INFINITY=166
WS=209
OUT=132
NONE=133
INPUT_NONE=52
CONSTANT=22
GT=144
CALL=138
END=177
FLOATING_LABEL=41
IFTHENELSE=47
dbarbera's avatar
dbarbera committed
85
T__215=215
86
T__216=216
87
88
T__213=213
T__214=214
89
T__219=219
90
91
T__217=217
T__218=218
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
INPUT=51
ENDSUBSTRUCTURE=131
FLOAT=40
SUBSTRUCTURE=130
PAREN=68
ASTERISK=129
INOUT=50
STR=206
STIMULUS=90
SELECTOR=81
THEN=104
ENDDECISION=140
OPEN_RANGE=62
SIGNAL=85
ENDSYSTEM=114
PLUS=155
dbarbera's avatar
dbarbera committed
108
CHOICE=14
109
110
TASK_BODY=99
PARAMS=67
dbarbera's avatar
dbarbera committed
111
CLOSED_RANGE=16
112
113
114
115
116
117
118
119
120
121
122
STATE=88
STATELIST=89
TO=106
ASSIG_OP=178
SIGNALROUTE=119
ENDSYNTYPE=30
SORT=87
SET=84
TEXT=101
SEMI=127
TEXTAREA=102
dbarbera's avatar
dbarbera committed
123
124
BLOCK=12
CIF=15
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
START=125
DECISION=25
DIV=158
PROCESS=73
STRING=92
INPUTLIST=53
EXTERNAL=34
LT=145
EXPONENT=169
TRANSITION=107
ENDBLOCK=118
RESET=77
ENDNEWTYPE=29
SIGNAL_LIST=86
ENDTEXT=31
CONNECTION=21
SYSTEM=97
CONNECT=20
L_PAREN=135
PROCEDURE_CALL=71
BASE=168
dbarbera's avatar
dbarbera committed
146
COMMENT=17
147
148
SYNONYM=94
ENDALTERNATIVE=139
dbarbera's avatar
dbarbera committed
149
ARRAY=8
150
151
152
153
154
155
156
157
ACTIVE=170
ENDFOR=151
FIELD_NAME=37
OCTSTR=61
VIEW=172
EMPTYSTR=28
ENDCHANNEL=115
NULL=164
dbarbera's avatar
dbarbera committed
158
ANSWER=7
159
160
161
162
163
164
165
166
167
168
CONDITIONAL=19
PRIMARY=69
TASK=98
REFERENCED=121
ALPHA=207
SEQUENCE=83
VARIABLE=110
PRIORITY=134
SPECIFIC=174
OR=153
dbarbera's avatar
dbarbera committed
169
COMPOSITE_STATE=18
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
FIELD=36
USE=108
FROM=116
ENDPROCEDURE=123
FALSE=163
OUTPUT=63
SYNONYM_LIST=95
APPEND=157
L_BRACKET=179
DIGITS=26
HYPERLINK=45
NEWTYPE=58
Exponent=208
FOR=42
ENDSTATE=128
PROCEDURE_NAME=72
CONSTANTS=23
AND=120
ID=150
FLOAT2=39
IF=46
IN=48
PROVIDED=74
COMMA=137
dbarbera's avatar
dbarbera committed
194
ALL=5
195
196
197
198
ASNFILENAME=176
DOT=205
EXPRESSION=33
WITH=117
dbarbera's avatar
dbarbera committed
199
BITSTR=11
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
XOR=154
DASH=156
DCL=24
ENDPROCESS=122
RANGE=76
VIA=112
SAVE=80
LITERAL=56
STRUCT=93
FIELDS=38
REM=160
TRUE=162
R_BRACKET=180
PROCEDURE=70
JOIN=54
R_PAREN=136
OUTPUT_BODY=64
ANY=141
NEQ=143
QUESTION=75
LABEL=55
PARAMNAMES=66
PLUS_INFINITY=165
dbarbera's avatar
dbarbera committed
223
ASN1=9
224
225
KEEP=173
NEG=57
dbarbera's avatar
dbarbera committed
226
ASSIGN=10
227
VARIABLES=111
dbarbera's avatar
dbarbera committed
228
ALTERNATIVE=6
229
230
231
SYNTYPE=96
TIMER=105
LE=146
Maxime Perrotin's avatar
Maxime Perrotin committed
232
233
234
235

# token names
tokenNames = [
    "<invalid>", "<EOR>", "<DOWN>", "<UP>", 
dbarbera's avatar
dbarbera committed
236
237
    "ACTION", "ALL", "ALTERNATIVE", "ANSWER", "ARRAY", "ASN1", "ASSIGN", 
    "BITSTR", "BLOCK", "CHANNEL", "CHOICE", "CIF", "CLOSED_RANGE", "COMMENT", 
238
239
240
241
242
243
244
245
    "COMPOSITE_STATE", "CONDITIONAL", "CONNECT", "CONNECTION", "CONSTANT", 
    "CONSTANTS", "DCL", "DECISION", "DIGITS", "ELSE", "EMPTYSTR", "ENDNEWTYPE", 
    "ENDSYNTYPE", "ENDTEXT", "EXPORT", "EXPRESSION", "EXTERNAL", "FI", "FIELD", 
    "FIELD_NAME", "FIELDS", "FLOAT2", "FLOAT", "FLOATING_LABEL", "FOR", 
    "FPAR", "GROUND", "HYPERLINK", "IF", "IFTHENELSE", "IN", "INFORMAL_TEXT", 
    "INOUT", "INPUT", "INPUT_NONE", "INPUTLIST", "JOIN", "LABEL", "LITERAL", 
    "NEG", "NEWTYPE", "NEXTSTATE", "NUMBER_OF_INSTANCES", "OCTSTR", "OPEN_RANGE", 
    "OUTPUT", "OUTPUT_BODY", "PARAM", "PARAMNAMES", "PARAMS", "PAREN", "PRIMARY", 
246
    "PROCEDURE", "PROCEDURE_CALL", "PROCEDURE_NAME", "PROCESS", "PROVIDED", 
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
    "QUESTION", "RANGE", "RESET", "RETURN", "ROUTE", "SAVE", "SELECTOR", 
    "SEQOF", "SEQUENCE", "SET", "SIGNAL", "SIGNAL_LIST", "SORT", "STATE", 
    "STATELIST", "STIMULUS", "STOP", "STRING", "STRUCT", "SYNONYM", "SYNONYM_LIST", 
    "SYNTYPE", "SYSTEM", "TASK", "TASK_BODY", "TERMINATOR", "TEXT", "TEXTAREA", 
    "TEXTAREA_CONTENT", "THEN", "TIMER", "TO", "TRANSITION", "USE", "VALUE", 
    "VARIABLE", "VARIABLES", "VIA", "VIAPATH", "ENDSYSTEM", "ENDCHANNEL", 
    "FROM", "WITH", "ENDBLOCK", "SIGNALROUTE", "AND", "REFERENCED", "ENDPROCESS", 
    "ENDPROCEDURE", "INT", "START", "ENDCONNECTION", "SEMI", "ENDSTATE", 
    "ASTERISK", "SUBSTRUCTURE", "ENDSUBSTRUCTURE", "OUT", "NONE", "PRIORITY", 
    "L_PAREN", "R_PAREN", "COMMA", "CALL", "ENDALTERNATIVE", "ENDDECISION", 
    "ANY", "EQ", "NEQ", "GT", "LT", "LE", "GE", "CREATE", "THIS", "ID", 
    "ENDFOR", "IMPLIES", "OR", "XOR", "PLUS", "DASH", "APPEND", "DIV", "MOD", 
    "REM", "NOT", "TRUE", "FALSE", "NULL", "PLUS_INFINITY", "MINUS_INFINITY", 
    "MANTISSA", "BASE", "EXPONENT", "ACTIVE", "IMPORT", "VIEW", "KEEP", 
    "SPECIFIC", "GEODE", "ASNFILENAME", "END", "ASSIG_OP", "L_BRACKET", 
    "R_BRACKET", "A", "N", "Y", "D", "C", "L", "E", "K", "P", "R", "M", 
    "S", "I", "F", "G", "O", "H", "T", "X", "U", "V", "W", "B", "J", "DOT", 
    "STR", "ALPHA", "Exponent", "WS", "COMMENT2", "Q", "Z", "':'", "'!'", 
    "'(.'", "'.)'", "'ERROR'", "'/* CIF'", "'*/'"
Maxime Perrotin's avatar
Maxime Perrotin committed
266
267
268
269
270
271
272
]




class sdl92Parser(Parser):
    grammarFileName = "sdl92.g"
Maxime Perrotin's avatar
Maxime Perrotin committed
273
274
    antlr_version = version_str_to_tuple("3.1.3 Mar 17, 2009 19:23:44")
    antlr_version_str = "3.1.3 Mar 17, 2009 19:23:44"
Maxime Perrotin's avatar
Maxime Perrotin committed
275
276
277
278
279
280
281
282
    tokenNames = tokenNames

    def __init__(self, input, state=None, *args, **kwargs):
        if state is None:
            state = RecognizerSharedState()

        super(sdl92Parser, self).__init__(input, state, *args, **kwargs)

283
284
285
286
287
288
289
290
291
        self.dfa19 = self.DFA19(
            self, 19,
            eot = self.DFA19_eot,
            eof = self.DFA19_eof,
            min = self.DFA19_min,
            max = self.DFA19_max,
            accept = self.DFA19_accept,
            special = self.DFA19_special,
            transition = self.DFA19_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
292
293
            )

294
295
296
297
298
299
300
301
302
303
304
        self.dfa30 = self.DFA30(
            self, 30,
            eot = self.DFA30_eot,
            eof = self.DFA30_eof,
            min = self.DFA30_min,
            max = self.DFA30_max,
            accept = self.DFA30_accept,
            special = self.DFA30_special,
            transition = self.DFA30_transition
            )

305
306
307
308
309
310
311
312
313
        self.dfa37 = self.DFA37(
            self, 37,
            eot = self.DFA37_eot,
            eof = self.DFA37_eof,
            min = self.DFA37_min,
            max = self.DFA37_max,
            accept = self.DFA37_accept,
            special = self.DFA37_special,
            transition = self.DFA37_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
314
315
            )

316
317
318
319
320
321
322
323
324
        self.dfa43 = self.DFA43(
            self, 43,
            eot = self.DFA43_eot,
            eof = self.DFA43_eof,
            min = self.DFA43_min,
            max = self.DFA43_max,
            accept = self.DFA43_accept,
            special = self.DFA43_special,
            transition = self.DFA43_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
325
326
            )

327
328
329
330
331
332
333
334
335
        self.dfa44 = self.DFA44(
            self, 44,
            eot = self.DFA44_eot,
            eof = self.DFA44_eof,
            min = self.DFA44_min,
            max = self.DFA44_max,
            accept = self.DFA44_accept,
            special = self.DFA44_special,
            transition = self.DFA44_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
336
337
            )

338
339
340
341
342
343
344
345
346
        self.dfa48 = self.DFA48(
            self, 48,
            eot = self.DFA48_eot,
            eof = self.DFA48_eof,
            min = self.DFA48_min,
            max = self.DFA48_max,
            accept = self.DFA48_accept,
            special = self.DFA48_special,
            transition = self.DFA48_transition
347
348
            )

349
350
351
352
353
354
355
356
357
        self.dfa66 = self.DFA66(
            self, 66,
            eot = self.DFA66_eot,
            eof = self.DFA66_eof,
            min = self.DFA66_min,
            max = self.DFA66_max,
            accept = self.DFA66_accept,
            special = self.DFA66_special,
            transition = self.DFA66_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
358
359
            )

360
361
362
363
364
365
366
367
368
        self.dfa67 = self.DFA67(
            self, 67,
            eot = self.DFA67_eot,
            eof = self.DFA67_eof,
            min = self.DFA67_min,
            max = self.DFA67_max,
            accept = self.DFA67_accept,
            special = self.DFA67_special,
            transition = self.DFA67_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
369
370
            )

371
372
373
374
375
376
377
378
379
        self.dfa68 = self.DFA68(
            self, 68,
            eot = self.DFA68_eot,
            eof = self.DFA68_eof,
            min = self.DFA68_min,
            max = self.DFA68_max,
            accept = self.DFA68_accept,
            special = self.DFA68_special,
            transition = self.DFA68_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
380
381
            )

382
383
384
385
386
387
388
389
390
        self.dfa72 = self.DFA72(
            self, 72,
            eot = self.DFA72_eot,
            eof = self.DFA72_eof,
            min = self.DFA72_min,
            max = self.DFA72_max,
            accept = self.DFA72_accept,
            special = self.DFA72_special,
            transition = self.DFA72_transition
391
392
            )

393
394
395
396
397
398
399
400
401
        self.dfa83 = self.DFA83(
            self, 83,
            eot = self.DFA83_eot,
            eof = self.DFA83_eof,
            min = self.DFA83_min,
            max = self.DFA83_max,
            accept = self.DFA83_accept,
            special = self.DFA83_special,
            transition = self.DFA83_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
402
403
            )

404
405
406
407
408
409
410
411
412
        self.dfa84 = self.DFA84(
            self, 84,
            eot = self.DFA84_eot,
            eof = self.DFA84_eof,
            min = self.DFA84_min,
            max = self.DFA84_max,
            accept = self.DFA84_accept,
            special = self.DFA84_special,
            transition = self.DFA84_transition
413
414
            )

415
416
417
418
419
420
421
422
423
        self.dfa92 = self.DFA92(
            self, 92,
            eot = self.DFA92_eot,
            eof = self.DFA92_eof,
            min = self.DFA92_min,
            max = self.DFA92_max,
            accept = self.DFA92_accept,
            special = self.DFA92_special,
            transition = self.DFA92_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
424
425
            )

426
427
428
429
430
431
432
433
434
        self.dfa89 = self.DFA89(
            self, 89,
            eot = self.DFA89_eot,
            eof = self.DFA89_eof,
            min = self.DFA89_min,
            max = self.DFA89_max,
            accept = self.DFA89_accept,
            special = self.DFA89_special,
            transition = self.DFA89_transition
435
436
            )

437
438
439
440
441
442
443
444
445
        self.dfa90 = self.DFA90(
            self, 90,
            eot = self.DFA90_eot,
            eof = self.DFA90_eof,
            min = self.DFA90_min,
            max = self.DFA90_max,
            accept = self.DFA90_accept,
            special = self.DFA90_special,
            transition = self.DFA90_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
446
447
            )

448
449
450
451
452
453
454
455
456
        self.dfa91 = self.DFA91(
            self, 91,
            eot = self.DFA91_eot,
            eof = self.DFA91_eof,
            min = self.DFA91_min,
            max = self.DFA91_max,
            accept = self.DFA91_accept,
            special = self.DFA91_special,
            transition = self.DFA91_transition
457
458
            )

459
460
461
462
463
464
465
466
467
        self.dfa93 = self.DFA93(
            self, 93,
            eot = self.DFA93_eot,
            eof = self.DFA93_eof,
            min = self.DFA93_min,
            max = self.DFA93_max,
            accept = self.DFA93_accept,
            special = self.DFA93_special,
            transition = self.DFA93_transition
468
469
            )

470
471
472
473
474
475
476
477
478
        self.dfa94 = self.DFA94(
            self, 94,
            eot = self.DFA94_eot,
            eof = self.DFA94_eof,
            min = self.DFA94_min,
            max = self.DFA94_max,
            accept = self.DFA94_accept,
            special = self.DFA94_special,
            transition = self.DFA94_transition
479
480
            )

481
482
483
484
485
486
487
488
489
        self.dfa105 = self.DFA105(
            self, 105,
            eot = self.DFA105_eot,
            eof = self.DFA105_eof,
            min = self.DFA105_min,
            max = self.DFA105_max,
            accept = self.DFA105_accept,
            special = self.DFA105_special,
            transition = self.DFA105_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
490
491
            )

492
493
494
495
496
497
498
499
500
        self.dfa103 = self.DFA103(
            self, 103,
            eot = self.DFA103_eot,
            eof = self.DFA103_eof,
            min = self.DFA103_min,
            max = self.DFA103_max,
            accept = self.DFA103_accept,
            special = self.DFA103_special,
            transition = self.DFA103_transition
501
502
            )

503
504
505
506
507
508
509
510
511
        self.dfa113 = self.DFA113(
            self, 113,
            eot = self.DFA113_eot,
            eof = self.DFA113_eof,
            min = self.DFA113_min,
            max = self.DFA113_max,
            accept = self.DFA113_accept,
            special = self.DFA113_special,
            transition = self.DFA113_transition
512
513
            )

514
515
516
517
518
519
520
521
522
523
524
        self.dfa119 = self.DFA119(
            self, 119,
            eot = self.DFA119_eot,
            eof = self.DFA119_eof,
            min = self.DFA119_min,
            max = self.DFA119_max,
            accept = self.DFA119_accept,
            special = self.DFA119_special,
            transition = self.DFA119_transition
            )

525
526
527
528
529
530
531
532
533
        self.dfa152 = self.DFA152(
            self, 152,
            eot = self.DFA152_eot,
            eof = self.DFA152_eof,
            min = self.DFA152_min,
            max = self.DFA152_max,
            accept = self.DFA152_accept,
            special = self.DFA152_special,
            transition = self.DFA152_transition
534
535
            )

536
537
538
539
540
541
542
543
544
        self.dfa157 = self.DFA157(
            self, 157,
            eot = self.DFA157_eot,
            eof = self.DFA157_eof,
            min = self.DFA157_min,
            max = self.DFA157_max,
            accept = self.DFA157_accept,
            special = self.DFA157_special,
            transition = self.DFA157_transition
545
546
            )

547
548
549
550
551
552
553
554
555
        self.dfa158 = self.DFA158(
            self, 158,
            eot = self.DFA158_eot,
            eof = self.DFA158_eof,
            min = self.DFA158_min,
            max = self.DFA158_max,
            accept = self.DFA158_accept,
            special = self.DFA158_special,
            transition = self.DFA158_transition
556
557
            )

558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
        self.dfa162 = self.DFA162(
            self, 162,
            eot = self.DFA162_eot,
            eof = self.DFA162_eof,
            min = self.DFA162_min,
            max = self.DFA162_max,
            accept = self.DFA162_accept,
            special = self.DFA162_special,
            transition = self.DFA162_transition
            )

        self.dfa171 = self.DFA171(
            self, 171,
            eot = self.DFA171_eot,
            eof = self.DFA171_eof,
            min = self.DFA171_min,
            max = self.DFA171_max,
            accept = self.DFA171_accept,
            special = self.DFA171_special,
            transition = self.DFA171_transition
Maxime Perrotin's avatar
Maxime Perrotin committed
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
            )






        self._adaptor = None
        self.adaptor = CommonTreeAdaptor()
                


        
    def getTreeAdaptor(self):
        return self._adaptor

    def setTreeAdaptor(self, adaptor):
        self._adaptor = adaptor

    adaptor = property(getTreeAdaptor, setTreeAdaptor)


    class pr_file_return(ParserRuleReturnScope):
        def __init__(self):
            super(sdl92Parser.pr_file_return, self).__init__()

            self.tree = None




    # $ANTLR start "pr_file"
610
    # sdl92.g:138:1: pr_file : ( use_clause | system_definition | process_definition )+ ;
Maxime Perrotin's avatar
Maxime Perrotin committed
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
    def pr_file(self, ):

        retval = self.pr_file_return()
        retval.start = self.input.LT(1)

        root_0 = None

        use_clause1 = None

        system_definition2 = None

        process_definition3 = None



        try:
            try:
628
629
                # sdl92.g:139:9: ( ( use_clause | system_definition | process_definition )+ )
                # sdl92.g:139:17: ( use_clause | system_definition | process_definition )+
Maxime Perrotin's avatar
Maxime Perrotin committed
630
631
632
                pass 
                root_0 = self._adaptor.nil()

633
                # sdl92.g:139:17: ( use_clause | system_definition | process_definition )+
Maxime Perrotin's avatar
Maxime Perrotin committed
634
635
636
637
                cnt1 = 0
                while True: #loop1
                    alt1 = 4
                    LA1 = self.input.LA(1)
638
                    if LA1 == 218:
639
640
                        LA1_2 = self.input.LA(2)

641
                        if (LA1_2 == ANSWER or LA1_2 == COMMENT or LA1_2 == CONNECT or LA1_2 == DECISION or LA1_2 == INPUT or (JOIN <= LA1_2 <= LABEL) or LA1_2 == NEXTSTATE or LA1_2 == OUTPUT or (PROCEDURE <= LA1_2 <= PROCEDURE_CALL) or (PROCESS <= LA1_2 <= PROVIDED) or LA1_2 == RETURN or LA1_2 == STATE or LA1_2 == STOP or LA1_2 == TASK or LA1_2 == TEXT or LA1_2 == START) :
642
                            alt1 = 3
643
644
                        elif (LA1_2 == KEEP) :
                            alt1 = 1
645
646
647


                    elif LA1 == USE:
Maxime Perrotin's avatar
Maxime Perrotin committed
648
649
650
651
652
653
654
                        alt1 = 1
                    elif LA1 == SYSTEM:
                        alt1 = 2
                    elif LA1 == PROCESS:
                        alt1 = 3

                    if alt1 == 1:
655
                        # sdl92.g:139:18: use_clause
Maxime Perrotin's avatar
Maxime Perrotin committed
656
                        pass 
657
                        self._state.following.append(self.FOLLOW_use_clause_in_pr_file1288)
Maxime Perrotin's avatar
Maxime Perrotin committed
658
659
660
661
662
663
664
665
                        use_clause1 = self.use_clause()

                        self._state.following.pop()
                        if self._state.backtracking == 0:
                            self._adaptor.addChild(root_0, use_clause1.tree)


                    elif alt1 == 2:
666
                        # sdl92.g:140:19: system_definition
Maxime Perrotin's avatar
Maxime Perrotin committed
667
                        pass 
668
                        self._state.following.append(self.FOLLOW_system_definition_in_pr_file1308)
Maxime Perrotin's avatar
Maxime Perrotin committed
669
670
671
672
673
674
675
676
                        system_definition2 = self.system_definition()

                        self._state.following.pop()
                        if self._state.backtracking == 0:
                            self._adaptor.addChild(root_0, system_definition2.tree)


                    elif alt1 == 3:
677
                        # sdl92.g:141:19: process_definition
Maxime Perrotin's avatar
Maxime Perrotin committed
678
                        pass 
679
                        self._state.following.append(self.FOLLOW_process_definition_in_pr_file1328)
Maxime Perrotin's avatar
Maxime Perrotin committed
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
                        process_definition3 = self.process_definition()

                        self._state.following.pop()
                        if self._state.backtracking == 0:
                            self._adaptor.addChild(root_0, process_definition3.tree)


                    else:
                        if cnt1 >= 1:
                            break #loop1

                        if self._state.backtracking > 0:
                            raise BacktrackingFailed

                        eee = EarlyExitException(1, self.input)
                        raise eee

                    cnt1 += 1



                retval.stop = self.input.LT(-1)

                if self._state.backtracking == 0:

                    retval.tree = self._adaptor.rulePostProcessing(root_0)
                    self._adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop)


            except RecognitionException, re:
                self.reportError(re)
                self.recover(self.input, re)
                retval.tree = self._adaptor.errorNode(self.input, retval.start, self.input.LT(-1), re)
        finally:

            pass
        return retval

    # $ANTLR end "pr_file"

    class system_definition_return(ParserRuleReturnScope):
        def __init__(self):
            super(sdl92Parser.system_definition_return, self).__init__()

            self.tree = None




    # $ANTLR start "system_definition"
730
    # sdl92.g:144:1: system_definition : SYSTEM system_name end ( entity_in_system )* ENDSYSTEM ( system_name )? end -> ^( SYSTEM system_name ( entity_in_system )* ) ;
Maxime Perrotin's avatar
Maxime Perrotin committed
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
    def system_definition(self, ):

        retval = self.system_definition_return()
        retval.start = self.input.LT(1)

        root_0 = None

        SYSTEM4 = None
        ENDSYSTEM8 = None
        system_name5 = None

        end6 = None

        entity_in_system7 = None

        system_name9 = None

        end10 = None


        SYSTEM4_tree = None
        ENDSYSTEM8_tree = None
        stream_ENDSYSTEM = RewriteRuleTokenStream(self._adaptor, "token ENDSYSTEM")
        stream_SYSTEM = RewriteRuleTokenStream(self._adaptor, "token SYSTEM")
        stream_entity_in_system = RewriteRuleSubtreeStream(self._adaptor, "rule entity_in_system")
        stream_system_name = RewriteRuleSubtreeStream(self._adaptor, "rule system_name")
        stream_end = RewriteRuleSubtreeStream(self._adaptor, "rule end")
        try:
            try:
760
761
                # sdl92.g:145:9: ( SYSTEM system_name end ( entity_in_system )* ENDSYSTEM ( system_name )? end -> ^( SYSTEM system_name ( entity_in_system )* ) )
                # sdl92.g:145:17: SYSTEM system_name end ( entity_in_system )* ENDSYSTEM ( system_name )? end
Maxime Perrotin's avatar
Maxime Perrotin committed
762
                pass 
763
                SYSTEM4=self.match(self.input, SYSTEM, self.FOLLOW_SYSTEM_in_system_definition1353) 
Maxime Perrotin's avatar
Maxime Perrotin committed
764
765
                if self._state.backtracking == 0:
                    stream_SYSTEM.add(SYSTEM4)
766
                self._state.following.append(self.FOLLOW_system_name_in_system_definition1355)
Maxime Perrotin's avatar
Maxime Perrotin committed
767
768
769
770
771
                system_name5 = self.system_name()

                self._state.following.pop()
                if self._state.backtracking == 0:
                    stream_system_name.add(system_name5.tree)
772
                self._state.following.append(self.FOLLOW_end_in_system_definition1357)
Maxime Perrotin's avatar
Maxime Perrotin committed
773
774
775
776
777
                end6 = self.end()

                self._state.following.pop()
                if self._state.backtracking == 0:
                    stream_end.add(end6.tree)
778
                # sdl92.g:146:17: ( entity_in_system )*
Maxime Perrotin's avatar
Maxime Perrotin committed
779
780
781
782
                while True: #loop2
                    alt2 = 2
                    LA2_0 = self.input.LA(1)

783
                    if ((BLOCK <= LA2_0 <= CHANNEL) or LA2_0 == PROCEDURE or LA2_0 == SIGNAL or LA2_0 == 218) :
Maxime Perrotin's avatar
Maxime Perrotin committed
784
785
786
787
788
789
                        alt2 = 1


                    if alt2 == 1:
                        # sdl92.g:0:0: entity_in_system
                        pass 
790
                        self._state.following.append(self.FOLLOW_entity_in_system_in_system_definition1375)
Maxime Perrotin's avatar
Maxime Perrotin committed
791
792
793
794
795
796
797
798
799
                        entity_in_system7 = self.entity_in_system()

                        self._state.following.pop()
                        if self._state.backtracking == 0:
                            stream_entity_in_system.add(entity_in_system7.tree)


                    else:
                        break #loop2
800
                ENDSYSTEM8=self.match(self.input, ENDSYSTEM, self.FOLLOW_ENDSYSTEM_in_system_definition1394) 
Maxime Perrotin's avatar
Maxime Perrotin committed
801
802
                if self._state.backtracking == 0:
                    stream_ENDSYSTEM.add(ENDSYSTEM8)
803
                # sdl92.g:147:27: ( system_name )?
Maxime Perrotin's avatar
Maxime Perrotin committed
804
805
806
807
808
809
810
811
                alt3 = 2
                LA3_0 = self.input.LA(1)

                if (LA3_0 == ID) :
                    alt3 = 1
                if alt3 == 1:
                    # sdl92.g:0:0: system_name
                    pass 
812
                    self._state.following.append(self.FOLLOW_system_name_in_system_definition1396)
Maxime Perrotin's avatar
Maxime Perrotin committed
813
814
815
816
817
818
819
820
                    system_name9 = self.system_name()

                    self._state.following.pop()
                    if self._state.backtracking == 0:
                        stream_system_name.add(system_name9.tree)



821
                self._state.following.append(self.FOLLOW_end_in_system_definition1399)
Maxime Perrotin's avatar
Maxime Perrotin committed
822
823
824
825
826
827
828
                end10 = self.end()

                self._state.following.pop()
                if self._state.backtracking == 0:
                    stream_end.add(end10.tree)

                # AST Rewrite
829
                # elements: SYSTEM, system_name, entity_in_system
Maxime Perrotin's avatar
Maxime Perrotin committed
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
                # token labels: 
                # rule labels: retval
                # token list labels: 
                # rule list labels: 
                # wildcard labels: 
                if self._state.backtracking == 0:

                    retval.tree = root_0

                    if retval is not None:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "rule retval", retval.tree)
                    else:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "token retval", None)


                    root_0 = self._adaptor.nil()
846
847
                    # 148:9: -> ^( SYSTEM system_name ( entity_in_system )* )
                    # sdl92.g:148:17: ^( SYSTEM system_name ( entity_in_system )* )
Maxime Perrotin's avatar
Maxime Perrotin committed
848
849
850
851
                    root_1 = self._adaptor.nil()
                    root_1 = self._adaptor.becomeRoot(stream_SYSTEM.nextNode(), root_1)

                    self._adaptor.addChild(root_1, stream_system_name.nextTree())
852
                    # sdl92.g:148:38: ( entity_in_system )*
Maxime Perrotin's avatar
Maxime Perrotin committed
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
                    while stream_entity_in_system.hasNext():
                        self._adaptor.addChild(root_1, stream_entity_in_system.nextTree())


                    stream_entity_in_system.reset();

                    self._adaptor.addChild(root_0, root_1)



                    retval.tree = root_0



                retval.stop = self.input.LT(-1)

                if self._state.backtracking == 0:

                    retval.tree = self._adaptor.rulePostProcessing(root_0)
                    self._adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop)


            except RecognitionException, re:
                self.reportError(re)
                self.recover(self.input, re)
                retval.tree = self._adaptor.errorNode(self.input, retval.start, self.input.LT(-1), re)
        finally:

            pass
        return retval

    # $ANTLR end "system_definition"

    class use_clause_return(ParserRuleReturnScope):
        def __init__(self):
            super(sdl92Parser.use_clause_return, self).__init__()

            self.tree = None




    # $ANTLR start "use_clause"
896
    # sdl92.g:151:1: use_clause : ( use_asn1 )? USE package_name end -> ^( USE ( use_asn1 )? ( end )? package_name ) ;
Maxime Perrotin's avatar
Maxime Perrotin committed
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
    def use_clause(self, ):

        retval = self.use_clause_return()
        retval.start = self.input.LT(1)

        root_0 = None

        USE12 = None
        use_asn111 = None

        package_name13 = None

        end14 = None


        USE12_tree = None
        stream_USE = RewriteRuleTokenStream(self._adaptor, "token USE")
        stream_use_asn1 = RewriteRuleSubtreeStream(self._adaptor, "rule use_asn1")
        stream_package_name = RewriteRuleSubtreeStream(self._adaptor, "rule package_name")
        stream_end = RewriteRuleSubtreeStream(self._adaptor, "rule end")
        try:
            try:
919
                # sdl92.g:152:9: ( ( use_asn1 )? USE package_name end -> ^( USE ( use_asn1 )? ( end )? package_name ) )
920
                # sdl92.g:152:17: ( use_asn1 )? USE package_name end
Maxime Perrotin's avatar
Maxime Perrotin committed
921
                pass 
922
                # sdl92.g:152:17: ( use_asn1 )?
Maxime Perrotin's avatar
Maxime Perrotin committed
923
924
925
                alt4 = 2
                LA4_0 = self.input.LA(1)

926
                if (LA4_0 == 218) :
Maxime Perrotin's avatar
Maxime Perrotin committed
927
928
929
930
                    alt4 = 1
                if alt4 == 1:
                    # sdl92.g:0:0: use_asn1
                    pass 
931
                    self._state.following.append(self.FOLLOW_use_asn1_in_use_clause1446)
Maxime Perrotin's avatar
Maxime Perrotin committed
932
933
934
935
936
937
938
939
                    use_asn111 = self.use_asn1()

                    self._state.following.pop()
                    if self._state.backtracking == 0:
                        stream_use_asn1.add(use_asn111.tree)



940
                USE12=self.match(self.input, USE, self.FOLLOW_USE_in_use_clause1465) 
Maxime Perrotin's avatar
Maxime Perrotin committed
941
942
                if self._state.backtracking == 0:
                    stream_USE.add(USE12)
943
                self._state.following.append(self.FOLLOW_package_name_in_use_clause1467)
Maxime Perrotin's avatar
Maxime Perrotin committed
944
945
946
947
948
                package_name13 = self.package_name()

                self._state.following.pop()
                if self._state.backtracking == 0:
                    stream_package_name.add(package_name13.tree)
949
                self._state.following.append(self.FOLLOW_end_in_use_clause1469)
Maxime Perrotin's avatar
Maxime Perrotin committed
950
951
952
953
954
955
956
                end14 = self.end()

                self._state.following.pop()
                if self._state.backtracking == 0:
                    stream_end.add(end14.tree)

                # AST Rewrite
957
                # elements: USE, package_name, use_asn1, end
Maxime Perrotin's avatar
Maxime Perrotin committed
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
                # token labels: 
                # rule labels: retval
                # token list labels: 
                # rule list labels: 
                # wildcard labels: 
                if self._state.backtracking == 0:

                    retval.tree = root_0

                    if retval is not None:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "rule retval", retval.tree)
                    else:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "token retval", None)


                    root_0 = self._adaptor.nil()
974
975
                    # 154:9: -> ^( USE ( use_asn1 )? ( end )? package_name )
                    # sdl92.g:154:17: ^( USE ( use_asn1 )? ( end )? package_name )
Maxime Perrotin's avatar
Maxime Perrotin committed
976
977
978
                    root_1 = self._adaptor.nil()
                    root_1 = self._adaptor.becomeRoot(stream_USE.nextNode(), root_1)

979
                    # sdl92.g:154:23: ( use_asn1 )?
Maxime Perrotin's avatar
Maxime Perrotin committed
980
981
982
983
984
                    if stream_use_asn1.hasNext():
                        self._adaptor.addChild(root_1, stream_use_asn1.nextTree())


                    stream_use_asn1.reset();
985
986
987
988
989
990
                    # sdl92.g:154:33: ( end )?
                    if stream_end.hasNext():
                        self._adaptor.addChild(root_1, stream_end.nextTree())


                    stream_end.reset();
Maxime Perrotin's avatar
Maxime Perrotin committed
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
                    self._adaptor.addChild(root_1, stream_package_name.nextTree())

                    self._adaptor.addChild(root_0, root_1)



                    retval.tree = root_0



                retval.stop = self.input.LT(-1)

                if self._state.backtracking == 0:

                    retval.tree = self._adaptor.rulePostProcessing(root_0)
                    self._adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop)


            except RecognitionException, re:
                self.reportError(re)
                self.recover(self.input, re)
                retval.tree = self._adaptor.errorNode(self.input, retval.start, self.input.LT(-1), re)
        finally:

            pass
        return retval

    # $ANTLR end "use_clause"

    class entity_in_system_return(ParserRuleReturnScope):
        def __init__(self):
            super(sdl92Parser.entity_in_system_return, self).__init__()

            self.tree = None




    # $ANTLR start "entity_in_system"
1030
    # sdl92.g:160:1: entity_in_system : ( signal_declaration | text_area | procedure | channel | block_definition );
Maxime Perrotin's avatar
Maxime Perrotin committed
1031
1032
1033
1034
1035
1036
1037
1038
1039
    def entity_in_system(self, ):

        retval = self.entity_in_system_return()
        retval.start = self.input.LT(1)

        root_0 = None

        signal_declaration15 = None

1040
        text_area16 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1041

1042
        procedure17 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1043

1044
1045
1046
        channel18 = None

        block_definition19 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1047
1048
1049
1050
1051



        try:
            try:
1052
1053
                # sdl92.g:161:9: ( signal_declaration | text_area | procedure | channel | block_definition )
                alt5 = 5
Maxime Perrotin's avatar
Maxime Perrotin committed
1054
                LA5 = self.input.LA(1)
1055
                if LA5 == 218:
Maxime Perrotin's avatar
Maxime Perrotin committed
1056
1057
                    LA5_1 = self.input.LA(2)

1058
                    if (self.synpred7_sdl92()) :
1059
                        alt5 = 1
1060
                    elif (self.synpred8_sdl92()) :
1061
                        alt5 = 2
1062
1063
                    elif (self.synpred9_sdl92()) :
                        alt5 = 3
Maxime Perrotin's avatar
Maxime Perrotin committed
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
                    else:
                        if self._state.backtracking > 0:
                            raise BacktrackingFailed

                        nvae = NoViableAltException("", 5, 1, self.input)

                        raise nvae

                elif LA5 == SIGNAL:
                    alt5 = 1
                elif LA5 == PROCEDURE:
                    alt5 = 3
1076
                elif LA5 == CHANNEL:
Maxime Perrotin's avatar
Maxime Perrotin committed
1077
                    alt5 = 4
1078
1079
                elif LA5 == BLOCK:
                    alt5 = 5
Maxime Perrotin's avatar
Maxime Perrotin committed
1080
1081
1082
1083
1084
1085
1086
1087
1088
                else:
                    if self._state.backtracking > 0:
                        raise BacktrackingFailed

                    nvae = NoViableAltException("", 5, 0, self.input)

                    raise nvae

                if alt5 == 1:
1089
                    # sdl92.g:161:17: signal_declaration
Maxime Perrotin's avatar
Maxime Perrotin committed
1090
1091
1092
                    pass 
                    root_0 = self._adaptor.nil()

1093
                    self._state.following.append(self.FOLLOW_signal_declaration_in_entity_in_system1521)
Maxime Perrotin's avatar
Maxime Perrotin committed
1094
1095
1096
1097
1098
1099
1100
1101
                    signal_declaration15 = self.signal_declaration()

                    self._state.following.pop()
                    if self._state.backtracking == 0:
                        self._adaptor.addChild(root_0, signal_declaration15.tree)


                elif alt5 == 2:
1102
                    # sdl92.g:162:19: text_area
Maxime Perrotin's avatar
Maxime Perrotin committed
1103
1104
1105
                    pass 
                    root_0 = self._adaptor.nil()

1106
                    self._state.following.append(self.FOLLOW_text_area_in_entity_in_system1541)
1107
                    text_area16 = self.text_area()
Maxime Perrotin's avatar
Maxime Perrotin committed
1108
1109
1110

                    self._state.following.pop()
                    if self._state.backtracking == 0:
1111
                        self._adaptor.addChild(root_0, text_area16.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1112
1113
1114


                elif alt5 == 3:
1115
                    # sdl92.g:163:19: procedure
Maxime Perrotin's avatar
Maxime Perrotin committed
1116
1117
1118
                    pass 
                    root_0 = self._adaptor.nil()

1119
                    self._state.following.append(self.FOLLOW_procedure_in_entity_in_system1561)
1120
                    procedure17 = self.procedure()
Maxime Perrotin's avatar
Maxime Perrotin committed
1121
1122
1123

                    self._state.following.pop()
                    if self._state.backtracking == 0:
1124
                        self._adaptor.addChild(root_0, procedure17.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1125
1126
1127


                elif alt5 == 4:
1128
1129
1130
1131
                    # sdl92.g:164:19: channel
                    pass 
                    root_0 = self._adaptor.nil()

1132
                    self._state.following.append(self.FOLLOW_channel_in_entity_in_system1581)
1133
1134
1135
1136
1137
1138
1139
1140
1141
                    channel18 = self.channel()

                    self._state.following.pop()
                    if self._state.backtracking == 0:
                        self._adaptor.addChild(root_0, channel18.tree)


                elif alt5 == 5:
                    # sdl92.g:165:19: block_definition
Maxime Perrotin's avatar
Maxime Perrotin committed
1142
1143
1144
                    pass 
                    root_0 = self._adaptor.nil()

1145
                    self._state.following.append(self.FOLLOW_block_definition_in_entity_in_system1601)
1146
                    block_definition19 = self.block_definition()
Maxime Perrotin's avatar
Maxime Perrotin committed
1147
1148
1149

                    self._state.following.pop()
                    if self._state.backtracking == 0:
1150
                        self._adaptor.addChild(root_0, block_definition19.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181


                retval.stop = self.input.LT(-1)

                if self._state.backtracking == 0:

                    retval.tree = self._adaptor.rulePostProcessing(root_0)
                    self._adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop)


            except RecognitionException, re:
                self.reportError(re)
                self.recover(self.input, re)
                retval.tree = self._adaptor.errorNode(self.input, retval.start, self.input.LT(-1), re)
        finally:

            pass
        return retval

    # $ANTLR end "entity_in_system"

    class signal_declaration_return(ParserRuleReturnScope):
        def __init__(self):
            super(sdl92Parser.signal_declaration_return, self).__init__()

            self.tree = None




    # $ANTLR start "signal_declaration"
1182
    # sdl92.g:170:1: signal_declaration : ( paramnames )? SIGNAL signal_id ( input_params )? end -> ^( SIGNAL ( paramnames )? signal_id ( input_params )? ) ;
Maxime Perrotin's avatar
Maxime Perrotin committed
1183
1184
1185
1186
1187
1188
1189
    def signal_declaration(self, ):

        retval = self.signal_declaration_return()
        retval.start = self.input.LT(1)

        root_0 = None

1190
1191
        SIGNAL21 = None
        paramnames20 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1192

1193
        signal_id22 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1194

1195
        input_params23 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1196

1197
        end24 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1198
1199


1200
        SIGNAL21_tree = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1201
1202
1203
1204
1205
1206
1207
        stream_SIGNAL = RewriteRuleTokenStream(self._adaptor, "token SIGNAL")
        stream_input_params = RewriteRuleSubtreeStream(self._adaptor, "rule input_params")
        stream_paramnames = RewriteRuleSubtreeStream(self._adaptor, "rule paramnames")
        stream_signal_id = RewriteRuleSubtreeStream(self._adaptor, "rule signal_id")
        stream_end = RewriteRuleSubtreeStream(self._adaptor, "rule end")
        try:
            try:
1208
1209
                # sdl92.g:171:9: ( ( paramnames )? SIGNAL signal_id ( input_params )? end -> ^( SIGNAL ( paramnames )? signal_id ( input_params )? ) )
                # sdl92.g:171:17: ( paramnames )? SIGNAL signal_id ( input_params )? end
Maxime Perrotin's avatar
Maxime Perrotin committed
1210
                pass 
1211
                # sdl92.g:171:17: ( paramnames )?
Maxime Perrotin's avatar
Maxime Perrotin committed
1212
1213
1214
                alt6 = 2
                LA6_0 = self.input.LA(1)

1215
                if (LA6_0 == 218) :
Maxime Perrotin's avatar
Maxime Perrotin committed
1216
1217
1218
1219
                    alt6 = 1
                if alt6 == 1:
                    # sdl92.g:0:0: paramnames
                    pass 
1220
                    self._state.following.append(self.FOLLOW_paramnames_in_signal_declaration1625)
1221
                    paramnames20 = self.paramnames()
Maxime Perrotin's avatar
Maxime Perrotin committed
1222
1223
1224

                    self._state.following.pop()
                    if self._state.backtracking == 0:
1225
                        stream_paramnames.add(paramnames20.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1226
1227
1228



1229
                SIGNAL21=self.match(self.input, SIGNAL, self.FOLLOW_SIGNAL_in_signal_declaration1644) 
Maxime Perrotin's avatar
Maxime Perrotin committed
1230
                if self._state.backtracking == 0:
1231
                    stream_SIGNAL.add(SIGNAL21)
1232
                self._state.following.append(self.FOLLOW_signal_id_in_signal_declaration1646)
1233
                signal_id22 = self.signal_id()
Maxime Perrotin's avatar
Maxime Perrotin committed
1234
1235
1236

                self._state.following.pop()
                if self._state.backtracking == 0:
1237
1238
                    stream_signal_id.add(signal_id22.tree)
                # sdl92.g:172:34: ( input_params )?
Maxime Perrotin's avatar
Maxime Perrotin committed
1239
1240
1241
1242
1243
1244
1245
1246
                alt7 = 2
                LA7_0 = self.input.LA(1)

                if (LA7_0 == L_PAREN) :
                    alt7 = 1
                if alt7 == 1:
                    # sdl92.g:0:0: input_params
                    pass 
1247
                    self._state.following.append(self.FOLLOW_input_params_in_signal_declaration1648)
1248
                    input_params23 = self.input_params()
Maxime Perrotin's avatar
Maxime Perrotin committed
1249
1250
1251

                    self._state.following.pop()
                    if self._state.backtracking == 0:
1252
                        stream_input_params.add(input_params23.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1253
1254
1255



1256
                self._state.following.append(self.FOLLOW_end_in_signal_declaration1651)
1257
                end24 = self.end()
Maxime Perrotin's avatar
Maxime Perrotin committed
1258
1259
1260

                self._state.following.pop()
                if self._state.backtracking == 0:
1261
                    stream_end.add(end24.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1262
1263

                # AST Rewrite
1264
                # elements: paramnames, signal_id, SIGNAL, input_params
Maxime Perrotin's avatar
Maxime Perrotin committed
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
                # token labels: 
                # rule labels: retval
                # token list labels: 
                # rule list labels: 
                # wildcard labels: 
                if self._state.backtracking == 0:

                    retval.tree = root_0

                    if retval is not None:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "rule retval", retval.tree)
                    else:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "token retval", None)


                    root_0 = self._adaptor.nil()
1281
1282
                    # 173:9: -> ^( SIGNAL ( paramnames )? signal_id ( input_params )? )
                    # sdl92.g:173:17: ^( SIGNAL ( paramnames )? signal_id ( input_params )? )
Maxime Perrotin's avatar
Maxime Perrotin committed
1283
1284
1285
                    root_1 = self._adaptor.nil()
                    root_1 = self._adaptor.becomeRoot(stream_SIGNAL.nextNode(), root_1)

1286
                    # sdl92.g:173:26: ( paramnames )?
Maxime Perrotin's avatar
Maxime Perrotin committed
1287
1288
1289
1290
1291
1292
                    if stream_paramnames.hasNext():
                        self._adaptor.addChild(root_1, stream_paramnames.nextTree())


                    stream_paramnames.reset();
                    self._adaptor.addChild(root_1, stream_signal_id.nextTree())
1293
                    # sdl92.g:173:48: ( input_params )?
Maxime Perrotin's avatar
Maxime Perrotin committed
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
                    if stream_input_params.hasNext():
                        self._adaptor.addChild(root_1, stream_input_params.nextTree())


                    stream_input_params.reset();

                    self._adaptor.addChild(root_0, root_1)



                    retval.tree = root_0



                retval.stop = self.input.LT(-1)

                if self._state.backtracking == 0:

                    retval.tree = self._adaptor.rulePostProcessing(root_0)
                    self._adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop)


            except RecognitionException, re:
                self.reportError(re)
                self.recover(self.input, re)
                retval.tree = self._adaptor.errorNode(self.input, retval.start, self.input.LT(-1), re)
        finally:

            pass
        return retval

    # $ANTLR end "signal_declaration"

    class channel_return(ParserRuleReturnScope):
        def __init__(self):
            super(sdl92Parser.channel_return, self).__init__()

            self.tree = None




    # $ANTLR start "channel"
1337
    # sdl92.g:176:1: channel : CHANNEL channel_id ( route )+ ENDCHANNEL end -> ^( CHANNEL channel_id ( route )+ ) ;
Maxime Perrotin's avatar
Maxime Perrotin committed
1338
1339
1340
1341
1342
1343
1344
    def channel(self, ):

        retval = self.channel_return()
        retval.start = self.input.LT(1)

        root_0 = None

1345
1346
1347
        CHANNEL25 = None
        ENDCHANNEL28 = None
        channel_id26 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1348

1349
        route27 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1350

1351
        end29 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1352
1353


1354
1355
        CHANNEL25_tree = None
        ENDCHANNEL28_tree = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1356
1357
1358
1359
1360
1361
1362
        stream_CHANNEL = RewriteRuleTokenStream(self._adaptor, "token CHANNEL")
        stream_ENDCHANNEL = RewriteRuleTokenStream(self._adaptor, "token ENDCHANNEL")
        stream_route = RewriteRuleSubtreeStream(self._adaptor, "rule route")
        stream_channel_id = RewriteRuleSubtreeStream(self._adaptor, "rule channel_id")
        stream_end = RewriteRuleSubtreeStream(self._adaptor, "rule end")
        try:
            try:
1363
1364
                # sdl92.g:177:9: ( CHANNEL channel_id ( route )+ ENDCHANNEL end -> ^( CHANNEL channel_id ( route )+ ) )
                # sdl92.g:177:17: CHANNEL channel_id ( route )+ ENDCHANNEL end
Maxime Perrotin's avatar
Maxime Perrotin committed
1365
                pass 
1366
                CHANNEL25=self.match(self.input, CHANNEL, self.FOLLOW_CHANNEL_in_channel1701) 
Maxime Perrotin's avatar
Maxime Perrotin committed
1367
                if self._state.backtracking == 0:
1368
                    stream_CHANNEL.add(CHANNEL25)
1369
                self._state.following.append(self.FOLLOW_channel_id_in_channel1703)
1370
                channel_id26 = self.channel_id()
Maxime Perrotin's avatar
Maxime Perrotin committed
1371
1372
1373

                self._state.following.pop()
                if self._state.backtracking == 0:
1374
1375
                    stream_channel_id.add(channel_id26.tree)
                # sdl92.g:178:17: ( route )+
Maxime Perrotin's avatar
Maxime Perrotin committed
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
                cnt8 = 0
                while True: #loop8
                    alt8 = 2
                    LA8_0 = self.input.LA(1)

                    if (LA8_0 == FROM) :
                        alt8 = 1


                    if alt8 == 1:
                        # sdl92.g:0:0: route
                        pass 
1388
                        self._state.following.append(self.FOLLOW_route_in_channel1721)
1389
                        route27 = self.route()
Maxime Perrotin's avatar
Maxime Perrotin committed
1390
1391
1392

                        self._state.following.pop()
                        if self._state.backtracking == 0:
1393
                            stream_route.add(route27.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406


                    else:
                        if cnt8 >= 1:
                            break #loop8

                        if self._state.backtracking > 0:
                            raise BacktrackingFailed

                        eee = EarlyExitException(8, self.input)
                        raise eee

                    cnt8 += 1
1407
                ENDCHANNEL28=self.match(self.input, ENDCHANNEL, self.FOLLOW_ENDCHANNEL_in_channel1740) 
Maxime Perrotin's avatar
Maxime Perrotin committed
1408
                if self._state.backtracking == 0:
1409
                    stream_ENDCHANNEL.add(ENDCHANNEL28)
1410
                self._state.following.append(self.FOLLOW_end_in_channel1742)
1411
                end29 = self.end()
Maxime Perrotin's avatar
Maxime Perrotin committed
1412
1413
1414

                self._state.following.pop()
                if self._state.backtracking == 0:
1415
                    stream_end.add(end29.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1416
1417

                # AST Rewrite
1418
                # elements: route, channel_id, CHANNEL
Maxime Perrotin's avatar
Maxime Perrotin committed
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
                # token labels: 
                # rule labels: retval
                # token list labels: 
                # rule list labels: 
                # wildcard labels: 
                if self._state.backtracking == 0:

                    retval.tree = root_0

                    if retval is not None:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "rule retval", retval.tree)
                    else:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "token retval", None)


                    root_0 = self._adaptor.nil()
1435
1436
                    # 180:9: -> ^( CHANNEL channel_id ( route )+ )
                    # sdl92.g:180:17: ^( CHANNEL channel_id ( route )+ )
Maxime Perrotin's avatar
Maxime Perrotin committed
1437
1438
1439
1440
                    root_1 = self._adaptor.nil()
                    root_1 = self._adaptor.becomeRoot(stream_CHANNEL.nextNode(), root_1)

                    self._adaptor.addChild(root_1, stream_channel_id.nextTree())
1441
                    # sdl92.g:180:38: ( route )+
Maxime Perrotin's avatar
Maxime Perrotin committed
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
                    if not (stream_route.hasNext()):
                        raise RewriteEarlyExitException()

                    while stream_route.hasNext():
                        self._adaptor.addChild(root_1, stream_route.nextTree())


                    stream_route.reset()

                    self._adaptor.addChild(root_0, root_1)



                    retval.tree = root_0



                retval.stop = self.input.LT(-1)

                if self._state.backtracking == 0:

                    retval.tree = self._adaptor.rulePostProcessing(root_0)
                    self._adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop)


            except RecognitionException, re:
                self.reportError(re)
                self.recover(self.input, re)
                retval.tree = self._adaptor.errorNode(self.input, retval.start, self.input.LT(-1), re)
        finally:

            pass
        return retval

    # $ANTLR end "channel"

    class route_return(ParserRuleReturnScope):
        def __init__(self):
            super(sdl92Parser.route_return, self).__init__()

            self.tree = None




    # $ANTLR start "route"
1488
    # sdl92.g:183:1: route : FROM source_id TO dest_id WITH signal_id ( ',' signal_id )* end -> ^( ROUTE source_id dest_id ( signal_id )+ ) ;
Maxime Perrotin's avatar
Maxime Perrotin committed
1489
1490
1491
1492
1493
1494
1495
    def route(self, ):

        retval = self.route_return()
        retval.start = self.input.LT(1)

        root_0 = None

1496
1497
1498
1499
1500
        FROM30 = None
        TO32 = None
        WITH34 = None
        char_literal36 = None
        source_id31 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1501

1502
        dest_id33 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1503

1504
        signal_id35 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1505

1506
        signal_id37 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1507

1508
        end38 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1509
1510


1511
1512
1513
1514
        FROM30_tree = None
        TO32_tree = None
        WITH34_tree = None
        char_literal36_tree = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
        stream_FROM = RewriteRuleTokenStream(self._adaptor, "token FROM")
        stream_TO = RewriteRuleTokenStream(self._adaptor, "token TO")
        stream_COMMA = RewriteRuleTokenStream(self._adaptor, "token COMMA")
        stream_WITH = RewriteRuleTokenStream(self._adaptor, "token WITH")
        stream_source_id = RewriteRuleSubtreeStream(self._adaptor, "rule source_id")
        stream_dest_id = RewriteRuleSubtreeStream(self._adaptor, "rule dest_id")
        stream_signal_id = RewriteRuleSubtreeStream(self._adaptor, "rule signal_id")
        stream_end = RewriteRuleSubtreeStream(self._adaptor, "rule end")
        try:
            try:
1525
1526
                # sdl92.g:184:9: ( FROM source_id TO dest_id WITH signal_id ( ',' signal_id )* end -> ^( ROUTE source_id dest_id ( signal_id )+ ) )
                # sdl92.g:184:17: FROM source_id TO dest_id WITH signal_id ( ',' signal_id )* end
Maxime Perrotin's avatar
Maxime Perrotin committed
1527
                pass 
1528
                FROM30=self.match(self.input, FROM, self.FOLLOW_FROM_in_route1789) 
Maxime Perrotin's avatar
Maxime Perrotin committed
1529
                if self._state.backtracking == 0:
1530
                    stream_FROM.add(FROM30)
1531
                self._state.following.append(self.FOLLOW_source_id_in_route1791)
1532
                source_id31 = self.source_id()
Maxime Perrotin's avatar
Maxime Perrotin committed
1533
1534
1535

                self._state.following.pop()
                if self._state.backtracking == 0:
1536
                    stream_source_id.add(source_id31.tree)
1537
                TO32=self.match(self.input, TO, self.FOLLOW_TO_in_route1793) 
Maxime Perrotin's avatar
Maxime Perrotin committed
1538
                if self._state.backtracking == 0:
1539
                    stream_TO.add(TO32)
1540
                self._state.following.append(self.FOLLOW_dest_id_in_route1795)
1541
                dest_id33 = self.dest_id()
Maxime Perrotin's avatar
Maxime Perrotin committed
1542
1543
1544

                self._state.following.pop()
                if self._state.backtracking == 0:
1545
                    stream_dest_id.add(dest_id33.tree)
1546
                WITH34=self.match(self.input, WITH, self.FOLLOW_WITH_in_route1797) 
Maxime Perrotin's avatar
Maxime Perrotin committed
1547
                if self._state.backtracking == 0:
1548
                    stream_WITH.add(WITH34)
1549
                self._state.following.append(self.FOLLOW_signal_id_in_route1799)
1550
                signal_id35 = self.signal_id()
Maxime Perrotin's avatar
Maxime Perrotin committed
1551
1552
1553

                self._state.following.pop()
                if self._state.backtracking == 0:
1554
1555
                    stream_signal_id.add(signal_id35.tree)
                # sdl92.g:184:58: ( ',' signal_id )*
Maxime Perrotin's avatar
Maxime Perrotin committed
1556
1557
1558
1559
1560
1561
1562
1563
1564
                while True: #loop9
                    alt9 = 2
                    LA9_0 = self.input.LA(1)

                    if (LA9_0 == COMMA) :
                        alt9 = 1


                    if alt9 == 1:
1565
                        # sdl92.g:184:59: ',' signal_id
Maxime Perrotin's avatar
Maxime Perrotin committed
1566
                        pass 
1567
                        char_literal36=self.match(self.input, COMMA, self.FOLLOW_COMMA_in_route1802) 
Maxime Perrotin's avatar
Maxime Perrotin committed
1568
                        if self._state.backtracking == 0:
1569
                            stream_COMMA.add(char_literal36)
1570
                        self._state.following.append(self.FOLLOW_signal_id_in_route1804)
1571
                        signal_id37 = self.signal_id()
Maxime Perrotin's avatar
Maxime Perrotin committed
1572
1573
1574

                        self._state.following.pop()
                        if self._state.backtracking == 0:
1575
                            stream_signal_id.add(signal_id37.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1576
1577
1578
1579


                    else:
                        break #loop9
1580
                self._state.following.append(self.FOLLOW_end_in_route1808)
1581
                end38 = self.end()
Maxime Perrotin's avatar
Maxime Perrotin committed
1582
1583
1584

                self._state.following.pop()
                if self._state.backtracking == 0:
1585
                    stream_end.add(end38.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1586
1587

                # AST Rewrite
1588
                # elements: signal_id, source_id, dest_id
Maxime Perrotin's avatar
Maxime Perrotin committed
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
                # token labels: 
                # rule labels: retval
                # token list labels: 
                # rule list labels: 
                # wildcard labels: 
                if self._state.backtracking == 0:

                    retval.tree = root_0

                    if retval is not None:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "rule retval", retval.tree)
                    else:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "token retval", None)


                    root_0 = self._adaptor.nil()
1605
1606
                    # 185:9: -> ^( ROUTE source_id dest_id ( signal_id )+ )
                    # sdl92.g:185:17: ^( ROUTE source_id dest_id ( signal_id )+ )
Maxime Perrotin's avatar
Maxime Perrotin committed
1607
1608
1609
1610
1611
                    root_1 = self._adaptor.nil()
                    root_1 = self._adaptor.becomeRoot(self._adaptor.createFromType(ROUTE, "ROUTE"), root_1)

                    self._adaptor.addChild(root_1, stream_source_id.nextTree())
                    self._adaptor.addChild(root_1, stream_dest_id.nextTree())
1612
                    # sdl92.g:185:43: ( signal_id )+
Maxime Perrotin's avatar
Maxime Perrotin committed
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
                    if not (stream_signal_id.hasNext()):
                        raise RewriteEarlyExitException()

                    while stream_signal_id.hasNext():
                        self._adaptor.addChild(root_1, stream_signal_id.nextTree())


                    stream_signal_id.reset()

                    self._adaptor.addChild(root_0, root_1)



                    retval.tree = root_0



                retval.stop = self.input.LT(-1)

                if self._state.backtracking == 0:

                    retval.tree = self._adaptor.rulePostProcessing(root_0)
                    self._adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop)


            except RecognitionException, re:
                self.reportError(re)
                self.recover(self.input, re)
                retval.tree = self._adaptor.errorNode(self.input, retval.start, self.input.LT(-1), re)
        finally:

            pass
        return retval

    # $ANTLR end "route"

    class block_definition_return(ParserRuleReturnScope):
        def __init__(self):
            super(sdl92Parser.block_definition_return, self).__init__()

            self.tree = None




    # $ANTLR start "block_definition"
1659
    # sdl92.g:188:1: block_definition : BLOCK block_id end ( entity_in_block )* ENDBLOCK end -> ^( BLOCK block_id ( entity_in_block )* ) ;
Maxime Perrotin's avatar
Maxime Perrotin committed
1660
1661
1662
1663
1664
1665
1666
    def block_definition(self, ):

        retval = self.block_definition_return()
        retval.start = self.input.LT(1)

        root_0 = None

1667
1668
1669
        BLOCK39 = None
        ENDBLOCK43 = None
        block_id40 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1670

1671
        end41 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1672

1673
        entity_in_block42 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1674

1675
        end44 = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1676
1677


1678
1679
        BLOCK39_tree = None
        ENDBLOCK43_tree = None
Maxime Perrotin's avatar
Maxime Perrotin committed
1680
1681
1682
1683
1684
1685
1686
        stream_ENDBLOCK = RewriteRuleTokenStream(self._adaptor, "token ENDBLOCK")
        stream_BLOCK = RewriteRuleTokenStream(self._adaptor, "token BLOCK")
        stream_entity_in_block = RewriteRuleSubtreeStream(self._adaptor, "rule entity_in_block")
        stream_end = RewriteRuleSubtreeStream(self._adaptor, "rule end")
        stream_block_id = RewriteRuleSubtreeStream(self._adaptor, "rule block_id")
        try:
            try:
1687
1688
                # sdl92.g:189:9: ( BLOCK block_id end ( entity_in_block )* ENDBLOCK end -> ^( BLOCK block_id ( entity_in_block )* ) )
                # sdl92.g:189:17: BLOCK block_id end ( entity_in_block )* ENDBLOCK end
Maxime Perrotin's avatar
Maxime Perrotin committed
1689
                pass 
1690
                BLOCK39=self.match(self.input, BLOCK, self.FOLLOW_BLOCK_in_block_definition1857) 
Maxime Perrotin's avatar
Maxime Perrotin committed
1691
                if self._state.backtracking == 0:
1692
                    stream_BLOCK.add(BLOCK39)
1693
                self._state.following.append(self.FOLLOW_block_id_in_block_definition1859)
1694
                block_id40 = self.block_id()
Maxime Perrotin's avatar
Maxime Perrotin committed
1695
1696
1697

                self._state.following.pop()
                if self._state.backtracking == 0:
1698
                    stream_block_id.add(block_id40.tree)
1699
                self._state.following.append(self.FOLLOW_end_in_block_definition1861)
1700
                end41 = self.end()
Maxime Perrotin's avatar
Maxime Perrotin committed
1701
1702
1703

                self._state.following.pop()
                if self._state.backtracking == 0:
1704
1705
                    stream_end.add(end41.tree)
                # sdl92.g:190:17: ( entity_in_block )*
Maxime Perrotin's avatar
Maxime Perrotin committed
1706
1707
1708
1709
                while True: #loop10
                    alt10 = 2
                    LA10_0 = self.input.LA(1)

1710
                    if (LA10_0 == BLOCK or LA10_0 == CONNECT or LA10_0 == PROCESS or LA10_0 == SIGNAL or LA10_0 == SIGNALROUTE or LA10_0 == 218) :
Maxime Perrotin's avatar
Maxime Perrotin committed
1711
1712
1713
1714
1715
1716
                        alt10 = 1


                    if alt10 == 1:
                        # sdl92.g:0:0: entity_in_block
                        pass 
1717
                        self._state.following.append(self.FOLLOW_entity_in_block_in_block_definition1879)
1718
                        entity_in_block42 = self.entity_in_block()
Maxime Perrotin's avatar
Maxime Perrotin committed
1719
1720
1721

                        self._state.following.pop()
                        if self._state.backtracking == 0:
1722
                            stream_entity_in_block.add(entity_in_block42.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1723
1724
1725
1726


                    else:
                        break #loop10
1727
                ENDBLOCK43=self.match(self.input, ENDBLOCK, self.FOLLOW_ENDBLOCK_in_block_definition1898) 
Maxime Perrotin's avatar
Maxime Perrotin committed
1728
                if self._state.backtracking == 0:
1729
                    stream_ENDBLOCK.add(ENDBLOCK43)
1730
                self._state.following.append(self.FOLLOW_end_in_block_definition1900)
1731
                end44 = self.end()
Maxime Perrotin's avatar
Maxime Perrotin committed
1732
1733
1734

                self._state.following.pop()
                if self._state.backtracking == 0:
1735
                    stream_end.add(end44.tree)
Maxime Perrotin's avatar
Maxime Perrotin committed
1736
1737

                # AST Rewrite
1738
                # elements: entity_in_block, block_id, BLOCK
Maxime Perrotin's avatar
Maxime Perrotin committed
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
                # token labels: 
                # rule labels: retval
                # token list labels: 
                # rule list labels: 
                # wildcard labels: 
                if self._state.backtracking == 0:

                    retval.tree = root_0

                    if retval is not None:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "rule retval", retval.tree)
                    else:
                        stream_retval = RewriteRuleSubtreeStream(self._adaptor, "token retval", None)


                    root_0 = self._adaptor.nil()
1755
1756
                    # 192:9: -> ^( BLOCK block_id ( entity_in_block )* )
                    # sdl92.g:192:17: ^( BLOCK block_id ( entity_in_block )* )
Maxime Perrotin's avatar
Maxime Perrotin committed
1757
1758
1759
1760
                    root_1 = self._adaptor.nil()
                    root_1 = self._adaptor.becomeRoot(stream_BLOCK.nextNode(), root_1)

                    self._adaptor.addChild(root_1, stream_block_id.nextTree())
1761
                    # sdl92.g:192:34: ( entity_in_block )*
Maxime Perrotin's avatar
Maxime Perrotin committed
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780