BaseTools: Use absolute import in Ecc
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / CParser.py
1 # $ANTLR 3.0.1 C.g 2010-02-23 09:58:53
2
3 from __future__ import print_function
4 from __future__ import absolute_import
5 from antlr3 import *
6 from antlr3.compat import set, frozenset
7
8 ## @file
9 # The file defines the parser for C source files.
10 #
11 # THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
12 # This file is generated by running:
13 # java org.antlr.Tool C.g
14 #
15 # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
16 #
17 # This program and the accompanying materials are licensed and made available
18 # under the terms and conditions of the BSD License which accompanies this
19 # distribution. The full text of the license may be found at:
20 # http://opensource.org/licenses/bsd-license.php
21 #
22 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
23 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
24 #
25 ##
26
27 from . import CodeFragment
28 from . import FileProfile
29
30
31
32 # for convenience in actions
33 HIDDEN = BaseRecognizer.HIDDEN
34
35 # token types
36 BS=20
37 LINE_COMMENT=23
38 FloatTypeSuffix=16
39 IntegerTypeSuffix=14
40 LETTER=11
41 OCTAL_LITERAL=6
42 CHARACTER_LITERAL=8
43 Exponent=15
44 EOF=-1
45 HexDigit=13
46 STRING_LITERAL=9
47 WS=19
48 FLOATING_POINT_LITERAL=10
49 IDENTIFIER=4
50 UnicodeEscape=18
51 LINE_COMMAND=24
52 UnicodeVocabulary=21
53 HEX_LITERAL=5
54 COMMENT=22
55 DECIMAL_LITERAL=7
56 EscapeSequence=12
57 OctalEscape=17
58
59 # token names
60 tokenNames = [
61 "<invalid>", "<EOR>", "<DOWN>", "<UP>",
62 "IDENTIFIER", "HEX_LITERAL", "OCTAL_LITERAL", "DECIMAL_LITERAL", "CHARACTER_LITERAL",
63 "STRING_LITERAL", "FLOATING_POINT_LITERAL", "LETTER", "EscapeSequence",
64 "HexDigit", "IntegerTypeSuffix", "Exponent", "FloatTypeSuffix", "OctalEscape",
65 "UnicodeEscape", "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COMMENT",
66 "LINE_COMMAND", "';'", "'typedef'", "','", "'='", "'extern'", "'static'",
67 "'auto'", "'register'", "'STATIC'", "'void'", "'char'", "'short'", "'int'",
68 "'long'", "'float'", "'double'", "'signed'", "'unsigned'", "'{'", "'}'",
69 "'struct'", "'union'", "':'", "'enum'", "'const'", "'volatile'", "'IN'",
70 "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'", "'VOLATILE'", "'GLOBAL_REMOVE_IF_UNREFERENCED'",
71 "'EFIAPI'", "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED'",
72 "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'", "'-'", "'/'", "'%'",
73 "'++'", "'--'", "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*='",
74 "'/='", "'%='", "'+='", "'-='", "'<<='", "'>>='", "'&='", "'^='", "'|='",
75 "'?'", "'||'", "'&&'", "'|'", "'^'", "'=='", "'!='", "'<'", "'>'", "'<='",
76 "'>='", "'<<'", "'>>'", "'__asm__'", "'_asm'", "'__asm'", "'case'",
77 "'default'", "'if'", "'else'", "'switch'", "'while'", "'do'", "'for'",
78 "'goto'", "'continue'", "'break'", "'return'"
79 ]
80
81
82 class function_definition_scope(object):
83 def __init__(self):
84 self.ModifierText = None
85 self.DeclText = None
86 self.LBLine = None
87 self.LBOffset = None
88 self.DeclLine = None
89 self.DeclOffset = None
90 class postfix_expression_scope(object):
91 def __init__(self):
92 self.FuncCallText = None
93
94
95 class CParser(Parser):
96 grammarFileName = "C.g"
97 tokenNames = tokenNames
98
99 def __init__(self, input):
100 Parser.__init__(self, input)
101 self.ruleMemo = {}
102
103 self.function_definition_stack = []
104 self.postfix_expression_stack = []
105
106 def printTokenInfo(self, line, offset, tokenText):
107 print(str(line)+ ',' + str(offset) + ':' + str(tokenText))
108
109 def StorePredicateExpression(self, StartLine, StartOffset, EndLine, EndOffset, Text):
110 PredExp = CodeFragment.PredicateExpression(Text, (StartLine, StartOffset), (EndLine, EndOffset))
111 FileProfile.PredicateExpressionList.append(PredExp)
112
113 def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):
114 EnumDef = CodeFragment.EnumerationDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))
115 FileProfile.EnumerationDefinitionList.append(EnumDef)
116
117 def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):
118 SUDef = CodeFragment.StructUnionDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))
119 FileProfile.StructUnionDefinitionList.append(SUDef)
120
121 def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndOffset, FromText, ToText):
122 Tdef = CodeFragment.TypedefDefinition(FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffset))
123 FileProfile.TypedefDefinitionList.append(Tdef)
124
125 def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, DeclOffset):
126 FuncDef = CodeFragment.FunctionDefinition(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLine, DeclOffset))
127 FileProfile.FunctionDefinitionList.append(FuncDef)
128
129 def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText):
130 VarDecl = CodeFragment.VariableDeclaration(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset))
131 FileProfile.VariableDeclarationList.append(VarDecl)
132
133 def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOffset, FuncName, ParamList):
134 FuncCall = CodeFragment.FunctionCalling(FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOffset))
135 FileProfile.FunctionCallingList.append(FuncCall)
136
137
138
139
140 # $ANTLR start translation_unit
141 # C.g:102:1: translation_unit : ( external_declaration )* ;
142 def translation_unit(self, ):
143
144 translation_unit_StartIndex = self.input.index()
145 try:
146 try:
147 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 1):
148 return
149
150 # C.g:103:2: ( ( external_declaration )* )
151 # C.g:103:4: ( external_declaration )*
152 # C.g:103:4: ( external_declaration )*
153 while True: #loop1
154 alt1 = 2
155 LA1_0 = self.input.LA(1)
156
157 if (LA1_0 == IDENTIFIER or LA1_0 == 26 or (29 <= LA1_0 <= 42) or (45 <= LA1_0 <= 46) or (48 <= LA1_0 <= 62) or LA1_0 == 66) :
158 alt1 = 1
159
160
161 if alt1 == 1:
162 # C.g:0:0: external_declaration
163 self.following.append(self.FOLLOW_external_declaration_in_translation_unit74)
164 self.external_declaration()
165 self.following.pop()
166 if self.failed:
167 return
168
169
170 else:
171 break #loop1
172
173
174
175
176
177
178 except RecognitionException as re:
179 self.reportError(re)
180 self.recover(self.input, re)
181 finally:
182 if self.backtracking > 0:
183 self.memoize(self.input, 1, translation_unit_StartIndex)
184
185 pass
186
187 return
188
189 # $ANTLR end translation_unit
190
191
192 # $ANTLR start external_declaration
193 # C.g:114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );
194 def external_declaration(self, ):
195
196 external_declaration_StartIndex = self.input.index()
197 try:
198 try:
199 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 2):
200 return
201
202 # C.g:119:2: ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? )
203 alt3 = 3
204 LA3_0 = self.input.LA(1)
205
206 if ((29 <= LA3_0 <= 33)) :
207 LA3_1 = self.input.LA(2)
208
209 if (self.synpred4()) :
210 alt3 = 1
211 elif (self.synpred5()) :
212 alt3 = 2
213 else:
214 if self.backtracking > 0:
215 self.failed = True
216 return
217
218 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 1, self.input)
219
220 raise nvae
221
222 elif (LA3_0 == 34) :
223 LA3_2 = self.input.LA(2)
224
225 if (self.synpred4()) :
226 alt3 = 1
227 elif (self.synpred5()) :
228 alt3 = 2
229 else:
230 if self.backtracking > 0:
231 self.failed = True
232 return
233
234 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 2, self.input)
235
236 raise nvae
237
238 elif (LA3_0 == 35) :
239 LA3_3 = self.input.LA(2)
240
241 if (self.synpred4()) :
242 alt3 = 1
243 elif (self.synpred5()) :
244 alt3 = 2
245 else:
246 if self.backtracking > 0:
247 self.failed = True
248 return
249
250 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 3, self.input)
251
252 raise nvae
253
254 elif (LA3_0 == 36) :
255 LA3_4 = self.input.LA(2)
256
257 if (self.synpred4()) :
258 alt3 = 1
259 elif (self.synpred5()) :
260 alt3 = 2
261 else:
262 if self.backtracking > 0:
263 self.failed = True
264 return
265
266 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 4, self.input)
267
268 raise nvae
269
270 elif (LA3_0 == 37) :
271 LA3_5 = self.input.LA(2)
272
273 if (self.synpred4()) :
274 alt3 = 1
275 elif (self.synpred5()) :
276 alt3 = 2
277 else:
278 if self.backtracking > 0:
279 self.failed = True
280 return
281
282 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 5, self.input)
283
284 raise nvae
285
286 elif (LA3_0 == 38) :
287 LA3_6 = self.input.LA(2)
288
289 if (self.synpred4()) :
290 alt3 = 1
291 elif (self.synpred5()) :
292 alt3 = 2
293 else:
294 if self.backtracking > 0:
295 self.failed = True
296 return
297
298 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 6, self.input)
299
300 raise nvae
301
302 elif (LA3_0 == 39) :
303 LA3_7 = self.input.LA(2)
304
305 if (self.synpred4()) :
306 alt3 = 1
307 elif (self.synpred5()) :
308 alt3 = 2
309 else:
310 if self.backtracking > 0:
311 self.failed = True
312 return
313
314 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 7, self.input)
315
316 raise nvae
317
318 elif (LA3_0 == 40) :
319 LA3_8 = self.input.LA(2)
320
321 if (self.synpred4()) :
322 alt3 = 1
323 elif (self.synpred5()) :
324 alt3 = 2
325 else:
326 if self.backtracking > 0:
327 self.failed = True
328 return
329
330 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 8, self.input)
331
332 raise nvae
333
334 elif (LA3_0 == 41) :
335 LA3_9 = self.input.LA(2)
336
337 if (self.synpred4()) :
338 alt3 = 1
339 elif (self.synpred5()) :
340 alt3 = 2
341 else:
342 if self.backtracking > 0:
343 self.failed = True
344 return
345
346 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 9, self.input)
347
348 raise nvae
349
350 elif (LA3_0 == 42) :
351 LA3_10 = self.input.LA(2)
352
353 if (self.synpred4()) :
354 alt3 = 1
355 elif (self.synpred5()) :
356 alt3 = 2
357 else:
358 if self.backtracking > 0:
359 self.failed = True
360 return
361
362 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 10, self.input)
363
364 raise nvae
365
366 elif ((45 <= LA3_0 <= 46)) :
367 LA3_11 = self.input.LA(2)
368
369 if (self.synpred4()) :
370 alt3 = 1
371 elif (self.synpred5()) :
372 alt3 = 2
373 else:
374 if self.backtracking > 0:
375 self.failed = True
376 return
377
378 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 11, self.input)
379
380 raise nvae
381
382 elif (LA3_0 == 48) :
383 LA3_12 = self.input.LA(2)
384
385 if (self.synpred4()) :
386 alt3 = 1
387 elif (self.synpred5()) :
388 alt3 = 2
389 else:
390 if self.backtracking > 0:
391 self.failed = True
392 return
393
394 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 12, self.input)
395
396 raise nvae
397
398 elif (LA3_0 == IDENTIFIER) :
399 LA3_13 = self.input.LA(2)
400
401 if (self.synpred4()) :
402 alt3 = 1
403 elif (self.synpred5()) :
404 alt3 = 2
405 elif (True) :
406 alt3 = 3
407 else:
408 if self.backtracking > 0:
409 self.failed = True
410 return
411
412 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 13, self.input)
413
414 raise nvae
415
416 elif (LA3_0 == 58) :
417 LA3_14 = self.input.LA(2)
418
419 if (self.synpred4()) :
420 alt3 = 1
421 elif (self.synpred5()) :
422 alt3 = 2
423 else:
424 if self.backtracking > 0:
425 self.failed = True
426 return
427
428 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 14, self.input)
429
430 raise nvae
431
432 elif (LA3_0 == 66) and (self.synpred4()):
433 alt3 = 1
434 elif (LA3_0 == 59) :
435 LA3_16 = self.input.LA(2)
436
437 if (self.synpred4()) :
438 alt3 = 1
439 elif (self.synpred5()) :
440 alt3 = 2
441 else:
442 if self.backtracking > 0:
443 self.failed = True
444 return
445
446 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 16, self.input)
447
448 raise nvae
449
450 elif (LA3_0 == 60) :
451 LA3_17 = self.input.LA(2)
452
453 if (self.synpred4()) :
454 alt3 = 1
455 elif (self.synpred5()) :
456 alt3 = 2
457 else:
458 if self.backtracking > 0:
459 self.failed = True
460 return
461
462 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 17, self.input)
463
464 raise nvae
465
466 elif ((49 <= LA3_0 <= 57) or LA3_0 == 61) :
467 LA3_18 = self.input.LA(2)
468
469 if (self.synpred4()) :
470 alt3 = 1
471 elif (self.synpred5()) :
472 alt3 = 2
473 else:
474 if self.backtracking > 0:
475 self.failed = True
476 return
477
478 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 18, self.input)
479
480 raise nvae
481
482 elif (LA3_0 == 62) and (self.synpred4()):
483 alt3 = 1
484 elif (LA3_0 == 26) :
485 alt3 = 2
486 else:
487 if self.backtracking > 0:
488 self.failed = True
489 return
490
491 nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 0, self.input)
492
493 raise nvae
494
495 if alt3 == 1:
496 # C.g:119:4: ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition
497 self.following.append(self.FOLLOW_function_definition_in_external_declaration113)
498 self.function_definition()
499 self.following.pop()
500 if self.failed:
501 return
502
503
504 elif alt3 == 2:
505 # C.g:120:4: declaration
506 self.following.append(self.FOLLOW_declaration_in_external_declaration118)
507 self.declaration()
508 self.following.pop()
509 if self.failed:
510 return
511
512
513 elif alt3 == 3:
514 # C.g:121:4: macro_statement ( ';' )?
515 self.following.append(self.FOLLOW_macro_statement_in_external_declaration123)
516 self.macro_statement()
517 self.following.pop()
518 if self.failed:
519 return
520 # C.g:121:20: ( ';' )?
521 alt2 = 2
522 LA2_0 = self.input.LA(1)
523
524 if (LA2_0 == 25) :
525 alt2 = 1
526 if alt2 == 1:
527 # C.g:121:21: ';'
528 self.match(self.input, 25, self.FOLLOW_25_in_external_declaration126)
529 if self.failed:
530 return
531
532
533
534
535
536
537 except RecognitionException as re:
538 self.reportError(re)
539 self.recover(self.input, re)
540 finally:
541 if self.backtracking > 0:
542 self.memoize(self.input, 2, external_declaration_StartIndex)
543
544 pass
545
546 return
547
548 # $ANTLR end external_declaration
549
550 class function_definition_return(object):
551 def __init__(self):
552 self.start = None
553 self.stop = None
554
555
556
557 # $ANTLR start function_definition
558 # C.g:126:1: function_definition : (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement ) ;
559 def function_definition(self, ):
560 self.function_definition_stack.append(function_definition_scope())
561 retval = self.function_definition_return()
562 retval.start = self.input.LT(1)
563 function_definition_StartIndex = self.input.index()
564 d = None
565
566 a = None
567
568 b = None
569
570 declarator1 = None
571
572
573
574 self.function_definition_stack[-1].ModifierText = ''
575 self.function_definition_stack[-1].DeclText = ''
576 self.function_definition_stack[-1].LBLine = 0
577 self.function_definition_stack[-1].LBOffset = 0
578 self.function_definition_stack[-1].DeclLine = 0
579 self.function_definition_stack[-1].DeclOffset = 0
580
581 try:
582 try:
583 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 3):
584 return retval
585
586 # C.g:146:2: ( (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement ) )
587 # C.g:146:4: (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement )
588 # C.g:146:5: (d= declaration_specifiers )?
589 alt4 = 2
590 LA4 = self.input.LA(1)
591 if LA4 == 29 or LA4 == 30 or LA4 == 31 or LA4 == 32 or LA4 == 33 or LA4 == 34 or LA4 == 35 or LA4 == 36 or LA4 == 37 or LA4 == 38 or LA4 == 39 or LA4 == 40 or LA4 == 41 or LA4 == 42 or LA4 == 45 or LA4 == 46 or LA4 == 48 or LA4 == 49 or LA4 == 50 or LA4 == 51 or LA4 == 52 or LA4 == 53 or LA4 == 54 or LA4 == 55 or LA4 == 56 or LA4 == 57 or LA4 == 61:
592 alt4 = 1
593 elif LA4 == IDENTIFIER:
594 LA4 = self.input.LA(2)
595 if LA4 == 66:
596 alt4 = 1
597 elif LA4 == 58:
598 LA4_21 = self.input.LA(3)
599
600 if (self.synpred7()) :
601 alt4 = 1
602 elif LA4 == 59:
603 LA4_22 = self.input.LA(3)
604
605 if (self.synpred7()) :
606 alt4 = 1
607 elif LA4 == 60:
608 LA4_23 = self.input.LA(3)
609
610 if (self.synpred7()) :
611 alt4 = 1
612 elif LA4 == IDENTIFIER:
613 LA4_24 = self.input.LA(3)
614
615 if (self.synpred7()) :
616 alt4 = 1
617 elif LA4 == 62:
618 LA4_25 = self.input.LA(3)
619
620 if (self.synpred7()) :
621 alt4 = 1
622 elif LA4 == 29 or LA4 == 30 or LA4 == 31 or LA4 == 32 or LA4 == 33:
623 LA4_26 = self.input.LA(3)
624
625 if (self.synpred7()) :
626 alt4 = 1
627 elif LA4 == 34:
628 LA4_27 = self.input.LA(3)
629
630 if (self.synpred7()) :
631 alt4 = 1
632 elif LA4 == 35:
633 LA4_28 = self.input.LA(3)
634
635 if (self.synpred7()) :
636 alt4 = 1
637 elif LA4 == 36:
638 LA4_29 = self.input.LA(3)
639
640 if (self.synpred7()) :
641 alt4 = 1
642 elif LA4 == 37:
643 LA4_30 = self.input.LA(3)
644
645 if (self.synpred7()) :
646 alt4 = 1
647 elif LA4 == 38:
648 LA4_31 = self.input.LA(3)
649
650 if (self.synpred7()) :
651 alt4 = 1
652 elif LA4 == 39:
653 LA4_32 = self.input.LA(3)
654
655 if (self.synpred7()) :
656 alt4 = 1
657 elif LA4 == 40:
658 LA4_33 = self.input.LA(3)
659
660 if (self.synpred7()) :
661 alt4 = 1
662 elif LA4 == 41:
663 LA4_34 = self.input.LA(3)
664
665 if (self.synpred7()) :
666 alt4 = 1
667 elif LA4 == 42:
668 LA4_35 = self.input.LA(3)
669
670 if (self.synpred7()) :
671 alt4 = 1
672 elif LA4 == 45 or LA4 == 46:
673 LA4_36 = self.input.LA(3)
674
675 if (self.synpred7()) :
676 alt4 = 1
677 elif LA4 == 48:
678 LA4_37 = self.input.LA(3)
679
680 if (self.synpred7()) :
681 alt4 = 1
682 elif LA4 == 49 or LA4 == 50 or LA4 == 51 or LA4 == 52 or LA4 == 53 or LA4 == 54 or LA4 == 55 or LA4 == 56 or LA4 == 57 or LA4 == 61:
683 LA4_38 = self.input.LA(3)
684
685 if (self.synpred7()) :
686 alt4 = 1
687 elif LA4 == 58:
688 LA4_14 = self.input.LA(2)
689
690 if (self.synpred7()) :
691 alt4 = 1
692 elif LA4 == 59:
693 LA4_16 = self.input.LA(2)
694
695 if (self.synpred7()) :
696 alt4 = 1
697 elif LA4 == 60:
698 LA4_17 = self.input.LA(2)
699
700 if (self.synpred7()) :
701 alt4 = 1
702 if alt4 == 1:
703 # C.g:0:0: d= declaration_specifiers
704 self.following.append(self.FOLLOW_declaration_specifiers_in_function_definition157)
705 d = self.declaration_specifiers()
706 self.following.pop()
707 if self.failed:
708 return retval
709
710
711
712 self.following.append(self.FOLLOW_declarator_in_function_definition160)
713 declarator1 = self.declarator()
714 self.following.pop()
715 if self.failed:
716 return retval
717 # C.g:147:3: ( ( declaration )+ a= compound_statement | b= compound_statement )
718 alt6 = 2
719 LA6_0 = self.input.LA(1)
720
721 if (LA6_0 == IDENTIFIER or LA6_0 == 26 or (29 <= LA6_0 <= 42) or (45 <= LA6_0 <= 46) or (48 <= LA6_0 <= 61)) :
722 alt6 = 1
723 elif (LA6_0 == 43) :
724 alt6 = 2
725 else:
726 if self.backtracking > 0:
727 self.failed = True
728 return retval
729
730 nvae = NoViableAltException("147:3: ( ( declaration )+ a= compound_statement | b= compound_statement )", 6, 0, self.input)
731
732 raise nvae
733
734 if alt6 == 1:
735 # C.g:147:5: ( declaration )+ a= compound_statement
736 # C.g:147:5: ( declaration )+
737 cnt5 = 0
738 while True: #loop5
739 alt5 = 2
740 LA5_0 = self.input.LA(1)
741
742 if (LA5_0 == IDENTIFIER or LA5_0 == 26 or (29 <= LA5_0 <= 42) or (45 <= LA5_0 <= 46) or (48 <= LA5_0 <= 61)) :
743 alt5 = 1
744
745
746 if alt5 == 1:
747 # C.g:0:0: declaration
748 self.following.append(self.FOLLOW_declaration_in_function_definition166)
749 self.declaration()
750 self.following.pop()
751 if self.failed:
752 return retval
753
754
755 else:
756 if cnt5 >= 1:
757 break #loop5
758
759 if self.backtracking > 0:
760 self.failed = True
761 return retval
762
763 eee = EarlyExitException(5, self.input)
764 raise eee
765
766 cnt5 += 1
767
768
769 self.following.append(self.FOLLOW_compound_statement_in_function_definition171)
770 a = self.compound_statement()
771 self.following.pop()
772 if self.failed:
773 return retval
774
775
776 elif alt6 == 2:
777 # C.g:148:5: b= compound_statement
778 self.following.append(self.FOLLOW_compound_statement_in_function_definition180)
779 b = self.compound_statement()
780 self.following.pop()
781 if self.failed:
782 return retval
783
784
785
786 if self.backtracking == 0:
787
788 if d is not None:
789 self.function_definition_stack[-1].ModifierText = self.input.toString(d.start, d.stop)
790 else:
791 self.function_definition_stack[-1].ModifierText = ''
792 self.function_definition_stack[-1].DeclText = self.input.toString(declarator1.start, declarator1.stop)
793 self.function_definition_stack[-1].DeclLine = declarator1.start.line
794 self.function_definition_stack[-1].DeclOffset = declarator1.start.charPositionInLine
795 if a is not None:
796 self.function_definition_stack[-1].LBLine = a.start.line
797 self.function_definition_stack[-1].LBOffset = a.start.charPositionInLine
798 else:
799 self.function_definition_stack[-1].LBLine = b.start.line
800 self.function_definition_stack[-1].LBOffset = b.start.charPositionInLine
801
802
803
804
805
806 retval.stop = self.input.LT(-1)
807
808 if self.backtracking == 0:
809
810 self.StoreFunctionDefinition(retval.start.line, retval.start.charPositionInLine, retval.stop.line, retval.stop.charPositionInLine, self.function_definition_stack[-1].ModifierText, self.function_definition_stack[-1].DeclText, self.function_definition_stack[-1].LBLine, self.function_definition_stack[-1].LBOffset, self.function_definition_stack[-1].DeclLine, self.function_definition_stack[-1].DeclOffset)
811
812
813
814 except RecognitionException as re:
815 self.reportError(re)
816 self.recover(self.input, re)
817 finally:
818 if self.backtracking > 0:
819 self.memoize(self.input, 3, function_definition_StartIndex)
820
821 self.function_definition_stack.pop()
822 pass
823
824 return retval
825
826 # $ANTLR end function_definition
827
828
829 # $ANTLR start declaration
830 # C.g:166:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );
831 def declaration(self, ):
832
833 declaration_StartIndex = self.input.index()
834 a = None
835 d = None
836 e = None
837 b = None
838
839 c = None
840
841 s = None
842
843 t = None
844
845
846 try:
847 try:
848 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 4):
849 return
850
851 # C.g:167:2: (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' )
852 alt9 = 2
853 LA9_0 = self.input.LA(1)
854
855 if (LA9_0 == 26) :
856 alt9 = 1
857 elif (LA9_0 == IDENTIFIER or (29 <= LA9_0 <= 42) or (45 <= LA9_0 <= 46) or (48 <= LA9_0 <= 61)) :
858 alt9 = 2
859 else:
860 if self.backtracking > 0:
861 self.failed = True
862 return
863
864 nvae = NoViableAltException("166:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );", 9, 0, self.input)
865
866 raise nvae
867
868 if alt9 == 1:
869 # C.g:167:4: a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';'
870 a = self.input.LT(1)
871 self.match(self.input, 26, self.FOLLOW_26_in_declaration203)
872 if self.failed:
873 return
874 # C.g:167:17: (b= declaration_specifiers )?
875 alt7 = 2
876 LA7 = self.input.LA(1)
877 if LA7 == 29 or LA7 == 30 or LA7 == 31 or LA7 == 32 or LA7 == 33 or LA7 == 34 or LA7 == 35 or LA7 == 36 or LA7 == 37 or LA7 == 38 or LA7 == 39 or LA7 == 40 or LA7 == 41 or LA7 == 42 or LA7 == 45 or LA7 == 46 or LA7 == 48 or LA7 == 49 or LA7 == 50 or LA7 == 51 or LA7 == 52 or LA7 == 53 or LA7 == 54 or LA7 == 55 or LA7 == 56 or LA7 == 57 or LA7 == 61:
878 alt7 = 1
879 elif LA7 == IDENTIFIER:
880 LA7_13 = self.input.LA(2)
881
882 if (LA7_13 == 62) :
883 LA7_21 = self.input.LA(3)
884
885 if (self.synpred10()) :
886 alt7 = 1
887 elif (LA7_13 == IDENTIFIER or (29 <= LA7_13 <= 42) or (45 <= LA7_13 <= 46) or (48 <= LA7_13 <= 61) or LA7_13 == 66) :
888 alt7 = 1
889 elif LA7 == 58:
890 LA7_14 = self.input.LA(2)
891
892 if (self.synpred10()) :
893 alt7 = 1
894 elif LA7 == 59:
895 LA7_16 = self.input.LA(2)
896
897 if (self.synpred10()) :
898 alt7 = 1
899 elif LA7 == 60:
900 LA7_17 = self.input.LA(2)
901
902 if (self.synpred10()) :
903 alt7 = 1
904 if alt7 == 1:
905 # C.g:0:0: b= declaration_specifiers
906 self.following.append(self.FOLLOW_declaration_specifiers_in_declaration207)
907 b = self.declaration_specifiers()
908 self.following.pop()
909 if self.failed:
910 return
911
912
913
914 self.following.append(self.FOLLOW_init_declarator_list_in_declaration216)
915 c = self.init_declarator_list()
916 self.following.pop()
917 if self.failed:
918 return
919 d = self.input.LT(1)
920 self.match(self.input, 25, self.FOLLOW_25_in_declaration220)
921 if self.failed:
922 return
923 if self.backtracking == 0:
924
925 if b is not None:
926 self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, self.input.toString(b.start, b.stop), self.input.toString(c.start, c.stop))
927 else:
928 self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start, c.stop))
929
930
931
932
933 elif alt9 == 2:
934 # C.g:175:4: s= declaration_specifiers (t= init_declarator_list )? e= ';'
935 self.following.append(self.FOLLOW_declaration_specifiers_in_declaration234)
936 s = self.declaration_specifiers()
937 self.following.pop()
938 if self.failed:
939 return
940 # C.g:175:30: (t= init_declarator_list )?
941 alt8 = 2
942 LA8_0 = self.input.LA(1)
943
944 if (LA8_0 == IDENTIFIER or (58 <= LA8_0 <= 60) or LA8_0 == 62 or LA8_0 == 66) :
945 alt8 = 1
946 if alt8 == 1:
947 # C.g:0:0: t= init_declarator_list
948 self.following.append(self.FOLLOW_init_declarator_list_in_declaration238)
949 t = self.init_declarator_list()
950 self.following.pop()
951 if self.failed:
952 return
953
954
955
956 e = self.input.LT(1)
957 self.match(self.input, 25, self.FOLLOW_25_in_declaration243)
958 if self.failed:
959 return
960 if self.backtracking == 0:
961
962 if t is not None:
963 self.StoreVariableDeclaration(s.start.line, s.start.charPositionInLine, t.start.line, t.start.charPositionInLine, self.input.toString(s.start, s.stop), self.input.toString(t.start, t.stop))
964
965
966
967
968
969 except RecognitionException as re:
970 self.reportError(re)
971 self.recover(self.input, re)
972 finally:
973 if self.backtracking > 0:
974 self.memoize(self.input, 4, declaration_StartIndex)
975
976 pass
977
978 return
979
980 # $ANTLR end declaration
981
982 class declaration_specifiers_return(object):
983 def __init__(self):
984 self.start = None
985 self.stop = None
986
987
988
989 # $ANTLR start declaration_specifiers
990 # C.g:182:1: declaration_specifiers : ( storage_class_specifier | type_specifier | type_qualifier )+ ;
991 def declaration_specifiers(self, ):
992
993 retval = self.declaration_specifiers_return()
994 retval.start = self.input.LT(1)
995 declaration_specifiers_StartIndex = self.input.index()
996 try:
997 try:
998 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 5):
999 return retval
1000
1001 # C.g:183:2: ( ( storage_class_specifier | type_specifier | type_qualifier )+ )
1002 # C.g:183:6: ( storage_class_specifier | type_specifier | type_qualifier )+
1003 # C.g:183:6: ( storage_class_specifier | type_specifier | type_qualifier )+
1004 cnt10 = 0
1005 while True: #loop10
1006 alt10 = 4
1007 LA10 = self.input.LA(1)
1008 if LA10 == 58:
1009 LA10_2 = self.input.LA(2)
1010
1011 if (self.synpred15()) :
1012 alt10 = 3
1013
1014
1015 elif LA10 == 59:
1016 LA10_3 = self.input.LA(2)
1017
1018 if (self.synpred15()) :
1019 alt10 = 3
1020
1021
1022 elif LA10 == 60:
1023 LA10_4 = self.input.LA(2)
1024
1025 if (self.synpred15()) :
1026 alt10 = 3
1027
1028
1029 elif LA10 == IDENTIFIER:
1030 LA10_5 = self.input.LA(2)
1031
1032 if (self.synpred14()) :
1033 alt10 = 2
1034
1035
1036 elif LA10 == 53:
1037 LA10_9 = self.input.LA(2)
1038
1039 if (self.synpred15()) :
1040 alt10 = 3
1041
1042
1043 elif LA10 == 29 or LA10 == 30 or LA10 == 31 or LA10 == 32 or LA10 == 33:
1044 alt10 = 1
1045 elif LA10 == 34 or LA10 == 35 or LA10 == 36 or LA10 == 37 or LA10 == 38 or LA10 == 39 or LA10 == 40 or LA10 == 41 or LA10 == 42 or LA10 == 45 or LA10 == 46 or LA10 == 48:
1046 alt10 = 2
1047 elif LA10 == 49 or LA10 == 50 or LA10 == 51 or LA10 == 52 or LA10 == 54 or LA10 == 55 or LA10 == 56 or LA10 == 57 or LA10 == 61:
1048 alt10 = 3
1049
1050 if alt10 == 1:
1051 # C.g:183:10: storage_class_specifier
1052 self.following.append(self.FOLLOW_storage_class_specifier_in_declaration_specifiers264)
1053 self.storage_class_specifier()
1054 self.following.pop()
1055 if self.failed:
1056 return retval
1057
1058
1059 elif alt10 == 2:
1060 # C.g:184:7: type_specifier
1061 self.following.append(self.FOLLOW_type_specifier_in_declaration_specifiers272)
1062 self.type_specifier()
1063 self.following.pop()
1064 if self.failed:
1065 return retval
1066
1067
1068 elif alt10 == 3:
1069 # C.g:185:13: type_qualifier
1070 self.following.append(self.FOLLOW_type_qualifier_in_declaration_specifiers286)
1071 self.type_qualifier()
1072 self.following.pop()
1073 if self.failed:
1074 return retval
1075
1076
1077 else:
1078 if cnt10 >= 1:
1079 break #loop10
1080
1081 if self.backtracking > 0:
1082 self.failed = True
1083 return retval
1084
1085 eee = EarlyExitException(10, self.input)
1086 raise eee
1087
1088 cnt10 += 1
1089
1090
1091
1092
1093
1094 retval.stop = self.input.LT(-1)
1095
1096
1097 except RecognitionException as re:
1098 self.reportError(re)
1099 self.recover(self.input, re)
1100 finally:
1101 if self.backtracking > 0:
1102 self.memoize(self.input, 5, declaration_specifiers_StartIndex)
1103
1104 pass
1105
1106 return retval
1107
1108 # $ANTLR end declaration_specifiers
1109
1110 class init_declarator_list_return(object):
1111 def __init__(self):
1112 self.start = None
1113 self.stop = None
1114
1115
1116
1117 # $ANTLR start init_declarator_list
1118 # C.g:189:1: init_declarator_list : init_declarator ( ',' init_declarator )* ;
1119 def init_declarator_list(self, ):
1120
1121 retval = self.init_declarator_list_return()
1122 retval.start = self.input.LT(1)
1123 init_declarator_list_StartIndex = self.input.index()
1124 try:
1125 try:
1126 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 6):
1127 return retval
1128
1129 # C.g:190:2: ( init_declarator ( ',' init_declarator )* )
1130 # C.g:190:4: init_declarator ( ',' init_declarator )*
1131 self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list308)
1132 self.init_declarator()
1133 self.following.pop()
1134 if self.failed:
1135 return retval
1136 # C.g:190:20: ( ',' init_declarator )*
1137 while True: #loop11
1138 alt11 = 2
1139 LA11_0 = self.input.LA(1)
1140
1141 if (LA11_0 == 27) :
1142 alt11 = 1
1143
1144
1145 if alt11 == 1:
1146 # C.g:190:21: ',' init_declarator
1147 self.match(self.input, 27, self.FOLLOW_27_in_init_declarator_list311)
1148 if self.failed:
1149 return retval
1150 self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list313)
1151 self.init_declarator()
1152 self.following.pop()
1153 if self.failed:
1154 return retval
1155
1156
1157 else:
1158 break #loop11
1159
1160
1161
1162
1163
1164 retval.stop = self.input.LT(-1)
1165
1166
1167 except RecognitionException as re:
1168 self.reportError(re)
1169 self.recover(self.input, re)
1170 finally:
1171 if self.backtracking > 0:
1172 self.memoize(self.input, 6, init_declarator_list_StartIndex)
1173
1174 pass
1175
1176 return retval
1177
1178 # $ANTLR end init_declarator_list
1179
1180
1181 # $ANTLR start init_declarator
1182 # C.g:193:1: init_declarator : declarator ( '=' initializer )? ;
1183 def init_declarator(self, ):
1184
1185 init_declarator_StartIndex = self.input.index()
1186 try:
1187 try:
1188 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 7):
1189 return
1190
1191 # C.g:194:2: ( declarator ( '=' initializer )? )
1192 # C.g:194:4: declarator ( '=' initializer )?
1193 self.following.append(self.FOLLOW_declarator_in_init_declarator326)
1194 self.declarator()
1195 self.following.pop()
1196 if self.failed:
1197 return
1198 # C.g:194:15: ( '=' initializer )?
1199 alt12 = 2
1200 LA12_0 = self.input.LA(1)
1201
1202 if (LA12_0 == 28) :
1203 alt12 = 1
1204 if alt12 == 1:
1205 # C.g:194:16: '=' initializer
1206 self.match(self.input, 28, self.FOLLOW_28_in_init_declarator329)
1207 if self.failed:
1208 return
1209 self.following.append(self.FOLLOW_initializer_in_init_declarator331)
1210 self.initializer()
1211 self.following.pop()
1212 if self.failed:
1213 return
1214
1215
1216
1217
1218
1219
1220
1221 except RecognitionException as re:
1222 self.reportError(re)
1223 self.recover(self.input, re)
1224 finally:
1225 if self.backtracking > 0:
1226 self.memoize(self.input, 7, init_declarator_StartIndex)
1227
1228 pass
1229
1230 return
1231
1232 # $ANTLR end init_declarator
1233
1234
1235 # $ANTLR start storage_class_specifier
1236 # C.g:197:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' | 'register' | 'STATIC' );
1237 def storage_class_specifier(self, ):
1238
1239 storage_class_specifier_StartIndex = self.input.index()
1240 try:
1241 try:
1242 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 8):
1243 return
1244
1245 # C.g:198:2: ( 'extern' | 'static' | 'auto' | 'register' | 'STATIC' )
1246 # C.g:
1247 if (29 <= self.input.LA(1) <= 33):
1248 self.input.consume();
1249 self.errorRecovery = False
1250 self.failed = False
1251
1252 else:
1253 if self.backtracking > 0:
1254 self.failed = True
1255 return
1256
1257 mse = MismatchedSetException(None, self.input)
1258 self.recoverFromMismatchedSet(
1259 self.input, mse, self.FOLLOW_set_in_storage_class_specifier0
1260 )
1261 raise mse
1262
1263
1264
1265
1266
1267
1268 except RecognitionException as re:
1269 self.reportError(re)
1270 self.recover(self.input, re)
1271 finally:
1272 if self.backtracking > 0:
1273 self.memoize(self.input, 8, storage_class_specifier_StartIndex)
1274
1275 pass
1276
1277 return
1278
1279 # $ANTLR end storage_class_specifier
1280
1281
1282 # $ANTLR start type_specifier
1283 # C.g:205:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id );
1284 def type_specifier(self, ):
1285
1286 type_specifier_StartIndex = self.input.index()
1287 s = None
1288
1289 e = None
1290
1291
1292 try:
1293 try:
1294 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 9):
1295 return
1296
1297 # C.g:206:2: ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id )
1298 alt13 = 12
1299 LA13_0 = self.input.LA(1)
1300
1301 if (LA13_0 == 34) :
1302 alt13 = 1
1303 elif (LA13_0 == 35) :
1304 alt13 = 2
1305 elif (LA13_0 == 36) :
1306 alt13 = 3
1307 elif (LA13_0 == 37) :
1308 alt13 = 4
1309 elif (LA13_0 == 38) :
1310 alt13 = 5
1311 elif (LA13_0 == 39) :
1312 alt13 = 6
1313 elif (LA13_0 == 40) :
1314 alt13 = 7
1315 elif (LA13_0 == 41) :
1316 alt13 = 8
1317 elif (LA13_0 == 42) :
1318 alt13 = 9
1319 elif ((45 <= LA13_0 <= 46)) :
1320 alt13 = 10
1321 elif (LA13_0 == 48) :
1322 alt13 = 11
1323 elif (LA13_0 == IDENTIFIER) and (self.synpred34()):
1324 alt13 = 12
1325 else:
1326 if self.backtracking > 0:
1327 self.failed = True
1328 return
1329
1330 nvae = NoViableAltException("205:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id );", 13, 0, self.input)
1331
1332 raise nvae
1333
1334 if alt13 == 1:
1335 # C.g:206:4: 'void'
1336 self.match(self.input, 34, self.FOLLOW_34_in_type_specifier376)
1337 if self.failed:
1338 return
1339
1340
1341 elif alt13 == 2:
1342 # C.g:207:4: 'char'
1343 self.match(self.input, 35, self.FOLLOW_35_in_type_specifier381)
1344 if self.failed:
1345 return
1346
1347
1348 elif alt13 == 3:
1349 # C.g:208:4: 'short'
1350 self.match(self.input, 36, self.FOLLOW_36_in_type_specifier386)
1351 if self.failed:
1352 return
1353
1354
1355 elif alt13 == 4:
1356 # C.g:209:4: 'int'
1357 self.match(self.input, 37, self.FOLLOW_37_in_type_specifier391)
1358 if self.failed:
1359 return
1360
1361
1362 elif alt13 == 5:
1363 # C.g:210:4: 'long'
1364 self.match(self.input, 38, self.FOLLOW_38_in_type_specifier396)
1365 if self.failed:
1366 return
1367
1368
1369 elif alt13 == 6:
1370 # C.g:211:4: 'float'
1371 self.match(self.input, 39, self.FOLLOW_39_in_type_specifier401)
1372 if self.failed:
1373 return
1374
1375
1376 elif alt13 == 7:
1377 # C.g:212:4: 'double'
1378 self.match(self.input, 40, self.FOLLOW_40_in_type_specifier406)
1379 if self.failed:
1380 return
1381
1382
1383 elif alt13 == 8:
1384 # C.g:213:4: 'signed'
1385 self.match(self.input, 41, self.FOLLOW_41_in_type_specifier411)
1386 if self.failed:
1387 return
1388
1389
1390 elif alt13 == 9:
1391 # C.g:214:4: 'unsigned'
1392 self.match(self.input, 42, self.FOLLOW_42_in_type_specifier416)
1393 if self.failed:
1394 return
1395
1396
1397 elif alt13 == 10:
1398 # C.g:215:4: s= struct_or_union_specifier
1399 self.following.append(self.FOLLOW_struct_or_union_specifier_in_type_specifier423)
1400 s = self.struct_or_union_specifier()
1401 self.following.pop()
1402 if self.failed:
1403 return
1404 if self.backtracking == 0:
1405
1406 if s.stop is not None:
1407 self.StoreStructUnionDefinition(s.start.line, s.start.charPositionInLine, s.stop.line, s.stop.charPositionInLine, self.input.toString(s.start, s.stop))
1408
1409
1410
1411
1412 elif alt13 == 11:
1413 # C.g:220:4: e= enum_specifier
1414 self.following.append(self.FOLLOW_enum_specifier_in_type_specifier433)
1415 e = self.enum_specifier()
1416 self.following.pop()
1417 if self.failed:
1418 return
1419 if self.backtracking == 0:
1420
1421 if e.stop is not None:
1422 self.StoreEnumerationDefinition(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))
1423
1424
1425
1426
1427 elif alt13 == 12:
1428 # C.g:225:4: ( IDENTIFIER ( type_qualifier )* declarator )=> type_id
1429 self.following.append(self.FOLLOW_type_id_in_type_specifier451)
1430 self.type_id()
1431 self.following.pop()
1432 if self.failed:
1433 return
1434
1435
1436
1437 except RecognitionException as re:
1438 self.reportError(re)
1439 self.recover(self.input, re)
1440 finally:
1441 if self.backtracking > 0:
1442 self.memoize(self.input, 9, type_specifier_StartIndex)
1443
1444 pass
1445
1446 return
1447
1448 # $ANTLR end type_specifier
1449
1450
1451 # $ANTLR start type_id
1452 # C.g:228:1: type_id : IDENTIFIER ;
1453 def type_id(self, ):
1454
1455 type_id_StartIndex = self.input.index()
1456 try:
1457 try:
1458 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 10):
1459 return
1460
1461 # C.g:229:5: ( IDENTIFIER )
1462 # C.g:229:9: IDENTIFIER
1463 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_type_id467)
1464 if self.failed:
1465 return
1466
1467
1468
1469
1470 except RecognitionException as re:
1471 self.reportError(re)
1472 self.recover(self.input, re)
1473 finally:
1474 if self.backtracking > 0:
1475 self.memoize(self.input, 10, type_id_StartIndex)
1476
1477 pass
1478
1479 return
1480
1481 # $ANTLR end type_id
1482
1483 class struct_or_union_specifier_return(object):
1484 def __init__(self):
1485 self.start = None
1486 self.stop = None
1487
1488
1489
1490 # $ANTLR start struct_or_union_specifier
1491 # C.g:233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );
1492 def struct_or_union_specifier(self, ):
1493
1494 retval = self.struct_or_union_specifier_return()
1495 retval.start = self.input.LT(1)
1496 struct_or_union_specifier_StartIndex = self.input.index()
1497 try:
1498 try:
1499 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 11):
1500 return retval
1501
1502 # C.g:235:2: ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER )
1503 alt15 = 2
1504 LA15_0 = self.input.LA(1)
1505
1506 if ((45 <= LA15_0 <= 46)) :
1507 LA15_1 = self.input.LA(2)
1508
1509 if (LA15_1 == IDENTIFIER) :
1510 LA15_2 = self.input.LA(3)
1511
1512 if (LA15_2 == 43) :
1513 alt15 = 1
1514 elif (LA15_2 == EOF or LA15_2 == IDENTIFIER or LA15_2 == 25 or LA15_2 == 27 or (29 <= LA15_2 <= 42) or (45 <= LA15_2 <= 64) or LA15_2 == 66) :
1515 alt15 = 2
1516 else:
1517 if self.backtracking > 0:
1518 self.failed = True
1519 return retval
1520
1521 nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 2, self.input)
1522
1523 raise nvae
1524
1525 elif (LA15_1 == 43) :
1526 alt15 = 1
1527 else:
1528 if self.backtracking > 0:
1529 self.failed = True
1530 return retval
1531
1532 nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 1, self.input)
1533
1534 raise nvae
1535
1536 else:
1537 if self.backtracking > 0:
1538 self.failed = True
1539 return retval
1540
1541 nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 0, self.input)
1542
1543 raise nvae
1544
1545 if alt15 == 1:
1546 # C.g:235:4: struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}'
1547 self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier494)
1548 self.struct_or_union()
1549 self.following.pop()
1550 if self.failed:
1551 return retval
1552 # C.g:235:20: ( IDENTIFIER )?
1553 alt14 = 2
1554 LA14_0 = self.input.LA(1)
1555
1556 if (LA14_0 == IDENTIFIER) :
1557 alt14 = 1
1558 if alt14 == 1:
1559 # C.g:0:0: IDENTIFIER
1560 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier496)
1561 if self.failed:
1562 return retval
1563
1564
1565
1566 self.match(self.input, 43, self.FOLLOW_43_in_struct_or_union_specifier499)
1567 if self.failed:
1568 return retval
1569 self.following.append(self.FOLLOW_struct_declaration_list_in_struct_or_union_specifier501)
1570 self.struct_declaration_list()
1571 self.following.pop()
1572 if self.failed:
1573 return retval
1574 self.match(self.input, 44, self.FOLLOW_44_in_struct_or_union_specifier503)
1575 if self.failed:
1576 return retval
1577
1578
1579 elif alt15 == 2:
1580 # C.g:236:4: struct_or_union IDENTIFIER
1581 self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier508)
1582 self.struct_or_union()
1583 self.following.pop()
1584 if self.failed:
1585 return retval
1586 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier510)
1587 if self.failed:
1588 return retval
1589
1590
1591 retval.stop = self.input.LT(-1)
1592
1593
1594 except RecognitionException as re:
1595 self.reportError(re)
1596 self.recover(self.input, re)
1597 finally:
1598 if self.backtracking > 0:
1599 self.memoize(self.input, 11, struct_or_union_specifier_StartIndex)
1600
1601 pass
1602
1603 return retval
1604
1605 # $ANTLR end struct_or_union_specifier
1606
1607
1608 # $ANTLR start struct_or_union
1609 # C.g:239:1: struct_or_union : ( 'struct' | 'union' );
1610 def struct_or_union(self, ):
1611
1612 struct_or_union_StartIndex = self.input.index()
1613 try:
1614 try:
1615 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 12):
1616 return
1617
1618 # C.g:240:2: ( 'struct' | 'union' )
1619 # C.g:
1620 if (45 <= self.input.LA(1) <= 46):
1621 self.input.consume();
1622 self.errorRecovery = False
1623 self.failed = False
1624
1625 else:
1626 if self.backtracking > 0:
1627 self.failed = True
1628 return
1629
1630 mse = MismatchedSetException(None, self.input)
1631 self.recoverFromMismatchedSet(
1632 self.input, mse, self.FOLLOW_set_in_struct_or_union0
1633 )
1634 raise mse
1635
1636
1637
1638
1639
1640
1641 except RecognitionException as re:
1642 self.reportError(re)
1643 self.recover(self.input, re)
1644 finally:
1645 if self.backtracking > 0:
1646 self.memoize(self.input, 12, struct_or_union_StartIndex)
1647
1648 pass
1649
1650 return
1651
1652 # $ANTLR end struct_or_union
1653
1654
1655 # $ANTLR start struct_declaration_list
1656 # C.g:244:1: struct_declaration_list : ( struct_declaration )+ ;
1657 def struct_declaration_list(self, ):
1658
1659 struct_declaration_list_StartIndex = self.input.index()
1660 try:
1661 try:
1662 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 13):
1663 return
1664
1665 # C.g:245:2: ( ( struct_declaration )+ )
1666 # C.g:245:4: ( struct_declaration )+
1667 # C.g:245:4: ( struct_declaration )+
1668 cnt16 = 0
1669 while True: #loop16
1670 alt16 = 2
1671 LA16_0 = self.input.LA(1)
1672
1673 if (LA16_0 == IDENTIFIER or (34 <= LA16_0 <= 42) or (45 <= LA16_0 <= 46) or (48 <= LA16_0 <= 61)) :
1674 alt16 = 1
1675
1676
1677 if alt16 == 1:
1678 # C.g:0:0: struct_declaration
1679 self.following.append(self.FOLLOW_struct_declaration_in_struct_declaration_list537)
1680 self.struct_declaration()
1681 self.following.pop()
1682 if self.failed:
1683 return
1684
1685
1686 else:
1687 if cnt16 >= 1:
1688 break #loop16
1689
1690 if self.backtracking > 0:
1691 self.failed = True
1692 return
1693
1694 eee = EarlyExitException(16, self.input)
1695 raise eee
1696
1697 cnt16 += 1
1698
1699
1700
1701
1702
1703
1704 except RecognitionException as re:
1705 self.reportError(re)
1706 self.recover(self.input, re)
1707 finally:
1708 if self.backtracking > 0:
1709 self.memoize(self.input, 13, struct_declaration_list_StartIndex)
1710
1711 pass
1712
1713 return
1714
1715 # $ANTLR end struct_declaration_list
1716
1717
1718 # $ANTLR start struct_declaration
1719 # C.g:248:1: struct_declaration : specifier_qualifier_list struct_declarator_list ';' ;
1720 def struct_declaration(self, ):
1721
1722 struct_declaration_StartIndex = self.input.index()
1723 try:
1724 try:
1725 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 14):
1726 return
1727
1728 # C.g:249:2: ( specifier_qualifier_list struct_declarator_list ';' )
1729 # C.g:249:4: specifier_qualifier_list struct_declarator_list ';'
1730 self.following.append(self.FOLLOW_specifier_qualifier_list_in_struct_declaration549)
1731 self.specifier_qualifier_list()
1732 self.following.pop()
1733 if self.failed:
1734 return
1735 self.following.append(self.FOLLOW_struct_declarator_list_in_struct_declaration551)
1736 self.struct_declarator_list()
1737 self.following.pop()
1738 if self.failed:
1739 return
1740 self.match(self.input, 25, self.FOLLOW_25_in_struct_declaration553)
1741 if self.failed:
1742 return
1743
1744
1745
1746
1747 except RecognitionException as re:
1748 self.reportError(re)
1749 self.recover(self.input, re)
1750 finally:
1751 if self.backtracking > 0:
1752 self.memoize(self.input, 14, struct_declaration_StartIndex)
1753
1754 pass
1755
1756 return
1757
1758 # $ANTLR end struct_declaration
1759
1760
1761 # $ANTLR start specifier_qualifier_list
1762 # C.g:252:1: specifier_qualifier_list : ( type_qualifier | type_specifier )+ ;
1763 def specifier_qualifier_list(self, ):
1764
1765 specifier_qualifier_list_StartIndex = self.input.index()
1766 try:
1767 try:
1768 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 15):
1769 return
1770
1771 # C.g:253:2: ( ( type_qualifier | type_specifier )+ )
1772 # C.g:253:4: ( type_qualifier | type_specifier )+
1773 # C.g:253:4: ( type_qualifier | type_specifier )+
1774 cnt17 = 0
1775 while True: #loop17
1776 alt17 = 3
1777 LA17 = self.input.LA(1)
1778 if LA17 == 58:
1779 LA17_2 = self.input.LA(2)
1780
1781 if (self.synpred39()) :
1782 alt17 = 1
1783
1784
1785 elif LA17 == 59:
1786 LA17_3 = self.input.LA(2)
1787
1788 if (self.synpred39()) :
1789 alt17 = 1
1790
1791
1792 elif LA17 == 60:
1793 LA17_4 = self.input.LA(2)
1794
1795 if (self.synpred39()) :
1796 alt17 = 1
1797
1798
1799 elif LA17 == IDENTIFIER:
1800 LA17 = self.input.LA(2)
1801 if LA17 == EOF or LA17 == IDENTIFIER or LA17 == 34 or LA17 == 35 or LA17 == 36 or LA17 == 37 or LA17 == 38 or LA17 == 39 or LA17 == 40 or LA17 == 41 or LA17 == 42 or LA17 == 45 or LA17 == 46 or LA17 == 48 or LA17 == 49 or LA17 == 50 or LA17 == 51 or LA17 == 52 or LA17 == 53 or LA17 == 54 or LA17 == 55 or LA17 == 56 or LA17 == 57 or LA17 == 58 or LA17 == 59 or LA17 == 60 or LA17 == 61 or LA17 == 63 or LA17 == 66:
1802 alt17 = 2
1803 elif LA17 == 62:
1804 LA17_94 = self.input.LA(3)
1805
1806 if (self.synpred40()) :
1807 alt17 = 2
1808
1809
1810 elif LA17 == 47:
1811 LA17_95 = self.input.LA(3)
1812
1813 if (self.synpred40()) :
1814 alt17 = 2
1815
1816
1817 elif LA17 == 64:
1818 LA17_96 = self.input.LA(3)
1819
1820 if (self.synpred40()) :
1821 alt17 = 2
1822
1823
1824
1825 elif LA17 == 49 or LA17 == 50 or LA17 == 51 or LA17 == 52 or LA17 == 53 or LA17 == 54 or LA17 == 55 or LA17 == 56 or LA17 == 57 or LA17 == 61:
1826 alt17 = 1
1827 elif LA17 == 34 or LA17 == 35 or LA17 == 36 or LA17 == 37 or LA17 == 38 or LA17 == 39 or LA17 == 40 or LA17 == 41 or LA17 == 42 or LA17 == 45 or LA17 == 46 or LA17 == 48:
1828 alt17 = 2
1829
1830 if alt17 == 1:
1831 # C.g:253:6: type_qualifier
1832 self.following.append(self.FOLLOW_type_qualifier_in_specifier_qualifier_list566)
1833 self.type_qualifier()
1834 self.following.pop()
1835 if self.failed:
1836 return
1837
1838
1839 elif alt17 == 2:
1840 # C.g:253:23: type_specifier
1841 self.following.append(self.FOLLOW_type_specifier_in_specifier_qualifier_list570)
1842 self.type_specifier()
1843 self.following.pop()
1844 if self.failed:
1845 return
1846
1847
1848 else:
1849 if cnt17 >= 1:
1850 break #loop17
1851
1852 if self.backtracking > 0:
1853 self.failed = True
1854 return
1855
1856 eee = EarlyExitException(17, self.input)
1857 raise eee
1858
1859 cnt17 += 1
1860
1861
1862
1863
1864
1865
1866 except RecognitionException as re:
1867 self.reportError(re)
1868 self.recover(self.input, re)
1869 finally:
1870 if self.backtracking > 0:
1871 self.memoize(self.input, 15, specifier_qualifier_list_StartIndex)
1872
1873 pass
1874
1875 return
1876
1877 # $ANTLR end specifier_qualifier_list
1878
1879
1880 # $ANTLR start struct_declarator_list
1881 # C.g:256:1: struct_declarator_list : struct_declarator ( ',' struct_declarator )* ;
1882 def struct_declarator_list(self, ):
1883
1884 struct_declarator_list_StartIndex = self.input.index()
1885 try:
1886 try:
1887 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 16):
1888 return
1889
1890 # C.g:257:2: ( struct_declarator ( ',' struct_declarator )* )
1891 # C.g:257:4: struct_declarator ( ',' struct_declarator )*
1892 self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list584)
1893 self.struct_declarator()
1894 self.following.pop()
1895 if self.failed:
1896 return
1897 # C.g:257:22: ( ',' struct_declarator )*
1898 while True: #loop18
1899 alt18 = 2
1900 LA18_0 = self.input.LA(1)
1901
1902 if (LA18_0 == 27) :
1903 alt18 = 1
1904
1905
1906 if alt18 == 1:
1907 # C.g:257:23: ',' struct_declarator
1908 self.match(self.input, 27, self.FOLLOW_27_in_struct_declarator_list587)
1909 if self.failed:
1910 return
1911 self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list589)
1912 self.struct_declarator()
1913 self.following.pop()
1914 if self.failed:
1915 return
1916
1917
1918 else:
1919 break #loop18
1920
1921
1922
1923
1924
1925
1926 except RecognitionException as re:
1927 self.reportError(re)
1928 self.recover(self.input, re)
1929 finally:
1930 if self.backtracking > 0:
1931 self.memoize(self.input, 16, struct_declarator_list_StartIndex)
1932
1933 pass
1934
1935 return
1936
1937 # $ANTLR end struct_declarator_list
1938
1939
1940 # $ANTLR start struct_declarator
1941 # C.g:260:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );
1942 def struct_declarator(self, ):
1943
1944 struct_declarator_StartIndex = self.input.index()
1945 try:
1946 try:
1947 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 17):
1948 return
1949
1950 # C.g:261:2: ( declarator ( ':' constant_expression )? | ':' constant_expression )
1951 alt20 = 2
1952 LA20_0 = self.input.LA(1)
1953
1954 if (LA20_0 == IDENTIFIER or (58 <= LA20_0 <= 60) or LA20_0 == 62 or LA20_0 == 66) :
1955 alt20 = 1
1956 elif (LA20_0 == 47) :
1957 alt20 = 2
1958 else:
1959 if self.backtracking > 0:
1960 self.failed = True
1961 return
1962
1963 nvae = NoViableAltException("260:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );", 20, 0, self.input)
1964
1965 raise nvae
1966
1967 if alt20 == 1:
1968 # C.g:261:4: declarator ( ':' constant_expression )?
1969 self.following.append(self.FOLLOW_declarator_in_struct_declarator602)
1970 self.declarator()
1971 self.following.pop()
1972 if self.failed:
1973 return
1974 # C.g:261:15: ( ':' constant_expression )?
1975 alt19 = 2
1976 LA19_0 = self.input.LA(1)
1977
1978 if (LA19_0 == 47) :
1979 alt19 = 1
1980 if alt19 == 1:
1981 # C.g:261:16: ':' constant_expression
1982 self.match(self.input, 47, self.FOLLOW_47_in_struct_declarator605)
1983 if self.failed:
1984 return
1985 self.following.append(self.FOLLOW_constant_expression_in_struct_declarator607)
1986 self.constant_expression()
1987 self.following.pop()
1988 if self.failed:
1989 return
1990
1991
1992
1993
1994
1995 elif alt20 == 2:
1996 # C.g:262:4: ':' constant_expression
1997 self.match(self.input, 47, self.FOLLOW_47_in_struct_declarator614)
1998 if self.failed:
1999 return
2000 self.following.append(self.FOLLOW_constant_expression_in_struct_declarator616)
2001 self.constant_expression()
2002 self.following.pop()
2003 if self.failed:
2004 return
2005
2006
2007
2008 except RecognitionException as re:
2009 self.reportError(re)
2010 self.recover(self.input, re)
2011 finally:
2012 if self.backtracking > 0:
2013 self.memoize(self.input, 17, struct_declarator_StartIndex)
2014
2015 pass
2016
2017 return
2018
2019 # $ANTLR end struct_declarator
2020
2021 class enum_specifier_return(object):
2022 def __init__(self):
2023 self.start = None
2024 self.stop = None
2025
2026
2027
2028 # $ANTLR start enum_specifier
2029 # C.g:265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );
2030 def enum_specifier(self, ):
2031
2032 retval = self.enum_specifier_return()
2033 retval.start = self.input.LT(1)
2034 enum_specifier_StartIndex = self.input.index()
2035 try:
2036 try:
2037 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 18):
2038 return retval
2039
2040 # C.g:267:2: ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER )
2041 alt23 = 3
2042 LA23_0 = self.input.LA(1)
2043
2044 if (LA23_0 == 48) :
2045 LA23_1 = self.input.LA(2)
2046
2047 if (LA23_1 == IDENTIFIER) :
2048 LA23_2 = self.input.LA(3)
2049
2050 if (LA23_2 == 43) :
2051 alt23 = 2
2052 elif (LA23_2 == EOF or LA23_2 == IDENTIFIER or LA23_2 == 25 or LA23_2 == 27 or (29 <= LA23_2 <= 42) or (45 <= LA23_2 <= 64) or LA23_2 == 66) :
2053 alt23 = 3
2054 else:
2055 if self.backtracking > 0:
2056 self.failed = True
2057 return retval
2058
2059 nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 2, self.input)
2060
2061 raise nvae
2062
2063 elif (LA23_1 == 43) :
2064 alt23 = 1
2065 else:
2066 if self.backtracking > 0:
2067 self.failed = True
2068 return retval
2069
2070 nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 1, self.input)
2071
2072 raise nvae
2073
2074 else:
2075 if self.backtracking > 0:
2076 self.failed = True
2077 return retval
2078
2079 nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 0, self.input)
2080
2081 raise nvae
2082
2083 if alt23 == 1:
2084 # C.g:267:4: 'enum' '{' enumerator_list ( ',' )? '}'
2085 self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier634)
2086 if self.failed:
2087 return retval
2088 self.match(self.input, 43, self.FOLLOW_43_in_enum_specifier636)
2089 if self.failed:
2090 return retval
2091 self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier638)
2092 self.enumerator_list()
2093 self.following.pop()
2094 if self.failed:
2095 return retval
2096 # C.g:267:31: ( ',' )?
2097 alt21 = 2
2098 LA21_0 = self.input.LA(1)
2099
2100 if (LA21_0 == 27) :
2101 alt21 = 1
2102 if alt21 == 1:
2103 # C.g:0:0: ','
2104 self.match(self.input, 27, self.FOLLOW_27_in_enum_specifier640)
2105 if self.failed:
2106 return retval
2107
2108
2109
2110 self.match(self.input, 44, self.FOLLOW_44_in_enum_specifier643)
2111 if self.failed:
2112 return retval
2113
2114
2115 elif alt23 == 2:
2116 # C.g:268:4: 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}'
2117 self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier648)
2118 if self.failed:
2119 return retval
2120 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier650)
2121 if self.failed:
2122 return retval
2123 self.match(self.input, 43, self.FOLLOW_43_in_enum_specifier652)
2124 if self.failed:
2125 return retval
2126 self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier654)
2127 self.enumerator_list()
2128 self.following.pop()
2129 if self.failed:
2130 return retval
2131 # C.g:268:42: ( ',' )?
2132 alt22 = 2
2133 LA22_0 = self.input.LA(1)
2134
2135 if (LA22_0 == 27) :
2136 alt22 = 1
2137 if alt22 == 1:
2138 # C.g:0:0: ','
2139 self.match(self.input, 27, self.FOLLOW_27_in_enum_specifier656)
2140 if self.failed:
2141 return retval
2142
2143
2144
2145 self.match(self.input, 44, self.FOLLOW_44_in_enum_specifier659)
2146 if self.failed:
2147 return retval
2148
2149
2150 elif alt23 == 3:
2151 # C.g:269:4: 'enum' IDENTIFIER
2152 self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier664)
2153 if self.failed:
2154 return retval
2155 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier666)
2156 if self.failed:
2157 return retval
2158
2159
2160 retval.stop = self.input.LT(-1)
2161
2162
2163 except RecognitionException as re:
2164 self.reportError(re)
2165 self.recover(self.input, re)
2166 finally:
2167 if self.backtracking > 0:
2168 self.memoize(self.input, 18, enum_specifier_StartIndex)
2169
2170 pass
2171
2172 return retval
2173
2174 # $ANTLR end enum_specifier
2175
2176
2177 # $ANTLR start enumerator_list
2178 # C.g:272:1: enumerator_list : enumerator ( ',' enumerator )* ;
2179 def enumerator_list(self, ):
2180
2181 enumerator_list_StartIndex = self.input.index()
2182 try:
2183 try:
2184 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 19):
2185 return
2186
2187 # C.g:273:2: ( enumerator ( ',' enumerator )* )
2188 # C.g:273:4: enumerator ( ',' enumerator )*
2189 self.following.append(self.FOLLOW_enumerator_in_enumerator_list677)
2190 self.enumerator()
2191 self.following.pop()
2192 if self.failed:
2193 return
2194 # C.g:273:15: ( ',' enumerator )*
2195 while True: #loop24
2196 alt24 = 2
2197 LA24_0 = self.input.LA(1)
2198
2199 if (LA24_0 == 27) :
2200 LA24_1 = self.input.LA(2)
2201
2202 if (LA24_1 == IDENTIFIER) :
2203 alt24 = 1
2204
2205
2206
2207
2208 if alt24 == 1:
2209 # C.g:273:16: ',' enumerator
2210 self.match(self.input, 27, self.FOLLOW_27_in_enumerator_list680)
2211 if self.failed:
2212 return
2213 self.following.append(self.FOLLOW_enumerator_in_enumerator_list682)
2214 self.enumerator()
2215 self.following.pop()
2216 if self.failed:
2217 return
2218
2219
2220 else:
2221 break #loop24
2222
2223
2224
2225
2226
2227
2228 except RecognitionException as re:
2229 self.reportError(re)
2230 self.recover(self.input, re)
2231 finally:
2232 if self.backtracking > 0:
2233 self.memoize(self.input, 19, enumerator_list_StartIndex)
2234
2235 pass
2236
2237 return
2238
2239 # $ANTLR end enumerator_list
2240
2241
2242 # $ANTLR start enumerator
2243 # C.g:276:1: enumerator : IDENTIFIER ( '=' constant_expression )? ;
2244 def enumerator(self, ):
2245
2246 enumerator_StartIndex = self.input.index()
2247 try:
2248 try:
2249 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 20):
2250 return
2251
2252 # C.g:277:2: ( IDENTIFIER ( '=' constant_expression )? )
2253 # C.g:277:4: IDENTIFIER ( '=' constant_expression )?
2254 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enumerator695)
2255 if self.failed:
2256 return
2257 # C.g:277:15: ( '=' constant_expression )?
2258 alt25 = 2
2259 LA25_0 = self.input.LA(1)
2260
2261 if (LA25_0 == 28) :
2262 alt25 = 1
2263 if alt25 == 1:
2264 # C.g:277:16: '=' constant_expression
2265 self.match(self.input, 28, self.FOLLOW_28_in_enumerator698)
2266 if self.failed:
2267 return
2268 self.following.append(self.FOLLOW_constant_expression_in_enumerator700)
2269 self.constant_expression()
2270 self.following.pop()
2271 if self.failed:
2272 return
2273
2274
2275
2276
2277
2278
2279
2280 except RecognitionException as re:
2281 self.reportError(re)
2282 self.recover(self.input, re)
2283 finally:
2284 if self.backtracking > 0:
2285 self.memoize(self.input, 20, enumerator_StartIndex)
2286
2287 pass
2288
2289 return
2290
2291 # $ANTLR end enumerator
2292
2293
2294 # $ANTLR start type_qualifier
2295 # C.g:280:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTIONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' );
2296 def type_qualifier(self, ):
2297
2298 type_qualifier_StartIndex = self.input.index()
2299 try:
2300 try:
2301 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 21):
2302 return
2303
2304 # C.g:281:2: ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTIONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' )
2305 # C.g:
2306 if (49 <= self.input.LA(1) <= 61):
2307 self.input.consume();
2308 self.errorRecovery = False
2309 self.failed = False
2310
2311 else:
2312 if self.backtracking > 0:
2313 self.failed = True
2314 return
2315
2316 mse = MismatchedSetException(None, self.input)
2317 self.recoverFromMismatchedSet(
2318 self.input, mse, self.FOLLOW_set_in_type_qualifier0
2319 )
2320 raise mse
2321
2322
2323
2324
2325
2326
2327 except RecognitionException as re:
2328 self.reportError(re)
2329 self.recover(self.input, re)
2330 finally:
2331 if self.backtracking > 0:
2332 self.memoize(self.input, 21, type_qualifier_StartIndex)
2333
2334 pass
2335
2336 return
2337
2338 # $ANTLR end type_qualifier
2339
2340 class declarator_return(object):
2341 def __init__(self):
2342 self.start = None
2343 self.stop = None
2344
2345
2346
2347 # $ANTLR start declarator
2348 # C.g:296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );
2349 def declarator(self, ):
2350
2351 retval = self.declarator_return()
2352 retval.start = self.input.LT(1)
2353 declarator_StartIndex = self.input.index()
2354 try:
2355 try:
2356 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 22):
2357 return retval
2358
2359 # C.g:297:2: ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer )
2360 alt30 = 2
2361 LA30_0 = self.input.LA(1)
2362
2363 if (LA30_0 == 66) :
2364 LA30_1 = self.input.LA(2)
2365
2366 if (self.synpred66()) :
2367 alt30 = 1
2368 elif (True) :
2369 alt30 = 2
2370 else:
2371 if self.backtracking > 0:
2372 self.failed = True
2373 return retval
2374
2375 nvae = NoViableAltException("296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );", 30, 1, self.input)
2376
2377 raise nvae
2378
2379 elif (LA30_0 == IDENTIFIER or (58 <= LA30_0 <= 60) or LA30_0 == 62) :
2380 alt30 = 1
2381 else:
2382 if self.backtracking > 0:
2383 self.failed = True
2384 return retval
2385
2386 nvae = NoViableAltException("296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );", 30, 0, self.input)
2387
2388 raise nvae
2389
2390 if alt30 == 1:
2391 # C.g:297:4: ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator
2392 # C.g:297:4: ( pointer )?
2393 alt26 = 2
2394 LA26_0 = self.input.LA(1)
2395
2396 if (LA26_0 == 66) :
2397 alt26 = 1
2398 if alt26 == 1:
2399 # C.g:0:0: pointer
2400 self.following.append(self.FOLLOW_pointer_in_declarator784)
2401 self.pointer()
2402 self.following.pop()
2403 if self.failed:
2404 return retval
2405
2406
2407
2408 # C.g:297:13: ( 'EFIAPI' )?
2409 alt27 = 2
2410 LA27_0 = self.input.LA(1)
2411
2412 if (LA27_0 == 58) :
2413 alt27 = 1
2414 if alt27 == 1:
2415 # C.g:297:14: 'EFIAPI'
2416 self.match(self.input, 58, self.FOLLOW_58_in_declarator788)
2417 if self.failed:
2418 return retval
2419
2420
2421
2422 # C.g:297:25: ( 'EFI_BOOTSERVICE' )?
2423 alt28 = 2
2424 LA28_0 = self.input.LA(1)
2425
2426 if (LA28_0 == 59) :
2427 alt28 = 1
2428 if alt28 == 1:
2429 # C.g:297:26: 'EFI_BOOTSERVICE'
2430 self.match(self.input, 59, self.FOLLOW_59_in_declarator793)
2431 if self.failed:
2432 return retval
2433
2434
2435
2436 # C.g:297:46: ( 'EFI_RUNTIMESERVICE' )?
2437 alt29 = 2
2438 LA29_0 = self.input.LA(1)
2439
2440 if (LA29_0 == 60) :
2441 alt29 = 1
2442 if alt29 == 1:
2443 # C.g:297:47: 'EFI_RUNTIMESERVICE'
2444 self.match(self.input, 60, self.FOLLOW_60_in_declarator798)
2445 if self.failed:
2446 return retval
2447
2448
2449
2450 self.following.append(self.FOLLOW_direct_declarator_in_declarator802)
2451 self.direct_declarator()
2452 self.following.pop()
2453 if self.failed:
2454 return retval
2455
2456
2457 elif alt30 == 2:
2458 # C.g:299:4: pointer
2459 self.following.append(self.FOLLOW_pointer_in_declarator808)
2460 self.pointer()
2461 self.following.pop()
2462 if self.failed:
2463 return retval
2464
2465
2466 retval.stop = self.input.LT(-1)
2467
2468
2469 except RecognitionException as re:
2470 self.reportError(re)
2471 self.recover(self.input, re)
2472 finally:
2473 if self.backtracking > 0:
2474 self.memoize(self.input, 22, declarator_StartIndex)
2475
2476 pass
2477
2478 return retval
2479
2480 # $ANTLR end declarator
2481
2482
2483 # $ANTLR start direct_declarator
2484 # C.g:302:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );
2485 def direct_declarator(self, ):
2486
2487 direct_declarator_StartIndex = self.input.index()
2488 try:
2489 try:
2490 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 23):
2491 return
2492
2493 # C.g:303:2: ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ )
2494 alt34 = 2
2495 LA34_0 = self.input.LA(1)
2496
2497 if (LA34_0 == IDENTIFIER) :
2498 alt34 = 1
2499 elif (LA34_0 == 62) :
2500 alt34 = 2
2501 else:
2502 if self.backtracking > 0:
2503 self.failed = True
2504 return
2505
2506 nvae = NoViableAltException("302:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );", 34, 0, self.input)
2507
2508 raise nvae
2509
2510 if alt34 == 1:
2511 # C.g:303:4: IDENTIFIER ( declarator_suffix )*
2512 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_direct_declarator819)
2513 if self.failed:
2514 return
2515 # C.g:303:15: ( declarator_suffix )*
2516 while True: #loop31
2517 alt31 = 2
2518 LA31_0 = self.input.LA(1)
2519
2520 if (LA31_0 == 62) :
2521 LA31 = self.input.LA(2)
2522 if LA31 == 63:
2523 LA31_30 = self.input.LA(3)
2524
2525 if (self.synpred67()) :
2526 alt31 = 1
2527
2528
2529 elif LA31 == 58:
2530 LA31_31 = self.input.LA(3)
2531
2532 if (self.synpred67()) :
2533 alt31 = 1
2534
2535
2536 elif LA31 == 66:
2537 LA31_32 = self.input.LA(3)
2538
2539 if (self.synpred67()) :
2540 alt31 = 1
2541
2542
2543 elif LA31 == 59:
2544 LA31_33 = self.input.LA(3)
2545
2546 if (self.synpred67()) :
2547 alt31 = 1
2548
2549
2550 elif LA31 == 60:
2551 LA31_34 = self.input.LA(3)
2552
2553 if (self.synpred67()) :
2554 alt31 = 1
2555
2556
2557 elif LA31 == IDENTIFIER:
2558 LA31_35 = self.input.LA(3)
2559
2560 if (self.synpred67()) :
2561 alt31 = 1
2562
2563
2564 elif LA31 == 29 or LA31 == 30 or LA31 == 31 or LA31 == 32 or LA31 == 33:
2565 LA31_37 = self.input.LA(3)
2566
2567 if (self.synpred67()) :
2568 alt31 = 1
2569
2570
2571 elif LA31 == 34:
2572 LA31_38 = self.input.LA(3)
2573
2574 if (self.synpred67()) :
2575 alt31 = 1
2576
2577
2578 elif LA31 == 35:
2579 LA31_39 = self.input.LA(3)
2580
2581 if (self.synpred67()) :
2582 alt31 = 1
2583
2584
2585 elif LA31 == 36:
2586 LA31_40 = self.input.LA(3)
2587
2588 if (self.synpred67()) :
2589 alt31 = 1
2590
2591
2592 elif LA31 == 37:
2593 LA31_41 = self.input.LA(3)
2594
2595 if (self.synpred67()) :
2596 alt31 = 1
2597
2598
2599 elif LA31 == 38:
2600 LA31_42 = self.input.LA(3)
2601
2602 if (self.synpred67()) :
2603 alt31 = 1
2604
2605
2606 elif LA31 == 39:
2607 LA31_43 = self.input.LA(3)
2608
2609 if (self.synpred67()) :
2610 alt31 = 1
2611
2612
2613 elif LA31 == 40:
2614 LA31_44 = self.input.LA(3)
2615
2616 if (self.synpred67()) :
2617 alt31 = 1
2618
2619
2620 elif LA31 == 41:
2621 LA31_45 = self.input.LA(3)
2622
2623 if (self.synpred67()) :
2624 alt31 = 1
2625
2626
2627 elif LA31 == 42:
2628 LA31_46 = self.input.LA(3)
2629
2630 if (self.synpred67()) :
2631 alt31 = 1
2632
2633
2634 elif LA31 == 45 or LA31 == 46:
2635 LA31_47 = self.input.LA(3)
2636
2637 if (self.synpred67()) :
2638 alt31 = 1
2639
2640
2641 elif LA31 == 48:
2642 LA31_48 = self.input.LA(3)
2643
2644 if (self.synpred67()) :
2645 alt31 = 1
2646
2647
2648 elif LA31 == 49 or LA31 == 50 or LA31 == 51 or LA31 == 52 or LA31 == 53 or LA31 == 54 or LA31 == 55 or LA31 == 56 or LA31 == 57 or LA31 == 61:
2649 LA31_49 = self.input.LA(3)
2650
2651 if (self.synpred67()) :
2652 alt31 = 1
2653
2654
2655
2656 elif (LA31_0 == 64) :
2657 LA31 = self.input.LA(2)
2658 if LA31 == 65:
2659 LA31_51 = self.input.LA(3)
2660
2661 if (self.synpred67()) :
2662 alt31 = 1
2663
2664
2665 elif LA31 == 62:
2666 LA31_52 = self.input.LA(3)
2667
2668 if (self.synpred67()) :
2669 alt31 = 1
2670
2671
2672 elif LA31 == IDENTIFIER:
2673 LA31_53 = self.input.LA(3)
2674
2675 if (self.synpred67()) :
2676 alt31 = 1
2677
2678
2679 elif LA31 == HEX_LITERAL:
2680 LA31_54 = self.input.LA(3)
2681
2682 if (self.synpred67()) :
2683 alt31 = 1
2684
2685
2686 elif LA31 == OCTAL_LITERAL:
2687 LA31_55 = self.input.LA(3)
2688
2689 if (self.synpred67()) :
2690 alt31 = 1
2691
2692
2693 elif LA31 == DECIMAL_LITERAL:
2694 LA31_56 = self.input.LA(3)
2695
2696 if (self.synpred67()) :
2697 alt31 = 1
2698
2699
2700 elif LA31 == CHARACTER_LITERAL:
2701 LA31_57 = self.input.LA(3)
2702
2703 if (self.synpred67()) :
2704 alt31 = 1
2705
2706
2707 elif LA31 == STRING_LITERAL:
2708 LA31_58 = self.input.LA(3)
2709
2710 if (self.synpred67()) :
2711 alt31 = 1
2712
2713
2714 elif LA31 == FLOATING_POINT_LITERAL:
2715 LA31_59 = self.input.LA(3)
2716
2717 if (self.synpred67()) :
2718 alt31 = 1
2719
2720
2721 elif LA31 == 72:
2722 LA31_60 = self.input.LA(3)
2723
2724 if (self.synpred67()) :
2725 alt31 = 1
2726
2727
2728 elif LA31 == 73:
2729 LA31_61 = self.input.LA(3)
2730
2731 if (self.synpred67()) :
2732 alt31 = 1
2733
2734
2735 elif LA31 == 66 or LA31 == 68 or LA31 == 69 or LA31 == 77 or LA31 == 78 or LA31 == 79:
2736 LA31_62 = self.input.LA(3)
2737
2738 if (self.synpred67()) :
2739 alt31 = 1
2740
2741
2742 elif LA31 == 74:
2743 LA31_63 = self.input.LA(3)
2744
2745 if (self.synpred67()) :
2746 alt31 = 1
2747
2748
2749
2750
2751
2752 if alt31 == 1:
2753 # C.g:0:0: declarator_suffix
2754 self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator821)
2755 self.declarator_suffix()
2756 self.following.pop()
2757 if self.failed:
2758 return
2759
2760
2761 else:
2762 break #loop31
2763
2764
2765
2766
2767 elif alt34 == 2:
2768 # C.g:304:4: '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+
2769 self.match(self.input, 62, self.FOLLOW_62_in_direct_declarator827)
2770 if self.failed:
2771 return
2772 # C.g:304:8: ( 'EFIAPI' )?
2773 alt32 = 2
2774 LA32_0 = self.input.LA(1)
2775
2776 if (LA32_0 == 58) :
2777 LA32_1 = self.input.LA(2)
2778
2779 if (self.synpred69()) :
2780 alt32 = 1
2781 if alt32 == 1:
2782 # C.g:304:9: 'EFIAPI'
2783 self.match(self.input, 58, self.FOLLOW_58_in_direct_declarator830)
2784 if self.failed:
2785 return
2786
2787
2788
2789 self.following.append(self.FOLLOW_declarator_in_direct_declarator834)
2790 self.declarator()
2791 self.following.pop()
2792 if self.failed:
2793 return
2794 self.match(self.input, 63, self.FOLLOW_63_in_direct_declarator836)
2795 if self.failed:
2796 return
2797 # C.g:304:35: ( declarator_suffix )+
2798 cnt33 = 0
2799 while True: #loop33
2800 alt33 = 2
2801 LA33_0 = self.input.LA(1)
2802
2803 if (LA33_0 == 62) :
2804 LA33 = self.input.LA(2)
2805 if LA33 == 63:
2806 LA33_30 = self.input.LA(3)
2807
2808 if (self.synpred70()) :
2809 alt33 = 1
2810
2811
2812 elif LA33 == 58:
2813 LA33_31 = self.input.LA(3)
2814
2815 if (self.synpred70()) :
2816 alt33 = 1
2817
2818
2819 elif LA33 == 66:
2820 LA33_32 = self.input.LA(3)
2821
2822 if (self.synpred70()) :
2823 alt33 = 1
2824
2825
2826 elif LA33 == 59:
2827 LA33_33 = self.input.LA(3)
2828
2829 if (self.synpred70()) :
2830 alt33 = 1
2831
2832
2833 elif LA33 == 60:
2834 LA33_34 = self.input.LA(3)
2835
2836 if (self.synpred70()) :
2837 alt33 = 1
2838
2839
2840 elif LA33 == IDENTIFIER:
2841 LA33_35 = self.input.LA(3)
2842
2843 if (self.synpred70()) :
2844 alt33 = 1
2845
2846
2847 elif LA33 == 29 or LA33 == 30 or LA33 == 31 or LA33 == 32 or LA33 == 33:
2848 LA33_37 = self.input.LA(3)
2849
2850 if (self.synpred70()) :
2851 alt33 = 1
2852
2853
2854 elif LA33 == 34:
2855 LA33_38 = self.input.LA(3)
2856
2857 if (self.synpred70()) :
2858 alt33 = 1
2859
2860
2861 elif LA33 == 35:
2862 LA33_39 = self.input.LA(3)
2863
2864 if (self.synpred70()) :
2865 alt33 = 1
2866
2867
2868 elif LA33 == 36:
2869 LA33_40 = self.input.LA(3)
2870
2871 if (self.synpred70()) :
2872 alt33 = 1
2873
2874
2875 elif LA33 == 37:
2876 LA33_41 = self.input.LA(3)
2877
2878 if (self.synpred70()) :
2879 alt33 = 1
2880
2881
2882 elif LA33 == 38:
2883 LA33_42 = self.input.LA(3)
2884
2885 if (self.synpred70()) :
2886 alt33 = 1
2887
2888
2889 elif LA33 == 39:
2890 LA33_43 = self.input.LA(3)
2891
2892 if (self.synpred70()) :
2893 alt33 = 1
2894
2895
2896 elif LA33 == 40:
2897 LA33_44 = self.input.LA(3)
2898
2899 if (self.synpred70()) :
2900 alt33 = 1
2901
2902
2903 elif LA33 == 41:
2904 LA33_45 = self.input.LA(3)
2905
2906 if (self.synpred70()) :
2907 alt33 = 1
2908
2909
2910 elif LA33 == 42:
2911 LA33_46 = self.input.LA(3)
2912
2913 if (self.synpred70()) :
2914 alt33 = 1
2915
2916
2917 elif LA33 == 45 or LA33 == 46:
2918 LA33_47 = self.input.LA(3)
2919
2920 if (self.synpred70()) :
2921 alt33 = 1
2922
2923
2924 elif LA33 == 48:
2925 LA33_48 = self.input.LA(3)
2926
2927 if (self.synpred70()) :
2928 alt33 = 1
2929
2930
2931 elif LA33 == 49 or LA33 == 50 or LA33 == 51 or LA33 == 52 or LA33 == 53 or LA33 == 54 or LA33 == 55 or LA33 == 56 or LA33 == 57 or LA33 == 61:
2932 LA33_49 = self.input.LA(3)
2933
2934 if (self.synpred70()) :
2935 alt33 = 1
2936
2937
2938
2939 elif (LA33_0 == 64) :
2940 LA33 = self.input.LA(2)
2941 if LA33 == 65:
2942 LA33_51 = self.input.LA(3)