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