1 # $ANTLR 3.0.1 C.g 2007-12-25 19:09:35
4 from antlr3.compat import set, frozenset
11 # for convenience in actions
12 HIDDEN = BaseRecognizer.HIDDEN
28 FLOATING_POINT_LITERAL=10
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'"
57 class function_definition_scope(object):
59 self.ModifierText = None
63 class CParser(Parser):
64 grammarFileName = "C.g"
65 tokenNames = tokenNames
67 def __init__(self, input):
68 Parser.__init__(self, input)
71 self.function_definition_stack = []
80 def printTokenInfo(self, line, offset, tokenText):
\r
81 print str(line)+ ',' + str(offset) + ':' + str(tokenText)
\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
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
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
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
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
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
110 # $ANTLR start translation_unit
111 # C.g:46:1: translation_unit : ( external_declaration )+ ;
112 def translation_unit(self, ):
114 translation_unit_StartIndex = self.input.index()
117 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 1):
120 # C.g:47:2: ( ( external_declaration )+ )
121 # C.g:47:4: ( external_declaration )+
122 # C.g:47:4: ( external_declaration )+
126 LA1_0 = self.input.LA(1)
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) :
133 # C.g:0:0: external_declaration
134 self.following.append(self.FOLLOW_external_declaration_in_translation_unit64)
135 self.external_declaration()
145 if self.backtracking > 0:
149 eee = EarlyExitException(1, self.input)
159 except RecognitionException, re:
161 self.recover(self.input, re)
163 if self.backtracking > 0:
164 self.memoize(self.input, 1, translation_unit_StartIndex)
170 # $ANTLR end translation_unit
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, ):
177 external_declaration_StartIndex = self.input.index()
180 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 2):
183 # C.g:63:2: ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? )
185 LA3_0 = self.input.LA(1)
187 if ((28 <= LA3_0 <= 31)) :
188 LA3_1 = self.input.LA(2)
190 if (self.synpred4()) :
192 elif (self.synpred5()) :
195 if self.backtracking > 0:
199 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 1, self.input)
204 LA3_2 = self.input.LA(2)
206 if (self.synpred4()) :
208 elif (self.synpred5()) :
211 if self.backtracking > 0:
215 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 2, self.input)
220 LA3_3 = self.input.LA(2)
222 if (self.synpred4()) :
224 elif (self.synpred5()) :
227 if self.backtracking > 0:
231 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 3, self.input)
236 LA3_4 = self.input.LA(2)
238 if (self.synpred4()) :
240 elif (self.synpred5()) :
243 if self.backtracking > 0:
247 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 4, self.input)
252 LA3_5 = self.input.LA(2)
254 if (self.synpred4()) :
256 elif (self.synpred5()) :
259 if self.backtracking > 0:
263 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 5, self.input)
268 LA3_6 = self.input.LA(2)
270 if (self.synpred4()) :
272 elif (self.synpred5()) :
275 if self.backtracking > 0:
279 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 6, self.input)
284 LA3_7 = self.input.LA(2)
286 if (self.synpred4()) :
288 elif (self.synpred5()) :
291 if self.backtracking > 0:
295 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 7, self.input)
300 LA3_8 = self.input.LA(2)
302 if (self.synpred4()) :
304 elif (self.synpred5()) :
307 if self.backtracking > 0:
311 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 8, self.input)
316 LA3_9 = self.input.LA(2)
318 if (self.synpred4()) :
320 elif (self.synpred5()) :
323 if self.backtracking > 0:
327 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 9, self.input)
332 LA3_10 = self.input.LA(2)
334 if (self.synpred4()) :
336 elif (self.synpred5()) :
339 if self.backtracking > 0:
343 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 10, self.input)
347 elif ((43 <= LA3_0 <= 44)) :
348 LA3_11 = self.input.LA(2)
350 if (self.synpred4()) :
352 elif (self.synpred5()) :
355 if self.backtracking > 0:
359 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 11, self.input)
364 LA3_12 = self.input.LA(2)
366 if (self.synpred4()) :
368 elif (self.synpred5()) :
371 if self.backtracking > 0:
375 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 12, self.input)
379 elif (LA3_0 == IDENTIFIER) :
380 LA3_13 = self.input.LA(2)
382 if (self.synpred4()) :
384 elif (self.synpred5()) :
389 if self.backtracking > 0:
393 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 13, self.input)
397 elif ((47 <= LA3_0 <= 50)) :
398 LA3_14 = self.input.LA(2)
400 if (self.synpred4()) :
402 elif (self.synpred5()) :
405 if self.backtracking > 0:
409 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 14, self.input)
413 elif (LA3_0 == 55) and (self.synpred4()):
415 elif (LA3_0 == 51) and (self.synpred4()):
420 if self.backtracking > 0:
424 nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 0, self.input)
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()
438 # C.g:64:4: declaration
439 self.following.append(self.FOLLOW_declaration_in_external_declaration108)
447 # C.g:65:4: macro_statement ( ';' )?
448 self.following.append(self.FOLLOW_macro_statement_in_external_declaration113)
449 self.macro_statement()
453 # C.g:65:20: ( ';' )?
455 LA2_0 = self.input.LA(1)
461 self.match(self.input, 24, self.FOLLOW_24_in_external_declaration116)
470 except RecognitionException, re:
472 self.recover(self.input, re)
474 if self.backtracking > 0:
475 self.memoize(self.input, 2, external_declaration_StartIndex)
481 # $ANTLR end external_declaration
483 class function_definition_return(object):
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
503 self.function_definition_stack[-1].ModifierText = ''
\r
504 self.function_definition_stack[-1].DeclText = ''
\r
508 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 3):
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 )?
515 LA4_0 = self.input.LA(1)
517 if ((28 <= LA4_0 <= 40) or (43 <= LA4_0 <= 44) or (46 <= LA4_0 <= 50)) :
519 elif (LA4_0 == IDENTIFIER) :
520 LA4 = self.input.LA(2)
522 LA4_18 = self.input.LA(3)
524 if (self.synpred7()) :
526 elif LA4 == 28 or LA4 == 29 or LA4 == 30 or LA4 == 31:
527 LA4_20 = self.input.LA(3)
529 if (self.synpred7()) :
532 LA4_21 = self.input.LA(3)
534 if (self.synpred7()) :
537 LA4_22 = self.input.LA(3)
539 if (self.synpred7()) :
542 LA4_23 = self.input.LA(3)
544 if (self.synpred7()) :
547 LA4_24 = self.input.LA(3)
549 if (self.synpred7()) :
552 LA4_25 = self.input.LA(3)
554 if (self.synpred7()) :
557 LA4_26 = self.input.LA(3)
559 if (self.synpred7()) :
562 LA4_27 = self.input.LA(3)
564 if (self.synpred7()) :
567 LA4_28 = self.input.LA(3)
569 if (self.synpred7()) :
572 LA4_29 = self.input.LA(3)
574 if (self.synpred7()) :
576 elif LA4 == 43 or LA4 == 44:
577 LA4_30 = self.input.LA(3)
579 if (self.synpred7()) :
582 LA4_31 = self.input.LA(3)
584 if (self.synpred7()) :
586 elif LA4 == IDENTIFIER:
587 LA4_32 = self.input.LA(3)
589 if (self.synpred7()) :
591 elif LA4 == 47 or LA4 == 48 or LA4 == 49 or LA4 == 50:
592 LA4_33 = self.input.LA(3)
594 if (self.synpred7()) :
599 # C.g:0:0: declaration_specifiers
600 self.following.append(self.FOLLOW_declaration_specifiers_in_function_definition145)
601 declaration_specifiers1 = self.declaration_specifiers()
608 self.following.append(self.FOLLOW_declarator_in_function_definition148)
609 declarator2 = self.declarator()
613 # C.g:83:3: ( ( declaration )+ compound_statement | compound_statement )
615 LA6_0 = self.input.LA(1)
617 if (LA6_0 == IDENTIFIER or LA6_0 == 25 or (28 <= LA6_0 <= 40) or (43 <= LA6_0 <= 44) or (46 <= LA6_0 <= 50)) :
622 if self.backtracking > 0:
626 nvae = NoViableAltException("83:3: ( ( declaration )+ compound_statement | compound_statement )", 6, 0, self.input)
631 # C.g:83:5: ( declaration )+ compound_statement
632 # C.g:83:5: ( declaration )+
636 LA5_0 = self.input.LA(1)
638 if (LA5_0 == IDENTIFIER or LA5_0 == 25 or (28 <= LA5_0 <= 40) or (43 <= LA5_0 <= 44) or (46 <= LA5_0 <= 50)) :
643 # C.g:0:0: declaration
644 self.following.append(self.FOLLOW_declaration_in_function_definition154)
655 if self.backtracking > 0:
659 eee = EarlyExitException(5, self.input)
665 self.following.append(self.FOLLOW_compound_statement_in_function_definition157)
666 self.compound_statement()
673 # C.g:84:5: compound_statement
674 self.following.append(self.FOLLOW_compound_statement_in_function_definition164)
675 self.compound_statement()
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)
689 retval.stop = self.input.LT(-1)
691 if self.backtracking == 0:
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
697 except RecognitionException, re:
699 self.recover(self.input, re)
701 if self.backtracking > 0:
702 self.memoize(self.input, 3, function_definition_StartIndex)
704 self.function_definition_stack.pop()
709 # $ANTLR end function_definition
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, ):
716 declaration_StartIndex = self.input.index()
731 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 4):
734 # C.g:90:2: (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' )
736 LA9_0 = self.input.LA(1)
740 elif (LA9_0 == IDENTIFIER or (28 <= LA9_0 <= 40) or (43 <= LA9_0 <= 44) or (46 <= LA9_0 <= 50)) :
743 if self.backtracking > 0:
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)
752 # C.g:90:4: a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';'
754 self.match(self.input, 25, self.FOLLOW_25_in_declaration187)
757 # C.g:90:17: (b= declaration_specifiers )?
759 LA7_0 = self.input.LA(1)
761 if ((28 <= LA7_0 <= 40) or (43 <= LA7_0 <= 44) or (46 <= LA7_0 <= 50)) :
763 elif (LA7_0 == IDENTIFIER) :
764 LA7_13 = self.input.LA(2)
766 if (LA7_13 == IDENTIFIER or (28 <= LA7_13 <= 40) or (43 <= LA7_13 <= 44) or (46 <= LA7_13 <= 50) or LA7_13 == 55) :
768 elif (LA7_13 == 51) :
769 LA7_19 = self.input.LA(3)
771 if (self.synpred10()) :
774 # C.g:0:0: b= declaration_specifiers
775 self.following.append(self.FOLLOW_declaration_specifiers_in_declaration191)
776 b = self.declaration_specifiers()
783 self.following.append(self.FOLLOW_init_declarator_list_in_declaration200)
784 c = self.init_declarator_list()
789 self.match(self.input, 24, self.FOLLOW_24_in_declaration204)
792 if self.backtracking == 0:
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
797 self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start,c.stop))
\r
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()
809 # C.g:98:30: (t= init_declarator_list )?
811 LA8_0 = self.input.LA(1)
813 if (LA8_0 == IDENTIFIER or LA8_0 == 51 or LA8_0 == 55) :
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()
826 self.match(self.input, 24, self.FOLLOW_24_in_declaration227)
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))
835 except RecognitionException, re:
837 self.recover(self.input, re)
839 if self.backtracking > 0:
840 self.memoize(self.input, 4, declaration_StartIndex)
846 # $ANTLR end declaration
848 class declaration_specifiers_return(object):
855 # $ANTLR start declaration_specifiers
856 # C.g:102:1: declaration_specifiers : ( storage_class_specifier | type_specifier | type_qualifier )+ ;
857 def declaration_specifiers(self, ):
859 retval = self.declaration_specifiers_return()
860 retval.start = self.input.LT(1)
861 declaration_specifiers_StartIndex = self.input.index()
864 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 5):
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 )+
873 LA10 = self.input.LA(1)
874 if LA10 == IDENTIFIER:
875 LA10_2 = self.input.LA(2)
877 if (self.synpred14()) :
881 elif LA10 == 28 or LA10 == 29 or LA10 == 30 or LA10 == 31:
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:
885 elif LA10 == 47 or LA10 == 48 or LA10 == 49 or LA10 == 50:
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()
898 # C.g:104:7: type_specifier
899 self.following.append(self.FOLLOW_type_specifier_in_declaration_specifiers256)
900 self.type_specifier()
907 # C.g:105:13: type_qualifier
908 self.following.append(self.FOLLOW_type_qualifier_in_declaration_specifiers270)
909 self.type_qualifier()
919 if self.backtracking > 0:
923 eee = EarlyExitException(10, self.input)
932 retval.stop = self.input.LT(-1)
935 except RecognitionException, re:
937 self.recover(self.input, re)
939 if self.backtracking > 0:
940 self.memoize(self.input, 5, declaration_specifiers_StartIndex)
946 # $ANTLR end declaration_specifiers
948 class init_declarator_list_return(object):
955 # $ANTLR start init_declarator_list
956 # C.g:109:1: init_declarator_list : init_declarator ( ',' init_declarator )* ;
957 def init_declarator_list(self, ):
959 retval = self.init_declarator_list_return()
960 retval.start = self.input.LT(1)
961 init_declarator_list_StartIndex = self.input.index()
964 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 6):
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()
974 # C.g:110:20: ( ',' init_declarator )*
977 LA11_0 = self.input.LA(1)
984 # C.g:110:21: ',' init_declarator
985 self.match(self.input, 26, self.FOLLOW_26_in_init_declarator_list295)
988 self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list297)
989 self.init_declarator()
1002 retval.stop = self.input.LT(-1)
1005 except RecognitionException, re:
1006 self.reportError(re)
1007 self.recover(self.input, re)
1009 if self.backtracking > 0:
1010 self.memoize(self.input, 6, init_declarator_list_StartIndex)
1016 # $ANTLR end init_declarator_list
1019 # $ANTLR start init_declarator
1020 # C.g:113:1: init_declarator : declarator ( '=' initializer )? ;
1021 def init_declarator(self, ):
1023 init_declarator_StartIndex = self.input.index()
1026 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 7):
1029 # C.g:114:2: ( declarator ( '=' initializer )? )
1030 # C.g:114:4: declarator ( '=' initializer )?
1031 self.following.append(self.FOLLOW_declarator_in_init_declarator310)
1033 self.following.pop()
1036 # C.g:114:15: ( '=' initializer )?
1038 LA12_0 = self.input.LA(1)
1043 # C.g:114:16: '=' initializer
1044 self.match(self.input, 27, self.FOLLOW_27_in_init_declarator313)
1047 self.following.append(self.FOLLOW_initializer_in_init_declarator315)
1049 self.following.pop()
1059 except RecognitionException, re:
1060 self.reportError(re)
1061 self.recover(self.input, re)
1063 if self.backtracking > 0:
1064 self.memoize(self.input, 7, init_declarator_StartIndex)
1070 # $ANTLR end init_declarator
1073 # $ANTLR start storage_class_specifier
1074 # C.g:117:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' | 'register' );
1075 def storage_class_specifier(self, ):
1077 storage_class_specifier_StartIndex = self.input.index()
1080 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 8):
1083 # C.g:118:2: ( 'extern' | 'static' | 'auto' | 'register' )
1085 if (28 <= self.input.LA(1) <= 31):
1086 self.input.consume();
1087 self.errorRecovery = False
1091 if self.backtracking > 0:
1095 mse = MismatchedSetException(None, self.input)
1096 self.recoverFromMismatchedSet(
1097 self.input, mse, self.FOLLOW_set_in_storage_class_specifier0
1106 except RecognitionException, re:
1107 self.reportError(re)
1108 self.recover(self.input, re)
1110 if self.backtracking > 0:
1111 self.memoize(self.input, 8, storage_class_specifier_StartIndex)
1117 # $ANTLR end storage_class_specifier
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, ):
1124 type_specifier_StartIndex = self.input.index()
1132 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 9):
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 )
1137 LA13_0 = self.input.LA(1)
1141 elif (LA13_0 == 33) :
1143 elif (LA13_0 == 34) :
1145 elif (LA13_0 == 35) :
1147 elif (LA13_0 == 36) :
1149 elif (LA13_0 == 37) :
1151 elif (LA13_0 == 38) :
1153 elif (LA13_0 == 39) :
1155 elif (LA13_0 == 40) :
1157 elif ((43 <= LA13_0 <= 44)) :
1159 elif (LA13_0 == 46) :
1161 elif (LA13_0 == IDENTIFIER) and (self.synpred32()):
1164 if self.backtracking > 0:
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)
1174 self.match(self.input, 32, self.FOLLOW_32_in_type_specifier355)
1181 self.match(self.input, 33, self.FOLLOW_33_in_type_specifier360)
1187 # C.g:127:4: 'short'
1188 self.match(self.input, 34, self.FOLLOW_34_in_type_specifier365)
1195 self.match(self.input, 35, self.FOLLOW_35_in_type_specifier370)
1202 self.match(self.input, 36, self.FOLLOW_36_in_type_specifier375)
1208 # C.g:130:4: 'float'
1209 self.match(self.input, 37, self.FOLLOW_37_in_type_specifier380)
1215 # C.g:131:4: 'double'
1216 self.match(self.input, 38, self.FOLLOW_38_in_type_specifier385)
1222 # C.g:132:4: 'signed'
1223 self.match(self.input, 39, self.FOLLOW_39_in_type_specifier390)
1229 # C.g:133:4: 'unsigned'
1230 self.match(self.input, 40, self.FOLLOW_40_in_type_specifier395)
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()
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))
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()
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))
1260 # C.g:136:4: ( IDENTIFIER declarator )=> type_id
1261 self.following.append(self.FOLLOW_type_id_in_type_specifier425)
1263 self.following.pop()
1269 except RecognitionException, re:
1270 self.reportError(re)
1271 self.recover(self.input, re)
1273 if self.backtracking > 0:
1274 self.memoize(self.input, 9, type_specifier_StartIndex)
1280 # $ANTLR end type_specifier
1283 # $ANTLR start type_id
1284 # C.g:139:1: type_id : IDENTIFIER ;
1285 def type_id(self, ):
1287 type_id_StartIndex = self.input.index()
1290 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 10):
1293 # C.g:140:5: ( IDENTIFIER )
1294 # C.g:140:9: IDENTIFIER
1295 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_type_id441)
1302 except RecognitionException, re:
1303 self.reportError(re)
1304 self.recover(self.input, re)
1306 if self.backtracking > 0:
1307 self.memoize(self.input, 10, type_id_StartIndex)
1313 # $ANTLR end type_id
1315 class struct_or_union_specifier_return(object):
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, ):
1326 retval = self.struct_or_union_specifier_return()
1327 retval.start = self.input.LT(1)
1328 struct_or_union_specifier_StartIndex = self.input.index()
1331 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 11):
1334 # C.g:146:2: ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER )
1336 LA15_0 = self.input.LA(1)
1338 if ((43 <= LA15_0 <= 44)) :
1339 LA15_1 = self.input.LA(2)
1341 if (LA15_1 == IDENTIFIER) :
1342 LA15_2 = self.input.LA(3)
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) :
1349 if self.backtracking > 0:
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)
1357 elif (LA15_1 == 41) :
1360 if self.backtracking > 0:
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)
1369 if self.backtracking > 0:
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)
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()
1384 # C.g:146:20: ( IDENTIFIER )?
1386 LA14_0 = self.input.LA(1)
1388 if (LA14_0 == IDENTIFIER) :
1391 # C.g:0:0: IDENTIFIER
1392 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier471)
1398 self.match(self.input, 41, self.FOLLOW_41_in_struct_or_union_specifier474)
1401 self.following.append(self.FOLLOW_struct_declaration_list_in_struct_or_union_specifier476)
1402 self.struct_declaration_list()
1403 self.following.pop()
1406 self.match(self.input, 42, self.FOLLOW_42_in_struct_or_union_specifier478)
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()
1418 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier485)
1423 retval.stop = self.input.LT(-1)
1426 except RecognitionException, re:
1427 self.reportError(re)
1428 self.recover(self.input, re)
1430 if self.backtracking > 0:
1431 self.memoize(self.input, 11, struct_or_union_specifier_StartIndex)
1437 # $ANTLR end struct_or_union_specifier
1440 # $ANTLR start struct_or_union
1441 # C.g:150:1: struct_or_union : ( 'struct' | 'union' );
1442 def struct_or_union(self, ):
1444 struct_or_union_StartIndex = self.input.index()
1447 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 12):
1450 # C.g:151:2: ( 'struct' | 'union' )
1452 if (43 <= self.input.LA(1) <= 44):
1453 self.input.consume();
1454 self.errorRecovery = False
1458 if self.backtracking > 0:
1462 mse = MismatchedSetException(None, self.input)
1463 self.recoverFromMismatchedSet(
1464 self.input, mse, self.FOLLOW_set_in_struct_or_union0
1473 except RecognitionException, re:
1474 self.reportError(re)
1475 self.recover(self.input, re)
1477 if self.backtracking > 0:
1478 self.memoize(self.input, 12, struct_or_union_StartIndex)
1484 # $ANTLR end struct_or_union
1487 # $ANTLR start struct_declaration_list
1488 # C.g:155:1: struct_declaration_list : ( struct_declaration )+ ;
1489 def struct_declaration_list(self, ):
1491 struct_declaration_list_StartIndex = self.input.index()
1494 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 13):
1497 # C.g:156:2: ( ( struct_declaration )+ )
1498 # C.g:156:4: ( struct_declaration )+
1499 # C.g:156:4: ( struct_declaration )+
1503 LA16_0 = self.input.LA(1)
1505 if (LA16_0 == IDENTIFIER or (32 <= LA16_0 <= 40) or (43 <= LA16_0 <= 44) or (46 <= LA16_0 <= 50)) :
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()
1522 if self.backtracking > 0:
1526 eee = EarlyExitException(16, self.input)
1536 except RecognitionException, re:
1537 self.reportError(re)
1538 self.recover(self.input, re)
1540 if self.backtracking > 0:
1541 self.memoize(self.input, 13, struct_declaration_list_StartIndex)
1547 # $ANTLR end struct_declaration_list
1550 # $ANTLR start struct_declaration
1551 # C.g:159:1: struct_declaration : specifier_qualifier_list struct_declarator_list ';' ;
1552 def struct_declaration(self, ):
1554 struct_declaration_StartIndex = self.input.index()
1557 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 14):
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()
1567 self.following.append(self.FOLLOW_struct_declarator_list_in_struct_declaration526)
1568 self.struct_declarator_list()
1569 self.following.pop()
1572 self.match(self.input, 24, self.FOLLOW_24_in_struct_declaration528)
1579 except RecognitionException, re:
1580 self.reportError(re)
1581 self.recover(self.input, re)
1583 if self.backtracking > 0:
1584 self.memoize(self.input, 14, struct_declaration_StartIndex)
1590 # $ANTLR end struct_declaration
1593 # $ANTLR start specifier_qualifier_list
1594 # C.g:163:1: specifier_qualifier_list : ( type_qualifier | type_specifier )+ ;
1595 def specifier_qualifier_list(self, ):
1597 specifier_qualifier_list_StartIndex = self.input.index()
1600 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 15):
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 )+
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:
1615 LA17_22 = self.input.LA(3)
1617 if (self.synpred38()) :
1622 LA17_23 = self.input.LA(3)
1624 if (self.synpred38()) :
1629 LA17_24 = self.input.LA(3)
1631 if (self.synpred38()) :
1636 elif LA17 == 47 or LA17 == 48 or LA17 == 49 or LA17 == 50:
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:
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()
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()
1663 if self.backtracking > 0:
1667 eee = EarlyExitException(17, self.input)
1677 except RecognitionException, re:
1678 self.reportError(re)
1679 self.recover(self.input, re)
1681 if self.backtracking > 0:
1682 self.memoize(self.input, 15, specifier_qualifier_list_StartIndex)
1688 # $ANTLR end specifier_qualifier_list
1691 # $ANTLR start struct_declarator_list
1692 # C.g:167:1: struct_declarator_list : struct_declarator ( ',' struct_declarator )* ;
1693 def struct_declarator_list(self, ):
1695 struct_declarator_list_StartIndex = self.input.index()
1698 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 16):
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()
1708 # C.g:168:22: ( ',' struct_declarator )*
1711 LA18_0 = self.input.LA(1)
1718 # C.g:168:23: ',' struct_declarator
1719 self.match(self.input, 26, self.FOLLOW_26_in_struct_declarator_list562)
1722 self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list564)
1723 self.struct_declarator()
1724 self.following.pop()
1737 except RecognitionException, re:
1738 self.reportError(re)
1739 self.recover(self.input, re)
1741 if self.backtracking > 0:
1742 self.memoize(self.input, 16, struct_declarator_list_StartIndex)
1748 # $ANTLR end struct_declarator_list
1751 # $ANTLR start struct_declarator
1752 # C.g:171:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );
1753 def struct_declarator(self, ):
1755 struct_declarator_StartIndex = self.input.index()
1758 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 17):
1761 # C.g:172:2: ( declarator ( ':' constant_expression )? | ':' constant_expression )
1763 LA20_0 = self.input.LA(1)
1765 if (LA20_0 == IDENTIFIER or LA20_0 == 51 or LA20_0 == 55) :
1767 elif (LA20_0 == 45) :
1770 if self.backtracking > 0:
1774 nvae = NoViableAltException("171:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );", 20, 0, self.input)
1779 # C.g:172:4: declarator ( ':' constant_expression )?
1780 self.following.append(self.FOLLOW_declarator_in_struct_declarator577)
1782 self.following.pop()
1785 # C.g:172:15: ( ':' constant_expression )?
1787 LA19_0 = self.input.LA(1)
1792 # C.g:172:16: ':' constant_expression
1793 self.match(self.input, 45, self.FOLLOW_45_in_struct_declarator580)
1796 self.following.append(self.FOLLOW_constant_expression_in_struct_declarator582)
1797 self.constant_expression()
1798 self.following.pop()
1807 # C.g:173:4: ':' constant_expression
1808 self.match(self.input, 45, self.FOLLOW_45_in_struct_declarator589)
1811 self.following.append(self.FOLLOW_constant_expression_in_struct_declarator591)
1812 self.constant_expression()
1813 self.following.pop()
1819 except RecognitionException, re:
1820 self.reportError(re)
1821 self.recover(self.input, re)
1823 if self.backtracking > 0:
1824 self.memoize(self.input, 17, struct_declarator_StartIndex)
1830 # $ANTLR end struct_declarator
1832 class enum_specifier_return(object):
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, ):
1843 retval = self.enum_specifier_return()
1844 retval.start = self.input.LT(1)
1845 enum_specifier_StartIndex = self.input.index()
1848 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 18):
1851 # C.g:178:2: ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER )
1853 LA21_0 = self.input.LA(1)
1856 LA21_1 = self.input.LA(2)
1858 if (LA21_1 == IDENTIFIER) :
1859 LA21_2 = self.input.LA(3)
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) :
1866 if self.backtracking > 0:
1870 nvae = NoViableAltException("176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 21, 2, self.input)
1874 elif (LA21_1 == 41) :
1877 if self.backtracking > 0:
1881 nvae = NoViableAltException("176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 21, 1, self.input)
1886 if self.backtracking > 0:
1890 nvae = NoViableAltException("176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 21, 0, self.input)
1895 # C.g:178:4: 'enum' '{' enumerator_list '}'
1896 self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier609)
1899 self.match(self.input, 41, self.FOLLOW_41_in_enum_specifier611)
1902 self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier613)
1903 self.enumerator_list()
1904 self.following.pop()
1907 self.match(self.input, 42, self.FOLLOW_42_in_enum_specifier615)
1913 # C.g:179:4: 'enum' IDENTIFIER '{' enumerator_list '}'
1914 self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier620)
1917 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier622)
1920 self.match(self.input, 41, self.FOLLOW_41_in_enum_specifier624)
1923 self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier626)
1924 self.enumerator_list()
1925 self.following.pop()
1928 self.match(self.input, 42, self.FOLLOW_42_in_enum_specifier628)
1934 # C.g:180:4: 'enum' IDENTIFIER
1935 self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier633)
1938 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier635)
1943 retval.stop = self.input.LT(-1)
1946 except RecognitionException, re:
1947 self.reportError(re)
1948 self.recover(self.input, re)
1950 if self.backtracking > 0:
1951 self.memoize(self.input, 18, enum_specifier_StartIndex)
1957 # $ANTLR end enum_specifier
1960 # $ANTLR start enumerator_list
1961 # C.g:183:1: enumerator_list : enumerator ( ',' enumerator )* ;
1962 def enumerator_list(self, ):
1964 enumerator_list_StartIndex = self.input.index()
1967 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 19):
1970 # C.g:184:2: ( enumerator ( ',' enumerator )* )
1971 # C.g:184:4: enumerator ( ',' enumerator )*
1972 self.following.append(self.FOLLOW_enumerator_in_enumerator_list646)
1974 self.following.pop()
1977 # C.g:184:15: ( ',' enumerator )*
1980 LA22_0 = self.input.LA(1)
1987 # C.g:184:16: ',' enumerator
1988 self.match(self.input, 26, self.FOLLOW_26_in_enumerator_list649)
1991 self.following.append(self.FOLLOW_enumerator_in_enumerator_list651)
1993 self.following.pop()
2006 except RecognitionException, re:
2007 self.reportError(re)
2008 self.recover(self.input, re)
2010 if self.backtracking > 0:
2011 self.memoize(self.input, 19, enumerator_list_StartIndex)
2017 # $ANTLR end enumerator_list
2020 # $ANTLR start enumerator
2021 # C.g:187:1: enumerator : IDENTIFIER ( '=' constant_expression )? ;
2022 def enumerator(self, ):
2024 enumerator_StartIndex = self.input.index()
2027 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 20):
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)
2035 # C.g:188:15: ( '=' constant_expression )?
2037 LA23_0 = self.input.LA(1)
2042 # C.g:188:16: '=' constant_expression
2043 self.match(self.input, 27, self.FOLLOW_27_in_enumerator667)
2046 self.following.append(self.FOLLOW_constant_expression_in_enumerator669)
2047 self.constant_expression()
2048 self.following.pop()
2058 except RecognitionException, re:
2059 self.reportError(re)
2060 self.recover(self.input, re)
2062 if self.backtracking > 0:
2063 self.memoize(self.input, 20, enumerator_StartIndex)
2069 # $ANTLR end enumerator
2072 # $ANTLR start type_qualifier
2073 # C.g:191:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' );
2074 def type_qualifier(self, ):
2076 type_qualifier_StartIndex = self.input.index()
2079 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 21):
2082 # C.g:192:2: ( 'const' | 'volatile' | 'IN' | 'OUT' )
2084 if (47 <= self.input.LA(1) <= 50):
2085 self.input.consume();
2086 self.errorRecovery = False
2090 if self.backtracking > 0:
2094 mse = MismatchedSetException(None, self.input)
2095 self.recoverFromMismatchedSet(
2096 self.input, mse, self.FOLLOW_set_in_type_qualifier0
2105 except RecognitionException, re:
2106 self.reportError(re)
2107 self.recover(self.input, re)
2109 if self.backtracking > 0:
2110 self.memoize(self.input, 21, type_qualifier_StartIndex)
2116 # $ANTLR end type_qualifier
2118 class declarator_return(object):
2125 # $ANTLR start declarator
2126 # C.g:198:1: declarator : ( ( pointer )? direct_declarator | pointer );
2127 def declarator(self, ):
2129 retval = self.declarator_return()
2130 retval.start = self.input.LT(1)
2131 declarator_StartIndex = self.input.index()
2134 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 22):
2137 # C.g:199:2: ( ( pointer )? direct_declarator | pointer )
2139 LA25_0 = self.input.LA(1)
2142 LA25_1 = self.input.LA(2)
2144 if (self.synpred50()) :
2149 if self.backtracking > 0:
2153 nvae = NoViableAltException("198:1: declarator : ( ( pointer )? direct_declarator | pointer );", 25, 1, self.input)
2157 elif (LA25_0 == IDENTIFIER or LA25_0 == 51) :
2160 if self.backtracking > 0:
2164 nvae = NoViableAltException("198:1: declarator : ( ( pointer )? direct_declarator | pointer );", 25, 0, self.input)
2169 # C.g:199:4: ( pointer )? direct_declarator
2170 # C.g:199:4: ( pointer )?
2172 LA24_0 = self.input.LA(1)
2178 self.following.append(self.FOLLOW_pointer_in_declarator708)
2180 self.following.pop()
2186 self.following.append(self.FOLLOW_direct_declarator_in_declarator711)
2187 self.direct_declarator()
2188 self.following.pop()
2194 # C.g:200:4: pointer
2195 self.following.append(self.FOLLOW_pointer_in_declarator716)
2197 self.following.pop()
2202 retval.stop = self.input.LT(-1)
2205 except RecognitionException, re:
2206 self.reportError(re)
2207 self.recover(self.input, re)
2209 if self.backtracking > 0:
2210 self.memoize(self.input, 22, declarator_StartIndex)
2216 # $ANTLR end declarator
2219 # $ANTLR start direct_declarator
2220 # C.g:203:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ );
2221 def direct_declarator(self, ):
2223 direct_declarator_StartIndex = self.input.index()
2226 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 23):
2229 # C.g:204:2: ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ )
2231 LA28_0 = self.input.LA(1)
2233 if (LA28_0 == IDENTIFIER) :
2235 elif (LA28_0 == 51) :
2238 if self.backtracking > 0:
2242 nvae = NoViableAltException("203:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ );", 28, 0, self.input)
2247 # C.g:204:4: IDENTIFIER ( declarator_suffix )*
2248 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_direct_declarator727)
2251 # C.g:204:15: ( declarator_suffix )*
2254 LA26_0 = self.input.LA(1)
2257 LA26 = self.input.LA(2)
2259 LA26_26 = self.input.LA(3)
2261 if (self.synpred51()) :
2265 elif LA26 == 28 or LA26 == 29 or LA26 == 30 or LA26 == 31:
2266 LA26_30 = self.input.LA(3)
2268 if (self.synpred51()) :
2273 LA26_31 = self.input.LA(3)
2275 if (self.synpred51()) :
2280 LA26_32 = self.input.LA(3)
2282 if (self.synpred51()) :
2287 LA26_33 = self.input.LA(3)
2289 if (self.synpred51()) :
2294 LA26_34 = self.input.LA(3)
2296 if (self.synpred51()) :
2301 LA26_35 = self.input.LA(3)
2303 if (self.synpred51()) :
2308 LA26_36 = self.input.LA(3)
2310 if (self.synpred51()) :
2315 LA26_37 = self.input.LA(3)
2317 if (self.synpred51()) :
2322 LA26_38 = self.input.LA(3)
2324 if (self.synpred51()) :
2329 LA26_39 = self.input.LA(3)
2331 if (self.synpred51()) :
2335 elif LA26 == 43 or LA26 == 44:
2336 LA26_40 = self.input.LA(3)
2338 if (self.synpred51()) :
2343 LA26_41 = self.input.LA(3)
2345 if (self.synpred51()) :
2349 elif LA26 == IDENTIFIER:
2350 LA26_42 = self.input.LA(3)
2352 if (self.synpred51()) :
2356 elif LA26 == 47 or LA26 == 48 or LA26 == 49 or LA26 == 50:
2357 LA26_43 = self.input.LA(3)
2359 if (self.synpred51()) :
2364 elif (LA26_0 == 53) :
2365 LA26 = self.input.LA(2)
2367 LA26_44 = self.input.LA(3)
2369 if (self.synpred51()) :
2374 LA26_45 = self.input.LA(3)
2376 if (self.synpred51()) :
2380 elif LA26 == IDENTIFIER:
2381 LA26_46 = self.input.LA(3)
2383 if (self.synpred51()) :
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)
2390 if (self.synpred51()) :
2395 LA26_48 = self.input.LA(3)
2397 if (self.synpred51()) :
2402 LA26_49 = self.input.LA(3)
2404 if (self.synpred51()) :
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)
2411 if (self.synpred51()) :
2416 LA26_51 = self.input.LA(3)
2418 if (self.synpred51()) :
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()
2441 # C.g:205:4: '(' declarator ')' ( declarator_suffix )+
2442 self.match(self.input, 51, self.FOLLOW_51_in_direct_declarator735)
2445 self.following.append(self.FOLLOW_declarator_in_direct_declarator737)
2447 self.following.pop()
2450 self.match(self.input, 52, self.FOLLOW_52_in_direct_declarator739)
2453 # C.g:205:23: ( declarator_suffix )+
2457 LA27_0 = self.input.LA(1)
2460 LA27 = self.input.LA(2)
2462 LA27_26 = self.input.LA(3)
2464 if (self.synpred53()) :
2468 elif LA27 == 28 or LA27 == 29 or LA27 == 30 or LA27 == 31:
2469 LA27_30 = self.input.LA(3)
2471 if (self.synpred53()) :
2476 LA27_31 = self.input.LA(3)
2478 if (self.synpred53()) :
2483 LA27_32 = self.input.LA(3)
2485 if (self.synpred53()) :
2490 LA27_33 = self.input.LA(3)
2492 if (self.synpred53()) :
2497 LA27_34 = self.input.LA(3)
2499 if (self.synpred53()) :
2504 LA27_35 = self.input.LA(3)
2506 if (self.synpred53()) :
2511 LA27_36 = self.input.LA(3)
2513 if (self.synpred53()) :
2518 LA27_37 = self.input.LA(3)
2520 if (self.synpred53()) :
2525 LA27_38 = self.input.LA(3)
2527 if (self.synpred53()) :
2532 LA27_39 = self.input.LA(3)
2534 if (self.synpred53()) :
2538 elif LA27 == 43 or LA27 == 44:
2539 LA27_40 = self.input.LA(3)
2541 if (self.synpred53()) :
2546 LA27_41 = self.input.LA(3)
2548 if (self.synpred53()) :
2552 elif LA27 == IDENTIFIER:
2553 LA27_42 = self.input.LA(3)
2555 if (self.synpred53()) :
2559 elif LA27 == 47 or LA27 == 48 or LA27 == 49 or LA27 == 50:
2560 LA27_43 = self.input.LA(3)
2562 if (self.synpred53()) :
2567 elif (LA27_0 == 53) :
2568 LA27 = self.input.LA(2)
2570 LA27_44 = self.input.LA(3)
2572 if (self.synpred53()) :
2577 LA27_45 = self.input.LA(3)
2579 if (self.synpred53()) :
2583 elif LA27 == IDENTIFIER:
2584 LA27_46 = self.input.LA(3)
2586 if (self.synpred53()) :
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)
2593 if (self.synpred53()) :
2598 LA27_48 = self.input.LA(3)
2600 if (self.synpred53()) :
2605 LA27_49 = self.input.LA(3)
2607 if (self.synpred53()) :
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)
2614 if (self.synpred53()) :
2619 LA27_51 = self.input.LA(3)
2621 if (self.synpred53()) :
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()
2641 if self.backtracking > 0:
2645 eee = EarlyExitException(27, self.input)
2654 except RecognitionException, re:
2655 self.reportError(re)
2656 self.recover(self.input, re)
2658 if self.backtracking > 0:
2659 self.memoize(self.input, 23, direct_declarator_StartIndex)
2665 # $ANTLR end direct_declarator
2668 # $ANTLR start declarator_suffix
2669 # C.g:208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );
2670 def declarator_suffix(self, ):
2672 declarator_suffix_StartIndex = self.input.index()
2675 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 24):
2678 # C.g:209:2: ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' )
2680 LA29_0 = self.input.LA(1)
2683 LA29_1 = self.input.LA(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)) :
2690 if self.backtracking > 0:
2694 nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 1, self.input)
2698 elif (LA29_0 == 51) :
2699 LA29 = self.input.LA(2)
2702 elif LA29 == IDENTIFIER:
2703 LA29_12 = self.input.LA(3)
2705 if (self.synpred56()) :
2707 elif (self.synpred57()) :
2710 if self.backtracking > 0:
2714 nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 12, self.input)
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:
2721 if self.backtracking > 0:
2725 nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 2, self.input)
2730 if self.backtracking > 0:
2734 nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 0, self.input)
2739 # C.g:209:6: '[' constant_expression ']'
2740 self.match(self.input, 53, self.FOLLOW_53_in_declarator_suffix755)
2743 self.following.append(self.FOLLOW_constant_expression_in_declarator_suffix757)
2744 self.constant_expression()
2745 self.following.pop()
2748 self.match(self.input, 54, self.FOLLOW_54_in_declarator_suffix759)
2754 # C.g:210:9: '[' ']'
2755 self.match(self.input, 53, self.FOLLOW_53_in_declarator_suffix769)
2758 self.match(self.input, 54, self.FOLLOW_54_in_declarator_suffix771)
2764 # C.g:211:9: '(' parameter_type_list ')'
2765 self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix781)
2768 self.following.append(self.FOLLOW_parameter_type_list_in_declarator_suffix783)
2769 self.parameter_type_list()
2770 self.following.pop()
2773 self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix785)
2779 # C.g:212:9: '(' identifier_list ')'
2780 self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix795)
2783 self.following.append(self.FOLLOW_identifier_list_in_declarator_suffix797)
2784 self.identifier_list()
2785 self.following.pop()
2788 self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix799)
2794 # C.g:213:9: '(' ')'
2795 self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix809)
2798 self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix811)
2804 except RecognitionException, re:
2805 self.reportError(re)
2806 self.recover(self.input, re)
2808 if self.backtracking > 0:
2809 self.memoize(self.input, 24, declarator_suffix_StartIndex)
2815 # $ANTLR end declarator_suffix
2818 # $ANTLR start pointer
2819 # C.g:216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );
2820 def pointer(self, ):
2822 pointer_StartIndex = self.input.index()
2827 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 25):
2830 # C.g:217:2: ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' )
2832 LA32_0 = self.input.LA(1)
2835 LA32 = self.input.LA(2)
2837 LA32_2 = self.input.LA(3)
2839 if (self.synpred61()) :
2844 if self.backtracking > 0:
2848 nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 2, self.input)
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:
2854 elif LA32 == 47 or LA32 == 48 or LA32 == 49 or LA32 == 50:
2855 LA32_18 = self.input.LA(3)
2857 if (self.synpred60()) :
2862 if self.backtracking > 0:
2866 nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 18, self.input)
2871 if self.backtracking > 0:
2875 nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 1, self.input)
2880 if self.backtracking > 0:
2884 nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 0, self.input)
2889 # C.g:217:4: '*' ( type_qualifier )+ ( pointer )?
2890 self.match(self.input, 55, self.FOLLOW_55_in_pointer822)
2893 # C.g:217:8: ( type_qualifier )+
2897 LA30_0 = self.input.LA(1)
2899 if ((47 <= LA30_0 <= 50)) :
2900 LA30_17 = self.input.LA(2)
2902 if (self.synpred58()) :
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()
2921 if self.backtracking > 0:
2925 eee = EarlyExitException(30, self.input)
2931 # C.g:217:24: ( pointer )?
2933 LA31_0 = self.input.LA(1)
2936 LA31_1 = self.input.LA(2)
2938 if (self.synpred59()) :
2942 self.following.append(self.FOLLOW_pointer_in_pointer827)
2944 self.following.pop()
2953 # C.g:218:4: '*' pointer
2954 self.match(self.input, 55, self.FOLLOW_55_in_pointer833)
2957 self.following.append(self.FOLLOW_pointer_in_pointer835)
2959 self.following.pop()
2966 s = self.input.LT(1)
2967 self.match(self.input, 55, self.FOLLOW_55_in_pointer842)
2973 except RecognitionException, re:
2974 self.reportError(re)
2975 self.recover(self.input, re)
2977 if self.backtracking > 0:
2978 self.memoize(self.input, 25, pointer_StartIndex)
2984 # $ANTLR end pointer
2987 # $ANTLR start parameter_type_list
2988 # C.g:222:1: parameter_type_list : parameter_list ( ',' '...' )? ;
2989 def parameter_type_list(self, ):
2991 parameter_type_list_StartIndex = self.input.index()
2994 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 26):
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()
3004 # C.g:223:19: ( ',' '...' )?
3006 LA33_0 = self.input.LA(1)
3011 # C.g:223:20: ',' '...'
3012 self.match(self.input, 26, self.FOLLOW_26_in_parameter_type_list856)
3015 self.match(self.input, 56, self.FOLLOW_56_in_parameter_type_list858)
3025 except RecognitionException, re:
3026 self.reportError(re)
3027 self.recover(self.input, re)
3029 if self.backtracking > 0:
3030 self.memoize(self.input, 26, parameter_type_list_StartIndex)
3036 # $ANTLR end parameter_type_list
3039 # $ANTLR start parameter_list
3040 # C.g:226:1: parameter_list : parameter_declaration ( ',' parameter_declaration )* ;
3041 def parameter_list(self, ):
3043 parameter_list_StartIndex = self.input.index()
3046 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 27):
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()
3056 # C.g:227:26: ( ',' parameter_declaration )*
3059 LA34_0 = self.input.LA(1)
3062 LA34_1 = self.input.LA(2)
3064 if (LA34_1 == IDENTIFIER or (28 <= LA34_1 <= 40) or (43 <= LA34_1 <= 44) or (46 <= LA34_1 <= 50)) :
3071 # C.g:227:27: ',' parameter_declaration
3072 self.match(self.input, 26, self.FOLLOW_26_in_parameter_list874)
3075 self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list876)
3076 self.parameter_declaration()
3077 self.following.pop()
3090 except RecognitionException, re:
3091 self.reportError(re)
3092 self.recover(self.input, re)
3094 if self.backtracking > 0:
3095 self.memoize(self.input, 27, parameter_list_StartIndex)
3101 # $ANTLR end parameter_list
3104 # $ANTLR start parameter_declaration
3105 # C.g:230:1: parameter_declaration : declaration_specifiers ( declarator | abstract_declarator )+ ;
3106 def parameter_declaration(self, ):
3108 parameter_declaration_StartIndex = self.input.index()
3111 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 28):
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()
3121 # C.g:231:27: ( declarator | abstract_declarator )+
3125 LA35 = self.input.LA(1)
3127 LA35_4 = self.input.LA(2)
3129 if (self.synpred64()) :
3131 elif (self.synpred65()) :
3135 elif LA35 == IDENTIFIER:
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:
3142 LA35_17 = self.input.LA(3)
3144 if (self.synpred64()) :
3146 elif (self.synpred65()) :
3151 LA35_18 = self.input.LA(3)
3153 if (self.synpred64()) :
3155 elif (self.synpred65()) :
3159 elif LA35 == IDENTIFIER:
3160 LA35_32 = self.input.LA(3)
3162 if (self.synpred64()) :
3164 elif (self.synpred65()) :
3173 # C.g:231:28: declarator
3174 self.following.append(self.FOLLOW_declarator_in_parameter_declaration892)
3176 self.following.pop()
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()
3194 if self.backtracking > 0:
3198 eee = EarlyExitException(35, self.input)
3208 except RecognitionException, re:
3209 self.reportError(re)
3210 self.recover(self.input, re)
3212 if self.backtracking > 0:
3213 self.memoize(self.input, 28, parameter_declaration_StartIndex)
3219 # $ANTLR end parameter_declaration
3222 # $ANTLR start identifier_list
3223 # C.g:234:1: identifier_list : IDENTIFIER ( ',' IDENTIFIER )* ;
3224 def identifier_list(self, ):
3226 identifier_list_StartIndex = self.input.index()
3229 if self.backtracking > 0 and self.alreadyParsedRule(self.input, 29):
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)
3237 # C.g:236:2: ( ',' IDENTIFIER )*
3240 LA36_0 = self.input.LA(1)
3247 # C.g:236:3: ',' IDENTIFIER
3248 self.match(self.input, 26, self.FOLLOW_26_in_identifier_list911)
3251 self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list913)
3264 except RecognitionException, re:
3265 self.reportError(re)
3266 self.recover(self.input, re)
3268 if self.backtracking > 0:
3269 self.memoize(self.input, 29, identifier_list_StartIndex)
3275 # $ANTLR end identifier_list
3278 # $ANTLR start type_name
3279 # C.g:239:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );
3280 def type_name(self, ):