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