-# $ANTLR 3.0.1 C.g 2007-12-12 15:55:53
+# $ANTLR 3.0.1 C.g 2007-12-25 19:09:36
from antlr3 import *
from antlr3.compat import set, frozenset
try:
self.type = T24
- # C.g:7:5: ( 'typedef' )
- # C.g:7:7: 'typedef'
- self.match("typedef")
-
+ # C.g:7:5: ( ';' )
+ # C.g:7:7: ';'
+ self.match(u';')
try:
self.type = T25
- # C.g:8:5: ( ';' )
- # C.g:8:7: ';'
- self.match(u';')
+ # C.g:8:5: ( 'typedef' )
+ # C.g:8:7: 'typedef'
+ self.match("typedef")
+
try:
self.type = IDENTIFIER
- # C.g:457:2: ( LETTER ( LETTER | '0' .. '9' )* )
- # C.g:457:4: LETTER ( LETTER | '0' .. '9' )*
+ # C.g:458:2: ( LETTER ( LETTER | '0' .. '9' )* )
+ # C.g:458:4: LETTER ( LETTER | '0' .. '9' )*
self.mLETTER()
- # C.g:457:11: ( LETTER | '0' .. '9' )*
+ # C.g:458:11: ( LETTER | '0' .. '9' )*
while True: #loop1
alt1 = 2
LA1_0 = self.input.LA(1)
def mLETTER(self, ):
try:
- # C.g:462:2: ( '$' | 'A' .. 'Z' | 'a' .. 'z' | '_' )
+ # C.g:463:2: ( '$' | 'A' .. 'Z' | 'a' .. 'z' | '_' )
# C.g:
if self.input.LA(1) == u'$' or (u'A' <= self.input.LA(1) <= u'Z') or self.input.LA(1) == u'_' or (u'a' <= self.input.LA(1) <= u'z'):
self.input.consume();
try:
self.type = CHARACTER_LITERAL
- # C.g:469:5: ( '\\'' ( EscapeSequence | ~ ( '\\'' | '\\\\' ) ) '\\'' )
- # C.g:469:9: '\\'' ( EscapeSequence | ~ ( '\\'' | '\\\\' ) ) '\\''
+ # C.g:470:5: ( '\\'' ( EscapeSequence | ~ ( '\\'' | '\\\\' ) ) '\\'' )
+ # C.g:470:9: '\\'' ( EscapeSequence | ~ ( '\\'' | '\\\\' ) ) '\\''
self.match(u'\'')
- # C.g:469:14: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )
+ # C.g:470:14: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )
alt2 = 2
LA2_0 = self.input.LA(1)
elif ((u'\u0000' <= LA2_0 <= u'&') or (u'(' <= LA2_0 <= u'[') or (u']' <= LA2_0 <= u'\uFFFE')) :
alt2 = 2
else:
- nvae = NoViableAltException("469:14: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )", 2, 0, self.input)
+ nvae = NoViableAltException("470:14: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )", 2, 0, self.input)
raise nvae
if alt2 == 1:
- # C.g:469:16: EscapeSequence
+ # C.g:470:16: EscapeSequence
self.mEscapeSequence()
elif alt2 == 2:
- # C.g:469:33: ~ ( '\\'' | '\\\\' )
+ # C.g:470:33: ~ ( '\\'' | '\\\\' )
if (u'\u0000' <= self.input.LA(1) <= u'&') or (u'(' <= self.input.LA(1) <= u'[') or (u']' <= self.input.LA(1) <= u'\uFFFE'):
self.input.consume();
try:
self.type = STRING_LITERAL
- # C.g:473:5: ( ( 'L' )? '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' )
- # C.g:473:8: ( 'L' )? '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"'
- # C.g:473:8: ( 'L' )?
+ # C.g:474:5: ( ( 'L' )? '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' )
+ # C.g:474:8: ( 'L' )? '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"'
+ # C.g:474:8: ( 'L' )?
alt3 = 2
LA3_0 = self.input.LA(1)
if (LA3_0 == u'L') :
alt3 = 1
if alt3 == 1:
- # C.g:473:9: 'L'
+ # C.g:474:9: 'L'
self.match(u'L')
self.match(u'"')
- # C.g:473:19: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )*
+ # C.g:474:19: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )*
while True: #loop4
alt4 = 3
LA4_0 = self.input.LA(1)
if alt4 == 1:
- # C.g:473:21: EscapeSequence
+ # C.g:474:21: EscapeSequence
self.mEscapeSequence()
elif alt4 == 2:
- # C.g:473:38: ~ ( '\\\\' | '\"' )
+ # C.g:474:38: ~ ( '\\\\' | '\"' )
if (u'\u0000' <= self.input.LA(1) <= u'!') or (u'#' <= self.input.LA(1) <= u'[') or (u']' <= self.input.LA(1) <= u'\uFFFE'):
self.input.consume();
try:
self.type = HEX_LITERAL
- # C.g:476:13: ( '0' ( 'x' | 'X' ) ( HexDigit )+ ( IntegerTypeSuffix )? )
- # C.g:476:15: '0' ( 'x' | 'X' ) ( HexDigit )+ ( IntegerTypeSuffix )?
+ # C.g:477:13: ( '0' ( 'x' | 'X' ) ( HexDigit )+ ( IntegerTypeSuffix )? )
+ # C.g:477:15: '0' ( 'x' | 'X' ) ( HexDigit )+ ( IntegerTypeSuffix )?
self.match(u'0')
if self.input.LA(1) == u'X' or self.input.LA(1) == u'x':
raise mse
- # C.g:476:29: ( HexDigit )+
+ # C.g:477:29: ( HexDigit )+
cnt5 = 0
while True: #loop5
alt5 = 2
if alt5 == 1:
- # C.g:476:29: HexDigit
+ # C.g:477:29: HexDigit
self.mHexDigit()
cnt5 += 1
- # C.g:476:39: ( IntegerTypeSuffix )?
+ # C.g:477:39: ( IntegerTypeSuffix )?
alt6 = 2
LA6_0 = self.input.LA(1)
if (LA6_0 == u'L' or LA6_0 == u'U' or LA6_0 == u'l' or LA6_0 == u'u') :
alt6 = 1
if alt6 == 1:
- # C.g:476:39: IntegerTypeSuffix
+ # C.g:477:39: IntegerTypeSuffix
self.mIntegerTypeSuffix()
try:
self.type = DECIMAL_LITERAL
- # C.g:478:17: ( ( '0' | '1' .. '9' ( '0' .. '9' )* ) ( IntegerTypeSuffix )? )
- # C.g:478:19: ( '0' | '1' .. '9' ( '0' .. '9' )* ) ( IntegerTypeSuffix )?
- # C.g:478:19: ( '0' | '1' .. '9' ( '0' .. '9' )* )
+ # C.g:479:17: ( ( '0' | '1' .. '9' ( '0' .. '9' )* ) ( IntegerTypeSuffix )? )
+ # C.g:479:19: ( '0' | '1' .. '9' ( '0' .. '9' )* ) ( IntegerTypeSuffix )?
+ # C.g:479:19: ( '0' | '1' .. '9' ( '0' .. '9' )* )
alt8 = 2
LA8_0 = self.input.LA(1)
elif ((u'1' <= LA8_0 <= u'9')) :
alt8 = 2
else:
- nvae = NoViableAltException("478:19: ( '0' | '1' .. '9' ( '0' .. '9' )* )", 8, 0, self.input)
+ nvae = NoViableAltException("479:19: ( '0' | '1' .. '9' ( '0' .. '9' )* )", 8, 0, self.input)
raise nvae
if alt8 == 1:
- # C.g:478:20: '0'
+ # C.g:479:20: '0'
self.match(u'0')
elif alt8 == 2:
- # C.g:478:26: '1' .. '9' ( '0' .. '9' )*
+ # C.g:479:26: '1' .. '9' ( '0' .. '9' )*
self.matchRange(u'1', u'9')
- # C.g:478:35: ( '0' .. '9' )*
+ # C.g:479:35: ( '0' .. '9' )*
while True: #loop7
alt7 = 2
LA7_0 = self.input.LA(1)
if alt7 == 1:
- # C.g:478:35: '0' .. '9'
+ # C.g:479:35: '0' .. '9'
self.matchRange(u'0', u'9')
- # C.g:478:46: ( IntegerTypeSuffix )?
+ # C.g:479:46: ( IntegerTypeSuffix )?
alt9 = 2
LA9_0 = self.input.LA(1)
if (LA9_0 == u'L' or LA9_0 == u'U' or LA9_0 == u'l' or LA9_0 == u'u') :
alt9 = 1
if alt9 == 1:
- # C.g:478:46: IntegerTypeSuffix
+ # C.g:479:46: IntegerTypeSuffix
self.mIntegerTypeSuffix()
try:
self.type = OCTAL_LITERAL
- # C.g:480:15: ( '0' ( '0' .. '7' )+ ( IntegerTypeSuffix )? )
- # C.g:480:17: '0' ( '0' .. '7' )+ ( IntegerTypeSuffix )?
+ # C.g:481:15: ( '0' ( '0' .. '7' )+ ( IntegerTypeSuffix )? )
+ # C.g:481:17: '0' ( '0' .. '7' )+ ( IntegerTypeSuffix )?
self.match(u'0')
- # C.g:480:21: ( '0' .. '7' )+
+ # C.g:481:21: ( '0' .. '7' )+
cnt10 = 0
while True: #loop10
alt10 = 2
if alt10 == 1:
- # C.g:480:22: '0' .. '7'
+ # C.g:481:22: '0' .. '7'
self.matchRange(u'0', u'7')
cnt10 += 1
- # C.g:480:33: ( IntegerTypeSuffix )?
+ # C.g:481:33: ( IntegerTypeSuffix )?
alt11 = 2
LA11_0 = self.input.LA(1)
if (LA11_0 == u'L' or LA11_0 == u'U' or LA11_0 == u'l' or LA11_0 == u'u') :
alt11 = 1
if alt11 == 1:
- # C.g:480:33: IntegerTypeSuffix
+ # C.g:481:33: IntegerTypeSuffix
self.mIntegerTypeSuffix()
def mHexDigit(self, ):
try:
- # C.g:483:10: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
- # C.g:483:12: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )
+ # C.g:484:10: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
+ # C.g:484:12: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )
if (u'0' <= self.input.LA(1) <= u'9') or (u'A' <= self.input.LA(1) <= u'F') or (u'a' <= self.input.LA(1) <= u'f'):
self.input.consume();
def mIntegerTypeSuffix(self, ):
try:
- # C.g:487:2: ( ( 'u' | 'U' )? ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' )? )
+ # C.g:488:2: ( ( 'u' | 'U' )? ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' )? )
alt14 = 2
LA14_0 = self.input.LA(1)
elif (LA14_0 == u'L' or LA14_0 == u'l') :
alt14 = 1
else:
- nvae = NoViableAltException("485:1: fragment IntegerTypeSuffix : ( ( 'u' | 'U' )? ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' )? );", 14, 0, self.input)
+ nvae = NoViableAltException("486:1: fragment IntegerTypeSuffix : ( ( 'u' | 'U' )? ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' )? );", 14, 0, self.input)
raise nvae
if alt14 == 1:
- # C.g:487:4: ( 'u' | 'U' )? ( 'l' | 'L' )
- # C.g:487:4: ( 'u' | 'U' )?
+ # C.g:488:4: ( 'u' | 'U' )? ( 'l' | 'L' )
+ # C.g:488:4: ( 'u' | 'U' )?
alt12 = 2
LA12_0 = self.input.LA(1)
elif alt14 == 2:
- # C.g:488:4: ( 'u' | 'U' ) ( 'l' | 'L' )?
+ # C.g:489:4: ( 'u' | 'U' ) ( 'l' | 'L' )?
if self.input.LA(1) == u'U' or self.input.LA(1) == u'u':
self.input.consume();
raise mse
- # C.g:488:15: ( 'l' | 'L' )?
+ # C.g:489:15: ( 'l' | 'L' )?
alt13 = 2
LA13_0 = self.input.LA(1)
try:
self.type = FLOATING_POINT_LITERAL
- # C.g:492:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? | '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? | ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? | ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix )
+ # C.g:493:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? | '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? | ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? | ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix )
alt26 = 4
alt26 = self.dfa26.predict(self.input)
if alt26 == 1:
- # C.g:492:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )?
- # C.g:492:9: ( '0' .. '9' )+
+ # C.g:493:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )?
+ # C.g:493:9: ( '0' .. '9' )+
cnt15 = 0
while True: #loop15
alt15 = 2
if alt15 == 1:
- # C.g:492:10: '0' .. '9'
+ # C.g:493:10: '0' .. '9'
self.matchRange(u'0', u'9')
self.match(u'.')
- # C.g:492:25: ( '0' .. '9' )*
+ # C.g:493:25: ( '0' .. '9' )*
while True: #loop16
alt16 = 2
LA16_0 = self.input.LA(1)
if alt16 == 1:
- # C.g:492:26: '0' .. '9'
+ # C.g:493:26: '0' .. '9'
self.matchRange(u'0', u'9')
break #loop16
- # C.g:492:37: ( Exponent )?
+ # C.g:493:37: ( Exponent )?
alt17 = 2
LA17_0 = self.input.LA(1)
if (LA17_0 == u'E' or LA17_0 == u'e') :
alt17 = 1
if alt17 == 1:
- # C.g:492:37: Exponent
+ # C.g:493:37: Exponent
self.mExponent()
- # C.g:492:47: ( FloatTypeSuffix )?
+ # C.g:493:47: ( FloatTypeSuffix )?
alt18 = 2
LA18_0 = self.input.LA(1)
if (LA18_0 == u'D' or LA18_0 == u'F' or LA18_0 == u'd' or LA18_0 == u'f') :
alt18 = 1
if alt18 == 1:
- # C.g:492:47: FloatTypeSuffix
+ # C.g:493:47: FloatTypeSuffix
self.mFloatTypeSuffix()
elif alt26 == 2:
- # C.g:493:9: '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )?
+ # C.g:494:9: '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )?
self.match(u'.')
- # C.g:493:13: ( '0' .. '9' )+
+ # C.g:494:13: ( '0' .. '9' )+
cnt19 = 0
while True: #loop19
alt19 = 2
if alt19 == 1:
- # C.g:493:14: '0' .. '9'
+ # C.g:494:14: '0' .. '9'
self.matchRange(u'0', u'9')
cnt19 += 1
- # C.g:493:25: ( Exponent )?
+ # C.g:494:25: ( Exponent )?
alt20 = 2
LA20_0 = self.input.LA(1)
if (LA20_0 == u'E' or LA20_0 == u'e') :
alt20 = 1
if alt20 == 1:
- # C.g:493:25: Exponent
+ # C.g:494:25: Exponent
self.mExponent()
- # C.g:493:35: ( FloatTypeSuffix )?
+ # C.g:494:35: ( FloatTypeSuffix )?
alt21 = 2
LA21_0 = self.input.LA(1)
if (LA21_0 == u'D' or LA21_0 == u'F' or LA21_0 == u'd' or LA21_0 == u'f') :
alt21 = 1
if alt21 == 1:
- # C.g:493:35: FloatTypeSuffix
+ # C.g:494:35: FloatTypeSuffix
self.mFloatTypeSuffix()
elif alt26 == 3:
- # C.g:494:9: ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )?
- # C.g:494:9: ( '0' .. '9' )+
+ # C.g:495:9: ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )?
+ # C.g:495:9: ( '0' .. '9' )+
cnt22 = 0
while True: #loop22
alt22 = 2
if alt22 == 1:
- # C.g:494:10: '0' .. '9'
+ # C.g:495:10: '0' .. '9'
self.matchRange(u'0', u'9')
self.mExponent()
- # C.g:494:30: ( FloatTypeSuffix )?
+ # C.g:495:30: ( FloatTypeSuffix )?
alt23 = 2
LA23_0 = self.input.LA(1)
if (LA23_0 == u'D' or LA23_0 == u'F' or LA23_0 == u'd' or LA23_0 == u'f') :
alt23 = 1
if alt23 == 1:
- # C.g:494:30: FloatTypeSuffix
+ # C.g:495:30: FloatTypeSuffix
self.mFloatTypeSuffix()
elif alt26 == 4:
- # C.g:495:9: ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix
- # C.g:495:9: ( '0' .. '9' )+
+ # C.g:496:9: ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix
+ # C.g:496:9: ( '0' .. '9' )+
cnt24 = 0
while True: #loop24
alt24 = 2
if alt24 == 1:
- # C.g:495:10: '0' .. '9'
+ # C.g:496:10: '0' .. '9'
self.matchRange(u'0', u'9')
cnt24 += 1
- # C.g:495:21: ( Exponent )?
+ # C.g:496:21: ( Exponent )?
alt25 = 2
LA25_0 = self.input.LA(1)
if (LA25_0 == u'E' or LA25_0 == u'e') :
alt25 = 1
if alt25 == 1:
- # C.g:495:21: Exponent
+ # C.g:496:21: Exponent
self.mExponent()
def mExponent(self, ):
try:
- # C.g:499:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
- # C.g:499:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
+ # C.g:500:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
+ # C.g:500:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
if self.input.LA(1) == u'E' or self.input.LA(1) == u'e':
self.input.consume();
raise mse
- # C.g:499:22: ( '+' | '-' )?
+ # C.g:500:22: ( '+' | '-' )?
alt27 = 2
LA27_0 = self.input.LA(1)
- # C.g:499:33: ( '0' .. '9' )+
+ # C.g:500:33: ( '0' .. '9' )+
cnt28 = 0
while True: #loop28
alt28 = 2
if alt28 == 1:
- # C.g:499:34: '0' .. '9'
+ # C.g:500:34: '0' .. '9'
self.matchRange(u'0', u'9')
def mFloatTypeSuffix(self, ):
try:
- # C.g:502:17: ( ( 'f' | 'F' | 'd' | 'D' ) )
- # C.g:502:19: ( 'f' | 'F' | 'd' | 'D' )
+ # C.g:503:17: ( ( 'f' | 'F' | 'd' | 'D' ) )
+ # C.g:503:19: ( 'f' | 'F' | 'd' | 'D' )
if self.input.LA(1) == u'D' or self.input.LA(1) == u'F' or self.input.LA(1) == u'd' or self.input.LA(1) == u'f':
self.input.consume();
def mEscapeSequence(self, ):
try:
- # C.g:506:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape )
+ # C.g:507:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape )
alt29 = 2
LA29_0 = self.input.LA(1)
elif ((u'0' <= LA29_1 <= u'7')) :
alt29 = 2
else:
- nvae = NoViableAltException("504:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 29, 1, self.input)
+ nvae = NoViableAltException("505:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 29, 1, self.input)
raise nvae
else:
- nvae = NoViableAltException("504:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 29, 0, self.input)
+ nvae = NoViableAltException("505:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 29, 0, self.input)
raise nvae
if alt29 == 1:
- # C.g:506:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
+ # C.g:507:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
self.match(u'\\')
if self.input.LA(1) == u'"' or self.input.LA(1) == u'\'' or self.input.LA(1) == u'\\' or self.input.LA(1) == u'b' or self.input.LA(1) == u'f' or self.input.LA(1) == u'n' or self.input.LA(1) == u'r' or self.input.LA(1) == u't':
elif alt29 == 2:
- # C.g:507:9: OctalEscape
+ # C.g:508:9: OctalEscape
self.mOctalEscape()
def mOctalEscape(self, ):
try:
- # C.g:512:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
+ # C.g:513:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
alt30 = 3
LA30_0 = self.input.LA(1)
else:
alt30 = 3
else:
- nvae = NoViableAltException("510:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 30, 1, self.input)
+ nvae = NoViableAltException("511:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 30, 1, self.input)
raise nvae
else:
- nvae = NoViableAltException("510:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 30, 0, self.input)
+ nvae = NoViableAltException("511:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 30, 0, self.input)
raise nvae
if alt30 == 1:
- # C.g:512:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
+ # C.g:513:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
self.match(u'\\')
- # C.g:512:14: ( '0' .. '3' )
- # C.g:512:15: '0' .. '3'
+ # C.g:513:14: ( '0' .. '3' )
+ # C.g:513:15: '0' .. '3'
self.matchRange(u'0', u'3')
- # C.g:512:25: ( '0' .. '7' )
- # C.g:512:26: '0' .. '7'
+ # C.g:513:25: ( '0' .. '7' )
+ # C.g:513:26: '0' .. '7'
self.matchRange(u'0', u'7')
- # C.g:512:36: ( '0' .. '7' )
- # C.g:512:37: '0' .. '7'
+ # C.g:513:36: ( '0' .. '7' )
+ # C.g:513:37: '0' .. '7'
self.matchRange(u'0', u'7')
elif alt30 == 2:
- # C.g:513:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
+ # C.g:514:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
self.match(u'\\')
- # C.g:513:14: ( '0' .. '7' )
- # C.g:513:15: '0' .. '7'
+ # C.g:514:14: ( '0' .. '7' )
+ # C.g:514:15: '0' .. '7'
self.matchRange(u'0', u'7')
- # C.g:513:25: ( '0' .. '7' )
- # C.g:513:26: '0' .. '7'
+ # C.g:514:25: ( '0' .. '7' )
+ # C.g:514:26: '0' .. '7'
self.matchRange(u'0', u'7')
elif alt30 == 3:
- # C.g:514:9: '\\\\' ( '0' .. '7' )
+ # C.g:515:9: '\\\\' ( '0' .. '7' )
self.match(u'\\')
- # C.g:514:14: ( '0' .. '7' )
- # C.g:514:15: '0' .. '7'
+ # C.g:515:14: ( '0' .. '7' )
+ # C.g:515:15: '0' .. '7'
self.matchRange(u'0', u'7')
def mUnicodeEscape(self, ):
try:
- # C.g:519:5: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit )
- # C.g:519:9: '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit
+ # C.g:520:5: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit )
+ # C.g:520:9: '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit
self.match(u'\\')
self.match(u'u')
try:
self.type = WS
- # C.g:522:5: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) )
- # C.g:522:8: ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' )
+ # C.g:523:5: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) )
+ # C.g:523:8: ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' )
if (u'\t' <= self.input.LA(1) <= u'\n') or (u'\f' <= self.input.LA(1) <= u'\r') or self.input.LA(1) == u' ':
self.input.consume();
try:
self.type = UnicodeVocabulary
- # C.g:530:5: ( '\\u0003' .. '\\uFFFE' )
- # C.g:530:7: '\\u0003' .. '\\uFFFE'
+ # C.g:531:5: ( '\\u0003' .. '\\uFFFE' )
+ # C.g:531:7: '\\u0003' .. '\\uFFFE'
self.matchRange(u'\u0003', u'\uFFFE')
try:
self.type = COMMENT
- # C.g:533:5: ( '/*' ( options {greedy=false; } : . )* '*/' )
- # C.g:533:9: '/*' ( options {greedy=false; } : . )* '*/'
+ # C.g:534:5: ( '/*' ( options {greedy=false; } : . )* '*/' )
+ # C.g:534:9: '/*' ( options {greedy=false; } : . )* '*/'
self.match("/*")
- # C.g:533:14: ( options {greedy=false; } : . )*
+ # C.g:534:14: ( options {greedy=false; } : . )*
while True: #loop31
alt31 = 2
LA31_0 = self.input.LA(1)
if alt31 == 1:
- # C.g:533:42: .
+ # C.g:534:42: .
self.matchAny()
try:
self.type = LINE_COMMENT
- # C.g:538:5: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
- # C.g:538:7: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
+ # C.g:539:5: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
+ # C.g:539:7: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
self.match("//")
- # C.g:538:12: (~ ( '\\n' | '\\r' ) )*
+ # C.g:539:12: (~ ( '\\n' | '\\r' ) )*
while True: #loop32
alt32 = 2
LA32_0 = self.input.LA(1)
if alt32 == 1:
- # C.g:538:12: ~ ( '\\n' | '\\r' )
+ # C.g:539:12: ~ ( '\\n' | '\\r' )
if (u'\u0000' <= self.input.LA(1) <= u'\t') or (u'\u000B' <= self.input.LA(1) <= u'\f') or (u'\u000E' <= self.input.LA(1) <= u'\uFFFE'):
self.input.consume();
break #loop32
- # C.g:538:26: ( '\\r' )?
+ # C.g:539:26: ( '\\r' )?
alt33 = 2
LA33_0 = self.input.LA(1)
if (LA33_0 == u'\r') :
alt33 = 1
if alt33 == 1:
- # C.g:538:26: '\\r'
+ # C.g:539:26: '\\r'
self.match(u'\r')
try:
self.type = LINE_COMMAND
- # C.g:543:5: ( '#' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
- # C.g:543:7: '#' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
+ # C.g:544:5: ( '#' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
+ # C.g:544:7: '#' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
self.match(u'#')
- # C.g:543:11: (~ ( '\\n' | '\\r' ) )*
+ # C.g:544:11: (~ ( '\\n' | '\\r' ) )*
while True: #loop34
alt34 = 2
LA34_0 = self.input.LA(1)
if alt34 == 1:
- # C.g:543:11: ~ ( '\\n' | '\\r' )
+ # C.g:544:11: ~ ( '\\n' | '\\r' )
if (u'\u0000' <= self.input.LA(1) <= u'\t') or (u'\u000B' <= self.input.LA(1) <= u'\f') or (u'\u000E' <= self.input.LA(1) <= u'\uFFFE'):
self.input.consume();
break #loop34
- # C.g:543:25: ( '\\r' )?
+ # C.g:544:25: ( '\\r' )?
alt35 = 2
LA35_0 = self.input.LA(1)
if (LA35_0 == u'\r') :
alt35 = 1
if alt35 == 1:
- # C.g:543:25: '\\r'
+ # C.g:544:25: '\\r'
self.match(u'\r')
# lookup tables for DFA #36
DFA36_eot = DFA.unpack(
- u"\1\uffff\1\64\2\uffff\1\70\13\64\3\uffff\2\64\4\uffff\1\130\1\132"
+ u"\2\uffff\1\65\1\uffff\1\70\13\65\3\uffff\2\65\4\uffff\1\130\1\132"
u"\1\136\1\142\1\146\1\150\1\153\1\uffff\1\156\1\161\1\164\1\166"
- u"\1\171\1\uffff\4\64\1\62\1\uffff\1\62\2\u0081\1\uffff\1\62\1\uffff"
- u"\1\64\5\uffff\15\64\1\u0098\4\64\1\u009e\2\64\3\uffff\1\u00a2\1"
- u"\64\34\uffff\1\u00a5\2\uffff\1\u00a7\10\uffff\3\64\4\uffff\1\u00ab"
- u"\1\u0081\2\uffff\22\64\1\uffff\1\u00bf\2\64\1\u00c2\1\64\1\uffff"
- u"\3\64\1\uffff\1\u00c7\4\uffff\3\64\1\uffff\1\64\1\u00cc\1\64\1"
- u"\u00ce\6\64\1\u00d5\2\64\1\u00d8\3\64\1\u00dc\1\u00dd\1\uffff\1"
- u"\u00de\1\64\1\uffff\4\64\1\uffff\1\64\1\u00e5\2\64\1\uffff\1\64"
- u"\1\uffff\4\64\1\u00ed\1\64\1\uffff\2\64\1\uffff\2\64\1\u00f3\3"
- u"\uffff\1\u00f4\2\64\1\u00f7\1\64\1\u00f9\1\uffff\1\u00fa\1\64\1"
+ u"\1\171\1\uffff\4\65\1\62\1\uffff\1\62\2\u0081\1\uffff\1\62\2\uffff"
+ u"\1\65\4\uffff\15\65\1\u0098\4\65\1\u009e\2\65\3\uffff\1\u00a2\1"
+ u"\65\34\uffff\1\u00a5\2\uffff\1\u00a7\10\uffff\3\65\4\uffff\1\u00ab"
+ u"\1\u0081\2\uffff\22\65\1\uffff\1\u00bf\2\65\1\u00c2\1\65\1\uffff"
+ u"\3\65\1\uffff\1\u00c7\4\uffff\3\65\1\uffff\1\65\1\u00cc\1\65\1"
+ u"\u00ce\6\65\1\u00d5\2\65\1\u00d8\3\65\1\u00dc\1\u00dd\1\uffff\1"
+ u"\u00de\1\65\1\uffff\4\65\1\uffff\1\65\1\u00e5\2\65\1\uffff\1\65"
+ u"\1\uffff\4\65\1\u00ed\1\65\1\uffff\2\65\1\uffff\2\65\1\u00f3\3"
+ u"\uffff\1\u00f4\2\65\1\u00f7\1\65\1\u00f9\1\uffff\1\u00fa\1\65\1"
u"\u00fc\1\u00fd\1\u00fe\1\u00ff\1\u0100\1\uffff\1\u0101\1\u0102"
- u"\3\64\2\uffff\1\u0106\1\64\1\uffff\1\64\2\uffff\1\u0109\7\uffff"
- u"\3\64\1\uffff\1\u010d\1\64\1\uffff\1\u010f\1\u0110\1\u0111\1\uffff"
+ u"\3\65\2\uffff\1\u0106\1\65\1\uffff\1\65\2\uffff\1\u0109\7\uffff"
+ u"\3\65\1\uffff\1\u010d\1\65\1\uffff\1\u010f\1\u0110\1\u0111\1\uffff"
u"\1\u0112\4\uffff"
)
)
DFA36_min = DFA.unpack(
- u"\1\3\1\171\2\uffff\1\75\1\154\1\150\1\165\1\145\1\157\1\141\1\146"
- u"\1\157\1\154\1\145\1\156\3\uffff\1\116\1\125\4\uffff\1\75\1\56"
- u"\1\53\1\55\1\52\1\75\1\46\1\uffff\1\75\1\74\3\75\1\uffff\1\150"
- u"\1\157\1\162\1\42\1\0\1\uffff\1\0\2\56\1\uffff\1\0\1\uffff\1\160"
- u"\5\uffff\1\165\1\164\1\163\1\147\1\141\1\157\1\151\1\164\1\147"
- u"\1\151\1\156\1\163\1\141\1\44\1\164\1\156\1\157\1\162\1\44\1\146"
- u"\1\151\3\uffff\1\44\1\124\34\uffff\1\75\2\uffff\1\75\10\uffff\1"
- u"\151\1\164\1\145\4\uffff\2\56\2\uffff\1\145\1\155\3\145\1\156\1"
- u"\164\1\165\1\162\1\164\1\157\1\165\1\151\1\144\1\141\1\163\1\145"
- u"\1\162\1\uffff\1\44\1\147\1\141\1\44\1\142\1\uffff\1\141\1\157"
- u"\1\151\1\uffff\1\44\4\uffff\1\154\1\157\1\141\1\uffff\1\144\1\44"
- u"\1\162\1\44\1\157\1\145\1\151\1\143\1\164\1\143\1\44\1\162\1\163"
- u"\1\44\1\164\1\151\1\164\2\44\1\uffff\1\44\1\164\1\uffff\1\154\1"
- u"\165\1\156\1\147\1\uffff\1\145\1\44\1\153\1\145\1\uffff\1\156\1"
- u"\uffff\1\146\1\144\1\143\1\164\1\44\1\150\1\uffff\1\156\1\164\1"
- u"\uffff\1\151\1\156\1\44\3\uffff\1\44\1\145\1\154\1\44\1\156\1\44"
- u"\1\uffff\1\44\1\146\5\44\1\uffff\2\44\1\145\1\154\1\165\2\uffff"
- u"\1\44\1\164\1\uffff\1\145\2\uffff\1\44\7\uffff\1\162\2\145\1\uffff"
- u"\1\44\1\144\1\uffff\3\44\1\uffff\1\44\4\uffff"
+ u"\1\3\1\uffff\1\171\1\uffff\1\75\1\154\1\150\1\165\1\145\1\157\1"
+ u"\141\1\146\1\157\1\154\1\145\1\156\3\uffff\1\116\1\125\4\uffff"
+ u"\1\75\1\56\1\53\1\55\1\52\1\75\1\46\1\uffff\1\75\1\74\3\75\1\uffff"
+ u"\1\150\1\157\1\162\1\42\1\0\1\uffff\1\0\2\56\1\uffff\1\0\2\uffff"
+ u"\1\160\4\uffff\1\165\1\164\1\163\1\147\1\141\1\157\1\151\1\164"
+ u"\1\147\1\151\1\156\1\163\1\141\1\44\1\164\1\156\1\157\1\162\1\44"
+ u"\1\146\1\151\3\uffff\1\44\1\124\34\uffff\1\75\2\uffff\1\75\10\uffff"
+ u"\1\151\1\164\1\145\4\uffff\2\56\2\uffff\1\145\1\155\3\145\1\156"
+ u"\1\164\1\165\1\162\1\164\1\157\1\165\1\151\1\144\1\141\1\163\1"
+ u"\145\1\162\1\uffff\1\44\1\147\1\141\1\44\1\142\1\uffff\1\141\1"
+ u"\157\1\151\1\uffff\1\44\4\uffff\1\154\1\157\1\141\1\uffff\1\144"
+ u"\1\44\1\162\1\44\1\157\1\145\1\151\1\143\1\164\1\143\1\44\1\162"
+ u"\1\163\1\44\1\164\1\151\1\164\2\44\1\uffff\1\44\1\164\1\uffff\1"
+ u"\154\1\165\1\156\1\147\1\uffff\1\145\1\44\1\153\1\145\1\uffff\1"
+ u"\156\1\uffff\1\146\1\144\1\143\1\164\1\44\1\150\1\uffff\1\156\1"
+ u"\164\1\uffff\1\151\1\156\1\44\3\uffff\1\44\1\145\1\154\1\44\1\156"
+ u"\1\44\1\uffff\1\44\1\146\5\44\1\uffff\2\44\1\145\1\154\1\165\2"
+ u"\uffff\1\44\1\164\1\uffff\1\145\2\uffff\1\44\7\uffff\1\162\2\145"
+ u"\1\uffff\1\44\1\144\1\uffff\3\44\1\uffff\1\44\4\uffff"
)
DFA36_max = DFA.unpack(
- u"\1\ufffe\1\171\2\uffff\1\75\1\170\1\167\1\165\1\145\2\157\1\156"
- u"\3\157\1\156\3\uffff\1\116\1\125\4\uffff\1\75\1\71\1\75\1\76\3"
- u"\75\1\uffff\2\75\1\76\1\75\1\174\1\uffff\1\150\1\157\1\162\1\42"
- u"\1\ufffe\1\uffff\1\ufffe\1\170\1\146\1\uffff\1\ufffe\1\uffff\1"
- u"\160\5\uffff\1\165\1\164\1\163\1\172\1\162\1\157\1\151\2\164\1"
- u"\154\1\156\1\163\1\141\1\172\1\164\1\156\1\157\1\162\1\172\1\146"
- u"\1\163\3\uffff\1\172\1\124\34\uffff\1\75\2\uffff\1\75\10\uffff"
+ u"\1\ufffe\1\uffff\1\171\1\uffff\1\75\1\170\1\167\1\165\1\145\2\157"
+ u"\1\156\3\157\1\156\3\uffff\1\116\1\125\4\uffff\1\75\1\71\1\75\1"
+ u"\76\3\75\1\uffff\2\75\1\76\1\75\1\174\1\uffff\1\150\1\157\1\162"
+ u"\1\42\1\ufffe\1\uffff\1\ufffe\1\170\1\146\1\uffff\1\ufffe\2\uffff"
+ u"\1\160\4\uffff\1\165\1\164\1\163\1\172\1\162\1\157\1\151\2\164"
+ u"\1\154\1\156\1\163\1\141\1\172\1\164\1\156\1\157\1\162\1\172\1"
+ u"\146\1\163\3\uffff\1\172\1\124\34\uffff\1\75\2\uffff\1\75\10\uffff"
u"\1\151\1\164\1\145\4\uffff\2\146\2\uffff\1\145\1\155\3\145\1\156"
u"\1\164\1\165\1\162\1\164\1\157\1\165\1\151\1\144\1\141\1\164\1"
u"\145\1\162\1\uffff\1\172\1\147\1\141\1\172\1\142\1\uffff\1\141"
)
DFA36_accept = DFA.unpack(
- u"\2\uffff\1\2\1\3\14\uffff\1\22\1\23\1\26\2\uffff\1\34\1\35\1\36"
- u"\1\37\7\uffff\1\54\5\uffff\1\70\5\uffff\1\121\3\uffff\1\130\1\uffff"
- u"\1\131\1\uffff\1\121\1\2\1\3\1\75\1\4\25\uffff\1\22\1\23\1\26\2"
- u"\uffff\1\34\1\35\1\36\1\37\1\56\1\40\1\41\1\51\1\127\1\46\1\61"
- u"\1\42\1\62\1\52\1\47\1\43\1\57\1\132\1\133\1\44\1\60\1\45\1\72"
- u"\1\65\1\53\1\54\1\76\1\55\1\uffff\1\101\1\77\1\uffff\1\102\1\100"
- u"\1\66\1\74\1\67\1\71\1\73\1\70\3\uffff\1\123\1\122\1\124\1\125"
- u"\2\uffff\1\130\1\134\22\uffff\1\107\5\uffff\1\113\3\uffff\1\32"
- u"\1\uffff\1\63\1\103\1\64\1\104\3\uffff\1\126\23\uffff\1\14\2\uffff"
- u"\1\114\4\uffff\1\33\4\uffff\1\27\1\uffff\1\110\6\uffff\1\7\2\uffff"
- u"\1\11\3\uffff\1\105\1\12\1\15\6\uffff\1\115\7\uffff\1\13\5\uffff"
- u"\1\30\1\16\2\uffff\1\25\1\uffff\1\112\1\117\1\uffff\1\5\1\50\1"
- u"\20\1\6\1\24\1\111\1\120\3\uffff\1\17\2\uffff\1\1\3\uffff\1\106"
- u"\1\uffff\1\10\1\31\1\116\1\21"
+ u"\1\uffff\1\1\1\uffff\1\3\14\uffff\1\22\1\23\1\26\2\uffff\1\34\1"
+ u"\35\1\36\1\37\7\uffff\1\54\5\uffff\1\70\5\uffff\1\121\3\uffff\1"
+ u"\130\1\uffff\1\131\1\1\1\uffff\1\121\1\3\1\75\1\4\25\uffff\1\22"
+ u"\1\23\1\26\2\uffff\1\34\1\35\1\36\1\37\1\56\1\40\1\41\1\51\1\127"
+ u"\1\46\1\61\1\42\1\62\1\52\1\47\1\43\1\57\1\132\1\133\1\44\1\60"
+ u"\1\45\1\72\1\65\1\53\1\54\1\76\1\55\1\uffff\1\101\1\77\1\uffff"
+ u"\1\102\1\100\1\66\1\74\1\67\1\71\1\73\1\70\3\uffff\1\123\1\122"
+ u"\1\124\1\125\2\uffff\1\130\1\134\22\uffff\1\107\5\uffff\1\113\3"
+ u"\uffff\1\32\1\uffff\1\63\1\103\1\64\1\104\3\uffff\1\126\23\uffff"
+ u"\1\14\2\uffff\1\114\4\uffff\1\33\4\uffff\1\27\1\uffff\1\110\6\uffff"
+ u"\1\7\2\uffff\1\11\3\uffff\1\105\1\12\1\15\6\uffff\1\115\7\uffff"
+ u"\1\13\5\uffff\1\30\1\16\2\uffff\1\25\1\uffff\1\112\1\117\1\uffff"
+ u"\1\5\1\50\1\20\1\6\1\24\1\111\1\120\3\uffff\1\17\2\uffff\1\2\3"
+ u"\uffff\1\106\1\uffff\1\10\1\31\1\116\1\21"
)
DFA36_special = DFA.unpack(
DFA36_transition = [
DFA.unpack(u"\6\62\2\60\1\62\2\60\22\62\1\60\1\41\1\55\1\61\1\54"
u"\1\36\1\37\1\53\1\25\1\26\1\31\1\33\1\3\1\34\1\32\1\35\1\56\11"
- u"\57\1\22\1\2\1\42\1\4\1\43\1\46\1\62\10\54\1\23\2\54\1\52\2\54"
+ u"\57\1\22\1\1\1\42\1\4\1\43\1\46\1\62\10\54\1\23\2\54\1\52\2\54"
u"\1\24\13\54\1\27\1\62\1\30\1\44\1\54\1\62\1\7\1\51\1\12\1\16\1"
- u"\5\1\15\1\50\1\54\1\13\2\54\1\14\5\54\1\10\1\6\1\1\1\17\1\11\1"
+ u"\5\1\15\1\50\1\54\1\13\2\54\1\14\5\54\1\10\1\6\1\2\1\17\1\11\1"
u"\47\3\54\1\20\1\45\1\21\1\40\uff80\62"),
- DFA.unpack(u"\1\63"),
DFA.unpack(u""),
+ DFA.unpack(u"\1\64"),
DFA.unpack(u""),
DFA.unpack(u"\1\67"),
DFA.unpack(u"\1\73\1\uffff\1\71\11\uffff\1\72"),
DFA.unpack(u""),
DFA.unpack(u"\uffff\u0085"),
DFA.unpack(u""),
- DFA.unpack(u"\1\u0086"),
DFA.unpack(u""),
+ DFA.unpack(u"\1\u0086"),
DFA.unpack(u""),
DFA.unpack(u""),
DFA.unpack(u""),
DFA.unpack(u"\1\u0095"),
DFA.unpack(u"\1\u0096"),
DFA.unpack(u"\1\u0097"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u0099"),
DFA.unpack(u"\1\u009a"),
DFA.unpack(u"\1\u009b"),
DFA.unpack(u"\1\u009c"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\24\64\1\u009d\5\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\24\65\1\u009d\5\65"),
DFA.unpack(u"\1\u009f"),
DFA.unpack(u"\1\u00a0\11\uffff\1\u00a1"),
DFA.unpack(u""),
DFA.unpack(u""),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00a3"),
DFA.unpack(u""),
DFA.unpack(u""),
DFA.unpack(u"\1\u00bd"),
DFA.unpack(u"\1\u00be"),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00c0"),
DFA.unpack(u"\1\u00c1"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00c3"),
DFA.unpack(u""),
DFA.unpack(u"\1\u00c4"),
DFA.unpack(u"\1\u00c5"),
DFA.unpack(u"\1\u00c6"),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u""),
DFA.unpack(u""),
DFA.unpack(u""),
DFA.unpack(u"\1\u00ca"),
DFA.unpack(u""),
DFA.unpack(u"\1\u00cb"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00cd"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00cf"),
DFA.unpack(u"\1\u00d0"),
DFA.unpack(u"\1\u00d1"),
DFA.unpack(u"\1\u00d2"),
DFA.unpack(u"\1\u00d3"),
DFA.unpack(u"\1\u00d4"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00d6"),
DFA.unpack(u"\1\u00d7"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00d9"),
DFA.unpack(u"\1\u00da"),
DFA.unpack(u"\1\u00db"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00df"),
DFA.unpack(u""),
DFA.unpack(u"\1\u00e0"),
DFA.unpack(u"\1\u00e3"),
DFA.unpack(u""),
DFA.unpack(u"\1\u00e4"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00e6"),
DFA.unpack(u"\1\u00e7"),
DFA.unpack(u""),
DFA.unpack(u"\1\u00ea"),
DFA.unpack(u"\1\u00eb"),
DFA.unpack(u"\1\u00ec"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00ee"),
DFA.unpack(u""),
DFA.unpack(u"\1\u00ef"),
DFA.unpack(u""),
DFA.unpack(u"\1\u00f1"),
DFA.unpack(u"\1\u00f2"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u""),
DFA.unpack(u""),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00f5"),
DFA.unpack(u"\1\u00f6"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00f8"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u00fb"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u0103"),
DFA.unpack(u"\1\u0104"),
DFA.unpack(u"\1\u0105"),
DFA.unpack(u""),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u0107"),
DFA.unpack(u""),
DFA.unpack(u"\1\u0108"),
DFA.unpack(u""),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u""),
DFA.unpack(u""),
DFA.unpack(u""),
DFA.unpack(u"\1\u010b"),
DFA.unpack(u"\1\u010c"),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u"\1\u010e"),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u""),
- DFA.unpack(u"\1\64\13\uffff\12\64\7\uffff\32\64\4\uffff\1\64\1\uffff"
- u"\32\64"),
+ DFA.unpack(u"\1\65\13\uffff\12\65\7\uffff\32\65\4\uffff\1\65\1\uffff"
+ u"\32\65"),
DFA.unpack(u""),
DFA.unpack(u""),
DFA.unpack(u""),
-# $ANTLR 3.0.1 C.g 2007-12-12 15:55:52
+# $ANTLR 3.0.1 C.g 2007-12-25 19:09:35
from antlr3 import *
from antlr3.compat import set, frozenset
+ \r
+import CodeFragment\r
+import FileProfile\r
+
# for convenience in actions
"STRING_LITERAL", "FLOATING_POINT_LITERAL", "LETTER", "EscapeSequence",
"HexDigit", "IntegerTypeSuffix", "Exponent", "FloatTypeSuffix", "OctalEscape",
"UnicodeEscape", "WS", "UnicodeVocabulary", "COMMENT", "LINE_COMMENT",
- "LINE_COMMAND", "'typedef'", "';'", "','", "'='", "'extern'", "'static'",
+ "LINE_COMMAND", "';'", "'typedef'", "','", "'='", "'extern'", "'static'",
"'auto'", "'register'", "'void'", "'char'", "'short'", "'int'", "'long'",
"'float'", "'double'", "'signed'", "'unsigned'", "'{'", "'}'", "'struct'",
"'union'", "':'", "'enum'", "'const'", "'volatile'", "'IN'", "'OUT'",
"'while'", "'do'", "'for'", "'goto'", "'continue'", "'break'", "'return'"
]
-class Symbols_scope(object):
- def __init__(self):
- self.types = None
- self.inFunc = None
-
-class declaration_scope(object):
+class function_definition_scope(object):
def __init__(self):
- self.isTypedef = None
+ self.ModifierText = None
+ self.DeclText = None
class CParser(Parser):
Parser.__init__(self, input)
self.ruleMemo = {}
- self.Symbols_stack = []
-
- self.declaration_stack = []
+ self.function_definition_stack = []
\r
- def isTypeName(self, name):\r
- for scope in reversed(self.Symbols_stack):\r
- if name in scope.types:\r
- return True\r
- \r
- return False\r
- \r
+ \r
def printTokenInfo(self, line, offset, tokenText):\r
print str(line)+ ',' + str(offset) + ':' + str(tokenText)\r
+ \r
+ def StorePredicateExpression(self, StartLine, StartOffset, EndLine, EndOffset, Text):\r
+ PredExp = CodeFragment.PredicateExpression(Text, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.PredicateExpressionList.append(PredExp)\r
\r
- def printFuncHeader(self, line, offset, tokenText):\r
- print str(line)+ ',' + str(offset) + ':' + str(tokenText) + ' is function header.'\r
+ def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):\r
+ EnumDef = CodeFragment.EnumerationDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.EnumerationDefinitionList.append(EnumDef)\r
+ \r
+ def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):\r
+ SUDef = CodeFragment.StructUnionDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.StructUnionDefinitionList.append(SUDef)\r
+ \r
+ def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndOffset, FromText, ToText):\r
+ Tdef = CodeFragment.TypedefDefinition(FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.TypedefDefinitionList.append(Tdef)\r
+ \r
+ def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText):\r
+ FuncDef = CodeFragment.FunctionDefinition(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.FunctionDefinitionList.append(FuncDef)\r
+ \r
+ def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText):\r
+ VarDecl = CodeFragment.VariableDeclaration(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset))\r
+ FileProfile.VariableDeclarationList.append(VarDecl)\r
\r
# $ANTLR start translation_unit
- # C.g:31:1: translation_unit : ( external_declaration )+ ;
+ # C.g:46:1: translation_unit : ( external_declaration )+ ;
def translation_unit(self, ):
- self.Symbols_stack.append(Symbols_scope())
translation_unit_StartIndex = self.input.index()
- \r
- self.Symbols_stack[-1].types = set()\r
- self.Symbols_stack[-1].inFunc = False\r
-
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 1):
return
- # C.g:37:2: ( ( external_declaration )+ )
- # C.g:37:4: ( external_declaration )+
- # C.g:37:4: ( external_declaration )+
+ # C.g:47:2: ( ( external_declaration )+ )
+ # C.g:47:4: ( external_declaration )+
+ # C.g:47:4: ( external_declaration )+
cnt1 = 0
while True: #loop1
alt1 = 2
LA1_0 = self.input.LA(1)
- if (LA1_0 == IDENTIFIER or LA1_0 == 24 or (28 <= LA1_0 <= 40) or (43 <= LA1_0 <= 44) or (46 <= LA1_0 <= 51) or LA1_0 == 55) :
+ if (LA1_0 == IDENTIFIER or LA1_0 == 25 or (28 <= LA1_0 <= 40) or (43 <= LA1_0 <= 44) or (46 <= LA1_0 <= 51) or LA1_0 == 55) :
alt1 = 1
if alt1 == 1:
# C.g:0:0: external_declaration
- self.following.append(self.FOLLOW_external_declaration_in_translation_unit76)
+ self.following.append(self.FOLLOW_external_declaration_in_translation_unit64)
self.external_declaration()
self.following.pop()
if self.failed:
if self.backtracking > 0:
self.memoize(self.input, 1, translation_unit_StartIndex)
- self.Symbols_stack.pop()
-
pass
return
# $ANTLR start external_declaration
- # C.g:48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );
+ # C.g:58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );
def external_declaration(self, ):
external_declaration_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 2):
return
- # C.g:53:2: ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement )
- alt2 = 3
- LA2_0 = self.input.LA(1)
+ # C.g:63:2: ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? )
+ alt3 = 3
+ LA3_0 = self.input.LA(1)
- if ((28 <= LA2_0 <= 31)) :
- LA2_1 = self.input.LA(2)
+ if ((28 <= LA3_0 <= 31)) :
+ LA3_1 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 1, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 1, self.input)
raise nvae
- elif (LA2_0 == 32) :
- LA2_2 = self.input.LA(2)
+ elif (LA3_0 == 32) :
+ LA3_2 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 2, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 2, self.input)
raise nvae
- elif (LA2_0 == 33) :
- LA2_3 = self.input.LA(2)
+ elif (LA3_0 == 33) :
+ LA3_3 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 3, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 3, self.input)
raise nvae
- elif (LA2_0 == 34) :
- LA2_4 = self.input.LA(2)
+ elif (LA3_0 == 34) :
+ LA3_4 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 4, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 4, self.input)
raise nvae
- elif (LA2_0 == 35) :
- LA2_5 = self.input.LA(2)
+ elif (LA3_0 == 35) :
+ LA3_5 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 5, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 5, self.input)
raise nvae
- elif (LA2_0 == 36) :
- LA2_6 = self.input.LA(2)
+ elif (LA3_0 == 36) :
+ LA3_6 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 6, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 6, self.input)
raise nvae
- elif (LA2_0 == 37) :
- LA2_7 = self.input.LA(2)
+ elif (LA3_0 == 37) :
+ LA3_7 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 7, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 7, self.input)
raise nvae
- elif (LA2_0 == 38) :
- LA2_8 = self.input.LA(2)
+ elif (LA3_0 == 38) :
+ LA3_8 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 8, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 8, self.input)
raise nvae
- elif (LA2_0 == 39) :
- LA2_9 = self.input.LA(2)
+ elif (LA3_0 == 39) :
+ LA3_9 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 9, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 9, self.input)
raise nvae
- elif (LA2_0 == 40) :
- LA2_10 = self.input.LA(2)
+ elif (LA3_0 == 40) :
+ LA3_10 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 10, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 10, self.input)
raise nvae
- elif ((43 <= LA2_0 <= 44)) :
- LA2_11 = self.input.LA(2)
+ elif ((43 <= LA3_0 <= 44)) :
+ LA3_11 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 11, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 11, self.input)
raise nvae
- elif (LA2_0 == 46) :
- LA2_12 = self.input.LA(2)
+ elif (LA3_0 == 46) :
+ LA3_12 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 12, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 12, self.input)
raise nvae
- elif (LA2_0 == IDENTIFIER) :
- LA2_13 = self.input.LA(2)
+ elif (LA3_0 == IDENTIFIER) :
+ LA3_13 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
elif (True) :
- alt2 = 3
+ alt3 = 3
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 13, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 13, self.input)
raise nvae
- elif ((47 <= LA2_0 <= 50)) :
- LA2_14 = self.input.LA(2)
+ elif ((47 <= LA3_0 <= 50)) :
+ LA3_14 = self.input.LA(2)
if (self.synpred4()) :
- alt2 = 1
+ alt3 = 1
elif (self.synpred5()) :
- alt2 = 2
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 14, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 14, self.input)
raise nvae
- elif (LA2_0 == 55) and (self.synpred4()):
- alt2 = 1
- elif (LA2_0 == 51) and (self.synpred4()):
- alt2 = 1
- elif (LA2_0 == 24) :
- alt2 = 2
+ elif (LA3_0 == 55) and (self.synpred4()):
+ alt3 = 1
+ elif (LA3_0 == 51) and (self.synpred4()):
+ alt3 = 1
+ elif (LA3_0 == 25) :
+ alt3 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("48:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement );", 2, 0, self.input)
+ nvae = NoViableAltException("58:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 0, self.input)
raise nvae
- if alt2 == 1:
- # C.g:53:4: ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition
- self.following.append(self.FOLLOW_function_definition_in_external_declaration115)
+ if alt3 == 1:
+ # C.g:63:4: ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition
+ self.following.append(self.FOLLOW_function_definition_in_external_declaration103)
self.function_definition()
self.following.pop()
if self.failed:
return
- elif alt2 == 2:
- # C.g:54:4: declaration
- self.following.append(self.FOLLOW_declaration_in_external_declaration120)
+ elif alt3 == 2:
+ # C.g:64:4: declaration
+ self.following.append(self.FOLLOW_declaration_in_external_declaration108)
self.declaration()
self.following.pop()
if self.failed:
return
- elif alt2 == 3:
- # C.g:55:4: macro_statement
- self.following.append(self.FOLLOW_macro_statement_in_external_declaration125)
+ elif alt3 == 3:
+ # C.g:65:4: macro_statement ( ';' )?
+ self.following.append(self.FOLLOW_macro_statement_in_external_declaration113)
self.macro_statement()
self.following.pop()
if self.failed:
return
+ # C.g:65:20: ( ';' )?
+ alt2 = 2
+ LA2_0 = self.input.LA(1)
+
+ if (LA2_0 == 24) :
+ alt2 = 1
+ if alt2 == 1:
+ # C.g:65:21: ';'
+ self.match(self.input, 24, self.FOLLOW_24_in_external_declaration116)
+ if self.failed:
+ return
+
+
+
# $ANTLR start function_definition
- # C.g:61:1: function_definition : ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement ) ;
+ # C.g:70:1: function_definition : ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement ) ;
def function_definition(self, ):
- self.Symbols_stack.append(Symbols_scope())
-
+ self.function_definition_stack.append(function_definition_scope())
retval = self.function_definition_return()
retval.start = self.input.LT(1)
function_definition_StartIndex = self.input.index()
- declarator1 = None
+ declaration_specifiers1 = None
+ declarator2 = None
- \r
- self.Symbols_stack[-1].inFunc = True\r
+
+ \r
+ self.function_definition_stack[-1].ModifierText = ''\r
+ self.function_definition_stack[-1].DeclText = ''\r
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 3):
return retval
- # C.g:70:2: ( ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement ) )
- # C.g:70:4: ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement )
- # C.g:70:4: ( declaration_specifiers )?
- alt3 = 2
- LA3_0 = self.input.LA(1)
+ # C.g:82:2: ( ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement ) )
+ # C.g:82:4: ( declaration_specifiers )? declarator ( ( declaration )+ compound_statement | compound_statement )
+ # C.g:82:4: ( declaration_specifiers )?
+ alt4 = 2
+ LA4_0 = self.input.LA(1)
- if ((28 <= LA3_0 <= 40) or (43 <= LA3_0 <= 44) or (46 <= LA3_0 <= 50)) :
- alt3 = 1
- elif (LA3_0 == IDENTIFIER) :
- LA3 = self.input.LA(2)
- if LA3 == 51:
- LA3_18 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 28 or LA3 == 29 or LA3 == 30 or LA3 == 31:
- LA3_20 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 32:
- LA3_21 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 33:
- LA3_22 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 34:
- LA3_23 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 35:
- LA3_24 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 36:
- LA3_25 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 37:
- LA3_26 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 38:
- LA3_27 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 39:
- LA3_28 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 40:
- LA3_29 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 43 or LA3 == 44:
- LA3_30 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 46:
- LA3_31 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == IDENTIFIER:
- LA3_32 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 47 or LA3 == 48 or LA3 == 49 or LA3 == 50:
- LA3_33 = self.input.LA(3)
-
- if (self.synpred6()) :
- alt3 = 1
- elif LA3 == 55:
- alt3 = 1
- if alt3 == 1:
+ if ((28 <= LA4_0 <= 40) or (43 <= LA4_0 <= 44) or (46 <= LA4_0 <= 50)) :
+ alt4 = 1
+ elif (LA4_0 == IDENTIFIER) :
+ LA4 = self.input.LA(2)
+ if LA4 == 51:
+ LA4_18 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 28 or LA4 == 29 or LA4 == 30 or LA4 == 31:
+ LA4_20 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 32:
+ LA4_21 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 33:
+ LA4_22 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 34:
+ LA4_23 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 35:
+ LA4_24 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 36:
+ LA4_25 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 37:
+ LA4_26 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 38:
+ LA4_27 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 39:
+ LA4_28 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 40:
+ LA4_29 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 43 or LA4 == 44:
+ LA4_30 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 46:
+ LA4_31 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == IDENTIFIER:
+ LA4_32 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 47 or LA4 == 48 or LA4 == 49 or LA4 == 50:
+ LA4_33 = self.input.LA(3)
+
+ if (self.synpred7()) :
+ alt4 = 1
+ elif LA4 == 55:
+ alt4 = 1
+ if alt4 == 1:
# C.g:0:0: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_function_definition153)
- self.declaration_specifiers()
+ self.following.append(self.FOLLOW_declaration_specifiers_in_function_definition145)
+ declaration_specifiers1 = self.declaration_specifiers()
self.following.pop()
if self.failed:
return retval
- self.following.append(self.FOLLOW_declarator_in_function_definition156)
- declarator1 = self.declarator()
+ self.following.append(self.FOLLOW_declarator_in_function_definition148)
+ declarator2 = self.declarator()
self.following.pop()
if self.failed:
return retval
- # C.g:71:3: ( ( declaration )+ compound_statement | compound_statement )
- alt5 = 2
- LA5_0 = self.input.LA(1)
-
- if (LA5_0 == IDENTIFIER or LA5_0 == 24 or (28 <= LA5_0 <= 40) or (43 <= LA5_0 <= 44) or (46 <= LA5_0 <= 50)) :
- alt5 = 1
- elif (LA5_0 == 41) :
- alt5 = 2
+ # C.g:83:3: ( ( declaration )+ compound_statement | compound_statement )
+ alt6 = 2
+ LA6_0 = self.input.LA(1)
+
+ if (LA6_0 == IDENTIFIER or LA6_0 == 25 or (28 <= LA6_0 <= 40) or (43 <= LA6_0 <= 44) or (46 <= LA6_0 <= 50)) :
+ alt6 = 1
+ elif (LA6_0 == 41) :
+ alt6 = 2
else:
if self.backtracking > 0:
self.failed = True
return retval
- nvae = NoViableAltException("71:3: ( ( declaration )+ compound_statement | compound_statement )", 5, 0, self.input)
+ nvae = NoViableAltException("83:3: ( ( declaration )+ compound_statement | compound_statement )", 6, 0, self.input)
raise nvae
- if alt5 == 1:
- # C.g:71:5: ( declaration )+ compound_statement
- # C.g:71:5: ( declaration )+
- cnt4 = 0
- while True: #loop4
- alt4 = 2
- LA4_0 = self.input.LA(1)
+ if alt6 == 1:
+ # C.g:83:5: ( declaration )+ compound_statement
+ # C.g:83:5: ( declaration )+
+ cnt5 = 0
+ while True: #loop5
+ alt5 = 2
+ LA5_0 = self.input.LA(1)
- if (LA4_0 == IDENTIFIER or LA4_0 == 24 or (28 <= LA4_0 <= 40) or (43 <= LA4_0 <= 44) or (46 <= LA4_0 <= 50)) :
- alt4 = 1
+ if (LA5_0 == IDENTIFIER or LA5_0 == 25 or (28 <= LA5_0 <= 40) or (43 <= LA5_0 <= 44) or (46 <= LA5_0 <= 50)) :
+ alt5 = 1
- if alt4 == 1:
+ if alt5 == 1:
# C.g:0:0: declaration
- self.following.append(self.FOLLOW_declaration_in_function_definition162)
+ self.following.append(self.FOLLOW_declaration_in_function_definition154)
self.declaration()
self.following.pop()
if self.failed:
else:
- if cnt4 >= 1:
- break #loop4
+ if cnt5 >= 1:
+ break #loop5
if self.backtracking > 0:
self.failed = True
return retval
- eee = EarlyExitException(4, self.input)
+ eee = EarlyExitException(5, self.input)
raise eee
- cnt4 += 1
+ cnt5 += 1
- self.following.append(self.FOLLOW_compound_statement_in_function_definition165)
+ self.following.append(self.FOLLOW_compound_statement_in_function_definition157)
self.compound_statement()
self.following.pop()
if self.failed:
return retval
- elif alt5 == 2:
- # C.g:72:5: compound_statement
- self.following.append(self.FOLLOW_compound_statement_in_function_definition172)
+ elif alt6 == 2:
+ # C.g:84:5: compound_statement
+ self.following.append(self.FOLLOW_compound_statement_in_function_definition164)
self.compound_statement()
self.following.pop()
if self.failed:
if self.backtracking == 0:
- self.printFuncHeader(declarator1.start.line, declarator1.start.charPositionInLine, self.input.toString(declarator1.start,declarator1.stop))
+ self.function_definition_stack[-1].ModifierText = self.input.toString(declaration_specifiers1.start,declaration_specifiers1.stop)\r
+ self.function_definition_stack[-1].DeclText = self.input.toString(declarator2.start,declarator2.stop)
if self.backtracking == 0:
\r
- print str(retval.start.line) + ',' + str(retval.start.charPositionInLine)\r
- print str(retval.stop.line) + ',' + str(retval.stop.charPositionInLine)\r
+ self.StoreFunctionDefinition(retval.start.line, retval.start.charPositionInLine, retval.stop.line, retval.stop.charPositionInLine, self.function_definition_stack[-1].ModifierText, self.function_definition_stack[-1].DeclText)\r
if self.backtracking > 0:
self.memoize(self.input, 3, function_definition_StartIndex)
- self.Symbols_stack.pop()
-
+ self.function_definition_stack.pop()
pass
return retval
# $ANTLR start declaration
- # C.g:76:1: declaration : (a= 'typedef' ( declaration_specifiers )? init_declarator_list ';' | declaration_specifiers ( init_declarator_list )? ';' );
+ # C.g:89:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );
def declaration(self, ):
- self.declaration_stack.append(declaration_scope())
+
declaration_StartIndex = self.input.index()
a = None
+ d = None
+ e = None
+ b = None
+
+ c = None
+
+ s = None
+
+ t = None
- \r
- self.declaration_stack[-1].isTypedef = False\r
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 4):
return
- # C.g:83:2: (a= 'typedef' ( declaration_specifiers )? init_declarator_list ';' | declaration_specifiers ( init_declarator_list )? ';' )
- alt8 = 2
- LA8_0 = self.input.LA(1)
+ # C.g:90:2: (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' )
+ alt9 = 2
+ LA9_0 = self.input.LA(1)
- if (LA8_0 == 24) :
- alt8 = 1
- elif (LA8_0 == IDENTIFIER or (28 <= LA8_0 <= 40) or (43 <= LA8_0 <= 44) or (46 <= LA8_0 <= 50)) :
- alt8 = 2
+ if (LA9_0 == 25) :
+ alt9 = 1
+ elif (LA9_0 == IDENTIFIER or (28 <= LA9_0 <= 40) or (43 <= LA9_0 <= 44) or (46 <= LA9_0 <= 50)) :
+ alt9 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("76:1: declaration : (a= 'typedef' ( declaration_specifiers )? init_declarator_list ';' | declaration_specifiers ( init_declarator_list )? ';' );", 8, 0, self.input)
+ nvae = NoViableAltException("89:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );", 9, 0, self.input)
raise nvae
- if alt8 == 1:
- # C.g:83:4: a= 'typedef' ( declaration_specifiers )? init_declarator_list ';'
+ if alt9 == 1:
+ # C.g:90:4: a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';'
a = self.input.LT(1)
- self.match(self.input, 24, self.FOLLOW_24_in_declaration204)
+ self.match(self.input, 25, self.FOLLOW_25_in_declaration187)
if self.failed:
return
- # C.g:83:16: ( declaration_specifiers )?
- alt6 = 2
- LA6_0 = self.input.LA(1)
-
- if ((28 <= LA6_0 <= 40) or (43 <= LA6_0 <= 44) or (46 <= LA6_0 <= 50)) :
- alt6 = 1
- elif (LA6_0 == IDENTIFIER) :
- LA6_13 = self.input.LA(2)
-
- if (LA6_13 == 51) :
- LA6_18 = self.input.LA(3)
-
- if (self.synpred9()) :
- alt6 = 1
- elif (LA6_13 == IDENTIFIER or (28 <= LA6_13 <= 40) or (43 <= LA6_13 <= 44) or (46 <= LA6_13 <= 50) or LA6_13 == 55) :
- alt6 = 1
- if alt6 == 1:
- # C.g:0:0: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_declaration206)
- self.declaration_specifiers()
+ # C.g:90:17: (b= declaration_specifiers )?
+ alt7 = 2
+ LA7_0 = self.input.LA(1)
+
+ if ((28 <= LA7_0 <= 40) or (43 <= LA7_0 <= 44) or (46 <= LA7_0 <= 50)) :
+ alt7 = 1
+ elif (LA7_0 == IDENTIFIER) :
+ LA7_13 = self.input.LA(2)
+
+ if (LA7_13 == IDENTIFIER or (28 <= LA7_13 <= 40) or (43 <= LA7_13 <= 44) or (46 <= LA7_13 <= 50) or LA7_13 == 55) :
+ alt7 = 1
+ elif (LA7_13 == 51) :
+ LA7_19 = self.input.LA(3)
+
+ if (self.synpred10()) :
+ alt7 = 1
+ if alt7 == 1:
+ # C.g:0:0: b= declaration_specifiers
+ self.following.append(self.FOLLOW_declaration_specifiers_in_declaration191)
+ b = self.declaration_specifiers()
self.following.pop()
if self.failed:
return
- self.following.append(self.FOLLOW_init_declarator_list_in_declaration213)
- self.init_declarator_list()
+ self.following.append(self.FOLLOW_init_declarator_list_in_declaration200)
+ c = self.init_declarator_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 25, self.FOLLOW_25_in_declaration215)
+ d = self.input.LT(1)
+ self.match(self.input, 24, self.FOLLOW_24_in_declaration204)
if self.failed:
return
+ if self.backtracking == 0:
+ \r
+ if b != None:\r
+ self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, self.input.toString(b.start,b.stop), self.input.toString(c.start,c.stop))\r
+ else:\r
+ self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start,c.stop))\r
+
+
- elif alt8 == 2:
- # C.g:85:4: declaration_specifiers ( init_declarator_list )? ';'
- self.following.append(self.FOLLOW_declaration_specifiers_in_declaration221)
- self.declaration_specifiers()
+ elif alt9 == 2:
+ # C.g:98:4: s= declaration_specifiers (t= init_declarator_list )? e= ';'
+ self.following.append(self.FOLLOW_declaration_specifiers_in_declaration218)
+ s = self.declaration_specifiers()
self.following.pop()
if self.failed:
return
- # C.g:85:27: ( init_declarator_list )?
- alt7 = 2
- LA7_0 = self.input.LA(1)
-
- if (LA7_0 == IDENTIFIER or LA7_0 == 51 or LA7_0 == 55) :
- alt7 = 1
- if alt7 == 1:
- # C.g:0:0: init_declarator_list
- self.following.append(self.FOLLOW_init_declarator_list_in_declaration223)
- self.init_declarator_list()
+ # C.g:98:30: (t= init_declarator_list )?
+ alt8 = 2
+ LA8_0 = self.input.LA(1)
+
+ if (LA8_0 == IDENTIFIER or LA8_0 == 51 or LA8_0 == 55) :
+ alt8 = 1
+ if alt8 == 1:
+ # C.g:0:0: t= init_declarator_list
+ self.following.append(self.FOLLOW_init_declarator_list_in_declaration222)
+ t = self.init_declarator_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 25, self.FOLLOW_25_in_declaration226)
+ e = self.input.LT(1)
+ self.match(self.input, 24, self.FOLLOW_24_in_declaration227)
if self.failed:
return
+ if self.backtracking == 0:
+ self.StoreVariableDeclaration(s.start.line, s.start.charPositionInLine, e.line, e.charPositionInLine, self.input.toString(s.start,s.stop), self.input.toString(t.start,t.stop))
+
if self.backtracking > 0:
self.memoize(self.input, 4, declaration_StartIndex)
- self.declaration_stack.pop()
pass
return
# $ANTLR end declaration
+ class declaration_specifiers_return(object):
+ def __init__(self):
+ self.start = None
+ self.stop = None
+
+
# $ANTLR start declaration_specifiers
- # C.g:89:1: declaration_specifiers : ( storage_class_specifier | type_specifier | type_qualifier )+ ;
+ # C.g:102:1: declaration_specifiers : ( storage_class_specifier | type_specifier | type_qualifier )+ ;
def declaration_specifiers(self, ):
+ retval = self.declaration_specifiers_return()
+ retval.start = self.input.LT(1)
declaration_specifiers_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 5):
- return
+ return retval
+
+ # C.g:103:2: ( ( storage_class_specifier | type_specifier | type_qualifier )+ )
+ # C.g:103:6: ( storage_class_specifier | type_specifier | type_qualifier )+
+ # C.g:103:6: ( storage_class_specifier | type_specifier | type_qualifier )+
+ cnt10 = 0
+ while True: #loop10
+ alt10 = 4
+ LA10 = self.input.LA(1)
+ if LA10 == IDENTIFIER:
+ LA10_2 = self.input.LA(2)
- # C.g:90:2: ( ( storage_class_specifier | type_specifier | type_qualifier )+ )
- # C.g:90:6: ( storage_class_specifier | type_specifier | type_qualifier )+
- # C.g:90:6: ( storage_class_specifier | type_specifier | type_qualifier )+
- cnt9 = 0
- while True: #loop9
- alt9 = 4
- LA9 = self.input.LA(1)
- if LA9 == IDENTIFIER:
- LA9_2 = self.input.LA(2)
-
- if (self.synpred13()) :
- alt9 = 2
-
-
- elif LA9 == 28 or LA9 == 29 or LA9 == 30 or LA9 == 31:
- alt9 = 1
- elif LA9 == 32 or LA9 == 33 or LA9 == 34 or LA9 == 35 or LA9 == 36 or LA9 == 37 or LA9 == 38 or LA9 == 39 or LA9 == 40 or LA9 == 43 or LA9 == 44 or LA9 == 46:
- alt9 = 2
- elif LA9 == 47 or LA9 == 48 or LA9 == 49 or LA9 == 50:
- alt9 = 3
-
- if alt9 == 1:
- # C.g:90:10: storage_class_specifier
- self.following.append(self.FOLLOW_storage_class_specifier_in_declaration_specifiers245)
+ if (self.synpred14()) :
+ alt10 = 2
+
+
+ elif LA10 == 28 or LA10 == 29 or LA10 == 30 or LA10 == 31:
+ alt10 = 1
+ elif LA10 == 32 or LA10 == 33 or LA10 == 34 or LA10 == 35 or LA10 == 36 or LA10 == 37 or LA10 == 38 or LA10 == 39 or LA10 == 40 or LA10 == 43 or LA10 == 44 or LA10 == 46:
+ alt10 = 2
+ elif LA10 == 47 or LA10 == 48 or LA10 == 49 or LA10 == 50:
+ alt10 = 3
+
+ if alt10 == 1:
+ # C.g:103:10: storage_class_specifier
+ self.following.append(self.FOLLOW_storage_class_specifier_in_declaration_specifiers248)
self.storage_class_specifier()
self.following.pop()
if self.failed:
- return
+ return retval
- elif alt9 == 2:
- # C.g:91:7: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_declaration_specifiers253)
+ elif alt10 == 2:
+ # C.g:104:7: type_specifier
+ self.following.append(self.FOLLOW_type_specifier_in_declaration_specifiers256)
self.type_specifier()
self.following.pop()
if self.failed:
- return
+ return retval
- elif alt9 == 3:
- # C.g:92:13: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_declaration_specifiers267)
+ elif alt10 == 3:
+ # C.g:105:13: type_qualifier
+ self.following.append(self.FOLLOW_type_qualifier_in_declaration_specifiers270)
self.type_qualifier()
self.following.pop()
if self.failed:
- return
+ return retval
else:
- if cnt9 >= 1:
- break #loop9
+ if cnt10 >= 1:
+ break #loop10
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- eee = EarlyExitException(9, self.input)
+ eee = EarlyExitException(10, self.input)
raise eee
- cnt9 += 1
+ cnt10 += 1
+
+ retval.stop = self.input.LT(-1)
except RecognitionException, re:
pass
- return
+ return retval
# $ANTLR end declaration_specifiers
+ class init_declarator_list_return(object):
+ def __init__(self):
+ self.start = None
+ self.stop = None
+
+
# $ANTLR start init_declarator_list
- # C.g:96:1: init_declarator_list : init_declarator ( ',' init_declarator )* ;
+ # C.g:109:1: init_declarator_list : init_declarator ( ',' init_declarator )* ;
def init_declarator_list(self, ):
+ retval = self.init_declarator_list_return()
+ retval.start = self.input.LT(1)
init_declarator_list_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 6):
- return
+ return retval
- # C.g:97:2: ( init_declarator ( ',' init_declarator )* )
- # C.g:97:4: init_declarator ( ',' init_declarator )*
- self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list289)
+ # C.g:110:2: ( init_declarator ( ',' init_declarator )* )
+ # C.g:110:4: init_declarator ( ',' init_declarator )*
+ self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list292)
self.init_declarator()
self.following.pop()
if self.failed:
- return
- # C.g:97:20: ( ',' init_declarator )*
- while True: #loop10
- alt10 = 2
- LA10_0 = self.input.LA(1)
+ return retval
+ # C.g:110:20: ( ',' init_declarator )*
+ while True: #loop11
+ alt11 = 2
+ LA11_0 = self.input.LA(1)
- if (LA10_0 == 26) :
- alt10 = 1
+ if (LA11_0 == 26) :
+ alt11 = 1
- if alt10 == 1:
- # C.g:97:21: ',' init_declarator
- self.match(self.input, 26, self.FOLLOW_26_in_init_declarator_list292)
+ if alt11 == 1:
+ # C.g:110:21: ',' init_declarator
+ self.match(self.input, 26, self.FOLLOW_26_in_init_declarator_list295)
if self.failed:
- return
- self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list294)
+ return retval
+ self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list297)
self.init_declarator()
self.following.pop()
if self.failed:
- return
+ return retval
else:
- break #loop10
+ break #loop11
+ retval.stop = self.input.LT(-1)
+
except RecognitionException, re:
self.reportError(re)
pass
- return
+ return retval
# $ANTLR end init_declarator_list
# $ANTLR start init_declarator
- # C.g:100:1: init_declarator : declarator ( '=' initializer )? ;
+ # C.g:113:1: init_declarator : declarator ( '=' initializer )? ;
def init_declarator(self, ):
init_declarator_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 7):
return
- # C.g:101:2: ( declarator ( '=' initializer )? )
- # C.g:101:4: declarator ( '=' initializer )?
- self.following.append(self.FOLLOW_declarator_in_init_declarator307)
+ # C.g:114:2: ( declarator ( '=' initializer )? )
+ # C.g:114:4: declarator ( '=' initializer )?
+ self.following.append(self.FOLLOW_declarator_in_init_declarator310)
self.declarator()
self.following.pop()
if self.failed:
return
- # C.g:101:15: ( '=' initializer )?
- alt11 = 2
- LA11_0 = self.input.LA(1)
+ # C.g:114:15: ( '=' initializer )?
+ alt12 = 2
+ LA12_0 = self.input.LA(1)
- if (LA11_0 == 27) :
- alt11 = 1
- if alt11 == 1:
- # C.g:101:16: '=' initializer
- self.match(self.input, 27, self.FOLLOW_27_in_init_declarator310)
+ if (LA12_0 == 27) :
+ alt12 = 1
+ if alt12 == 1:
+ # C.g:114:16: '=' initializer
+ self.match(self.input, 27, self.FOLLOW_27_in_init_declarator313)
if self.failed:
return
- self.following.append(self.FOLLOW_initializer_in_init_declarator312)
+ self.following.append(self.FOLLOW_initializer_in_init_declarator315)
self.initializer()
self.following.pop()
if self.failed:
# $ANTLR start storage_class_specifier
- # C.g:105:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' | 'register' );
+ # C.g:117:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' | 'register' );
def storage_class_specifier(self, ):
storage_class_specifier_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 8):
return
- # C.g:106:2: ( 'extern' | 'static' | 'auto' | 'register' )
+ # C.g:118:2: ( 'extern' | 'static' | 'auto' | 'register' )
# C.g:
if (28 <= self.input.LA(1) <= 31):
self.input.consume();
# $ANTLR start type_specifier
- # C.g:112:1: type_specifier options {k=3; } : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | struct_or_union_specifier | enum_specifier | ( IDENTIFIER declarator )=> type_id );
+ # C.g:124:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER declarator )=> type_id );
def type_specifier(self, ):
type_specifier_StartIndex = self.input.index()
+ s = None
+
+ e = None
+
+
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 9):
return
- # C.g:114:2: ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | struct_or_union_specifier | enum_specifier | ( IDENTIFIER declarator )=> type_id )
- alt12 = 12
- LA12_0 = self.input.LA(1)
+ # C.g:125:2: ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER declarator )=> type_id )
+ alt13 = 12
+ LA13_0 = self.input.LA(1)
- if (LA12_0 == 32) :
- alt12 = 1
- elif (LA12_0 == 33) :
- alt12 = 2
- elif (LA12_0 == 34) :
- alt12 = 3
- elif (LA12_0 == 35) :
- alt12 = 4
- elif (LA12_0 == 36) :
- alt12 = 5
- elif (LA12_0 == 37) :
- alt12 = 6
- elif (LA12_0 == 38) :
- alt12 = 7
- elif (LA12_0 == 39) :
- alt12 = 8
- elif (LA12_0 == 40) :
- alt12 = 9
- elif ((43 <= LA12_0 <= 44)) :
- alt12 = 10
- elif (LA12_0 == 46) :
- alt12 = 11
- elif (LA12_0 == IDENTIFIER) and (self.synpred31()):
- alt12 = 12
+ if (LA13_0 == 32) :
+ alt13 = 1
+ elif (LA13_0 == 33) :
+ alt13 = 2
+ elif (LA13_0 == 34) :
+ alt13 = 3
+ elif (LA13_0 == 35) :
+ alt13 = 4
+ elif (LA13_0 == 36) :
+ alt13 = 5
+ elif (LA13_0 == 37) :
+ alt13 = 6
+ elif (LA13_0 == 38) :
+ alt13 = 7
+ elif (LA13_0 == 39) :
+ alt13 = 8
+ elif (LA13_0 == 40) :
+ alt13 = 9
+ elif ((43 <= LA13_0 <= 44)) :
+ alt13 = 10
+ elif (LA13_0 == 46) :
+ alt13 = 11
+ elif (LA13_0 == IDENTIFIER) and (self.synpred32()):
+ alt13 = 12
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("112:1: type_specifier options {k=3; } : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | struct_or_union_specifier | enum_specifier | ( IDENTIFIER declarator )=> type_id );", 12, 0, self.input)
+ nvae = NoViableAltException("124:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER declarator )=> type_id );", 13, 0, self.input)
raise nvae
- if alt12 == 1:
- # C.g:114:4: 'void'
- self.match(self.input, 32, self.FOLLOW_32_in_type_specifier361)
+ if alt13 == 1:
+ # C.g:125:4: 'void'
+ self.match(self.input, 32, self.FOLLOW_32_in_type_specifier355)
if self.failed:
return
- elif alt12 == 2:
- # C.g:115:4: 'char'
- self.match(self.input, 33, self.FOLLOW_33_in_type_specifier366)
+ elif alt13 == 2:
+ # C.g:126:4: 'char'
+ self.match(self.input, 33, self.FOLLOW_33_in_type_specifier360)
if self.failed:
return
- elif alt12 == 3:
- # C.g:116:4: 'short'
- self.match(self.input, 34, self.FOLLOW_34_in_type_specifier371)
+ elif alt13 == 3:
+ # C.g:127:4: 'short'
+ self.match(self.input, 34, self.FOLLOW_34_in_type_specifier365)
if self.failed:
return
- elif alt12 == 4:
- # C.g:117:4: 'int'
- self.match(self.input, 35, self.FOLLOW_35_in_type_specifier376)
+ elif alt13 == 4:
+ # C.g:128:4: 'int'
+ self.match(self.input, 35, self.FOLLOW_35_in_type_specifier370)
if self.failed:
return
- elif alt12 == 5:
- # C.g:118:4: 'long'
- self.match(self.input, 36, self.FOLLOW_36_in_type_specifier381)
+ elif alt13 == 5:
+ # C.g:129:4: 'long'
+ self.match(self.input, 36, self.FOLLOW_36_in_type_specifier375)
if self.failed:
return
- elif alt12 == 6:
- # C.g:119:4: 'float'
- self.match(self.input, 37, self.FOLLOW_37_in_type_specifier386)
+ elif alt13 == 6:
+ # C.g:130:4: 'float'
+ self.match(self.input, 37, self.FOLLOW_37_in_type_specifier380)
if self.failed:
return
- elif alt12 == 7:
- # C.g:120:4: 'double'
- self.match(self.input, 38, self.FOLLOW_38_in_type_specifier391)
+ elif alt13 == 7:
+ # C.g:131:4: 'double'
+ self.match(self.input, 38, self.FOLLOW_38_in_type_specifier385)
if self.failed:
return
- elif alt12 == 8:
- # C.g:121:4: 'signed'
- self.match(self.input, 39, self.FOLLOW_39_in_type_specifier396)
+ elif alt13 == 8:
+ # C.g:132:4: 'signed'
+ self.match(self.input, 39, self.FOLLOW_39_in_type_specifier390)
if self.failed:
return
- elif alt12 == 9:
- # C.g:122:4: 'unsigned'
- self.match(self.input, 40, self.FOLLOW_40_in_type_specifier401)
+ elif alt13 == 9:
+ # C.g:133:4: 'unsigned'
+ self.match(self.input, 40, self.FOLLOW_40_in_type_specifier395)
if self.failed:
return
- elif alt12 == 10:
- # C.g:123:4: struct_or_union_specifier
- self.following.append(self.FOLLOW_struct_or_union_specifier_in_type_specifier406)
- self.struct_or_union_specifier()
+ elif alt13 == 10:
+ # C.g:134:4: s= struct_or_union_specifier
+ self.following.append(self.FOLLOW_struct_or_union_specifier_in_type_specifier402)
+ s = self.struct_or_union_specifier()
self.following.pop()
if self.failed:
return
+ if self.backtracking == 0:
+ self.StoreStructUnionDefinition(s.start.line, s.start.charPositionInLine, s.stop.line, s.stop.charPositionInLine, self.input.toString(s.start,s.stop))
- elif alt12 == 11:
- # C.g:124:4: enum_specifier
+
+ elif alt13 == 11:
+ # C.g:135:4: e= enum_specifier
self.following.append(self.FOLLOW_enum_specifier_in_type_specifier411)
- self.enum_specifier()
+ e = self.enum_specifier()
self.following.pop()
if self.failed:
return
+ if self.backtracking == 0:
+ self.StoreEnumerationDefinition(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
+
- elif alt12 == 12:
- # C.g:125:4: ( IDENTIFIER declarator )=> type_id
- self.following.append(self.FOLLOW_type_id_in_type_specifier423)
+ elif alt13 == 12:
+ # C.g:136:4: ( IDENTIFIER declarator )=> type_id
+ self.following.append(self.FOLLOW_type_id_in_type_specifier425)
self.type_id()
self.following.pop()
if self.failed:
# $ANTLR start type_id
- # C.g:128:1: type_id : IDENTIFIER ;
+ # C.g:139:1: type_id : IDENTIFIER ;
def type_id(self, ):
type_id_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 10):
return
- # C.g:129:5: ( IDENTIFIER )
- # C.g:129:9: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_type_id439)
+ # C.g:140:5: ( IDENTIFIER )
+ # C.g:140:9: IDENTIFIER
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_type_id441)
if self.failed:
return
# $ANTLR end type_id
+ class struct_or_union_specifier_return(object):
+ def __init__(self):
+ self.start = None
+ self.stop = None
+
+
# $ANTLR start struct_or_union_specifier
- # C.g:133:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );
+ # C.g:144:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );
def struct_or_union_specifier(self, ):
- self.Symbols_stack.append(Symbols_scope())
+ retval = self.struct_or_union_specifier_return()
+ retval.start = self.input.LT(1)
struct_or_union_specifier_StartIndex = self.input.index()
- \r
- self.Symbols_stack[-1].types = set()\r
-
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 11):
- return
+ return retval
- # C.g:139:2: ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER )
- alt14 = 2
- LA14_0 = self.input.LA(1)
+ # C.g:146:2: ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER )
+ alt15 = 2
+ LA15_0 = self.input.LA(1)
- if ((43 <= LA14_0 <= 44)) :
- LA14_1 = self.input.LA(2)
+ if ((43 <= LA15_0 <= 44)) :
+ LA15_1 = self.input.LA(2)
- if (LA14_1 == IDENTIFIER) :
- LA14_2 = self.input.LA(3)
+ if (LA15_1 == IDENTIFIER) :
+ LA15_2 = self.input.LA(3)
- if (LA14_2 == 41) :
- alt14 = 1
- elif (LA14_2 == EOF or LA14_2 == IDENTIFIER or LA14_2 == 25 or (28 <= LA14_2 <= 40) or (43 <= LA14_2 <= 53) or LA14_2 == 55) :
- alt14 = 2
+ if (LA15_2 == 41) :
+ alt15 = 1
+ elif (LA15_2 == EOF or LA15_2 == IDENTIFIER or LA15_2 == 24 or (28 <= LA15_2 <= 40) or (43 <= LA15_2 <= 53) or LA15_2 == 55) :
+ alt15 = 2
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("133:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 14, 2, self.input)
+ nvae = NoViableAltException("144:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 2, self.input)
raise nvae
- elif (LA14_1 == 41) :
- alt14 = 1
+ elif (LA15_1 == 41) :
+ alt15 = 1
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("133:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 14, 1, self.input)
+ nvae = NoViableAltException("144:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 1, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("133:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 14, 0, self.input)
+ nvae = NoViableAltException("144:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 0, self.input)
raise nvae
- if alt14 == 1:
- # C.g:139:4: struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}'
- self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier478)
+ if alt15 == 1:
+ # C.g:146:4: struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}'
+ self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier469)
self.struct_or_union()
self.following.pop()
if self.failed:
- return
- # C.g:139:20: ( IDENTIFIER )?
- alt13 = 2
- LA13_0 = self.input.LA(1)
+ return retval
+ # C.g:146:20: ( IDENTIFIER )?
+ alt14 = 2
+ LA14_0 = self.input.LA(1)
- if (LA13_0 == IDENTIFIER) :
- alt13 = 1
- if alt13 == 1:
+ if (LA14_0 == IDENTIFIER) :
+ alt14 = 1
+ if alt14 == 1:
# C.g:0:0: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier480)
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier471)
if self.failed:
- return
+ return retval
- self.match(self.input, 41, self.FOLLOW_41_in_struct_or_union_specifier483)
+ self.match(self.input, 41, self.FOLLOW_41_in_struct_or_union_specifier474)
if self.failed:
- return
- self.following.append(self.FOLLOW_struct_declaration_list_in_struct_or_union_specifier485)
+ return retval
+ self.following.append(self.FOLLOW_struct_declaration_list_in_struct_or_union_specifier476)
self.struct_declaration_list()
self.following.pop()
if self.failed:
- return
- self.match(self.input, 42, self.FOLLOW_42_in_struct_or_union_specifier487)
+ return retval
+ self.match(self.input, 42, self.FOLLOW_42_in_struct_or_union_specifier478)
if self.failed:
- return
+ return retval
- elif alt14 == 2:
- # C.g:140:4: struct_or_union IDENTIFIER
- self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier492)
+ elif alt15 == 2:
+ # C.g:147:4: struct_or_union IDENTIFIER
+ self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier483)
self.struct_or_union()
self.following.pop()
if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier494)
+ return retval
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier485)
if self.failed:
- return
+ return retval
+
+ retval.stop = self.input.LT(-1)
except RecognitionException, re:
if self.backtracking > 0:
self.memoize(self.input, 11, struct_or_union_specifier_StartIndex)
- self.Symbols_stack.pop()
-
pass
- return
+ return retval
# $ANTLR end struct_or_union_specifier
# $ANTLR start struct_or_union
- # C.g:143:1: struct_or_union : ( 'struct' | 'union' );
+ # C.g:150:1: struct_or_union : ( 'struct' | 'union' );
def struct_or_union(self, ):
struct_or_union_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 12):
return
- # C.g:144:2: ( 'struct' | 'union' )
+ # C.g:151:2: ( 'struct' | 'union' )
# C.g:
if (43 <= self.input.LA(1) <= 44):
self.input.consume();
# $ANTLR start struct_declaration_list
- # C.g:148:1: struct_declaration_list : ( struct_declaration )+ ;
+ # C.g:155:1: struct_declaration_list : ( struct_declaration )+ ;
def struct_declaration_list(self, ):
struct_declaration_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 13):
return
- # C.g:149:2: ( ( struct_declaration )+ )
- # C.g:149:4: ( struct_declaration )+
- # C.g:149:4: ( struct_declaration )+
- cnt15 = 0
- while True: #loop15
- alt15 = 2
- LA15_0 = self.input.LA(1)
+ # C.g:156:2: ( ( struct_declaration )+ )
+ # C.g:156:4: ( struct_declaration )+
+ # C.g:156:4: ( struct_declaration )+
+ cnt16 = 0
+ while True: #loop16
+ alt16 = 2
+ LA16_0 = self.input.LA(1)
- if (LA15_0 == IDENTIFIER or (32 <= LA15_0 <= 40) or (43 <= LA15_0 <= 44) or (46 <= LA15_0 <= 50)) :
- alt15 = 1
+ if (LA16_0 == IDENTIFIER or (32 <= LA16_0 <= 40) or (43 <= LA16_0 <= 44) or (46 <= LA16_0 <= 50)) :
+ alt16 = 1
- if alt15 == 1:
+ if alt16 == 1:
# C.g:0:0: struct_declaration
- self.following.append(self.FOLLOW_struct_declaration_in_struct_declaration_list521)
+ self.following.append(self.FOLLOW_struct_declaration_in_struct_declaration_list512)
self.struct_declaration()
self.following.pop()
if self.failed:
else:
- if cnt15 >= 1:
- break #loop15
+ if cnt16 >= 1:
+ break #loop16
if self.backtracking > 0:
self.failed = True
return
- eee = EarlyExitException(15, self.input)
+ eee = EarlyExitException(16, self.input)
raise eee
- cnt15 += 1
+ cnt16 += 1
# $ANTLR start struct_declaration
- # C.g:152:1: struct_declaration : specifier_qualifier_list struct_declarator_list ';' ;
+ # C.g:159:1: struct_declaration : specifier_qualifier_list struct_declarator_list ';' ;
def struct_declaration(self, ):
struct_declaration_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 14):
return
- # C.g:153:2: ( specifier_qualifier_list struct_declarator_list ';' )
- # C.g:153:4: specifier_qualifier_list struct_declarator_list ';'
- self.following.append(self.FOLLOW_specifier_qualifier_list_in_struct_declaration533)
+ # C.g:160:2: ( specifier_qualifier_list struct_declarator_list ';' )
+ # C.g:160:4: specifier_qualifier_list struct_declarator_list ';'
+ self.following.append(self.FOLLOW_specifier_qualifier_list_in_struct_declaration524)
self.specifier_qualifier_list()
self.following.pop()
if self.failed:
return
- self.following.append(self.FOLLOW_struct_declarator_list_in_struct_declaration535)
+ self.following.append(self.FOLLOW_struct_declarator_list_in_struct_declaration526)
self.struct_declarator_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 25, self.FOLLOW_25_in_struct_declaration537)
+ self.match(self.input, 24, self.FOLLOW_24_in_struct_declaration528)
if self.failed:
return
# $ANTLR start specifier_qualifier_list
- # C.g:156:1: specifier_qualifier_list : ( type_qualifier | type_specifier )+ ;
+ # C.g:163:1: specifier_qualifier_list : ( type_qualifier | type_specifier )+ ;
def specifier_qualifier_list(self, ):
specifier_qualifier_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 15):
return
- # C.g:157:2: ( ( type_qualifier | type_specifier )+ )
- # C.g:157:4: ( type_qualifier | type_specifier )+
- # C.g:157:4: ( type_qualifier | type_specifier )+
- cnt16 = 0
- while True: #loop16
- alt16 = 3
- LA16 = self.input.LA(1)
- if LA16 == IDENTIFIER:
- LA16 = self.input.LA(2)
- if LA16 == 53:
- LA16_20 = self.input.LA(3)
+ # C.g:164:2: ( ( type_qualifier | type_specifier )+ )
+ # C.g:164:4: ( type_qualifier | type_specifier )+
+ # C.g:164:4: ( type_qualifier | type_specifier )+
+ cnt17 = 0
+ while True: #loop17
+ alt17 = 3
+ LA17 = self.input.LA(1)
+ if LA17 == IDENTIFIER:
+ LA17 = self.input.LA(2)
+ if LA17 == EOF or LA17 == IDENTIFIER or LA17 == 32 or LA17 == 33 or LA17 == 34 or LA17 == 35 or LA17 == 36 or LA17 == 37 or LA17 == 38 or LA17 == 39 or LA17 == 40 or LA17 == 43 or LA17 == 44 or LA17 == 46 or LA17 == 47 or LA17 == 48 or LA17 == 49 or LA17 == 50 or LA17 == 52 or LA17 == 55:
+ alt17 = 2
+ elif LA17 == 51:
+ LA17_22 = self.input.LA(3)
- if (self.synpred37()) :
- alt16 = 2
+ if (self.synpred38()) :
+ alt17 = 2
- elif LA16 == 51:
- LA16_21 = self.input.LA(3)
+ elif LA17 == 45:
+ LA17_23 = self.input.LA(3)
- if (self.synpred37()) :
- alt16 = 2
+ if (self.synpred38()) :
+ alt17 = 2
- elif LA16 == 45:
- LA16_22 = self.input.LA(3)
+ elif LA17 == 53:
+ LA17_24 = self.input.LA(3)
- if (self.synpred37()) :
- alt16 = 2
+ if (self.synpred38()) :
+ alt17 = 2
- elif LA16 == EOF or LA16 == IDENTIFIER or LA16 == 32 or LA16 == 33 or LA16 == 34 or LA16 == 35 or LA16 == 36 or LA16 == 37 or LA16 == 38 or LA16 == 39 or LA16 == 40 or LA16 == 43 or LA16 == 44 or LA16 == 46 or LA16 == 47 or LA16 == 48 or LA16 == 49 or LA16 == 50 or LA16 == 52 or LA16 == 55:
- alt16 = 2
- elif LA16 == 47 or LA16 == 48 or LA16 == 49 or LA16 == 50:
- alt16 = 1
- elif LA16 == 32 or LA16 == 33 or LA16 == 34 or LA16 == 35 or LA16 == 36 or LA16 == 37 or LA16 == 38 or LA16 == 39 or LA16 == 40 or LA16 == 43 or LA16 == 44 or LA16 == 46:
- alt16 = 2
+ elif LA17 == 47 or LA17 == 48 or LA17 == 49 or LA17 == 50:
+ alt17 = 1
+ elif LA17 == 32 or LA17 == 33 or LA17 == 34 or LA17 == 35 or LA17 == 36 or LA17 == 37 or LA17 == 38 or LA17 == 39 or LA17 == 40 or LA17 == 43 or LA17 == 44 or LA17 == 46:
+ alt17 = 2
- if alt16 == 1:
- # C.g:157:6: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_specifier_qualifier_list550)
+ if alt17 == 1:
+ # C.g:164:6: type_qualifier
+ self.following.append(self.FOLLOW_type_qualifier_in_specifier_qualifier_list541)
self.type_qualifier()
self.following.pop()
if self.failed:
return
- elif alt16 == 2:
- # C.g:157:23: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_specifier_qualifier_list554)
+ elif alt17 == 2:
+ # C.g:164:23: type_specifier
+ self.following.append(self.FOLLOW_type_specifier_in_specifier_qualifier_list545)
self.type_specifier()
self.following.pop()
if self.failed:
else:
- if cnt16 >= 1:
- break #loop16
+ if cnt17 >= 1:
+ break #loop17
if self.backtracking > 0:
self.failed = True
return
- eee = EarlyExitException(16, self.input)
+ eee = EarlyExitException(17, self.input)
raise eee
- cnt16 += 1
+ cnt17 += 1
# $ANTLR start struct_declarator_list
- # C.g:160:1: struct_declarator_list : struct_declarator ( ',' struct_declarator )* ;
+ # C.g:167:1: struct_declarator_list : struct_declarator ( ',' struct_declarator )* ;
def struct_declarator_list(self, ):
struct_declarator_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 16):
return
- # C.g:161:2: ( struct_declarator ( ',' struct_declarator )* )
- # C.g:161:4: struct_declarator ( ',' struct_declarator )*
- self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list568)
+ # C.g:168:2: ( struct_declarator ( ',' struct_declarator )* )
+ # C.g:168:4: struct_declarator ( ',' struct_declarator )*
+ self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list559)
self.struct_declarator()
self.following.pop()
if self.failed:
return
- # C.g:161:22: ( ',' struct_declarator )*
- while True: #loop17
- alt17 = 2
- LA17_0 = self.input.LA(1)
+ # C.g:168:22: ( ',' struct_declarator )*
+ while True: #loop18
+ alt18 = 2
+ LA18_0 = self.input.LA(1)
- if (LA17_0 == 26) :
- alt17 = 1
+ if (LA18_0 == 26) :
+ alt18 = 1
- if alt17 == 1:
- # C.g:161:23: ',' struct_declarator
- self.match(self.input, 26, self.FOLLOW_26_in_struct_declarator_list571)
+ if alt18 == 1:
+ # C.g:168:23: ',' struct_declarator
+ self.match(self.input, 26, self.FOLLOW_26_in_struct_declarator_list562)
if self.failed:
return
- self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list573)
+ self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list564)
self.struct_declarator()
self.following.pop()
if self.failed:
else:
- break #loop17
+ break #loop18
# $ANTLR start struct_declarator
- # C.g:164:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );
+ # C.g:171:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );
def struct_declarator(self, ):
struct_declarator_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 17):
return
- # C.g:165:2: ( declarator ( ':' constant_expression )? | ':' constant_expression )
- alt19 = 2
- LA19_0 = self.input.LA(1)
+ # C.g:172:2: ( declarator ( ':' constant_expression )? | ':' constant_expression )
+ alt20 = 2
+ LA20_0 = self.input.LA(1)
- if (LA19_0 == IDENTIFIER or LA19_0 == 51 or LA19_0 == 55) :
- alt19 = 1
- elif (LA19_0 == 45) :
- alt19 = 2
+ if (LA20_0 == IDENTIFIER or LA20_0 == 51 or LA20_0 == 55) :
+ alt20 = 1
+ elif (LA20_0 == 45) :
+ alt20 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("164:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );", 19, 0, self.input)
+ nvae = NoViableAltException("171:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );", 20, 0, self.input)
raise nvae
- if alt19 == 1:
- # C.g:165:4: declarator ( ':' constant_expression )?
- self.following.append(self.FOLLOW_declarator_in_struct_declarator586)
+ if alt20 == 1:
+ # C.g:172:4: declarator ( ':' constant_expression )?
+ self.following.append(self.FOLLOW_declarator_in_struct_declarator577)
self.declarator()
self.following.pop()
if self.failed:
return
- # C.g:165:15: ( ':' constant_expression )?
- alt18 = 2
- LA18_0 = self.input.LA(1)
+ # C.g:172:15: ( ':' constant_expression )?
+ alt19 = 2
+ LA19_0 = self.input.LA(1)
- if (LA18_0 == 45) :
- alt18 = 1
- if alt18 == 1:
- # C.g:165:16: ':' constant_expression
- self.match(self.input, 45, self.FOLLOW_45_in_struct_declarator589)
+ if (LA19_0 == 45) :
+ alt19 = 1
+ if alt19 == 1:
+ # C.g:172:16: ':' constant_expression
+ self.match(self.input, 45, self.FOLLOW_45_in_struct_declarator580)
if self.failed:
return
- self.following.append(self.FOLLOW_constant_expression_in_struct_declarator591)
+ self.following.append(self.FOLLOW_constant_expression_in_struct_declarator582)
self.constant_expression()
self.following.pop()
if self.failed:
- elif alt19 == 2:
- # C.g:166:4: ':' constant_expression
- self.match(self.input, 45, self.FOLLOW_45_in_struct_declarator598)
+ elif alt20 == 2:
+ # C.g:173:4: ':' constant_expression
+ self.match(self.input, 45, self.FOLLOW_45_in_struct_declarator589)
if self.failed:
return
- self.following.append(self.FOLLOW_constant_expression_in_struct_declarator600)
+ self.following.append(self.FOLLOW_constant_expression_in_struct_declarator591)
self.constant_expression()
self.following.pop()
if self.failed:
# $ANTLR end struct_declarator
+ class enum_specifier_return(object):
+ def __init__(self):
+ self.start = None
+ self.stop = None
+
+
# $ANTLR start enum_specifier
- # C.g:169:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );
+ # C.g:176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );
def enum_specifier(self, ):
+ retval = self.enum_specifier_return()
+ retval.start = self.input.LT(1)
enum_specifier_StartIndex = self.input.index()
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 18):
- return
+ return retval
- # C.g:171:2: ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER )
- alt20 = 3
- LA20_0 = self.input.LA(1)
+ # C.g:178:2: ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER )
+ alt21 = 3
+ LA21_0 = self.input.LA(1)
- if (LA20_0 == 46) :
- LA20_1 = self.input.LA(2)
+ if (LA21_0 == 46) :
+ LA21_1 = self.input.LA(2)
- if (LA20_1 == IDENTIFIER) :
- LA20_2 = self.input.LA(3)
+ if (LA21_1 == IDENTIFIER) :
+ LA21_2 = self.input.LA(3)
- if (LA20_2 == 41) :
- alt20 = 2
- elif (LA20_2 == EOF or LA20_2 == IDENTIFIER or LA20_2 == 25 or (28 <= LA20_2 <= 40) or (43 <= LA20_2 <= 53) or LA20_2 == 55) :
- alt20 = 3
+ if (LA21_2 == 41) :
+ alt21 = 2
+ elif (LA21_2 == EOF or LA21_2 == IDENTIFIER or LA21_2 == 24 or (28 <= LA21_2 <= 40) or (43 <= LA21_2 <= 53) or LA21_2 == 55) :
+ alt21 = 3
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("169:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 20, 2, self.input)
+ nvae = NoViableAltException("176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 21, 2, self.input)
raise nvae
- elif (LA20_1 == 41) :
- alt20 = 1
+ elif (LA21_1 == 41) :
+ alt21 = 1
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("169:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 20, 1, self.input)
+ nvae = NoViableAltException("176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 21, 1, self.input)
raise nvae
else:
if self.backtracking > 0:
self.failed = True
- return
+ return retval
- nvae = NoViableAltException("169:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 20, 0, self.input)
+ nvae = NoViableAltException("176:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list '}' | 'enum' IDENTIFIER '{' enumerator_list '}' | 'enum' IDENTIFIER );", 21, 0, self.input)
raise nvae
- if alt20 == 1:
- # C.g:171:4: 'enum' '{' enumerator_list '}'
- self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier618)
+ if alt21 == 1:
+ # C.g:178:4: 'enum' '{' enumerator_list '}'
+ self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier609)
if self.failed:
- return
- self.match(self.input, 41, self.FOLLOW_41_in_enum_specifier620)
+ return retval
+ self.match(self.input, 41, self.FOLLOW_41_in_enum_specifier611)
if self.failed:
- return
- self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier622)
+ return retval
+ self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier613)
self.enumerator_list()
self.following.pop()
if self.failed:
- return
- self.match(self.input, 42, self.FOLLOW_42_in_enum_specifier624)
+ return retval
+ self.match(self.input, 42, self.FOLLOW_42_in_enum_specifier615)
if self.failed:
- return
+ return retval
- elif alt20 == 2:
- # C.g:172:4: 'enum' IDENTIFIER '{' enumerator_list '}'
- self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier629)
+ elif alt21 == 2:
+ # C.g:179:4: 'enum' IDENTIFIER '{' enumerator_list '}'
+ self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier620)
if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier631)
+ return retval
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier622)
if self.failed:
- return
- self.match(self.input, 41, self.FOLLOW_41_in_enum_specifier633)
+ return retval
+ self.match(self.input, 41, self.FOLLOW_41_in_enum_specifier624)
if self.failed:
- return
- self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier635)
+ return retval
+ self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier626)
self.enumerator_list()
self.following.pop()
if self.failed:
- return
- self.match(self.input, 42, self.FOLLOW_42_in_enum_specifier637)
+ return retval
+ self.match(self.input, 42, self.FOLLOW_42_in_enum_specifier628)
if self.failed:
- return
+ return retval
- elif alt20 == 3:
- # C.g:173:4: 'enum' IDENTIFIER
- self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier642)
+ elif alt21 == 3:
+ # C.g:180:4: 'enum' IDENTIFIER
+ self.match(self.input, 46, self.FOLLOW_46_in_enum_specifier633)
if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier644)
+ return retval
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier635)
if self.failed:
- return
+ return retval
+ retval.stop = self.input.LT(-1)
+
except RecognitionException, re:
self.reportError(re)
pass
- return
+ return retval
# $ANTLR end enum_specifier
# $ANTLR start enumerator_list
- # C.g:176:1: enumerator_list : enumerator ( ',' enumerator )* ;
+ # C.g:183:1: enumerator_list : enumerator ( ',' enumerator )* ;
def enumerator_list(self, ):
enumerator_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 19):
return
- # C.g:177:2: ( enumerator ( ',' enumerator )* )
- # C.g:177:4: enumerator ( ',' enumerator )*
- self.following.append(self.FOLLOW_enumerator_in_enumerator_list655)
+ # C.g:184:2: ( enumerator ( ',' enumerator )* )
+ # C.g:184:4: enumerator ( ',' enumerator )*
+ self.following.append(self.FOLLOW_enumerator_in_enumerator_list646)
self.enumerator()
self.following.pop()
if self.failed:
return
- # C.g:177:15: ( ',' enumerator )*
- while True: #loop21
- alt21 = 2
- LA21_0 = self.input.LA(1)
+ # C.g:184:15: ( ',' enumerator )*
+ while True: #loop22
+ alt22 = 2
+ LA22_0 = self.input.LA(1)
- if (LA21_0 == 26) :
- alt21 = 1
+ if (LA22_0 == 26) :
+ alt22 = 1
- if alt21 == 1:
- # C.g:177:16: ',' enumerator
- self.match(self.input, 26, self.FOLLOW_26_in_enumerator_list658)
+ if alt22 == 1:
+ # C.g:184:16: ',' enumerator
+ self.match(self.input, 26, self.FOLLOW_26_in_enumerator_list649)
if self.failed:
return
- self.following.append(self.FOLLOW_enumerator_in_enumerator_list660)
+ self.following.append(self.FOLLOW_enumerator_in_enumerator_list651)
self.enumerator()
self.following.pop()
if self.failed:
else:
- break #loop21
+ break #loop22
# $ANTLR start enumerator
- # C.g:180:1: enumerator : IDENTIFIER ( '=' constant_expression )? ;
+ # C.g:187:1: enumerator : IDENTIFIER ( '=' constant_expression )? ;
def enumerator(self, ):
enumerator_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 20):
return
- # C.g:181:2: ( IDENTIFIER ( '=' constant_expression )? )
- # C.g:181:4: IDENTIFIER ( '=' constant_expression )?
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enumerator673)
+ # C.g:188:2: ( IDENTIFIER ( '=' constant_expression )? )
+ # C.g:188:4: IDENTIFIER ( '=' constant_expression )?
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enumerator664)
if self.failed:
return
- # C.g:181:15: ( '=' constant_expression )?
- alt22 = 2
- LA22_0 = self.input.LA(1)
+ # C.g:188:15: ( '=' constant_expression )?
+ alt23 = 2
+ LA23_0 = self.input.LA(1)
- if (LA22_0 == 27) :
- alt22 = 1
- if alt22 == 1:
- # C.g:181:16: '=' constant_expression
- self.match(self.input, 27, self.FOLLOW_27_in_enumerator676)
+ if (LA23_0 == 27) :
+ alt23 = 1
+ if alt23 == 1:
+ # C.g:188:16: '=' constant_expression
+ self.match(self.input, 27, self.FOLLOW_27_in_enumerator667)
if self.failed:
return
- self.following.append(self.FOLLOW_constant_expression_in_enumerator678)
+ self.following.append(self.FOLLOW_constant_expression_in_enumerator669)
self.constant_expression()
self.following.pop()
if self.failed:
# $ANTLR start type_qualifier
- # C.g:184:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' );
+ # C.g:191:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' );
def type_qualifier(self, ):
type_qualifier_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 21):
return
- # C.g:185:2: ( 'const' | 'volatile' | 'IN' | 'OUT' )
+ # C.g:192:2: ( 'const' | 'volatile' | 'IN' | 'OUT' )
# C.g:
if (47 <= self.input.LA(1) <= 50):
self.input.consume();
# $ANTLR start declarator
- # C.g:191:1: declarator : ( ( pointer )? direct_declarator | pointer );
+ # C.g:198:1: declarator : ( ( pointer )? direct_declarator | pointer );
def declarator(self, ):
retval = self.declarator_return()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 22):
return retval
- # C.g:192:2: ( ( pointer )? direct_declarator | pointer )
- alt24 = 2
- LA24_0 = self.input.LA(1)
+ # C.g:199:2: ( ( pointer )? direct_declarator | pointer )
+ alt25 = 2
+ LA25_0 = self.input.LA(1)
- if (LA24_0 == 55) :
- LA24_1 = self.input.LA(2)
+ if (LA25_0 == 55) :
+ LA25_1 = self.input.LA(2)
- if (self.synpred49()) :
- alt24 = 1
+ if (self.synpred50()) :
+ alt25 = 1
elif (True) :
- alt24 = 2
+ alt25 = 2
else:
if self.backtracking > 0:
self.failed = True
return retval
- nvae = NoViableAltException("191:1: declarator : ( ( pointer )? direct_declarator | pointer );", 24, 1, self.input)
+ nvae = NoViableAltException("198:1: declarator : ( ( pointer )? direct_declarator | pointer );", 25, 1, self.input)
raise nvae
- elif (LA24_0 == IDENTIFIER or LA24_0 == 51) :
- alt24 = 1
+ elif (LA25_0 == IDENTIFIER or LA25_0 == 51) :
+ alt25 = 1
else:
if self.backtracking > 0:
self.failed = True
return retval
- nvae = NoViableAltException("191:1: declarator : ( ( pointer )? direct_declarator | pointer );", 24, 0, self.input)
+ nvae = NoViableAltException("198:1: declarator : ( ( pointer )? direct_declarator | pointer );", 25, 0, self.input)
raise nvae
- if alt24 == 1:
- # C.g:192:4: ( pointer )? direct_declarator
- # C.g:192:4: ( pointer )?
- alt23 = 2
- LA23_0 = self.input.LA(1)
+ if alt25 == 1:
+ # C.g:199:4: ( pointer )? direct_declarator
+ # C.g:199:4: ( pointer )?
+ alt24 = 2
+ LA24_0 = self.input.LA(1)
- if (LA23_0 == 55) :
- alt23 = 1
- if alt23 == 1:
+ if (LA24_0 == 55) :
+ alt24 = 1
+ if alt24 == 1:
# C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_declarator717)
+ self.following.append(self.FOLLOW_pointer_in_declarator708)
self.pointer()
self.following.pop()
if self.failed:
- self.following.append(self.FOLLOW_direct_declarator_in_declarator720)
+ self.following.append(self.FOLLOW_direct_declarator_in_declarator711)
self.direct_declarator()
self.following.pop()
if self.failed:
return retval
- elif alt24 == 2:
- # C.g:193:4: pointer
- self.following.append(self.FOLLOW_pointer_in_declarator725)
+ elif alt25 == 2:
+ # C.g:200:4: pointer
+ self.following.append(self.FOLLOW_pointer_in_declarator716)
self.pointer()
self.following.pop()
if self.failed:
# $ANTLR start direct_declarator
- # C.g:196:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ );
+ # C.g:203:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ );
def direct_declarator(self, ):
- self.Symbols_stack.append(Symbols_scope())
direct_declarator_StartIndex = self.input.index()
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 23):
return
- # C.g:198:2: ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ )
- alt27 = 2
- LA27_0 = self.input.LA(1)
+ # C.g:204:2: ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ )
+ alt28 = 2
+ LA28_0 = self.input.LA(1)
- if (LA27_0 == IDENTIFIER) :
- alt27 = 1
- elif (LA27_0 == 51) :
- alt27 = 2
+ if (LA28_0 == IDENTIFIER) :
+ alt28 = 1
+ elif (LA28_0 == 51) :
+ alt28 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("196:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ );", 27, 0, self.input)
+ nvae = NoViableAltException("203:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' declarator ')' ( declarator_suffix )+ );", 28, 0, self.input)
raise nvae
- if alt27 == 1:
- # C.g:198:4: IDENTIFIER ( declarator_suffix )*
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_direct_declarator741)
+ if alt28 == 1:
+ # C.g:204:4: IDENTIFIER ( declarator_suffix )*
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_direct_declarator727)
if self.failed:
return
- # C.g:198:15: ( declarator_suffix )*
- while True: #loop25
- alt25 = 2
- LA25_0 = self.input.LA(1)
+ # C.g:204:15: ( declarator_suffix )*
+ while True: #loop26
+ alt26 = 2
+ LA26_0 = self.input.LA(1)
- if (LA25_0 == 51) :
- LA25 = self.input.LA(2)
- if LA25 == 52:
- LA25_26 = self.input.LA(3)
+ if (LA26_0 == 51) :
+ LA26 = self.input.LA(2)
+ if LA26 == 52:
+ LA26_26 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == IDENTIFIER:
- LA25_27 = self.input.LA(3)
+ elif LA26 == 28 or LA26 == 29 or LA26 == 30 or LA26 == 31:
+ LA26_30 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 28 or LA25 == 29 or LA25 == 30 or LA25 == 31:
- LA25_28 = self.input.LA(3)
+ elif LA26 == 32:
+ LA26_31 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 32:
- LA25_29 = self.input.LA(3)
+ elif LA26 == 33:
+ LA26_32 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 33:
- LA25_30 = self.input.LA(3)
+ elif LA26 == 34:
+ LA26_33 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 34:
- LA25_31 = self.input.LA(3)
+ elif LA26 == 35:
+ LA26_34 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 35:
- LA25_32 = self.input.LA(3)
+ elif LA26 == 36:
+ LA26_35 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 36:
- LA25_33 = self.input.LA(3)
+ elif LA26 == 37:
+ LA26_36 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 37:
- LA25_34 = self.input.LA(3)
+ elif LA26 == 38:
+ LA26_37 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 38:
- LA25_35 = self.input.LA(3)
+ elif LA26 == 39:
+ LA26_38 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 39:
- LA25_36 = self.input.LA(3)
+ elif LA26 == 40:
+ LA26_39 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 40:
- LA25_37 = self.input.LA(3)
+ elif LA26 == 43 or LA26 == 44:
+ LA26_40 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 43 or LA25 == 44:
- LA25_38 = self.input.LA(3)
+ elif LA26 == 46:
+ LA26_41 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 46:
- LA25_39 = self.input.LA(3)
+ elif LA26 == IDENTIFIER:
+ LA26_42 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 47 or LA25 == 48 or LA25 == 49 or LA25 == 50:
- LA25_40 = self.input.LA(3)
+ elif LA26 == 47 or LA26 == 48 or LA26 == 49 or LA26 == 50:
+ LA26_43 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif (LA25_0 == 53) :
- LA25 = self.input.LA(2)
- if LA25 == 54:
- LA25_44 = self.input.LA(3)
+ elif (LA26_0 == 53) :
+ LA26 = self.input.LA(2)
+ if LA26 == 54:
+ LA26_44 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 51:
- LA25_45 = self.input.LA(3)
+ elif LA26 == 51:
+ LA26_45 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == IDENTIFIER:
- LA25_46 = self.input.LA(3)
+ elif LA26 == IDENTIFIER:
+ LA26_46 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == HEX_LITERAL or LA25 == OCTAL_LITERAL or LA25 == DECIMAL_LITERAL or LA25 == CHARACTER_LITERAL or LA25 == STRING_LITERAL or LA25 == FLOATING_POINT_LITERAL:
- LA25_47 = self.input.LA(3)
+ elif LA26 == HEX_LITERAL or LA26 == OCTAL_LITERAL or LA26 == DECIMAL_LITERAL or LA26 == CHARACTER_LITERAL or LA26 == STRING_LITERAL or LA26 == FLOATING_POINT_LITERAL:
+ LA26_47 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 61:
- LA25_48 = self.input.LA(3)
+ elif LA26 == 61:
+ LA26_48 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 62:
- LA25_49 = self.input.LA(3)
+ elif LA26 == 62:
+ LA26_49 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 55 or LA25 == 57 or LA25 == 58 or LA25 == 66 or LA25 == 67 or LA25 == 68:
- LA25_50 = self.input.LA(3)
+ elif LA26 == 55 or LA26 == 57 or LA26 == 58 or LA26 == 66 or LA26 == 67 or LA26 == 68:
+ LA26_50 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- elif LA25 == 63:
- LA25_51 = self.input.LA(3)
+ elif LA26 == 63:
+ LA26_51 = self.input.LA(3)
- if (self.synpred50()) :
- alt25 = 1
+ if (self.synpred51()) :
+ alt26 = 1
- if alt25 == 1:
+ if alt26 == 1:
# C.g:0:0: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator743)
+ self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator729)
self.declarator_suffix()
self.following.pop()
if self.failed:
else:
- break #loop25
+ break #loop26
- elif alt27 == 2:
- # C.g:200:4: '(' declarator ')' ( declarator_suffix )+
- self.match(self.input, 51, self.FOLLOW_51_in_direct_declarator753)
+ elif alt28 == 2:
+ # C.g:205:4: '(' declarator ')' ( declarator_suffix )+
+ self.match(self.input, 51, self.FOLLOW_51_in_direct_declarator735)
if self.failed:
return
- self.following.append(self.FOLLOW_declarator_in_direct_declarator755)
+ self.following.append(self.FOLLOW_declarator_in_direct_declarator737)
self.declarator()
self.following.pop()
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_direct_declarator757)
+ self.match(self.input, 52, self.FOLLOW_52_in_direct_declarator739)
if self.failed:
- return
- # C.g:200:23: ( declarator_suffix )+
- cnt26 = 0
- while True: #loop26
- alt26 = 2
- LA26_0 = self.input.LA(1)
-
- if (LA26_0 == 51) :
- LA26 = self.input.LA(2)
- if LA26 == 52:
- LA26_26 = self.input.LA(3)
+ return
+ # C.g:205:23: ( declarator_suffix )+
+ cnt27 = 0
+ while True: #loop27
+ alt27 = 2
+ LA27_0 = self.input.LA(1)
- if (self.synpred52()) :
- alt26 = 1
+ if (LA27_0 == 51) :
+ LA27 = self.input.LA(2)
+ if LA27 == 52:
+ LA27_26 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 28 or LA26 == 29 or LA26 == 30 or LA26 == 31:
- LA26_27 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 28 or LA27 == 29 or LA27 == 30 or LA27 == 31:
+ LA27_30 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 32:
- LA26_28 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 32:
+ LA27_31 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 33:
- LA26_29 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 33:
+ LA27_32 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 34:
- LA26_30 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 34:
+ LA27_33 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 35:
- LA26_31 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 35:
+ LA27_34 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 36:
- LA26_32 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 36:
+ LA27_35 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 37:
- LA26_33 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 37:
+ LA27_36 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 38:
- LA26_34 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 38:
+ LA27_37 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 39:
- LA26_35 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 39:
+ LA27_38 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 40:
- LA26_36 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 40:
+ LA27_39 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 43 or LA26 == 44:
- LA26_37 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 43 or LA27 == 44:
+ LA27_40 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 46:
- LA26_38 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 46:
+ LA27_41 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == IDENTIFIER:
- LA26_39 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == IDENTIFIER:
+ LA27_42 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 47 or LA26 == 48 or LA26 == 49 or LA26 == 50:
- LA26_40 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 47 or LA27 == 48 or LA27 == 49 or LA27 == 50:
+ LA27_43 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif (LA26_0 == 53) :
- LA26 = self.input.LA(2)
- if LA26 == 54:
- LA26_44 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif (LA27_0 == 53) :
+ LA27 = self.input.LA(2)
+ if LA27 == 54:
+ LA27_44 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 51:
- LA26_45 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 51:
+ LA27_45 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == IDENTIFIER:
- LA26_46 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == IDENTIFIER:
+ LA27_46 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == HEX_LITERAL or LA26 == OCTAL_LITERAL or LA26 == DECIMAL_LITERAL or LA26 == CHARACTER_LITERAL or LA26 == STRING_LITERAL or LA26 == FLOATING_POINT_LITERAL:
- LA26_47 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == HEX_LITERAL or LA27 == OCTAL_LITERAL or LA27 == DECIMAL_LITERAL or LA27 == CHARACTER_LITERAL or LA27 == STRING_LITERAL or LA27 == FLOATING_POINT_LITERAL:
+ LA27_47 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 61:
- LA26_48 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 61:
+ LA27_48 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 62:
- LA26_49 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 62:
+ LA27_49 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 55 or LA26 == 57 or LA26 == 58 or LA26 == 66 or LA26 == 67 or LA26 == 68:
- LA26_50 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 55 or LA27 == 57 or LA27 == 58 or LA27 == 66 or LA27 == 67 or LA27 == 68:
+ LA27_50 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- elif LA26 == 63:
- LA26_51 = self.input.LA(3)
- if (self.synpred52()) :
- alt26 = 1
+ elif LA27 == 63:
+ LA27_51 = self.input.LA(3)
+ if (self.synpred53()) :
+ alt27 = 1
- if alt26 == 1:
+
+ if alt27 == 1:
# C.g:0:0: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator759)
+ self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator741)
self.declarator_suffix()
self.following.pop()
if self.failed:
else:
- if cnt26 >= 1:
- break #loop26
+ if cnt27 >= 1:
+ break #loop27
if self.backtracking > 0:
self.failed = True
return
- eee = EarlyExitException(26, self.input)
+ eee = EarlyExitException(27, self.input)
raise eee
- cnt26 += 1
+ cnt27 += 1
if self.backtracking > 0:
self.memoize(self.input, 23, direct_declarator_StartIndex)
- self.Symbols_stack.pop()
-
pass
return
# $ANTLR start declarator_suffix
- # C.g:203:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );
+ # C.g:208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );
def declarator_suffix(self, ):
declarator_suffix_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 24):
return
- # C.g:204:2: ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' )
- alt28 = 5
- LA28_0 = self.input.LA(1)
+ # C.g:209:2: ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' )
+ alt29 = 5
+ LA29_0 = self.input.LA(1)
- if (LA28_0 == 53) :
- LA28_1 = self.input.LA(2)
+ if (LA29_0 == 53) :
+ LA29_1 = self.input.LA(2)
- if (LA28_1 == 54) :
- alt28 = 2
- elif ((IDENTIFIER <= LA28_1 <= FLOATING_POINT_LITERAL) or LA28_1 == 51 or LA28_1 == 55 or (57 <= LA28_1 <= 58) or (61 <= LA28_1 <= 63) or (66 <= LA28_1 <= 68)) :
- alt28 = 1
+ if (LA29_1 == 54) :
+ alt29 = 2
+ elif ((IDENTIFIER <= LA29_1 <= FLOATING_POINT_LITERAL) or LA29_1 == 51 or LA29_1 == 55 or (57 <= LA29_1 <= 58) or (61 <= LA29_1 <= 63) or (66 <= LA29_1 <= 68)) :
+ alt29 = 1
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("203:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 28, 1, self.input)
+ nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 1, self.input)
raise nvae
- elif (LA28_0 == 51) :
- LA28 = self.input.LA(2)
- if LA28 == 52:
- alt28 = 5
- elif LA28 == 28 or LA28 == 29 or LA28 == 30 or LA28 == 31 or LA28 == 32 or LA28 == 33 or LA28 == 34 or LA28 == 35 or LA28 == 36 or LA28 == 37 or LA28 == 38 or LA28 == 39 or LA28 == 40 or LA28 == 43 or LA28 == 44 or LA28 == 46 or LA28 == 47 or LA28 == 48 or LA28 == 49 or LA28 == 50:
- alt28 = 3
- elif LA28 == IDENTIFIER:
- LA28_24 = self.input.LA(3)
-
- if (self.synpred55()) :
- alt28 = 3
- elif (self.synpred56()) :
- alt28 = 4
+ elif (LA29_0 == 51) :
+ LA29 = self.input.LA(2)
+ if LA29 == 52:
+ alt29 = 5
+ elif LA29 == IDENTIFIER:
+ LA29_12 = self.input.LA(3)
+
+ if (self.synpred56()) :
+ alt29 = 3
+ elif (self.synpred57()) :
+ alt29 = 4
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("203:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 28, 24, self.input)
+ nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 12, self.input)
raise nvae
+ elif LA29 == 28 or LA29 == 29 or LA29 == 30 or LA29 == 31 or LA29 == 32 or LA29 == 33 or LA29 == 34 or LA29 == 35 or LA29 == 36 or LA29 == 37 or LA29 == 38 or LA29 == 39 or LA29 == 40 or LA29 == 43 or LA29 == 44 or LA29 == 46 or LA29 == 47 or LA29 == 48 or LA29 == 49 or LA29 == 50:
+ alt29 = 3
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("203:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 28, 2, self.input)
+ nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 2, self.input)
raise nvae
self.failed = True
return
- nvae = NoViableAltException("203:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 28, 0, self.input)
+ nvae = NoViableAltException("208:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 29, 0, self.input)
raise nvae
- if alt28 == 1:
- # C.g:204:6: '[' constant_expression ']'
- self.match(self.input, 53, self.FOLLOW_53_in_declarator_suffix773)
+ if alt29 == 1:
+ # C.g:209:6: '[' constant_expression ']'
+ self.match(self.input, 53, self.FOLLOW_53_in_declarator_suffix755)
if self.failed:
return
- self.following.append(self.FOLLOW_constant_expression_in_declarator_suffix775)
+ self.following.append(self.FOLLOW_constant_expression_in_declarator_suffix757)
self.constant_expression()
self.following.pop()
if self.failed:
return
- self.match(self.input, 54, self.FOLLOW_54_in_declarator_suffix777)
+ self.match(self.input, 54, self.FOLLOW_54_in_declarator_suffix759)
if self.failed:
return
- elif alt28 == 2:
- # C.g:205:9: '[' ']'
- self.match(self.input, 53, self.FOLLOW_53_in_declarator_suffix787)
+ elif alt29 == 2:
+ # C.g:210:9: '[' ']'
+ self.match(self.input, 53, self.FOLLOW_53_in_declarator_suffix769)
if self.failed:
return
- self.match(self.input, 54, self.FOLLOW_54_in_declarator_suffix789)
+ self.match(self.input, 54, self.FOLLOW_54_in_declarator_suffix771)
if self.failed:
return
- elif alt28 == 3:
- # C.g:206:9: '(' parameter_type_list ')'
- self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix799)
+ elif alt29 == 3:
+ # C.g:211:9: '(' parameter_type_list ')'
+ self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix781)
if self.failed:
return
- self.following.append(self.FOLLOW_parameter_type_list_in_declarator_suffix801)
+ self.following.append(self.FOLLOW_parameter_type_list_in_declarator_suffix783)
self.parameter_type_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix803)
+ self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix785)
if self.failed:
return
- elif alt28 == 4:
- # C.g:207:9: '(' identifier_list ')'
- self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix813)
+ elif alt29 == 4:
+ # C.g:212:9: '(' identifier_list ')'
+ self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix795)
if self.failed:
return
- self.following.append(self.FOLLOW_identifier_list_in_declarator_suffix815)
+ self.following.append(self.FOLLOW_identifier_list_in_declarator_suffix797)
self.identifier_list()
self.following.pop()
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix817)
+ self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix799)
if self.failed:
return
- elif alt28 == 5:
- # C.g:208:9: '(' ')'
- self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix827)
+ elif alt29 == 5:
+ # C.g:213:9: '(' ')'
+ self.match(self.input, 51, self.FOLLOW_51_in_declarator_suffix809)
if self.failed:
return
- self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix829)
+ self.match(self.input, 52, self.FOLLOW_52_in_declarator_suffix811)
if self.failed:
return
# $ANTLR start pointer
- # C.g:211:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );
+ # C.g:216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );
def pointer(self, ):
pointer_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 25):
return
- # C.g:212:2: ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' )
- alt31 = 3
- LA31_0 = self.input.LA(1)
+ # C.g:217:2: ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' )
+ alt32 = 3
+ LA32_0 = self.input.LA(1)
- if (LA31_0 == 55) :
- LA31 = self.input.LA(2)
- if LA31 == 55:
- LA31_2 = self.input.LA(3)
+ if (LA32_0 == 55) :
+ LA32 = self.input.LA(2)
+ if LA32 == 55:
+ LA32_2 = self.input.LA(3)
- if (self.synpred60()) :
- alt31 = 2
+ if (self.synpred61()) :
+ alt32 = 2
elif (True) :
- alt31 = 3
+ alt32 = 3
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("211:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 31, 2, self.input)
+ nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 2, self.input)
raise nvae
- elif LA31 == EOF or LA31 == IDENTIFIER or LA31 == 24 or LA31 == 25 or LA31 == 26 or LA31 == 27 or LA31 == 28 or LA31 == 29 or LA31 == 30 or LA31 == 31 or LA31 == 32 or LA31 == 33 or LA31 == 34 or LA31 == 35 or LA31 == 36 or LA31 == 37 or LA31 == 38 or LA31 == 39 or LA31 == 40 or LA31 == 41 or LA31 == 43 or LA31 == 44 or LA31 == 45 or LA31 == 46 or LA31 == 51 or LA31 == 52 or LA31 == 53:
- alt31 = 3
- elif LA31 == 47 or LA31 == 48 or LA31 == 49 or LA31 == 50:
- LA31_18 = self.input.LA(3)
+ elif LA32 == EOF or LA32 == IDENTIFIER or LA32 == 24 or LA32 == 25 or LA32 == 26 or LA32 == 27 or LA32 == 28 or LA32 == 29 or LA32 == 30 or LA32 == 31 or LA32 == 32 or LA32 == 33 or LA32 == 34 or LA32 == 35 or LA32 == 36 or LA32 == 37 or LA32 == 38 or LA32 == 39 or LA32 == 40 or LA32 == 41 or LA32 == 43 or LA32 == 44 or LA32 == 45 or LA32 == 46 or LA32 == 51 or LA32 == 52 or LA32 == 53:
+ alt32 = 3
+ elif LA32 == 47 or LA32 == 48 or LA32 == 49 or LA32 == 50:
+ LA32_18 = self.input.LA(3)
- if (self.synpred59()) :
- alt31 = 1
+ if (self.synpred60()) :
+ alt32 = 1
elif (True) :
- alt31 = 3
+ alt32 = 3
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("211:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 31, 18, self.input)
+ nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 18, self.input)
raise nvae
self.failed = True
return
- nvae = NoViableAltException("211:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 31, 1, self.input)
+ nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 1, self.input)
raise nvae
self.failed = True
return
- nvae = NoViableAltException("211:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 31, 0, self.input)
+ nvae = NoViableAltException("216:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | s= '*' );", 32, 0, self.input)
raise nvae
- if alt31 == 1:
- # C.g:212:4: '*' ( type_qualifier )+ ( pointer )?
- self.match(self.input, 55, self.FOLLOW_55_in_pointer840)
+ if alt32 == 1:
+ # C.g:217:4: '*' ( type_qualifier )+ ( pointer )?
+ self.match(self.input, 55, self.FOLLOW_55_in_pointer822)
if self.failed:
return
- # C.g:212:8: ( type_qualifier )+
- cnt29 = 0
- while True: #loop29
- alt29 = 2
- LA29_0 = self.input.LA(1)
+ # C.g:217:8: ( type_qualifier )+
+ cnt30 = 0
+ while True: #loop30
+ alt30 = 2
+ LA30_0 = self.input.LA(1)
- if ((47 <= LA29_0 <= 50)) :
- LA29_17 = self.input.LA(2)
+ if ((47 <= LA30_0 <= 50)) :
+ LA30_17 = self.input.LA(2)
- if (self.synpred57()) :
- alt29 = 1
+ if (self.synpred58()) :
+ alt30 = 1
- if alt29 == 1:
+ if alt30 == 1:
# C.g:0:0: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_pointer842)
+ self.following.append(self.FOLLOW_type_qualifier_in_pointer824)
self.type_qualifier()
self.following.pop()
if self.failed:
else:
- if cnt29 >= 1:
- break #loop29
+ if cnt30 >= 1:
+ break #loop30
if self.backtracking > 0:
self.failed = True
return
- eee = EarlyExitException(29, self.input)
+ eee = EarlyExitException(30, self.input)
raise eee
- cnt29 += 1
+ cnt30 += 1
- # C.g:212:24: ( pointer )?
- alt30 = 2
- LA30_0 = self.input.LA(1)
+ # C.g:217:24: ( pointer )?
+ alt31 = 2
+ LA31_0 = self.input.LA(1)
- if (LA30_0 == 55) :
- LA30_1 = self.input.LA(2)
+ if (LA31_0 == 55) :
+ LA31_1 = self.input.LA(2)
- if (self.synpred58()) :
- alt30 = 1
- if alt30 == 1:
+ if (self.synpred59()) :
+ alt31 = 1
+ if alt31 == 1:
# C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_pointer845)
+ self.following.append(self.FOLLOW_pointer_in_pointer827)
self.pointer()
self.following.pop()
if self.failed:
- elif alt31 == 2:
- # C.g:213:4: '*' pointer
- self.match(self.input, 55, self.FOLLOW_55_in_pointer851)
+ elif alt32 == 2:
+ # C.g:218:4: '*' pointer
+ self.match(self.input, 55, self.FOLLOW_55_in_pointer833)
if self.failed:
return
- self.following.append(self.FOLLOW_pointer_in_pointer853)
+ self.following.append(self.FOLLOW_pointer_in_pointer835)
self.pointer()
self.following.pop()
if self.failed:
return
- elif alt31 == 3:
- # C.g:214:4: s= '*'
+ elif alt32 == 3:
+ # C.g:219:4: s= '*'
s = self.input.LT(1)
- self.match(self.input, 55, self.FOLLOW_55_in_pointer860)
+ self.match(self.input, 55, self.FOLLOW_55_in_pointer842)
if self.failed:
return
# $ANTLR start parameter_type_list
- # C.g:217:1: parameter_type_list : parameter_list ( ',' '...' )? ;
+ # C.g:222:1: parameter_type_list : parameter_list ( ',' '...' )? ;
def parameter_type_list(self, ):
parameter_type_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 26):
return
- # C.g:218:2: ( parameter_list ( ',' '...' )? )
- # C.g:218:4: parameter_list ( ',' '...' )?
- self.following.append(self.FOLLOW_parameter_list_in_parameter_type_list871)
+ # C.g:223:2: ( parameter_list ( ',' '...' )? )
+ # C.g:223:4: parameter_list ( ',' '...' )?
+ self.following.append(self.FOLLOW_parameter_list_in_parameter_type_list853)
self.parameter_list()
self.following.pop()
if self.failed:
return
- # C.g:218:19: ( ',' '...' )?
- alt32 = 2
- LA32_0 = self.input.LA(1)
+ # C.g:223:19: ( ',' '...' )?
+ alt33 = 2
+ LA33_0 = self.input.LA(1)
- if (LA32_0 == 26) :
- alt32 = 1
- if alt32 == 1:
- # C.g:218:20: ',' '...'
- self.match(self.input, 26, self.FOLLOW_26_in_parameter_type_list874)
+ if (LA33_0 == 26) :
+ alt33 = 1
+ if alt33 == 1:
+ # C.g:223:20: ',' '...'
+ self.match(self.input, 26, self.FOLLOW_26_in_parameter_type_list856)
if self.failed:
return
- self.match(self.input, 56, self.FOLLOW_56_in_parameter_type_list876)
+ self.match(self.input, 56, self.FOLLOW_56_in_parameter_type_list858)
if self.failed:
return
# $ANTLR start parameter_list
- # C.g:221:1: parameter_list : parameter_declaration ( ',' parameter_declaration )* ;
+ # C.g:226:1: parameter_list : parameter_declaration ( ',' parameter_declaration )* ;
def parameter_list(self, ):
parameter_list_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 27):
return
- # C.g:222:2: ( parameter_declaration ( ',' parameter_declaration )* )
- # C.g:222:4: parameter_declaration ( ',' parameter_declaration )*
- self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list889)
+ # C.g:227:2: ( parameter_declaration ( ',' parameter_declaration )* )
+ # C.g:227:4: parameter_declaration ( ',' parameter_declaration )*
+ self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list871)
self.parameter_declaration()
self.following.pop()
if self.failed:
return
- # C.g:222:26: ( ',' parameter_declaration )*
- while True: #loop33
- alt33 = 2
- LA33_0 = self.input.LA(1)
+ # C.g:227:26: ( ',' parameter_declaration )*
+ while True: #loop34
+ alt34 = 2
+ LA34_0 = self.input.LA(1)
- if (LA33_0 == 26) :
- LA33_1 = self.input.LA(2)
+ if (LA34_0 == 26) :
+ LA34_1 = self.input.LA(2)
- if (LA33_1 == IDENTIFIER or (28 <= LA33_1 <= 40) or (43 <= LA33_1 <= 44) or (46 <= LA33_1 <= 50)) :
- alt33 = 1
+ if (LA34_1 == IDENTIFIER or (28 <= LA34_1 <= 40) or (43 <= LA34_1 <= 44) or (46 <= LA34_1 <= 50)) :
+ alt34 = 1
- if alt33 == 1:
- # C.g:222:27: ',' parameter_declaration
- self.match(self.input, 26, self.FOLLOW_26_in_parameter_list892)
+ if alt34 == 1:
+ # C.g:227:27: ',' parameter_declaration
+ self.match(self.input, 26, self.FOLLOW_26_in_parameter_list874)
if self.failed:
return
- self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list894)
+ self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list876)
self.parameter_declaration()
self.following.pop()
if self.failed:
else:
- break #loop33
+ break #loop34
# $ANTLR start parameter_declaration
- # C.g:225:1: parameter_declaration : declaration_specifiers ( declarator | abstract_declarator )+ ;
+ # C.g:230:1: parameter_declaration : declaration_specifiers ( declarator | abstract_declarator )+ ;
def parameter_declaration(self, ):
parameter_declaration_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 28):
return
- # C.g:226:2: ( declaration_specifiers ( declarator | abstract_declarator )+ )
- # C.g:226:4: declaration_specifiers ( declarator | abstract_declarator )+
- self.following.append(self.FOLLOW_declaration_specifiers_in_parameter_declaration907)
+ # C.g:231:2: ( declaration_specifiers ( declarator | abstract_declarator )+ )
+ # C.g:231:4: declaration_specifiers ( declarator | abstract_declarator )+
+ self.following.append(self.FOLLOW_declaration_specifiers_in_parameter_declaration889)
self.declaration_specifiers()
self.following.pop()
if self.failed:
return
- # C.g:226:27: ( declarator | abstract_declarator )+
- cnt34 = 0
- while True: #loop34
- alt34 = 3
- LA34 = self.input.LA(1)
- if LA34 == 55:
- LA34_4 = self.input.LA(2)
+ # C.g:231:27: ( declarator | abstract_declarator )+
+ cnt35 = 0
+ while True: #loop35
+ alt35 = 3
+ LA35 = self.input.LA(1)
+ if LA35 == 55:
+ LA35_4 = self.input.LA(2)
- if (self.synpred63()) :
- alt34 = 1
- elif (self.synpred64()) :
- alt34 = 2
+ if (self.synpred64()) :
+ alt35 = 1
+ elif (self.synpred65()) :
+ alt35 = 2
- elif LA34 == IDENTIFIER:
- alt34 = 1
- elif LA34 == 51:
- LA34 = self.input.LA(2)
- if LA34 == 28 or LA34 == 29 or LA34 == 30 or LA34 == 31 or LA34 == 32 or LA34 == 33 or LA34 == 34 or LA34 == 35 or LA34 == 36 or LA34 == 37 or LA34 == 38 or LA34 == 39 or LA34 == 40 or LA34 == 43 or LA34 == 44 or LA34 == 46 or LA34 == 47 or LA34 == 48 or LA34 == 49 or LA34 == 50 or LA34 == 52 or LA34 == 53:
- alt34 = 2
- elif LA34 == IDENTIFIER:
- LA34_29 = self.input.LA(3)
+ elif LA35 == IDENTIFIER:
+ alt35 = 1
+ elif LA35 == 51:
+ LA35 = self.input.LA(2)
+ if LA35 == 28 or LA35 == 29 or LA35 == 30 or LA35 == 31 or LA35 == 32 or LA35 == 33 or LA35 == 34 or LA35 == 35 or LA35 == 36 or LA35 == 37 or LA35 == 38 or LA35 == 39 or LA35 == 40 or LA35 == 43 or LA35 == 44 or LA35 == 46 or LA35 == 47 or LA35 == 48 or LA35 == 49 or LA35 == 50 or LA35 == 52 or LA35 == 53:
+ alt35 = 2
+ elif LA35 == 55:
+ LA35_17 = self.input.LA(3)
- if (self.synpred63()) :
- alt34 = 1
- elif (self.synpred64()) :
- alt34 = 2
+ if (self.synpred64()) :
+ alt35 = 1
+ elif (self.synpred65()) :
+ alt35 = 2
- elif LA34 == 55:
- LA34_31 = self.input.LA(3)
+ elif LA35 == 51:
+ LA35_18 = self.input.LA(3)
- if (self.synpred63()) :
- alt34 = 1
- elif (self.synpred64()) :
- alt34 = 2
+ if (self.synpred64()) :
+ alt35 = 1
+ elif (self.synpred65()) :
+ alt35 = 2
- elif LA34 == 51:
- LA34_32 = self.input.LA(3)
+ elif LA35 == IDENTIFIER:
+ LA35_32 = self.input.LA(3)
- if (self.synpred63()) :
- alt34 = 1
- elif (self.synpred64()) :
- alt34 = 2
+ if (self.synpred64()) :
+ alt35 = 1
+ elif (self.synpred65()) :
+ alt35 = 2
- elif LA34 == 53:
- alt34 = 2
+ elif LA35 == 53:
+ alt35 = 2
- if alt34 == 1:
- # C.g:226:28: declarator
- self.following.append(self.FOLLOW_declarator_in_parameter_declaration910)
+ if alt35 == 1:
+ # C.g:231:28: declarator
+ self.following.append(self.FOLLOW_declarator_in_parameter_declaration892)
self.declarator()
self.following.pop()
if self.failed:
return
- elif alt34 == 2:
- # C.g:226:39: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_parameter_declaration912)
+ elif alt35 == 2:
+ # C.g:231:39: abstract_declarator
+ self.following.append(self.FOLLOW_abstract_declarator_in_parameter_declaration894)
self.abstract_declarator()
self.following.pop()
if self.failed:
else:
- if cnt34 >= 1:
- break #loop34
+ if cnt35 >= 1:
+ break #loop35
if self.backtracking > 0:
self.failed = True
return
- eee = EarlyExitException(34, self.input)
+ eee = EarlyExitException(35, self.input)
raise eee
- cnt34 += 1
+ cnt35 += 1
# $ANTLR start identifier_list
- # C.g:229:1: identifier_list : i= IDENTIFIER ( ',' d= IDENTIFIER )* ;
+ # C.g:234:1: identifier_list : IDENTIFIER ( ',' IDENTIFIER )* ;
def identifier_list(self, ):
identifier_list_StartIndex = self.input.index()
- i = None
- d = None
-
try:
try:
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 29):
return
- # C.g:230:2: (i= IDENTIFIER ( ',' d= IDENTIFIER )* )
- # C.g:230:4: i= IDENTIFIER ( ',' d= IDENTIFIER )*
- i = self.input.LT(1)
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list927)
+ # C.g:235:2: ( IDENTIFIER ( ',' IDENTIFIER )* )
+ # C.g:235:4: IDENTIFIER ( ',' IDENTIFIER )*
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list907)
if self.failed:
return
- # C.g:231:2: ( ',' d= IDENTIFIER )*
- while True: #loop35
- alt35 = 2
- LA35_0 = self.input.LA(1)
+ # C.g:236:2: ( ',' IDENTIFIER )*
+ while True: #loop36
+ alt36 = 2
+ LA36_0 = self.input.LA(1)
- if (LA35_0 == 26) :
- alt35 = 1
+ if (LA36_0 == 26) :
+ alt36 = 1
- if alt35 == 1:
- # C.g:231:3: ',' d= IDENTIFIER
- self.match(self.input, 26, self.FOLLOW_26_in_identifier_list932)
+ if alt36 == 1:
+ # C.g:236:3: ',' IDENTIFIER
+ self.match(self.input, 26, self.FOLLOW_26_in_identifier_list911)
if self.failed:
return
- d = self.input.LT(1)
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list936)
+ self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list913)
if self.failed:
return
else:
- break #loop35
+ break #loop36
# $ANTLR start type_name
- # C.g:234:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );
+ # C.g:239:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );
def type_name(self, ):
type_name_StartIndex = self.input.index()
if self.backtracking > 0 and self.alreadyParsedRule(self.input, 30):
return
- # C.g:235:2: ( specifier_qualifier_list ( abstract_declarator )? | type_id )
- alt37 = 2
- LA37_0 = self.input.LA(1)
+ # C.g:240:2: ( specifier_qualifier_list ( abstract_declarator )? | type_id )
+ alt38 = 2
+ LA38_0 = self.input.LA(1)
- if ((32 <= LA37_0 <= 40) or (43 <= LA37_0 <= 44) or (46 <= LA37_0 <= 50)) :
- alt37 = 1
- elif (LA37_0 == IDENTIFIER) :
- LA37_13 = self.input.LA(2)
+ if ((32 <= LA38_0 <= 40) or (43 <= LA38_0 <= 44) or (46 <= LA38_0 <= 50)) :
+ alt38 = 1
+ elif (LA38_0 == IDENTIFIER) :
+ LA38_13 = self.input.LA(2)
- if (self.synpred67()) :
- alt37 = 1
+ if (self.synpred68()) :
+ alt38 = 1
elif (True) :
- alt37 = 2
+ alt38 = 2
else:
if self.backtracking > 0:
self.failed = True
return
- nvae = NoViableAltException("234:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 37, 13, self.input)
+ nvae = NoViableAltException("239:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 38, 13, self.input)
raise nvae
self.failed = True
return
- nvae = NoViableAltException("234:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 37, 0, self.input)
+ nvae = NoViableAltException("239:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 38, 0, self.input)
raise nvae
- if alt37 == 1:
- # C.g:235:4: specifier_qualifier_list ( abstract_declarator )?
- self.following.append(self.FOLLOW_specifier_qualifier_list_in_type_name951)
+ if alt38 == 1:
+ # C.g:240:4: specifier_qualifier_list ( abstract_declarator )?
+ self.following.append(self.FOLLOW_specifier_qualifier_list_in_type_name926)
self.specifier_qualifier_list()
self.following.pop()
if self.failed:
return
- # C.g:235:29: ( abstract_declarator )?
- alt36 = 2
- LA36_0 = self.input.LA(1)
+ # C.g:240:29: ( abstract_declarator )?
+ alt37 = 2
+ LA37_0 = self.input.LA(1)
- if (LA36_0 == 51 or LA36_0 == 53 or LA36_0 == 55) :
- alt36 = 1
- if alt36 == 1:
+ if (LA37_0 == 51 or LA37_0 == 53 or LA37_0 == 55) :
+