-# $ANTLR 3.0.1 C.g 2007-12-12 15:55:52
+# $ANTLR 3.0.1 C.g 2007-12-25 19:09:35
from antlr3 import *
from antlr3.compat import set, frozenset
+ \r
+import CodeFragment\r
+import FileProfile\r
+
# for convenience in actions
"STRING_LITERAL", "FLOATING_POINT_LITERAL", "LETTER", "EscapeSequence",
"HexDigit", "IntegerTypeSuffix", "Exponent", "FloatTypeSuffix", "OctalEscape",
"UnicodeEscape", "WS", "UnicodeVocabulary", "COMMENT", "LINE_COMMENT",
- "LINE_COMMAND", "'typedef'", "';'", "','", "'='", "'extern'", "'static'",
+ "LINE_COMMAND", "';'", "'typedef'", "','", "'='", "'extern'", "'static'",
"'auto'", "'register'", "'void'", "'char'", "'short'", "'int'", "'long'",
"'float'", "'double'", "'signed'", "'unsigned'", "'{'", "'}'", "'struct'",
"'union'", "':'", "'enum'", "'const'", "'volatile'", "'IN'", "'OUT'",
"'while'", "'do'", "'for'", "'goto'", "'continue'", "'break'", "'return'"
]
-class Symbols_scope(object):
- def __init__(self):
- self.types = None
- self.inFunc = None
-
-class declaration_scope(object):
+class function_definition_scope(object):
def __init__(self):
- self.isTypedef = None
+ self.ModifierText = None
+ self.DeclText = None
class CParser(Parser):
Parser.__init__(self, input)
self.ruleMemo = {}
- self.Symbols_stack = []
-
- self.declaration_stack = []
+ self.function_definition_stack = []
\r
- def isTypeName(self, name):\r
- for scope in reversed(self.Symbols_stack):\r
- if name in scope.types:\r
- return True\r
- \r
- return False\r
- \r
+ \r
def printTokenInfo(self, line, offset, tokenText):\r
print str(line)+ ',' + str(offset) + ':' + str(tokenText)\r
+ \r
+ def StorePredicateExpression(self, StartLine, StartOffset, EndLine, EndOffset, Text):\r
+ PredExp = CodeFragment.PredicateExpression(Text, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.PredicateExpressionList.append(PredExp)\r
\r
- def printFuncHeader(self, line, offset, tokenText):\r
- print str(line)+ ',' + str(offset) + ':' + str(tokenText) + ' is function header.'\r
+ def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):\r
+ EnumDef = CodeFragment.EnumerationDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.EnumerationDefinitionList.append(EnumDef)\r
+ \r
+ def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):\r
+ SUDef = CodeFragment.StructUnionDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.StructUnionDefinitionList.append(SUDef)\r
+ \r
+ def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndOffset, FromText, ToText):\r
+ Tdef = CodeFragment.TypedefDefinition(FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.TypedefDefinitionList.append(Tdef)\r
+ \r
+ def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText):\r
+ FuncDef = CodeFragment.FunctionDefinition(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.FunctionDefinitionList.append(FuncDef)\r
+ \r
+ def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText):\r
+ VarDecl = CodeFragment.VariableDeclaration(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.VariableDeclarationList.append(VarDecl)\r
\r
# $ANTLR start translation_unit
- # C.g:31:1: translation_unit : ( external_declaration )+ ;
+ # C.g:46:1: translation_unit : ( external_declaration )+ ;
def translation_unit(self, ):
- self.Symbols_stack.append(Symbols_scope())
translation_unit_StartIndex = self.input.index()
- \r
- self.Symbols_stack[-1].types = set()\r
- self.Symbols_stack[-1].inFunc = False\r
-
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 1):
return
- # C.g:37:2: ( ( external_declaration )+ )
- # C.g:37:4: ( external_declaration )+
- # C.g:37:4: ( external_declaration )+
+ # C.g:47:2: ( ( external_declaration )+ )
+ # C.g:47:4: ( external_declaration )+
+ # C.g:47:4: ( external_declaration )+
cnt1 = 0
while True: #loop1
alt1 = 2
LA1_0 = self.input.LA(1)
- if (LA1_0 == IDENTIFIER or LA1_0 == 24 or (28 <= LA1_0 <= 40) or (43 <= LA1_0 <= 44) or (46 <= LA1_0 <= 51) or LA1_0 == 55) :
+ 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) :
alt1 = 1
if alt1 == 1:
# C.g:0:0: external_declaration
- self.following.append(self.FOLLOW_external_declaration_in_translation_unit76)
+ self.following.append(self.FOLLOW_external_declaration_in_translation_unit64)
self.external_declaration()
self.following.pop()
if self.failed:
if self.backtracking > 0:
self.memoize(self.input, 1, translation_unit_StartIndex)
- self.Symbols_stack.pop()
-
pass
return
# $ANTLR start external_declaration
- # C.g:48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );
+ # C.g:58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );
def external_declaration(self, ):
external_declaration_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 2):
return
- # C.g:53:2: ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement )
- alt2 = 3
- LA2_0 = self.input.LA(1)
+ # C.g:63:2: ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? )
+ alt3 = 3
+ LA3_0 = self.input.LA(1)
- if ((28 <= LA2_0 <= 31)) :
- LA2_1 = self.input.LA(2)
+ if ((28 <= LA3_0 <= 31)) :
+ LA3_1 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 1, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 1, self.input)
raise nvae
- elif (LA2_0 == 32) :
- LA2_2 = self.input.LA(2)
+ elif (LA3_0 == 32) :
+ LA3_2 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 2, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 2, self.input)
raise nvae
- elif (LA2_0 == 33) :
- LA2_3 = self.input.LA(2)
+ elif (LA3_0 == 33) :
+ LA3_3 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 3, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 3, self.input)
raise nvae
- elif (LA2_0 == 34) :
- LA2_4 = self.input.LA(2)
+ elif (LA3_0 == 34) :
+ LA3_4 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 4, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 4, self.input)
raise nvae
- elif (LA2_0 == 35) :
- LA2_5 = self.input.LA(2)
+ elif (LA3_0 == 35) :
+ LA3_5 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 5, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 5, self.input)
raise nvae
- elif (LA2_0 == 36) :
- LA2_6 = self.input.LA(2)
+ elif (LA3_0 == 36) :
+ LA3_6 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 6, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 6, self.input)
raise nvae
- elif (LA2_0 == 37) :
- LA2_7 = self.input.LA(2)
+ elif (LA3_0 == 37) :
+ LA3_7 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 7, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 7, self.input)
raise nvae
- elif (LA2_0 == 38) :
- LA2_8 = self.input.LA(2)
+ elif (LA3_0 == 38) :
+ LA3_8 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 8, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 8, self.input)
raise nvae
- elif (LA2_0 == 39) :
- LA2_9 = self.input.LA(2)
+ elif (LA3_0 == 39) :
+ LA3_9 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 9, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 9, self.input)
raise nvae
- elif (LA2_0 == 40) :
- LA2_10 = self.input.LA(2)
+ elif (LA3_0 == 40) :
+ LA3_10 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 10, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 10, self.input)
raise nvae
- elif ((43 <= LA2_0 <= 44)) :
- LA2_11 = self.input.LA(2)
+ elif ((43 <= LA3_0 <= 44)) :
+ LA3_11 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 11, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 11, self.input)
raise nvae
- elif (LA2_0 == 46) :
- LA2_12 = self.input.LA(2)
+ elif (LA3_0 == 46) :
+ LA3_12 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 12, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 12, self.input)
raise nvae
- elif (LA2_0 == IDENTIFIER) :
- LA2_13 = self.input.LA(2)
+ elif (LA3_0 == IDENTIFIER) :
+ LA3_13 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
elif (True) :
- alt2 = 3
+ alt3 = 3
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 13, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 13, self.input)
raise nvae
- elif ((47 <= LA2_0 <= 50)) :
- LA2_14 = self.input.LA(2)
+ elif ((47 <= LA3_0 <= 50)) :
+ LA3_14 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 14, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 14, self.input)
raise nvae
- elif (LA2_0 == 55) and (self.synpred4()):
- alt2 = 1
- elif (LA2_0 == 51) and (self.synpred4()):
- alt2 = 1
- elif (LA2_0 == 24) :
- alt2 = 2
+ elif (LA3_0 == 55) and (self.synpred4()):
+ alt3 = 1
+ elif (LA3_0 == 51) and (self.synpred4()):
+ alt3 = 1
+ elif (LA3_0 == 25) :
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 0, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 0, self.input)
raise nvae
- if alt2 == 1:
- # C.g:53:4: ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition
- self.following.append(self.FOLLOW_function_definition_in_external_declaration115)
+ if alt3 == 1:
+ # C.g:63:4: ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition
+ self.following.append(self.FOLLOW_function_definition_in_external_declaration103)
self.function_definition()
self.following.pop()
if self.failed:
return
- elif alt2 == 2:
- # C.g:54:4: declaration
- self.following.append(self.FOLLOW_declaration_in_external_declaration120)
+ elif alt3 == 2:
+ # C.g:64:4: declaration
+ self.following.append(self.FOLLOW_declaration_in_external_declaration108)
self.declaration()
self.following.pop()
if self.failed:
return
- elif alt2 == 3:
- # C.g:55:4: macro_statement
- self.following.append(self.FOLLOW_macro_statement_in_external_declaration125)
+ elif alt3 == 3:
+ # C.g:65:4: macro_statement ( ';' )?
+ self.following.append(self.FOLLOW_macro_statement_in_external_declaration113)
self.macro_statement()
self.following.pop()
if self.failed:
return
+ # C.g:65:20: ( ';' )?
+ alt2 = 2
+ LA2_0 = self.input.LA(1)
+
+ if (LA2_0 == 24) :
+ alt2 = 1
+ if alt2 == 1:
+ # C.g:65:21: ';'
+ self.match(self.input, 24, self.FOLLOW_24_in_external_declaration116)
+ if self.failed:
+ return
+
+
+
# $ANTLR start function_definition
- # C.g:61:1: function_definition : ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement ) ;
+ # C.g:70:1: function_definition : ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement ) ;
def function_definition(self, ):
- self.Symbols_stack.append(Symbols_scope())
-
+ self.function_definition_stack.append(function_definition_scope())
retval = self.function_definition_return()
retval.start = self.input.LT(1)
function_definition_StartIndex = self.input.index()
- declarator1 = None
+ declaration_specifiers1 = None
+ declarator2 = None
- \r
- self.Symbols_stack[-1].inFunc = True\r
+
+ \r
+ self.function_definition_stack[-1].ModifierText = ''\r
+ self.function_definition_stack[-1].DeclText = ''\r
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 3):
return retval
- # C.g:70:2: ( ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement ) )
- # C.g:70:4: ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement )
- # C.g:70:4: ( declaration_specifiers )?
- alt3 = 2
- LA3_0 = self.input.LA(1)
+ # C.g:82:2: ( ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement ) )
+ # C.g:82:4: ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement )
+ # C.g:82:4: ( declaration_specifiers )?
+ alt4 = 2
+ LA4_0 = self.input.LA(1)
- if ((28 <= LA3_0 <= 40) or (43 <= LA3_0 <= 44) or (46 <= LA3_0 <= 50)) :
- alt3 = 1
- elif (LA3_0 == IDENTIFIER) :
- LA3 = self.input.LA(2)
- if LA3 == 51:
- LA3_18 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 28 or LA3 == 29 or LA3 == 30 or LA3 == 31:
- LA3_20 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 32:
- LA3_21 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 33:
- LA3_22 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 34:
- LA3_23 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 35:
- LA3_24 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 36:
- LA3_25 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 37:
- LA3_26 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 38:
- LA3_27 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 39:
- LA3_28 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 40:
- LA3_29 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 43 or LA3 == 44:
- LA3_30 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 46:
- LA3_31 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == IDENTIFIER:
- LA3_32 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 47 or LA3 == 48 or LA3 == 49 or LA3 == 50:
- LA3_33 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 55:
- alt3 = 1
- if alt3 == 1:
+ if ((28 <= LA4_0 <= 40) or (43 <= LA4_0 <= 44) or (46 <= LA4_0 <= 50)) :
+ alt4 = 1
+ elif (LA4_0 == IDENTIFIER) :
+ LA4 = self.input.LA(2)
+ if LA4 == 51:
+ LA4_18 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 28 or LA4 == 29 or LA4 == 30 or LA4 == 31:
+ LA4_20 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 32:
+ LA4_21 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 33:
+ LA4_22 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 34:
+ LA4_23 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 35:
+ LA4_24 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 36:
+ LA4_25 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 37:
+ LA4_26 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 38:
+ LA4_27 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 39:
+ LA4_28 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 40:
+ LA4_29 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 43 or LA4 == 44:
+ LA4_30 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 46:
+ LA4_31 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == IDENTIFIER:
+ LA4_32 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 47 or LA4 == 48 or LA4 == 49 or LA4 == 50:
+ LA4_33 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 55:
+ alt4 = 1
+ if alt4 == 1:
# C.g:0:0: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_function_definition153)
- self.declaration_specifiers()
+ self.following.append(self.FOLLOW_declaration_specifiers_in_function_definition145)
+ declaration_specifiers1 = self.declaration_specifiers()
self.following.pop()
if self.failed:
return retval
- self.following.append(self.FOLLOW_declarator_in_function_definition156)
- declarator1 = self.declarator()
+ self.following.append(self.FOLLOW_declarator_in_function_definition148)
+ declarator2 = self.declarator()
self.following.pop()
if self.failed:
return retval
- # C.g:71:3: ( ( declaration )+ compound_statement | compound_statement )
- alt5 = 2
- LA5_0 = self.input.LA(1)
-
- if (LA5_0 == IDENTIFIER or LA5_0 == 24 or (28 <= LA5_0 <= 40) or (43 <= LA5_0 <= 44) or (46 <= LA5_0 <= 50)) :
- alt5 = 1
- elif (LA5_0 == 41) :
- alt5 = 2
+ # C.g:83:3: ( ( declaration )+ compound_statement | compound_statement )
+ alt6 = 2
+ LA6_0 = self.input.LA(1)
+
+ if (LA6_0 == IDENTIFIER or LA6_0 == 25 or (28 <= LA6_0 <= 40) or (43 <= LA6_0 <= 44) or (46 <= LA6_0 <= 50)) :
+ alt6 = 1
+ elif (LA6_0 == 41) :
+ alt6 = 2
else:
if self.backtracking > 0:
self.failed = True
return retval
- nvae = NoViableAltException("71:3: ( ( declaration )+ compound_statement | compound_statement )", 5, 0, self.input)
+ nvae = NoViableAltException("83:3: ( ( declaration )+ compound_statement | compound_statement )", 6, 0, self.input)
raise nvae
- if alt5 == 1:
- # C.g:71:5: ( declaration )+ compound_statement
- # C.g:71:5: ( declaration )+
- cnt4 = 0
- while True: #loop4
- alt4 = 2
- LA4_0 = self.input.LA(1)
+ if alt6 == 1:
+ # C.g:83:5: ( declaration )+ compound_statement
+ # C.g:83:5: ( declaration )+
+ cnt5 = 0
+ while True: #loop5
+ alt5 = 2
+ LA5_0 = self.input.LA(1)
- if (LA4_0 == IDENTIFIER or LA4_0 == 24 or (28 <= LA4_0 <= 40) or (43 <= LA4_0 <= 44) or (46 <= LA4_0 <= 50)) :
- alt4 = 1
+ if (LA5_0 == IDENTIFIER or LA5_0 == 25 or (28 <= LA5_0 <= 40) or (43 <= LA5_0 <= 44) or (46 <= LA5_0 <= 50)) :
+ alt5 = 1
- if alt4 == 1:
+ if alt5 == 1:
# C.g:0:0: declaration
- self.following.append(self.FOLLOW_declaration_in_function_definition162)
+ self.following.append(self.FOLLOW_declaration_in_function_definition154)
self.declaration()
self.following.pop()
if self.failed:
else:
- if cnt4 >= 1:
- break #loop4
+ if cnt5 >= 1:
+ break #loop5
if self.backtracking > 0:
self.failed = True
return retval
- eee = EarlyExitException(4, self.input)
+ eee = EarlyExitException(5, self.input)
raise eee
- cnt4 += 1
+ cnt5 += 1
- self.following.append(self.FOLLOW_compound_statement_in_function_definition165)
+ self.following.append(self.FOLLOW_compound_statement_in_function_definition157)
self.compound_statement()
self.following.pop()
if self.failed:
return retval
- elif alt5 == 2:
- # C.g:72:5: compound_statement
- self.following.append(self.FOLLOW_compound_statement_in_function_definition172)
+ elif alt6 == 2:
+ # C.g:84:5: compound_statement
+ self.following.append(self.FOLLOW_compound_statement_in_function_definition164)
self.compound_statement()
self.following.pop()
if self.failed:
if self.backtracking == 0:
- self.printFuncHeader(declarator1.start.line, declarator1.start.charPositionInLine, self.input.toString(declarator1.start,declarator1.stop))
+ self.function_definition_stack[-1].ModifierText = self.input.toString(declaration_specifiers1.start,declaration_specifiers1.stop)\r
+ self.function_definition_stack[-1].DeclText = self.input.toString(declarator2.start,declarator2.stop)
if self.backtracking == 0:
\r
- print str(retval.start.line) + ',' + str(retval.start.charPositionInLine)\r
- print str(retval.stop.line) + ',' + str(retval.stop.charPositionInLine)\r
+ 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
if self.backtracking > 0:
self.memoize(self.input, 3, function_definition_StartIndex)
- self.Symbols_stack.pop()
-
+ self.function_definition_stack.pop()
pass
return retval
# $ANTLR start declaration
- # C.g:76:1: declaration : (a= 'typedef' ( declaration_specifiers )? init_declarator_list ';' | declaration_specifiers ( init_declarator_list )? ';' );
+ # C.g:89:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );
def declaration(self, ):
- self.declaration_stack.append(declaration_scope())
+
declaration_StartIndex = self.input.index()
a = None
+ d = None
+ e = None
+ b = None
+
+ c = None
+
+ s = None
+
+ t = None
- \r
- self.declaration_stack[-1].isTypedef = False\r
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 4):
return
- # C.g:83:2: (a= 'typedef' ( declaration_specifiers )? init_declarator_list ';' | declaration_specifiers ( init_declarator_list )? ';' )
- alt8 = 2
- LA8_0 = self.input.LA(1)
+ # C.g:90:2: (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' )
+ alt9 = 2
+ LA9_0 = self.input.LA(1)
- if (LA8_0 == 24) :
- alt8 = 1
- elif (LA8_0 == IDENTIFIER or (28 <= LA8_0 <= 40) or (43 <= LA8_0 <= 44) or (46 <= LA8_0 <= 50)) :
- alt8 = 2
+ if (LA9_0 == 25) :
+ alt9 = 1
+ elif (LA9_0 == IDENTIFIER or (28 <= LA9_0 <= 40) or (43 <= LA9_0 <= 44) or (46 <= LA9_0 <= 50)) :
+ alt9 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("76:1: declaration : (a= 'typedef' ( declaration_specifiers )? init_declarator_list ';' | declaration_specifiers ( init_declarator_list )? ';' );", 8, 0, self.input)
+ 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)
raise nvae
- if alt8 == 1:
- # C.g:83:4: a= 'typedef' ( declaration_specifiers )? init_declarator_list ';'
+ if alt9 == 1:
+ # C.g:90:4: a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';'
a = self.input.LT(1)
- self.match(self.input, 24, self.FOLLOW_24_in_declaration204)
+ self.match(self.input, 25, self.FOLLOW_25_in_declaration187)
if self.failed:
return
- # C.g:83:16: ( declaration_specifiers )?
- alt6 = 2
- LA6_0 = self.input.LA(1)
-
- if ((28 <= LA6_0 <= 40) or (43 <= LA6_0 <= 44) or (46 <= LA6_0 <= 50)) :
- alt6 = 1
- elif (LA6_0 == IDENTIFIER) :
- LA6_13 = self.input.LA(2)
-
- if (LA6_13 == 51) :
- LA6_18 = self.input.LA(3)
-
- if (self.synpred9()) :
- alt6 = 1
- elif (LA6_13 == IDENTIFIER or (28 <= LA6_13 <= 40) or (43 <= LA6_13 <= 44) or (46 <= LA6_13 <= 50) or LA6_13 == 55) :
- alt6 = 1
- if alt6 == 1:
- # C.g:0:0: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_declaration206)
- self.declaration_specifiers()
+ # C.g:90:17: (b= declaration_specifiers )?
+ alt7 = 2
+ LA7_0 = self.input.LA(1)
+
+ if ((28 <= LA7_0 <= 40) or (43 <= LA7_0 <= 44) or (46 <= LA7_0 <= 50)) :
+ alt7 = 1
+ elif (LA7_0 == IDENTIFIER) :
+ LA7_13 = self.input.LA(2)
+
+ if (LA7_13 == IDENTIFIER or (28 <= LA7_13 <= 40) or (43 <= LA7_13 <= 44) or (46 <= LA7_13 <= 50) or LA7_13 == 55) :
+ alt7 = 1
+ elif (LA7_13 == 51) :
+ LA7_19 = self.input.LA(3)
+
+ if (self.synpred10()) :
+ alt7 = 1
+ if alt7 == 1:
+ # C.g:0:0: b= declaration_specifiers
+ self.following.append(self.FOLLOW_declaration_specifiers_in_declaration191)
+ b = self.declaration_specifiers()
self.following.pop()
if self.failed:
return
- self.following.append(self.FOLLOW_init_declarator_list_in_declaration213)
- self.init_declarator_list()
+ self.following.append(self.FOLLOW_init_declarator_list_in_declaration200)
+ c = self.init_declarator_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 25, self.FOLLOW_25_in_declaration215)
+ d = self.input.LT(1)
+ self.match(self.input, 24, self.FOLLOW_24_in_declaration204)
if self.failed:
return
+ if self.backtracking == 0:
+ \r
+ if b != None:\r
+ 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
+ else:\r
+ self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start,c.stop))\r
+
+
- elif alt8 == 2:
- # C.g:85:4: declaration_specifiers ( init_declarator_list )? ';'
- self.following.append(self.FOLLOW_declaration_specifiers_in_declaration221)
- self.declaration_specifiers()
+ elif alt9 == 2:
+ # C.g:98:4: s= declaration_specifiers (t= init_declarator_list )? e= ';'
+ self.following.append(self.FOLLOW_declaration_specifiers_in_declaration218)
+ s = self.declaration_specifiers()
self.following.pop()
if self.failed:
return
- # C.g:85:27: ( init_declarator_list )?
- alt7 = 2
- LA7_0 = self.input.LA(1)
-
- if (LA7_0 == IDENTIFIER or LA7_0 == 51 or LA7_0 == 55) :
- alt7 = 1
- if alt7 == 1:
- # C.g:0:0: init_declarator_list
- self.following.append(self.FOLLOW_init_declarator_list_in_declaration223)
- self.init_declarator_list()
+ # C.g:98:30: (t= init_declarator_list )?
+ alt8 = 2
+ LA8_0 = self.input.LA(1)
+
+ if (LA8_0 == IDENTIFIER or LA8_0 == 51 or LA8_0 == 55) :
+ alt8 = 1
+ if alt8 == 1:
+ # C.g:0:0: t= init_declarator_list
+ self.following.append(self.FOLLOW_init_declarator_list_in_declaration222)
+ t = self.init_declarator_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 25, self.FOLLOW_25_in_declaration226)
+ e = self.input.LT(1)
+ self.match(self.input, 24, self.FOLLOW_24_in_declaration227)
if self.failed:
return
+ if self.backtracking == 0:
+ 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))
+
if self.backtracking > 0:
self.memoize(self.input, 4, declaration_StartIndex)
- self.declaration_stack.pop()
pass
return
# $ANTLR end declaration
+ class declaration_specifiers_return(object):
+ def __init__(self):
+ self.start = None
+ self.stop = None
+
+
# $ANTLR start declaration_specifiers
- # C.g:89:1: declaration_specifiers : ( storage_class_specifier | type_specifier | type_qualifier )+ ;
+ # C.g:102:1: declaration_specifiers : ( storage_class_specifier | type_specifier | type_qualifier )+ ;
def declaration_specifiers(self, ):
+ retval = self.declaration_specifiers_return()
+ retval.start = self.input.LT(1)
declaration_specifiers_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 5):
- return
+ return retval
+
+ # C.g:103:2: ( ( storage_class_specifier | type_specifier | type_qualifier )+ )
+ # C.g:103:6: ( storage_class_specifier | type_specifier | type_qualifier )+
+ # C.g:103:6: ( storage_class_specifier | type_specifier | type_qualifier )+
+ cnt10 = 0
+ while True: #loop10
+ alt10 = 4
+ LA10 = self.input.LA(1)
+ if LA10 == IDENTIFIER:
+ LA10_2 = self.input.LA(2)
- # C.g:90:2: ( ( storage_class_specifier | type_specifier | type_qualifier )+ )
- # C.g:90:6: ( storage_class_specifier | type_specifier | type_qualifier )+
- # C.g:90:6: ( storage_class_specifier | type_specifier | type_qualifier )+
- cnt9 = 0
- while True: #loop9
- alt9 = 4
- LA9 = self.input.LA(1)
- if LA9 == IDENTIFIER:
- LA9_2 = self.input.LA(2)
-
- if (self.synpred13()) :
- alt9 = 2
-
-
- elif LA9 == 28 or LA9 == 29 or LA9 == 30 or LA9 == 31:
- alt9 = 1
- elif LA9 == 32 or LA9 == 33 or LA9 == 34 or LA9 == 35 or LA9 == 36 or LA9 == 37 or LA9 == 38 or LA9 == 39 or LA9 == 40 or LA9 == 43 or LA9 == 44 or LA9 == 46:
- alt9 = 2
- elif LA9 == 47 or LA9 == 48 or LA9 == 49 or LA9 == 50:
- alt9 = 3
-
- if alt9 == 1:
- # C.g:90:10: storage_class_specifier
- self.following.append(self.FOLLOW_storage_class_specifier_in_declaration_specifiers245)
+ if (self.synpred14()) :
+ alt10 = 2
+
+
+ elif LA10 == 28 or LA10 == 29 or LA10 == 30 or LA10 == 31:
+ alt10 = 1
+ 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:
+ alt10 = 2
+ elif LA10 == 47 or LA10 == 48 or LA10 == 49 or LA10 == 50:
+ alt10 = 3
+
+ if alt10 == 1:
+ # C.g:103:10: storage_class_specifier
+ self.following.append(self.FOLLOW_storage_class_specifier_in_declaration_specifiers248)
self.storage_class_specifier()
self.following.pop()
if self.failed:
- return
+ return retval
- elif alt9 == 2:
- # C.g:91:7: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_declaration_specifiers253)
+ elif alt10 == 2:
+ # C.g:104:7: type_specifier
+ self.following.append(self.FOLLOW_type_specifier_in_declaration_specifiers256)
self.type_specifier()
self.following.pop()
if self.failed:
- return
+ return retval
- elif alt9 == 3:
- # C.g:92:13: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_declaration_specifiers267)
+ elif alt10 == 3:
+ # C.g:105:13: type_qualifier
+ self.following.append(self.FOLLOW_type_qualifier_in_declaration_specifiers270)
self.type_qualifier()
self.following.pop()
if self.failed:
- return
+ return retval
else:
- if cnt9 >= 1:
- break #loop9
+ if cnt10 >= 1:
+ break #loop10
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- eee = EarlyExitException(9, self.input)
+ eee = EarlyExitException(10, self.input)
raise eee
- cnt9 += 1
+ cnt10 += 1
+
+ retval.stop = self.input.LT(-1)
except RecognitionException, re:
pass
- return
+ return retval
# $ANTLR end declaration_specifiers
+ class init_declarator_list_return(object):
+ def __init__(self):
+ self.start = None
+ self.stop = None
+
+
# $ANTLR start init_declarator_list
- # C.g:96:1: init_declarator_list : init_declarator ( ',' init_declarator )* ;
+ # C.g:109:1: init_declarator_list : init_declarator ( ',' init_declarator )* ;
def init_declarator_list(self, ):
+ retval = self.init_declarator_list_return()
+ retval.start = self.input.LT(1)
init_declarator_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 6):
- return
+ return retval
- # C.g:97:2: ( init_declarator ( ',' init_declarator )* )
- # C.g:97:4: init_declarator ( ',' init_declarator )*
- self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list289)
+ # C.g:110:2: ( init_declarator ( ',' init_declarator )* )
+ # C.g:110:4: init_declarator ( ',' init_declarator )*
+ self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list292)
self.init_declarator()
self.following.pop()
if self.failed:
- return
- # C.g:97:20: ( ',' init_declarator )*
- while True: #loop10
- alt10 = 2
- LA10_0 = self.input.LA(1)
+ return retval
+ # C.g:110:20: ( ',' init_declarator )*
+ while True: #loop11
+ alt11 = 2
+ LA11_0 = self.input.LA(1)
- if (LA10_0 == 26) :
- alt10 = 1
+ if (LA11_0 == 26) :
+ alt11 = 1
- if alt10 == 1:
- # C.g:97:21: ',' init_declarator
- self.match(self.input, 26, self.FOLLOW_26_in_init_declarator_list292)
+ if alt11 == 1:
+ # C.g:110:21: ',' init_declarator
+ self.match(self.input, 26, self.FOLLOW_26_in_init_declarator_list295)
if self.failed:
- return
- self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list294)
+ return retval
+ self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list297)
self.init_declarator()
self.following.pop()
if self.failed:
- return
+ return retval
else:
- break #loop10
+ break #loop11
+ retval.stop = self.input.LT(-1)
+
except RecognitionException, re:
self.reportError(re)
pass
- return
+ return retval
# $ANTLR end init_declarator_list
# $ANTLR start init_declarator
- # C.g:100:1: init_declarator : declarator ( '=' initializer )? ;
+ # C.g:113:1: init_declarator : declarator ( '=' initializer )? ;
def init_declarator(self, ):
init_declarator_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 7):
return
- # C.g:101:2: ( declarator ( '=' initializer )? )
- # C.g:101:4: declarator ( '=' initializer )?
- self.following.append(self.FOLLOW_declarator_in_init_declarator307)
+ # C.g:114:2: ( declarator ( '=' initializer )? )
+ # C.g:114:4: declarator ( '=' initializer )?
+ self.following.append(self.FOLLOW_declarator_in_init_declarator310)
self.declarator()
self.following.pop()
if self.failed:
return
- # C.g:101:15: ( '=' initializer )?
- alt11 = 2
- LA11_0 = self.input.LA(1)
+ # C.g:114:15: ( '=' initializer )?
+ alt12 = 2
+ LA12_0 = self.input.LA(1)
- if (LA11_0 == 27) :
- alt11 = 1
- if alt11 == 1:
- # C.g:101:16: '=' initializer
- self.match(self.input, 27, self.FOLLOW_27_in_init_declarator310)
+ if (LA12_0 == 27) :
+ alt12 = 1
+ if alt12 == 1:
+ # C.g:114:16: '=' initializer
+ self.match(self.input, 27, self.FOLLOW_27_in_init_declarator313)
if self.failed:
return
- self.following.append(self.FOLLOW_initializer_in_init_declarator312)
+ self.following.append(self.FOLLOW_initializer_in_init_declarator315)
self.initializer()
self.following.pop()
if self.failed:
# $ANTLR start storage_class_specifier
- # C.g:105:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' | 'register' );
+ # C.g:117:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' | 'register' );
def storage_class_specifier(self, ):
storage_class_specifier_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 8):
return
- # C.g:106:2: ( 'extern' | 'static' | 'auto' | 'register' )
+ # C.g:118:2: ( 'extern' | 'static' | 'auto' | 'register' )
# C.g:
if (28 <= self.input.LA(1) <= 31):
self.input.consume();
# $ANTLR start type_specifier
- # C.g:112:1: type_specifier options {k=3; } : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | struct_or_union_specifier | enum_specifier | ( IDENTIFIER declarator )=> type_id );
+ # 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 );
def type_specifier(self, ):
type_specifier_StartIndex = self.input.index()
+ s = None
+
+ e = None
+
+
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 9):
return
- # C.g:114:2: ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | struct_or_union_specifier | enum_specifier | ( IDENTIFIER declarator )=> type_id )
- alt12 = 12
- LA12_0 = self.input.LA(1)
+ # 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 )
+ alt13 = 12
+ LA13_0 = self.input.LA(1)
- if (LA12_0 == 32) :
- alt12 = 1
- elif (LA12_0 == 33) :
- alt12 = 2
- elif (LA12_0 == 34) :
- alt12 = 3
- elif (LA12_0 == 35) :
- alt12 = 4
- elif (LA12_0 == 36) :
- alt12 = 5
- elif (LA12_0 == 37) :
- alt12 = 6
- elif (LA12_0 == 38) :
- alt12 = 7
- elif (LA12_0 == 39) :
- alt12 = 8
- elif (LA12_0 == 40) :
- alt12 = 9
- elif ((43 <= LA12_0 <= 44)) :
- alt12 = 10
- elif (LA12_0 == 46) :
- alt12 = 11
- elif (LA12_0 == IDENTIFIER) and (self.synpred31()):
- alt12 = 12
+ if (LA13_0 == 32) :
+ alt13 = 1
+ elif (LA13_0 == 33) :
+ alt13 = 2
+ elif (LA13_0 == 34) :
+ alt13 = 3
+ elif (LA13_0 == 35) :
+ alt13 = 4
+ elif (LA13_0 == 36) :
+ alt13 = 5
+ elif (LA13_0 == 37) :
+ alt13 = 6
+ elif (LA13_0 == 38) :
+ alt13 = 7
+ elif (LA13_0 == 39) :
+ alt13 = 8
+ elif (LA13_0 == 40) :
+ alt13 = 9
+ elif ((43 <= LA13_0 <= 44)) :
+ alt13 = 10
+ elif (LA13_0 == 46) :
+ alt13 = 11
+ elif (LA13_0 == IDENTIFIER) and (self.synpred32()):
+ alt13 = 12
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("112:1: type_specifier options {k=3; } : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | struct_or_union_specifier | enum_specifier | ( IDENTIFIER declarator )=> type_id );", 12, 0, self.input)
+ 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)
raise nvae
- if alt12 == 1:
- # C.g:114:4: 'void'
- self.match(self.input, 32, self.FOLLOW_32_in_type_specifier361)
+ if alt13 == 1:
+ # C.g:125:4: 'void'
+ self.match(self.input, 32, self.FOLLOW_32_in_type_specifier355)
if self.failed:
return
- elif alt12 == 2:
- # C.g:115:4: 'char'
- self.match(self.input, 33, self.FOLLOW_33_in_type_specifier366)
+ elif alt13 == 2:
+ # C.g:126:4: 'char'
+ self.match(self.input, 33, self.FOLLOW_33_in_type_specifier360)
if self.failed:
return
- elif alt12 == 3:
- # C.g:116:4: 'short'
- self.match(self.input, 34, self.FOLLOW_34_in_type_specifier371)
+ elif alt13 == 3:
+ # C.g:127:4: 'short'
+ self.match(self.input, 34, self.FOLLOW_34_in_type_specifier365)
if self.failed:
return
- elif alt12 == 4:
- # C.g:117:4: 'int'
- self.match(self.input, 35, self.FOLLOW_35_in_type_specifier376)
+ elif alt13 == 4:
+ # C.g:128:4: 'int'
+ self.match(self.input, 35, self.FOLLOW_35_in_type_specifier370)
if self.failed:
return
- elif alt12 == 5:
- # C.g:118:4: 'long'
- self.match(self.input, 36, self.FOLLOW_36_in_type_specifier381)
+ elif alt13 == 5:
+ # C.g:129:4: 'long'
+ self.match(self.input, 36, self.FOLLOW_36_in_type_specifier375)
if self.failed:
return
- elif alt12 == 6:
- # C.g:119:4: 'float'
- self.match(self.input, 37, self.FOLLOW_37_in_type_specifier386)
+ elif alt13 == 6:
+ # C.g:130:4: 'float'
+ self.match(self.input, 37, self.FOLLOW_37_in_type_specifier380)
if self.failed:
return
- elif alt12 == 7:
- # C.g:120:4: 'double'
- self.match(self.input, 38, self.FOLLOW_38_in_type_specifier391)
+ elif alt13 == 7:
+ # C.g:131:4: 'double'
+ self.match(self.input, 38, self.FOLLOW_38_in_type_specifier385)
if self.failed:
return
- elif alt12 == 8:
- # C.g:121:4: 'signed'
- self.match(self.input, 39, self.FOLLOW_39_in_type_specifier396)
+ elif alt13 == 8:
+ # C.g:132:4: 'signed'
+ self.match(self.input, 39, self.FOLLOW_39_in_type_specifier390)
if self.failed:
return
- elif alt12 == 9:
- # C.g:122:4: 'unsigned'
- self.match(self.input, 40, self.FOLLOW_40_in_type_specifier401)
+ elif alt13 == 9:
+ # C.g:133:4: 'unsigned'
+ self.match(self.input, 40, self.FOLLOW_40_in_type_specifier395)
if self.failed:
return
- elif alt12 == 10:
- # C.g:123:4: struct_or_union_specifier
- self.following.append(self.FOLLOW_struct_or_union_specifier_in_type_specifier406)
- self.struct_or_union_specifier()
+ elif alt13 == 10:
+ # C.g:134:4: s= struct_or_union_specifier
+ self.following.append(self.FOLLOW_struct_or_union_specifier_in_type_specifier402)
+ s = self.struct_or_union_specifier()
self.following.pop()
if self.failed:
return
+ if self.backtracking == 0:
+ self.StoreStructUnionDefinition(s.start.line, s.start.charPositionInLine, s.stop.line, s.stop.charPositionInLine, self.input.toString(s.start,s.stop))
- elif alt12 == 11:
- # C.g:124:4: enum_specifier
+
+ elif alt13 == 11:
+ # C.g:135:4: e= enum_specifier
self.following.append(self.FOLLOW_enum_specifier_in_type_specifier411)
- self.enum_specifier()
+ e = self.enum_specifier()
self.following.pop()
if self.failed:
return
+ if self.backtracking == 0:
+ self.StoreEnumerationDefinition(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
+
- elif alt12 == 12:
- # C.g:125:4: ( IDENTIFIER declarator )=> type_id
- self.following.append(self.FOLLOW_type_id_in_type_specifier423)
+ elif alt13 == 12:
+ # C.g:136:4: ( IDENTIFIER declarator )=> type_id
+ self.following.append(self.FOLLOW_type_id_in_type_specifier425)
self.type_id()
self.following.pop()
if self.failed:
# $ANTLR start type_id
- # C.g:128:1: type_id : IDENTIFIER ;
+ # C.g:139:1: type_id : IDENTIFIER ;
def type_id(self, ):
type_id_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 10):
return
- # C.g:129:5: ( IDENTIFIER )
- # C.g:129:9: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_type_id439)
+ # C.g:140:5: ( IDENTIFIER )
+ # C.g:140:9: IDENTIFIER
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_type_id441)
if self.failed:
return
# $ANTLR end type_id
+ class struct_or_union_specifier_return(object):
+ def __init__(self):
+ self.start = None
+ self.stop = None
+
+
# $ANTLR start struct_or_union_specifier
- # C.g:133:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );
+ # C.g:144:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );
def struct_or_union_specifier(self, ):
- self.Symbols_stack.append(Symbols_scope())
+ retval = self.struct_or_union_specifier_return()
+ retval.start = self.input.LT(1)
struct_or_union_specifier_StartIndex = self.input.index()
- \r
- self.Symbols_stack[-1].types = set()\r
-
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 11):
- return
+ return retval
- # C.g:139:2: ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER )
- alt14 = 2
- LA14_0 = self.input.LA(1)
+ # C.g:146:2: ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER )
+ alt15 = 2
+ LA15_0 = self.input.LA(1)
- if ((43 <= LA14_0 <= 44)) :
- LA14_1 = self.input.LA(2)
+ if ((43 <= LA15_0 <= 44)) :
+ LA15_1 = self.input.LA(2)
- if (LA14_1 == IDENTIFIER) :
- LA14_2 = self.input.LA(3)
+ if (LA15_1 == IDENTIFIER) :
+ LA15_2 = self.input.LA(3)
- if (LA14_2 == 41) :
- alt14 = 1
- elif (LA14_2 == EOF or LA14_2 == IDENTIFIER or LA14_2 == 25 or (28 <= LA14_2 <= 40) or (43 <= LA14_2 <= 53) or LA14_2 == 55) :
- alt14 = 2
+ if (LA15_2 == 41) :
+ alt15 = 1
+ 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) :
+ alt15 = 2
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("133:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 14, 2, self.input)
+ 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)
raise nvae
- elif (LA14_1 == 41) :
- alt14 = 1
+ elif (LA15_1 == 41) :
+ alt15 = 1
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("133:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 14, 1, self.input)
+ 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)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("133:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 14, 0, self.input)
+ 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)
raise nvae
- if alt14 == 1:
- # C.g:139:4: struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}'
- self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier478)
+ if alt15 == 1:
+ # C.g:146:4: struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}'
+ self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier469)
self.struct_or_union()
self.following.pop()
if self.failed:
- return
- # C.g:139:20: ( IDENTIFIER )?
- alt13 = 2
- LA13_0 = self.input.LA(1)
+ return retval
+ # C.g:146:20: ( IDENTIFIER )?
+ alt14 = 2
+ LA14_0 = self.input.LA(1)
- if (LA13_0 == IDENTIFIER) :
- alt13 = 1
- if alt13 == 1:
+ if (LA14_0 == IDENTIFIER) :
+ alt14 = 1
+ if alt14 == 1:
# C.g:0:0: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier480)
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier471)
if self.failed:
- return
+ return retval
- self.match(self.input, 41, self.FOLLOW_41_in_struct_or_union_specifier483)
+ self.match(self.input, 41, self.FOLLOW_41_in_struct_or_union_specifier474)
if self.failed:
- return
- self.following.append(self.FOLLOW_struct_declaration_list_in_struct_or_union_specifier485)
+ return retval
+ self.following.append(self.FOLLOW_struct_declaration_list_in_struct_or_union_specifier476)
self.struct_declaration_list()
self.following.pop()
if self.failed:
- return
- self.match(self.input, 42, self.FOLLOW_42_in_struct_or_union_specifier487)
+ return retval
+ self.match(self.input, 42, self.FOLLOW_42_in_struct_or_union_specifier478)
if self.failed:
- return
+ return retval
- elif alt14 == 2:
- # C.g:140:4: struct_or_union IDENTIFIER
- self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier492)
+ elif alt15 == 2:
+ # C.g:147:4: struct_or_union IDENTIFIER
+ self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier483)
self.struct_or_union()
self.following.pop()
if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier494)
+ return retval
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier485)
if self.failed:
- return
+ return retval
+
+ retval.stop = self.input.LT(-1)
except RecognitionException, re:
if self.backtracking > 0:
self.memoize(self.input, 11, struct_or_union_specifier_StartIndex)
- self.Symbols_stack.pop()
-
pass
- return
+ return retval
# $ANTLR end struct_or_union_specifier
# $ANTLR start struct_or_union
- # C.g:143:1: struct_or_union : ( 'struct' | 'union' );
+ # C.g:150:1: struct_or_union : ( 'struct' | 'union' );
def struct_or_union(self, ):
struct_or_union_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 12):
return
- # C.g:144:2: ( 'struct' | 'union' )
+ # C.g:151:2: ( 'struct' | 'union' )
# C.g:
if (43 <= self.input.LA(1) <= 44):
self.input.consume();
# $ANTLR start struct_declaration_list
- # C.g:148:1: struct_declaration_list : ( struct_declaration )+ ;
+ # C.g:155:1: struct_declaration_list : ( struct_declaration )+ ;
def struct_declaration_list(self, ):
struct_declaration_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 13):
return
- # C.g:149:2: ( ( struct_declaration )+ )
- # C.g:149:4: ( struct_declaration )+
- # C.g:149:4: ( struct_declaration )+
- cnt15 = 0
- while True: #loop15
- alt15 = 2
- LA15_0 = self.input.LA(1)
+ # C.g:156:2: ( ( struct_declaration )+ )
+ # C.g:156:4: ( struct_declaration )+
+ # C.g:156:4: ( struct_declaration )+
+ cnt16 = 0
+ while True: #loop16
+ alt16 = 2
+ LA16_0 = self.input.LA(1)
- if (LA15_0 == IDENTIFIER or (32 <= LA15_0 <= 40) or (43 <= LA15_0 <= 44) or (46 <= LA15_0 <= 50)) :
- alt15 = 1
+ if (LA16_0 == IDENTIFIER or (32 <= LA16_0 <= 40) or (43 <= LA16_0 <= 44) or (46 <= LA16_0 <= 50)) :
+ alt16 = 1
- if alt15 == 1:
+ if alt16 == 1:
# C.g:0:0: struct_declaration
- self.following.append(self.FOLLOW_struct_declaration_in_struct_declaration_list521)
+ self.following.append(self.FOLLOW_struct_declaration_in_struct_declaration_list512)
self.struct_declaration()
self.following.pop()
if self.failed:
else:
- if cnt15 >= 1:
- break #loop15
+ if cnt16 >= 1:
+ break #loop16
if self.backtracking > 0:
self.failed = True
return
- eee = EarlyExitException(15, self.input)
+ eee = EarlyExitException(16, self.input)
raise eee
- cnt15 += 1
+ cnt16 += 1
# $ANTLR start struct_declaration
- # C.g:152:1: struct_declaration : specifier_qualifier_list struct_declarator_list ';' ;
+ # C.g:159:1: struct_declaration : specifier_qualifier_list struct_declarator_list ';' ;
def struct_declaration(self, ):
struct_declaration_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 14):
return
- # C.g:153:2: ( specifier_qualifier_list struct_declarator_list ';' )
- # C.g:153:4: specifier_qualifier_list struct_declarator_list ';'
- self.following.append(self.FOLLOW_specifier_qualifier_list_in_struct_declaration533)
+ # C.g:160:2: ( specifier_qualifier_list struct_declarator_list ';' )
+ # C.g:160:4: specifier_qualifier_list struct_declarator_list ';'
+ self.following.append(self.FOLLOW_specifier_qualifier_list_in_struct_declaration524)
self.specifier_qualifier_list()
self.following.pop()
if self.failed:
return
- self.following.append(self.FOLLOW_struct_declarator_list_in_struct_declaration535)
+ self.following.append(self.FOLLOW_struct_declarator_list_in_struct_declaration526)
self.struct_declarator_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 25, self.FOLLOW_25_in_struct_declaration537)
+ self.match(self.input, 24, self.FOLLOW_24_in_struct_declaration528)
if self.failed:
return
# $ANTLR start specifier_qualifier_list
- # C.g:156:1: specifier_qualifier_list : ( type_qualifier | type_specifier )+ ;
+ # C.g:163:1: specifier_qualifier_list : ( type_qualifier | type_specifier )+ ;
def specifier_qualifier_list(self, ):
specifier_qualifier_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 15):
return
- # C.g:157:2: ( ( type_qualifier | type_specifier )+ )
- # C.g:157:4: ( type_qualifier | type_specifier )+
- # C.g:157:4: ( type_qualifier | type_specifier )+
- cnt16 = 0
- while True: #loop16
- alt16 = 3
- LA16 = self.input.LA(1)
- if LA16 == IDENTIFIER:
- LA16 = self.input.LA(2)
- if LA16 == 53:
- LA16_20 = self.input.LA(3)
+ # C.g:164:2: ( ( type_qualifier | type_specifier )+ )
+ # C.g:164:4: ( type_qualifier | type_specifier )+
+ # C.g:164:4: ( type_qualifier | type_specifier )+
+ cnt17 = 0
+ while True: #loop17
+ alt17 = 3
+ LA17 = self.input.LA(1)
+ if LA17 == IDENTIFIER:
+ LA17 = self.input.LA(2)
+ 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:
+ alt17 = 2
+ elif LA17 == 51:
+ LA17_22 = self.input.LA(3)
- if (self.synpred37()) :
- alt16 = 2
+ if (self.synpred38()) :
+ alt17 = 2
- elif LA16 == 51:
- LA16_21 = self.input.LA(3)
+ elif LA17 == 45:
+ LA17_23 = self.input.LA(3)
- if (self.synpred37()) :
- alt16 = 2
+ if (self.synpred38()) :
+ alt17 = 2
- elif LA16 == 45:
- LA16_22 = self.input.LA(3)
+ elif LA17 == 53:
+ LA17_24 = self.input.LA(3)
- if (self.synpred37()) :
- alt16 = 2
+ if (self.synpred38()) :
+ alt17 = 2
- elif LA16 == EOF or LA16 == IDENTIFIER or LA16 == 32 or LA16 == 33 or LA16 == 34 or LA16 == 35 or LA16 == 36 or LA16 == 37 or LA16 == 38 or LA16 == 39 or LA16 == 40 or LA16 == 43 or LA16 == 44 or LA16 == 46 or LA16 == 47 or LA16 == 48 or LA16 == 49 or LA16 == 50 or LA16 == 52 or LA16 == 55:
- alt16 = 2
- elif LA16 == 47 or LA16 == 48 or LA16 == 49 or LA16 == 50:
- alt16 = 1
- elif LA16 == 32 or LA16 == 33 or LA16 == 34 or LA16 == 35 or LA16 == 36 or LA16 == 37 or LA16 == 38 or LA16 == 39 or LA16 == 40 or LA16 == 43 or LA16 == 44 or LA16 == 46:
- alt16 = 2
+ elif LA17 == 47 or LA17 == 48 or LA17 == 49 or LA17 == 50:
+ alt17 = 1
+ 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:
+ alt17 = 2
- if alt16 == 1:
- # C.g:157:6: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_specifier_qualifier_list550)
+ if alt17 == 1:
+ # C.g:164:6: type_qualifier
+ self.following.append(self.FOLLOW_type_qualifier_in_specifier_qualifier_list541)
self.type_qualifier()
self.following.pop()
if self.failed:
return
- elif alt16 == 2:
- # C.g:157:23: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_specifier_qualifier_list554)
+ elif alt17 == 2:
+ # C.g:164:23: type_specifier
+ self.following.append(self.FOLLOW_type_specifier_in_specifier_qualifier_list545)
self.type_specifier()
self.following.pop()
if self.failed:
else:
- if cnt16 >= 1:
- break #loop16
+ if cnt17 >= 1:
+ break #loop17
if self.backtracking > 0:
self.failed = True
return
- eee = EarlyExitException(16, self.input)
+ eee = EarlyExitException(17, self.input)
raise eee
- cnt16 += 1
+ cnt17 += 1
# $ANTLR start struct_declarator_list
- # C.g:160:1: struct_declarator_list : struct_declarator ( ',' struct_declarator )* ;
+ # C.g:167:1: struct_declarator_list : struct_declarator ( ',' struct_declarator )* ;
def struct_declarator_list(self, ):
struct_declarator_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 16):
return
- # C.g:161:2: ( struct_declarator ( ',' struct_declarator )* )
- # C.g:161:4: struct_declarator ( ',' struct_declarator )*
- self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list568)
+ # C.g:168:2: ( struct_declarator ( ',' struct_declarator )* )
+ # C.g:168:4: struct_declarator ( ',' struct_declarator )*
+ self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list559)
self.struct_declarator()
self.following.pop()
if self.failed:
return
- # C.g:161:22: ( ',' struct_declarator )*
- while True: #loop17
- alt17 = 2
- LA17_0 = self.input.LA(1)
+ # C.g:168:22: ( ',' struct_declarator )*
+ while True: #loop18
+ alt18 = 2
+ LA18_0 = self.input.LA(1)
- if (LA17_0 == 26) :
- alt17 = 1
+ if (LA18_0 == 26) :
+ alt18 = 1
- if alt17 == 1:
- # C.g:161:23: ',' struct_declarator
- self.match(self.input, 26, self.FOLLOW_26_in_struct_declarator_list571)
+ if alt18 == 1:
+ # C.g:168:23: ',' struct_declarator
+ self.match(self.input, 26, self.FOLLOW_26_in_struct_declarator_list562)
if self.failed:
return
- self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list573)
+ self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list564)
self.struct_declarator()
self.following.pop()
if self.failed:
else:
- break #loop17
+ break #loop18
# $ANTLR start struct_declarator
- # C.g:164:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );
+ # C.g:171:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );
def struct_declarator(self, ):
struct_declarator_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 17):
return
- # C.g:165:2: ( declarator ( ':' constant_expression )? | ':' constant_expression )
- alt19 = 2
- LA19_0 = self.input.LA(1)
+ # C.g:172:2: ( declarator ( ':' constant_expression )? | ':' constant_expression )
+ alt20 = 2
+ LA20_0 = self.input.LA(1)
- if (LA19_0 == IDENTIFIER or LA19_0 == 51 or LA19_0 == 55) :
- alt19 = 1
- elif (LA19_0 == 45) :
- alt19 = 2
+ if (LA20_0 == IDENTIFIER or LA20_0 == 51 or LA20_0 == 55) :
+ alt20 = 1
+ elif (LA20_0 == 45) :
+ alt20 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("164:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );", 19, 0, self.input)
+ nvae = NoViableAltException("171:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );", 20, 0, self.input)
raise nvae
- if alt19 == 1:
- # C.g:165:4: declarator ( ':' constant_expression )?
- self.following.append(self.FOLLOW_declarator_in_struct_declarator586)
+ if alt20 == 1:
+ # C.g:172:4: declarator ( ':' constant_expression )?
+ self.following.append(self.FOLLOW_declarator_in_struct_declarator577)
self.declarator()
self.following.pop()
if self.failed:
return
- # C.g:165:15: ( ':' constant_expression )?
- alt18 = 2
- LA18_0 = self.input.LA(1)
+ # C.g:172:15: ( ':' constant_expression )?
+ alt19 = 2
+ LA19_0 = self.input.LA(1)
- if (LA18_0 == 45) :
- alt18 = 1
- if alt18 == 1:
- # C.g:165:16: ':' constant_expression
- self.match(self.input, 45, self.FOLLOW_45_in_struct_declarator589)
+ if (LA19_0 == 45) :
+ alt19 = 1
+ if alt19 == 1:
+ # C.g:172:16: ':' constant_expression
+ self.match(self.input, 45, self.FOLLOW_45_in_struct_declarator580)
if self.failed:
return
- self.following.append(self.FOLLOW_constant_expression_in_struct_declarator591)
+ self.following.append(self.FOLLOW_constant_expression_in_struct_declarator582)
self.constant_expression()
self.following.pop()
if self.failed:
- elif alt19 == 2:
- # C.g:166:4: ':' constant_expression
- self.match(self.input, 45, self.FOLLOW_45_in_struct_declarator598)
+ elif alt20 == 2:
+ # C.g:173:4: ':' constant_expression
+ self.match(self.input, 45, self.FOLLOW_45_in_struct_declarator589)
if self.failed:
return
- self.following.append(self.FOLLOW_constant_expression_in_struct_declarator600)
+ self.following.append(self.FOLLOW_constant_expression_in_struct_declarator591)
self.constant_expression()
self.following.pop()
if self.failed:
# $ANTLR end struct_declarator
+ class enum_specifier_return(object):
+ def __init__(self):
+ self.start = None
+ self.stop = None
+
+
# $ANTLR start enum_specifier
- # C.g:169:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );
+ # C.g:176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );
def enum_specifier(self, ):
+ retval = self.enum_specifier_return()
+ retval.start = self.input.LT(1)
enum_specifier_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 18):
- return
+ return retval
- # C.g:171:2: ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER )
- alt20 = 3
- LA20_0 = self.input.LA(1)
+ # C.g:178:2: ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER )
+ alt21 = 3
+ LA21_0 = self.input.LA(1)
- if (LA20_0 == 46) :
- LA20_1 = self.input.LA(2)
+ if (LA21_0 == 46) :
+ LA21_1 = self.input.LA(2)
- if (LA20_1 == IDENTIFIER) :
- LA20_2 = self.input.LA(3)
+ if (LA21_1 == IDENTIFIER) :
+ LA21_2 = self.input.LA(3)
- if (LA20_2 == 41) :
- alt20 = 2
- elif (LA20_2 == EOF or LA20_2 == IDENTIFIER or LA20_2 == 25 or (28 <= LA20_2 <= 40) or (43 <= LA20_2 <= 53) or LA20_2 == 55) :
- alt20 = 3
+ if (LA21_2 == 41) :
+ alt21 = 2
+ 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) :
+ alt21 = 3
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("169:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 20, 2, self.input)
+ nvae = NoViableAltException("176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 21, 2, self.input)
raise nvae
- elif (LA20_1 == 41) :
- alt20 = 1
+ elif (LA21_1 == 41) :
+ alt21 = 1
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("169:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 20, 1, self.input)
+ nvae = NoViableAltException("176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 21, 1, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("169:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 20, 0, self.input)
+ nvae = NoViableAltException("176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 21, 0, self.input)
raise nvae
- if alt20 == 1:
- # C.g:171:4: 'enum' '{' enumerator_list '}'
- self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier618)
+ if alt21 == 1:
+ # C.g:178:4: 'enum' '{' enumerator_list '}'
+ self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier609)
if self.failed:
- return
- self.match(self.input, 41, self.FOLLOW_41_in_enum_specifier620)
+ return retval
+ self.match(self.input, 41, self.FOLLOW_41_in_enum_specifier611)
if self.failed:
- return
- self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier622)
+ return retval
+ self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier613)
self.enumerator_list()
self.following.pop()
if self.failed:
- return
- self.match(self.input, 42, self.FOLLOW_42_in_enum_specifier624)
+ return retval
+ self.match(self.input, 42, self.FOLLOW_42_in_enum_specifier615)
if self.failed:
- return
+ return retval
- elif alt20 == 2:
- # C.g:172:4: 'enum' IDENTIFIER '{' enumerator_list '}'
- self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier629)
+ elif alt21 == 2:
+ # C.g:179:4: 'enum' IDENTIFIER '{' enumerator_list '}'
+ self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier620)
if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier631)
+ return retval
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier622)
if self.failed:
- return
- self.match(self.input, 41, self.FOLLOW_41_in_enum_specifier633)
+ return retval
+ self.match(self.input, 41, self.FOLLOW_41_in_enum_specifier624)
if self.failed:
- return
- self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier635)
+ return retval
+ self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier626)
self.enumerator_list()
self.following.pop()
if self.failed:
- return
- self.match(self.input, 42, self.FOLLOW_42_in_enum_specifier637)
+ return retval
+ self.match(self.input, 42, self.FOLLOW_42_in_enum_specifier628)
if self.failed:
- return
+ return retval
- elif alt20 == 3:
- # C.g:173:4: 'enum' IDENTIFIER
- self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier642)
+ elif alt21 == 3:
+ # C.g:180:4: 'enum' IDENTIFIER
+ self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier633)
if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier644)
+ return retval
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier635)
if self.failed:
- return
+ return retval
+ retval.stop = self.input.LT(-1)
+
except RecognitionException, re:
self.reportError(re)
pass
- return
+ return retval
# $ANTLR end enum_specifier
# $ANTLR start enumerator_list
- # C.g:176:1: enumerator_list : enumerator ( ',' enumerator )* ;
+ # C.g:183:1: enumerator_list : enumerator ( ',' enumerator )* ;
def enumerator_list(self, ):
enumerator_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 19):
return
- # C.g:177:2: ( enumerator ( ',' enumerator )* )
- # C.g:177:4: enumerator ( ',' enumerator )*
- self.following.append(self.FOLLOW_enumerator_in_enumerator_list655)
+ # C.g:184:2: ( enumerator ( ',' enumerator )* )
+ # C.g:184:4: enumerator ( ',' enumerator )*
+ self.following.append(self.FOLLOW_enumerator_in_enumerator_list646)
self.enumerator()
self.following.pop()
if self.failed:
return
- # C.g:177:15: ( ',' enumerator )*
- while True: #loop21
- alt21 = 2
- LA21_0 = self.input.LA(1)
+ # C.g:184:15: ( ',' enumerator )*
+ while True: #loop22
+ alt22 = 2
+ LA22_0 = self.input.LA(1)
- if (LA21_0 == 26) :
- alt21 = 1
+ if (LA22_0 == 26) :
+ alt22 = 1
- if alt21 == 1:
- # C.g:177:16: ',' enumerator
- self.match(self.input, 26, self.FOLLOW_26_in_enumerator_list658)
+ if alt22 == 1:
+ # C.g:184:16: ',' enumerator
+ self.match(self.input, 26, self.FOLLOW_26_in_enumerator_list649)
if self.failed:
return
- self.following.append(self.FOLLOW_enumerator_in_enumerator_list660)
+ self.following.append(self.FOLLOW_enumerator_in_enumerator_list651)
self.enumerator()
self.following.pop()
if self.failed:
else:
- break #loop21
+ break #loop22
# $ANTLR start enumerator
- # C.g:180:1: enumerator : IDENTIFIER ( '=' constant_expression )? ;
+ # C.g:187:1: enumerator : IDENTIFIER ( '=' constant_expression )? ;
def enumerator(self, ):
enumerator_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 20):
return
- # C.g:181:2: ( IDENTIFIER ( '=' constant_expression )? )
- # C.g:181:4: IDENTIFIER ( '=' constant_expression )?
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enumerator673)
+ # C.g:188:2: ( IDENTIFIER ( '=' constant_expression )? )
+ # C.g:188:4: IDENTIFIER ( '=' constant_expression )?
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enumerator664)
if self.failed:
return
- # C.g:181:15: ( '=' constant_expression )?
- alt22 = 2
- LA22_0 = self.input.LA(1)
+ # C.g:188:15: ( '=' constant_expression )?
+ alt23 = 2
+ LA23_0 = self.input.LA(1)
- if (LA22_0 == 27) :
- alt22 = 1
- if alt22 == 1:
- # C.g:181:16: '=' constant_expression
- self.match(self.input, 27, self.FOLLOW_27_in_enumerator676)
+ if (LA23_0 == 27) :
+ alt23 = 1
+ if alt23 == 1:
+ # C.g:188:16: '=' constant_expression
+ self.match(self.input, 27, self.FOLLOW_27_in_enumerator667)
if self.failed:
return
- self.following.append(self.FOLLOW_constant_expression_in_enumerator678)
+ self.following.append(self.FOLLOW_constant_expression_in_enumerator669)
self.constant_expression()
self.following.pop()
if self.failed:
# $ANTLR start type_qualifier
- # C.g:184:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' );
+ # C.g:191:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' );
def type_qualifier(self, ):
type_qualifier_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 21):
return
- # C.g:185:2: ( 'const' | 'volatile' | 'IN' | 'OUT' )
+ # C.g:192:2: ( 'const' | 'volatile' | 'IN' | 'OUT' )
# C.g:
if (47 <= self.input.LA(1) <= 50):
self.input.consume();
# $ANTLR start declarator
- # C.g:191:1: declarator : ( ( pointer )? direct_declarator | pointer );
+ # C.g:198:1: declarator : ( ( pointer )? direct_declarator | pointer );
def declarator(self, ):
retval = self.declarator_return()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 22):
return retval
- # C.g:192:2: ( ( pointer )? direct_declarator | pointer )
- alt24 = 2
- LA24_0 = self.input.LA(1)
+ # C.g:199:2: ( ( pointer )? direct_declarator | pointer )
+ alt25 = 2
+ LA25_0 = self.input.LA(1)
- if (LA24_0 == 55) :
- LA24_1 = self.input.LA(2)
+ if (LA25_0 == 55) :
+ LA25_1 = self.input.LA(2)
- if (self.synpred49()) :
- alt24 = 1
+ if (self.synpred50()) :
+ alt25 = 1
elif (True) :
- alt24 = 2
+ alt25 = 2
else:
if self.backtracking > 0:
self.failed = True
return retval
- nvae = NoViableAltException("191:1: declarator : ( ( pointer )? direct_declarator | pointer );", 24, 1, self.input)
+ nvae = NoViableAltException("198:1: declarator : ( ( pointer )? direct_declarator | pointer );", 25, 1, self.input)
raise nvae
- elif (LA24_0 == IDENTIFIER or LA24_0 == 51) :
- alt24 = 1
+ elif (LA25_0 == IDENTIFIER or LA25_0 == 51) :
+ alt25 = 1
else:
if self.backtracking > 0:
self.failed = True
return retval
- nvae = NoViableAltException("191:1: declarator : ( ( pointer )? direct_declarator | pointer );", 24, 0, self.input)
+ nvae = NoViableAltException("198:1: declarator : ( ( pointer )? direct_declarator | pointer );", 25, 0, self.input)
raise nvae
- if alt24 == 1:
- # C.g:192:4: ( pointer )? direct_declarator
- # C.g:192:4: ( pointer )?
- alt23 = 2
- LA23_0 = self.input.LA(1)
+ if alt25 == 1:
+ # C.g:199:4: ( pointer )? direct_declarator
+ # C.g:199:4: ( pointer )?
+ alt24 = 2
+ LA24_0 = self.input.LA(1)
- if (LA23_0 == 55) :
- alt23 = 1
- if alt23 == 1:
+ if (LA24_0 == 55) :
+ alt24 = 1
+ if alt24 == 1:
# C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_declarator717)
+ self.following.append(self.FOLLOW_pointer_in_declarator708)
self.pointer()
self.following.pop()
if self.failed:
- self.following.append(self.FOLLOW_direct_declarator_in_declarator720)
+ self.following.append(self.FOLLOW_direct_declarator_in_declarator711)
self.direct_declarator()
self.following.pop()
if self.failed:
return retval
- elif alt24 == 2:
- # C.g:193:4: pointer
- self.following.append(self.FOLLOW_pointer_in_declarator725)
+ elif alt25 == 2:
+ # C.g:200:4: pointer
+ self.following.append(self.FOLLOW_pointer_in_declarator716)
self.pointer()
self.following.pop()
if self.failed:
# $ANTLR start direct_declarator
- # C.g:196:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ );
+ # C.g:203:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ );
def direct_declarator(self, ):
- self.Symbols_stack.append(Symbols_scope())
direct_declarator_StartIndex = self.input.index()
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 23):
return
- # C.g:198:2: ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ )
- alt27 = 2
- LA27_0 = self.input.LA(1)
+ # C.g:204:2: ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ )
+ alt28 = 2
+ LA28_0 = self.input.LA(1)
- if (LA27_0 == IDENTIFIER) :
- alt27 = 1
- elif (LA27_0 == 51) :
- alt27 = 2
+ if (LA28_0 == IDENTIFIER) :
+ alt28 = 1
+ elif (LA28_0 == 51) :
+ alt28 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("196:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ );", 27, 0, self.input)
+ nvae = NoViableAltException("203:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ );", 28, 0, self.input)
raise nvae
- if alt27 == 1:
- # C.g:198:4: IDENTIFIER ( declarator_suffix )*
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_direct_declarator741)
+ if alt28 == 1:
+ # C.g:204:4: IDENTIFIER ( declarator_suffix )*
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_direct_declarator727)
if self.failed:
return
- # C.g:198:15: ( declarator_suffix )*
- while True: #loop25
- alt25 = 2
- LA25_0 = self.input.LA(1)
+ # C.g:204:15: ( declarator_suffix )*
+ while True: #loop26
+ alt26 = 2
+ LA26_0 = self.input.LA(1)
- if (LA25_0 == 51) :
- LA25 = self.input.LA(2)
- if LA25 == 52:
- LA25_26 = self.input.LA(3)
+ if (LA26_0 == 51) :
+ LA26 = self.input.LA(2)
+ if LA26 == 52:
+ LA26_26 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == IDENTIFIER:
- LA25_27 = self.input.LA(3)
+ elif LA26 == 28 or LA26 == 29 or LA26 == 30 or LA26 == 31:
+ LA26_30 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 28 or LA25 == 29 or LA25 == 30 or LA25 == 31:
- LA25_28 = self.input.LA(3)
+ elif LA26 == 32:
+ LA26_31 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 32:
- LA25_29 = self.input.LA(3)
+ elif LA26 == 33:
+ LA26_32 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 33:
- LA25_30 = self.input.LA(3)
+ elif LA26 == 34:
+ LA26_33 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 34:
- LA25_31 = self.input.LA(3)
+ elif LA26 == 35:
+ LA26_34 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 35:
- LA25_32 = self.input.LA(3)
+ elif LA26 == 36:
+ LA26_35 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 36:
- LA25_33 = self.input.LA(3)
+ elif LA26 == 37:
+ LA26_36 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 37:
- LA25_34 = self.input.LA(3)
+ elif LA26 == 38:
+ LA26_37 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 38:
- LA25_35 = self.input.LA(3)
+ elif LA26 == 39:
+ LA26_38 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 39:
- LA25_36 = self.input.LA(3)
+ elif LA26 == 40:
+ LA26_39 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 40:
- LA25_37 = self.input.LA(3)
+ elif LA26 == 43 or LA26 == 44:
+ LA26_40 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 43 or LA25 == 44:
- LA25_38 = self.input.LA(3)
+ elif LA26 == 46:
+ LA26_41 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 46:
- LA25_39 = self.input.LA(3)
+ elif LA26 == IDENTIFIER:
+ LA26_42 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 47 or LA25 == 48 or LA25 == 49 or LA25 == 50:
- LA25_40 = self.input.LA(3)
+ elif LA26 == 47 or LA26 == 48 or LA26 == 49 or LA26 == 50:
+ LA26_43 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif (LA25_0 == 53) :
- LA25 = self.input.LA(2)
- if LA25 == 54:
- LA25_44 = self.input.LA(3)
+ elif (LA26_0 == 53) :
+ LA26 = self.input.LA(2)
+ if LA26 == 54:
+ LA26_44 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 51:
- LA25_45 = self.input.LA(3)
+ elif LA26 == 51:
+ LA26_45 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == IDENTIFIER:
- LA25_46 = self.input.LA(3)
+ elif LA26 == IDENTIFIER:
+ LA26_46 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == HEX_LITERAL or LA25 == OCTAL_LITERAL or LA25 == DECIMAL_LITERAL or LA25 == CHARACTER_LITERAL or LA25 == STRING_LITERAL or LA25 == FLOATING_POINT_LITERAL:
- LA25_47 = self.input.LA(3)
+ 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:
+ LA26_47 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 61:
- LA25_48 = self.input.LA(3)
+ elif LA26 == 61:
+ LA26_48 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 62:
- LA25_49 = self.input.LA(3)
+ elif LA26 == 62:
+ LA26_49 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 55 or LA25 == 57 or LA25 == 58 or LA25 == 66 or LA25 == 67 or LA25 == 68:
- LA25_50 = self.input.LA(3)
+ elif LA26 == 55 or LA26 == 57 or LA26 == 58 or LA26 == 66 or LA26 == 67 or LA26 == 68:
+ LA26_50 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 63:
- LA25_51 = self.input.LA(3)
+ elif LA26 == 63:
+ LA26_51 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- if alt25 == 1:
+ if alt26 == 1:
# C.g:0:0: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator743)
+ self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator729)
self.declarator_suffix()
self.following.pop()
if self.failed:
else:
- break #loop25
+ break #loop26
- elif alt27 == 2:
- # C.g:200:4: '(' declarator ')' ( declarator_suffix )+
- self.match(self.input, 51, self.FOLLOW_51_in_direct_declarator753)
+ elif alt28 == 2:
+ # C.g:205:4: '(' declarator ')' ( declarator_suffix )+
+ self.match(self.input, 51, self.FOLLOW_51_in_direct_declarator735)
if self.failed:
return
- self.following.append(self.FOLLOW_declarator_in_direct_declarator755)
+ self.following.append(self.FOLLOW_declarator_in_direct_declarator737)
self.declarator()
self.following.pop()
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_direct_declarator757)
+ self.match(self.input, 52, self.FOLLOW_52_in_direct_declarator739)
if self.failed:
- return
- # C.g:200:23: ( declarator_suffix )+
- cnt26 = 0
- while True: #loop26
- alt26 = 2
- LA26_0 = self.input.LA(1)
-
- if (LA26_0 == 51) :
- LA26 = self.input.LA(2)
- if LA26 == 52:
- LA26_26 = self.input.LA(3)
+ return
+ # C.g:205:23: ( declarator_suffix )+
+ cnt27 = 0
+ while True: #loop27
+ alt27 = 2
+ LA27_0 = self.input.LA(1)
- if (self.synpred52()) :
- alt26 = 1
+ if (LA27_0 == 51) :
+ LA27 = self.input.LA(2)
+ if LA27 == 52:
+ LA27_26 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 28 or LA26 == 29 or LA26 == 30 or LA26 == 31:
- LA26_27 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 28 or LA27 == 29 or LA27 == 30 or LA27 == 31:
+ LA27_30 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 32:
- LA26_28 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 32:
+ LA27_31 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 33:
- LA26_29 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 33:
+ LA27_32 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 34:
- LA26_30 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 34:
+ LA27_33 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 35:
- LA26_31 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 35:
+ LA27_34 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 36:
- LA26_32 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 36:
+ LA27_35 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 37:
- LA26_33 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 37:
+ LA27_36 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 38:
- LA26_34 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 38:
+ LA27_37 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 39:
- LA26_35 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 39:
+ LA27_38 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 40:
- LA26_36 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 40:
+ LA27_39 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 43 or LA26 == 44:
- LA26_37 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 43 or LA27 == 44:
+ LA27_40 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 46:
- LA26_38 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 46:
+ LA27_41 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == IDENTIFIER:
- LA26_39 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == IDENTIFIER:
+ LA27_42 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 47 or LA26 == 48 or LA26 == 49 or LA26 == 50:
- LA26_40 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 47 or LA27 == 48 or LA27 == 49 or LA27 == 50:
+ LA27_43 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif (LA26_0 == 53) :
- LA26 = self.input.LA(2)
- if LA26 == 54:
- LA26_44 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif (LA27_0 == 53) :
+ LA27 = self.input.LA(2)
+ if LA27 == 54:
+ LA27_44 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 51:
- LA26_45 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 51:
+ LA27_45 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == IDENTIFIER:
- LA26_46 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == IDENTIFIER:
+ LA27_46 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- 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:
- LA26_47 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ 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:
+ LA27_47 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 61:
- LA26_48 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 61:
+ LA27_48 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 62:
- LA26_49 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 62:
+ LA27_49 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 55 or LA26 == 57 or LA26 == 58 or LA26 == 66 or LA26 == 67 or LA26 == 68:
- LA26_50 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 55 or LA27 == 57 or LA27 == 58 or LA27 == 66 or LA27 == 67 or LA27 == 68:
+ LA27_50 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 63:
- LA26_51 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 63:
+ LA27_51 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- if alt26 == 1:
+
+ if alt27 == 1:
# C.g:0:0: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator759)
+ self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator741)
self.declarator_suffix()
self.following.pop()
if self.failed:
else:
- if cnt26 >= 1:
- break #loop26
+ if cnt27 >= 1:
+ break #loop27
if self.backtracking > 0:
self.failed = True
return
- eee = EarlyExitException(26, self.input)
+ eee = EarlyExitException(27, self.input)
raise eee
- cnt26 += 1
+ cnt27 += 1
if self.backtracking > 0:
self.memoize(self.input, 23, direct_declarator_StartIndex)
- self.Symbols_stack.pop()
-
pass
return
# $ANTLR start declarator_suffix
- # C.g:203:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );
+ # C.g:208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );
def declarator_suffix(self, ):
declarator_suffix_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 24):
return
- # C.g:204:2: ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' )
- alt28 = 5
- LA28_0 = self.input.LA(1)
+ # C.g:209:2: ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' )
+ alt29 = 5
+ LA29_0 = self.input.LA(1)
- if (LA28_0 == 53) :
- LA28_1 = self.input.LA(2)
+ if (LA29_0 == 53) :
+ LA29_1 = self.input.LA(2)
- if (LA28_1 == 54) :
- alt28 = 2
- elif ((IDENTIFIER <= LA28_1 <= FLOATING_POINT_LITERAL) or LA28_1 == 51 or LA28_1 == 55 or (57 <= LA28_1 <= 58) or (61 <= LA28_1 <= 63) or (66 <= LA28_1 <= 68)) :
- alt28 = 1
+ if (LA29_1 == 54) :
+ alt29 = 2
+ 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)) :
+ alt29 = 1
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("203:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 28, 1, self.input)
+ nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 1, self.input)
raise nvae
- elif (LA28_0 == 51) :
- LA28 = self.input.LA(2)
- if LA28 == 52:
- alt28 = 5
- elif LA28 == 28 or LA28 == 29 or LA28 == 30 or LA28 == 31 or LA28 == 32 or LA28 == 33 or LA28 == 34 or LA28 == 35 or LA28 == 36 or LA28 == 37 or LA28 == 38 or LA28 == 39 or LA28 == 40 or LA28 == 43 or LA28 == 44 or LA28 == 46 or LA28 == 47 or LA28 == 48 or LA28 == 49 or LA28 == 50:
- alt28 = 3
- elif LA28 == IDENTIFIER:
- LA28_24 = self.input.LA(3)
-
- if (self.synpred55()) :
- alt28 = 3
- elif (self.synpred56()) :
- alt28 = 4
+ elif (LA29_0 == 51) :
+ LA29 = self.input.LA(2)
+ if LA29 == 52:
+ alt29 = 5
+ elif LA29 == IDENTIFIER:
+ LA29_12 = self.input.LA(3)
+
+ if (self.synpred56()) :
+ alt29 = 3
+ elif (self.synpred57()) :
+ alt29 = 4
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("203:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 28, 24, self.input)
+ nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 12, self.input)
raise nvae
+ 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:
+ alt29 = 3
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("203:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 28, 2, self.input)
+ nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 2, self.input)
raise nvae
self.failed = True
return
- nvae = NoViableAltException("203:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 28, 0, self.input)
+ nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 0, self.input)
raise nvae
- if alt28 == 1:
- # C.g:204:6: '[' constant_expression ']'
- self.match(self.input, 53, self.FOLLOW_53_in_declarator_suffix773)
+ if alt29 == 1:
+ # C.g:209:6: '[' constant_expression ']'
+ self.match(self.input, 53, self.FOLLOW_53_in_declarator_suffix755)
if self.failed:
return
- self.following.append(self.FOLLOW_constant_expression_in_declarator_suffix775)
+ self.following.append(self.FOLLOW_constant_expression_in_declarator_suffix757)
self.constant_expression()
self.following.pop()
if self.failed:
return
- self.match(self.input, 54, self.FOLLOW_54_in_declarator_suffix777)
+ self.match(self.input, 54, self.FOLLOW_54_in_declarator_suffix759)
if self.failed:
return
- elif alt28 == 2:
- # C.g:205:9: '[' ']'
- self.match(self.input, 53, self.FOLLOW_53_in_declarator_suffix787)
+ elif alt29 == 2:
+ # C.g:210:9: '[' ']'
+ self.match(self.input, 53, self.FOLLOW_53_in_declarator_suffix769)
if self.failed:
return
- self.match(self.input, 54, self.FOLLOW_54_in_declarator_suffix789)
+ self.match(self.input, 54, self.FOLLOW_54_in_declarator_suffix771)
if self.failed:
return
- elif alt28 == 3:
- # C.g:206:9: '(' parameter_type_list ')'
- self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix799)
+ elif alt29 == 3:
+ # C.g:211:9: '(' parameter_type_list ')'
+ self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix781)
if self.failed:
return
- self.following.append(self.FOLLOW_parameter_type_list_in_declarator_suffix801)
+ self.following.append(self.FOLLOW_parameter_type_list_in_declarator_suffix783)
self.parameter_type_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix803)
+ self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix785)
if self.failed:
return
- elif alt28 == 4:
- # C.g:207:9: '(' identifier_list ')'
- self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix813)
+ elif alt29 == 4:
+ # C.g:212:9: '(' identifier_list ')'
+ self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix795)
if self.failed:
return
- self.following.append(self.FOLLOW_identifier_list_in_declarator_suffix815)
+ self.following.append(self.FOLLOW_identifier_list_in_declarator_suffix797)
self.identifier_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix817)
+ self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix799)
if self.failed:
return
- elif alt28 == 5:
- # C.g:208:9: '(' ')'
- self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix827)
+ elif alt29 == 5:
+ # C.g:213:9: '(' ')'
+ self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix809)
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix829)
+ self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix811)
if self.failed:
return
# $ANTLR start pointer
- # C.g:211:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );
+ # C.g:216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );
def pointer(self, ):
pointer_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 25):
return
- # C.g:212:2: ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' )
- alt31 = 3
- LA31_0 = self.input.LA(1)
+ # C.g:217:2: ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' )
+ alt32 = 3
+ LA32_0 = self.input.LA(1)
- if (LA31_0 == 55) :
- LA31 = self.input.LA(2)
- if LA31 == 55:
- LA31_2 = self.input.LA(3)
+ if (LA32_0 == 55) :
+ LA32 = self.input.LA(2)
+ if LA32 == 55:
+ LA32_2 = self.input.LA(3)
- if (self.synpred60()) :
- alt31 = 2
+ if (self.synpred61()) :
+ alt32 = 2
elif (True) :
- alt31 = 3
+ alt32 = 3
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("211:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 31, 2, self.input)
+ nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 2, self.input)
raise nvae
- elif LA31 == EOF or LA31 == IDENTIFIER or LA31 == 24 or LA31 == 25 or LA31 == 26 or LA31 == 27 or LA31 == 28 or LA31 == 29 or LA31 == 30 or LA31 == 31 or LA31 == 32 or LA31 == 33 or LA31 == 34 or LA31 == 35 or LA31 == 36 or LA31 == 37 or LA31 == 38 or LA31 == 39 or LA31 == 40 or LA31 == 41 or LA31 == 43 or LA31 == 44 or LA31 == 45 or LA31 == 46 or LA31 == 51 or LA31 == 52 or LA31 == 53:
- alt31 = 3
- elif LA31 == 47 or LA31 == 48 or LA31 == 49 or LA31 == 50:
- LA31_18 = self.input.LA(3)
+ 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:
+ alt32 = 3
+ elif LA32 == 47 or LA32 == 48 or LA32 == 49 or LA32 == 50:
+ LA32_18 = self.input.LA(3)
- if (self.synpred59()) :
- alt31 = 1
+ if (self.synpred60()) :
+ alt32 = 1
elif (True) :
- alt31 = 3
+ alt32 = 3
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("211:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 31, 18, self.input)
+ nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 18, self.input)
raise nvae
self.failed = True
return
- nvae = NoViableAltException("211:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 31, 1, self.input)
+ nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 1, self.input)
raise nvae
self.failed = True
return
- nvae = NoViableAltException("211:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 31, 0, self.input)
+ nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 0, self.input)
raise nvae
- if alt31 == 1:
- # C.g:212:4: '*' ( type_qualifier )+ ( pointer )?
- self.match(self.input, 55, self.FOLLOW_55_in_pointer840)
+ if alt32 == 1:
+ # C.g:217:4: '*' ( type_qualifier )+ ( pointer )?
+ self.match(self.input, 55, self.FOLLOW_55_in_pointer822)
if self.failed:
return
- # C.g:212:8: ( type_qualifier )+
- cnt29 = 0
- while True: #loop29
- alt29 = 2
- LA29_0 = self.input.LA(1)
+ # C.g:217:8: ( type_qualifier )+
+ cnt30 = 0
+ while True: #loop30
+ alt30 = 2
+ LA30_0 = self.input.LA(1)
- if ((47 <= LA29_0 <= 50)) :
- LA29_17 = self.input.LA(2)
+ if ((47 <= LA30_0 <= 50)) :
+ LA30_17 = self.input.LA(2)
- if (self.synpred57()) :
- alt29 = 1
+ if (self.synpred58()) :
+ alt30 = 1
- if alt29 == 1:
+ if alt30 == 1:
# C.g:0:0: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_pointer842)
+ self.following.append(self.FOLLOW_type_qualifier_in_pointer824)
self.type_qualifier()
self.following.pop()
if self.failed:
else:
- if cnt29 >= 1:
- break #loop29
+ if cnt30 >= 1:
+ break #loop30
if self.backtracking > 0:
self.failed = True
return
- eee = EarlyExitException(29, self.input)
+ eee = EarlyExitException(30, self.input)
raise eee
- cnt29 += 1
+ cnt30 += 1
- # C.g:212:24: ( pointer )?
- alt30 = 2
- LA30_0 = self.input.LA(1)
+ # C.g:217:24: ( pointer )?
+ alt31 = 2
+ LA31_0 = self.input.LA(1)
- if (LA30_0 == 55) :
- LA30_1 = self.input.LA(2)
+ if (LA31_0 == 55) :
+ LA31_1 = self.input.LA(2)
- if (self.synpred58()) :
- alt30 = 1
- if alt30 == 1:
+ if (self.synpred59()) :
+ alt31 = 1
+ if alt31 == 1:
# C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_pointer845)
+ self.following.append(self.FOLLOW_pointer_in_pointer827)
self.pointer()
self.following.pop()
if self.failed:
- elif alt31 == 2:
- # C.g:213:4: '*' pointer
- self.match(self.input, 55, self.FOLLOW_55_in_pointer851)
+ elif alt32 == 2:
+ # C.g:218:4: '*' pointer
+ self.match(self.input, 55, self.FOLLOW_55_in_pointer833)
if self.failed:
return
- self.following.append(self.FOLLOW_pointer_in_pointer853)
+ self.following.append(self.FOLLOW_pointer_in_pointer835)
self.pointer()
self.following.pop()
if self.failed:
return
- elif alt31 == 3:
- # C.g:214:4: s= '*'
+ elif alt32 == 3:
+ # C.g:219:4: s= '*'
s = self.input.LT(1)
- self.match(self.input, 55, self.FOLLOW_55_in_pointer860)
+ self.match(self.input, 55, self.FOLLOW_55_in_pointer842)
if self.failed:
return
# $ANTLR start parameter_type_list
- # C.g:217:1: parameter_type_list : parameter_list ( ',' '...' )? ;
+ # C.g:222:1: parameter_type_list : parameter_list ( ',' '...' )? ;
def parameter_type_list(self, ):
parameter_type_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 26):
return
- # C.g:218:2: ( parameter_list ( ',' '...' )? )
- # C.g:218:4: parameter_list ( ',' '...' )?
- self.following.append(self.FOLLOW_parameter_list_in_parameter_type_list871)
+ # C.g:223:2: ( parameter_list ( ',' '...' )? )
+ # C.g:223:4: parameter_list ( ',' '...' )?
+ self.following.append(self.FOLLOW_parameter_list_in_parameter_type_list853)
self.parameter_list()
self.following.pop()
if self.failed:
return
- # C.g:218:19: ( ',' '...' )?
- alt32 = 2
- LA32_0 = self.input.LA(1)
+ # C.g:223:19: ( ',' '...' )?
+ alt33 = 2
+ LA33_0 = self.input.LA(1)
- if (LA32_0 == 26) :
- alt32 = 1
- if alt32 == 1:
- # C.g:218:20: ',' '...'
- self.match(self.input, 26, self.FOLLOW_26_in_parameter_type_list874)
+ if (LA33_0 == 26) :
+ alt33 = 1
+ if alt33 == 1:
+ # C.g:223:20: ',' '...'
+ self.match(self.input, 26, self.FOLLOW_26_in_parameter_type_list856)
if self.failed:
return
- self.match(self.input, 56, self.FOLLOW_56_in_parameter_type_list876)
+ self.match(self.input, 56, self.FOLLOW_56_in_parameter_type_list858)
if self.failed:
return
# $ANTLR start parameter_list
- # C.g:221:1: parameter_list : parameter_declaration ( ',' parameter_declaration )* ;
+ # C.g:226:1: parameter_list : parameter_declaration ( ',' parameter_declaration )* ;
def parameter_list(self, ):
parameter_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 27):
return
- # C.g:222:2: ( parameter_declaration ( ',' parameter_declaration )* )
- # C.g:222:4: parameter_declaration ( ',' parameter_declaration )*
- self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list889)
+ # C.g:227:2: ( parameter_declaration ( ',' parameter_declaration )* )
+ # C.g:227:4: parameter_declaration ( ',' parameter_declaration )*
+ self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list871)
self.parameter_declaration()
self.following.pop()
if self.failed:
return
- # C.g:222:26: ( ',' parameter_declaration )*
- while True: #loop33
- alt33 = 2
- LA33_0 = self.input.LA(1)
+ # C.g:227:26: ( ',' parameter_declaration )*
+ while True: #loop34
+ alt34 = 2
+ LA34_0 = self.input.LA(1)
- if (LA33_0 == 26) :
- LA33_1 = self.input.LA(2)
+ if (LA34_0 == 26) :
+ LA34_1 = self.input.LA(2)
- if (LA33_1 == IDENTIFIER or (28 <= LA33_1 <= 40) or (43 <= LA33_1 <= 44) or (46 <= LA33_1 <= 50)) :
- alt33 = 1
+ if (LA34_1 == IDENTIFIER or (28 <= LA34_1 <= 40) or (43 <= LA34_1 <= 44) or (46 <= LA34_1 <= 50)) :
+ alt34 = 1
- if alt33 == 1:
- # C.g:222:27: ',' parameter_declaration
- self.match(self.input, 26, self.FOLLOW_26_in_parameter_list892)
+ if alt34 == 1:
+ # C.g:227:27: ',' parameter_declaration
+ self.match(self.input, 26, self.FOLLOW_26_in_parameter_list874)
if self.failed:
return
- self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list894)
+ self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list876)
self.parameter_declaration()
self.following.pop()
if self.failed:
else:
- break #loop33
+ break #loop34
# $ANTLR start parameter_declaration
- # C.g:225:1: parameter_declaration : declaration_specifiers ( declarator | abstract_declarator )+ ;
+ # C.g:230:1: parameter_declaration : declaration_specifiers ( declarator | abstract_declarator )+ ;
def parameter_declaration(self, ):
parameter_declaration_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 28):
return
- # C.g:226:2: ( declaration_specifiers ( declarator | abstract_declarator )+ )
- # C.g:226:4: declaration_specifiers ( declarator | abstract_declarator )+
- self.following.append(self.FOLLOW_declaration_specifiers_in_parameter_declaration907)
+ # C.g:231:2: ( declaration_specifiers ( declarator | abstract_declarator )+ )
+ # C.g:231:4: declaration_specifiers ( declarator | abstract_declarator )+
+ self.following.append(self.FOLLOW_declaration_specifiers_in_parameter_declaration889)
self.declaration_specifiers()
self.following.pop()
if self.failed:
return
- # C.g:226:27: ( declarator | abstract_declarator )+
- cnt34 = 0
- while True: #loop34
- alt34 = 3
- LA34 = self.input.LA(1)
- if LA34 == 55:
- LA34_4 = self.input.LA(2)
+ # C.g:231:27: ( declarator | abstract_declarator )+
+ cnt35 = 0
+ while True: #loop35
+ alt35 = 3
+ LA35 = self.input.LA(1)
+ if LA35 == 55:
+ LA35_4 = self.input.LA(2)
- if (self.synpred63()) :
- alt34 = 1
- elif (self.synpred64()) :
- alt34 = 2
+ if (self.synpred64()) :
+ alt35 = 1
+ elif (self.synpred65()) :
+ alt35 = 2
- elif LA34 == IDENTIFIER:
- alt34 = 1
- elif LA34 == 51:
- LA34 = self.input.LA(2)
- if LA34 == 28 or LA34 == 29 or LA34 == 30 or LA34 == 31 or LA34 == 32 or LA34 == 33 or LA34 == 34 or LA34 == 35 or LA34 == 36 or LA34 == 37 or LA34 == 38 or LA34 == 39 or LA34 == 40 or LA34 == 43 or LA34 == 44 or LA34 == 46 or LA34 == 47 or LA34 == 48 or LA34 == 49 or LA34 == 50 or LA34 == 52 or LA34 == 53:
- alt34 = 2
- elif LA34 == IDENTIFIER:
- LA34_29 = self.input.LA(3)
+ elif LA35 == IDENTIFIER:
+ alt35 = 1
+ elif LA35 == 51:
+ LA35 = self.input.LA(2)
+ 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:
+ alt35 = 2
+ elif LA35 == 55:
+ LA35_17 = self.input.LA(3)
- if (self.synpred63()) :
- alt34 = 1
- elif (self.synpred64()) :
- alt34 = 2
+ if (self.synpred64()) :
+ alt35 = 1
+ elif (self.synpred65()) :
+ alt35 = 2
- elif LA34 == 55:
- LA34_31 = self.input.LA(3)
+ elif LA35 == 51:
+ LA35_18 = self.input.LA(3)
- if (self.synpred63()) :
- alt34 = 1
- elif (self.synpred64()) :
- alt34 = 2
+ if (self.synpred64()) :
+ alt35 = 1
+ elif (self.synpred65()) :
+ alt35 = 2
- elif LA34 == 51:
- LA34_32 = self.input.LA(3)
+ elif LA35 == IDENTIFIER:
+ LA35_32 = self.input.LA(3)
- if (self.synpred63()) :
- alt34 = 1
- elif (self.synpred64()) :
- alt34 = 2
+ if (self.synpred64()) :
+ alt35 = 1
+ elif (self.synpred65()) :
+ alt35 = 2
- elif LA34 == 53:
- alt34 = 2
+ elif LA35 == 53:
+ alt35 = 2
- if alt34 == 1:
- # C.g:226:28: declarator
- self.following.append(self.FOLLOW_declarator_in_parameter_declaration910)
+ if alt35 == 1:
+ # C.g:231:28: declarator
+ self.following.append(self.FOLLOW_declarator_in_parameter_declaration892)
self.declarator()
self.following.pop()
if self.failed:
return
- elif alt34 == 2:
- # C.g:226:39: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_parameter_declaration912)
+ elif alt35 == 2:
+ # C.g:231:39: abstract_declarator
+ self.following.append(self.FOLLOW_abstract_declarator_in_parameter_declaration894)
self.abstract_declarator()
self.following.pop()
if self.failed:
else:
- if cnt34 >= 1:
- break #loop34
+ if cnt35 >= 1:
+ break #loop35
if self.backtracking > 0:
self.failed = True
return
- eee = EarlyExitException(34, self.input)
+ eee = EarlyExitException(35, self.input)
raise eee
- cnt34 += 1
+ cnt35 += 1
# $ANTLR start identifier_list
- # C.g:229:1: identifier_list : i= IDENTIFIER ( ',' d= IDENTIFIER )* ;
+ # C.g:234:1: identifier_list : IDENTIFIER ( ',' IDENTIFIER )* ;
def identifier_list(self, ):
identifier_list_StartIndex = self.input.index()
- i = None
- d = None
-
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 29):
return
- # C.g:230:2: (i= IDENTIFIER ( ',' d= IDENTIFIER )* )
- # C.g:230:4: i= IDENTIFIER ( ',' d= IDENTIFIER )*
- i = self.input.LT(1)
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list927)
+ # C.g:235:2: ( IDENTIFIER ( ',' IDENTIFIER )* )
+ # C.g:235:4: IDENTIFIER ( ',' IDENTIFIER )*
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list907)
if self.failed:
return
- # C.g:231:2: ( ',' d= IDENTIFIER )*
- while True: #loop35
- alt35 = 2
- LA35_0 = self.input.LA(1)
+ # C.g:236:2: ( ',' IDENTIFIER )*
+ while True: #loop36
+ alt36 = 2
+ LA36_0 = self.input.LA(1)
- if (LA35_0 == 26) :
- alt35 = 1
+ if (LA36_0 == 26) :
+ alt36 = 1
- if alt35 == 1:
- # C.g:231:3: ',' d= IDENTIFIER
- self.match(self.input, 26, self.FOLLOW_26_in_identifier_list932)
+ if alt36 == 1:
+ # C.g:236:3: ',' IDENTIFIER
+ self.match(self.input, 26, self.FOLLOW_26_in_identifier_list911)
if self.failed:
return
- d = self.input.LT(1)
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list936)
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list913)
if self.failed:
return
else:
- break #loop35
+ break #loop36
# $ANTLR start type_name
- # C.g:234:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );
+ # C.g:239:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );
def type_name(self, ):
type_name_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 30):
return
- # C.g:235:2: ( specifier_qualifier_list ( abstract_declarator )? | type_id )
- alt37 = 2
- LA37_0 = self.input.LA(1)
+ # C.g:240:2: ( specifier_qualifier_list ( abstract_declarator )? | type_id )
+ alt38 = 2
+ LA38_0 = self.input.LA(1)
- if ((32 <= LA37_0 <= 40) or (43 <= LA37_0 <= 44) or (46 <= LA37_0 <= 50)) :
- alt37 = 1
- elif (LA37_0 == IDENTIFIER) :
- LA37_13 = self.input.LA(2)
+ if ((32 <= LA38_0 <= 40) or (43 <= LA38_0 <= 44) or (46 <= LA38_0 <= 50)) :
+ alt38 = 1
+ elif (LA38_0 == IDENTIFIER) :
+ LA38_13 = self.input.LA(2)
- if (self.synpred67()) :
- alt37 = 1
+ if (self.synpred68()) :
+ alt38 = 1
elif (True) :
- alt37 = 2
+ alt38 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("234:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 37, 13, self.input)
+ nvae = NoViableAltException("239:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 38, 13, self.input)
raise nvae
self.failed = True
return
- nvae = NoViableAltException("234:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 37, 0, self.input)
+ nvae = NoViableAltException("239:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 38, 0, self.input)
raise nvae
- if alt37 == 1:
- # C.g:235:4: specifier_qualifier_list ( abstract_declarator )?
- self.following.append(self.FOLLOW_specifier_qualifier_list_in_type_name951)
+ if alt38 == 1:
+ # C.g:240:4: specifier_qualifier_list ( abstract_declarator )?
+ self.following.append(self.FOLLOW_specifier_qualifier_list_in_type_name926)
self.specifier_qualifier_list()
self.following.pop()
if self.failed:
return
- # C.g:235:29: ( abstract_declarator )?
- alt36 = 2
- LA36_0 = self.input.LA(1)
+ # C.g:240:29: ( abstract_declarator )?
+ alt37 = 2
+ LA37_0 = self.input.LA(1)
- if (LA36_0 == 51 or LA36_0 == 53 or LA36_0 == 55) :
- alt36 = 1
- if alt36 == 1:
+ if (LA37_0 == 51 or LA37_0 == 53 or LA37_0 == 55) :
+ alt37 = 1
+ if alt37 == 1:
# C.g:0:0: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_type_name953)
+ self.following.append(self.FOLLOW_abstract_declarator_in_type_name928)
self.abstract_declarator()
self.following.pop()
if self.failed:
- elif alt37 == 2:
- # C.g:236:4: type_id
- self.following.append(self.FOLLOW_type_id_in_type_name959)
+ elif alt38 == 2:
+ # C.g:241:4: type_id
+ self.following.append(self.FOLLOW_type_id_in_type_name934)
self.type_id()
self.following.pop()
if self.failed:
# $ANTLR start abstract_declarator
- # C.g:239:1: abstract_declarator : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator );
+ # C.g:244:1: abstract_declarator : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator );
def abstract_declarator(self, ):
abstract_declarator_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 31):
return
- # C.g:240:2: ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator )
- alt39 = 2
- LA39_0 = self.input.LA(1)
+ # C.g:245:2: ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator )
+ alt40 = 2
+ LA40_0 = self.input.LA(1)
- if (LA39_0 == 55) :
- alt39 = 1
- elif (LA39_0 == 51 or LA39_0 == 53) :
- alt39 = 2
+ if (LA40_0 == 55) :
+ alt40 = 1
+ elif (LA40_0 == 51 or LA40_0 == 53) :
+ alt40 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("239:1: abstract_declarator : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator );", 39, 0, self.input)
+ nvae = NoViableAltException("244:1: abstract_declarator : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator );", 40, 0, self.input)
raise nvae
- if alt39 == 1:
- # C.g:240:4: pointer ( direct_abstract_declarator )?
- self.following.append(self.FOLLOW_pointer_in_abstract_declarator970)
+ if alt40 == 1:
+ # C.g:245:4: pointer ( direct_abstract_declarator )?
+ self.following.append(self.FOLLOW_pointer_in_abstract_declarator945)
self.pointer()
self.following.pop()
if self.failed:
return
- # C.g:240:12: ( direct_abstract_declarator )?
- alt38 = 2
- LA38_0 = self.input.LA(1)
-
- if (LA38_0 == 51) :
- LA38 = self.input.LA(2)
- if LA38 == 52:
- LA38_8 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 28 or LA38 == 29 or LA38 == 30 or LA38 == 31:
- LA38_9 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 32:
- LA38_10 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 33:
- LA38_11 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 34:
- LA38_12 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 35:
- LA38_13 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 36:
- LA38_14 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 37:
- LA38_15 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 38:
- LA38_16 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 39:
- LA38_17 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 40:
- LA38_18 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 43 or LA38 == 44:
- LA38_19 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 46:
- LA38_20 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == IDENTIFIER:
- LA38_21 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 47 or LA38 == 48 or LA38 == 49 or LA38 == 50:
- LA38_22 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 55:
- LA38_23 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 51:
- LA38_24 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 53:
- LA38_25 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif (LA38_0 == 53) :
- LA38 = self.input.LA(2)
- if LA38 == 54:
- LA38_26 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 51:
- LA38_27 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == IDENTIFIER:
- LA38_28 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == HEX_LITERAL or LA38 == OCTAL_LITERAL or LA38 == DECIMAL_LITERAL or LA38 == CHARACTER_LITERAL or LA38 == STRING_LITERAL or LA38 == FLOATING_POINT_LITERAL:
- LA38_29 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 61:
- LA38_30 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 62:
- LA38_31 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 55 or LA38 == 57 or LA38 == 58 or LA38 == 66 or LA38 == 67 or LA38 == 68:
- LA38_32 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- elif LA38 == 63:
- LA38_33 = self.input.LA(3)
-
- if (self.synpred68()) :
- alt38 = 1
- if alt38 == 1:
+ # C.g:245:12: ( direct_abstract_declarator )?
+ alt39 = 2
+ LA39_0 = self.input.LA(1)
+
+ if (LA39_0 == 51) :
+ LA39 = self.input.LA(2)
+ if LA39 == 52:
+ LA39_8 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 55:
+ LA39_9 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 51:
+ LA39_10 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 53:
+ LA39_11 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 28 or LA39 == 29 or LA39 == 30 or LA39 == 31:
+ LA39_12 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 32:
+ LA39_13 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 33:
+ LA39_14 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 34:
+ LA39_15 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 35:
+ LA39_16 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 36:
+ LA39_17 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 37:
+ LA39_18 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 38:
+ LA39_19 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 39:
+ LA39_20 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 40:
+ LA39_21 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 43 or LA39 == 44:
+ LA39_22 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 46:
+ LA39_23 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == IDENTIFIER:
+ LA39_24 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 47 or LA39 == 48 or LA39 == 49 or LA39 == 50:
+ LA39_25 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif (LA39_0 == 53) :
+ LA39 = self.input.LA(2)
+ if LA39 == 54:
+ LA39_26 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 51:
+ LA39_27 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == IDENTIFIER:
+ LA39_28 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == HEX_LITERAL or LA39 == OCTAL_LITERAL or LA39 == DECIMAL_LITERAL or LA39 == CHARACTER_LITERAL or LA39 == STRING_LITERAL or LA39 == FLOATING_POINT_LITERAL:
+ LA39_29 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 61:
+ LA39_30 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 62:
+ LA39_31 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 55 or LA39 == 57 or LA39 == 58 or LA39 == 66 or LA39 == 67 or LA39 == 68:
+ LA39_32 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ elif LA39 == 63:
+ LA39_33 = self.input.LA(3)
+
+ if (self.synpred69()) :
+ alt39 = 1
+ if alt39 == 1:
# C.g:0:0: direct_abstract_declarator
- self.following.append(self.FOLLOW_direct_abstract_declarator_in_abstract_declarator972)
+ self.following.append(self.FOLLOW_direct_abstract_declarator_in_abstract_declarator947)
self.direct_abstract_declarator()
self.following.pop()
if self.failed:
- elif alt39 == 2:
- # C.g:241:4: direct_abstract_declarator
- self.following.append(self.FOLLOW_direct_abstract_declarator_in_abstract_declarator978)
+ elif alt40 == 2:
+ # C.g:246:4: direct_abstract_declarator
+ self.following.append(self.FOLLOW_direct_abstract_declarator_in_abstract_declarator953)
self.direct_abstract_declarator()
self.following.pop()
if self.failed:
# $ANTLR start direct_abstract_declarator
- # C.g:244:1: direct_abstract_declarator : ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* ;
+ # C.g:249:1: direct_abstract_declarator : ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* ;
def direct_abstract_declarator(self, ):
direct_abstract_declarator_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 32):
return
- # C.g:245:2: ( ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* )
- # C.g:245:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )*
- # C.g:245:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )
- alt40 = 2
- LA40_0 = self.input.LA(1)
+ # C.g:250:2: ( ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* )
+ # C.g:250:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )*
+ # C.g:250:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )
+ alt41 = 2
+ LA41_0 = self.input.LA(1)
- if (LA40_0 == 51) :
- LA40_1 = self.input.LA(2)
+ if (LA41_0 == 51) :
+ LA41_1 = self.input.LA(2)
- if (LA40_1 == IDENTIFIER or (28 <= LA40_1 <= 40) or (43 <= LA40_1 <= 44) or (46 <= LA40_1 <= 50) or LA40_1 == 52) :
- alt40 = 2
- elif (LA40_1 == 51 or LA40_1 == 53 or LA40_1 == 55) :
- alt40 = 1
+ if (LA41_1 == IDENTIFIER or (28 <= LA41_1 <= 40) or (43 <= LA41_1 <= 44) or (46 <= LA41_1 <= 50) or LA41_1 == 52) :
+ alt41 = 2
+ elif (LA41_1 == 51 or LA41_1 == 53 or LA41_1 == 55) :
+ alt41 = 1
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("245:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 40, 1, self.input)
+ nvae = NoViableAltException("250:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 41, 1, self.input)
raise nvae
- elif (LA40_0 == 53) :
- alt40 = 2
+ elif (LA41_0 == 53) :
+ alt41 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("245:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 40, 0, self.input)
+ nvae = NoViableAltException("250:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 41, 0, self.input)
raise nvae
- if alt40 == 1:
- # C.g:245:6: '(' abstract_declarator ')'
- self.match(self.input, 51, self.FOLLOW_51_in_direct_abstract_declarator991)
+ if alt41 == 1:
+ # C.g:250:6: '(' abstract_declarator ')'
+ self.match(self.input, 51, self.FOLLOW_51_in_direct_abstract_declarator966)
if self.failed:
return
- self.following.append(self.FOLLOW_abstract_declarator_in_direct_abstract_declarator993)
+ self.following.append(self.FOLLOW_abstract_declarator_in_direct_abstract_declarator968)
self.abstract_declarator()
self.following.pop()
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_direct_abstract_declarator995)
+ self.match(self.input, 52, self.FOLLOW_52_in_direct_abstract_declarator970)
if self.failed:
return
- elif alt40 == 2:
- # C.g:245:36: abstract_declarator_suffix
- self.following.append(self.FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator999)
+ elif alt41 == 2:
+ # C.g:250:36: abstract_declarator_suffix
+ self.following.append(self.FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator974)
self.abstract_declarator_suffix()
self.following.pop()
if self.failed:
- # C.g:245:65: ( abstract_declarator_suffix )*
- while True: #loop41
- alt41 = 2
- LA41_0 = self.input.LA(1)
+ # C.g:250:65: ( abstract_declarator_suffix )*
+ while True: #loop42
+ alt42 = 2
+ LA42_0 = self.input.LA(1)
- if (LA41_0 == 51) :
- LA41 = self.input.LA(2)
- if LA41 == 52:
- LA41_8 = self.input.LA(3)
+ if (LA42_0 == 51) :
+ LA42 = self.input.LA(2)
+ if LA42 == 52:
+ LA42_8 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 28 or LA41 == 29 or LA41 == 30 or LA41 == 31:
- LA41_9 = self.input.LA(3)
+ elif LA42 == 28 or LA42 == 29 or LA42 == 30 or LA42 == 31:
+ LA42_12 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 32:
- LA41_10 = self.input.LA(3)
+ elif LA42 == 32:
+ LA42_13 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 33:
- LA41_11 = self.input.LA(3)
+ elif LA42 == 33:
+ LA42_14 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 34:
- LA41_12 = self.input.LA(3)
+ elif LA42 == 34:
+ LA42_15 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 35:
- LA41_13 = self.input.LA(3)
+ elif LA42 == 35:
+ LA42_16 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 36:
- LA41_14 = self.input.LA(3)
+ elif LA42 == 36:
+ LA42_17 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 37:
- LA41_15 = self.input.LA(3)
+ elif LA42 == 37:
+ LA42_18 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 38:
- LA41_16 = self.input.LA(3)
+ elif LA42 == 38:
+ LA42_19 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 39:
- LA41_17 = self.input.LA(3)
+ elif LA42 == 39:
+ LA42_20 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 40:
- LA41_18 = self.input.LA(3)
+ elif LA42 == 40:
+ LA42_21 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 43 or LA41 == 44:
- LA41_19 = self.input.LA(3)
+ elif LA42 == 43 or LA42 == 44:
+ LA42_22 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 46:
- LA41_20 = self.input.LA(3)
+ elif LA42 == 46:
+ LA42_23 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == IDENTIFIER:
- LA41_21 = self.input.LA(3)
+ elif LA42 == IDENTIFIER:
+ LA42_24 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 47 or LA41 == 48 or LA41 == 49 or LA41 == 50:
- LA41_22 = self.input.LA(3)
+ elif LA42 == 47 or LA42 == 48 or LA42 == 49 or LA42 == 50:
+ LA42_25 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif (LA41_0 == 53) :
- LA41 = self.input.LA(2)
- if LA41 == 54:
- LA41_26 = self.input.LA(3)
+ elif (LA42_0 == 53) :
+ LA42 = self.input.LA(2)
+ if LA42 == 54:
+ LA42_26 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 51:
- LA41_27 = self.input.LA(3)
+ elif LA42 == 51:
+ LA42_27 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == IDENTIFIER:
- LA41_28 = self.input.LA(3)
+ elif LA42 == IDENTIFIER:
+ LA42_28 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == HEX_LITERAL or LA41 == OCTAL_LITERAL or LA41 == DECIMAL_LITERAL or LA41 == CHARACTER_LITERAL or LA41 == STRING_LITERAL or LA41 == FLOATING_POINT_LITERAL:
- LA41_29 = self.input.LA(3)
+ elif LA42 == HEX_LITERAL or LA42 == OCTAL_LITERAL or LA42 == DECIMAL_LITERAL or LA42 == CHARACTER_LITERAL or LA42 == STRING_LITERAL or LA42 == FLOATING_POINT_LITERAL:
+ LA42_29 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 61:
- LA41_30 = self.input.LA(3)
+ elif LA42 == 61:
+ LA42_30 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 62:
- LA41_31 = self.input.LA(3)
+ elif LA42 == 62:
+ LA42_31 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 55 or LA41 == 57 or LA41 == 58 or LA41 == 66 or LA41 == 67 or LA41 == 68:
- LA41_32 = self.input.LA(3)
+ elif LA42 == 55 or LA42 == 57 or LA42 == 58 or LA42 == 66 or LA42 == 67 or LA42 == 68:
+ LA42_32 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- elif LA41 == 63:
- LA41_33 = self.input.LA(3)
+ elif LA42 == 63:
+ LA42_33 = self.input.LA(3)
- if (self.synpred71()) :
- alt41 = 1
+ if (self.synpred72()) :
+ alt42 = 1
- if alt41 == 1:
+ if alt42 == 1:
# C.g:0:0: abstract_declarator_suffix
- self.following.append(self.FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1003)
+ self.following.append(self.FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator978)
self.abstract_declarator_suffix()
self.following.pop()
if self.failed:
else:
- break #loop41
+ break #loop42
# $ANTLR start abstract_declarator_suffix
- # C.g:248:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );
+ # C.g:253:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );
def abstract_declarator_suffix(self, ):
abstract_declarator_suffix_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 33):
return
- # C.g:249:2: ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' )
- alt42 = 4
- LA42_0 = self.input.LA(1)
+ # C.g:254:2: ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' )
+ alt43 = 4
+ LA43_0 = self.input.LA(1)
- if (LA42_0 == 53) :
- LA42_1 = self.input.LA(2)
+ if (LA43_0 == 53) :
+ LA43_1 = self.input.LA(2)
- if (LA42_1 == 54) :
- alt42 = 1
- elif ((IDENTIFIER <= LA42_1 <= FLOATING_POINT_LITERAL) or LA42_1 == 51 or LA42_1 == 55 or (57 <= LA42_1 <= 58) or (61 <= LA42_1 <= 63) or (66 <= LA42_1 <= 68)) :
- alt42 = 2
+ if (LA43_1 == 54) :
+ alt43 = 1
+ elif ((IDENTIFIER <= LA43_1 <= FLOATING_POINT_LITERAL) or LA43_1 == 51 or LA43_1 == 55 or (57 <= LA43_1 <= 58) or (61 <= LA43_1 <= 63) or (66 <= LA43_1 <= 68)) :
+ alt43 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("248:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 42, 1, self.input)
+ nvae = NoViableAltException("253:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 43, 1, self.input)
raise nvae
- elif (LA42_0 == 51) :
- LA42_2 = self.input.LA(2)
+ elif (LA43_0 == 51) :
+ LA43_2 = self.input.LA(2)
- if (LA42_2 == 52) :
- alt42 = 3
- elif (LA42_2 == IDENTIFIER or (28 <= LA42_2 <= 40) or (43 <= LA42_2 <= 44) or (46 <= LA42_2 <= 50)) :
- alt42 = 4
+ if (LA43_2 == 52) :
+ alt43 = 3
+ elif (LA43_2 == IDENTIFIER or (28 <= LA43_2 <= 40) or (43 <= LA43_2 <= 44) or (46 <= LA43_2 <= 50)) :
+ alt43 = 4
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("248:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 42, 2, self.input)
+ nvae = NoViableAltException("253:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 43, 2, self.input)
raise nvae
self.failed = True
return
- nvae = NoViableAltException("248:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 42, 0, self.input)
+ nvae = NoViableAltException("253:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 43, 0, self.input)
raise nvae
- if alt42 == 1:
- # C.g:249:4: '[' ']'
- self.match(self.input, 53, self.FOLLOW_53_in_abstract_declarator_suffix1015)
+ if alt43 == 1:
+ # C.g:254:4: '[' ']'
+ self.match(self.input, 53, self.FOLLOW_53_in_abstract_declarator_suffix990)
if self.failed:
return
- self.match(self.input, 54, self.FOLLOW_54_in_abstract_declarator_suffix1017)
+ self.match(self.input, 54, self.FOLLOW_54_in_abstract_declarator_suffix992)
if self.failed:
return
- elif alt42 == 2:
- # C.g:250:4: '[' constant_expression ']'
- self.match(self.input, 53, self.FOLLOW_53_in_abstract_declarator_suffix1022)
+ elif alt43 == 2:
+ # C.g:255:4: '[' constant_expression ']'
+ self.match(self.input, 53, self.FOLLOW_53_in_abstract_declarator_suffix997)
if self.failed:
return
- self.following.append(self.FOLLOW_constant_expression_in_abstract_declarator_suffix1024)
+ self.following.append(self.FOLLOW_constant_expression_in_abstract_declarator_suffix999)
self.constant_expression()
self.following.pop()
if self.failed:
return
- self.match(self.input, 54, self.FOLLOW_54_in_abstract_declarator_suffix1026)
+ self.match(self.input, 54, self.FOLLOW_54_in_abstract_declarator_suffix1001)
if self.failed:
return
- elif alt42 == 3:
- # C.g:251:4: '(' ')'
- self.match(self.input, 51, self.FOLLOW_51_in_abstract_declarator_suffix1031)
+ elif alt43 == 3:
+ # C.g:256:4: '(' ')'
+ self.match(self.input, 51, self.FOLLOW_51_in_abstract_declarator_suffix1006)
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_abstract_declarator_suffix1033)
+ self.match(self.input, 52, self.FOLLOW_52_in_abstract_declarator_suffix1008)
if self.failed:
return
- elif alt42 == 4:
- # C.g:252:4: '(' parameter_type_list ')'
- self.match(self.input, 51, self.FOLLOW_51_in_abstract_declarator_suffix1038)
+ elif alt43 == 4:
+ # C.g:257:4: '(' parameter_type_list ')'
+ self.match(self.input, 51, self.FOLLOW_51_in_abstract_declarator_suffix1013)
if self.failed:
return
- self.following.append(self.FOLLOW_parameter_type_list_in_abstract_declarator_suffix1040)
+ self.following.append(self.FOLLOW_parameter_type_list_in_abstract_declarator_suffix1015)
self.parameter_type_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_abstract_declarator_suffix1042)
+ self.match(self.input, 52, self.FOLLOW_52_in_abstract_declarator_suffix1017)
if self.failed:
return
# $ANTLR start initializer
- # C.g:255:1: initializer : ( assignment_expression | '{' initializer_list ( ',' )? '}' );
+ # C.g:260:1: initializer : ( assignment_expression | '{' initializer_list ( ',' )? '}' );
def initializer(self, ):
initializer_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 34):
return
- # C.g:257:2: ( assignment_expression | '{' initializer_list ( ',' )? '}' )
- alt44 = 2
- LA44_0 = self.input.LA(1)
+ # C.g:262:2: ( assignment_expression | '{' initializer_list ( ',' )? '}' )
+ alt45 = 2
+ LA45_0 = self.input.LA(1)
- if ((IDENTIFIER <= LA44_0 <= FLOATING_POINT_LITERAL) or LA44_0 == 51 or LA44_0 == 55 or (57 <= LA44_0 <= 58) or (61 <= LA44_0 <= 63) or (66 <= LA44_0 <= 68)) :
- alt44 = 1
- elif (LA44_0 == 41) :
- alt44 = 2
+ if ((IDENTIFIER <= LA45_0 <= FLOATING_POINT_LITERAL) or LA45_0 == 51 or LA45_0 == 55 or (57 <= LA45_0 <= 58) or (61 <= LA45_0 <= 63) or (66 <= LA45_0 <= 68)) :
+ alt45 = 1
+ elif (LA45_0 == 41) :
+ alt45 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("255:1: initializer : ( assignment_expression | '{' initializer_list ( ',' )? '}' );", 44, 0, self.input)
+ nvae = NoViableAltException("260:1: initializer : ( assignment_expression | '{' initializer_list ( ',' )? '}' );", 45, 0, self.input)
raise nvae
- if alt44 == 1:
- # C.g:257:4: assignment_expression
- self.following.append(self.FOLLOW_assignment_expression_in_initializer1055)
+ if alt45 == 1:
+ # C.g:262:4: assignment_expression
+ self.following.append(self.FOLLOW_assignment_expression_in_initializer1030)
self.assignment_expression()
self.following.pop()
if self.failed:
return
- elif alt44 == 2:
- # C.g:258:4: '{' initializer_list ( ',' )? '}'
- self.match(self.input, 41, self.FOLLOW_41_in_initializer1060)
+ elif alt45 == 2:
+ # C.g:263:4: '{' initializer_list ( ',' )? '}'
+ self.match(self.input, 41, self.FOLLOW_41_in_initializer1035)
if self.failed:
return
- self.following.append(self.FOLLOW_initializer_list_in_initializer1062)
+ self.following.append(self.FOLLOW_initializer_list_in_initializer1037)
self.initializer_list()
self.following.pop()
if self.failed:
return
- # C.g:258:25: ( ',' )?
- alt43 = 2
- LA43_0 = self.input.LA(1)
+ # C.g:263:25: ( ',' )?
+ alt44 = 2
+ LA44_0 = self.input.LA(1)
- if (LA43_0 == 26) :
- alt43 = 1
- if alt43 == 1:
+ if (LA44_0 == 26) :
+ alt44 = 1
+ if alt44 == 1:
# C.g:0:0: ','
- self.match(self.input, 26, self.FOLLOW_26_in_initializer1064)
+ self.match(self.input, 26, self.FOLLOW_26_in_initializer1039)
if self.failed:
return
- self.match(self.input, 42, self.FOLLOW_42_in_initializer1067)
+ self.match(self.input, 42, self.FOLLOW_42_in_initializer1042)
if self.failed:
return
# $ANTLR start initializer_list
- # C.g:261:1: initializer_list : initializer ( ',' initializer )* ;
+ # C.g:266:1: initializer_list : initializer ( ',' initializer )* ;
def initializer_list(self, ):
initializer_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 35):
return
- # C.g:262:2: ( initializer ( ',' initializer )* )
- # C.g:262:4: initializer ( ',' initializer )*
- self.following.append(self.FOLLOW_initializer_in_initializer_list1078)
+ # C.g:267:2: ( initializer ( ',' initializer )* )
+ # C.g:267:4: initializer ( ',' initializer )*
+ self.following.append(self.FOLLOW_initializer_in_initializer_list1053)
self.initializer()
self.following.pop()
if self.failed:
return
- # C.g:262:16: ( ',' initializer )*
- while True: #loop45
- alt45 = 2
- LA45_0 = self.input.LA(1)
+ # C.g:267:16: ( ',' initializer )*
+ while True: #loop46
+ alt46 = 2
+ LA46_0 = self.input.LA(1)
- if (LA45_0 == 26) :
- LA45_1 = self.input.LA(2)
+ if (LA46_0 == 26) :
+ LA46_1 = self.input.LA(2)
- if ((IDENTIFIER <= LA45_1 <= FLOATING_POINT_LITERAL) or LA45_1 == 41 or LA45_1 == 51 or LA45_1 == 55 or (57 <= LA45_1 <= 58) or (61 <= LA45_1 <= 63) or (66 <= LA45_1 <= 68)) :
- alt45 = 1
+ if ((IDENTIFIER <= LA46_1 <= FLOATING_POINT_LITERAL) or LA46_1 == 41 or LA46_1 == 51 or LA46_1 == 55 or (57 <= LA46_1 <= 58) or (61 <= LA46_1 <= 63) or (66 <= LA46_1 <= 68)) :
+ alt46 = 1
- if alt45 == 1:
- # C.g:262:17: ',' initializer
- self.match(self.input, 26, self.FOLLOW_26_in_initializer_list1081)
+ if alt46 == 1:
+ # C.g:267:17: ',' initializer
+ self.match(self.input, 26, self.FOLLOW_26_in_initializer_list1056)
if self.failed:
return
- self.following.append(self.FOLLOW_initializer_in_initializer_list1083)
+ self.following.append(self.FOLLOW_initializer_in_initializer_list1058)
self.initializer()
self.following.pop()
if self.failed:
else:
- break #loop45
+ break #loop46
# $ANTLR start argument_expression_list
- # C.g:267:1: argument_expression_list : assignment_expression ( ',' assignment_expression )* ;
+ # C.g:272:1: argument_expression_list : assignment_expression ( ',' assignment_expression )* ;
def argument_expression_list(self, ):
argument_expression_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 36):
return
- # C.g:268:2: ( assignment_expression ( ',' assignment_expression )* )
- # C.g:268:6: assignment_expression ( ',' assignment_expression )*
- self.following.append(self.FOLLOW_assignment_expression_in_argument_expression_list1101)
+ # C.g:273:2: ( assignment_expression ( ',' assignment_expression )* )
+ # C.g:273:6: assignment_expression ( ',' assignment_expression )*
+ self.following.append(self.FOLLOW_assignment_expression_in_argument_expression_list1076)
self.assignment_expression()
self.following.pop()
if self.failed:
return
- # C.g:268:28: ( ',' assignment_expression )*
- while True: #loop46
- alt46 = 2
- LA46_0 = self.input.LA(1)
+ # C.g:273:28: ( ',' assignment_expression )*
+ while True: #loop47
+ alt47 = 2
+ LA47_0 = self.input.LA(1)
- if (LA46_0 == 26) :
- alt46 = 1
+ if (LA47_0 == 26) :
+ alt47 = 1
- if alt46 == 1:
- # C.g:268:29: ',' assignment_expression
- self.match(self.input, 26, self.FOLLOW_26_in_argument_expression_list1104)
+ if alt47 == 1:
+ # C.g:273:29: ',' assignment_expression
+ self.match(self.input, 26, self.FOLLOW_26_in_argument_expression_list1079)
if self.failed:
return
- self.following.append(self.FOLLOW_assignment_expression_in_argument_expression_list1106)
+ self.following.append(self.FOLLOW_assignment_expression_in_argument_expression_list1081)
self.assignment_expression()
self.following.pop()
if self.failed:
else:
- break #loop46
+ break #loop47
# $ANTLR start additive_expression
- # C.g:271:1: additive_expression : ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )* ;
+ # C.g:276:1: additive_expression : ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )* ;
def additive_expression(self, ):
additive_expression_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 37):
return
- # C.g:272:2: ( ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )* )
- # C.g:272:4: ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )*
- # C.g:272:4: ( multiplicative_expression )
- # C.g:272:5: multiplicative_expression
- self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1120)
+ # C.g:277:2: ( ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )* )
+ # C.g:277:4: ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )*
+ # C.g:277:4: ( multiplicative_expression )
+ # C.g:277:5: multiplicative_expression
+ self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1095)
self.multiplicative_expression()
self.following.pop()
if self.failed:
- # C.g:272:32: ( '+' multiplicative_expression | '-' multiplicative_expression )*
- while True: #loop47
- alt47 = 3
- LA47_0 = self.input.LA(1)
+ # C.g:277:32: ( '+' multiplicative_expression | '-' multiplicative_expression )*
+ while True: #loop48
+ alt48 = 3
+ LA48_0 = self.input.LA(1)
- if (LA47_0 == 57) :
- alt47 = 1
- elif (LA47_0 == 58) :
- alt47 = 2
+ if (LA48_0 == 57) :
+ alt48 = 1
+ elif (LA48_0 == 58) :
+ alt48 = 2
- if alt47 == 1:
- # C.g:272:33: '+' multiplicative_expression
- self.match(self.input, 57, self.FOLLOW_57_in_additive_expression1124)
+ if alt48 == 1:
+ # C.g:277:33: '+' multiplicative_expression
+ self.match(self.input, 57, self.FOLLOW_57_in_additive_expression1099)
if self.failed:
return
- self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1126)
+ self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1101)
self.multiplicative_expression()
self.following.pop()
if self.failed:
return
- elif alt47 == 2:
- # C.g:272:65: '-' multiplicative_expression
- self.match(self.input, 58, self.FOLLOW_58_in_additive_expression1130)
+ elif alt48 == 2:
+ # C.g:277:65: '-' multiplicative_expression
+ self.match(self.input, 58, self.FOLLOW_58_in_additive_expression1105)
if self.failed:
return
- self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1132)
+ self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1107)
self.multiplicative_expression()
self.following.pop()
if self.failed:
else:
- break #loop47
+ break #loop48
# $ANTLR start multiplicative_expression
- # C.g:275:1: multiplicative_expression : ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )* ;
+ # C.g:280:1: multiplicative_expression : ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )* ;
def multiplicative_expression(self, ):
multiplicative_expression_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 38):
return
- # C.g:276:2: ( ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )* )
- # C.g:276:4: ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )*
- # C.g:276:4: ( cast_expression )
- # C.g:276:5: cast_expression
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1146)
+ # C.g:281:2: ( ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )* )
+ # C.g:281:4: ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )*
+ # C.g:281:4: ( cast_expression )
+ # C.g:281:5: cast_expression
+ self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1121)
self.cast_expression()
self.following.pop()
if self.failed:
- # C.g:276:22: ( '*' cast_expression | '/' cast_expression | '%' cast_expression )*
- while True: #loop48
- alt48 = 4
- LA48 = self.input.LA(1)
- if LA48 == 55:
- alt48 = 1
- elif LA48 == 59:
- alt48 = 2
- elif LA48 == 60:
- alt48 = 3
+ # C.g:281:22: ( '*' cast_expression | '/' cast_expression | '%' cast_expression )*
+ while True: #loop49
+ alt49 = 4
+ LA49 = self.input.LA(1)
+ if LA49 == 55:
+ alt49 = 1
+ elif LA49 == 59:
+ alt49 = 2
+ elif LA49 == 60:
+ alt49 = 3
- if alt48 == 1:
- # C.g:276:23: '*' cast_expression
- self.match(self.input, 55, self.FOLLOW_55_in_multiplicative_expression1150)
+ if alt49 == 1:
+ # C.g:281:23: '*' cast_expression
+ self.match(self.input, 55, self.FOLLOW_55_in_multiplicative_expression1125)
if self.failed:
return
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1152)
+ self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1127)
self.cast_expression()
self.following.pop()
if self.failed:
return
- elif alt48 == 2:
- # C.g:276:45: '/' cast_expression
- self.match(self.input, 59, self.FOLLOW_59_in_multiplicative_expression1156)
+ elif alt49 == 2:
+ # C.g:281:45: '/' cast_expression
+ self.match(self.input, 59, self.FOLLOW_59_in_multiplicative_expression1131)
if self.failed:
return
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1158)
+ self.following.append(self.FOL