# $ANTLR 3.0.1 C.g 2010-02-23 09:58:53
from antlr3 import *
from antlr3.compat import set, frozenset
## @file
# The file defines the parser for C source files.
#
# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
# This file is generated by running:
# java org.antlr.Tool C.g
#
# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of the license may be found at:
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
import CodeFragment
import FileProfile
# for convenience in actions
HIDDEN = BaseRecognizer.HIDDEN
# token types
BS=20
LINE_COMMENT=23
FloatTypeSuffix=16
IntegerTypeSuffix=14
LETTER=11
OCTAL_LITERAL=6
CHARACTER_LITERAL=8
Exponent=15
EOF=-1
HexDigit=13
STRING_LITERAL=9
WS=19
FLOATING_POINT_LITERAL=10
IDENTIFIER=4
UnicodeEscape=18
LINE_COMMAND=24
UnicodeVocabulary=21
HEX_LITERAL=5
COMMENT=22
DECIMAL_LITERAL=7
EscapeSequence=12
OctalEscape=17
# token names
tokenNames = [
"", "", "", "",
"IDENTIFIER", "HEX_LITERAL", "OCTAL_LITERAL", "DECIMAL_LITERAL", "CHARACTER_LITERAL",
"STRING_LITERAL", "FLOATING_POINT_LITERAL", "LETTER", "EscapeSequence",
"HexDigit", "IntegerTypeSuffix", "Exponent", "FloatTypeSuffix", "OctalEscape",
"UnicodeEscape", "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COMMENT",
"LINE_COMMAND", "';'", "'typedef'", "','", "'='", "'extern'", "'static'",
"'auto'", "'register'", "'STATIC'", "'void'", "'char'", "'short'", "'int'",
"'long'", "'float'", "'double'", "'signed'", "'unsigned'", "'{'", "'}'",
"'struct'", "'union'", "':'", "'enum'", "'const'", "'volatile'", "'IN'",
"'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'", "'VOLATILE'", "'GLOBAL_REMOVE_IF_UNREFERENCED'",
"'EFIAPI'", "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED'",
"'('", "')'", "'['", "']'", "'*'", "'...'", "'+'", "'-'", "'/'", "'%'",
"'++'", "'--'", "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*='",
"'/='", "'%='", "'+='", "'-='", "'<<='", "'>>='", "'&='", "'^='", "'|='",
"'?'", "'||'", "'&&'", "'|'", "'^'", "'=='", "'!='", "'<'", "'>'", "'<='",
"'>='", "'<<'", "'>>'", "'__asm__'", "'_asm'", "'__asm'", "'case'",
"'default'", "'if'", "'else'", "'switch'", "'while'", "'do'", "'for'",
"'goto'", "'continue'", "'break'", "'return'"
]
class function_definition_scope(object):
def __init__(self):
self.ModifierText = None
self.DeclText = None
self.LBLine = None
self.LBOffset = None
self.DeclLine = None
self.DeclOffset = None
class postfix_expression_scope(object):
def __init__(self):
self.FuncCallText = None
class CParser(Parser):
grammarFileName = "C.g"
tokenNames = tokenNames
def __init__(self, input):
Parser.__init__(self, input)
self.ruleMemo = {}
self.function_definition_stack = []
self.postfix_expression_stack = []
def printTokenInfo(self, line, offset, tokenText):
print str(line)+ ',' + str(offset) + ':' + str(tokenText)
def StorePredicateExpression(self, StartLine, StartOffset, EndLine, EndOffset, Text):
PredExp = CodeFragment.PredicateExpression(Text, (StartLine, StartOffset), (EndLine, EndOffset))
FileProfile.PredicateExpressionList.append(PredExp)
def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):
EnumDef = CodeFragment.EnumerationDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))
FileProfile.EnumerationDefinitionList.append(EnumDef)
def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):
SUDef = CodeFragment.StructUnionDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))
FileProfile.StructUnionDefinitionList.append(SUDef)
def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndOffset, FromText, ToText):
Tdef = CodeFragment.TypedefDefinition(FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffset))
FileProfile.TypedefDefinitionList.append(Tdef)
def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, DeclOffset):
FuncDef = CodeFragment.FunctionDefinition(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLine, DeclOffset))
FileProfile.FunctionDefinitionList.append(FuncDef)
def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText):
VarDecl = CodeFragment.VariableDeclaration(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset))
FileProfile.VariableDeclarationList.append(VarDecl)
def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOffset, FuncName, ParamList):
FuncCall = CodeFragment.FunctionCalling(FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOffset))
FileProfile.FunctionCallingList.append(FuncCall)
# $ANTLR start translation_unit
# C.g:102:1: translation_unit : ( external_declaration )* ;
def translation_unit(self, ):
translation_unit_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 1):
return
# C.g:103:2: ( ( external_declaration )* )
# C.g:103:4: ( external_declaration )*
# C.g:103:4: ( external_declaration )*
while True: #loop1
alt1 = 2
LA1_0 = self.input.LA(1)
if (LA1_0 == IDENTIFIER or LA1_0 == 26 or (29 <= LA1_0 <= 42) or (45 <= LA1_0 <= 46) or (48 <= LA1_0 <= 62) or LA1_0 == 66) :
alt1 = 1
if alt1 == 1:
# C.g:0:0: external_declaration
self.following.append(self.FOLLOW_external_declaration_in_translation_unit74)
self.external_declaration()
self.following.pop()
if self.failed:
return
else:
break #loop1
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 1, translation_unit_StartIndex)
pass
return
# $ANTLR end translation_unit
# $ANTLR start external_declaration
# C.g:114: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()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 2):
return
# C.g:119:2: ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? )
alt3 = 3
LA3_0 = self.input.LA(1)
if ((29 <= LA3_0 <= 33)) :
LA3_1 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 1, self.input)
raise nvae
elif (LA3_0 == 34) :
LA3_2 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 2, self.input)
raise nvae
elif (LA3_0 == 35) :
LA3_3 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 3, self.input)
raise nvae
elif (LA3_0 == 36) :
LA3_4 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 4, self.input)
raise nvae
elif (LA3_0 == 37) :
LA3_5 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 5, self.input)
raise nvae
elif (LA3_0 == 38) :
LA3_6 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 6, self.input)
raise nvae
elif (LA3_0 == 39) :
LA3_7 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 7, self.input)
raise nvae
elif (LA3_0 == 40) :
LA3_8 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 8, self.input)
raise nvae
elif (LA3_0 == 41) :
LA3_9 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 9, self.input)
raise nvae
elif (LA3_0 == 42) :
LA3_10 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 10, self.input)
raise nvae
elif ((45 <= LA3_0 <= 46)) :
LA3_11 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 11, self.input)
raise nvae
elif (LA3_0 == 48) :
LA3_12 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 12, self.input)
raise nvae
elif (LA3_0 == IDENTIFIER) :
LA3_13 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
elif (True) :
alt3 = 3
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 13, self.input)
raise nvae
elif (LA3_0 == 58) :
LA3_14 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 14, self.input)
raise nvae
elif (LA3_0 == 66) and (self.synpred4()):
alt3 = 1
elif (LA3_0 == 59) :
LA3_16 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 16, self.input)
raise nvae
elif (LA3_0 == 60) :
LA3_17 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 17, self.input)
raise nvae
elif ((49 <= LA3_0 <= 57) or LA3_0 == 61) :
LA3_18 = self.input.LA(2)
if (self.synpred4()) :
alt3 = 1
elif (self.synpred5()) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 18, self.input)
raise nvae
elif (LA3_0 == 62) and (self.synpred4()):
alt3 = 1
elif (LA3_0 == 26) :
alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 0, self.input)
raise nvae
if alt3 == 1:
# C.g:119:4: ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition
self.following.append(self.FOLLOW_function_definition_in_external_declaration113)
self.function_definition()
self.following.pop()
if self.failed:
return
elif alt3 == 2:
# C.g:120:4: declaration
self.following.append(self.FOLLOW_declaration_in_external_declaration118)
self.declaration()
self.following.pop()
if self.failed:
return
elif alt3 == 3:
# C.g:121:4: macro_statement ( ';' )?
self.following.append(self.FOLLOW_macro_statement_in_external_declaration123)
self.macro_statement()
self.following.pop()
if self.failed:
return
# C.g:121:20: ( ';' )?
alt2 = 2
LA2_0 = self.input.LA(1)
if (LA2_0 == 25) :
alt2 = 1
if alt2 == 1:
# C.g:121:21: ';'
self.match(self.input, 25, self.FOLLOW_25_in_external_declaration126)
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 2, external_declaration_StartIndex)
pass
return
# $ANTLR end external_declaration
class function_definition_return(object):
def __init__(self):
self.start = None
self.stop = None
# $ANTLR start function_definition
# C.g:126:1: function_definition : (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement ) ;
def function_definition(self, ):
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()
d = None
a = None
b = None
declarator1 = None
self.function_definition_stack[-1].ModifierText = ''
self.function_definition_stack[-1].DeclText = ''
self.function_definition_stack[-1].LBLine = 0
self.function_definition_stack[-1].LBOffset = 0
self.function_definition_stack[-1].DeclLine = 0
self.function_definition_stack[-1].DeclOffset = 0
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 3):
return retval
# C.g:146:2: ( (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement ) )
# C.g:146:4: (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement )
# C.g:146:5: (d= declaration_specifiers )?
alt4 = 2
LA4 = self.input.LA(1)
if LA4 == 29 or LA4 == 30 or LA4 == 31 or LA4 == 32 or LA4 == 33 or LA4 == 34 or LA4 == 35 or LA4 == 36 or LA4 == 37 or LA4 == 38 or LA4 == 39 or LA4 == 40 or LA4 == 41 or LA4 == 42 or LA4 == 45 or LA4 == 46 or LA4 == 48 or LA4 == 49 or LA4 == 50 or LA4 == 51 or LA4 == 52 or LA4 == 53 or LA4 == 54 or LA4 == 55 or LA4 == 56 or LA4 == 57 or LA4 == 61:
alt4 = 1
elif LA4 == IDENTIFIER:
LA4 = self.input.LA(2)
if LA4 == 66:
alt4 = 1
elif LA4 == 58:
LA4_21 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 59:
LA4_22 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 60:
LA4_23 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == IDENTIFIER:
LA4_24 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 62:
LA4_25 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 29 or LA4 == 30 or LA4 == 31 or LA4 == 32 or LA4 == 33:
LA4_26 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 34:
LA4_27 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 35:
LA4_28 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 36:
LA4_29 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 37:
LA4_30 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 38:
LA4_31 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 39:
LA4_32 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 40:
LA4_33 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 41:
LA4_34 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 42:
LA4_35 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 45 or LA4 == 46:
LA4_36 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 48:
LA4_37 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 49 or LA4 == 50 or LA4 == 51 or LA4 == 52 or LA4 == 53 or LA4 == 54 or LA4 == 55 or LA4 == 56 or LA4 == 57 or LA4 == 61:
LA4_38 = self.input.LA(3)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 58:
LA4_14 = self.input.LA(2)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 59:
LA4_16 = self.input.LA(2)
if (self.synpred7()) :
alt4 = 1
elif LA4 == 60:
LA4_17 = self.input.LA(2)
if (self.synpred7()) :
alt4 = 1
if alt4 == 1:
# C.g:0:0: d= declaration_specifiers
self.following.append(self.FOLLOW_declaration_specifiers_in_function_definition157)
d = self.declaration_specifiers()
self.following.pop()
if self.failed:
return retval
self.following.append(self.FOLLOW_declarator_in_function_definition160)
declarator1 = self.declarator()
self.following.pop()
if self.failed:
return retval
# C.g:147:3: ( ( declaration )+ a= compound_statement | b= compound_statement )
alt6 = 2
LA6_0 = self.input.LA(1)
if (LA6_0 == IDENTIFIER or LA6_0 == 26 or (29 <= LA6_0 <= 42) or (45 <= LA6_0 <= 46) or (48 <= LA6_0 <= 61)) :
alt6 = 1
elif (LA6_0 == 43) :
alt6 = 2
else:
if self.backtracking > 0:
self.failed = True
return retval
nvae = NoViableAltException("147:3: ( ( declaration )+ a= compound_statement | b= compound_statement )", 6, 0, self.input)
raise nvae
if alt6 == 1:
# C.g:147:5: ( declaration )+ a= compound_statement
# C.g:147:5: ( declaration )+
cnt5 = 0
while True: #loop5
alt5 = 2
LA5_0 = self.input.LA(1)
if (LA5_0 == IDENTIFIER or LA5_0 == 26 or (29 <= LA5_0 <= 42) or (45 <= LA5_0 <= 46) or (48 <= LA5_0 <= 61)) :
alt5 = 1
if alt5 == 1:
# C.g:0:0: declaration
self.following.append(self.FOLLOW_declaration_in_function_definition166)
self.declaration()
self.following.pop()
if self.failed:
return retval
else:
if cnt5 >= 1:
break #loop5
if self.backtracking > 0:
self.failed = True
return retval
eee = EarlyExitException(5, self.input)
raise eee
cnt5 += 1
self.following.append(self.FOLLOW_compound_statement_in_function_definition171)
a = self.compound_statement()
self.following.pop()
if self.failed:
return retval
elif alt6 == 2:
# C.g:148:5: b= compound_statement
self.following.append(self.FOLLOW_compound_statement_in_function_definition180)
b = self.compound_statement()
self.following.pop()
if self.failed:
return retval
if self.backtracking == 0:
if d != None:
self.function_definition_stack[-1].ModifierText = self.input.toString(d.start,d.stop)
else:
self.function_definition_stack[-1].ModifierText = ''
self.function_definition_stack[-1].DeclText = self.input.toString(declarator1.start,declarator1.stop)
self.function_definition_stack[-1].DeclLine = declarator1.start.line
self.function_definition_stack[-1].DeclOffset = declarator1.start.charPositionInLine
if a != None:
self.function_definition_stack[-1].LBLine = a.start.line
self.function_definition_stack[-1].LBOffset = a.start.charPositionInLine
else:
self.function_definition_stack[-1].LBLine = b.start.line
self.function_definition_stack[-1].LBOffset = b.start.charPositionInLine
retval.stop = self.input.LT(-1)
if self.backtracking == 0:
self.StoreFunctionDefinition(retval.start.line, retval.start.charPositionInLine, retval.stop.line, retval.stop.charPositionInLine, self.function_definition_stack[-1].ModifierText, self.function_definition_stack[-1].DeclText, self.function_definition_stack[-1].LBLine, self.function_definition_stack[-1].LBOffset, self.function_definition_stack[-1].DeclLine, self.function_definition_stack[-1].DeclOffset)
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 3, function_definition_StartIndex)
self.function_definition_stack.pop()
pass
return retval
# $ANTLR end function_definition
# $ANTLR start declaration
# C.g:166:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );
def declaration(self, ):
declaration_StartIndex = self.input.index()
a = None
d = None
e = None
b = None
c = None
s = None
t = None
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 4):
return
# C.g:167: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 (LA9_0 == 26) :
alt9 = 1
elif (LA9_0 == IDENTIFIER or (29 <= LA9_0 <= 42) or (45 <= LA9_0 <= 46) or (48 <= LA9_0 <= 61)) :
alt9 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("166:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );", 9, 0, self.input)
raise nvae
if alt9 == 1:
# C.g:167:4: a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';'
a = self.input.LT(1)
self.match(self.input, 26, self.FOLLOW_26_in_declaration203)
if self.failed:
return
# C.g:167:17: (b= declaration_specifiers )?
alt7 = 2
LA7 = self.input.LA(1)
if LA7 == 29 or LA7 == 30 or LA7 == 31 or LA7 == 32 or LA7 == 33 or LA7 == 34 or LA7 == 35 or LA7 == 36 or LA7 == 37 or LA7 == 38 or LA7 == 39 or LA7 == 40 or LA7 == 41 or LA7 == 42 or LA7 == 45 or LA7 == 46 or LA7 == 48 or LA7 == 49 or LA7 == 50 or LA7 == 51 or LA7 == 52 or LA7 == 53 or LA7 == 54 or LA7 == 55 or LA7 == 56 or LA7 == 57 or LA7 == 61:
alt7 = 1
elif LA7 == IDENTIFIER:
LA7_13 = self.input.LA(2)
if (LA7_13 == 62) :
LA7_21 = self.input.LA(3)
if (self.synpred10()) :
alt7 = 1
elif (LA7_13 == IDENTIFIER or (29 <= LA7_13 <= 42) or (45 <= LA7_13 <= 46) or (48 <= LA7_13 <= 61) or LA7_13 == 66) :
alt7 = 1
elif LA7 == 58:
LA7_14 = self.input.LA(2)
if (self.synpred10()) :
alt7 = 1
elif LA7 == 59:
LA7_16 = self.input.LA(2)
if (self.synpred10()) :
alt7 = 1
elif LA7 == 60:
LA7_17 = self.input.LA(2)
if (self.synpred10()) :
alt7 = 1
if alt7 == 1:
# C.g:0:0: b= declaration_specifiers
self.following.append(self.FOLLOW_declaration_specifiers_in_declaration207)
b = self.declaration_specifiers()
self.following.pop()
if self.failed:
return
self.following.append(self.FOLLOW_init_declarator_list_in_declaration216)
c = self.init_declarator_list()
self.following.pop()
if self.failed:
return
d = self.input.LT(1)
self.match(self.input, 25, self.FOLLOW_25_in_declaration220)
if self.failed:
return
if self.backtracking == 0:
if b != None:
self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, self.input.toString(b.start,b.stop), self.input.toString(c.start,c.stop))
else:
self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start,c.stop))
elif alt9 == 2:
# C.g:175:4: s= declaration_specifiers (t= init_declarator_list )? e= ';'
self.following.append(self.FOLLOW_declaration_specifiers_in_declaration234)
s = self.declaration_specifiers()
self.following.pop()
if self.failed:
return
# C.g:175:30: (t= init_declarator_list )?
alt8 = 2
LA8_0 = self.input.LA(1)
if (LA8_0 == IDENTIFIER or (58 <= LA8_0 <= 60) or LA8_0 == 62 or LA8_0 == 66) :
alt8 = 1
if alt8 == 1:
# C.g:0:0: t= init_declarator_list
self.following.append(self.FOLLOW_init_declarator_list_in_declaration238)
t = self.init_declarator_list()
self.following.pop()
if self.failed:
return
e = self.input.LT(1)
self.match(self.input, 25, self.FOLLOW_25_in_declaration243)
if self.failed:
return
if self.backtracking == 0:
if t != None:
self.StoreVariableDeclaration(s.start.line, s.start.charPositionInLine, t.start.line, t.start.charPositionInLine, self.input.toString(s.start,s.stop), self.input.toString(t.start,t.stop))
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 4, declaration_StartIndex)
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:182: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 retval
# C.g:183:2: ( ( storage_class_specifier | type_specifier | type_qualifier )+ )
# C.g:183:6: ( storage_class_specifier | type_specifier | type_qualifier )+
# C.g:183:6: ( storage_class_specifier | type_specifier | type_qualifier )+
cnt10 = 0
while True: #loop10
alt10 = 4
LA10 = self.input.LA(1)
if LA10 == 58:
LA10_2 = self.input.LA(2)
if (self.synpred15()) :
alt10 = 3
elif LA10 == 59:
LA10_3 = self.input.LA(2)
if (self.synpred15()) :
alt10 = 3
elif LA10 == 60:
LA10_4 = self.input.LA(2)
if (self.synpred15()) :
alt10 = 3
elif LA10 == IDENTIFIER:
LA10_5 = self.input.LA(2)
if (self.synpred14()) :
alt10 = 2
elif LA10 == 53:
LA10_9 = self.input.LA(2)
if (self.synpred15()) :
alt10 = 3
elif LA10 == 29 or LA10 == 30 or LA10 == 31 or LA10 == 32 or LA10 == 33:
alt10 = 1
elif LA10 == 34 or LA10 == 35 or LA10 == 36 or LA10 == 37 or LA10 == 38 or LA10 == 39 or LA10 == 40 or LA10 == 41 or LA10 == 42 or LA10 == 45 or LA10 == 46 or LA10 == 48:
alt10 = 2
elif LA10 == 49 or LA10 == 50 or LA10 == 51 or LA10 == 52 or LA10 == 54 or LA10 == 55 or LA10 == 56 or LA10 == 57 or LA10 == 61:
alt10 = 3
if alt10 == 1:
# C.g:183:10: storage_class_specifier
self.following.append(self.FOLLOW_storage_class_specifier_in_declaration_specifiers264)
self.storage_class_specifier()
self.following.pop()
if self.failed:
return retval
elif alt10 == 2:
# C.g:184:7: type_specifier
self.following.append(self.FOLLOW_type_specifier_in_declaration_specifiers272)
self.type_specifier()
self.following.pop()
if self.failed:
return retval
elif alt10 == 3:
# C.g:185:13: type_qualifier
self.following.append(self.FOLLOW_type_qualifier_in_declaration_specifiers286)
self.type_qualifier()
self.following.pop()
if self.failed:
return retval
else:
if cnt10 >= 1:
break #loop10
if self.backtracking > 0:
self.failed = True
return retval
eee = EarlyExitException(10, self.input)
raise eee
cnt10 += 1
retval.stop = self.input.LT(-1)
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 5, declaration_specifiers_StartIndex)
pass
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:189: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 retval
# C.g:190:2: ( init_declarator ( ',' init_declarator )* )
# C.g:190:4: init_declarator ( ',' init_declarator )*
self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list308)
self.init_declarator()
self.following.pop()
if self.failed:
return retval
# C.g:190:20: ( ',' init_declarator )*
while True: #loop11
alt11 = 2
LA11_0 = self.input.LA(1)
if (LA11_0 == 27) :
alt11 = 1
if alt11 == 1:
# C.g:190:21: ',' init_declarator
self.match(self.input, 27, self.FOLLOW_27_in_init_declarator_list311)
if self.failed:
return retval
self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list313)
self.init_declarator()
self.following.pop()
if self.failed:
return retval
else:
break #loop11
retval.stop = self.input.LT(-1)
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 6, init_declarator_list_StartIndex)
pass
return retval
# $ANTLR end init_declarator_list
# $ANTLR start init_declarator
# C.g:193:1: init_declarator : declarator ( '=' initializer )? ;
def init_declarator(self, ):
init_declarator_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 7):
return
# C.g:194:2: ( declarator ( '=' initializer )? )
# C.g:194:4: declarator ( '=' initializer )?
self.following.append(self.FOLLOW_declarator_in_init_declarator326)
self.declarator()
self.following.pop()
if self.failed:
return
# C.g:194:15: ( '=' initializer )?
alt12 = 2
LA12_0 = self.input.LA(1)
if (LA12_0 == 28) :
alt12 = 1
if alt12 == 1:
# C.g:194:16: '=' initializer
self.match(self.input, 28, self.FOLLOW_28_in_init_declarator329)
if self.failed:
return
self.following.append(self.FOLLOW_initializer_in_init_declarator331)
self.initializer()
self.following.pop()
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 7, init_declarator_StartIndex)
pass
return
# $ANTLR end init_declarator
# $ANTLR start storage_class_specifier
# C.g:197:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' | 'register' | 'STATIC' );
def storage_class_specifier(self, ):
storage_class_specifier_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 8):
return
# C.g:198:2: ( 'extern' | 'static' | 'auto' | 'register' | 'STATIC' )
# C.g:
if (29 <= self.input.LA(1) <= 33):
self.input.consume();
self.errorRecovery = False
self.failed = False
else:
if self.backtracking > 0:
self.failed = True
return
mse = MismatchedSetException(None, self.input)
self.recoverFromMismatchedSet(
self.input, mse, self.FOLLOW_set_in_storage_class_specifier0
)
raise mse
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 8, storage_class_specifier_StartIndex)
pass
return
# $ANTLR end storage_class_specifier
# $ANTLR start type_specifier
# C.g:205:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id );
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:206:2: ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id )
alt13 = 12
LA13_0 = self.input.LA(1)
if (LA13_0 == 34) :
alt13 = 1
elif (LA13_0 == 35) :
alt13 = 2
elif (LA13_0 == 36) :
alt13 = 3
elif (LA13_0 == 37) :
alt13 = 4
elif (LA13_0 == 38) :
alt13 = 5
elif (LA13_0 == 39) :
alt13 = 6
elif (LA13_0 == 40) :
alt13 = 7
elif (LA13_0 == 41) :
alt13 = 8
elif (LA13_0 == 42) :
alt13 = 9
elif ((45 <= LA13_0 <= 46)) :
alt13 = 10
elif (LA13_0 == 48) :
alt13 = 11
elif (LA13_0 == IDENTIFIER) and (self.synpred34()):
alt13 = 12
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("205:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id );", 13, 0, self.input)
raise nvae
if alt13 == 1:
# C.g:206:4: 'void'
self.match(self.input, 34, self.FOLLOW_34_in_type_specifier376)
if self.failed:
return
elif alt13 == 2:
# C.g:207:4: 'char'
self.match(self.input, 35, self.FOLLOW_35_in_type_specifier381)
if self.failed:
return
elif alt13 == 3:
# C.g:208:4: 'short'
self.match(self.input, 36, self.FOLLOW_36_in_type_specifier386)
if self.failed:
return
elif alt13 == 4:
# C.g:209:4: 'int'
self.match(self.input, 37, self.FOLLOW_37_in_type_specifier391)
if self.failed:
return
elif alt13 == 5:
# C.g:210:4: 'long'
self.match(self.input, 38, self.FOLLOW_38_in_type_specifier396)
if self.failed:
return
elif alt13 == 6:
# C.g:211:4: 'float'
self.match(self.input, 39, self.FOLLOW_39_in_type_specifier401)
if self.failed:
return
elif alt13 == 7:
# C.g:212:4: 'double'
self.match(self.input, 40, self.FOLLOW_40_in_type_specifier406)
if self.failed:
return
elif alt13 == 8:
# C.g:213:4: 'signed'
self.match(self.input, 41, self.FOLLOW_41_in_type_specifier411)
if self.failed:
return
elif alt13 == 9:
# C.g:214:4: 'unsigned'
self.match(self.input, 42, self.FOLLOW_42_in_type_specifier416)
if self.failed:
return
elif alt13 == 10:
# C.g:215:4: s= struct_or_union_specifier
self.following.append(self.FOLLOW_struct_or_union_specifier_in_type_specifier423)
s = self.struct_or_union_specifier()
self.following.pop()
if self.failed:
return
if self.backtracking == 0:
if s.stop != None:
self.StoreStructUnionDefinition(s.start.line, s.start.charPositionInLine, s.stop.line, s.stop.charPositionInLine, self.input.toString(s.start,s.stop))
elif alt13 == 11:
# C.g:220:4: e= enum_specifier
self.following.append(self.FOLLOW_enum_specifier_in_type_specifier433)
e = self.enum_specifier()
self.following.pop()
if self.failed:
return
if self.backtracking == 0:
if e.stop != None:
self.StoreEnumerationDefinition(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
elif alt13 == 12:
# C.g:225:4: ( IDENTIFIER ( type_qualifier )* declarator )=> type_id
self.following.append(self.FOLLOW_type_id_in_type_specifier451)
self.type_id()
self.following.pop()
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 9, type_specifier_StartIndex)
pass
return
# $ANTLR end type_specifier
# $ANTLR start type_id
# C.g:228:1: type_id : IDENTIFIER ;
def type_id(self, ):
type_id_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 10):
return
# C.g:229:5: ( IDENTIFIER )
# C.g:229:9: IDENTIFIER
self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_type_id467)
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 10, type_id_StartIndex)
pass
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:233: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, ):
retval = self.struct_or_union_specifier_return()
retval.start = self.input.LT(1)
struct_or_union_specifier_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 11):
return retval
# C.g:235:2: ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER )
alt15 = 2
LA15_0 = self.input.LA(1)
if ((45 <= LA15_0 <= 46)) :
LA15_1 = self.input.LA(2)
if (LA15_1 == IDENTIFIER) :
LA15_2 = self.input.LA(3)
if (LA15_2 == 43) :
alt15 = 1
elif (LA15_2 == EOF or LA15_2 == IDENTIFIER or LA15_2 == 25 or LA15_2 == 27 or (29 <= LA15_2 <= 42) or (45 <= LA15_2 <= 64) or LA15_2 == 66) :
alt15 = 2
else:
if self.backtracking > 0:
self.failed = True
return retval
nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 2, self.input)
raise nvae
elif (LA15_1 == 43) :
alt15 = 1
else:
if self.backtracking > 0:
self.failed = True
return retval
nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 1, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
return retval
nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 0, self.input)
raise nvae
if alt15 == 1:
# C.g:235:4: struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}'
self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier494)
self.struct_or_union()
self.following.pop()
if self.failed:
return retval
# C.g:235:20: ( IDENTIFIER )?
alt14 = 2
LA14_0 = self.input.LA(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_specifier496)
if self.failed:
return retval
self.match(self.input, 43, self.FOLLOW_43_in_struct_or_union_specifier499)
if self.failed:
return retval
self.following.append(self.FOLLOW_struct_declaration_list_in_struct_or_union_specifier501)
self.struct_declaration_list()
self.following.pop()
if self.failed:
return retval
self.match(self.input, 44, self.FOLLOW_44_in_struct_or_union_specifier503)
if self.failed:
return retval
elif alt15 == 2:
# C.g:236:4: struct_or_union IDENTIFIER
self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier508)
self.struct_or_union()
self.following.pop()
if self.failed:
return retval
self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier510)
if self.failed:
return retval
retval.stop = self.input.LT(-1)
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 11, struct_or_union_specifier_StartIndex)
pass
return retval
# $ANTLR end struct_or_union_specifier
# $ANTLR start struct_or_union
# C.g:239:1: struct_or_union : ( 'struct' | 'union' );
def struct_or_union(self, ):
struct_or_union_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 12):
return
# C.g:240:2: ( 'struct' | 'union' )
# C.g:
if (45 <= self.input.LA(1) <= 46):
self.input.consume();
self.errorRecovery = False
self.failed = False
else:
if self.backtracking > 0:
self.failed = True
return
mse = MismatchedSetException(None, self.input)
self.recoverFromMismatchedSet(
self.input, mse, self.FOLLOW_set_in_struct_or_union0
)
raise mse
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 12, struct_or_union_StartIndex)
pass
return
# $ANTLR end struct_or_union
# $ANTLR start struct_declaration_list
# C.g:244:1: struct_declaration_list : ( struct_declaration )+ ;
def struct_declaration_list(self, ):
struct_declaration_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 13):
return
# C.g:245:2: ( ( struct_declaration )+ )
# C.g:245:4: ( struct_declaration )+
# C.g:245:4: ( struct_declaration )+
cnt16 = 0
while True: #loop16
alt16 = 2
LA16_0 = self.input.LA(1)
if (LA16_0 == IDENTIFIER or (34 <= LA16_0 <= 42) or (45 <= LA16_0 <= 46) or (48 <= LA16_0 <= 61)) :
alt16 = 1
if alt16 == 1:
# C.g:0:0: struct_declaration
self.following.append(self.FOLLOW_struct_declaration_in_struct_declaration_list537)
self.struct_declaration()
self.following.pop()
if self.failed:
return
else:
if cnt16 >= 1:
break #loop16
if self.backtracking > 0:
self.failed = True
return
eee = EarlyExitException(16, self.input)
raise eee
cnt16 += 1
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 13, struct_declaration_list_StartIndex)
pass
return
# $ANTLR end struct_declaration_list
# $ANTLR start struct_declaration
# C.g:248:1: struct_declaration : specifier_qualifier_list struct_declarator_list ';' ;
def struct_declaration(self, ):
struct_declaration_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 14):
return
# C.g:249:2: ( specifier_qualifier_list struct_declarator_list ';' )
# C.g:249:4: specifier_qualifier_list struct_declarator_list ';'
self.following.append(self.FOLLOW_specifier_qualifier_list_in_struct_declaration549)
self.specifier_qualifier_list()
self.following.pop()
if self.failed:
return
self.following.append(self.FOLLOW_struct_declarator_list_in_struct_declaration551)
self.struct_declarator_list()
self.following.pop()
if self.failed:
return
self.match(self.input, 25, self.FOLLOW_25_in_struct_declaration553)
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 14, struct_declaration_StartIndex)
pass
return
# $ANTLR end struct_declaration
# $ANTLR start specifier_qualifier_list
# C.g:252:1: specifier_qualifier_list : ( type_qualifier | type_specifier )+ ;
def specifier_qualifier_list(self, ):
specifier_qualifier_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 15):
return
# C.g:253:2: ( ( type_qualifier | type_specifier )+ )
# C.g:253:4: ( type_qualifier | type_specifier )+
# C.g:253:4: ( type_qualifier | type_specifier )+
cnt17 = 0
while True: #loop17
alt17 = 3
LA17 = self.input.LA(1)
if LA17 == 58:
LA17_2 = self.input.LA(2)
if (self.synpred39()) :
alt17 = 1
elif LA17 == 59:
LA17_3 = self.input.LA(2)
if (self.synpred39()) :
alt17 = 1
elif LA17 == 60:
LA17_4 = self.input.LA(2)
if (self.synpred39()) :
alt17 = 1
elif LA17 == IDENTIFIER:
LA17 = self.input.LA(2)
if LA17 == EOF or LA17 == IDENTIFIER or LA17 == 34 or LA17 == 35 or LA17 == 36 or LA17 == 37 or LA17 == 38 or LA17 == 39 or LA17 == 40 or LA17 == 41 or LA17 == 42 or LA17 == 45 or LA17 == 46 or LA17 == 48 or LA17 == 49 or LA17 == 50 or LA17 == 51 or LA17 == 52 or LA17 == 53 or LA17 == 54 or LA17 == 55 or LA17 == 56 or LA17 == 57 or LA17 == 58 or LA17 == 59 or LA17 == 60 or LA17 == 61 or LA17 == 63 or LA17 == 66:
alt17 = 2
elif LA17 == 62:
LA17_94 = self.input.LA(3)
if (self.synpred40()) :
alt17 = 2
elif LA17 == 47:
LA17_95 = self.input.LA(3)
if (self.synpred40()) :
alt17 = 2
elif LA17 == 64:
LA17_96 = self.input.LA(3)
if (self.synpred40()) :
alt17 = 2
elif LA17 == 49 or LA17 == 50 or LA17 == 51 or LA17 == 52 or LA17 == 53 or LA17 == 54 or LA17 == 55 or LA17 == 56 or LA17 == 57 or LA17 == 61:
alt17 = 1
elif LA17 == 34 or LA17 == 35 or LA17 == 36 or LA17 == 37 or LA17 == 38 or LA17 == 39 or LA17 == 40 or LA17 == 41 or LA17 == 42 or LA17 == 45 or LA17 == 46 or LA17 == 48:
alt17 = 2
if alt17 == 1:
# C.g:253:6: type_qualifier
self.following.append(self.FOLLOW_type_qualifier_in_specifier_qualifier_list566)
self.type_qualifier()
self.following.pop()
if self.failed:
return
elif alt17 == 2:
# C.g:253:23: type_specifier
self.following.append(self.FOLLOW_type_specifier_in_specifier_qualifier_list570)
self.type_specifier()
self.following.pop()
if self.failed:
return
else:
if cnt17 >= 1:
break #loop17
if self.backtracking > 0:
self.failed = True
return
eee = EarlyExitException(17, self.input)
raise eee
cnt17 += 1
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 15, specifier_qualifier_list_StartIndex)
pass
return
# $ANTLR end specifier_qualifier_list
# $ANTLR start struct_declarator_list
# C.g:256:1: struct_declarator_list : struct_declarator ( ',' struct_declarator )* ;
def struct_declarator_list(self, ):
struct_declarator_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 16):
return
# C.g:257:2: ( struct_declarator ( ',' struct_declarator )* )
# C.g:257:4: struct_declarator ( ',' struct_declarator )*
self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list584)
self.struct_declarator()
self.following.pop()
if self.failed:
return
# C.g:257:22: ( ',' struct_declarator )*
while True: #loop18
alt18 = 2
LA18_0 = self.input.LA(1)
if (LA18_0 == 27) :
alt18 = 1
if alt18 == 1:
# C.g:257:23: ',' struct_declarator
self.match(self.input, 27, self.FOLLOW_27_in_struct_declarator_list587)
if self.failed:
return
self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list589)
self.struct_declarator()
self.following.pop()
if self.failed:
return
else:
break #loop18
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 16, struct_declarator_list_StartIndex)
pass
return
# $ANTLR end struct_declarator_list
# $ANTLR start struct_declarator
# C.g:260:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );
def struct_declarator(self, ):
struct_declarator_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 17):
return
# C.g:261:2: ( declarator ( ':' constant_expression )? | ':' constant_expression )
alt20 = 2
LA20_0 = self.input.LA(1)
if (LA20_0 == IDENTIFIER or (58 <= LA20_0 <= 60) or LA20_0 == 62 or LA20_0 == 66) :
alt20 = 1
elif (LA20_0 == 47) :
alt20 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("260:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );", 20, 0, self.input)
raise nvae
if alt20 == 1:
# C.g:261:4: declarator ( ':' constant_expression )?
self.following.append(self.FOLLOW_declarator_in_struct_declarator602)
self.declarator()
self.following.pop()
if self.failed:
return
# C.g:261:15: ( ':' constant_expression )?
alt19 = 2
LA19_0 = self.input.LA(1)
if (LA19_0 == 47) :
alt19 = 1
if alt19 == 1:
# C.g:261:16: ':' constant_expression
self.match(self.input, 47, self.FOLLOW_47_in_struct_declarator605)
if self.failed:
return
self.following.append(self.FOLLOW_constant_expression_in_struct_declarator607)
self.constant_expression()
self.following.pop()
if self.failed:
return
elif alt20 == 2:
# C.g:262:4: ':' constant_expression
self.match(self.input, 47, self.FOLLOW_47_in_struct_declarator614)
if self.failed:
return
self.following.append(self.FOLLOW_constant_expression_in_struct_declarator616)
self.constant_expression()
self.following.pop()
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 17, struct_declarator_StartIndex)
pass
return
# $ANTLR end struct_declarator
class enum_specifier_return(object):
def __init__(self):
self.start = None
self.stop = None
# $ANTLR start enum_specifier
# C.g:265: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 retval
# C.g:267:2: ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER )
alt23 = 3
LA23_0 = self.input.LA(1)
if (LA23_0 == 48) :
LA23_1 = self.input.LA(2)
if (LA23_1 == IDENTIFIER) :
LA23_2 = self.input.LA(3)
if (LA23_2 == 43) :
alt23 = 2
elif (LA23_2 == EOF or LA23_2 == IDENTIFIER or LA23_2 == 25 or LA23_2 == 27 or (29 <= LA23_2 <= 42) or (45 <= LA23_2 <= 64) or LA23_2 == 66) :
alt23 = 3
else:
if self.backtracking > 0:
self.failed = True
return retval
nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 2, self.input)
raise nvae
elif (LA23_1 == 43) :
alt23 = 1
else:
if self.backtracking > 0:
self.failed = True
return retval
nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 1, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
return retval
nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 0, self.input)
raise nvae
if alt23 == 1:
# C.g:267:4: 'enum' '{' enumerator_list ( ',' )? '}'
self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier634)
if self.failed:
return retval
self.match(self.input, 43, self.FOLLOW_43_in_enum_specifier636)
if self.failed:
return retval
self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier638)
self.enumerator_list()
self.following.pop()
if self.failed:
return retval
# C.g:267:31: ( ',' )?
alt21 = 2
LA21_0 = self.input.LA(1)
if (LA21_0 == 27) :
alt21 = 1
if alt21 == 1:
# C.g:0:0: ','
self.match(self.input, 27, self.FOLLOW_27_in_enum_specifier640)
if self.failed:
return retval
self.match(self.input, 44, self.FOLLOW_44_in_enum_specifier643)
if self.failed:
return retval
elif alt23 == 2:
# C.g:268:4: 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}'
self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier648)
if self.failed:
return retval
self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier650)
if self.failed:
return retval
self.match(self.input, 43, self.FOLLOW_43_in_enum_specifier652)
if self.failed:
return retval
self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier654)
self.enumerator_list()
self.following.pop()
if self.failed:
return retval
# C.g:268:42: ( ',' )?
alt22 = 2
LA22_0 = self.input.LA(1)
if (LA22_0 == 27) :
alt22 = 1
if alt22 == 1:
# C.g:0:0: ','
self.match(self.input, 27, self.FOLLOW_27_in_enum_specifier656)
if self.failed:
return retval
self.match(self.input, 44, self.FOLLOW_44_in_enum_specifier659)
if self.failed:
return retval
elif alt23 == 3:
# C.g:269:4: 'enum' IDENTIFIER
self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier664)
if self.failed:
return retval
self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier666)
if self.failed:
return retval
retval.stop = self.input.LT(-1)
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 18, enum_specifier_StartIndex)
pass
return retval
# $ANTLR end enum_specifier
# $ANTLR start enumerator_list
# C.g:272:1: enumerator_list : enumerator ( ',' enumerator )* ;
def enumerator_list(self, ):
enumerator_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 19):
return
# C.g:273:2: ( enumerator ( ',' enumerator )* )
# C.g:273:4: enumerator ( ',' enumerator )*
self.following.append(self.FOLLOW_enumerator_in_enumerator_list677)
self.enumerator()
self.following.pop()
if self.failed:
return
# C.g:273:15: ( ',' enumerator )*
while True: #loop24
alt24 = 2
LA24_0 = self.input.LA(1)
if (LA24_0 == 27) :
LA24_1 = self.input.LA(2)
if (LA24_1 == IDENTIFIER) :
alt24 = 1
if alt24 == 1:
# C.g:273:16: ',' enumerator
self.match(self.input, 27, self.FOLLOW_27_in_enumerator_list680)
if self.failed:
return
self.following.append(self.FOLLOW_enumerator_in_enumerator_list682)
self.enumerator()
self.following.pop()
if self.failed:
return
else:
break #loop24
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 19, enumerator_list_StartIndex)
pass
return
# $ANTLR end enumerator_list
# $ANTLR start enumerator
# C.g:276:1: enumerator : IDENTIFIER ( '=' constant_expression )? ;
def enumerator(self, ):
enumerator_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 20):
return
# C.g:277:2: ( IDENTIFIER ( '=' constant_expression )? )
# C.g:277:4: IDENTIFIER ( '=' constant_expression )?
self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enumerator695)
if self.failed:
return
# C.g:277:15: ( '=' constant_expression )?
alt25 = 2
LA25_0 = self.input.LA(1)
if (LA25_0 == 28) :
alt25 = 1
if alt25 == 1:
# C.g:277:16: '=' constant_expression
self.match(self.input, 28, self.FOLLOW_28_in_enumerator698)
if self.failed:
return
self.following.append(self.FOLLOW_constant_expression_in_enumerator700)
self.constant_expression()
self.following.pop()
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 20, enumerator_StartIndex)
pass
return
# $ANTLR end enumerator
# $ANTLR start type_qualifier
# C.g:280:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTIONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' );
def type_qualifier(self, ):
type_qualifier_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 21):
return
# C.g:281:2: ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTIONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' )
# C.g:
if (49 <= self.input.LA(1) <= 61):
self.input.consume();
self.errorRecovery = False
self.failed = False
else:
if self.backtracking > 0:
self.failed = True
return
mse = MismatchedSetException(None, self.input)
self.recoverFromMismatchedSet(
self.input, mse, self.FOLLOW_set_in_type_qualifier0
)
raise mse
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 21, type_qualifier_StartIndex)
pass
return
# $ANTLR end type_qualifier
class declarator_return(object):
def __init__(self):
self.start = None
self.stop = None
# $ANTLR start declarator
# C.g:296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );
def declarator(self, ):
retval = self.declarator_return()
retval.start = self.input.LT(1)
declarator_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 22):
return retval
# C.g:297:2: ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer )
alt30 = 2
LA30_0 = self.input.LA(1)
if (LA30_0 == 66) :
LA30_1 = self.input.LA(2)
if (self.synpred66()) :
alt30 = 1
elif (True) :
alt30 = 2
else:
if self.backtracking > 0:
self.failed = True
return retval
nvae = NoViableAltException("296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );", 30, 1, self.input)
raise nvae
elif (LA30_0 == IDENTIFIER or (58 <= LA30_0 <= 60) or LA30_0 == 62) :
alt30 = 1
else:
if self.backtracking > 0:
self.failed = True
return retval
nvae = NoViableAltException("296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );", 30, 0, self.input)
raise nvae
if alt30 == 1:
# C.g:297:4: ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator
# C.g:297:4: ( pointer )?
alt26 = 2
LA26_0 = self.input.LA(1)
if (LA26_0 == 66) :
alt26 = 1
if alt26 == 1:
# C.g:0:0: pointer
self.following.append(self.FOLLOW_pointer_in_declarator784)
self.pointer()
self.following.pop()
if self.failed:
return retval
# C.g:297:13: ( 'EFIAPI' )?
alt27 = 2
LA27_0 = self.input.LA(1)
if (LA27_0 == 58) :
alt27 = 1
if alt27 == 1:
# C.g:297:14: 'EFIAPI'
self.match(self.input, 58, self.FOLLOW_58_in_declarator788)
if self.failed:
return retval
# C.g:297:25: ( 'EFI_BOOTSERVICE' )?
alt28 = 2
LA28_0 = self.input.LA(1)
if (LA28_0 == 59) :
alt28 = 1
if alt28 == 1:
# C.g:297:26: 'EFI_BOOTSERVICE'
self.match(self.input, 59, self.FOLLOW_59_in_declarator793)
if self.failed:
return retval
# C.g:297:46: ( 'EFI_RUNTIMESERVICE' )?
alt29 = 2
LA29_0 = self.input.LA(1)
if (LA29_0 == 60) :
alt29 = 1
if alt29 == 1:
# C.g:297:47: 'EFI_RUNTIMESERVICE'
self.match(self.input, 60, self.FOLLOW_60_in_declarator798)
if self.failed:
return retval
self.following.append(self.FOLLOW_direct_declarator_in_declarator802)
self.direct_declarator()
self.following.pop()
if self.failed:
return retval
elif alt30 == 2:
# C.g:299:4: pointer
self.following.append(self.FOLLOW_pointer_in_declarator808)
self.pointer()
self.following.pop()
if self.failed:
return retval
retval.stop = self.input.LT(-1)
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 22, declarator_StartIndex)
pass
return retval
# $ANTLR end declarator
# $ANTLR start direct_declarator
# C.g:302:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );
def direct_declarator(self, ):
direct_declarator_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 23):
return
# C.g:303:2: ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ )
alt34 = 2
LA34_0 = self.input.LA(1)
if (LA34_0 == IDENTIFIER) :
alt34 = 1
elif (LA34_0 == 62) :
alt34 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("302:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );", 34, 0, self.input)
raise nvae
if alt34 == 1:
# C.g:303:4: IDENTIFIER ( declarator_suffix )*
self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_direct_declarator819)
if self.failed:
return
# C.g:303:15: ( declarator_suffix )*
while True: #loop31
alt31 = 2
LA31_0 = self.input.LA(1)
if (LA31_0 == 62) :
LA31 = self.input.LA(2)
if LA31 == 63:
LA31_30 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 58:
LA31_31 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 66:
LA31_32 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 59:
LA31_33 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 60:
LA31_34 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == IDENTIFIER:
LA31_35 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 29 or LA31 == 30 or LA31 == 31 or LA31 == 32 or LA31 == 33:
LA31_37 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 34:
LA31_38 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 35:
LA31_39 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 36:
LA31_40 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 37:
LA31_41 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 38:
LA31_42 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 39:
LA31_43 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 40:
LA31_44 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 41:
LA31_45 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 42:
LA31_46 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 45 or LA31 == 46:
LA31_47 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 48:
LA31_48 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 49 or LA31 == 50 or LA31 == 51 or LA31 == 52 or LA31 == 53 or LA31 == 54 or LA31 == 55 or LA31 == 56 or LA31 == 57 or LA31 == 61:
LA31_49 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif (LA31_0 == 64) :
LA31 = self.input.LA(2)
if LA31 == 65:
LA31_51 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 62:
LA31_52 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == IDENTIFIER:
LA31_53 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == HEX_LITERAL:
LA31_54 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == OCTAL_LITERAL:
LA31_55 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == DECIMAL_LITERAL:
LA31_56 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == CHARACTER_LITERAL:
LA31_57 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == STRING_LITERAL:
LA31_58 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == FLOATING_POINT_LITERAL:
LA31_59 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 72:
LA31_60 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 73:
LA31_61 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 66 or LA31 == 68 or LA31 == 69 or LA31 == 77 or LA31 == 78 or LA31 == 79:
LA31_62 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
elif LA31 == 74:
LA31_63 = self.input.LA(3)
if (self.synpred67()) :
alt31 = 1
if alt31 == 1:
# C.g:0:0: declarator_suffix
self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator821)
self.declarator_suffix()
self.following.pop()
if self.failed:
return
else:
break #loop31
elif alt34 == 2:
# C.g:304:4: '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+
self.match(self.input, 62, self.FOLLOW_62_in_direct_declarator827)
if self.failed:
return
# C.g:304:8: ( 'EFIAPI' )?
alt32 = 2
LA32_0 = self.input.LA(1)
if (LA32_0 == 58) :
LA32_1 = self.input.LA(2)
if (self.synpred69()) :
alt32 = 1
if alt32 == 1:
# C.g:304:9: 'EFIAPI'
self.match(self.input, 58, self.FOLLOW_58_in_direct_declarator830)
if self.failed:
return
self.following.append(self.FOLLOW_declarator_in_direct_declarator834)
self.declarator()
self.following.pop()
if self.failed:
return
self.match(self.input, 63, self.FOLLOW_63_in_direct_declarator836)
if self.failed:
return
# C.g:304:35: ( declarator_suffix )+
cnt33 = 0
while True: #loop33
alt33 = 2
LA33_0 = self.input.LA(1)
if (LA33_0 == 62) :
LA33 = self.input.LA(2)
if LA33 == 63:
LA33_30 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 58:
LA33_31 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 66:
LA33_32 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 59:
LA33_33 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 60:
LA33_34 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == IDENTIFIER:
LA33_35 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 29 or LA33 == 30 or LA33 == 31 or LA33 == 32 or LA33 == 33:
LA33_37 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 34:
LA33_38 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 35:
LA33_39 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 36:
LA33_40 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 37:
LA33_41 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 38:
LA33_42 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 39:
LA33_43 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 40:
LA33_44 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 41:
LA33_45 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 42:
LA33_46 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 45 or LA33 == 46:
LA33_47 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 48:
LA33_48 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 49 or LA33 == 50 or LA33 == 51 or LA33 == 52 or LA33 == 53 or LA33 == 54 or LA33 == 55 or LA33 == 56 or LA33 == 57 or LA33 == 61:
LA33_49 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif (LA33_0 == 64) :
LA33 = self.input.LA(2)
if LA33 == 65:
LA33_51 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 62:
LA33_52 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == IDENTIFIER:
LA33_53 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == HEX_LITERAL:
LA33_54 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == OCTAL_LITERAL:
LA33_55 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == DECIMAL_LITERAL:
LA33_56 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == CHARACTER_LITERAL:
LA33_57 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == STRING_LITERAL:
LA33_58 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == FLOATING_POINT_LITERAL:
LA33_59 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 72:
LA33_60 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 73:
LA33_61 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 66 or LA33 == 68 or LA33 == 69 or LA33 == 77 or LA33 == 78 or LA33 == 79:
LA33_62 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
elif LA33 == 74:
LA33_63 = self.input.LA(3)
if (self.synpred70()) :
alt33 = 1
if alt33 == 1:
# C.g:0:0: declarator_suffix
self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator838)
self.declarator_suffix()
self.following.pop()
if self.failed:
return
else:
if cnt33 >= 1:
break #loop33
if self.backtracking > 0:
self.failed = True
return
eee = EarlyExitException(33, self.input)
raise eee
cnt33 += 1
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 23, direct_declarator_StartIndex)
pass
return
# $ANTLR end direct_declarator
# $ANTLR start declarator_suffix
# C.g:307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );
def declarator_suffix(self, ):
declarator_suffix_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 24):
return
# C.g:308:2: ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' )
alt35 = 5
LA35_0 = self.input.LA(1)
if (LA35_0 == 64) :
LA35_1 = self.input.LA(2)
if (LA35_1 == 65) :
alt35 = 2
elif ((IDENTIFIER <= LA35_1 <= FLOATING_POINT_LITERAL) or LA35_1 == 62 or LA35_1 == 66 or (68 <= LA35_1 <= 69) or (72 <= LA35_1 <= 74) or (77 <= LA35_1 <= 79)) :
alt35 = 1
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 1, self.input)
raise nvae
elif (LA35_0 == 62) :
LA35 = self.input.LA(2)
if LA35 == 63:
alt35 = 5
elif LA35 == 29 or LA35 == 30 or LA35 == 31 or LA35 == 32 or LA35 == 33 or LA35 == 34 or LA35 == 35 or LA35 == 36 or LA35 == 37 or LA35 == 38 or LA35 == 39 or LA35 == 40 or LA35 == 41 or LA35 == 42 or LA35 == 45 or LA35 == 46 or LA35 == 48 or LA35 == 49 or LA35 == 50 or LA35 == 51 or LA35 == 52 or LA35 == 53 or LA35 == 54 or LA35 == 55 or LA35 == 56 or LA35 == 57 or LA35 == 58 or LA35 == 59 or LA35 == 60 or LA35 == 61 or LA35 == 66:
alt35 = 3
elif LA35 == IDENTIFIER:
LA35_29 = self.input.LA(3)
if (self.synpred73()) :
alt35 = 3
elif (self.synpred74()) :
alt35 = 4
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 29, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 2, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 0, self.input)
raise nvae
if alt35 == 1:
# C.g:308:6: '[' constant_expression ']'
self.match(self.input, 64, self.FOLLOW_64_in_declarator_suffix852)
if self.failed:
return
self.following.append(self.FOLLOW_constant_expression_in_declarator_suffix854)
self.constant_expression()
self.following.pop()
if self.failed:
return
self.match(self.input, 65, self.FOLLOW_65_in_declarator_suffix856)
if self.failed:
return
elif alt35 == 2:
# C.g:309:9: '[' ']'
self.match(self.input, 64, self.FOLLOW_64_in_declarator_suffix866)
if self.failed:
return
self.match(self.input, 65, self.FOLLOW_65_in_declarator_suffix868)
if self.failed:
return
elif alt35 == 3:
# C.g:310:9: '(' parameter_type_list ')'
self.match(self.input, 62, self.FOLLOW_62_in_declarator_suffix878)
if self.failed:
return
self.following.append(self.FOLLOW_parameter_type_list_in_declarator_suffix880)
self.parameter_type_list()
self.following.pop()
if self.failed:
return
self.match(self.input, 63, self.FOLLOW_63_in_declarator_suffix882)
if self.failed:
return
elif alt35 == 4:
# C.g:311:9: '(' identifier_list ')'
self.match(self.input, 62, self.FOLLOW_62_in_declarator_suffix892)
if self.failed:
return
self.following.append(self.FOLLOW_identifier_list_in_declarator_suffix894)
self.identifier_list()
self.following.pop()
if self.failed:
return
self.match(self.input, 63, self.FOLLOW_63_in_declarator_suffix896)
if self.failed:
return
elif alt35 == 5:
# C.g:312:9: '(' ')'
self.match(self.input, 62, self.FOLLOW_62_in_declarator_suffix906)
if self.failed:
return
self.match(self.input, 63, self.FOLLOW_63_in_declarator_suffix908)
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 24, declarator_suffix_StartIndex)
pass
return
# $ANTLR end declarator_suffix
# $ANTLR start pointer
# C.g:315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );
def pointer(self, ):
pointer_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 25):
return
# C.g:316:2: ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' )
alt38 = 3
LA38_0 = self.input.LA(1)
if (LA38_0 == 66) :
LA38 = self.input.LA(2)
if LA38 == 66:
LA38_2 = self.input.LA(3)
if (self.synpred78()) :
alt38 = 2
elif (True) :
alt38 = 3
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 2, self.input)
raise nvae
elif LA38 == 58:
LA38_3 = self.input.LA(3)
if (self.synpred77()) :
alt38 = 1
elif (True) :
alt38 = 3
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 3, self.input)
raise nvae
elif LA38 == 59:
LA38_4 = self.input.LA(3)
if (self.synpred77()) :
alt38 = 1
elif (True) :
alt38 = 3
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 4, self.input)
raise nvae
elif LA38 == 60:
LA38_5 = self.input.LA(3)
if (self.synpred77()) :
alt38 = 1
elif (True) :
alt38 = 3
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 5, self.input)
raise nvae
elif LA38 == EOF or LA38 == IDENTIFIER or LA38 == 25 or LA38 == 26 or LA38 == 27 or LA38 == 28 or LA38 == 29 or LA38 == 30 or LA38 == 31 or LA38 == 32 or LA38 == 33 or LA38 == 34 or LA38 == 35 or LA38 == 36 or LA38 == 37 or LA38 == 38 or LA38 == 39 or LA38 == 40 or LA38 == 41 or LA38 == 42 or LA38 == 43 or LA38 == 45 or LA38 == 46 or LA38 == 47 or LA38 == 48 or LA38 == 62 or LA38 == 63 or LA38 == 64:
alt38 = 3
elif LA38 == 53:
LA38_21 = self.input.LA(3)
if (self.synpred77()) :
alt38 = 1
elif (True) :
alt38 = 3
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 21, self.input)
raise nvae
elif LA38 == 49 or LA38 == 50 or LA38 == 51 or LA38 == 52 or LA38 == 54 or LA38 == 55 or LA38 == 56 or LA38 == 57 or LA38 == 61:
LA38_29 = self.input.LA(3)
if (self.synpred77()) :
alt38 = 1
elif (True) :
alt38 = 3
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 29, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 1, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 0, self.input)
raise nvae
if alt38 == 1:
# C.g:316:4: '*' ( type_qualifier )+ ( pointer )?
self.match(self.input, 66, self.FOLLOW_66_in_pointer919)
if self.failed:
return
# C.g:316:8: ( type_qualifier )+
cnt36 = 0
while True: #loop36
alt36 = 2
LA36 = self.input.LA(1)
if LA36 == 58:
LA36_2 = self.input.LA(2)
if (self.synpred75()) :
alt36 = 1
elif LA36 == 59:
LA36_3 = self.input.LA(2)
if (self.synpred75()) :
alt36 = 1
elif LA36 == 60:
LA36_4 = self.input.LA(2)
if (self.synpred75()) :
alt36 = 1
elif LA36 == 53:
LA36_20 = self.input.LA(2)
if (self.synpred75()) :
alt36 = 1
elif LA36 == 49 or LA36 == 50 or LA36 == 51 or LA36 == 52 or LA36 == 54 or LA36 == 55 or LA36 == 56 or LA36 == 57 or LA36 == 61:
LA36_28 = self.input.LA(2)
if (self.synpred75()) :
alt36 = 1
if alt36 == 1:
# C.g:0:0: type_qualifier
self.following.append(self.FOLLOW_type_qualifier_in_pointer921)
self.type_qualifier()
self.following.pop()
if self.failed:
return
else:
if cnt36 >= 1:
break #loop36
if self.backtracking > 0:
self.failed = True
return
eee = EarlyExitException(36, self.input)
raise eee
cnt36 += 1
# C.g:316:24: ( pointer )?
alt37 = 2
LA37_0 = self.input.LA(1)
if (LA37_0 == 66) :
LA37_1 = self.input.LA(2)
if (self.synpred76()) :
alt37 = 1
if alt37 == 1:
# C.g:0:0: pointer
self.following.append(self.FOLLOW_pointer_in_pointer924)
self.pointer()
self.following.pop()
if self.failed:
return
elif alt38 == 2:
# C.g:317:4: '*' pointer
self.match(self.input, 66, self.FOLLOW_66_in_pointer930)
if self.failed:
return
self.following.append(self.FOLLOW_pointer_in_pointer932)
self.pointer()
self.following.pop()
if self.failed:
return
elif alt38 == 3:
# C.g:318:4: '*'
self.match(self.input, 66, self.FOLLOW_66_in_pointer937)
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 25, pointer_StartIndex)
pass
return
# $ANTLR end pointer
# $ANTLR start parameter_type_list
# C.g:321:1: parameter_type_list : parameter_list ( ',' ( 'OPTIONAL' )? '...' )? ;
def parameter_type_list(self, ):
parameter_type_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 26):
return
# C.g:322:2: ( parameter_list ( ',' ( 'OPTIONAL' )? '...' )? )
# C.g:322:4: parameter_list ( ',' ( 'OPTIONAL' )? '...' )?
self.following.append(self.FOLLOW_parameter_list_in_parameter_type_list948)
self.parameter_list()
self.following.pop()
if self.failed:
return
# C.g:322:19: ( ',' ( 'OPTIONAL' )? '...' )?
alt40 = 2
LA40_0 = self.input.LA(1)
if (LA40_0 == 27) :
alt40 = 1
if alt40 == 1:
# C.g:322:20: ',' ( 'OPTIONAL' )? '...'
self.match(self.input, 27, self.FOLLOW_27_in_parameter_type_list951)
if self.failed:
return
# C.g:322:24: ( 'OPTIONAL' )?
alt39 = 2
LA39_0 = self.input.LA(1)
if (LA39_0 == 53) :
alt39 = 1
if alt39 == 1:
# C.g:322:25: 'OPTIONAL'
self.match(self.input, 53, self.FOLLOW_53_in_parameter_type_list954)
if self.failed:
return
self.match(self.input, 67, self.FOLLOW_67_in_parameter_type_list958)
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 26, parameter_type_list_StartIndex)
pass
return
# $ANTLR end parameter_type_list
# $ANTLR start parameter_list
# C.g:325:1: parameter_list : parameter_declaration ( ',' ( 'OPTIONAL' )? parameter_declaration )* ;
def parameter_list(self, ):
parameter_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 27):
return
# C.g:326:2: ( parameter_declaration ( ',' ( 'OPTIONAL' )? parameter_declaration )* )
# C.g:326:4: parameter_declaration ( ',' ( 'OPTIONAL' )? parameter_declaration )*
self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list971)
self.parameter_declaration()
self.following.pop()
if self.failed:
return
# C.g:326:26: ( ',' ( 'OPTIONAL' )? parameter_declaration )*
while True: #loop42
alt42 = 2
LA42_0 = self.input.LA(1)
if (LA42_0 == 27) :
LA42_1 = self.input.LA(2)
if (LA42_1 == 53) :
LA42_3 = self.input.LA(3)
if (self.synpred82()) :
alt42 = 1
elif (LA42_1 == IDENTIFIER or (29 <= LA42_1 <= 42) or (45 <= LA42_1 <= 46) or (48 <= LA42_1 <= 52) or (54 <= LA42_1 <= 61) or LA42_1 == 66) :
alt42 = 1
if alt42 == 1:
# C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declaration
self.match(self.input, 27, self.FOLLOW_27_in_parameter_list974)
if self.failed:
return
# C.g:326:31: ( 'OPTIONAL' )?
alt41 = 2
LA41_0 = self.input.LA(1)
if (LA41_0 == 53) :
LA41_1 = self.input.LA(2)
if (self.synpred81()) :
alt41 = 1
if alt41 == 1:
# C.g:326:32: 'OPTIONAL'
self.match(self.input, 53, self.FOLLOW_53_in_parameter_list977)
if self.failed:
return
self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list981)
self.parameter_declaration()
self.following.pop()
if self.failed:
return
else:
break #loop42
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 27, parameter_list_StartIndex)
pass
return
# $ANTLR end parameter_list
# $ANTLR start parameter_declaration
# C.g:329:1: parameter_declaration : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );
def parameter_declaration(self, ):
parameter_declaration_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 28):
return
# C.g:330:2: ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER )
alt46 = 2
LA46 = self.input.LA(1)
if LA46 == 29 or LA46 == 30 or LA46 == 31 or LA46 == 32 or LA46 == 33 or LA46 == 34 or LA46 == 35 or LA46 == 36 or LA46 == 37 or LA46 == 38 or LA46 == 39 or LA46 == 40 or LA46 == 41 or LA46 == 42 or LA46 == 45 or LA46 == 46 or LA46 == 48 or LA46 == 49 or LA46 == 50 or LA46 == 51 or LA46 == 52 or LA46 == 53 or LA46 == 54 or LA46 == 55 or LA46 == 56 or LA46 == 57 or LA46 == 58 or LA46 == 59 or LA46 == 60 or LA46 == 61:
alt46 = 1
elif LA46 == IDENTIFIER:
LA46_13 = self.input.LA(2)
if (self.synpred86()) :
alt46 = 1
elif (True) :
alt46 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("329:1: parameter_declaration : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 13, self.input)
raise nvae
elif LA46 == 66:
alt46 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("329:1: parameter_declaration : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 0, self.input)
raise nvae
if alt46 == 1:
# C.g:330:4: declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )?
self.following.append(self.FOLLOW_declaration_specifiers_in_parameter_declaration994)
self.declaration_specifiers()
self.following.pop()
if self.failed:
return
# C.g:330:27: ( declarator | abstract_declarator )*
while True: #loop43
alt43 = 3
LA43 = self.input.LA(1)
if LA43 == 66:
LA43_5 = self.input.LA(2)
if (self.synpred83()) :
alt43 = 1
elif (self.synpred84()) :
alt43 = 2
elif LA43 == IDENTIFIER or LA43 == 58 or LA43 == 59 or LA43 == 60:
alt43 = 1
elif LA43 == 62:
LA43 = self.input.LA(2)
if LA43 == 29 or LA43 == 30 or LA43 == 31 or LA43 == 32 or LA43 == 33 or LA43 == 34 or LA43 == 35 or LA43 == 36 or LA43 == 37 or LA43 == 38 or LA43 == 39 or LA43 == 40 or LA43 == 41 or LA43 == 42 or LA43 == 45 or LA43 == 46 or LA43 == 48 or LA43 == 49 or LA43 == 50 or LA43 == 51 or LA43 == 52 or LA43 == 53 or LA43 == 54 or LA43 == 55 or LA43 == 56 or LA43 == 57 or LA43 == 61 or LA43 == 63 or LA43 == 64:
alt43 = 2
elif LA43 == IDENTIFIER:
LA43_37 = self.input.LA(3)
if (self.synpred83()) :
alt43 = 1
elif (self.synpred84()) :
alt43 = 2
elif LA43 == 58:
LA43_38 = self.input.LA(3)
if (self.synpred83()) :
alt43 = 1
elif (self.synpred84()) :
alt43 = 2
elif LA43 == 66:
LA43_39 = self.input.LA(3)
if (self.synpred83()) :
alt43 = 1
elif (self.synpred84()) :
alt43 = 2
elif LA43 == 59:
LA43_40 = self.input.LA(3)
if (self.synpred83()) :
alt43 = 1
elif (self.synpred84()) :
alt43 = 2
elif LA43 == 60:
LA43_41 = self.input.LA(3)
if (self.synpred83()) :
alt43 = 1
elif (self.synpred84()) :
alt43 = 2
elif LA43 == 62:
LA43_43 = self.input.LA(3)
if (self.synpred83()) :
alt43 = 1
elif (self.synpred84()) :
alt43 = 2
elif LA43 == 64:
alt43 = 2
if alt43 == 1:
# C.g:330:28: declarator
self.following.append(self.FOLLOW_declarator_in_parameter_declaration997)
self.declarator()
self.following.pop()
if self.failed:
return
elif alt43 == 2:
# C.g:330:39: abstract_declarator
self.following.append(self.FOLLOW_abstract_declarator_in_parameter_declaration999)
self.abstract_declarator()
self.following.pop()
if self.failed:
return
else:
break #loop43
# C.g:330:61: ( 'OPTIONAL' )?
alt44 = 2
LA44_0 = self.input.LA(1)
if (LA44_0 == 53) :
alt44 = 1
if alt44 == 1:
# C.g:330:62: 'OPTIONAL'
self.match(self.input, 53, self.FOLLOW_53_in_parameter_declaration1004)
if self.failed:
return
elif alt46 == 2:
# C.g:332:4: ( pointer )* IDENTIFIER
# C.g:332:4: ( pointer )*
while True: #loop45
alt45 = 2
LA45_0 = self.input.LA(1)
if (LA45_0 == 66) :
alt45 = 1
if alt45 == 1:
# C.g:0:0: pointer
self.following.append(self.FOLLOW_pointer_in_parameter_declaration1013)
self.pointer()
self.following.pop()
if self.failed:
return
else:
break #loop45
self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_parameter_declaration1016)
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 28, parameter_declaration_StartIndex)
pass
return
# $ANTLR end parameter_declaration
# $ANTLR start identifier_list
# C.g:335:1: identifier_list : IDENTIFIER ( ',' IDENTIFIER )* ;
def identifier_list(self, ):
identifier_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 29):
return
# C.g:336:2: ( IDENTIFIER ( ',' IDENTIFIER )* )
# C.g:336:4: IDENTIFIER ( ',' IDENTIFIER )*
self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list1027)
if self.failed:
return
# C.g:337:2: ( ',' IDENTIFIER )*
while True: #loop47
alt47 = 2
LA47_0 = self.input.LA(1)
if (LA47_0 == 27) :
alt47 = 1
if alt47 == 1:
# C.g:337:3: ',' IDENTIFIER
self.match(self.input, 27, self.FOLLOW_27_in_identifier_list1031)
if self.failed:
return
self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list1033)
if self.failed:
return
else:
break #loop47
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 29, identifier_list_StartIndex)
pass
return
# $ANTLR end identifier_list
# $ANTLR start type_name
# C.g:340:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );
def type_name(self, ):
type_name_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 30):
return
# C.g:341:2: ( specifier_qualifier_list ( abstract_declarator )? | type_id )
alt49 = 2
LA49_0 = self.input.LA(1)
if ((34 <= LA49_0 <= 42) or (45 <= LA49_0 <= 46) or (48 <= LA49_0 <= 61)) :
alt49 = 1
elif (LA49_0 == IDENTIFIER) :
LA49_13 = self.input.LA(2)
if (self.synpred90()) :
alt49 = 1
elif (True) :
alt49 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("340:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 13, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("340:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 0, self.input)
raise nvae
if alt49 == 1:
# C.g:341:4: specifier_qualifier_list ( abstract_declarator )?
self.following.append(self.FOLLOW_specifier_qualifier_list_in_type_name1046)
self.specifier_qualifier_list()
self.following.pop()
if self.failed:
return
# C.g:341:29: ( abstract_declarator )?
alt48 = 2
LA48_0 = self.input.LA(1)
if (LA48_0 == 62 or LA48_0 == 64 or LA48_0 == 66) :
alt48 = 1
if alt48 == 1:
# C.g:0:0: abstract_declarator
self.following.append(self.FOLLOW_abstract_declarator_in_type_name1048)
self.abstract_declarator()
self.following.pop()
if self.failed:
return
elif alt49 == 2:
# C.g:342:4: type_id
self.following.append(self.FOLLOW_type_id_in_type_name1054)
self.type_id()
self.following.pop()
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 30, type_name_StartIndex)
pass
return
# $ANTLR end type_name
# $ANTLR start abstract_declarator
# C.g:345:1: abstract_declarator : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator );
def abstract_declarator(self, ):
abstract_declarator_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 31):
return
# C.g:346:2: ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator )
alt51 = 2
LA51_0 = self.input.LA(1)
if (LA51_0 == 66) :
alt51 = 1
elif (LA51_0 == 62 or LA51_0 == 64) :
alt51 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("345:1: abstract_declarator : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator );", 51, 0, self.input)
raise nvae
if alt51 == 1:
# C.g:346:4: pointer ( direct_abstract_declarator )?
self.following.append(self.FOLLOW_pointer_in_abstract_declarator1065)
self.pointer()
self.following.pop()
if self.failed:
return
# C.g:346:12: ( direct_abstract_declarator )?
alt50 = 2
LA50_0 = self.input.LA(1)
if (LA50_0 == 62) :
LA50 = self.input.LA(2)
if LA50 == 63:
LA50_12 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 58:
LA50_13 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 66:
LA50_14 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 59:
LA50_15 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 60:
LA50_16 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == IDENTIFIER:
LA50_17 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 62:
LA50_18 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 64:
LA50_19 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 29 or LA50 == 30 or LA50 == 31 or LA50 == 32 or LA50 == 33:
LA50_20 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 34:
LA50_21 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 35:
LA50_22 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 36:
LA50_23 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 37:
LA50_24 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 38:
LA50_25 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 39:
LA50_26 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 40:
LA50_27 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 41:
LA50_28 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 42:
LA50_29 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 45 or LA50 == 46:
LA50_30 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 48:
LA50_31 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 49 or LA50 == 50 or LA50 == 51 or LA50 == 52 or LA50 == 53 or LA50 == 54 or LA50 == 55 or LA50 == 56 or LA50 == 57 or LA50 == 61:
LA50_32 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif (LA50_0 == 64) :
LA50 = self.input.LA(2)
if LA50 == 65:
LA50_33 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 62:
LA50_34 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == IDENTIFIER:
LA50_35 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == HEX_LITERAL:
LA50_36 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == OCTAL_LITERAL:
LA50_37 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == DECIMAL_LITERAL:
LA50_38 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == CHARACTER_LITERAL:
LA50_39 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == STRING_LITERAL:
LA50_40 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == FLOATING_POINT_LITERAL:
LA50_41 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 72:
LA50_42 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 73:
LA50_43 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 66 or LA50 == 68 or LA50 == 69 or LA50 == 77 or LA50 == 78 or LA50 == 79:
LA50_44 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
elif LA50 == 74:
LA50_45 = self.input.LA(3)
if (self.synpred91()) :
alt50 = 1
if alt50 == 1:
# C.g:0:0: direct_abstract_declarator
self.following.append(self.FOLLOW_direct_abstract_declarator_in_abstract_declarator1067)
self.direct_abstract_declarator()
self.following.pop()
if self.failed:
return
elif alt51 == 2:
# C.g:347:4: direct_abstract_declarator
self.following.append(self.FOLLOW_direct_abstract_declarator_in_abstract_declarator1073)
self.direct_abstract_declarator()
self.following.pop()
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 31, abstract_declarator_StartIndex)
pass
return
# $ANTLR end abstract_declarator
# $ANTLR start direct_abstract_declarator
# C.g:350:1: direct_abstract_declarator : ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* ;
def direct_abstract_declarator(self, ):
direct_abstract_declarator_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 32):
return
# C.g:351:2: ( ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* )
# C.g:351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )*
# C.g:351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )
alt52 = 2
LA52_0 = self.input.LA(1)
if (LA52_0 == 62) :
LA52 = self.input.LA(2)
if LA52 == IDENTIFIER or LA52 == 29 or LA52 == 30 or LA52 == 31 or LA52 == 32 or LA52 == 33 or LA52 == 34 or LA52 == 35 or LA52 == 36 or LA52 == 37 or LA52 == 38 or LA52 == 39 or LA52 == 40 or LA52 == 41 or LA52 == 42 or LA52 == 45 or LA52 == 46 or LA52 == 48 or LA52 == 49 or LA52 == 50 or LA52 == 51 or LA52 == 52 or LA52 == 53 or LA52 == 54 or LA52 == 55 or LA52 == 56 or LA52 == 57 or LA52 == 58 or LA52 == 59 or LA52 == 60 or LA52 == 61 or LA52 == 63:
alt52 = 2
elif LA52 == 66:
LA52_18 = self.input.LA(3)
if (self.synpred93()) :
alt52 = 1
elif (True) :
alt52 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 52, 18, self.input)
raise nvae
elif LA52 == 62 or LA52 == 64:
alt52 = 1
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 52, 1, self.input)
raise nvae
elif (LA52_0 == 64) :
alt52 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 52, 0, self.input)
raise nvae
if alt52 == 1:
# C.g:351:6: '(' abstract_declarator ')'
self.match(self.input, 62, self.FOLLOW_62_in_direct_abstract_declarator1086)
if self.failed:
return
self.following.append(self.FOLLOW_abstract_declarator_in_direct_abstract_declarator1088)
self.abstract_declarator()
self.following.pop()
if self.failed:
return
self.match(self.input, 63, self.FOLLOW_63_in_direct_abstract_declarator1090)
if self.failed:
return
elif alt52 == 2:
# C.g:351:36: abstract_declarator_suffix
self.following.append(self.FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1094)
self.abstract_declarator_suffix()
self.following.pop()
if self.failed:
return
# C.g:351:65: ( abstract_declarator_suffix )*
while True: #loop53
alt53 = 2
LA53_0 = self.input.LA(1)
if (LA53_0 == 62) :
LA53 = self.input.LA(2)
if LA53 == 63:
LA53_12 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 58:
LA53_13 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 66:
LA53_14 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 59:
LA53_15 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 60:
LA53_16 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == IDENTIFIER:
LA53_17 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 29 or LA53 == 30 or LA53 == 31 or LA53 == 32 or LA53 == 33:
LA53_19 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 34:
LA53_20 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 35:
LA53_21 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 36:
LA53_22 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 37:
LA53_23 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 38:
LA53_24 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 39:
LA53_25 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 40:
LA53_26 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 41:
LA53_27 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 42:
LA53_28 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 45 or LA53 == 46:
LA53_29 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 48:
LA53_30 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 49 or LA53 == 50 or LA53 == 51 or LA53 == 52 or LA53 == 53 or LA53 == 54 or LA53 == 55 or LA53 == 56 or LA53 == 57 or LA53 == 61:
LA53_31 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif (LA53_0 == 64) :
LA53 = self.input.LA(2)
if LA53 == 65:
LA53_33 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 62:
LA53_34 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == IDENTIFIER:
LA53_35 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == HEX_LITERAL:
LA53_36 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == OCTAL_LITERAL:
LA53_37 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == DECIMAL_LITERAL:
LA53_38 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == CHARACTER_LITERAL:
LA53_39 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == STRING_LITERAL:
LA53_40 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == FLOATING_POINT_LITERAL:
LA53_41 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 72:
LA53_42 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 73:
LA53_43 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 66 or LA53 == 68 or LA53 == 69 or LA53 == 77 or LA53 == 78 or LA53 == 79:
LA53_44 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
elif LA53 == 74:
LA53_45 = self.input.LA(3)
if (self.synpred94()) :
alt53 = 1
if alt53 == 1:
# C.g:0:0: abstract_declarator_suffix
self.following.append(self.FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1098)
self.abstract_declarator_suffix()
self.following.pop()
if self.failed:
return
else:
break #loop53
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 32, direct_abstract_declarator_StartIndex)
pass
return
# $ANTLR end direct_abstract_declarator
# $ANTLR start abstract_declarator_suffix
# C.g:354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );
def abstract_declarator_suffix(self, ):
abstract_declarator_suffix_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 33):
return
# C.g:355:2: ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' )
alt54 = 4
LA54_0 = self.input.LA(1)
if (LA54_0 == 64) :
LA54_1 = self.input.LA(2)
if (LA54_1 == 65) :
alt54 = 1
elif ((IDENTIFIER <= LA54_1 <= FLOATING_POINT_LITERAL) or LA54_1 == 62 or LA54_1 == 66 or (68 <= LA54_1 <= 69) or (72 <= LA54_1 <= 74) or (77 <= LA54_1 <= 79)) :
alt54 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54, 1, self.input)
raise nvae
elif (LA54_0 == 62) :
LA54_2 = self.input.LA(2)
if (LA54_2 == 63) :
alt54 = 3
elif (LA54_2 == IDENTIFIER or (29 <= LA54_2 <= 42) or (45 <= LA54_2 <= 46) or (48 <= LA54_2 <= 61) or LA54_2 == 66) :
alt54 = 4
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54, 2, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54, 0, self.input)
raise nvae
if alt54 == 1:
# C.g:355:4: '[' ']'
self.match(self.input, 64, self.FOLLOW_64_in_abstract_declarator_suffix1110)
if self.failed:
return
self.match(self.input, 65, self.FOLLOW_65_in_abstract_declarator_suffix1112)
if self.failed:
return
elif alt54 == 2:
# C.g:356:4: '[' constant_expression ']'
self.match(self.input, 64, self.FOLLOW_64_in_abstract_declarator_suffix1117)
if self.failed:
return
self.following.append(self.FOLLOW_constant_expression_in_abstract_declarator_suffix1119)
self.constant_expression()
self.following.pop()
if self.failed:
return
self.match(self.input, 65, self.FOLLOW_65_in_abstract_declarator_suffix1121)
if self.failed:
return
elif alt54 == 3:
# C.g:357:4: '(' ')'
self.match(self.input, 62, self.FOLLOW_62_in_abstract_declarator_suffix1126)
if self.failed:
return
self.match(self.input, 63, self.FOLLOW_63_in_abstract_declarator_suffix1128)
if self.failed:
return
elif alt54 == 4:
# C.g:358:4: '(' parameter_type_list ')'
self.match(self.input, 62, self.FOLLOW_62_in_abstract_declarator_suffix1133)
if self.failed:
return
self.following.append(self.FOLLOW_parameter_type_list_in_abstract_declarator_suffix1135)
self.parameter_type_list()
self.following.pop()
if self.failed:
return
self.match(self.input, 63, self.FOLLOW_63_in_abstract_declarator_suffix1137)
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 33, abstract_declarator_suffix_StartIndex)
pass
return
# $ANTLR end abstract_declarator_suffix
# $ANTLR start initializer
# C.g:361:1: initializer : ( assignment_expression | '{' initializer_list ( ',' )? '}' );
def initializer(self, ):
initializer_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 34):
return
# C.g:363:2: ( assignment_expression | '{' initializer_list ( ',' )? '}' )
alt56 = 2
LA56_0 = self.input.LA(1)
if ((IDENTIFIER <= LA56_0 <= FLOATING_POINT_LITERAL) or LA56_0 == 62 or LA56_0 == 66 or (68 <= LA56_0 <= 69) or (72 <= LA56_0 <= 74) or (77 <= LA56_0 <= 79)) :
alt56 = 1
elif (LA56_0 == 43) :
alt56 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("361:1: initializer : ( assignment_expression | '{' initializer_list ( ',' )? '}' );", 56, 0, self.input)
raise nvae
if alt56 == 1:
# C.g:363:4: assignment_expression
self.following.append(self.FOLLOW_assignment_expression_in_initializer1150)
self.assignment_expression()
self.following.pop()
if self.failed:
return
elif alt56 == 2:
# C.g:364:4: '{' initializer_list ( ',' )? '}'
self.match(self.input, 43, self.FOLLOW_43_in_initializer1155)
if self.failed:
return
self.following.append(self.FOLLOW_initializer_list_in_initializer1157)
self.initializer_list()
self.following.pop()
if self.failed:
return
# C.g:364:25: ( ',' )?
alt55 = 2
LA55_0 = self.input.LA(1)
if (LA55_0 == 27) :
alt55 = 1
if alt55 == 1:
# C.g:0:0: ','
self.match(self.input, 27, self.FOLLOW_27_in_initializer1159)
if self.failed:
return
self.match(self.input, 44, self.FOLLOW_44_in_initializer1162)
if self.failed:
return
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 34, initializer_StartIndex)
pass
return
# $ANTLR end initializer
# $ANTLR start initializer_list
# C.g:367:1: initializer_list : initializer ( ',' initializer )* ;
def initializer_list(self, ):
initializer_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 35):
return
# C.g:368:2: ( initializer ( ',' initializer )* )
# C.g:368:4: initializer ( ',' initializer )*
self.following.append(self.FOLLOW_initializer_in_initializer_list1173)
self.initializer()
self.following.pop()
if self.failed:
return
# C.g:368:16: ( ',' initializer )*
while True: #loop57
alt57 = 2
LA57_0 = self.input.LA(1)
if (LA57_0 == 27) :
LA57_1 = self.input.LA(2)
if ((IDENTIFIER <= LA57_1 <= FLOATING_POINT_LITERAL) or LA57_1 == 43 or LA57_1 == 62 or LA57_1 == 66 or (68 <= LA57_1 <= 69) or (72 <= LA57_1 <= 74) or (77 <= LA57_1 <= 79)) :
alt57 = 1
if alt57 == 1:
# C.g:368:17: ',' initializer
self.match(self.input, 27, self.FOLLOW_27_in_initializer_list1176)
if self.failed:
return
self.following.append(self.FOLLOW_initializer_in_initializer_list1178)
self.initializer()
self.following.pop()
if self.failed:
return
else:
break #loop57
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 35, initializer_list_StartIndex)
pass
return
# $ANTLR end initializer_list
class argument_expression_list_return(object):
def __init__(self):
self.start = None
self.stop = None
# $ANTLR start argument_expression_list
# C.g:373:1: argument_expression_list : assignment_expression ( 'OPTIONAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )* ;
def argument_expression_list(self, ):
retval = self.argument_expression_list_return()
retval.start = self.input.LT(1)
argument_expression_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 36):
return retval
# C.g:374:2: ( assignment_expression ( 'OPTIONAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )* )
# C.g:374:6: assignment_expression ( 'OPTIONAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )*
self.following.append(self.FOLLOW_assignment_expression_in_argument_expression_list1196)
self.assignment_expression()
self.following.pop()
if self.failed:
return retval
# C.g:374:28: ( 'OPTIONAL' )?
alt58 = 2
LA58_0 = self.input.LA(1)
if (LA58_0 == 53) :
alt58 = 1
if alt58 == 1:
# C.g:374:29: 'OPTIONAL'
self.match(self.input, 53, self.FOLLOW_53_in_argument_expression_list1199)
if self.failed:
return retval
# C.g:374:42: ( ',' assignment_expression ( 'OPTIONAL' )? )*
while True: #loop60
alt60 = 2
LA60_0 = self.input.LA(1)
if (LA60_0 == 27) :
alt60 = 1
if alt60 == 1:
# C.g:374:43: ',' assignment_expression ( 'OPTIONAL' )?
self.match(self.input, 27, self.FOLLOW_27_in_argument_expression_list1204)
if self.failed:
return retval
self.following.append(self.FOLLOW_assignment_expression_in_argument_expression_list1206)
self.assignment_expression()
self.following.pop()
if self.failed:
return retval
# C.g:374:69: ( 'OPTIONAL' )?
alt59 = 2
LA59_0 = self.input.LA(1)
if (LA59_0 == 53) :
alt59 = 1
if alt59 == 1:
# C.g:374:70: 'OPTIONAL'
self.match(self.input, 53, self.FOLLOW_53_in_argument_expression_list1209)
if self.failed:
return retval
else:
break #loop60
retval.stop = self.input.LT(-1)
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 36, argument_expression_list_StartIndex)
pass
return retval
# $ANTLR end argument_expression_list
# $ANTLR start additive_expression
# C.g:377:1: additive_expression : ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )* ;
def additive_expression(self, ):
additive_expression_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 37):
return
# C.g:378:2: ( ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )* )
# C.g:378:4: ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )*
# C.g:378:4: ( multiplicative_expression )
# C.g:378:5: multiplicative_expression
self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1225)
self.multiplicative_expression()
self.following.pop()
if self.failed:
return
# C.g:378:32: ( '+' multiplicative_expression | '-' multiplicative_expression )*
while True: #loop61
alt61 = 3
LA61_0 = self.input.LA(1)
if (LA61_0 == 68) :
alt61 = 1
elif (LA61_0 == 69) :
alt61 = 2
if alt61 == 1:
# C.g:378:33: '+' multiplicative_expression
self.match(self.input, 68, self.FOLLOW_68_in_additive_expression1229)
if self.failed:
return
self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1231)
self.multiplicative_expression()
self.following.pop()
if self.failed:
return
elif alt61 == 2:
# C.g:378:65: '-' multiplicative_expression
self.match(self.input, 69, self.FOLLOW_69_in_additive_expression1235)
if self.failed:
return
self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1237)
self.multiplicative_expression()
self.following.pop()
if self.failed:
return
else:
break #loop61
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 37, additive_expression_StartIndex)
pass
return
# $ANTLR end additive_expression
# $ANTLR start multiplicative_expression
# C.g:381:1: multiplicative_expression : ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )* ;
def multiplicative_expression(self, ):
multiplicative_expression_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 38):
return
# C.g:382:2: ( ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )* )
# C.g:382:4: ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )*
# C.g:382:4: ( cast_expression )
# C.g:382:5: cast_expression
self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1251)
self.cast_expression()
self.following.pop()
if self.failed:
return
# C.g:382:22: ( '*' cast_expression | '/' cast_expression | '%' cast_expression )*
while True: #loop62
alt62 = 4
LA62 = self.input.LA(1)
if LA62 == 66:
alt62 = 1
elif LA62 == 70:
alt62 = 2
elif LA62 == 71:
alt62 = 3
if alt62 == 1:
# C.g:382:23: '*' cast_expression
self.match(self.input, 66, self.FOLLOW_66_in_multiplicative_expression1255)
if self.failed:
return
self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1257)
self.cast_expression()
self.following.pop()
if self.failed:
return
elif alt62 == 2:
# C.g:382:45: '/' cast_expression
self.match(self.input, 70, self.FOLLOW_70_in_multiplicative_expression1261)
if self.failed:
return
self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1263)
self.cast_expression()
self.following.pop()
if self.failed:
return
elif alt62 == 3:
# C.g:382:67: '%' cast_expression
self.match(self.input, 71, self.FOLLOW_71_in_multiplicative_expression1267)
if self.failed:
return
self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1269)
self.cast_expression()
self.following.pop()
if self.failed:
return
else:
break #loop62
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
finally:
if self.backtracking > 0:
self.memoize(self.input, 38, multiplicative_expression_StartIndex)
pass
return
# $ANTLR end multiplicative_expression
# $ANTLR start cast_expression
# C.g:385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );
def cast_expression(self, ):
cast_expression_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 39):
return
# C.g:386:2: ( '(' type_name ')' cast_expression | unary_expression )
alt63 = 2
LA63_0 = self.input.LA(1)
if (LA63_0 == 62) :
LA63 = self.input.LA(2)
if LA63 == 34 or LA63 == 35 or LA63 == 36 or LA63 == 37 or LA63 == 38 or LA63 == 39 or LA63 == 40 or LA63 == 41 or LA63 == 42 or LA63 == 45 or LA63 == 46 or LA63 == 48 or LA63 == 49 or LA63 == 50 or LA63 == 51 or LA63 == 52 or LA63 == 53 or LA63 == 54 or LA63 == 55 or LA63 == 56 or LA63 == 57 or LA63 == 58 or LA63 == 59 or LA63 == 60 or LA63 == 61:
alt63 = 1
elif LA63 == IDENTIFIER:
LA63_25 = self.input.LA(3)
if (self.synpred109()) :
alt63 = 1
elif (True) :
alt63 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 25, self.input)
raise nvae
elif LA63 == HEX_LITERAL or LA63 == OCTAL_LITERAL or LA63 == DECIMAL_LITERAL or LA63 == CHARACTER_LITERAL or LA63 == STRING_LITERAL or LA63 == FLOATING_POINT_LITERAL or LA63 == 62 or LA63 == 66 or LA63 == 68 or LA63 == 69 or LA63 == 72 or LA63 == 73 or LA63 == 74 or LA63 == 77 or LA63 == 78 or LA63 == 79:
alt63 = 2
else:
if self.backtracking > 0:
self.failed = True
return
nvae = NoViableAltException("385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 1, self.input)
raise nvae
elif ((IDENTIFIER <= LA63_0 <= FLOATING_POINT_LITERAL) or L