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