diff --git a/app/preproc/STDCTokenTypes.java b/app/preproc/STDCTokenTypes.java index 4ae50a859..112d6c4ce 100644 --- a/app/preproc/STDCTokenTypes.java +++ b/app/preproc/STDCTokenTypes.java @@ -1,149 +1,149 @@ -// $ANTLR 2.7.2: "StdCParser.g" -> "StdCLexer.java"$ +// $ANTLR 2.7.2: "StdCParser.g" -> "StdCLexer.java"$ package processing.app.preproc; import java.io.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -public interface STDCTokenTypes { - int EOF = 1; - int NULL_TREE_LOOKAHEAD = 3; - int LITERAL_typedef = 4; - int LITERAL_asm = 5; - int LITERAL_volatile = 6; - int LCURLY = 7; - int RCURLY = 8; - int SEMI = 9; - int LITERAL_struct = 10; - int LITERAL_union = 11; - int LITERAL_enum = 12; - int LITERAL_auto = 13; - int LITERAL_register = 14; - int LITERAL_extern = 15; - int LITERAL_static = 16; - int LITERAL_const = 17; - int LITERAL_void = 18; - int LITERAL_char = 19; - int LITERAL_short = 20; - int LITERAL_int = 21; - int LITERAL_long = 22; - int LITERAL_float = 23; - int LITERAL_double = 24; - int LITERAL_signed = 25; - int LITERAL_unsigned = 26; - int ID = 27; - int COMMA = 28; - int COLON = 29; - int ASSIGN = 30; - int STAR = 31; - int LPAREN = 32; - int RPAREN = 33; - int LBRACKET = 34; - int RBRACKET = 35; - int VARARGS = 36; - int LITERAL_while = 37; - int LITERAL_do = 38; - int LITERAL_for = 39; - int LITERAL_goto = 40; - int LITERAL_continue = 41; - int LITERAL_break = 42; - int LITERAL_return = 43; - int LITERAL_case = 44; - int LITERAL_default = 45; - int LITERAL_if = 46; - int LITERAL_else = 47; - int LITERAL_switch = 48; - int DIV_ASSIGN = 49; - int PLUS_ASSIGN = 50; - int MINUS_ASSIGN = 51; - int STAR_ASSIGN = 52; - int MOD_ASSIGN = 53; - int RSHIFT_ASSIGN = 54; - int LSHIFT_ASSIGN = 55; - int BAND_ASSIGN = 56; - int BOR_ASSIGN = 57; - int BXOR_ASSIGN = 58; - int QUESTION = 59; - int LOR = 60; - int LAND = 61; - int BOR = 62; - int BXOR = 63; - int BAND = 64; - int EQUAL = 65; - int NOT_EQUAL = 66; - int LT = 67; - int LTE = 68; - int GT = 69; - int GTE = 70; - int LSHIFT = 71; - int RSHIFT = 72; - int PLUS = 73; - int MINUS = 74; - int DIV = 75; - int MOD = 76; - int INC = 77; - int DEC = 78; - int LITERAL_sizeof = 79; - int BNOT = 80; - int LNOT = 81; - int PTR = 82; - int DOT = 83; - int CharLiteral = 84; - int StringLiteral = 85; - int IntOctalConst = 86; - int LongOctalConst = 87; - int UnsignedOctalConst = 88; - int IntIntConst = 89; - int LongIntConst = 90; - int UnsignedIntConst = 91; - int IntHexConst = 92; - int LongHexConst = 93; - int UnsignedHexConst = 94; - int FloatDoubleConst = 95; - int DoubleDoubleConst = 96; - int LongDoubleConst = 97; - int NTypedefName = 98; - int NInitDecl = 99; - int NDeclarator = 100; - int NStructDeclarator = 101; - int NDeclaration = 102; - int NCast = 103; - int NPointerGroup = 104; - int NExpressionGroup = 105; - int NFunctionCallArgs = 106; - int NNonemptyAbstractDeclarator = 107; - int NInitializer = 108; - int NStatementExpr = 109; - int NEmptyExpression = 110; - int NParameterTypeList = 111; - int NFunctionDef = 112; - int NCompoundStatement = 113; - int NParameterDeclaration = 114; - int NCommaExpr = 115; - int NUnaryExpr = 116; - int NLabel = 117; - int NPostfixExpr = 118; - int NRangeExpr = 119; - int NStringSeq = 120; - int NInitializerElementLabel = 121; - int NLcurlyInitializer = 122; - int NAsmAttribute = 123; - int NGnuAsmExpr = 124; - int NTypeMissing = 125; - int Vocabulary = 126; - int Whitespace = 127; - int Comment = 128; - int CPPComment = 129; - int PREPROC_DIRECTIVE = 130; - int Space = 131; - int LineDirective = 132; - int BadStringLiteral = 133; - int Escape = 134; - int Digit = 135; - int LongSuffix = 136; - int UnsignedSuffix = 137; - int FloatSuffix = 138; - int Exponent = 139; - int Number = 140; -} + +public interface STDCTokenTypes { + int EOF = 1; + int NULL_TREE_LOOKAHEAD = 3; + int LITERAL_typedef = 4; + int LITERAL_asm = 5; + int LITERAL_volatile = 6; + int LCURLY = 7; + int RCURLY = 8; + int SEMI = 9; + int LITERAL_struct = 10; + int LITERAL_union = 11; + int LITERAL_enum = 12; + int LITERAL_auto = 13; + int LITERAL_register = 14; + int LITERAL_extern = 15; + int LITERAL_static = 16; + int LITERAL_const = 17; + int LITERAL_void = 18; + int LITERAL_char = 19; + int LITERAL_short = 20; + int LITERAL_int = 21; + int LITERAL_long = 22; + int LITERAL_float = 23; + int LITERAL_double = 24; + int LITERAL_signed = 25; + int LITERAL_unsigned = 26; + int ID = 27; + int COMMA = 28; + int COLON = 29; + int ASSIGN = 30; + int STAR = 31; + int LPAREN = 32; + int RPAREN = 33; + int LBRACKET = 34; + int RBRACKET = 35; + int VARARGS = 36; + int LITERAL_while = 37; + int LITERAL_do = 38; + int LITERAL_for = 39; + int LITERAL_goto = 40; + int LITERAL_continue = 41; + int LITERAL_break = 42; + int LITERAL_return = 43; + int LITERAL_case = 44; + int LITERAL_default = 45; + int LITERAL_if = 46; + int LITERAL_else = 47; + int LITERAL_switch = 48; + int DIV_ASSIGN = 49; + int PLUS_ASSIGN = 50; + int MINUS_ASSIGN = 51; + int STAR_ASSIGN = 52; + int MOD_ASSIGN = 53; + int RSHIFT_ASSIGN = 54; + int LSHIFT_ASSIGN = 55; + int BAND_ASSIGN = 56; + int BOR_ASSIGN = 57; + int BXOR_ASSIGN = 58; + int QUESTION = 59; + int LOR = 60; + int LAND = 61; + int BOR = 62; + int BXOR = 63; + int BAND = 64; + int EQUAL = 65; + int NOT_EQUAL = 66; + int LT = 67; + int LTE = 68; + int GT = 69; + int GTE = 70; + int LSHIFT = 71; + int RSHIFT = 72; + int PLUS = 73; + int MINUS = 74; + int DIV = 75; + int MOD = 76; + int INC = 77; + int DEC = 78; + int LITERAL_sizeof = 79; + int BNOT = 80; + int LNOT = 81; + int PTR = 82; + int DOT = 83; + int CharLiteral = 84; + int StringLiteral = 85; + int IntOctalConst = 86; + int LongOctalConst = 87; + int UnsignedOctalConst = 88; + int IntIntConst = 89; + int LongIntConst = 90; + int UnsignedIntConst = 91; + int IntHexConst = 92; + int LongHexConst = 93; + int UnsignedHexConst = 94; + int FloatDoubleConst = 95; + int DoubleDoubleConst = 96; + int LongDoubleConst = 97; + int NTypedefName = 98; + int NInitDecl = 99; + int NDeclarator = 100; + int NStructDeclarator = 101; + int NDeclaration = 102; + int NCast = 103; + int NPointerGroup = 104; + int NExpressionGroup = 105; + int NFunctionCallArgs = 106; + int NNonemptyAbstractDeclarator = 107; + int NInitializer = 108; + int NStatementExpr = 109; + int NEmptyExpression = 110; + int NParameterTypeList = 111; + int NFunctionDef = 112; + int NCompoundStatement = 113; + int NParameterDeclaration = 114; + int NCommaExpr = 115; + int NUnaryExpr = 116; + int NLabel = 117; + int NPostfixExpr = 118; + int NRangeExpr = 119; + int NStringSeq = 120; + int NInitializerElementLabel = 121; + int NLcurlyInitializer = 122; + int NAsmAttribute = 123; + int NGnuAsmExpr = 124; + int NTypeMissing = 125; + int Vocabulary = 126; + int Whitespace = 127; + int Comment = 128; + int CPPComment = 129; + int PREPROC_DIRECTIVE = 130; + int Space = 131; + int LineDirective = 132; + int BadStringLiteral = 133; + int Escape = 134; + int Digit = 135; + int LongSuffix = 136; + int UnsignedSuffix = 137; + int FloatSuffix = 138; + int Exponent = 139; + int Number = 140; +} diff --git a/app/preproc/STDCTokenTypes.txt b/app/preproc/STDCTokenTypes.txt index facb47ad6..902834cd8 100644 --- a/app/preproc/STDCTokenTypes.txt +++ b/app/preproc/STDCTokenTypes.txt @@ -1,139 +1,139 @@ -// $ANTLR 2.7.2: StdCParser.g -> STDCTokenTypes.txt$ -STDC // output token vocab name -LITERAL_typedef="typedef"=4 -LITERAL_asm="asm"=5 -LITERAL_volatile="volatile"=6 -LCURLY=7 -RCURLY=8 -SEMI=9 -LITERAL_struct="struct"=10 -LITERAL_union="union"=11 -LITERAL_enum="enum"=12 -LITERAL_auto="auto"=13 -LITERAL_register="register"=14 -LITERAL_extern="extern"=15 -LITERAL_static="static"=16 -LITERAL_const="const"=17 -LITERAL_void="void"=18 -LITERAL_char="char"=19 -LITERAL_short="short"=20 -LITERAL_int="int"=21 -LITERAL_long="long"=22 -LITERAL_float="float"=23 -LITERAL_double="double"=24 -LITERAL_signed="signed"=25 -LITERAL_unsigned="unsigned"=26 -ID=27 -COMMA=28 -COLON=29 -ASSIGN=30 -STAR=31 -LPAREN=32 -RPAREN=33 -LBRACKET=34 -RBRACKET=35 -VARARGS=36 -LITERAL_while="while"=37 -LITERAL_do="do"=38 -LITERAL_for="for"=39 -LITERAL_goto="goto"=40 -LITERAL_continue="continue"=41 -LITERAL_break="break"=42 -LITERAL_return="return"=43 -LITERAL_case="case"=44 -LITERAL_default="default"=45 -LITERAL_if="if"=46 -LITERAL_else="else"=47 -LITERAL_switch="switch"=48 -DIV_ASSIGN=49 -PLUS_ASSIGN=50 -MINUS_ASSIGN=51 -STAR_ASSIGN=52 -MOD_ASSIGN=53 -RSHIFT_ASSIGN=54 -LSHIFT_ASSIGN=55 -BAND_ASSIGN=56 -BOR_ASSIGN=57 -BXOR_ASSIGN=58 -QUESTION=59 -LOR=60 -LAND=61 -BOR=62 -BXOR=63 -BAND=64 -EQUAL=65 -NOT_EQUAL=66 -LT=67 -LTE=68 -GT=69 -GTE=70 -LSHIFT=71 -RSHIFT=72 -PLUS=73 -MINUS=74 -DIV=75 -MOD=76 -INC=77 -DEC=78 -LITERAL_sizeof="sizeof"=79 -BNOT=80 -LNOT=81 -PTR=82 -DOT=83 -CharLiteral=84 -StringLiteral=85 -IntOctalConst=86 -LongOctalConst=87 -UnsignedOctalConst=88 -IntIntConst=89 -LongIntConst=90 -UnsignedIntConst=91 -IntHexConst=92 -LongHexConst=93 -UnsignedHexConst=94 -FloatDoubleConst=95 -DoubleDoubleConst=96 -LongDoubleConst=97 -NTypedefName=98 -NInitDecl=99 -NDeclarator=100 -NStructDeclarator=101 -NDeclaration=102 -NCast=103 -NPointerGroup=104 -NExpressionGroup=105 -NFunctionCallArgs=106 -NNonemptyAbstractDeclarator=107 -NInitializer=108 -NStatementExpr=109 -NEmptyExpression=110 -NParameterTypeList=111 -NFunctionDef=112 -NCompoundStatement=113 -NParameterDeclaration=114 -NCommaExpr=115 -NUnaryExpr=116 -NLabel=117 -NPostfixExpr=118 -NRangeExpr=119 -NStringSeq=120 -NInitializerElementLabel=121 -NLcurlyInitializer=122 -NAsmAttribute=123 -NGnuAsmExpr=124 -NTypeMissing=125 -Vocabulary=126 -Whitespace=127 -Comment=128 -CPPComment=129 -PREPROC_DIRECTIVE("a line directive")=130 -Space=131 -LineDirective=132 -BadStringLiteral=133 -Escape=134 -Digit=135 -LongSuffix=136 -UnsignedSuffix=137 -FloatSuffix=138 -Exponent=139 -Number=140 +// $ANTLR 2.7.2: StdCParser.g -> STDCTokenTypes.txt$ +STDC // output token vocab name +LITERAL_typedef="typedef"=4 +LITERAL_asm="asm"=5 +LITERAL_volatile="volatile"=6 +LCURLY=7 +RCURLY=8 +SEMI=9 +LITERAL_struct="struct"=10 +LITERAL_union="union"=11 +LITERAL_enum="enum"=12 +LITERAL_auto="auto"=13 +LITERAL_register="register"=14 +LITERAL_extern="extern"=15 +LITERAL_static="static"=16 +LITERAL_const="const"=17 +LITERAL_void="void"=18 +LITERAL_char="char"=19 +LITERAL_short="short"=20 +LITERAL_int="int"=21 +LITERAL_long="long"=22 +LITERAL_float="float"=23 +LITERAL_double="double"=24 +LITERAL_signed="signed"=25 +LITERAL_unsigned="unsigned"=26 +ID=27 +COMMA=28 +COLON=29 +ASSIGN=30 +STAR=31 +LPAREN=32 +RPAREN=33 +LBRACKET=34 +RBRACKET=35 +VARARGS=36 +LITERAL_while="while"=37 +LITERAL_do="do"=38 +LITERAL_for="for"=39 +LITERAL_goto="goto"=40 +LITERAL_continue="continue"=41 +LITERAL_break="break"=42 +LITERAL_return="return"=43 +LITERAL_case="case"=44 +LITERAL_default="default"=45 +LITERAL_if="if"=46 +LITERAL_else="else"=47 +LITERAL_switch="switch"=48 +DIV_ASSIGN=49 +PLUS_ASSIGN=50 +MINUS_ASSIGN=51 +STAR_ASSIGN=52 +MOD_ASSIGN=53 +RSHIFT_ASSIGN=54 +LSHIFT_ASSIGN=55 +BAND_ASSIGN=56 +BOR_ASSIGN=57 +BXOR_ASSIGN=58 +QUESTION=59 +LOR=60 +LAND=61 +BOR=62 +BXOR=63 +BAND=64 +EQUAL=65 +NOT_EQUAL=66 +LT=67 +LTE=68 +GT=69 +GTE=70 +LSHIFT=71 +RSHIFT=72 +PLUS=73 +MINUS=74 +DIV=75 +MOD=76 +INC=77 +DEC=78 +LITERAL_sizeof="sizeof"=79 +BNOT=80 +LNOT=81 +PTR=82 +DOT=83 +CharLiteral=84 +StringLiteral=85 +IntOctalConst=86 +LongOctalConst=87 +UnsignedOctalConst=88 +IntIntConst=89 +LongIntConst=90 +UnsignedIntConst=91 +IntHexConst=92 +LongHexConst=93 +UnsignedHexConst=94 +FloatDoubleConst=95 +DoubleDoubleConst=96 +LongDoubleConst=97 +NTypedefName=98 +NInitDecl=99 +NDeclarator=100 +NStructDeclarator=101 +NDeclaration=102 +NCast=103 +NPointerGroup=104 +NExpressionGroup=105 +NFunctionCallArgs=106 +NNonemptyAbstractDeclarator=107 +NInitializer=108 +NStatementExpr=109 +NEmptyExpression=110 +NParameterTypeList=111 +NFunctionDef=112 +NCompoundStatement=113 +NParameterDeclaration=114 +NCommaExpr=115 +NUnaryExpr=116 +NLabel=117 +NPostfixExpr=118 +NRangeExpr=119 +NStringSeq=120 +NInitializerElementLabel=121 +NLcurlyInitializer=122 +NAsmAttribute=123 +NGnuAsmExpr=124 +NTypeMissing=125 +Vocabulary=126 +Whitespace=127 +Comment=128 +CPPComment=129 +PREPROC_DIRECTIVE("a line directive")=130 +Space=131 +LineDirective=132 +BadStringLiteral=133 +Escape=134 +Digit=135 +LongSuffix=136 +UnsignedSuffix=137 +FloatSuffix=138 +Exponent=139 +Number=140 diff --git a/app/preproc/StdCLexer.java b/app/preproc/StdCLexer.java index 8551c5bad..ed3c38b80 100644 --- a/app/preproc/StdCLexer.java +++ b/app/preproc/StdCLexer.java @@ -1,42 +1,42 @@ -// $ANTLR 2.7.2: "StdCParser.g" -> "StdCLexer.java"$ +// $ANTLR 2.7.2: "StdCParser.g" -> "StdCLexer.java"$ package processing.app.preproc; import java.io.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -import java.io.InputStream; -import antlr.TokenStreamException; -import antlr.TokenStreamIOException; -import antlr.TokenStreamRecognitionException; -import antlr.CharStreamException; -import antlr.CharStreamIOException; -import antlr.ANTLRException; -import java.io.Reader; -import java.util.Hashtable; -import antlr.CharScanner; -import antlr.InputBuffer; -import antlr.ByteBuffer; -import antlr.CharBuffer; -import antlr.Token; -import antlr.CommonToken; -import antlr.RecognitionException; -import antlr.NoViableAltForCharException; -import antlr.MismatchedCharException; -import antlr.TokenStream; -import antlr.ANTLRHashString; -import antlr.LexerSharedInputState; -import antlr.collections.impl.BitSet; -import antlr.SemanticException; + +import java.io.InputStream; +import antlr.TokenStreamException; +import antlr.TokenStreamIOException; +import antlr.TokenStreamRecognitionException; +import antlr.CharStreamException; +import antlr.CharStreamIOException; +import antlr.ANTLRException; +import java.io.Reader; +import java.util.Hashtable; +import antlr.CharScanner; +import antlr.InputBuffer; +import antlr.ByteBuffer; +import antlr.CharBuffer; +import antlr.Token; +import antlr.CommonToken; +import antlr.RecognitionException; +import antlr.NoViableAltForCharException; +import antlr.MismatchedCharException; +import antlr.TokenStream; +import antlr.ANTLRHashString; +import antlr.LexerSharedInputState; +import antlr.collections.impl.BitSet; +import antlr.SemanticException; // import CToken; import java.io.*; // import LineObject; import antlr.*; - -public class StdCLexer extends antlr.CharScanner implements STDCTokenTypes, TokenStream - { + +public class StdCLexer extends antlr.CharScanner implements STDCTokenTypes, TokenStream + { LineObject lineObject = new LineObject(); String originalSource = ""; @@ -104,2642 +104,2642 @@ public class StdCLexer extends antlr.CharScanner implements STDCTokenTypes, Toke -public StdCLexer(InputStream in) { - this(new ByteBuffer(in)); -} -public StdCLexer(Reader in) { - this(new CharBuffer(in)); -} -public StdCLexer(InputBuffer ib) { - this(new LexerSharedInputState(ib)); -} -public StdCLexer(LexerSharedInputState state) { - super(state); - caseSensitiveLiterals = true; - setCaseSensitive(true); - literals = new Hashtable(); - literals.put(new ANTLRHashString("switch", this), new Integer(48)); - literals.put(new ANTLRHashString("case", this), new Integer(44)); - literals.put(new ANTLRHashString("for", this), new Integer(39)); - literals.put(new ANTLRHashString("register", this), new Integer(14)); - literals.put(new ANTLRHashString("sizeof", this), new Integer(79)); - literals.put(new ANTLRHashString("auto", this), new Integer(13)); - literals.put(new ANTLRHashString("void", this), new Integer(18)); - literals.put(new ANTLRHashString("float", this), new Integer(23)); - literals.put(new ANTLRHashString("continue", this), new Integer(41)); - literals.put(new ANTLRHashString("long", this), new Integer(22)); - literals.put(new ANTLRHashString("do", this), new Integer(38)); - literals.put(new ANTLRHashString("typedef", this), new Integer(4)); - literals.put(new ANTLRHashString("short", this), new Integer(20)); - literals.put(new ANTLRHashString("signed", this), new Integer(25)); - literals.put(new ANTLRHashString("enum", this), new Integer(12)); - literals.put(new ANTLRHashString("asm", this), new Integer(5)); - literals.put(new ANTLRHashString("static", this), new Integer(16)); - literals.put(new ANTLRHashString("char", this), new Integer(19)); - literals.put(new ANTLRHashString("union", this), new Integer(11)); - literals.put(new ANTLRHashString("while", this), new Integer(37)); - literals.put(new ANTLRHashString("const", this), new Integer(17)); - literals.put(new ANTLRHashString("break", this), new Integer(42)); - literals.put(new ANTLRHashString("extern", this), new Integer(15)); - literals.put(new ANTLRHashString("return", this), new Integer(43)); - literals.put(new ANTLRHashString("if", this), new Integer(46)); - literals.put(new ANTLRHashString("int", this), new Integer(21)); - literals.put(new ANTLRHashString("double", this), new Integer(24)); - literals.put(new ANTLRHashString("volatile", this), new Integer(6)); - literals.put(new ANTLRHashString("default", this), new Integer(45)); - literals.put(new ANTLRHashString("unsigned", this), new Integer(26)); - literals.put(new ANTLRHashString("struct", this), new Integer(10)); - literals.put(new ANTLRHashString("else", this), new Integer(47)); - literals.put(new ANTLRHashString("goto", this), new Integer(40)); -} - -public Token nextToken() throws TokenStreamException { - Token theRetToken=null; -tryAgain: - for (;;) { - Token _token = null; - int _ttype = Token.INVALID_TYPE; - resetText(); - try { // for char stream error handling - try { // for lexical error handling - switch ( LA(1)) { - case ':': - { - mCOLON(true); - theRetToken=_returnToken; - break; - } - case ',': - { - mCOMMA(true); - theRetToken=_returnToken; - break; - } - case '?': - { - mQUESTION(true); - theRetToken=_returnToken; - break; - } - case ';': - { - mSEMI(true); - theRetToken=_returnToken; - break; - } - case '(': - { - mLPAREN(true); - theRetToken=_returnToken; - break; - } - case ')': - { - mRPAREN(true); - theRetToken=_returnToken; - break; - } - case '[': - { - mLBRACKET(true); - theRetToken=_returnToken; - break; - } - case ']': - { - mRBRACKET(true); - theRetToken=_returnToken; - break; - } - case '{': - { - mLCURLY(true); - theRetToken=_returnToken; - break; - } - case '}': - { - mRCURLY(true); - theRetToken=_returnToken; - break; - } - case '~': - { - mBNOT(true); - theRetToken=_returnToken; - break; - } - case '#': - { - mPREPROC_DIRECTIVE(true); - theRetToken=_returnToken; - break; - } - case '.': case '0': case '1': case '2': - case '3': case '4': case '5': case '6': - case '7': case '8': case '9': - { - mNumber(true); - theRetToken=_returnToken; - break; - } - case '"': - { - mStringLiteral(true); - theRetToken=_returnToken; - break; - } - case 'A': case 'B': case 'C': case 'D': - case 'E': case 'F': case 'G': case 'H': - case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': - case 'Q': case 'R': case 'S': case 'T': - case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': case '_': case 'a': - case 'b': case 'c': case 'd': case 'e': - case 'f': case 'g': case 'h': case 'i': - case 'j': case 'k': case 'l': case 'm': - case 'n': case 'o': case 'p': case 'q': - case 'r': case 's': case 't': case 'u': - case 'v': case 'w': case 'x': case 'y': - case 'z': - { - mID(true); - theRetToken=_returnToken; - break; - } - case '\'': - { - mCharLiteral(true); - theRetToken=_returnToken; - break; - } - default: - if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='=')) { - mRSHIFT_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='<') && (LA(2)=='<') && (LA(3)=='=')) { - mLSHIFT_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='-') && (LA(2)=='>')) { - mPTR(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='=') && (LA(2)=='=')) { - mEQUAL(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='!') && (LA(2)=='=')) { - mNOT_EQUAL(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='<') && (LA(2)=='=')) { - mLTE(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='>') && (LA(2)=='=')) { - mGTE(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='/') && (LA(2)=='=')) { - mDIV_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='+') && (LA(2)=='=')) { - mPLUS_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='+') && (LA(2)=='+')) { - mINC(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='-') && (LA(2)=='=')) { - mMINUS_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='-') && (LA(2)=='-')) { - mDEC(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='*') && (LA(2)=='=')) { - mSTAR_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='%') && (LA(2)=='=')) { - mMOD_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='>') && (LA(2)=='>') && (true)) { - mRSHIFT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='<') && (LA(2)=='<') && (true)) { - mLSHIFT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='&') && (LA(2)=='&')) { - mLAND(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='|') && (LA(2)=='|')) { - mLOR(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='&') && (LA(2)=='=')) { - mBAND_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='|') && (LA(2)=='=')) { - mBOR_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='^') && (LA(2)=='=')) { - mBXOR_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='/') && (LA(2)=='*')) { - mComment(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='/') && (LA(2)=='/')) { - mCPPComment(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='=') && (true)) { - mASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='<') && (true)) { - mLT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='>') && (true)) { - mGT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='/') && (true)) { - mDIV(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='+') && (true)) { - mPLUS(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='-') && (true)) { - mMINUS(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='*') && (true)) { - mSTAR(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='%') && (true)) { - mMOD(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='!') && (true)) { - mLNOT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='&') && (true)) { - mBAND(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='|') && (true)) { - mBOR(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='^') && (true)) { - mBXOR(true); - theRetToken=_returnToken; - } - else if ((_tokenSet_0.member(LA(1)))) { - mWhitespace(true); - theRetToken=_returnToken; - } - else { - if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} - else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - } - if ( _returnToken==null ) continue tryAgain; // found SKIP token - _ttype = _returnToken.getType(); - _returnToken.setType(_ttype); - return _returnToken; - } - catch (RecognitionException e) { - throw new TokenStreamRecognitionException(e); - } - } - catch (CharStreamException cse) { - if ( cse instanceof CharStreamIOException ) { - throw new TokenStreamIOException(((CharStreamIOException)cse).io); - } - else { - throw new TokenStreamException(cse.getMessage()); - } - } - } -} - - protected final void mVocabulary(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Vocabulary; - int _saveIndex; - - matchRange('\3','\377'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = ASSIGN; - int _saveIndex; - - match('='); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = COLON; - int _saveIndex; - - match(':'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = COMMA; - int _saveIndex; - - match(','); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mQUESTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = QUESTION; - int _saveIndex; - - match('?'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = SEMI; - int _saveIndex; - - match(';'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mPTR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = PTR; - int _saveIndex; - - match("->"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = DOT; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mVARARGS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = VARARGS; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LPAREN; - int _saveIndex; - - match('('); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = RPAREN; - int _saveIndex; - - match(')'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LBRACKET; - int _saveIndex; - - match('['); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mRBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = RBRACKET; - int _saveIndex; - - match(']'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LCURLY; - int _saveIndex; - - match('{'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = RCURLY; - int _saveIndex; - - match('}'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mEQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = EQUAL; - int _saveIndex; - - match("=="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mNOT_EQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = NOT_EQUAL; - int _saveIndex; - - match("!="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LTE; - int _saveIndex; - - match("<="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LT; - int _saveIndex; - - match("<"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mGTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = GTE; - int _saveIndex; - - match(">="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = GT; - int _saveIndex; - - match(">"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mDIV(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = DIV; - int _saveIndex; - - match('/'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mDIV_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = DIV_ASSIGN; - int _saveIndex; - - match("/="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = PLUS; - int _saveIndex; - - match('+'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mPLUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = PLUS_ASSIGN; - int _saveIndex; - - match("+="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mINC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = INC; - int _saveIndex; - - match("++"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = MINUS; - int _saveIndex; - - match('-'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mMINUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = MINUS_ASSIGN; - int _saveIndex; - - match("-="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mDEC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = DEC; - int _saveIndex; - - match("--"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = STAR; - int _saveIndex; - - match('*'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mSTAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = STAR_ASSIGN; - int _saveIndex; - - match("*="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mMOD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = MOD; - int _saveIndex; - - match('%'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mMOD_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = MOD_ASSIGN; - int _saveIndex; - - match("%="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mRSHIFT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = RSHIFT; - int _saveIndex; - - match(">>"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mRSHIFT_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = RSHIFT_ASSIGN; - int _saveIndex; - - match(">>="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLSHIFT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LSHIFT; - int _saveIndex; - - match("<<"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLSHIFT_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LSHIFT_ASSIGN; - int _saveIndex; - - match("<<="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LAND; - int _saveIndex; - - match("&&"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LNOT; - int _saveIndex; - - match('!'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LOR; - int _saveIndex; - - match("||"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BAND; - int _saveIndex; - - match('&'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBAND_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BAND_ASSIGN; - int _saveIndex; - - match("&="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BNOT; - int _saveIndex; - - match('~'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BOR; - int _saveIndex; - - match('|'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BOR_ASSIGN; - int _saveIndex; - - match("|="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBXOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BXOR; - int _saveIndex; - - match('^'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBXOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BXOR_ASSIGN; - int _saveIndex; - - match("^="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mWhitespace(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Whitespace; - int _saveIndex; - - { - if ((LA(1)=='\r') && (LA(2)=='\n')) { - match("\r\n"); - if ( inputState.guessing==0 ) { - newline(); - } - } - else if ((_tokenSet_1.member(LA(1)))) { - { - switch ( LA(1)) { - case '\u0003': case '\u0004': case '\u0005': case '\u0006': - case '\u0007': case '\u0008': - { - matchRange('\003','\010'); - break; - } - case '\t': - { - match('\t'); - break; - } - case '\u000b': - { - match('\013'); - break; - } - case '\u000c': - { - match('\f'); - break; - } - case '\u000e': case '\u000f': case '\u0010': case '\u0011': - case '\u0012': case '\u0013': case '\u0014': case '\u0015': - case '\u0016': case '\u0017': case '\u0018': case '\u0019': - case '\u001a': case '\u001b': case '\u001c': case '\u001d': - case '\u001e': case '\u001f': - { - matchRange('\016','\037'); - break; - } - case ' ': - { - match(' '); - break; - } - default: - if (((LA(1) >= '\u007f' && LA(1) <= '\u00ff'))) { - matchRange('\177','\377'); - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - } - else if ((LA(1)=='\n'||LA(1)=='\r') && (true)) { - { - switch ( LA(1)) { - case '\n': - { - match('\n'); - break; - } - case '\r': - { - match('\r'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - if ( inputState.guessing==0 ) { - newline(); - } - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - if ( inputState.guessing==0 ) { - _ttype = Token.SKIP; - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mComment(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Comment; - int _saveIndex; - - match("/*"); - { - _loop269: - do { - if (((LA(1)=='*') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff')))&&( LA(2) != '/' )) { - match('*'); - } - else if ((LA(1)=='\r') && (LA(2)=='\n') && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { - match("\r\n"); - if ( inputState.guessing==0 ) { - deferredNewline(); - } - } - else if ((LA(1)=='\n'||LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { - { - switch ( LA(1)) { - case '\r': - { - match('\r'); - break; - } - case '\n': - { - match('\n'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - if ( inputState.guessing==0 ) { - deferredNewline(); - } - } - else if ((_tokenSet_2.member(LA(1)))) { - { - match(_tokenSet_2); - } - } - else { - break _loop269; - } - - } while (true); - } - match("*/"); - if ( inputState.guessing==0 ) { - _ttype = Token.SKIP; - - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mCPPComment(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = CPPComment; - int _saveIndex; - - match("//"); - { - _loop273: - do { - if ((_tokenSet_3.member(LA(1)))) { - { - match(_tokenSet_3); - } - } - else { - break _loop273; - } - - } while (true); - } - if ( inputState.guessing==0 ) { - - _ttype = Token.SKIP; - - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mPREPROC_DIRECTIVE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = PREPROC_DIRECTIVE; - int _saveIndex; - - match('#'); - { - boolean synPredMatched280 = false; - if (((_tokenSet_4.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_6.member(LA(3))))) { - int _m280 = mark(); - synPredMatched280 = true; - inputState.guessing++; - try { - { - switch ( LA(1)) { - case 'l': - { - match("line"); - break; - } - case '\t': case '\u000c': case ' ': - { - { - { - int _cnt279=0; - _loop279: - do { - switch ( LA(1)) { - case ' ': - { - match(' '); - break; - } - case '\t': - { - match('\t'); - break; - } - case '\u000c': - { - match('\014'); - break; - } - default: - { - if ( _cnt279>=1 ) { break _loop279; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - } - _cnt279++; - } while (true); - } - matchRange('0','9'); - } - break; - } - default: - { - } - } - } - } - catch (RecognitionException pe) { - synPredMatched280 = false; - } - rewind(_m280); - inputState.guessing--; - } - if ( synPredMatched280 ) { - mLineDirective(false); - } - else { - { - _loop282: - do { - if ((_tokenSet_3.member(LA(1)))) { - matchNot('\n'); - } - else { - break _loop282; - } - - } while (true); - } - if ( inputState.guessing==0 ) { - setPreprocessingDirective(getText()); - } - } - - } - if ( inputState.guessing==0 ) { - - _ttype = Token.SKIP; - - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLineDirective(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LineDirective; - int _saveIndex; - Token n=null; - Token fn=null; - Token fi=null; - - boolean oldCountingTokens = countingTokens; - countingTokens = false; - - - if ( inputState.guessing==0 ) { - - lineObject = new LineObject(); - deferredLineCount = 0; - - } - { - switch ( LA(1)) { - case 'l': - { - match("line"); - break; - } - case '\t': case '\u000c': case ' ': - { - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - int _cnt288=0; - _loop288: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ')) { - mSpace(false); - } - else { - if ( _cnt288>=1 ) { break _loop288; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt288++; - } while (true); - } - mNumber(true); - n=_returnToken; - if ( inputState.guessing==0 ) { - lineObject.setLine(Integer.parseInt(n.getText())); - } - { - int _cnt290=0; - _loop290: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mSpace(false); - } - else { - if ( _cnt290>=1 ) { break _loop290; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt290++; - } while (true); - } - { - if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { - mStringLiteral(true); - fn=_returnToken; - if ( inputState.guessing==0 ) { - try { - lineObject.setSource(fn.getText().substring(1,fn.getText().length()-1)); - } - catch (StringIndexOutOfBoundsException e) { /*not possible*/ } - - } - } - else if ((_tokenSet_7.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mID(true); - fi=_returnToken; - if ( inputState.guessing==0 ) { - lineObject.setSource(fi.getText()); - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - { - _loop293: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mSpace(false); - } - else { - break _loop293; - } - - } while (true); - } - { - if ((LA(1)=='1') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - match("1"); - if ( inputState.guessing==0 ) { - lineObject.setEnteringFile(true); - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - { - _loop296: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mSpace(false); - } - else { - break _loop296; - } - - } while (true); - } - { - if ((LA(1)=='2') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - match("2"); - if ( inputState.guessing==0 ) { - lineObject.setReturningToFile(true); - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - { - _loop299: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mSpace(false); - } - else { - break _loop299; - } - - } while (true); - } - { - if ((LA(1)=='3') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - match("3"); - if ( inputState.guessing==0 ) { - lineObject.setSystemHeader(true); - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - { - _loop302: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mSpace(false); - } - else { - break _loop302; - } - - } while (true); - } - { - if ((LA(1)=='4') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - match("4"); - if ( inputState.guessing==0 ) { - lineObject.setTreatAsC(true); - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - { - _loop306: - do { - if ((_tokenSet_8.member(LA(1)))) { - { - match(_tokenSet_8); - } - } - else { - break _loop306; - } - - } while (true); - } - { - if ((LA(1)=='\r') && (LA(2)=='\n')) { - match("\r\n"); - } - else if ((LA(1)=='\r') && (true)) { - match("\r"); - } - else if ((LA(1)=='\n')) { - match("\n"); - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - if ( inputState.guessing==0 ) { - - preprocessorInfoChannel.addLineForTokenNumber(new LineObject(lineObject), new Integer(tokenNumber)); - countingTokens = oldCountingTokens; - - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mSpace(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Space; - int _saveIndex; - - { - switch ( LA(1)) { - case ' ': - { - match(' '); - break; - } - case '\t': - { - match('\t'); - break; - } - case '\u000c': - { - match('\014'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mNumber(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Number; - int _saveIndex; - - boolean synPredMatched352 = false; - if ((((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_9.member(LA(2))) && (true))) { - int _m352 = mark(); - synPredMatched352 = true; - inputState.guessing++; - try { - { - { - int _cnt350=0; - _loop350: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - if ( _cnt350>=1 ) { break _loop350; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt350++; - } while (true); - } - { - switch ( LA(1)) { - case '.': - { - match('.'); - break; - } - case 'e': - { - match('e'); - break; - } - case 'E': - { - match('E'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - } - } - catch (RecognitionException pe) { - synPredMatched352 = false; - } - rewind(_m352); - inputState.guessing--; - } - if ( synPredMatched352 ) { - { - int _cnt354=0; - _loop354: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - if ( _cnt354>=1 ) { break _loop354; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt354++; - } while (true); - } - { - switch ( LA(1)) { - case '.': - { - match('.'); - { - _loop357: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - break _loop357; - } - - } while (true); - } - { - if ((LA(1)=='E'||LA(1)=='e')) { - mExponent(false); - } - else { - } - - } - break; - } - case 'E': case 'e': - { - mExponent(false); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - if ( inputState.guessing==0 ) { - _ttype = DoubleDoubleConst; - } - { - switch ( LA(1)) { - case 'F': case 'f': - { - mFloatSuffix(false); - if ( inputState.guessing==0 ) { - _ttype = FloatDoubleConst; - } - break; - } - case 'L': case 'l': - { - mLongSuffix(false); - if ( inputState.guessing==0 ) { - _ttype = LongDoubleConst; - } - break; - } - default: - { - } - } - } - } - else { - boolean synPredMatched361 = false; - if (((LA(1)=='.') && (LA(2)=='.'))) { - int _m361 = mark(); - synPredMatched361 = true; - inputState.guessing++; - try { - { - match("..."); - } - } - catch (RecognitionException pe) { - synPredMatched361 = false; - } - rewind(_m361); - inputState.guessing--; - } - if ( synPredMatched361 ) { - match("..."); - if ( inputState.guessing==0 ) { - _ttype = VARARGS; - } - } - else if ((LA(1)=='0') && (LA(2)=='X'||LA(2)=='x')) { - match('0'); - { - switch ( LA(1)) { - case 'x': - { - match('x'); - break; - } - case 'X': - { - match('X'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - int _cnt375=0; - _loop375: - do { - switch ( LA(1)) { - case 'a': case 'b': case 'c': case 'd': - case 'e': case 'f': - { - matchRange('a','f'); - break; - } - case 'A': case 'B': case 'C': case 'D': - case 'E': case 'F': - { - matchRange('A','F'); - break; - } - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': - { - mDigit(false); - break; - } - default: - { - if ( _cnt375>=1 ) { break _loop375; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - } - _cnt375++; - } while (true); - } - if ( inputState.guessing==0 ) { - _ttype = IntHexConst; - } - { - switch ( LA(1)) { - case 'L': case 'l': - { - mLongSuffix(false); - if ( inputState.guessing==0 ) { - _ttype = LongHexConst; - } - break; - } - case 'U': case 'u': - { - mUnsignedSuffix(false); - if ( inputState.guessing==0 ) { - _ttype = UnsignedHexConst; - } - break; - } - default: - { - } - } - } - } - else if ((LA(1)=='.') && (true)) { - match('.'); - if ( inputState.guessing==0 ) { - _ttype = DOT; - } - { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - { - int _cnt364=0; - _loop364: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - if ( _cnt364>=1 ) { break _loop364; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt364++; - } while (true); - } - { - if ((LA(1)=='E'||LA(1)=='e')) { - mExponent(false); - } - else { - } - - } - if ( inputState.guessing==0 ) { - _ttype = DoubleDoubleConst; - } - { - switch ( LA(1)) { - case 'F': case 'f': - { - mFloatSuffix(false); - if ( inputState.guessing==0 ) { - _ttype = FloatDoubleConst; - } - break; - } - case 'L': case 'l': - { - mLongSuffix(false); - if ( inputState.guessing==0 ) { - _ttype = LongDoubleConst; - } - break; - } - default: - { - } - } - } - } - else { - } - - } - } - else if ((LA(1)=='0') && (true) && (true)) { - match('0'); - { - _loop368: - do { - if (((LA(1) >= '0' && LA(1) <= '7'))) { - matchRange('0','7'); - } - else { - break _loop368; - } - - } while (true); - } - if ( inputState.guessing==0 ) { - _ttype = IntOctalConst; - } - { - switch ( LA(1)) { - case 'L': case 'l': - { - mLongSuffix(false); - if ( inputState.guessing==0 ) { - _ttype = LongOctalConst; - } - break; - } - case 'U': case 'u': - { - mUnsignedSuffix(false); - if ( inputState.guessing==0 ) { - _ttype = UnsignedOctalConst; - } - break; - } - default: - { - } - } - } - } - else if (((LA(1) >= '1' && LA(1) <= '9')) && (true) && (true)) { - matchRange('1','9'); - { - _loop371: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - break _loop371; - } - - } while (true); - } - if ( inputState.guessing==0 ) { - _ttype = IntIntConst; - } - { - switch ( LA(1)) { - case 'L': case 'l': - { - mLongSuffix(false); - if ( inputState.guessing==0 ) { - _ttype = LongIntConst; - } - break; - } - case 'U': case 'u': - { - mUnsignedSuffix(false); - if ( inputState.guessing==0 ) { - _ttype = UnsignedIntConst; - } - break; - } - default: - { - } - } - } - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = StringLiteral; - int _saveIndex; - - match('"'); - { - _loop315: - do { - if ((LA(1)=='\\') && (_tokenSet_10.member(LA(2))) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { - mEscape(false); - } - else if ((LA(1)=='\n'||LA(1)=='\r'||LA(1)=='\\') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - { - switch ( LA(1)) { - case '\r': - { - match('\r'); - if ( inputState.guessing==0 ) { - deferredNewline(); - } - break; - } - case '\n': - { - match('\n'); - if ( inputState.guessing==0 ) { - - deferredNewline(); - _ttype = BadStringLiteral; - - } - break; - } - case '\\': - { - match('\\'); - match('\n'); - if ( inputState.guessing==0 ) { - - deferredNewline(); - - } - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - } - else if ((_tokenSet_11.member(LA(1)))) { - { - match(_tokenSet_11); - } - } - else { - break _loop315; - } - - } while (true); - } - match('"'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = ID; - int _saveIndex; - - { - switch ( LA(1)) { - case 'a': case 'b': case 'c': case 'd': - case 'e': case 'f': case 'g': case 'h': - case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'p': - case 'q': case 'r': case 's': case 't': - case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - { - matchRange('a','z'); - break; - } - case 'A': case 'B': case 'C': case 'D': - case 'E': case 'F': case 'G': case 'H': - case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': - case 'Q': case 'R': case 'S': case 'T': - case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - { - matchRange('A','Z'); - break; - } - case '_': - { - match('_'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - _loop380: - do { - if (((LA(1) >= 'a' && LA(1) <= 'z')) && (true) && (true)) { - matchRange('a','z'); - } - else if (((LA(1) >= 'A' && LA(1) <= 'Z')) && (true) && (true)) { - matchRange('A','Z'); - } - else if ((LA(1)=='_') && (true) && (true)) { - match('_'); - } - else if (((LA(1) >= '0' && LA(1) <= '9')) && (true) && (true)) { - matchRange('0','9'); - } - else { - break _loop380; - } - - } while (true); - } - _ttype = testLiteralsTable(_ttype); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mCharLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = CharLiteral; - int _saveIndex; - - match('\''); - { - if ((LA(1)=='\\') && (_tokenSet_10.member(LA(2))) && (_tokenSet_12.member(LA(3)))) { - mEscape(false); - } - else if ((_tokenSet_13.member(LA(1))) && (LA(2)=='\'') && (true)) { - { - match(_tokenSet_13); - } - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - match('\''); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mEscape(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Escape; - int _saveIndex; - - match('\\'); - { - switch ( LA(1)) { - case 'a': - { - match('a'); - break; - } - case 'b': - { - match('b'); - break; - } - case 'f': - { - match('f'); - break; - } - case 'n': - { - match('n'); - break; - } - case 'r': - { - match('r'); - break; - } - case 't': - { - match('t'); - break; - } - case 'v': - { - match('v'); - break; - } - case '"': - { - match('"'); - break; - } - case '\'': - { - match('\''); - break; - } - case '\\': - { - match('\\'); - break; - } - case '?': - { - match('?'); - break; - } - case '0': case '1': case '2': case '3': - { - { - matchRange('0','3'); - } - { - if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mDigit(false); - { - if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mDigit(false); - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - break; - } - case '4': case '5': case '6': case '7': - { - { - matchRange('4','7'); - } - { - if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mDigit(false); - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - break; - } - case 'x': - { - match('x'); - { - int _cnt325=0; - _loop325: - do { - if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mDigit(false); - } - else if (((LA(1) >= 'a' && LA(1) <= 'f')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - matchRange('a','f'); - } - else if (((LA(1) >= 'A' && LA(1) <= 'F')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - matchRange('A','F'); - } - else { - if ( _cnt325>=1 ) { break _loop325; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt325++; - } while (true); - } - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mBadStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BadStringLiteral; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mDigit(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Digit; - int _saveIndex; - - matchRange('0','9'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLongSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LongSuffix; - int _saveIndex; - - switch ( LA(1)) { - case 'l': - { - match('l'); - break; - } - case 'L': - { - match('L'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mUnsignedSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = UnsignedSuffix; - int _saveIndex; - - switch ( LA(1)) { - case 'u': - { - match('u'); - break; - } - case 'U': - { - match('U'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mFloatSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = FloatSuffix; - int _saveIndex; - - switch ( LA(1)) { - case 'f': - { - match('f'); - break; - } - case 'F': - { - match('F'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mExponent(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Exponent; - int _saveIndex; - - { - switch ( LA(1)) { - case 'e': - { - match('e'); - break; - } - case 'E': - { - match('E'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - switch ( LA(1)) { - case '+': - { - match('+'); - break; - } - case '-': - { - match('-'); - break; - } - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': - { - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - int _cnt334=0; - _loop334: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - if ( _cnt334>=1 ) { break _loop334; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt334++; - } while (true); - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mDoubleDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = DoubleDoubleConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mFloatDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = FloatDoubleConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLongDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LongDoubleConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mIntOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = IntOctalConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLongOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LongOctalConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mUnsignedOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = UnsignedOctalConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mIntIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = IntIntConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLongIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LongIntConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mUnsignedIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = UnsignedIntConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mIntHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = IntHexConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLongHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LongHexConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mUnsignedHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = UnsignedHexConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - - private static final long[] mk_tokenSet_0() { - long[] data = new long[8]; - data[0]=8589934584L; - data[1]=-9223372036854775808L; - for (int i = 2; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); - private static final long[] mk_tokenSet_1() { - long[] data = new long[8]; - data[0]=8589925368L; - data[1]=-9223372036854775808L; - for (int i = 2; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); - private static final long[] mk_tokenSet_2() { - long[] data = new long[8]; - data[0]=-4398046520328L; - for (int i = 1; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); - private static final long[] mk_tokenSet_3() { - long[] data = new long[8]; - data[0]=-1032L; - for (int i = 1; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); - private static final long[] mk_tokenSet_4() { - long[] data = { 4294971904L, 17592186044416L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); - private static final long[] mk_tokenSet_5() { - long[] data = { 288019274214150656L, 2199023255552L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); - private static final long[] mk_tokenSet_6() { - long[] data = { 288019274214150656L, 81152891680722976L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6()); - private static final long[] mk_tokenSet_7() { - long[] data = { 0L, 576460745995190270L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7()); - private static final long[] mk_tokenSet_8() { - long[] data = new long[8]; - data[0]=-9224L; - for (int i = 1; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8()); - private static final long[] mk_tokenSet_9() { - long[] data = { 288019269919178752L, 137438953504L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9()); - private static final long[] mk_tokenSet_10() { - long[] data = { -9151595350857875456L, 95772161741946880L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10()); - private static final long[] mk_tokenSet_11() { - long[] data = new long[8]; - data[0]=-17179878408L; - data[1]=-268435457L; - for (int i = 2; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11()); - private static final long[] mk_tokenSet_12() { - long[] data = { 287949450930814976L, 541165879422L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); - private static final long[] mk_tokenSet_13() { - long[] data = new long[8]; - data[0]=-549755813896L; - for (int i = 1; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13()); - - } +public StdCLexer(InputStream in) { + this(new ByteBuffer(in)); +} +public StdCLexer(Reader in) { + this(new CharBuffer(in)); +} +public StdCLexer(InputBuffer ib) { + this(new LexerSharedInputState(ib)); +} +public StdCLexer(LexerSharedInputState state) { + super(state); + caseSensitiveLiterals = true; + setCaseSensitive(true); + literals = new Hashtable(); + literals.put(new ANTLRHashString("switch", this), new Integer(48)); + literals.put(new ANTLRHashString("case", this), new Integer(44)); + literals.put(new ANTLRHashString("for", this), new Integer(39)); + literals.put(new ANTLRHashString("register", this), new Integer(14)); + literals.put(new ANTLRHashString("sizeof", this), new Integer(79)); + literals.put(new ANTLRHashString("auto", this), new Integer(13)); + literals.put(new ANTLRHashString("void", this), new Integer(18)); + literals.put(new ANTLRHashString("float", this), new Integer(23)); + literals.put(new ANTLRHashString("continue", this), new Integer(41)); + literals.put(new ANTLRHashString("long", this), new Integer(22)); + literals.put(new ANTLRHashString("do", this), new Integer(38)); + literals.put(new ANTLRHashString("typedef", this), new Integer(4)); + literals.put(new ANTLRHashString("short", this), new Integer(20)); + literals.put(new ANTLRHashString("signed", this), new Integer(25)); + literals.put(new ANTLRHashString("enum", this), new Integer(12)); + literals.put(new ANTLRHashString("asm", this), new Integer(5)); + literals.put(new ANTLRHashString("static", this), new Integer(16)); + literals.put(new ANTLRHashString("char", this), new Integer(19)); + literals.put(new ANTLRHashString("union", this), new Integer(11)); + literals.put(new ANTLRHashString("while", this), new Integer(37)); + literals.put(new ANTLRHashString("const", this), new Integer(17)); + literals.put(new ANTLRHashString("break", this), new Integer(42)); + literals.put(new ANTLRHashString("extern", this), new Integer(15)); + literals.put(new ANTLRHashString("return", this), new Integer(43)); + literals.put(new ANTLRHashString("if", this), new Integer(46)); + literals.put(new ANTLRHashString("int", this), new Integer(21)); + literals.put(new ANTLRHashString("double", this), new Integer(24)); + literals.put(new ANTLRHashString("volatile", this), new Integer(6)); + literals.put(new ANTLRHashString("default", this), new Integer(45)); + literals.put(new ANTLRHashString("unsigned", this), new Integer(26)); + literals.put(new ANTLRHashString("struct", this), new Integer(10)); + literals.put(new ANTLRHashString("else", this), new Integer(47)); + literals.put(new ANTLRHashString("goto", this), new Integer(40)); +} + +public Token nextToken() throws TokenStreamException { + Token theRetToken=null; +tryAgain: + for (;;) { + Token _token = null; + int _ttype = Token.INVALID_TYPE; + resetText(); + try { // for char stream error handling + try { // for lexical error handling + switch ( LA(1)) { + case ':': + { + mCOLON(true); + theRetToken=_returnToken; + break; + } + case ',': + { + mCOMMA(true); + theRetToken=_returnToken; + break; + } + case '?': + { + mQUESTION(true); + theRetToken=_returnToken; + break; + } + case ';': + { + mSEMI(true); + theRetToken=_returnToken; + break; + } + case '(': + { + mLPAREN(true); + theRetToken=_returnToken; + break; + } + case ')': + { + mRPAREN(true); + theRetToken=_returnToken; + break; + } + case '[': + { + mLBRACKET(true); + theRetToken=_returnToken; + break; + } + case ']': + { + mRBRACKET(true); + theRetToken=_returnToken; + break; + } + case '{': + { + mLCURLY(true); + theRetToken=_returnToken; + break; + } + case '}': + { + mRCURLY(true); + theRetToken=_returnToken; + break; + } + case '~': + { + mBNOT(true); + theRetToken=_returnToken; + break; + } + case '#': + { + mPREPROC_DIRECTIVE(true); + theRetToken=_returnToken; + break; + } + case '.': case '0': case '1': case '2': + case '3': case '4': case '5': case '6': + case '7': case '8': case '9': + { + mNumber(true); + theRetToken=_returnToken; + break; + } + case '"': + { + mStringLiteral(true); + theRetToken=_returnToken; + break; + } + case 'A': case 'B': case 'C': case 'D': + case 'E': case 'F': case 'G': case 'H': + case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': + case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': case '_': case 'a': + case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': + case 'j': case 'k': case 'l': case 'm': + case 'n': case 'o': case 'p': case 'q': + case 'r': case 's': case 't': case 'u': + case 'v': case 'w': case 'x': case 'y': + case 'z': + { + mID(true); + theRetToken=_returnToken; + break; + } + case '\'': + { + mCharLiteral(true); + theRetToken=_returnToken; + break; + } + default: + if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='=')) { + mRSHIFT_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (LA(2)=='<') && (LA(3)=='=')) { + mLSHIFT_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (LA(2)=='>')) { + mPTR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='=') && (LA(2)=='=')) { + mEQUAL(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='!') && (LA(2)=='=')) { + mNOT_EQUAL(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (LA(2)=='=')) { + mLTE(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (LA(2)=='=')) { + mGTE(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (LA(2)=='=')) { + mDIV_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='+') && (LA(2)=='=')) { + mPLUS_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='+') && (LA(2)=='+')) { + mINC(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (LA(2)=='=')) { + mMINUS_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (LA(2)=='-')) { + mDEC(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='*') && (LA(2)=='=')) { + mSTAR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='%') && (LA(2)=='=')) { + mMOD_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (LA(2)=='>') && (true)) { + mRSHIFT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (LA(2)=='<') && (true)) { + mLSHIFT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='&') && (LA(2)=='&')) { + mLAND(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='|') && (LA(2)=='|')) { + mLOR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='&') && (LA(2)=='=')) { + mBAND_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='|') && (LA(2)=='=')) { + mBOR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='^') && (LA(2)=='=')) { + mBXOR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (LA(2)=='*')) { + mComment(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (LA(2)=='/')) { + mCPPComment(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='=') && (true)) { + mASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (true)) { + mLT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (true)) { + mGT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (true)) { + mDIV(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='+') && (true)) { + mPLUS(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (true)) { + mMINUS(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='*') && (true)) { + mSTAR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='%') && (true)) { + mMOD(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='!') && (true)) { + mLNOT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='&') && (true)) { + mBAND(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='|') && (true)) { + mBOR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='^') && (true)) { + mBXOR(true); + theRetToken=_returnToken; + } + else if ((_tokenSet_0.member(LA(1)))) { + mWhitespace(true); + theRetToken=_returnToken; + } + else { + if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} + else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + } + if ( _returnToken==null ) continue tryAgain; // found SKIP token + _ttype = _returnToken.getType(); + _returnToken.setType(_ttype); + return _returnToken; + } + catch (RecognitionException e) { + throw new TokenStreamRecognitionException(e); + } + } + catch (CharStreamException cse) { + if ( cse instanceof CharStreamIOException ) { + throw new TokenStreamIOException(((CharStreamIOException)cse).io); + } + else { + throw new TokenStreamException(cse.getMessage()); + } + } + } +} + + protected final void mVocabulary(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Vocabulary; + int _saveIndex; + + matchRange('\3','\377'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = ASSIGN; + int _saveIndex; + + match('='); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = COLON; + int _saveIndex; + + match(':'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = COMMA; + int _saveIndex; + + match(','); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mQUESTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = QUESTION; + int _saveIndex; + + match('?'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = SEMI; + int _saveIndex; + + match(';'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mPTR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = PTR; + int _saveIndex; + + match("->"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DOT; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mVARARGS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = VARARGS; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LPAREN; + int _saveIndex; + + match('('); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RPAREN; + int _saveIndex; + + match(')'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LBRACKET; + int _saveIndex; + + match('['); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RBRACKET; + int _saveIndex; + + match(']'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LCURLY; + int _saveIndex; + + match('{'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RCURLY; + int _saveIndex; + + match('}'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mEQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = EQUAL; + int _saveIndex; + + match("=="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mNOT_EQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = NOT_EQUAL; + int _saveIndex; + + match("!="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LTE; + int _saveIndex; + + match("<="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LT; + int _saveIndex; + + match("<"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mGTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = GTE; + int _saveIndex; + + match(">="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = GT; + int _saveIndex; + + match(">"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mDIV(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DIV; + int _saveIndex; + + match('/'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mDIV_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DIV_ASSIGN; + int _saveIndex; + + match("/="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = PLUS; + int _saveIndex; + + match('+'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mPLUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = PLUS_ASSIGN; + int _saveIndex; + + match("+="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mINC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = INC; + int _saveIndex; + + match("++"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MINUS; + int _saveIndex; + + match('-'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMINUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MINUS_ASSIGN; + int _saveIndex; + + match("-="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mDEC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DEC; + int _saveIndex; + + match("--"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = STAR; + int _saveIndex; + + match('*'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSTAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = STAR_ASSIGN; + int _saveIndex; + + match("*="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMOD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MOD; + int _saveIndex; + + match('%'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMOD_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MOD_ASSIGN; + int _saveIndex; + + match("%="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRSHIFT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RSHIFT; + int _saveIndex; + + match(">>"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRSHIFT_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RSHIFT_ASSIGN; + int _saveIndex; + + match(">>="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLSHIFT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LSHIFT; + int _saveIndex; + + match("<<"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLSHIFT_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LSHIFT_ASSIGN; + int _saveIndex; + + match("<<="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LAND; + int _saveIndex; + + match("&&"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LNOT; + int _saveIndex; + + match('!'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LOR; + int _saveIndex; + + match("||"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BAND; + int _saveIndex; + + match('&'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBAND_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BAND_ASSIGN; + int _saveIndex; + + match("&="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BNOT; + int _saveIndex; + + match('~'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BOR; + int _saveIndex; + + match('|'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BOR_ASSIGN; + int _saveIndex; + + match("|="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBXOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BXOR; + int _saveIndex; + + match('^'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBXOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BXOR_ASSIGN; + int _saveIndex; + + match("^="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mWhitespace(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Whitespace; + int _saveIndex; + + { + if ((LA(1)=='\r') && (LA(2)=='\n')) { + match("\r\n"); + if ( inputState.guessing==0 ) { + newline(); + } + } + else if ((_tokenSet_1.member(LA(1)))) { + { + switch ( LA(1)) { + case '\u0003': case '\u0004': case '\u0005': case '\u0006': + case '\u0007': case '\u0008': + { + matchRange('\003','\010'); + break; + } + case '\t': + { + match('\t'); + break; + } + case '\u000b': + { + match('\013'); + break; + } + case '\u000c': + { + match('\f'); + break; + } + case '\u000e': case '\u000f': case '\u0010': case '\u0011': + case '\u0012': case '\u0013': case '\u0014': case '\u0015': + case '\u0016': case '\u0017': case '\u0018': case '\u0019': + case '\u001a': case '\u001b': case '\u001c': case '\u001d': + case '\u001e': case '\u001f': + { + matchRange('\016','\037'); + break; + } + case ' ': + { + match(' '); + break; + } + default: + if (((LA(1) >= '\u007f' && LA(1) <= '\u00ff'))) { + matchRange('\177','\377'); + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + else if ((LA(1)=='\n'||LA(1)=='\r') && (true)) { + { + switch ( LA(1)) { + case '\n': + { + match('\n'); + break; + } + case '\r': + { + match('\r'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( inputState.guessing==0 ) { + newline(); + } + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + if ( inputState.guessing==0 ) { + _ttype = Token.SKIP; + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mComment(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Comment; + int _saveIndex; + + match("/*"); + { + _loop269: + do { + if (((LA(1)=='*') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff')))&&( LA(2) != '/' )) { + match('*'); + } + else if ((LA(1)=='\r') && (LA(2)=='\n') && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { + match("\r\n"); + if ( inputState.guessing==0 ) { + deferredNewline(); + } + } + else if ((LA(1)=='\n'||LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { + { + switch ( LA(1)) { + case '\r': + { + match('\r'); + break; + } + case '\n': + { + match('\n'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( inputState.guessing==0 ) { + deferredNewline(); + } + } + else if ((_tokenSet_2.member(LA(1)))) { + { + match(_tokenSet_2); + } + } + else { + break _loop269; + } + + } while (true); + } + match("*/"); + if ( inputState.guessing==0 ) { + _ttype = Token.SKIP; + + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCPPComment(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = CPPComment; + int _saveIndex; + + match("//"); + { + _loop273: + do { + if ((_tokenSet_3.member(LA(1)))) { + { + match(_tokenSet_3); + } + } + else { + break _loop273; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + + _ttype = Token.SKIP; + + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mPREPROC_DIRECTIVE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = PREPROC_DIRECTIVE; + int _saveIndex; + + match('#'); + { + boolean synPredMatched280 = false; + if (((_tokenSet_4.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_6.member(LA(3))))) { + int _m280 = mark(); + synPredMatched280 = true; + inputState.guessing++; + try { + { + switch ( LA(1)) { + case 'l': + { + match("line"); + break; + } + case '\t': case '\u000c': case ' ': + { + { + { + int _cnt279=0; + _loop279: + do { + switch ( LA(1)) { + case ' ': + { + match(' '); + break; + } + case '\t': + { + match('\t'); + break; + } + case '\u000c': + { + match('\014'); + break; + } + default: + { + if ( _cnt279>=1 ) { break _loop279; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + } + _cnt279++; + } while (true); + } + matchRange('0','9'); + } + break; + } + default: + { + } + } + } + } + catch (RecognitionException pe) { + synPredMatched280 = false; + } + rewind(_m280); + inputState.guessing--; + } + if ( synPredMatched280 ) { + mLineDirective(false); + } + else { + { + _loop282: + do { + if ((_tokenSet_3.member(LA(1)))) { + matchNot('\n'); + } + else { + break _loop282; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + setPreprocessingDirective(getText()); + } + } + + } + if ( inputState.guessing==0 ) { + + _ttype = Token.SKIP; + + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLineDirective(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LineDirective; + int _saveIndex; + Token n=null; + Token fn=null; + Token fi=null; + + boolean oldCountingTokens = countingTokens; + countingTokens = false; + + + if ( inputState.guessing==0 ) { + + lineObject = new LineObject(); + deferredLineCount = 0; + + } + { + switch ( LA(1)) { + case 'l': + { + match("line"); + break; + } + case '\t': case '\u000c': case ' ': + { + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + int _cnt288=0; + _loop288: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ')) { + mSpace(false); + } + else { + if ( _cnt288>=1 ) { break _loop288; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt288++; + } while (true); + } + mNumber(true); + n=_returnToken; + if ( inputState.guessing==0 ) { + lineObject.setLine(Integer.parseInt(n.getText())); + } + { + int _cnt290=0; + _loop290: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mSpace(false); + } + else { + if ( _cnt290>=1 ) { break _loop290; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt290++; + } while (true); + } + { + if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { + mStringLiteral(true); + fn=_returnToken; + if ( inputState.guessing==0 ) { + try { + lineObject.setSource(fn.getText().substring(1,fn.getText().length()-1)); + } + catch (StringIndexOutOfBoundsException e) { /*not possible*/ } + + } + } + else if ((_tokenSet_7.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mID(true); + fi=_returnToken; + if ( inputState.guessing==0 ) { + lineObject.setSource(fi.getText()); + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + { + _loop293: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mSpace(false); + } + else { + break _loop293; + } + + } while (true); + } + { + if ((LA(1)=='1') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + match("1"); + if ( inputState.guessing==0 ) { + lineObject.setEnteringFile(true); + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + { + _loop296: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mSpace(false); + } + else { + break _loop296; + } + + } while (true); + } + { + if ((LA(1)=='2') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + match("2"); + if ( inputState.guessing==0 ) { + lineObject.setReturningToFile(true); + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + { + _loop299: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mSpace(false); + } + else { + break _loop299; + } + + } while (true); + } + { + if ((LA(1)=='3') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + match("3"); + if ( inputState.guessing==0 ) { + lineObject.setSystemHeader(true); + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + { + _loop302: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mSpace(false); + } + else { + break _loop302; + } + + } while (true); + } + { + if ((LA(1)=='4') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + match("4"); + if ( inputState.guessing==0 ) { + lineObject.setTreatAsC(true); + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + { + _loop306: + do { + if ((_tokenSet_8.member(LA(1)))) { + { + match(_tokenSet_8); + } + } + else { + break _loop306; + } + + } while (true); + } + { + if ((LA(1)=='\r') && (LA(2)=='\n')) { + match("\r\n"); + } + else if ((LA(1)=='\r') && (true)) { + match("\r"); + } + else if ((LA(1)=='\n')) { + match("\n"); + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + if ( inputState.guessing==0 ) { + + preprocessorInfoChannel.addLineForTokenNumber(new LineObject(lineObject), new Integer(tokenNumber)); + countingTokens = oldCountingTokens; + + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mSpace(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Space; + int _saveIndex; + + { + switch ( LA(1)) { + case ' ': + { + match(' '); + break; + } + case '\t': + { + match('\t'); + break; + } + case '\u000c': + { + match('\014'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mNumber(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Number; + int _saveIndex; + + boolean synPredMatched352 = false; + if ((((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_9.member(LA(2))) && (true))) { + int _m352 = mark(); + synPredMatched352 = true; + inputState.guessing++; + try { + { + { + int _cnt350=0; + _loop350: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + if ( _cnt350>=1 ) { break _loop350; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt350++; + } while (true); + } + { + switch ( LA(1)) { + case '.': + { + match('.'); + break; + } + case 'e': + { + match('e'); + break; + } + case 'E': + { + match('E'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + } + catch (RecognitionException pe) { + synPredMatched352 = false; + } + rewind(_m352); + inputState.guessing--; + } + if ( synPredMatched352 ) { + { + int _cnt354=0; + _loop354: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + if ( _cnt354>=1 ) { break _loop354; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt354++; + } while (true); + } + { + switch ( LA(1)) { + case '.': + { + match('.'); + { + _loop357: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + break _loop357; + } + + } while (true); + } + { + if ((LA(1)=='E'||LA(1)=='e')) { + mExponent(false); + } + else { + } + + } + break; + } + case 'E': case 'e': + { + mExponent(false); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( inputState.guessing==0 ) { + _ttype = DoubleDoubleConst; + } + { + switch ( LA(1)) { + case 'F': case 'f': + { + mFloatSuffix(false); + if ( inputState.guessing==0 ) { + _ttype = FloatDoubleConst; + } + break; + } + case 'L': case 'l': + { + mLongSuffix(false); + if ( inputState.guessing==0 ) { + _ttype = LongDoubleConst; + } + break; + } + default: + { + } + } + } + } + else { + boolean synPredMatched361 = false; + if (((LA(1)=='.') && (LA(2)=='.'))) { + int _m361 = mark(); + synPredMatched361 = true; + inputState.guessing++; + try { + { + match("..."); + } + } + catch (RecognitionException pe) { + synPredMatched361 = false; + } + rewind(_m361); + inputState.guessing--; + } + if ( synPredMatched361 ) { + match("..."); + if ( inputState.guessing==0 ) { + _ttype = VARARGS; + } + } + else if ((LA(1)=='0') && (LA(2)=='X'||LA(2)=='x')) { + match('0'); + { + switch ( LA(1)) { + case 'x': + { + match('x'); + break; + } + case 'X': + { + match('X'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + int _cnt375=0; + _loop375: + do { + switch ( LA(1)) { + case 'a': case 'b': case 'c': case 'd': + case 'e': case 'f': + { + matchRange('a','f'); + break; + } + case 'A': case 'B': case 'C': case 'D': + case 'E': case 'F': + { + matchRange('A','F'); + break; + } + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + { + mDigit(false); + break; + } + default: + { + if ( _cnt375>=1 ) { break _loop375; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + } + _cnt375++; + } while (true); + } + if ( inputState.guessing==0 ) { + _ttype = IntHexConst; + } + { + switch ( LA(1)) { + case 'L': case 'l': + { + mLongSuffix(false); + if ( inputState.guessing==0 ) { + _ttype = LongHexConst; + } + break; + } + case 'U': case 'u': + { + mUnsignedSuffix(false); + if ( inputState.guessing==0 ) { + _ttype = UnsignedHexConst; + } + break; + } + default: + { + } + } + } + } + else if ((LA(1)=='.') && (true)) { + match('.'); + if ( inputState.guessing==0 ) { + _ttype = DOT; + } + { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + { + int _cnt364=0; + _loop364: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + if ( _cnt364>=1 ) { break _loop364; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt364++; + } while (true); + } + { + if ((LA(1)=='E'||LA(1)=='e')) { + mExponent(false); + } + else { + } + + } + if ( inputState.guessing==0 ) { + _ttype = DoubleDoubleConst; + } + { + switch ( LA(1)) { + case 'F': case 'f': + { + mFloatSuffix(false); + if ( inputState.guessing==0 ) { + _ttype = FloatDoubleConst; + } + break; + } + case 'L': case 'l': + { + mLongSuffix(false); + if ( inputState.guessing==0 ) { + _ttype = LongDoubleConst; + } + break; + } + default: + { + } + } + } + } + else { + } + + } + } + else if ((LA(1)=='0') && (true) && (true)) { + match('0'); + { + _loop368: + do { + if (((LA(1) >= '0' && LA(1) <= '7'))) { + matchRange('0','7'); + } + else { + break _loop368; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + _ttype = IntOctalConst; + } + { + switch ( LA(1)) { + case 'L': case 'l': + { + mLongSuffix(false); + if ( inputState.guessing==0 ) { + _ttype = LongOctalConst; + } + break; + } + case 'U': case 'u': + { + mUnsignedSuffix(false); + if ( inputState.guessing==0 ) { + _ttype = UnsignedOctalConst; + } + break; + } + default: + { + } + } + } + } + else if (((LA(1) >= '1' && LA(1) <= '9')) && (true) && (true)) { + matchRange('1','9'); + { + _loop371: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + break _loop371; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + _ttype = IntIntConst; + } + { + switch ( LA(1)) { + case 'L': case 'l': + { + mLongSuffix(false); + if ( inputState.guessing==0 ) { + _ttype = LongIntConst; + } + break; + } + case 'U': case 'u': + { + mUnsignedSuffix(false); + if ( inputState.guessing==0 ) { + _ttype = UnsignedIntConst; + } + break; + } + default: + { + } + } + } + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = StringLiteral; + int _saveIndex; + + match('"'); + { + _loop315: + do { + if ((LA(1)=='\\') && (_tokenSet_10.member(LA(2))) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { + mEscape(false); + } + else if ((LA(1)=='\n'||LA(1)=='\r'||LA(1)=='\\') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + { + switch ( LA(1)) { + case '\r': + { + match('\r'); + if ( inputState.guessing==0 ) { + deferredNewline(); + } + break; + } + case '\n': + { + match('\n'); + if ( inputState.guessing==0 ) { + + deferredNewline(); + _ttype = BadStringLiteral; + + } + break; + } + case '\\': + { + match('\\'); + match('\n'); + if ( inputState.guessing==0 ) { + + deferredNewline(); + + } + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + else if ((_tokenSet_11.member(LA(1)))) { + { + match(_tokenSet_11); + } + } + else { + break _loop315; + } + + } while (true); + } + match('"'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = ID; + int _saveIndex; + + { + switch ( LA(1)) { + case 'a': case 'b': case 'c': case 'd': + case 'e': case 'f': case 'g': case 'h': + case 'i': case 'j': case 'k': case 'l': + case 'm': case 'n': case 'o': case 'p': + case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': + case 'y': case 'z': + { + matchRange('a','z'); + break; + } + case 'A': case 'B': case 'C': case 'D': + case 'E': case 'F': case 'G': case 'H': + case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': + case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': + { + matchRange('A','Z'); + break; + } + case '_': + { + match('_'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + _loop380: + do { + if (((LA(1) >= 'a' && LA(1) <= 'z')) && (true) && (true)) { + matchRange('a','z'); + } + else if (((LA(1) >= 'A' && LA(1) <= 'Z')) && (true) && (true)) { + matchRange('A','Z'); + } + else if ((LA(1)=='_') && (true) && (true)) { + match('_'); + } + else if (((LA(1) >= '0' && LA(1) <= '9')) && (true) && (true)) { + matchRange('0','9'); + } + else { + break _loop380; + } + + } while (true); + } + _ttype = testLiteralsTable(_ttype); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCharLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = CharLiteral; + int _saveIndex; + + match('\''); + { + if ((LA(1)=='\\') && (_tokenSet_10.member(LA(2))) && (_tokenSet_12.member(LA(3)))) { + mEscape(false); + } + else if ((_tokenSet_13.member(LA(1))) && (LA(2)=='\'') && (true)) { + { + match(_tokenSet_13); + } + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + match('\''); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mEscape(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Escape; + int _saveIndex; + + match('\\'); + { + switch ( LA(1)) { + case 'a': + { + match('a'); + break; + } + case 'b': + { + match('b'); + break; + } + case 'f': + { + match('f'); + break; + } + case 'n': + { + match('n'); + break; + } + case 'r': + { + match('r'); + break; + } + case 't': + { + match('t'); + break; + } + case 'v': + { + match('v'); + break; + } + case '"': + { + match('"'); + break; + } + case '\'': + { + match('\''); + break; + } + case '\\': + { + match('\\'); + break; + } + case '?': + { + match('?'); + break; + } + case '0': case '1': case '2': case '3': + { + { + matchRange('0','3'); + } + { + if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mDigit(false); + { + if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mDigit(false); + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + break; + } + case '4': case '5': case '6': case '7': + { + { + matchRange('4','7'); + } + { + if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mDigit(false); + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + break; + } + case 'x': + { + match('x'); + { + int _cnt325=0; + _loop325: + do { + if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mDigit(false); + } + else if (((LA(1) >= 'a' && LA(1) <= 'f')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + matchRange('a','f'); + } + else if (((LA(1) >= 'A' && LA(1) <= 'F')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + matchRange('A','F'); + } + else { + if ( _cnt325>=1 ) { break _loop325; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt325++; + } while (true); + } + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mBadStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BadStringLiteral; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mDigit(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Digit; + int _saveIndex; + + matchRange('0','9'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLongSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LongSuffix; + int _saveIndex; + + switch ( LA(1)) { + case 'l': + { + match('l'); + break; + } + case 'L': + { + match('L'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mUnsignedSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = UnsignedSuffix; + int _saveIndex; + + switch ( LA(1)) { + case 'u': + { + match('u'); + break; + } + case 'U': + { + match('U'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mFloatSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = FloatSuffix; + int _saveIndex; + + switch ( LA(1)) { + case 'f': + { + match('f'); + break; + } + case 'F': + { + match('F'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mExponent(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Exponent; + int _saveIndex; + + { + switch ( LA(1)) { + case 'e': + { + match('e'); + break; + } + case 'E': + { + match('E'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + switch ( LA(1)) { + case '+': + { + match('+'); + break; + } + case '-': + { + match('-'); + break; + } + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + { + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + int _cnt334=0; + _loop334: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + if ( _cnt334>=1 ) { break _loop334; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt334++; + } while (true); + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mDoubleDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DoubleDoubleConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mFloatDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = FloatDoubleConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLongDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LongDoubleConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mIntOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = IntOctalConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLongOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LongOctalConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mUnsignedOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = UnsignedOctalConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mIntIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = IntIntConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLongIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LongIntConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mUnsignedIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = UnsignedIntConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mIntHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = IntHexConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLongHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LongHexConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mUnsignedHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = UnsignedHexConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + + private static final long[] mk_tokenSet_0() { + long[] data = new long[8]; + data[0]=8589934584L; + data[1]=-9223372036854775808L; + for (int i = 2; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); + private static final long[] mk_tokenSet_1() { + long[] data = new long[8]; + data[0]=8589925368L; + data[1]=-9223372036854775808L; + for (int i = 2; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); + private static final long[] mk_tokenSet_2() { + long[] data = new long[8]; + data[0]=-4398046520328L; + for (int i = 1; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); + private static final long[] mk_tokenSet_3() { + long[] data = new long[8]; + data[0]=-1032L; + for (int i = 1; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); + private static final long[] mk_tokenSet_4() { + long[] data = { 4294971904L, 17592186044416L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); + private static final long[] mk_tokenSet_5() { + long[] data = { 288019274214150656L, 2199023255552L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); + private static final long[] mk_tokenSet_6() { + long[] data = { 288019274214150656L, 81152891680722976L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6()); + private static final long[] mk_tokenSet_7() { + long[] data = { 0L, 576460745995190270L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7()); + private static final long[] mk_tokenSet_8() { + long[] data = new long[8]; + data[0]=-9224L; + for (int i = 1; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8()); + private static final long[] mk_tokenSet_9() { + long[] data = { 288019269919178752L, 137438953504L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9()); + private static final long[] mk_tokenSet_10() { + long[] data = { -9151595350857875456L, 95772161741946880L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10()); + private static final long[] mk_tokenSet_11() { + long[] data = new long[8]; + data[0]=-17179878408L; + data[1]=-268435457L; + for (int i = 2; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11()); + private static final long[] mk_tokenSet_12() { + long[] data = { 287949450930814976L, 541165879422L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); + private static final long[] mk_tokenSet_13() { + long[] data = new long[8]; + data[0]=-549755813896L; + for (int i = 1; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13()); + + } diff --git a/app/preproc/StdCParser.java b/app/preproc/StdCParser.java index e59277f88..ce313ad12 100644 --- a/app/preproc/StdCParser.java +++ b/app/preproc/StdCParser.java @@ -1,32 +1,32 @@ -// $ANTLR 2.7.2: "StdCParser.g" -> "StdCParser.java"$ +// $ANTLR 2.7.2: "StdCParser.g" -> "StdCParser.java"$ package processing.app.preproc; import java.io.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -import antlr.TokenBuffer; -import antlr.TokenStreamException; -import antlr.TokenStreamIOException; -import antlr.ANTLRException; -import antlr.LLkParser; -import antlr.Token; -import antlr.TokenStream; -import antlr.RecognitionException; -import antlr.NoViableAltException; -import antlr.MismatchedTokenException; -import antlr.SemanticException; -import antlr.ParserSharedInputState; -import antlr.collections.impl.BitSet; -import antlr.collections.AST; -import java.util.Hashtable; -import antlr.ASTFactory; -import antlr.ASTPair; -import antlr.collections.impl.ASTArray; - -public class StdCParser extends antlr.LLkParser implements STDCTokenTypes - { + +import antlr.TokenBuffer; +import antlr.TokenStreamException; +import antlr.TokenStreamIOException; +import antlr.ANTLRException; +import antlr.LLkParser; +import antlr.Token; +import antlr.TokenStream; +import antlr.RecognitionException; +import antlr.NoViableAltException; +import antlr.MismatchedTokenException; +import antlr.SemanticException; +import antlr.ParserSharedInputState; +import antlr.collections.impl.BitSet; +import antlr.collections.AST; +import java.util.Hashtable; +import antlr.ASTFactory; +import antlr.ASTPair; +import antlr.collections.impl.ASTArray; + +public class StdCParser extends antlr.LLkParser implements STDCTokenTypes + { // Suppport C++-style single-line comments? public static boolean CPPComments = true; @@ -133,5754 +133,5754 @@ public class StdCParser extends antlr.LLkParser implements STDCTokenTypes traceDepth -= 1; } - -protected StdCParser(TokenBuffer tokenBuf, int k) { - super(tokenBuf,k); - tokenNames = _tokenNames; - buildTokenTypeASTClassMap(); - astFactory = new ASTFactory(getTokenTypeToASTClassMap()); -} - -public StdCParser(TokenBuffer tokenBuf) { - this(tokenBuf,2); -} - -protected StdCParser(TokenStream lexer, int k) { - super(lexer,k); - tokenNames = _tokenNames; - buildTokenTypeASTClassMap(); - astFactory = new ASTFactory(getTokenTypeToASTClassMap()); -} - -public StdCParser(TokenStream lexer) { - this(lexer,2); -} - -public StdCParser(ParserSharedInputState state) { - super(state,2); - tokenNames = _tokenNames; - buildTokenTypeASTClassMap(); - astFactory = new ASTFactory(getTokenTypeToASTClassMap()); -} - - public final void translationUnit() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode translationUnit_AST = null; - - try { // for error handling - switch ( LA(1)) { - case LITERAL_typedef: - case LITERAL_asm: - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_auto: - case LITERAL_register: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case ID: - case STAR: - case LPAREN: - { - externalList(); - astFactory.addASTChild(currentAST, returnAST); - translationUnit_AST = (TNode)currentAST.root; - break; - } - case EOF: - { - if ( inputState.guessing==0 ) { - - System.err.println ( "Empty source file!" ); - - } - translationUnit_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_0); - } else { - throw ex; - } - } - returnAST = translationUnit_AST; - } - - public final void externalList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode externalList_AST = null; - - try { // for error handling - { - int _cnt4=0; - _loop4: - do { - if ((_tokenSet_1.member(LA(1)))) { - externalDef(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt4>=1 ) { break _loop4; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt4++; - } while (true); - } - externalList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_0); - } else { - throw ex; - } - } - returnAST = externalList_AST; - } - - public final void externalDef() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode externalDef_AST = null; - - try { // for error handling - boolean synPredMatched7 = false; - if (((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))))) { - int _m7 = mark(); - synPredMatched7 = true; - inputState.guessing++; - try { - { - if ((LA(1)==LITERAL_typedef) && (true)) { - match(LITERAL_typedef); - } - else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2)))) { - declaration(); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - } - catch (RecognitionException pe) { - synPredMatched7 = false; - } - rewind(_m7); - inputState.guessing--; - } - if ( synPredMatched7 ) { - declaration(); - astFactory.addASTChild(currentAST, returnAST); - externalDef_AST = (TNode)currentAST.root; - } - else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_5.member(LA(2)))) { - functionDef(); - astFactory.addASTChild(currentAST, returnAST); - externalDef_AST = (TNode)currentAST.root; - } - else if ((LA(1)==LITERAL_asm)) { - asm_expr(); - astFactory.addASTChild(currentAST, returnAST); - externalDef_AST = (TNode)currentAST.root; - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_6); - } else { - throw ex; - } - } - returnAST = externalDef_AST; - } - - public final void declaration() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declaration_AST = null; - TNode ds_AST = null; - AST ds1 = null; - - try { // for error handling - declSpecifiers(); - ds_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - ds1 = astFactory.dupList(ds_AST); - } - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - { - initDeclList(ds1); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - match(SEMI); - if ( inputState.guessing==0 ) { - declaration_AST = (TNode)currentAST.root; - declaration_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NDeclaration)).add(declaration_AST)); - currentAST.root = declaration_AST; - currentAST.child = declaration_AST!=null &&declaration_AST.getFirstChild()!=null ? - declaration_AST.getFirstChild() : declaration_AST; - currentAST.advanceChildToEnd(); - } - declaration_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_7); - } else { - throw ex; - } - } - returnAST = declaration_AST; - } - - public final void functionDef() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode functionDef_AST = null; - TNode ds_AST = null; - TNode d_AST = null; - String declName; - - try { // for error handling - { - boolean synPredMatched94 = false; - if (((_tokenSet_8.member(LA(1))) && (_tokenSet_9.member(LA(2))))) { - int _m94 = mark(); - synPredMatched94 = true; - inputState.guessing++; - try { - { - functionDeclSpecifiers(); - } - } - catch (RecognitionException pe) { - synPredMatched94 = false; - } - rewind(_m94); - inputState.guessing--; - } - if ( synPredMatched94 ) { - functionDeclSpecifiers(); - ds_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_10.member(LA(1))) && (_tokenSet_5.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - declName=declarator(true); - d_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - - AST d2, ds2; - d2 = astFactory.dupList(d_AST); - ds2 = astFactory.dupList(ds_AST); - symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds2).add(d2))); - pushScope(declName); - - } - { - _loop96: - do { - if ((_tokenSet_2.member(LA(1)))) { - declaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop96; - } - - } while (true); - } - { - switch ( LA(1)) { - case VARARGS: - { - TNode tmp2_AST = null; - tmp2_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp2_AST); - match(VARARGS); - break; - } - case LCURLY: - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - _loop99: - do { - if ((LA(1)==SEMI)) { - match(SEMI); - } - else { - break _loop99; - } - - } while (true); - } - if ( inputState.guessing==0 ) { - popScope(); - } - compoundStatement(declName); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - functionDef_AST = (TNode)currentAST.root; - functionDef_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NFunctionDef)).add(functionDef_AST)); - currentAST.root = functionDef_AST; - currentAST.child = functionDef_AST!=null &&functionDef_AST.getFirstChild()!=null ? - functionDef_AST.getFirstChild() : functionDef_AST; - currentAST.advanceChildToEnd(); - } - functionDef_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_6); - } else { - throw ex; - } - } - returnAST = functionDef_AST; - } - - public final void asm_expr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode asm_expr_AST = null; - - try { // for error handling - TNode tmp4_AST = null; - tmp4_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp4_AST); - match(LITERAL_asm); - { - switch ( LA(1)) { - case LITERAL_volatile: - { - TNode tmp5_AST = null; - tmp5_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp5_AST); - match(LITERAL_volatile); - break; - } - case LCURLY: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - match(LCURLY); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(RCURLY); - match(SEMI); - asm_expr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_6); - } else { - throw ex; - } - } - returnAST = asm_expr_AST; - } - - public final void expr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode expr_AST = null; - Token c = null; - TNode c_AST = null; - - try { // for error handling - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop129: - do { - if ((LA(1)==COMMA) && (_tokenSet_11.member(LA(2)))) { - c = LT(1); - c_AST = (TNode)astFactory.create(c); - astFactory.makeASTRoot(currentAST, c_AST); - match(COMMA); - if ( inputState.guessing==0 ) { - c_AST.setType(NCommaExpr); - } - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop129; - } - - } while (true); - } - expr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_12); - } else { - throw ex; - } - } - returnAST = expr_AST; - } - - public final void declSpecifiers() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declSpecifiers_AST = null; - TNode s_AST = null; - int specCount=0; - - try { // for error handling - { - int _cnt16=0; - _loop16: - do { - switch ( LA(1)) { - case LITERAL_typedef: - case LITERAL_auto: - case LITERAL_register: - case LITERAL_extern: - case LITERAL_static: - { - storageClassSpecifier(); - s_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_volatile: - case LITERAL_const: - { - typeQualifier(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - default: - boolean synPredMatched15 = false; - if (((_tokenSet_13.member(LA(1))) && (_tokenSet_14.member(LA(2))))) { - int _m15 = mark(); - synPredMatched15 = true; - inputState.guessing++; - try { - { - if ((LA(1)==LITERAL_struct) && (true)) { - match(LITERAL_struct); - } - else if ((LA(1)==LITERAL_union) && (true)) { - match(LITERAL_union); - } - else if ((LA(1)==LITERAL_enum) && (true)) { - match(LITERAL_enum); - } - else if ((_tokenSet_13.member(LA(1))) && (true)) { - typeSpecifier(specCount); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - } - catch (RecognitionException pe) { - synPredMatched15 = false; - } - rewind(_m15); - inputState.guessing--; - } - if ( synPredMatched15 ) { - specCount=typeSpecifier(specCount); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt16>=1 ) { break _loop16; } else {throw new NoViableAltException(LT(1), getFilename());} - } - } - _cnt16++; - } while (true); - } - declSpecifiers_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_15); - } else { - throw ex; - } - } - returnAST = declSpecifiers_AST; - } - - public final void initDeclList( - AST declarationSpecifiers - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode initDeclList_AST = null; - - try { // for error handling - initDecl(declarationSpecifiers); - astFactory.addASTChild(currentAST, returnAST); - { - _loop56: - do { - if ((LA(1)==COMMA)) { - match(COMMA); - initDecl(declarationSpecifiers); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop56; - } - - } while (true); - } - initDeclList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_16); - } else { - throw ex; - } - } - returnAST = initDeclList_AST; - } - - public final void storageClassSpecifier() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode storageClassSpecifier_AST = null; - - try { // for error handling - switch ( LA(1)) { - case LITERAL_auto: - { - TNode tmp10_AST = null; - tmp10_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp10_AST); - match(LITERAL_auto); - storageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_register: - { - TNode tmp11_AST = null; - tmp11_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp11_AST); - match(LITERAL_register); - storageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_typedef: - { - TNode tmp12_AST = null; - tmp12_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp12_AST); - match(LITERAL_typedef); - storageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_extern: - case LITERAL_static: - { - functionStorageClassSpecifier(); - astFactory.addASTChild(currentAST, returnAST); - storageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_17); - } else { - throw ex; - } - } - returnAST = storageClassSpecifier_AST; - } - - public final void typeQualifier() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode typeQualifier_AST = null; - - try { // for error handling - switch ( LA(1)) { - case LITERAL_const: - { - TNode tmp13_AST = null; - tmp13_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp13_AST); - match(LITERAL_const); - typeQualifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_volatile: - { - TNode tmp14_AST = null; - tmp14_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp14_AST); - match(LITERAL_volatile); - typeQualifier_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_18); - } else { - throw ex; - } - } - returnAST = typeQualifier_AST; - } - - public final int typeSpecifier( - int specCount - ) throws RecognitionException, TokenStreamException { - int retSpecCount; - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode typeSpecifier_AST = null; - retSpecCount = specCount + 1; - - try { // for error handling - { - switch ( LA(1)) { - case LITERAL_void: - { - TNode tmp15_AST = null; - tmp15_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp15_AST); - match(LITERAL_void); - break; - } - case LITERAL_char: - { - TNode tmp16_AST = null; - tmp16_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp16_AST); - match(LITERAL_char); - break; - } - case LITERAL_short: - { - TNode tmp17_AST = null; - tmp17_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp17_AST); - match(LITERAL_short); - break; - } - case LITERAL_int: - { - TNode tmp18_AST = null; - tmp18_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp18_AST); - match(LITERAL_int); - break; - } - case LITERAL_long: - { - TNode tmp19_AST = null; - tmp19_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp19_AST); - match(LITERAL_long); - break; - } - case LITERAL_float: - { - TNode tmp20_AST = null; - tmp20_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp20_AST); - match(LITERAL_float); - break; - } - case LITERAL_double: - { - TNode tmp21_AST = null; - tmp21_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp21_AST); - match(LITERAL_double); - break; - } - case LITERAL_signed: - { - TNode tmp22_AST = null; - tmp22_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp22_AST); - match(LITERAL_signed); - break; - } - case LITERAL_unsigned: - { - TNode tmp23_AST = null; - tmp23_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp23_AST); - match(LITERAL_unsigned); - break; - } - case LITERAL_struct: - case LITERAL_union: - { - structOrUnionSpecifier(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_enum: - { - enumSpecifier(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - default: - if (((LA(1)==ID))&&( specCount == 0 )) { - typedefName(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - typeSpecifier_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_18); - } else { - throw ex; - } - } - returnAST = typeSpecifier_AST; - return retSpecCount; - } - - public final void functionStorageClassSpecifier() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode functionStorageClassSpecifier_AST = null; - - try { // for error handling - switch ( LA(1)) { - case LITERAL_extern: - { - TNode tmp24_AST = null; - tmp24_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp24_AST); - match(LITERAL_extern); - functionStorageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_static: - { - TNode tmp25_AST = null; - tmp25_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp25_AST); - match(LITERAL_static); - functionStorageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_17); - } else { - throw ex; - } - } - returnAST = functionStorageClassSpecifier_AST; - } - - public final void structOrUnionSpecifier() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structOrUnionSpecifier_AST = null; - TNode sou_AST = null; - Token i = null; - TNode i_AST = null; - Token l = null; - TNode l_AST = null; - Token l1 = null; - TNode l1_AST = null; - String scopeName; - - try { // for error handling - structOrUnion(); - sou_AST = (TNode)returnAST; - { - boolean synPredMatched26 = false; - if (((LA(1)==ID) && (LA(2)==LCURLY))) { - int _m26 = mark(); - synPredMatched26 = true; - inputState.guessing++; - try { - { - match(ID); - match(LCURLY); - } - } - catch (RecognitionException pe) { - synPredMatched26 = false; - } - rewind(_m26); - inputState.guessing--; - } - if ( synPredMatched26 ) { - i = LT(1); - i_AST = (TNode)astFactory.create(i); - astFactory.addASTChild(currentAST, i_AST); - match(ID); - l = LT(1); - l_AST = (TNode)astFactory.create(l); - astFactory.addASTChild(currentAST, l_AST); - match(LCURLY); - if ( inputState.guessing==0 ) { - - scopeName = sou_AST.getText() + " " + i_AST.getText(); - l_AST.setText(scopeName); - pushScope(scopeName); - - } - structDeclarationList(); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - popScope(); - } - match(RCURLY); - } - else if ((LA(1)==LCURLY)) { - l1 = LT(1); - l1_AST = (TNode)astFactory.create(l1); - astFactory.addASTChild(currentAST, l1_AST); - match(LCURLY); - if ( inputState.guessing==0 ) { - - scopeName = getAScopeName(); - l1_AST.setText(scopeName); - pushScope(scopeName); - - } - structDeclarationList(); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - popScope(); - } - match(RCURLY); - } - else if ((LA(1)==ID) && (_tokenSet_18.member(LA(2)))) { - TNode tmp28_AST = null; - tmp28_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp28_AST); - match(ID); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - if ( inputState.guessing==0 ) { - structOrUnionSpecifier_AST = (TNode)currentAST.root; - - structOrUnionSpecifier_AST = (TNode)astFactory.make( (new ASTArray(2)).add(sou_AST).add(structOrUnionSpecifier_AST)); - - currentAST.root = structOrUnionSpecifier_AST; - currentAST.child = structOrUnionSpecifier_AST!=null &&structOrUnionSpecifier_AST.getFirstChild()!=null ? - structOrUnionSpecifier_AST.getFirstChild() : structOrUnionSpecifier_AST; - currentAST.advanceChildToEnd(); - } - structOrUnionSpecifier_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_18); - } else { - throw ex; - } - } - returnAST = structOrUnionSpecifier_AST; - } - - public final void enumSpecifier() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode enumSpecifier_AST = null; - Token i = null; - TNode i_AST = null; - - try { // for error handling - TNode tmp29_AST = null; - tmp29_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp29_AST); - match(LITERAL_enum); - { - boolean synPredMatched48 = false; - if (((LA(1)==ID) && (LA(2)==LCURLY))) { - int _m48 = mark(); - synPredMatched48 = true; - inputState.guessing++; - try { - { - match(ID); - match(LCURLY); - } - } - catch (RecognitionException pe) { - synPredMatched48 = false; - } - rewind(_m48); - inputState.guessing--; - } - if ( synPredMatched48 ) { - i = LT(1); - i_AST = (TNode)astFactory.create(i); - astFactory.addASTChild(currentAST, i_AST); - match(ID); - TNode tmp30_AST = null; - tmp30_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp30_AST); - match(LCURLY); - enumList(i.getText()); - astFactory.addASTChild(currentAST, returnAST); - match(RCURLY); - } - else if ((LA(1)==LCURLY)) { - TNode tmp32_AST = null; - tmp32_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp32_AST); - match(LCURLY); - enumList("anonymous"); - astFactory.addASTChild(currentAST, returnAST); - match(RCURLY); - } - else if ((LA(1)==ID) && (_tokenSet_18.member(LA(2)))) { - TNode tmp34_AST = null; - tmp34_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp34_AST); - match(ID); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - enumSpecifier_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_18); - } else { - throw ex; - } - } - returnAST = enumSpecifier_AST; - } - - public final void typedefName() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode typedefName_AST = null; - Token i = null; - TNode i_AST = null; - - try { // for error handling - if (!( isTypedefName ( LT(1).getText() ) )) - throw new SemanticException(" isTypedefName ( LT(1).getText() ) "); - i = LT(1); - i_AST = (TNode)astFactory.create(i); - astFactory.addASTChild(currentAST, i_AST); - match(ID); - if ( inputState.guessing==0 ) { - typedefName_AST = (TNode)currentAST.root; - typedefName_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NTypedefName)).add(i_AST)); - currentAST.root = typedefName_AST; - currentAST.child = typedefName_AST!=null &&typedefName_AST.getFirstChild()!=null ? - typedefName_AST.getFirstChild() : typedefName_AST; - currentAST.advanceChildToEnd(); - } - typedefName_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_18); - } else { - throw ex; - } - } - returnAST = typedefName_AST; - } - - public final void structOrUnion() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structOrUnion_AST = null; - - try { // for error handling - switch ( LA(1)) { - case LITERAL_struct: - { - TNode tmp35_AST = null; - tmp35_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp35_AST); - match(LITERAL_struct); - structOrUnion_AST = (TNode)currentAST.root; - break; - } - case LITERAL_union: - { - TNode tmp36_AST = null; - tmp36_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp36_AST); - match(LITERAL_union); - structOrUnion_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_19); - } else { - throw ex; - } - } - returnAST = structOrUnion_AST; - } - - public final void structDeclarationList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structDeclarationList_AST = null; - - try { // for error handling - { - int _cnt30=0; - _loop30: - do { - if ((_tokenSet_20.member(LA(1)))) { - structDeclaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt30>=1 ) { break _loop30; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt30++; - } while (true); - } - structDeclarationList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_21); - } else { - throw ex; - } - } - returnAST = structDeclarationList_AST; - } - - public final void structDeclaration() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structDeclaration_AST = null; - - try { // for error handling - specifierQualifierList(); - astFactory.addASTChild(currentAST, returnAST); - structDeclaratorList(); - astFactory.addASTChild(currentAST, returnAST); - { - int _cnt33=0; - _loop33: - do { - if ((LA(1)==SEMI)) { - match(SEMI); - } - else { - if ( _cnt33>=1 ) { break _loop33; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt33++; - } while (true); - } - structDeclaration_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_22); - } else { - throw ex; - } - } - returnAST = structDeclaration_AST; - } - - public final void specifierQualifierList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode specifierQualifierList_AST = null; - int specCount = 0; - - try { // for error handling - { - int _cnt38=0; - _loop38: - do { - boolean synPredMatched37 = false; - if (((_tokenSet_13.member(LA(1))) && (_tokenSet_23.member(LA(2))))) { - int _m37 = mark(); - synPredMatched37 = true; - inputState.guessing++; - try { - { - if ((LA(1)==LITERAL_struct) && (true)) { - match(LITERAL_struct); - } - else if ((LA(1)==LITERAL_union) && (true)) { - match(LITERAL_union); - } - else if ((LA(1)==LITERAL_enum) && (true)) { - match(LITERAL_enum); - } - else if ((_tokenSet_13.member(LA(1))) && (true)) { - typeSpecifier(specCount); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - } - catch (RecognitionException pe) { - synPredMatched37 = false; - } - rewind(_m37); - inputState.guessing--; - } - if ( synPredMatched37 ) { - specCount=typeSpecifier(specCount); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((LA(1)==LITERAL_volatile||LA(1)==LITERAL_const)) { - typeQualifier(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt38>=1 ) { break _loop38; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt38++; - } while (true); - } - specifierQualifierList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_24); - } else { - throw ex; - } - } - returnAST = specifierQualifierList_AST; - } - - public final void structDeclaratorList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structDeclaratorList_AST = null; - - try { // for error handling - structDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop41: - do { - if ((LA(1)==COMMA)) { - match(COMMA); - structDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop41; - } - - } while (true); - } - structDeclaratorList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_16); - } else { - throw ex; - } - } - returnAST = structDeclaratorList_AST; - } - - public final void structDeclarator() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structDeclarator_AST = null; - - try { // for error handling - { - switch ( LA(1)) { - case COLON: - { - TNode tmp39_AST = null; - tmp39_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp39_AST); - match(COLON); - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case ID: - case STAR: - case LPAREN: - { - declarator(false); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case COLON: - { - TNode tmp40_AST = null; - tmp40_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp40_AST); - match(COLON); - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case SEMI: - case COMMA: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - structDeclarator_AST = (TNode)currentAST.root; - structDeclarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStructDeclarator)).add(structDeclarator_AST)); - currentAST.root = structDeclarator_AST; - currentAST.child = structDeclarator_AST!=null &&structDeclarator_AST.getFirstChild()!=null ? - structDeclarator_AST.getFirstChild() : structDeclarator_AST; - currentAST.advanceChildToEnd(); - } - structDeclarator_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_25); - } else { - throw ex; - } - } - returnAST = structDeclarator_AST; - } - - public final void constExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode constExpr_AST = null; - - try { // for error handling - conditionalExpr(); - astFactory.addASTChild(currentAST, returnAST); - constExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_26); - } else { - throw ex; - } - } - returnAST = constExpr_AST; - } - - public final String declarator( - boolean isFunctionDefinition - ) throws RecognitionException, TokenStreamException { - String declName; - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declarator_AST = null; - Token id = null; - TNode id_AST = null; - TNode p_AST = null; - TNode i_AST = null; - declName = ""; - - try { // for error handling - { - switch ( LA(1)) { - case STAR: - { - pointerGroup(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case ID: - case LPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - switch ( LA(1)) { - case ID: - { - id = LT(1); - id_AST = (TNode)astFactory.create(id); - astFactory.addASTChild(currentAST, id_AST); - match(ID); - if ( inputState.guessing==0 ) { - declName = id.getText(); - } - break; - } - case LPAREN: - { - TNode tmp41_AST = null; - tmp41_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp41_AST); - match(LPAREN); - declName=declarator(false); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp42_AST = null; - tmp42_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp42_AST); - match(RPAREN); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - _loop82: - do { - switch ( LA(1)) { - case LPAREN: - { - TNode tmp43_AST = null; - tmp43_AST = (TNode)astFactory.create(LT(1)); - match(LPAREN); - if ( inputState.guessing==0 ) { - - if (isFunctionDefinition) { - pushScope(declName); - } - else { - pushScope("!"+declName); - } - - } - { - boolean synPredMatched79 = false; - if (((_tokenSet_2.member(LA(1))) && (_tokenSet_27.member(LA(2))))) { - int _m79 = mark(); - synPredMatched79 = true; - inputState.guessing++; - try { - { - declSpecifiers(); - } - } - catch (RecognitionException pe) { - synPredMatched79 = false; - } - rewind(_m79); - inputState.guessing--; - } - if ( synPredMatched79 ) { - parameterTypeList(); - p_AST = (TNode)returnAST; - if ( inputState.guessing==0 ) { - declarator_AST = (TNode)currentAST.root; - - declarator_AST = (TNode)astFactory.make( (new ASTArray(3)).add(null).add(declarator_AST).add((TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NParameterTypeList)).add(p_AST)))); - - currentAST.root = declarator_AST; - currentAST.child = declarator_AST!=null &&declarator_AST.getFirstChild()!=null ? - declarator_AST.getFirstChild() : declarator_AST; - currentAST.advanceChildToEnd(); - } - } - else if ((LA(1)==ID||LA(1)==RPAREN) && (_tokenSet_28.member(LA(2)))) { - { - switch ( LA(1)) { - case ID: - { - idList(); - i_AST = (TNode)returnAST; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - declarator_AST = (TNode)currentAST.root; - - declarator_AST = (TNode)astFactory.make( (new ASTArray(3)).add(null).add(declarator_AST).add((TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NParameterTypeList)).add(i_AST)))); - - currentAST.root = declarator_AST; - currentAST.child = declarator_AST!=null &&declarator_AST.getFirstChild()!=null ? - declarator_AST.getFirstChild() : declarator_AST; - currentAST.advanceChildToEnd(); - } - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - if ( inputState.guessing==0 ) { - - popScope(); - - } - TNode tmp44_AST = null; - tmp44_AST = (TNode)astFactory.create(LT(1)); - match(RPAREN); - break; - } - case LBRACKET: - { - TNode tmp45_AST = null; - tmp45_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp45_AST); - match(LBRACKET); - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp46_AST = null; - tmp46_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp46_AST); - match(RBRACKET); - break; - } - default: - { - break _loop82; - } - } - } while (true); - } - if ( inputState.guessing==0 ) { - declarator_AST = (TNode)currentAST.root; - declarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NDeclarator)).add(declarator_AST)); - currentAST.root = declarator_AST; - currentAST.child = declarator_AST!=null &&declarator_AST.getFirstChild()!=null ? - declarator_AST.getFirstChild() : declarator_AST; - currentAST.advanceChildToEnd(); - } - declarator_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_29); - } else { - throw ex; - } - } - returnAST = declarator_AST; - return declName; - } - - public final void enumList( - String enumName - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode enumList_AST = null; - - try { // for error handling - enumerator(enumName); - astFactory.addASTChild(currentAST, returnAST); - { - _loop51: - do { - if ((LA(1)==COMMA)) { - match(COMMA); - enumerator(enumName); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop51; - } - - } while (true); - } - enumList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_21); - } else { - throw ex; - } - } - returnAST = enumList_AST; - } - - public final void enumerator( - String enumName - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode enumerator_AST = null; - Token i = null; - TNode i_AST = null; - - try { // for error handling - i = LT(1); - i_AST = (TNode)astFactory.create(i); - astFactory.addASTChild(currentAST, i_AST); - match(ID); - if ( inputState.guessing==0 ) { - symbolTable.add( i.getText(), - (TNode)astFactory.make( (new ASTArray(3)).add(null).add((TNode)astFactory.create(LITERAL_enum,"enum")).add((TNode)astFactory.create(ID,enumName))) - ); - - } - { - switch ( LA(1)) { - case ASSIGN: - { - TNode tmp48_AST = null; - tmp48_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp48_AST); - match(ASSIGN); - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RCURLY: - case COMMA: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - enumerator_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_30); - } else { - throw ex; - } - } - returnAST = enumerator_AST; - } - - public final void initDecl( - AST declarationSpecifiers - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode initDecl_AST = null; - TNode d_AST = null; - String declName = ""; - - try { // for error handling - declName=declarator(false); - d_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - AST ds1, d1; - ds1 = astFactory.dupList(declarationSpecifiers); - d1 = astFactory.dupList(d_AST); - symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds1).add(d1)) ); - - } - { - switch ( LA(1)) { - case ASSIGN: - { - TNode tmp49_AST = null; - tmp49_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp49_AST); - match(ASSIGN); - initializer(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case COLON: - { - TNode tmp50_AST = null; - tmp50_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp50_AST); - match(COLON); - expr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case SEMI: - case COMMA: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - initDecl_AST = (TNode)currentAST.root; - initDecl_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NInitDecl)).add(initDecl_AST)); - currentAST.root = initDecl_AST; - currentAST.child = initDecl_AST!=null &&initDecl_AST.getFirstChild()!=null ? - initDecl_AST.getFirstChild() : initDecl_AST; - currentAST.advanceChildToEnd(); - } - initDecl_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_25); - } else { - throw ex; - } - } - returnAST = initDecl_AST; - } - - public final void initializer() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode initializer_AST = null; - - try { // for error handling - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LCURLY: - { - TNode tmp51_AST = null; - tmp51_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp51_AST); - match(LCURLY); - initializerList(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case COMMA: - { - match(COMMA); - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - match(RCURLY); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - initializer_AST = (TNode)currentAST.root; - initializer_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NInitializer)).add(initializer_AST)); - currentAST.root = initializer_AST; - currentAST.child = initializer_AST!=null &&initializer_AST.getFirstChild()!=null ? - initializer_AST.getFirstChild() : initializer_AST; - currentAST.advanceChildToEnd(); - } - initializer_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_31); - } else { - throw ex; - } - } - returnAST = initializer_AST; - } - - public final void pointerGroup() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode pointerGroup_AST = null; - - try { // for error handling - { - int _cnt63=0; - _loop63: - do { - if ((LA(1)==STAR)) { - TNode tmp54_AST = null; - tmp54_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp54_AST); - match(STAR); - { - _loop62: - do { - if ((LA(1)==LITERAL_volatile||LA(1)==LITERAL_const)) { - typeQualifier(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop62; - } - - } while (true); - } - } - else { - if ( _cnt63>=1 ) { break _loop63; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt63++; - } while (true); - } - if ( inputState.guessing==0 ) { - pointerGroup_AST = (TNode)currentAST.root; - pointerGroup_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NPointerGroup)).add(pointerGroup_AST)); - currentAST.root = pointerGroup_AST; - currentAST.child = pointerGroup_AST!=null &&pointerGroup_AST.getFirstChild()!=null ? - pointerGroup_AST.getFirstChild() : pointerGroup_AST; - currentAST.advanceChildToEnd(); - } - pointerGroup_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_32); - } else { - throw ex; - } - } - returnAST = pointerGroup_AST; - } - - public final void idList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode idList_AST = null; - - try { // for error handling - TNode tmp55_AST = null; - tmp55_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp55_AST); - match(ID); - { - _loop66: - do { - if ((LA(1)==COMMA)) { - match(COMMA); - TNode tmp57_AST = null; - tmp57_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp57_AST); - match(ID); - } - else { - break _loop66; - } - - } while (true); - } - idList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_33); - } else { - throw ex; - } - } - returnAST = idList_AST; - } - - public final void assignExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode assignExpr_AST = null; - TNode a_AST = null; - - try { // for error handling - conditionalExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case ASSIGN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - { - assignOperator(); - a_AST = (TNode)returnAST; - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - assignExpr_AST = (TNode)currentAST.root; - assignExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add(a_AST).add(assignExpr_AST)); - currentAST.root = assignExpr_AST; - currentAST.child = assignExpr_AST!=null &&assignExpr_AST.getFirstChild()!=null ? - assignExpr_AST.getFirstChild() : assignExpr_AST; - currentAST.advanceChildToEnd(); - } - break; - } - case RCURLY: - case SEMI: - case COMMA: - case COLON: - case RPAREN: - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - assignExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_12); - } else { - throw ex; - } - } - returnAST = assignExpr_AST; - } - - public final void initializerList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode initializerList_AST = null; - - try { // for error handling - initializer(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop72: - do { - if ((LA(1)==COMMA) && (_tokenSet_34.member(LA(2)))) { - match(COMMA); - initializer(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop72; - } - - } while (true); - } - initializerList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_30); - } else { - throw ex; - } - } - returnAST = initializerList_AST; - } - - public final void parameterTypeList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode parameterTypeList_AST = null; - - try { // for error handling - parameterDeclaration(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop85: - do { - if ((LA(1)==COMMA) && (_tokenSet_2.member(LA(2)))) { - match(COMMA); - parameterDeclaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop85; - } - - } while (true); - } - { - switch ( LA(1)) { - case COMMA: - { - match(COMMA); - TNode tmp61_AST = null; - tmp61_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp61_AST); - match(VARARGS); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - parameterTypeList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_33); - } else { - throw ex; - } - } - returnAST = parameterTypeList_AST; - } - - public final void parameterDeclaration() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode parameterDeclaration_AST = null; - TNode ds_AST = null; - TNode d_AST = null; - String declName; - - try { // for error handling - declSpecifiers(); - ds_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - { - boolean synPredMatched90 = false; - if (((_tokenSet_10.member(LA(1))) && (_tokenSet_35.member(LA(2))))) { - int _m90 = mark(); - synPredMatched90 = true; - inputState.guessing++; - try { - { - declarator(false); - } - } - catch (RecognitionException pe) { - synPredMatched90 = false; - } - rewind(_m90); - inputState.guessing--; - } - if ( synPredMatched90 ) { - declName=declarator(false); - d_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - - AST d2, ds2; - d2 = astFactory.dupList(d_AST); - ds2 = astFactory.dupList(ds_AST); - symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds2).add(d2))); - - } - } - else if ((_tokenSet_36.member(LA(1))) && (_tokenSet_37.member(LA(2)))) { - nonemptyAbstractDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((LA(1)==COMMA||LA(1)==RPAREN)) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - if ( inputState.guessing==0 ) { - parameterDeclaration_AST = (TNode)currentAST.root; - - parameterDeclaration_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NParameterDeclaration)).add(parameterDeclaration_AST)); - - currentAST.root = parameterDeclaration_AST; - currentAST.child = parameterDeclaration_AST!=null &¶meterDeclaration_AST.getFirstChild()!=null ? - parameterDeclaration_AST.getFirstChild() : parameterDeclaration_AST; - currentAST.advanceChildToEnd(); - } - parameterDeclaration_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_38); - } else { - throw ex; - } - } - returnAST = parameterDeclaration_AST; - } - - public final void nonemptyAbstractDeclarator() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode nonemptyAbstractDeclarator_AST = null; - - try { // for error handling - { - switch ( LA(1)) { - case STAR: - { - pointerGroup(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop184: - do { - switch ( LA(1)) { - case LPAREN: - { - { - TNode tmp62_AST = null; - tmp62_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp62_AST); - match(LPAREN); - { - switch ( LA(1)) { - case STAR: - case LPAREN: - case LBRACKET: - { - nonemptyAbstractDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_typedef: - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_auto: - case LITERAL_register: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case ID: - { - parameterTypeList(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp63_AST = null; - tmp63_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp63_AST); - match(RPAREN); - } - break; - } - case LBRACKET: - { - { - TNode tmp64_AST = null; - tmp64_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp64_AST); - match(LBRACKET); - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - expr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp65_AST = null; - tmp65_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp65_AST); - match(RBRACKET); - } - break; - } - default: - { - break _loop184; - } - } - } while (true); - } - break; - } - case LPAREN: - case LBRACKET: - { - { - int _cnt190=0; - _loop190: - do { - switch ( LA(1)) { - case LPAREN: - { - { - TNode tmp66_AST = null; - tmp66_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp66_AST); - match(LPAREN); - { - switch ( LA(1)) { - case STAR: - case LPAREN: - case LBRACKET: - { - nonemptyAbstractDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_typedef: - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_auto: - case LITERAL_register: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case ID: - { - parameterTypeList(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp67_AST = null; - tmp67_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp67_AST); - match(RPAREN); - } - break; - } - case LBRACKET: - { - { - TNode tmp68_AST = null; - tmp68_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp68_AST); - match(LBRACKET); - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - expr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp69_AST = null; - tmp69_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp69_AST); - match(RBRACKET); - } - break; - } - default: - { - if ( _cnt190>=1 ) { break _loop190; } else {throw new NoViableAltException(LT(1), getFilename());} - } - } - _cnt190++; - } while (true); - } - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - nonemptyAbstractDeclarator_AST = (TNode)currentAST.root; - nonemptyAbstractDeclarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NNonemptyAbstractDeclarator)).add(nonemptyAbstractDeclarator_AST)); - currentAST.root = nonemptyAbstractDeclarator_AST; - currentAST.child = nonemptyAbstractDeclarator_AST!=null &&nonemptyAbstractDeclarator_AST.getFirstChild()!=null ? - nonemptyAbstractDeclarator_AST.getFirstChild() : nonemptyAbstractDeclarator_AST; - currentAST.advanceChildToEnd(); - } - nonemptyAbstractDeclarator_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_38); - } else { - throw ex; - } - } - returnAST = nonemptyAbstractDeclarator_AST; - } - - public final void functionDeclSpecifiers() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode functionDeclSpecifiers_AST = null; - int specCount = 0; - - try { // for error handling - { - int _cnt104=0; - _loop104: - do { - switch ( LA(1)) { - case LITERAL_extern: - case LITERAL_static: - { - functionStorageClassSpecifier(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_volatile: - case LITERAL_const: - { - typeQualifier(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - default: - boolean synPredMatched103 = false; - if (((_tokenSet_13.member(LA(1))) && (_tokenSet_9.member(LA(2))))) { - int _m103 = mark(); - synPredMatched103 = true; - inputState.guessing++; - try { - { - if ((LA(1)==LITERAL_struct) && (true)) { - match(LITERAL_struct); - } - else if ((LA(1)==LITERAL_union) && (true)) { - match(LITERAL_union); - } - else if ((LA(1)==LITERAL_enum) && (true)) { - match(LITERAL_enum); - } - else if ((_tokenSet_13.member(LA(1))) && (true)) { - typeSpecifier(specCount); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - } - catch (RecognitionException pe) { - synPredMatched103 = false; - } - rewind(_m103); - inputState.guessing--; - } - if ( synPredMatched103 ) { - specCount=typeSpecifier(specCount); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt104>=1 ) { break _loop104; } else {throw new NoViableAltException(LT(1), getFilename());} - } - } - _cnt104++; - } while (true); - } - functionDeclSpecifiers_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_10); - } else { - throw ex; - } - } - returnAST = functionDeclSpecifiers_AST; - } - - public final void compoundStatement( - String scopeName - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode compoundStatement_AST = null; - - try { // for error handling - match(LCURLY); - if ( inputState.guessing==0 ) { - - pushScope(scopeName); - - } - { - boolean synPredMatched115 = false; - if (((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))))) { - int _m115 = mark(); - synPredMatched115 = true; - inputState.guessing++; - try { - { - declarationPredictor(); - } - } - catch (RecognitionException pe) { - synPredMatched115 = false; - } - rewind(_m115); - inputState.guessing--; - } - if ( synPredMatched115 ) { - declarationList(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_39.member(LA(1))) && (_tokenSet_40.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - { - switch ( LA(1)) { - case LCURLY: - case SEMI: - case ID: - case STAR: - case LPAREN: - case LITERAL_while: - case LITERAL_do: - case LITERAL_for: - case LITERAL_goto: - case LITERAL_continue: - case LITERAL_break: - case LITERAL_return: - case LITERAL_case: - case LITERAL_default: - case LITERAL_if: - case LITERAL_switch: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - statementList(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - popScope(); - } - match(RCURLY); - if ( inputState.guessing==0 ) { - compoundStatement_AST = (TNode)currentAST.root; - compoundStatement_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NCompoundStatement,scopeName)).add(compoundStatement_AST)); - currentAST.root = compoundStatement_AST; - currentAST.child = compoundStatement_AST!=null &&compoundStatement_AST.getFirstChild()!=null ? - compoundStatement_AST.getFirstChild() : compoundStatement_AST; - currentAST.advanceChildToEnd(); - } - compoundStatement_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_41); - } else { - throw ex; - } - } - returnAST = compoundStatement_AST; - } - - public final void declarationList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declarationList_AST = null; - - try { // for error handling - { - int _cnt109=0; - _loop109: - do { - boolean synPredMatched108 = false; - if (((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))))) { - int _m108 = mark(); - synPredMatched108 = true; - inputState.guessing++; - try { - { - declarationPredictor(); - } - } - catch (RecognitionException pe) { - synPredMatched108 = false; - } - rewind(_m108); - inputState.guessing--; - } - if ( synPredMatched108 ) { - declaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt109>=1 ) { break _loop109; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt109++; - } while (true); - } - declarationList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_39); - } else { - throw ex; - } - } - returnAST = declarationList_AST; - } - - public final void declarationPredictor() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declarationPredictor_AST = null; - - try { // for error handling - { - if ((LA(1)==LITERAL_typedef) && (LA(2)==EOF)) { - TNode tmp72_AST = null; - tmp72_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp72_AST); - match(LITERAL_typedef); - } - else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2)))) { - declaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - declarationPredictor_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_0); - } else { - throw ex; - } - } - returnAST = declarationPredictor_AST; - } - - public final void statementList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode statementList_AST = null; - - try { // for error handling - { - int _cnt119=0; - _loop119: - do { - if ((_tokenSet_42.member(LA(1)))) { - statement(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt119>=1 ) { break _loop119; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt119++; - } while (true); - } - statementList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_21); - } else { - throw ex; - } - } - returnAST = statementList_AST; - } - - public final void statement() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode statement_AST = null; - TNode e1_AST = null; - TNode e2_AST = null; - TNode e3_AST = null; - TNode s_AST = null; - - try { // for error handling - switch ( LA(1)) { - case SEMI: - { - TNode tmp73_AST = null; - tmp73_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp73_AST); - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LCURLY: - { - compoundStatement(getAScopeName()); - astFactory.addASTChild(currentAST, returnAST); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_while: - { - TNode tmp74_AST = null; - tmp74_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp74_AST); - match(LITERAL_while); - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(RPAREN); - statement(); - astFactory.addASTChild(currentAST, returnAST); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_do: - { - TNode tmp77_AST = null; - tmp77_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp77_AST); - match(LITERAL_do); - statement(); - astFactory.addASTChild(currentAST, returnAST); - match(LITERAL_while); - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(RPAREN); - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_for: - { - match(LITERAL_for); - TNode tmp83_AST = null; - tmp83_AST = (TNode)astFactory.create(LT(1)); - match(LPAREN); - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - expr(); - e1_AST = (TNode)returnAST; - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp84_AST = null; - tmp84_AST = (TNode)astFactory.create(LT(1)); - match(SEMI); - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - expr(); - e2_AST = (TNode)returnAST; - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp85_AST = null; - tmp85_AST = (TNode)astFactory.create(LT(1)); - match(SEMI); - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - expr(); - e3_AST = (TNode)returnAST; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp86_AST = null; - tmp86_AST = (TNode)astFactory.create(LT(1)); - match(RPAREN); - statement(); - s_AST = (TNode)returnAST; - if ( inputState.guessing==0 ) { - statement_AST = (TNode)currentAST.root; - - if ( e1_AST == null) { e1_AST = (TNode)astFactory.create(NEmptyExpression); } - if ( e2_AST == null) { e2_AST = (TNode)astFactory.create(NEmptyExpression); } - if ( e3_AST == null) { e3_AST = (TNode)astFactory.create(NEmptyExpression); } - statement_AST = (TNode)astFactory.make( (new ASTArray(5)).add((TNode)astFactory.create(LITERAL_for,"for")).add(e1_AST).add(e2_AST).add(e3_AST).add(s_AST)); - - currentAST.root = statement_AST; - currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? - statement_AST.getFirstChild() : statement_AST; - currentAST.advanceChildToEnd(); - } - break; - } - case LITERAL_goto: - { - TNode tmp87_AST = null; - tmp87_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp87_AST); - match(LITERAL_goto); - TNode tmp88_AST = null; - tmp88_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp88_AST); - match(ID); - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_continue: - { - TNode tmp90_AST = null; - tmp90_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp90_AST); - match(LITERAL_continue); - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_break: - { - TNode tmp92_AST = null; - tmp92_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp92_AST); - match(LITERAL_break); - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_return: - { - TNode tmp94_AST = null; - tmp94_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp94_AST); - match(LITERAL_return); - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - expr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_case: - { - TNode tmp96_AST = null; - tmp96_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp96_AST); - match(LITERAL_case); - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - match(COLON); - statement(); - astFactory.addASTChild(currentAST, returnAST); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_default: - { - TNode tmp98_AST = null; - tmp98_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp98_AST); - match(LITERAL_default); - match(COLON); - statement(); - astFactory.addASTChild(currentAST, returnAST); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_if: - { - TNode tmp100_AST = null; - tmp100_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp100_AST); - match(LITERAL_if); - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(RPAREN); - statement(); - astFactory.addASTChild(currentAST, returnAST); - { - if ((LA(1)==LITERAL_else) && (_tokenSet_42.member(LA(2)))) { - TNode tmp103_AST = null; - tmp103_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp103_AST); - match(LITERAL_else); - statement(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_40.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_switch: - { - TNode tmp104_AST = null; - tmp104_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp104_AST); - match(LITERAL_switch); - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(RPAREN); - statement(); - astFactory.addASTChild(currentAST, returnAST); - statement_AST = (TNode)currentAST.root; - break; - } - default: - if ((_tokenSet_11.member(LA(1))) && (_tokenSet_44.member(LA(2)))) { - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(SEMI); - if ( inputState.guessing==0 ) { - statement_AST = (TNode)currentAST.root; - statement_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStatementExpr)).add(statement_AST)); - currentAST.root = statement_AST; - currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? - statement_AST.getFirstChild() : statement_AST; - currentAST.advanceChildToEnd(); - } - statement_AST = (TNode)currentAST.root; - } - else if ((LA(1)==ID) && (LA(2)==COLON)) { - TNode tmp108_AST = null; - tmp108_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp108_AST); - match(ID); - match(COLON); - { - if ((_tokenSet_42.member(LA(1))) && (_tokenSet_45.member(LA(2)))) { - statement(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_40.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - if ( inputState.guessing==0 ) { - statement_AST = (TNode)currentAST.root; - statement_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NLabel)).add(statement_AST)); - currentAST.root = statement_AST; - currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? - statement_AST.getFirstChild() : statement_AST; - currentAST.advanceChildToEnd(); - } - statement_AST = (TNode)currentAST.root; - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_43); - } else { - throw ex; - } - } - returnAST = statement_AST; - } - - public final void conditionalExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode conditionalExpr_AST = null; - - try { // for error handling - logicalOrExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case QUESTION: - { - TNode tmp110_AST = null; - tmp110_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp110_AST); - match(QUESTION); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(COLON); - conditionalExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RCURLY: - case SEMI: - case COMMA: - case COLON: - case ASSIGN: - case RPAREN: - case RBRACKET: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - conditionalExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_46); - } else { - throw ex; - } - } - returnAST = conditionalExpr_AST; - } - - public final void assignOperator() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode assignOperator_AST = null; - - try { // for error handling - switch ( LA(1)) { - case ASSIGN: - { - TNode tmp112_AST = null; - tmp112_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp112_AST); - match(ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case DIV_ASSIGN: - { - TNode tmp113_AST = null; - tmp113_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp113_AST); - match(DIV_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case PLUS_ASSIGN: - { - TNode tmp114_AST = null; - tmp114_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp114_AST); - match(PLUS_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case MINUS_ASSIGN: - { - TNode tmp115_AST = null; - tmp115_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp115_AST); - match(MINUS_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case STAR_ASSIGN: - { - TNode tmp116_AST = null; - tmp116_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp116_AST); - match(STAR_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case MOD_ASSIGN: - { - TNode tmp117_AST = null; - tmp117_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp117_AST); - match(MOD_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case RSHIFT_ASSIGN: - { - TNode tmp118_AST = null; - tmp118_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp118_AST); - match(RSHIFT_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case LSHIFT_ASSIGN: - { - TNode tmp119_AST = null; - tmp119_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp119_AST); - match(LSHIFT_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case BAND_ASSIGN: - { - TNode tmp120_AST = null; - tmp120_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp120_AST); - match(BAND_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case BOR_ASSIGN: - { - TNode tmp121_AST = null; - tmp121_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp121_AST); - match(BOR_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case BXOR_ASSIGN: - { - TNode tmp122_AST = null; - tmp122_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp122_AST); - match(BXOR_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_11); - } else { - throw ex; - } - } - returnAST = assignOperator_AST; - } - - public final void logicalOrExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode logicalOrExpr_AST = null; - - try { // for error handling - logicalAndExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop138: - do { - if ((LA(1)==LOR)) { - TNode tmp123_AST = null; - tmp123_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp123_AST); - match(LOR); - logicalAndExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop138; - } - - } while (true); - } - logicalOrExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_47); - } else { - throw ex; - } - } - returnAST = logicalOrExpr_AST; - } - - public final void logicalAndExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode logicalAndExpr_AST = null; - - try { // for error handling - inclusiveOrExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop141: - do { - if ((LA(1)==LAND)) { - TNode tmp124_AST = null; - tmp124_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp124_AST); - match(LAND); - inclusiveOrExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop141; - } - - } while (true); - } - logicalAndExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_48); - } else { - throw ex; - } - } - returnAST = logicalAndExpr_AST; - } - - public final void inclusiveOrExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode inclusiveOrExpr_AST = null; - - try { // for error handling - exclusiveOrExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop144: - do { - if ((LA(1)==BOR)) { - TNode tmp125_AST = null; - tmp125_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp125_AST); - match(BOR); - exclusiveOrExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop144; - } - - } while (true); - } - inclusiveOrExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_49); - } else { - throw ex; - } - } - returnAST = inclusiveOrExpr_AST; - } - - public final void exclusiveOrExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode exclusiveOrExpr_AST = null; - - try { // for error handling - bitAndExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop147: - do { - if ((LA(1)==BXOR)) { - TNode tmp126_AST = null; - tmp126_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp126_AST); - match(BXOR); - bitAndExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop147; - } - - } while (true); - } - exclusiveOrExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_50); - } else { - throw ex; - } - } - returnAST = exclusiveOrExpr_AST; - } - - public final void bitAndExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode bitAndExpr_AST = null; - - try { // for error handling - equalityExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop150: - do { - if ((LA(1)==BAND)) { - TNode tmp127_AST = null; - tmp127_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp127_AST); - match(BAND); - equalityExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop150; - } - - } while (true); - } - bitAndExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_51); - } else { - throw ex; - } - } - returnAST = bitAndExpr_AST; - } - - public final void equalityExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode equalityExpr_AST = null; - - try { // for error handling - relationalExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop154: - do { - if ((LA(1)==EQUAL||LA(1)==NOT_EQUAL)) { - { - switch ( LA(1)) { - case EQUAL: - { - TNode tmp128_AST = null; - tmp128_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp128_AST); - match(EQUAL); - break; - } - case NOT_EQUAL: - { - TNode tmp129_AST = null; - tmp129_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp129_AST); - match(NOT_EQUAL); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - relationalExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop154; - } - - } while (true); - } - equalityExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_52); - } else { - throw ex; - } - } - returnAST = equalityExpr_AST; - } - - public final void relationalExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode relationalExpr_AST = null; - - try { // for error handling - shiftExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop158: - do { - if (((LA(1) >= LT && LA(1) <= GTE))) { - { - switch ( LA(1)) { - case LT: - { - TNode tmp130_AST = null; - tmp130_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp130_AST); - match(LT); - break; - } - case LTE: - { - TNode tmp131_AST = null; - tmp131_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp131_AST); - match(LTE); - break; - } - case GT: - { - TNode tmp132_AST = null; - tmp132_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp132_AST); - match(GT); - break; - } - case GTE: - { - TNode tmp133_AST = null; - tmp133_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp133_AST); - match(GTE); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - shiftExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop158; - } - - } while (true); - } - relationalExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_53); - } else { - throw ex; - } - } - returnAST = relationalExpr_AST; - } - - public final void shiftExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode shiftExpr_AST = null; - - try { // for error handling - additiveExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop162: - do { - if ((LA(1)==LSHIFT||LA(1)==RSHIFT)) { - { - switch ( LA(1)) { - case LSHIFT: - { - TNode tmp134_AST = null; - tmp134_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp134_AST); - match(LSHIFT); - break; - } - case RSHIFT: - { - TNode tmp135_AST = null; - tmp135_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp135_AST); - match(RSHIFT); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - additiveExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop162; - } - - } while (true); - } - shiftExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_54); - } else { - throw ex; - } - } - returnAST = shiftExpr_AST; - } - - public final void additiveExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode additiveExpr_AST = null; - - try { // for error handling - multExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop166: - do { - if ((LA(1)==PLUS||LA(1)==MINUS)) { - { - switch ( LA(1)) { - case PLUS: - { - TNode tmp136_AST = null; - tmp136_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp136_AST); - match(PLUS); - break; - } - case MINUS: - { - TNode tmp137_AST = null; - tmp137_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp137_AST); - match(MINUS); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - multExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop166; - } - - } while (true); - } - additiveExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_55); - } else { - throw ex; - } - } - returnAST = additiveExpr_AST; - } - - public final void multExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode multExpr_AST = null; - - try { // for error handling - castExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop170: - do { - if ((_tokenSet_56.member(LA(1)))) { - { - switch ( LA(1)) { - case STAR: - { - TNode tmp138_AST = null; - tmp138_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp138_AST); - match(STAR); - break; - } - case DIV: - { - TNode tmp139_AST = null; - tmp139_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp139_AST); - match(DIV); - break; - } - case MOD: - { - TNode tmp140_AST = null; - tmp140_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp140_AST); - match(MOD); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - castExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop170; - } - - } while (true); - } - multExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_57); - } else { - throw ex; - } - } - returnAST = multExpr_AST; - } - - public final void castExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode castExpr_AST = null; - - try { // for error handling - boolean synPredMatched173 = false; - if (((LA(1)==LPAREN) && (_tokenSet_20.member(LA(2))))) { - int _m173 = mark(); - synPredMatched173 = true; - inputState.guessing++; - try { - { - match(LPAREN); - typeName(); - match(RPAREN); - } - } - catch (RecognitionException pe) { - synPredMatched173 = false; - } - rewind(_m173); - inputState.guessing--; - } - if ( synPredMatched173 ) { - match(LPAREN); - typeName(); - astFactory.addASTChild(currentAST, returnAST); - match(RPAREN); - { - castExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - if ( inputState.guessing==0 ) { - castExpr_AST = (TNode)currentAST.root; - castExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NCast,"(")).add(castExpr_AST)); - currentAST.root = castExpr_AST; - currentAST.child = castExpr_AST!=null &&castExpr_AST.getFirstChild()!=null ? - castExpr_AST.getFirstChild() : castExpr_AST; - currentAST.advanceChildToEnd(); - } - castExpr_AST = (TNode)currentAST.root; - } - else if ((_tokenSet_11.member(LA(1))) && (_tokenSet_58.member(LA(2)))) { - unaryExpr(); - astFactory.addASTChild(currentAST, returnAST); - castExpr_AST = (TNode)currentAST.root; - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_59); - } else { - throw ex; - } - } - returnAST = castExpr_AST; - } - - public final void typeName() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode typeName_AST = null; - - try { // for error handling - specifierQualifierList(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case STAR: - case LPAREN: - case LBRACKET: - { - nonemptyAbstractDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - typeName_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_33); - } else { - throw ex; - } - } - returnAST = typeName_AST; - } - - public final void unaryExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode unaryExpr_AST = null; - TNode u_AST = null; - - try { // for error handling - switch ( LA(1)) { - case ID: - case LPAREN: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - postfixExpr(); - astFactory.addASTChild(currentAST, returnAST); - unaryExpr_AST = (TNode)currentAST.root; - break; - } - case INC: - { - TNode tmp143_AST = null; - tmp143_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp143_AST); - match(INC); - unaryExpr(); - astFactory.addASTChild(currentAST, returnAST); - unaryExpr_AST = (TNode)currentAST.root; - break; - } - case DEC: - { - TNode tmp144_AST = null; - tmp144_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp144_AST); - match(DEC); - unaryExpr(); - astFactory.addASTChild(currentAST, returnAST); - unaryExpr_AST = (TNode)currentAST.root; - break; - } - case STAR: - case BAND: - case PLUS: - case MINUS: - case BNOT: - case LNOT: - { - unaryOperator(); - u_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - castExpr(); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - unaryExpr_AST = (TNode)currentAST.root; - unaryExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NUnaryExpr)).add(unaryExpr_AST)); - currentAST.root = unaryExpr_AST; - currentAST.child = unaryExpr_AST!=null &&unaryExpr_AST.getFirstChild()!=null ? - unaryExpr_AST.getFirstChild() : unaryExpr_AST; - currentAST.advanceChildToEnd(); - } - unaryExpr_AST = (TNode)currentAST.root; - break; - } - case LITERAL_sizeof: - { - TNode tmp145_AST = null; - tmp145_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp145_AST); - match(LITERAL_sizeof); - { - boolean synPredMatched194 = false; - if (((LA(1)==LPAREN) && (_tokenSet_20.member(LA(2))))) { - int _m194 = mark(); - synPredMatched194 = true; - inputState.guessing++; - try { - { - match(LPAREN); - typeName(); - } - } - catch (RecognitionException pe) { - synPredMatched194 = false; - } - rewind(_m194); - inputState.guessing--; - } - if ( synPredMatched194 ) { - TNode tmp146_AST = null; - tmp146_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp146_AST); - match(LPAREN); - typeName(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp147_AST = null; - tmp147_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp147_AST); - match(RPAREN); - } - else if ((_tokenSet_11.member(LA(1))) && (_tokenSet_58.member(LA(2)))) { - unaryExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - unaryExpr_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_59); - } else { - throw ex; - } - } - returnAST = unaryExpr_AST; - } - - public final void postfixExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode postfixExpr_AST = null; - - try { // for error handling - primaryExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case LPAREN: - case LBRACKET: - case INC: - case DEC: - case PTR: - case DOT: - { - postfixSuffix(); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - postfixExpr_AST = (TNode)currentAST.root; - postfixExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NPostfixExpr)).add(postfixExpr_AST)); - currentAST.root = postfixExpr_AST; - currentAST.child = postfixExpr_AST!=null &&postfixExpr_AST.getFirstChild()!=null ? - postfixExpr_AST.getFirstChild() : postfixExpr_AST; - currentAST.advanceChildToEnd(); - } - break; - } - case RCURLY: - case SEMI: - case COMMA: - case COLON: - case ASSIGN: - case STAR: - case RPAREN: - case RBRACKET: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - postfixExpr_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_59); - } else { - throw ex; - } - } - returnAST = postfixExpr_AST; - } - - public final void unaryOperator() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode unaryOperator_AST = null; - - try { // for error handling - switch ( LA(1)) { - case BAND: - { - TNode tmp148_AST = null; - tmp148_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp148_AST); - match(BAND); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case STAR: - { - TNode tmp149_AST = null; - tmp149_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp149_AST); - match(STAR); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case PLUS: - { - TNode tmp150_AST = null; - tmp150_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp150_AST); - match(PLUS); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case MINUS: - { - TNode tmp151_AST = null; - tmp151_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp151_AST); - match(MINUS); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case BNOT: - { - TNode tmp152_AST = null; - tmp152_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp152_AST); - match(BNOT); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case LNOT: - { - TNode tmp153_AST = null; - tmp153_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp153_AST); - match(LNOT); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_11); - } else { - throw ex; - } - } - returnAST = unaryOperator_AST; - } - - public final void primaryExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode primaryExpr_AST = null; - - try { // for error handling - switch ( LA(1)) { - case ID: - { - TNode tmp154_AST = null; - tmp154_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp154_AST); - match(ID); - primaryExpr_AST = (TNode)currentAST.root; - break; - } - case CharLiteral: - { - charConst(); - astFactory.addASTChild(currentAST, returnAST); - primaryExpr_AST = (TNode)currentAST.root; - break; - } - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - { - intConst(); - astFactory.addASTChild(currentAST, returnAST); - primaryExpr_AST = (TNode)currentAST.root; - break; - } - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - floatConst(); - astFactory.addASTChild(currentAST, returnAST); - primaryExpr_AST = (TNode)currentAST.root; - break; - } - case StringLiteral: - { - stringConst(); - astFactory.addASTChild(currentAST, returnAST); - primaryExpr_AST = (TNode)currentAST.root; - break; - } - case LPAREN: - { - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(RPAREN); - if ( inputState.guessing==0 ) { - primaryExpr_AST = (TNode)currentAST.root; - primaryExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NExpressionGroup,"(")).add(primaryExpr_AST)); - currentAST.root = primaryExpr_AST; - currentAST.child = primaryExpr_AST!=null &&primaryExpr_AST.getFirstChild()!=null ? - primaryExpr_AST.getFirstChild() : primaryExpr_AST; - currentAST.advanceChildToEnd(); - } - primaryExpr_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_60); - } else { - throw ex; - } - } - returnAST = primaryExpr_AST; - } - - public final void postfixSuffix() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode postfixSuffix_AST = null; - - try { // for error handling - { - int _cnt200=0; - _loop200: - do { - switch ( LA(1)) { - case PTR: - { - TNode tmp157_AST = null; - tmp157_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp157_AST); - match(PTR); - TNode tmp158_AST = null; - tmp158_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp158_AST); - match(ID); - break; - } - case DOT: - { - TNode tmp159_AST = null; - tmp159_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp159_AST); - match(DOT); - TNode tmp160_AST = null; - tmp160_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp160_AST); - match(ID); - break; - } - case LPAREN: - { - functionCall(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LBRACKET: - { - TNode tmp161_AST = null; - tmp161_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp161_AST); - match(LBRACKET); - expr(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp162_AST = null; - tmp162_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp162_AST); - match(RBRACKET); - break; - } - case INC: - { - TNode tmp163_AST = null; - tmp163_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp163_AST); - match(INC); - break; - } - case DEC: - { - TNode tmp164_AST = null; - tmp164_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp164_AST); - match(DEC); - break; - } - default: - { - if ( _cnt200>=1 ) { break _loop200; } else {throw new NoViableAltException(LT(1), getFilename());} - } - } - _cnt200++; - } while (true); - } - postfixSuffix_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_59); - } else { - throw ex; - } - } - returnAST = postfixSuffix_AST; - } - - public final void functionCall() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode functionCall_AST = null; - TNode a_AST = null; - - try { // for error handling - TNode tmp165_AST = null; - tmp165_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp165_AST); - match(LPAREN); - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case IntOctalConst: - case LongOctalConst: - case UnsignedOctalConst: - case IntIntConst: - case LongIntConst: - case UnsignedIntConst: - case IntHexConst: - case LongHexConst: - case UnsignedHexConst: - case FloatDoubleConst: - case DoubleDoubleConst: - case LongDoubleConst: - { - argExprList(); - a_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp166_AST = null; - tmp166_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp166_AST); - match(RPAREN); - if ( inputState.guessing==0 ) { - functionCall_AST = (TNode)currentAST.root; - - functionCall_AST.setType( NFunctionCallArgs ); - - } - functionCall_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_60); - } else { - throw ex; - } - } - returnAST = functionCall_AST; - } - - public final void argExprList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode argExprList_AST = null; - - try { // for error handling - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop206: - do { - if ((LA(1)==COMMA)) { - match(COMMA); - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop206; - } - - } while (true); - } - argExprList_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_33); - } else { - throw ex; - } - } - returnAST = argExprList_AST; - } - - protected final void charConst() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode charConst_AST = null; - - try { // for error handling - TNode tmp168_AST = null; - tmp168_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp168_AST); - match(CharLiteral); - charConst_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_60); - } else { - throw ex; - } - } - returnAST = charConst_AST; - } - - protected final void intConst() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode intConst_AST = null; - - try { // for error handling - switch ( LA(1)) { - case IntOctalConst: - { - TNode tmp169_AST = null; - tmp169_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp169_AST); - match(IntOctalConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case LongOctalConst: - { - TNode tmp170_AST = null; - tmp170_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp170_AST); - match(LongOctalConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case UnsignedOctalConst: - { - TNode tmp171_AST = null; - tmp171_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp171_AST); - match(UnsignedOctalConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case IntIntConst: - { - TNode tmp172_AST = null; - tmp172_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp172_AST); - match(IntIntConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case LongIntConst: - { - TNode tmp173_AST = null; - tmp173_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp173_AST); - match(LongIntConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case UnsignedIntConst: - { - TNode tmp174_AST = null; - tmp174_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp174_AST); - match(UnsignedIntConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case IntHexConst: - { - TNode tmp175_AST = null; - tmp175_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp175_AST); - match(IntHexConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case LongHexConst: - { - TNode tmp176_AST = null; - tmp176_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp176_AST); - match(LongHexConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case UnsignedHexConst: - { - TNode tmp177_AST = null; - tmp177_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp177_AST); - match(UnsignedHexConst); - intConst_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_60); - } else { - throw ex; - } - } - returnAST = intConst_AST; - } - - protected final void floatConst() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode floatConst_AST = null; - - try { // for error handling - switch ( LA(1)) { - case FloatDoubleConst: - { - TNode tmp178_AST = null; - tmp178_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp178_AST); - match(FloatDoubleConst); - floatConst_AST = (TNode)currentAST.root; - break; - } - case DoubleDoubleConst: - { - TNode tmp179_AST = null; - tmp179_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp179_AST); - match(DoubleDoubleConst); - floatConst_AST = (TNode)currentAST.root; - break; - } - case LongDoubleConst: - { - TNode tmp180_AST = null; - tmp180_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp180_AST); - match(LongDoubleConst); - floatConst_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_60); - } else { - throw ex; - } - } - returnAST = floatConst_AST; - } - - protected final void stringConst() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode stringConst_AST = null; - - try { // for error handling - { - int _cnt210=0; - _loop210: - do { - if ((LA(1)==StringLiteral)) { - TNode tmp181_AST = null; - tmp181_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp181_AST); - match(StringLiteral); - } - else { - if ( _cnt210>=1 ) { break _loop210; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt210++; - } while (true); - } - if ( inputState.guessing==0 ) { - stringConst_AST = (TNode)currentAST.root; - stringConst_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStringSeq)).add(stringConst_AST)); - currentAST.root = stringConst_AST; - currentAST.child = stringConst_AST!=null &&stringConst_AST.getFirstChild()!=null ? - stringConst_AST.getFirstChild() : stringConst_AST; - currentAST.advanceChildToEnd(); - } - stringConst_AST = (TNode)currentAST.root; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_60); - } else { - throw ex; - } - } - returnAST = stringConst_AST; - } - - public final void dummy() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode dummy_AST = null; - - try { // for error handling - switch ( LA(1)) { - case NTypedefName: - { - TNode tmp182_AST = null; - tmp182_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp182_AST); - match(NTypedefName); - dummy_AST = (TNode)currentAST.root; - break; - } - case NInitDecl: - { - TNode tmp183_AST = null; - tmp183_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp183_AST); - match(NInitDecl); - dummy_AST = (TNode)currentAST.root; - break; - } - case NDeclarator: - { - TNode tmp184_AST = null; - tmp184_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp184_AST); - match(NDeclarator); - dummy_AST = (TNode)currentAST.root; - break; - } - case NStructDeclarator: - { - TNode tmp185_AST = null; - tmp185_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp185_AST); - match(NStructDeclarator); - dummy_AST = (TNode)currentAST.root; - break; - } - case NDeclaration: - { - TNode tmp186_AST = null; - tmp186_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp186_AST); - match(NDeclaration); - dummy_AST = (TNode)currentAST.root; - break; - } - case NCast: - { - TNode tmp187_AST = null; - tmp187_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp187_AST); - match(NCast); - dummy_AST = (TNode)currentAST.root; - break; - } - case NPointerGroup: - { - TNode tmp188_AST = null; - tmp188_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp188_AST); - match(NPointerGroup); - dummy_AST = (TNode)currentAST.root; - break; - } - case NExpressionGroup: - { - TNode tmp189_AST = null; - tmp189_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp189_AST); - match(NExpressionGroup); - dummy_AST = (TNode)currentAST.root; - break; - } - case NFunctionCallArgs: - { - TNode tmp190_AST = null; - tmp190_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp190_AST); - match(NFunctionCallArgs); - dummy_AST = (TNode)currentAST.root; - break; - } - case NNonemptyAbstractDeclarator: - { - TNode tmp191_AST = null; - tmp191_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp191_AST); - match(NNonemptyAbstractDeclarator); - dummy_AST = (TNode)currentAST.root; - break; - } - case NInitializer: - { - TNode tmp192_AST = null; - tmp192_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp192_AST); - match(NInitializer); - dummy_AST = (TNode)currentAST.root; - break; - } - case NStatementExpr: - { - TNode tmp193_AST = null; - tmp193_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp193_AST); - match(NStatementExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NEmptyExpression: - { - TNode tmp194_AST = null; - tmp194_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp194_AST); - match(NEmptyExpression); - dummy_AST = (TNode)currentAST.root; - break; - } - case NParameterTypeList: - { - TNode tmp195_AST = null; - tmp195_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp195_AST); - match(NParameterTypeList); - dummy_AST = (TNode)currentAST.root; - break; - } - case NFunctionDef: - { - TNode tmp196_AST = null; - tmp196_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp196_AST); - match(NFunctionDef); - dummy_AST = (TNode)currentAST.root; - break; - } - case NCompoundStatement: - { - TNode tmp197_AST = null; - tmp197_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp197_AST); - match(NCompoundStatement); - dummy_AST = (TNode)currentAST.root; - break; - } - case NParameterDeclaration: - { - TNode tmp198_AST = null; - tmp198_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp198_AST); - match(NParameterDeclaration); - dummy_AST = (TNode)currentAST.root; - break; - } - case NCommaExpr: - { - TNode tmp199_AST = null; - tmp199_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp199_AST); - match(NCommaExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NUnaryExpr: - { - TNode tmp200_AST = null; - tmp200_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp200_AST); - match(NUnaryExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NLabel: - { - TNode tmp201_AST = null; - tmp201_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp201_AST); - match(NLabel); - dummy_AST = (TNode)currentAST.root; - break; - } - case NPostfixExpr: - { - TNode tmp202_AST = null; - tmp202_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp202_AST); - match(NPostfixExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NRangeExpr: - { - TNode tmp203_AST = null; - tmp203_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp203_AST); - match(NRangeExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NStringSeq: - { - TNode tmp204_AST = null; - tmp204_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp204_AST); - match(NStringSeq); - dummy_AST = (TNode)currentAST.root; - break; - } - case NInitializerElementLabel: - { - TNode tmp205_AST = null; - tmp205_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp205_AST); - match(NInitializerElementLabel); - dummy_AST = (TNode)currentAST.root; - break; - } - case NLcurlyInitializer: - { - TNode tmp206_AST = null; - tmp206_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp206_AST); - match(NLcurlyInitializer); - dummy_AST = (TNode)currentAST.root; - break; - } - case NAsmAttribute: - { - TNode tmp207_AST = null; - tmp207_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp207_AST); - match(NAsmAttribute); - dummy_AST = (TNode)currentAST.root; - break; - } - case NGnuAsmExpr: - { - TNode tmp208_AST = null; - tmp208_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp208_AST); - match(NGnuAsmExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NTypeMissing: - { - TNode tmp209_AST = null; - tmp209_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp209_AST); - match(NTypeMissing); - dummy_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - consume(); - consumeUntil(_tokenSet_0); - } else { - throw ex; - } - } - returnAST = dummy_AST; - } - - - public static final String[] _tokenNames = { - "<0>", - "EOF", - "<2>", - "NULL_TREE_LOOKAHEAD", - "\"typedef\"", - "\"asm\"", - "\"volatile\"", - "LCURLY", - "RCURLY", - "SEMI", - "\"struct\"", - "\"union\"", - "\"enum\"", - "\"auto\"", - "\"register\"", - "\"extern\"", - "\"static\"", - "\"const\"", - "\"void\"", - "\"char\"", - "\"short\"", - "\"int\"", - "\"long\"", - "\"float\"", - "\"double\"", - "\"signed\"", - "\"unsigned\"", - "ID", - "COMMA", - "COLON", - "ASSIGN", - "STAR", - "LPAREN", - "RPAREN", - "LBRACKET", - "RBRACKET", - "VARARGS", - "\"while\"", - "\"do\"", - "\"for\"", - "\"goto\"", - "\"continue\"", - "\"break\"", - "\"return\"", - "\"case\"", - "\"default\"", - "\"if\"", - "\"else\"", - "\"switch\"", - "DIV_ASSIGN", - "PLUS_ASSIGN", - "MINUS_ASSIGN", - "STAR_ASSIGN", - "MOD_ASSIGN", - "RSHIFT_ASSIGN", - "LSHIFT_ASSIGN", - "BAND_ASSIGN", - "BOR_ASSIGN", - "BXOR_ASSIGN", - "QUESTION", - "LOR", - "LAND", - "BOR", - "BXOR", - "BAND", - "EQUAL", - "NOT_EQUAL", - "LT", - "LTE", - "GT", - "GTE", - "LSHIFT", - "RSHIFT", - "PLUS", - "MINUS", - "DIV", - "MOD", - "INC", - "DEC", - "\"sizeof\"", - "BNOT", - "LNOT", - "PTR", - "DOT", - "CharLiteral", - "StringLiteral", - "IntOctalConst", - "LongOctalConst", - "UnsignedOctalConst", - "IntIntConst", - "LongIntConst", - "UnsignedIntConst", - "IntHexConst", - "LongHexConst", - "UnsignedHexConst", - "FloatDoubleConst", - "DoubleDoubleConst", - "LongDoubleConst", - "NTypedefName", - "NInitDecl", - "NDeclarator", - "NStructDeclarator", - "NDeclaration", - "NCast", - "NPointerGroup", - "NExpressionGroup", - "NFunctionCallArgs", - "NNonemptyAbstractDeclarator", - "NInitializer", - "NStatementExpr", - "NEmptyExpression", - "NParameterTypeList", - "NFunctionDef", - "NCompoundStatement", - "NParameterDeclaration", - "NCommaExpr", - "NUnaryExpr", - "NLabel", - "NPostfixExpr", - "NRangeExpr", - "NStringSeq", - "NInitializerElementLabel", - "NLcurlyInitializer", - "NAsmAttribute", - "NGnuAsmExpr", - "NTypeMissing", - "Vocabulary", - "Whitespace", - "Comment", - "CPPComment", - "a line directive", - "Space", - "LineDirective", - "BadStringLiteral", - "Escape", - "Digit", - "LongSuffix", - "UnsignedSuffix", - "FloatSuffix", - "Exponent", - "Number" - }; - - protected void buildTokenTypeASTClassMap() { - tokenTypeToASTClassMap=null; - }; - - private static final long[] mk_tokenSet_0() { - long[] data = { 2L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); - private static final long[] mk_tokenSet_1() { - long[] data = { 6710885488L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); - private static final long[] mk_tokenSet_2() { - long[] data = { 268434512L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); - private static final long[] mk_tokenSet_3() { - long[] data = { 6710886096L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); - private static final long[] mk_tokenSet_4() { - long[] data = { 6710860864L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); - private static final long[] mk_tokenSet_5() { - long[] data = { 92610232016L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); - private static final long[] mk_tokenSet_6() { - long[] data = { 6710885490L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6()); - private static final long[] mk_tokenSet_7() { - long[] data = { 422150456475634L, 17179076097L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7()); - private static final long[] mk_tokenSet_8() { - long[] data = { 268409920L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8()); - private static final long[] mk_tokenSet_9() { - long[] data = { 6710860992L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9()); - private static final long[] mk_tokenSet_10() { - long[] data = { 6576668672L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10()); - private static final long[] mk_tokenSet_11() { - long[] data = { 6576668672L, 17179076097L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11()); - private static final long[] mk_tokenSet_12() { - long[] data = { 43754980096L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); - private static final long[] mk_tokenSet_13() { - long[] data = { 268180480L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13()); - private static final long[] mk_tokenSet_14() { - long[] data = { 32749125328L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_14 = new BitSet(mk_tokenSet_14()); - private static final long[] mk_tokenSet_15() { - long[] data = { 32614908416L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_15 = new BitSet(mk_tokenSet_15()); - private static final long[] mk_tokenSet_16() { - long[] data = { 512L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_16 = new BitSet(mk_tokenSet_16()); - private static final long[] mk_tokenSet_17() { - long[] data = { 32749125200L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_17 = new BitSet(mk_tokenSet_17()); - private static final long[] mk_tokenSet_18() { - long[] data = { 33285996112L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_18 = new BitSet(mk_tokenSet_18()); - private static final long[] mk_tokenSet_19() { - long[] data = { 134217856L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_19 = new BitSet(mk_tokenSet_19()); - private static final long[] mk_tokenSet_20() { - long[] data = { 268311616L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_20 = new BitSet(mk_tokenSet_20()); - private static final long[] mk_tokenSet_21() { - long[] data = { 256L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_21 = new BitSet(mk_tokenSet_21()); - private static final long[] mk_tokenSet_22() { - long[] data = { 268311872L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_22 = new BitSet(mk_tokenSet_22()); - private static final long[] mk_tokenSet_23() { - long[] data = { 33017437376L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_23 = new BitSet(mk_tokenSet_23()); - private static final long[] mk_tokenSet_24() { - long[] data = { 32883343360L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_24 = new BitSet(mk_tokenSet_24()); - private static final long[] mk_tokenSet_25() { - long[] data = { 268435968L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_25 = new BitSet(mk_tokenSet_25()); - private static final long[] mk_tokenSet_26() { - long[] data = { 35165045504L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_26 = new BitSet(mk_tokenSet_26()); - private static final long[] mk_tokenSet_27() { - long[] data = { 32749124816L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_27 = new BitSet(mk_tokenSet_27()); - private static final long[] mk_tokenSet_28() { - long[] data = { 100931731152L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_28 = new BitSet(mk_tokenSet_28()); - private static final long[] mk_tokenSet_29() { - long[] data = { 79456894672L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_29 = new BitSet(mk_tokenSet_29()); - private static final long[] mk_tokenSet_30() { - long[] data = { 268435712L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_30 = new BitSet(mk_tokenSet_30()); - private static final long[] mk_tokenSet_31() { - long[] data = { 268436224L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_31 = new BitSet(mk_tokenSet_31()); - private static final long[] mk_tokenSet_32() { - long[] data = { 30467424256L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_32 = new BitSet(mk_tokenSet_32()); - private static final long[] mk_tokenSet_33() { - long[] data = { 8589934592L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_33 = new BitSet(mk_tokenSet_33()); - private static final long[] mk_tokenSet_34() { - long[] data = { 6576668800L, 17179076097L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_34 = new BitSet(mk_tokenSet_34()); - private static final long[] mk_tokenSet_35() { - long[] data = { 32615039040L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_35 = new BitSet(mk_tokenSet_35()); - private static final long[] mk_tokenSet_36() { - long[] data = { 23622320128L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_36 = new BitSet(mk_tokenSet_36()); - private static final long[] mk_tokenSet_37() { - long[] data = { 67108863056L, 17179076097L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_37 = new BitSet(mk_tokenSet_37()); - private static final long[] mk_tokenSet_38() { - long[] data = { 8858370048L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_38 = new BitSet(mk_tokenSet_38()); - private static final long[] mk_tokenSet_39() { - long[] data = { 422081602782080L, 17179076097L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_39 = new BitSet(mk_tokenSet_39()); - private static final long[] mk_tokenSet_40() { - long[] data = { -111669149710L, 17179869183L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_40 = new BitSet(mk_tokenSet_40()); - private static final long[] mk_tokenSet_41() { - long[] data = { 562819225354226L, 17179076097L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_41 = new BitSet(mk_tokenSet_41()); - private static final long[] mk_tokenSet_42() { - long[] data = { 422081602781824L, 17179076097L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_42 = new BitSet(mk_tokenSet_42()); - private static final long[] mk_tokenSet_43() { - long[] data = { 562819091137408L, 17179076097L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_43 = new BitSet(mk_tokenSet_43()); - private static final long[] mk_tokenSet_44() { - long[] data = { -562924720611776L, 17179869183L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_44 = new BitSet(mk_tokenSet_44()); - private static final long[] mk_tokenSet_45() { - long[] data = { -111669149744L, 17179869183L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_45 = new BitSet(mk_tokenSet_45()); - private static final long[] mk_tokenSet_46() { - long[] data = { 575897847178724096L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_46 = new BitSet(mk_tokenSet_46()); - private static final long[] mk_tokenSet_47() { - long[] data = { 1152358599482147584L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_47 = new BitSet(mk_tokenSet_47()); - private static final long[] mk_tokenSet_48() { - long[] data = { 2305280104088994560L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_48 = new BitSet(mk_tokenSet_48()); - private static final long[] mk_tokenSet_49() { - long[] data = { 4611123113302688512L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_49 = new BitSet(mk_tokenSet_49()); - private static final long[] mk_tokenSet_50() { - long[] data = { 9222809131730076416L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_50 = new BitSet(mk_tokenSet_50()); - private static final long[] mk_tokenSet_51() { - long[] data = { -562905124699392L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_51 = new BitSet(mk_tokenSet_51()); - private static final long[] mk_tokenSet_52() { - long[] data = { -562905124699392L, 1L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_52 = new BitSet(mk_tokenSet_52()); - private static final long[] mk_tokenSet_53() { - long[] data = { -562905124699392L, 7L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_53 = new BitSet(mk_tokenSet_53()); - private static final long[] mk_tokenSet_54() { - long[] data = { -562905124699392L, 127L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_54 = new BitSet(mk_tokenSet_54()); - private static final long[] mk_tokenSet_55() { - long[] data = { -562905124699392L, 511L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_55 = new BitSet(mk_tokenSet_55()); - private static final long[] mk_tokenSet_56() { - long[] data = { 2147483648L, 6144L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_56 = new BitSet(mk_tokenSet_56()); - private static final long[] mk_tokenSet_57() { - long[] data = { -562905124699392L, 2047L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_57 = new BitSet(mk_tokenSet_57()); - private static final long[] mk_tokenSet_58() { - long[] data = { -562881368161536L, 17179869183L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_58 = new BitSet(mk_tokenSet_58()); - private static final long[] mk_tokenSet_59() { - long[] data = { -562902977215744L, 8191L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_59 = new BitSet(mk_tokenSet_59()); - private static final long[] mk_tokenSet_60() { - long[] data = { -562881502379264L, 819199L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_60 = new BitSet(mk_tokenSet_60()); - - } + +protected StdCParser(TokenBuffer tokenBuf, int k) { + super(tokenBuf,k); + tokenNames = _tokenNames; + buildTokenTypeASTClassMap(); + astFactory = new ASTFactory(getTokenTypeToASTClassMap()); +} + +public StdCParser(TokenBuffer tokenBuf) { + this(tokenBuf,2); +} + +protected StdCParser(TokenStream lexer, int k) { + super(lexer,k); + tokenNames = _tokenNames; + buildTokenTypeASTClassMap(); + astFactory = new ASTFactory(getTokenTypeToASTClassMap()); +} + +public StdCParser(TokenStream lexer) { + this(lexer,2); +} + +public StdCParser(ParserSharedInputState state) { + super(state,2); + tokenNames = _tokenNames; + buildTokenTypeASTClassMap(); + astFactory = new ASTFactory(getTokenTypeToASTClassMap()); +} + + public final void translationUnit() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode translationUnit_AST = null; + + try { // for error handling + switch ( LA(1)) { + case LITERAL_typedef: + case LITERAL_asm: + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_auto: + case LITERAL_register: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case ID: + case STAR: + case LPAREN: + { + externalList(); + astFactory.addASTChild(currentAST, returnAST); + translationUnit_AST = (TNode)currentAST.root; + break; + } + case EOF: + { + if ( inputState.guessing==0 ) { + + System.err.println ( "Empty source file!" ); + + } + translationUnit_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_0); + } else { + throw ex; + } + } + returnAST = translationUnit_AST; + } + + public final void externalList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode externalList_AST = null; + + try { // for error handling + { + int _cnt4=0; + _loop4: + do { + if ((_tokenSet_1.member(LA(1)))) { + externalDef(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt4>=1 ) { break _loop4; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt4++; + } while (true); + } + externalList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_0); + } else { + throw ex; + } + } + returnAST = externalList_AST; + } + + public final void externalDef() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode externalDef_AST = null; + + try { // for error handling + boolean synPredMatched7 = false; + if (((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))))) { + int _m7 = mark(); + synPredMatched7 = true; + inputState.guessing++; + try { + { + if ((LA(1)==LITERAL_typedef) && (true)) { + match(LITERAL_typedef); + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2)))) { + declaration(); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + } + catch (RecognitionException pe) { + synPredMatched7 = false; + } + rewind(_m7); + inputState.guessing--; + } + if ( synPredMatched7 ) { + declaration(); + astFactory.addASTChild(currentAST, returnAST); + externalDef_AST = (TNode)currentAST.root; + } + else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_5.member(LA(2)))) { + functionDef(); + astFactory.addASTChild(currentAST, returnAST); + externalDef_AST = (TNode)currentAST.root; + } + else if ((LA(1)==LITERAL_asm)) { + asm_expr(); + astFactory.addASTChild(currentAST, returnAST); + externalDef_AST = (TNode)currentAST.root; + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_6); + } else { + throw ex; + } + } + returnAST = externalDef_AST; + } + + public final void declaration() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declaration_AST = null; + TNode ds_AST = null; + AST ds1 = null; + + try { // for error handling + declSpecifiers(); + ds_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + ds1 = astFactory.dupList(ds_AST); + } + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + { + initDeclList(ds1); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + if ( inputState.guessing==0 ) { + declaration_AST = (TNode)currentAST.root; + declaration_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NDeclaration)).add(declaration_AST)); + currentAST.root = declaration_AST; + currentAST.child = declaration_AST!=null &&declaration_AST.getFirstChild()!=null ? + declaration_AST.getFirstChild() : declaration_AST; + currentAST.advanceChildToEnd(); + } + declaration_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_7); + } else { + throw ex; + } + } + returnAST = declaration_AST; + } + + public final void functionDef() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode functionDef_AST = null; + TNode ds_AST = null; + TNode d_AST = null; + String declName; + + try { // for error handling + { + boolean synPredMatched94 = false; + if (((_tokenSet_8.member(LA(1))) && (_tokenSet_9.member(LA(2))))) { + int _m94 = mark(); + synPredMatched94 = true; + inputState.guessing++; + try { + { + functionDeclSpecifiers(); + } + } + catch (RecognitionException pe) { + synPredMatched94 = false; + } + rewind(_m94); + inputState.guessing--; + } + if ( synPredMatched94 ) { + functionDeclSpecifiers(); + ds_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_10.member(LA(1))) && (_tokenSet_5.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + declName=declarator(true); + d_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + + AST d2, ds2; + d2 = astFactory.dupList(d_AST); + ds2 = astFactory.dupList(ds_AST); + symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds2).add(d2))); + pushScope(declName); + + } + { + _loop96: + do { + if ((_tokenSet_2.member(LA(1)))) { + declaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop96; + } + + } while (true); + } + { + switch ( LA(1)) { + case VARARGS: + { + TNode tmp2_AST = null; + tmp2_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp2_AST); + match(VARARGS); + break; + } + case LCURLY: + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + _loop99: + do { + if ((LA(1)==SEMI)) { + match(SEMI); + } + else { + break _loop99; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + popScope(); + } + compoundStatement(declName); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + functionDef_AST = (TNode)currentAST.root; + functionDef_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NFunctionDef)).add(functionDef_AST)); + currentAST.root = functionDef_AST; + currentAST.child = functionDef_AST!=null &&functionDef_AST.getFirstChild()!=null ? + functionDef_AST.getFirstChild() : functionDef_AST; + currentAST.advanceChildToEnd(); + } + functionDef_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_6); + } else { + throw ex; + } + } + returnAST = functionDef_AST; + } + + public final void asm_expr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode asm_expr_AST = null; + + try { // for error handling + TNode tmp4_AST = null; + tmp4_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp4_AST); + match(LITERAL_asm); + { + switch ( LA(1)) { + case LITERAL_volatile: + { + TNode tmp5_AST = null; + tmp5_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp5_AST); + match(LITERAL_volatile); + break; + } + case LCURLY: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + match(LCURLY); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(RCURLY); + match(SEMI); + asm_expr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_6); + } else { + throw ex; + } + } + returnAST = asm_expr_AST; + } + + public final void expr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode expr_AST = null; + Token c = null; + TNode c_AST = null; + + try { // for error handling + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop129: + do { + if ((LA(1)==COMMA) && (_tokenSet_11.member(LA(2)))) { + c = LT(1); + c_AST = (TNode)astFactory.create(c); + astFactory.makeASTRoot(currentAST, c_AST); + match(COMMA); + if ( inputState.guessing==0 ) { + c_AST.setType(NCommaExpr); + } + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop129; + } + + } while (true); + } + expr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_12); + } else { + throw ex; + } + } + returnAST = expr_AST; + } + + public final void declSpecifiers() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declSpecifiers_AST = null; + TNode s_AST = null; + int specCount=0; + + try { // for error handling + { + int _cnt16=0; + _loop16: + do { + switch ( LA(1)) { + case LITERAL_typedef: + case LITERAL_auto: + case LITERAL_register: + case LITERAL_extern: + case LITERAL_static: + { + storageClassSpecifier(); + s_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_volatile: + case LITERAL_const: + { + typeQualifier(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + default: + boolean synPredMatched15 = false; + if (((_tokenSet_13.member(LA(1))) && (_tokenSet_14.member(LA(2))))) { + int _m15 = mark(); + synPredMatched15 = true; + inputState.guessing++; + try { + { + if ((LA(1)==LITERAL_struct) && (true)) { + match(LITERAL_struct); + } + else if ((LA(1)==LITERAL_union) && (true)) { + match(LITERAL_union); + } + else if ((LA(1)==LITERAL_enum) && (true)) { + match(LITERAL_enum); + } + else if ((_tokenSet_13.member(LA(1))) && (true)) { + typeSpecifier(specCount); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + } + catch (RecognitionException pe) { + synPredMatched15 = false; + } + rewind(_m15); + inputState.guessing--; + } + if ( synPredMatched15 ) { + specCount=typeSpecifier(specCount); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt16>=1 ) { break _loop16; } else {throw new NoViableAltException(LT(1), getFilename());} + } + } + _cnt16++; + } while (true); + } + declSpecifiers_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_15); + } else { + throw ex; + } + } + returnAST = declSpecifiers_AST; + } + + public final void initDeclList( + AST declarationSpecifiers + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode initDeclList_AST = null; + + try { // for error handling + initDecl(declarationSpecifiers); + astFactory.addASTChild(currentAST, returnAST); + { + _loop56: + do { + if ((LA(1)==COMMA)) { + match(COMMA); + initDecl(declarationSpecifiers); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop56; + } + + } while (true); + } + initDeclList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_16); + } else { + throw ex; + } + } + returnAST = initDeclList_AST; + } + + public final void storageClassSpecifier() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode storageClassSpecifier_AST = null; + + try { // for error handling + switch ( LA(1)) { + case LITERAL_auto: + { + TNode tmp10_AST = null; + tmp10_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp10_AST); + match(LITERAL_auto); + storageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_register: + { + TNode tmp11_AST = null; + tmp11_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp11_AST); + match(LITERAL_register); + storageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_typedef: + { + TNode tmp12_AST = null; + tmp12_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp12_AST); + match(LITERAL_typedef); + storageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_extern: + case LITERAL_static: + { + functionStorageClassSpecifier(); + astFactory.addASTChild(currentAST, returnAST); + storageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_17); + } else { + throw ex; + } + } + returnAST = storageClassSpecifier_AST; + } + + public final void typeQualifier() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode typeQualifier_AST = null; + + try { // for error handling + switch ( LA(1)) { + case LITERAL_const: + { + TNode tmp13_AST = null; + tmp13_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp13_AST); + match(LITERAL_const); + typeQualifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_volatile: + { + TNode tmp14_AST = null; + tmp14_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp14_AST); + match(LITERAL_volatile); + typeQualifier_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_18); + } else { + throw ex; + } + } + returnAST = typeQualifier_AST; + } + + public final int typeSpecifier( + int specCount + ) throws RecognitionException, TokenStreamException { + int retSpecCount; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode typeSpecifier_AST = null; + retSpecCount = specCount + 1; + + try { // for error handling + { + switch ( LA(1)) { + case LITERAL_void: + { + TNode tmp15_AST = null; + tmp15_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp15_AST); + match(LITERAL_void); + break; + } + case LITERAL_char: + { + TNode tmp16_AST = null; + tmp16_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp16_AST); + match(LITERAL_char); + break; + } + case LITERAL_short: + { + TNode tmp17_AST = null; + tmp17_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp17_AST); + match(LITERAL_short); + break; + } + case LITERAL_int: + { + TNode tmp18_AST = null; + tmp18_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp18_AST); + match(LITERAL_int); + break; + } + case LITERAL_long: + { + TNode tmp19_AST = null; + tmp19_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp19_AST); + match(LITERAL_long); + break; + } + case LITERAL_float: + { + TNode tmp20_AST = null; + tmp20_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp20_AST); + match(LITERAL_float); + break; + } + case LITERAL_double: + { + TNode tmp21_AST = null; + tmp21_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp21_AST); + match(LITERAL_double); + break; + } + case LITERAL_signed: + { + TNode tmp22_AST = null; + tmp22_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp22_AST); + match(LITERAL_signed); + break; + } + case LITERAL_unsigned: + { + TNode tmp23_AST = null; + tmp23_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp23_AST); + match(LITERAL_unsigned); + break; + } + case LITERAL_struct: + case LITERAL_union: + { + structOrUnionSpecifier(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_enum: + { + enumSpecifier(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + default: + if (((LA(1)==ID))&&( specCount == 0 )) { + typedefName(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + typeSpecifier_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_18); + } else { + throw ex; + } + } + returnAST = typeSpecifier_AST; + return retSpecCount; + } + + public final void functionStorageClassSpecifier() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode functionStorageClassSpecifier_AST = null; + + try { // for error handling + switch ( LA(1)) { + case LITERAL_extern: + { + TNode tmp24_AST = null; + tmp24_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp24_AST); + match(LITERAL_extern); + functionStorageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_static: + { + TNode tmp25_AST = null; + tmp25_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp25_AST); + match(LITERAL_static); + functionStorageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_17); + } else { + throw ex; + } + } + returnAST = functionStorageClassSpecifier_AST; + } + + public final void structOrUnionSpecifier() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structOrUnionSpecifier_AST = null; + TNode sou_AST = null; + Token i = null; + TNode i_AST = null; + Token l = null; + TNode l_AST = null; + Token l1 = null; + TNode l1_AST = null; + String scopeName; + + try { // for error handling + structOrUnion(); + sou_AST = (TNode)returnAST; + { + boolean synPredMatched26 = false; + if (((LA(1)==ID) && (LA(2)==LCURLY))) { + int _m26 = mark(); + synPredMatched26 = true; + inputState.guessing++; + try { + { + match(ID); + match(LCURLY); + } + } + catch (RecognitionException pe) { + synPredMatched26 = false; + } + rewind(_m26); + inputState.guessing--; + } + if ( synPredMatched26 ) { + i = LT(1); + i_AST = (TNode)astFactory.create(i); + astFactory.addASTChild(currentAST, i_AST); + match(ID); + l = LT(1); + l_AST = (TNode)astFactory.create(l); + astFactory.addASTChild(currentAST, l_AST); + match(LCURLY); + if ( inputState.guessing==0 ) { + + scopeName = sou_AST.getText() + " " + i_AST.getText(); + l_AST.setText(scopeName); + pushScope(scopeName); + + } + structDeclarationList(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + popScope(); + } + match(RCURLY); + } + else if ((LA(1)==LCURLY)) { + l1 = LT(1); + l1_AST = (TNode)astFactory.create(l1); + astFactory.addASTChild(currentAST, l1_AST); + match(LCURLY); + if ( inputState.guessing==0 ) { + + scopeName = getAScopeName(); + l1_AST.setText(scopeName); + pushScope(scopeName); + + } + structDeclarationList(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + popScope(); + } + match(RCURLY); + } + else if ((LA(1)==ID) && (_tokenSet_18.member(LA(2)))) { + TNode tmp28_AST = null; + tmp28_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp28_AST); + match(ID); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState.guessing==0 ) { + structOrUnionSpecifier_AST = (TNode)currentAST.root; + + structOrUnionSpecifier_AST = (TNode)astFactory.make( (new ASTArray(2)).add(sou_AST).add(structOrUnionSpecifier_AST)); + + currentAST.root = structOrUnionSpecifier_AST; + currentAST.child = structOrUnionSpecifier_AST!=null &&structOrUnionSpecifier_AST.getFirstChild()!=null ? + structOrUnionSpecifier_AST.getFirstChild() : structOrUnionSpecifier_AST; + currentAST.advanceChildToEnd(); + } + structOrUnionSpecifier_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_18); + } else { + throw ex; + } + } + returnAST = structOrUnionSpecifier_AST; + } + + public final void enumSpecifier() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode enumSpecifier_AST = null; + Token i = null; + TNode i_AST = null; + + try { // for error handling + TNode tmp29_AST = null; + tmp29_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp29_AST); + match(LITERAL_enum); + { + boolean synPredMatched48 = false; + if (((LA(1)==ID) && (LA(2)==LCURLY))) { + int _m48 = mark(); + synPredMatched48 = true; + inputState.guessing++; + try { + { + match(ID); + match(LCURLY); + } + } + catch (RecognitionException pe) { + synPredMatched48 = false; + } + rewind(_m48); + inputState.guessing--; + } + if ( synPredMatched48 ) { + i = LT(1); + i_AST = (TNode)astFactory.create(i); + astFactory.addASTChild(currentAST, i_AST); + match(ID); + TNode tmp30_AST = null; + tmp30_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp30_AST); + match(LCURLY); + enumList(i.getText()); + astFactory.addASTChild(currentAST, returnAST); + match(RCURLY); + } + else if ((LA(1)==LCURLY)) { + TNode tmp32_AST = null; + tmp32_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp32_AST); + match(LCURLY); + enumList("anonymous"); + astFactory.addASTChild(currentAST, returnAST); + match(RCURLY); + } + else if ((LA(1)==ID) && (_tokenSet_18.member(LA(2)))) { + TNode tmp34_AST = null; + tmp34_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp34_AST); + match(ID); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + enumSpecifier_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_18); + } else { + throw ex; + } + } + returnAST = enumSpecifier_AST; + } + + public final void typedefName() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode typedefName_AST = null; + Token i = null; + TNode i_AST = null; + + try { // for error handling + if (!( isTypedefName ( LT(1).getText() ) )) + throw new SemanticException(" isTypedefName ( LT(1).getText() ) "); + i = LT(1); + i_AST = (TNode)astFactory.create(i); + astFactory.addASTChild(currentAST, i_AST); + match(ID); + if ( inputState.guessing==0 ) { + typedefName_AST = (TNode)currentAST.root; + typedefName_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NTypedefName)).add(i_AST)); + currentAST.root = typedefName_AST; + currentAST.child = typedefName_AST!=null &&typedefName_AST.getFirstChild()!=null ? + typedefName_AST.getFirstChild() : typedefName_AST; + currentAST.advanceChildToEnd(); + } + typedefName_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_18); + } else { + throw ex; + } + } + returnAST = typedefName_AST; + } + + public final void structOrUnion() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structOrUnion_AST = null; + + try { // for error handling + switch ( LA(1)) { + case LITERAL_struct: + { + TNode tmp35_AST = null; + tmp35_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp35_AST); + match(LITERAL_struct); + structOrUnion_AST = (TNode)currentAST.root; + break; + } + case LITERAL_union: + { + TNode tmp36_AST = null; + tmp36_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp36_AST); + match(LITERAL_union); + structOrUnion_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_19); + } else { + throw ex; + } + } + returnAST = structOrUnion_AST; + } + + public final void structDeclarationList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structDeclarationList_AST = null; + + try { // for error handling + { + int _cnt30=0; + _loop30: + do { + if ((_tokenSet_20.member(LA(1)))) { + structDeclaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt30>=1 ) { break _loop30; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt30++; + } while (true); + } + structDeclarationList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_21); + } else { + throw ex; + } + } + returnAST = structDeclarationList_AST; + } + + public final void structDeclaration() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structDeclaration_AST = null; + + try { // for error handling + specifierQualifierList(); + astFactory.addASTChild(currentAST, returnAST); + structDeclaratorList(); + astFactory.addASTChild(currentAST, returnAST); + { + int _cnt33=0; + _loop33: + do { + if ((LA(1)==SEMI)) { + match(SEMI); + } + else { + if ( _cnt33>=1 ) { break _loop33; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt33++; + } while (true); + } + structDeclaration_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_22); + } else { + throw ex; + } + } + returnAST = structDeclaration_AST; + } + + public final void specifierQualifierList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode specifierQualifierList_AST = null; + int specCount = 0; + + try { // for error handling + { + int _cnt38=0; + _loop38: + do { + boolean synPredMatched37 = false; + if (((_tokenSet_13.member(LA(1))) && (_tokenSet_23.member(LA(2))))) { + int _m37 = mark(); + synPredMatched37 = true; + inputState.guessing++; + try { + { + if ((LA(1)==LITERAL_struct) && (true)) { + match(LITERAL_struct); + } + else if ((LA(1)==LITERAL_union) && (true)) { + match(LITERAL_union); + } + else if ((LA(1)==LITERAL_enum) && (true)) { + match(LITERAL_enum); + } + else if ((_tokenSet_13.member(LA(1))) && (true)) { + typeSpecifier(specCount); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + } + catch (RecognitionException pe) { + synPredMatched37 = false; + } + rewind(_m37); + inputState.guessing--; + } + if ( synPredMatched37 ) { + specCount=typeSpecifier(specCount); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((LA(1)==LITERAL_volatile||LA(1)==LITERAL_const)) { + typeQualifier(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt38>=1 ) { break _loop38; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt38++; + } while (true); + } + specifierQualifierList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_24); + } else { + throw ex; + } + } + returnAST = specifierQualifierList_AST; + } + + public final void structDeclaratorList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structDeclaratorList_AST = null; + + try { // for error handling + structDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop41: + do { + if ((LA(1)==COMMA)) { + match(COMMA); + structDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop41; + } + + } while (true); + } + structDeclaratorList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_16); + } else { + throw ex; + } + } + returnAST = structDeclaratorList_AST; + } + + public final void structDeclarator() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structDeclarator_AST = null; + + try { // for error handling + { + switch ( LA(1)) { + case COLON: + { + TNode tmp39_AST = null; + tmp39_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp39_AST); + match(COLON); + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case ID: + case STAR: + case LPAREN: + { + declarator(false); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case COLON: + { + TNode tmp40_AST = null; + tmp40_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp40_AST); + match(COLON); + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case SEMI: + case COMMA: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + structDeclarator_AST = (TNode)currentAST.root; + structDeclarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStructDeclarator)).add(structDeclarator_AST)); + currentAST.root = structDeclarator_AST; + currentAST.child = structDeclarator_AST!=null &&structDeclarator_AST.getFirstChild()!=null ? + structDeclarator_AST.getFirstChild() : structDeclarator_AST; + currentAST.advanceChildToEnd(); + } + structDeclarator_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_25); + } else { + throw ex; + } + } + returnAST = structDeclarator_AST; + } + + public final void constExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode constExpr_AST = null; + + try { // for error handling + conditionalExpr(); + astFactory.addASTChild(currentAST, returnAST); + constExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_26); + } else { + throw ex; + } + } + returnAST = constExpr_AST; + } + + public final String declarator( + boolean isFunctionDefinition + ) throws RecognitionException, TokenStreamException { + String declName; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declarator_AST = null; + Token id = null; + TNode id_AST = null; + TNode p_AST = null; + TNode i_AST = null; + declName = ""; + + try { // for error handling + { + switch ( LA(1)) { + case STAR: + { + pointerGroup(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case ID: + case LPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case ID: + { + id = LT(1); + id_AST = (TNode)astFactory.create(id); + astFactory.addASTChild(currentAST, id_AST); + match(ID); + if ( inputState.guessing==0 ) { + declName = id.getText(); + } + break; + } + case LPAREN: + { + TNode tmp41_AST = null; + tmp41_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp41_AST); + match(LPAREN); + declName=declarator(false); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp42_AST = null; + tmp42_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp42_AST); + match(RPAREN); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + _loop82: + do { + switch ( LA(1)) { + case LPAREN: + { + TNode tmp43_AST = null; + tmp43_AST = (TNode)astFactory.create(LT(1)); + match(LPAREN); + if ( inputState.guessing==0 ) { + + if (isFunctionDefinition) { + pushScope(declName); + } + else { + pushScope("!"+declName); + } + + } + { + boolean synPredMatched79 = false; + if (((_tokenSet_2.member(LA(1))) && (_tokenSet_27.member(LA(2))))) { + int _m79 = mark(); + synPredMatched79 = true; + inputState.guessing++; + try { + { + declSpecifiers(); + } + } + catch (RecognitionException pe) { + synPredMatched79 = false; + } + rewind(_m79); + inputState.guessing--; + } + if ( synPredMatched79 ) { + parameterTypeList(); + p_AST = (TNode)returnAST; + if ( inputState.guessing==0 ) { + declarator_AST = (TNode)currentAST.root; + + declarator_AST = (TNode)astFactory.make( (new ASTArray(3)).add(null).add(declarator_AST).add((TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NParameterTypeList)).add(p_AST)))); + + currentAST.root = declarator_AST; + currentAST.child = declarator_AST!=null &&declarator_AST.getFirstChild()!=null ? + declarator_AST.getFirstChild() : declarator_AST; + currentAST.advanceChildToEnd(); + } + } + else if ((LA(1)==ID||LA(1)==RPAREN) && (_tokenSet_28.member(LA(2)))) { + { + switch ( LA(1)) { + case ID: + { + idList(); + i_AST = (TNode)returnAST; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + declarator_AST = (TNode)currentAST.root; + + declarator_AST = (TNode)astFactory.make( (new ASTArray(3)).add(null).add(declarator_AST).add((TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NParameterTypeList)).add(i_AST)))); + + currentAST.root = declarator_AST; + currentAST.child = declarator_AST!=null &&declarator_AST.getFirstChild()!=null ? + declarator_AST.getFirstChild() : declarator_AST; + currentAST.advanceChildToEnd(); + } + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState.guessing==0 ) { + + popScope(); + + } + TNode tmp44_AST = null; + tmp44_AST = (TNode)astFactory.create(LT(1)); + match(RPAREN); + break; + } + case LBRACKET: + { + TNode tmp45_AST = null; + tmp45_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp45_AST); + match(LBRACKET); + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp46_AST = null; + tmp46_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp46_AST); + match(RBRACKET); + break; + } + default: + { + break _loop82; + } + } + } while (true); + } + if ( inputState.guessing==0 ) { + declarator_AST = (TNode)currentAST.root; + declarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NDeclarator)).add(declarator_AST)); + currentAST.root = declarator_AST; + currentAST.child = declarator_AST!=null &&declarator_AST.getFirstChild()!=null ? + declarator_AST.getFirstChild() : declarator_AST; + currentAST.advanceChildToEnd(); + } + declarator_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_29); + } else { + throw ex; + } + } + returnAST = declarator_AST; + return declName; + } + + public final void enumList( + String enumName + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode enumList_AST = null; + + try { // for error handling + enumerator(enumName); + astFactory.addASTChild(currentAST, returnAST); + { + _loop51: + do { + if ((LA(1)==COMMA)) { + match(COMMA); + enumerator(enumName); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop51; + } + + } while (true); + } + enumList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_21); + } else { + throw ex; + } + } + returnAST = enumList_AST; + } + + public final void enumerator( + String enumName + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode enumerator_AST = null; + Token i = null; + TNode i_AST = null; + + try { // for error handling + i = LT(1); + i_AST = (TNode)astFactory.create(i); + astFactory.addASTChild(currentAST, i_AST); + match(ID); + if ( inputState.guessing==0 ) { + symbolTable.add( i.getText(), + (TNode)astFactory.make( (new ASTArray(3)).add(null).add((TNode)astFactory.create(LITERAL_enum,"enum")).add((TNode)astFactory.create(ID,enumName))) + ); + + } + { + switch ( LA(1)) { + case ASSIGN: + { + TNode tmp48_AST = null; + tmp48_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp48_AST); + match(ASSIGN); + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RCURLY: + case COMMA: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + enumerator_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_30); + } else { + throw ex; + } + } + returnAST = enumerator_AST; + } + + public final void initDecl( + AST declarationSpecifiers + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode initDecl_AST = null; + TNode d_AST = null; + String declName = ""; + + try { // for error handling + declName=declarator(false); + d_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + AST ds1, d1; + ds1 = astFactory.dupList(declarationSpecifiers); + d1 = astFactory.dupList(d_AST); + symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds1).add(d1)) ); + + } + { + switch ( LA(1)) { + case ASSIGN: + { + TNode tmp49_AST = null; + tmp49_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp49_AST); + match(ASSIGN); + initializer(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case COLON: + { + TNode tmp50_AST = null; + tmp50_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp50_AST); + match(COLON); + expr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case SEMI: + case COMMA: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + initDecl_AST = (TNode)currentAST.root; + initDecl_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NInitDecl)).add(initDecl_AST)); + currentAST.root = initDecl_AST; + currentAST.child = initDecl_AST!=null &&initDecl_AST.getFirstChild()!=null ? + initDecl_AST.getFirstChild() : initDecl_AST; + currentAST.advanceChildToEnd(); + } + initDecl_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_25); + } else { + throw ex; + } + } + returnAST = initDecl_AST; + } + + public final void initializer() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode initializer_AST = null; + + try { // for error handling + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LCURLY: + { + TNode tmp51_AST = null; + tmp51_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp51_AST); + match(LCURLY); + initializerList(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case COMMA: + { + match(COMMA); + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + match(RCURLY); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + initializer_AST = (TNode)currentAST.root; + initializer_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NInitializer)).add(initializer_AST)); + currentAST.root = initializer_AST; + currentAST.child = initializer_AST!=null &&initializer_AST.getFirstChild()!=null ? + initializer_AST.getFirstChild() : initializer_AST; + currentAST.advanceChildToEnd(); + } + initializer_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_31); + } else { + throw ex; + } + } + returnAST = initializer_AST; + } + + public final void pointerGroup() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode pointerGroup_AST = null; + + try { // for error handling + { + int _cnt63=0; + _loop63: + do { + if ((LA(1)==STAR)) { + TNode tmp54_AST = null; + tmp54_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp54_AST); + match(STAR); + { + _loop62: + do { + if ((LA(1)==LITERAL_volatile||LA(1)==LITERAL_const)) { + typeQualifier(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop62; + } + + } while (true); + } + } + else { + if ( _cnt63>=1 ) { break _loop63; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt63++; + } while (true); + } + if ( inputState.guessing==0 ) { + pointerGroup_AST = (TNode)currentAST.root; + pointerGroup_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NPointerGroup)).add(pointerGroup_AST)); + currentAST.root = pointerGroup_AST; + currentAST.child = pointerGroup_AST!=null &&pointerGroup_AST.getFirstChild()!=null ? + pointerGroup_AST.getFirstChild() : pointerGroup_AST; + currentAST.advanceChildToEnd(); + } + pointerGroup_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_32); + } else { + throw ex; + } + } + returnAST = pointerGroup_AST; + } + + public final void idList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode idList_AST = null; + + try { // for error handling + TNode tmp55_AST = null; + tmp55_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp55_AST); + match(ID); + { + _loop66: + do { + if ((LA(1)==COMMA)) { + match(COMMA); + TNode tmp57_AST = null; + tmp57_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp57_AST); + match(ID); + } + else { + break _loop66; + } + + } while (true); + } + idList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_33); + } else { + throw ex; + } + } + returnAST = idList_AST; + } + + public final void assignExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode assignExpr_AST = null; + TNode a_AST = null; + + try { // for error handling + conditionalExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case ASSIGN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + { + assignOperator(); + a_AST = (TNode)returnAST; + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + assignExpr_AST = (TNode)currentAST.root; + assignExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add(a_AST).add(assignExpr_AST)); + currentAST.root = assignExpr_AST; + currentAST.child = assignExpr_AST!=null &&assignExpr_AST.getFirstChild()!=null ? + assignExpr_AST.getFirstChild() : assignExpr_AST; + currentAST.advanceChildToEnd(); + } + break; + } + case RCURLY: + case SEMI: + case COMMA: + case COLON: + case RPAREN: + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + assignExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_12); + } else { + throw ex; + } + } + returnAST = assignExpr_AST; + } + + public final void initializerList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode initializerList_AST = null; + + try { // for error handling + initializer(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop72: + do { + if ((LA(1)==COMMA) && (_tokenSet_34.member(LA(2)))) { + match(COMMA); + initializer(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop72; + } + + } while (true); + } + initializerList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_30); + } else { + throw ex; + } + } + returnAST = initializerList_AST; + } + + public final void parameterTypeList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode parameterTypeList_AST = null; + + try { // for error handling + parameterDeclaration(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop85: + do { + if ((LA(1)==COMMA) && (_tokenSet_2.member(LA(2)))) { + match(COMMA); + parameterDeclaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop85; + } + + } while (true); + } + { + switch ( LA(1)) { + case COMMA: + { + match(COMMA); + TNode tmp61_AST = null; + tmp61_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp61_AST); + match(VARARGS); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + parameterTypeList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_33); + } else { + throw ex; + } + } + returnAST = parameterTypeList_AST; + } + + public final void parameterDeclaration() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode parameterDeclaration_AST = null; + TNode ds_AST = null; + TNode d_AST = null; + String declName; + + try { // for error handling + declSpecifiers(); + ds_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + { + boolean synPredMatched90 = false; + if (((_tokenSet_10.member(LA(1))) && (_tokenSet_35.member(LA(2))))) { + int _m90 = mark(); + synPredMatched90 = true; + inputState.guessing++; + try { + { + declarator(false); + } + } + catch (RecognitionException pe) { + synPredMatched90 = false; + } + rewind(_m90); + inputState.guessing--; + } + if ( synPredMatched90 ) { + declName=declarator(false); + d_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + + AST d2, ds2; + d2 = astFactory.dupList(d_AST); + ds2 = astFactory.dupList(ds_AST); + symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds2).add(d2))); + + } + } + else if ((_tokenSet_36.member(LA(1))) && (_tokenSet_37.member(LA(2)))) { + nonemptyAbstractDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((LA(1)==COMMA||LA(1)==RPAREN)) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState.guessing==0 ) { + parameterDeclaration_AST = (TNode)currentAST.root; + + parameterDeclaration_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NParameterDeclaration)).add(parameterDeclaration_AST)); + + currentAST.root = parameterDeclaration_AST; + currentAST.child = parameterDeclaration_AST!=null &¶meterDeclaration_AST.getFirstChild()!=null ? + parameterDeclaration_AST.getFirstChild() : parameterDeclaration_AST; + currentAST.advanceChildToEnd(); + } + parameterDeclaration_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_38); + } else { + throw ex; + } + } + returnAST = parameterDeclaration_AST; + } + + public final void nonemptyAbstractDeclarator() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode nonemptyAbstractDeclarator_AST = null; + + try { // for error handling + { + switch ( LA(1)) { + case STAR: + { + pointerGroup(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop184: + do { + switch ( LA(1)) { + case LPAREN: + { + { + TNode tmp62_AST = null; + tmp62_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp62_AST); + match(LPAREN); + { + switch ( LA(1)) { + case STAR: + case LPAREN: + case LBRACKET: + { + nonemptyAbstractDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_typedef: + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_auto: + case LITERAL_register: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case ID: + { + parameterTypeList(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp63_AST = null; + tmp63_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp63_AST); + match(RPAREN); + } + break; + } + case LBRACKET: + { + { + TNode tmp64_AST = null; + tmp64_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp64_AST); + match(LBRACKET); + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + expr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp65_AST = null; + tmp65_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp65_AST); + match(RBRACKET); + } + break; + } + default: + { + break _loop184; + } + } + } while (true); + } + break; + } + case LPAREN: + case LBRACKET: + { + { + int _cnt190=0; + _loop190: + do { + switch ( LA(1)) { + case LPAREN: + { + { + TNode tmp66_AST = null; + tmp66_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp66_AST); + match(LPAREN); + { + switch ( LA(1)) { + case STAR: + case LPAREN: + case LBRACKET: + { + nonemptyAbstractDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_typedef: + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_auto: + case LITERAL_register: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case ID: + { + parameterTypeList(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp67_AST = null; + tmp67_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp67_AST); + match(RPAREN); + } + break; + } + case LBRACKET: + { + { + TNode tmp68_AST = null; + tmp68_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp68_AST); + match(LBRACKET); + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + expr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp69_AST = null; + tmp69_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp69_AST); + match(RBRACKET); + } + break; + } + default: + { + if ( _cnt190>=1 ) { break _loop190; } else {throw new NoViableAltException(LT(1), getFilename());} + } + } + _cnt190++; + } while (true); + } + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + nonemptyAbstractDeclarator_AST = (TNode)currentAST.root; + nonemptyAbstractDeclarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NNonemptyAbstractDeclarator)).add(nonemptyAbstractDeclarator_AST)); + currentAST.root = nonemptyAbstractDeclarator_AST; + currentAST.child = nonemptyAbstractDeclarator_AST!=null &&nonemptyAbstractDeclarator_AST.getFirstChild()!=null ? + nonemptyAbstractDeclarator_AST.getFirstChild() : nonemptyAbstractDeclarator_AST; + currentAST.advanceChildToEnd(); + } + nonemptyAbstractDeclarator_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_38); + } else { + throw ex; + } + } + returnAST = nonemptyAbstractDeclarator_AST; + } + + public final void functionDeclSpecifiers() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode functionDeclSpecifiers_AST = null; + int specCount = 0; + + try { // for error handling + { + int _cnt104=0; + _loop104: + do { + switch ( LA(1)) { + case LITERAL_extern: + case LITERAL_static: + { + functionStorageClassSpecifier(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_volatile: + case LITERAL_const: + { + typeQualifier(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + default: + boolean synPredMatched103 = false; + if (((_tokenSet_13.member(LA(1))) && (_tokenSet_9.member(LA(2))))) { + int _m103 = mark(); + synPredMatched103 = true; + inputState.guessing++; + try { + { + if ((LA(1)==LITERAL_struct) && (true)) { + match(LITERAL_struct); + } + else if ((LA(1)==LITERAL_union) && (true)) { + match(LITERAL_union); + } + else if ((LA(1)==LITERAL_enum) && (true)) { + match(LITERAL_enum); + } + else if ((_tokenSet_13.member(LA(1))) && (true)) { + typeSpecifier(specCount); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + } + catch (RecognitionException pe) { + synPredMatched103 = false; + } + rewind(_m103); + inputState.guessing--; + } + if ( synPredMatched103 ) { + specCount=typeSpecifier(specCount); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt104>=1 ) { break _loop104; } else {throw new NoViableAltException(LT(1), getFilename());} + } + } + _cnt104++; + } while (true); + } + functionDeclSpecifiers_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_10); + } else { + throw ex; + } + } + returnAST = functionDeclSpecifiers_AST; + } + + public final void compoundStatement( + String scopeName + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode compoundStatement_AST = null; + + try { // for error handling + match(LCURLY); + if ( inputState.guessing==0 ) { + + pushScope(scopeName); + + } + { + boolean synPredMatched115 = false; + if (((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))))) { + int _m115 = mark(); + synPredMatched115 = true; + inputState.guessing++; + try { + { + declarationPredictor(); + } + } + catch (RecognitionException pe) { + synPredMatched115 = false; + } + rewind(_m115); + inputState.guessing--; + } + if ( synPredMatched115 ) { + declarationList(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_39.member(LA(1))) && (_tokenSet_40.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + { + switch ( LA(1)) { + case LCURLY: + case SEMI: + case ID: + case STAR: + case LPAREN: + case LITERAL_while: + case LITERAL_do: + case LITERAL_for: + case LITERAL_goto: + case LITERAL_continue: + case LITERAL_break: + case LITERAL_return: + case LITERAL_case: + case LITERAL_default: + case LITERAL_if: + case LITERAL_switch: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + statementList(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + popScope(); + } + match(RCURLY); + if ( inputState.guessing==0 ) { + compoundStatement_AST = (TNode)currentAST.root; + compoundStatement_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NCompoundStatement,scopeName)).add(compoundStatement_AST)); + currentAST.root = compoundStatement_AST; + currentAST.child = compoundStatement_AST!=null &&compoundStatement_AST.getFirstChild()!=null ? + compoundStatement_AST.getFirstChild() : compoundStatement_AST; + currentAST.advanceChildToEnd(); + } + compoundStatement_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_41); + } else { + throw ex; + } + } + returnAST = compoundStatement_AST; + } + + public final void declarationList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declarationList_AST = null; + + try { // for error handling + { + int _cnt109=0; + _loop109: + do { + boolean synPredMatched108 = false; + if (((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))))) { + int _m108 = mark(); + synPredMatched108 = true; + inputState.guessing++; + try { + { + declarationPredictor(); + } + } + catch (RecognitionException pe) { + synPredMatched108 = false; + } + rewind(_m108); + inputState.guessing--; + } + if ( synPredMatched108 ) { + declaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt109>=1 ) { break _loop109; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt109++; + } while (true); + } + declarationList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_39); + } else { + throw ex; + } + } + returnAST = declarationList_AST; + } + + public final void declarationPredictor() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declarationPredictor_AST = null; + + try { // for error handling + { + if ((LA(1)==LITERAL_typedef) && (LA(2)==EOF)) { + TNode tmp72_AST = null; + tmp72_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp72_AST); + match(LITERAL_typedef); + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2)))) { + declaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + declarationPredictor_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_0); + } else { + throw ex; + } + } + returnAST = declarationPredictor_AST; + } + + public final void statementList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode statementList_AST = null; + + try { // for error handling + { + int _cnt119=0; + _loop119: + do { + if ((_tokenSet_42.member(LA(1)))) { + statement(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt119>=1 ) { break _loop119; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt119++; + } while (true); + } + statementList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_21); + } else { + throw ex; + } + } + returnAST = statementList_AST; + } + + public final void statement() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode statement_AST = null; + TNode e1_AST = null; + TNode e2_AST = null; + TNode e3_AST = null; + TNode s_AST = null; + + try { // for error handling + switch ( LA(1)) { + case SEMI: + { + TNode tmp73_AST = null; + tmp73_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp73_AST); + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LCURLY: + { + compoundStatement(getAScopeName()); + astFactory.addASTChild(currentAST, returnAST); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_while: + { + TNode tmp74_AST = null; + tmp74_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp74_AST); + match(LITERAL_while); + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + statement(); + astFactory.addASTChild(currentAST, returnAST); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_do: + { + TNode tmp77_AST = null; + tmp77_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp77_AST); + match(LITERAL_do); + statement(); + astFactory.addASTChild(currentAST, returnAST); + match(LITERAL_while); + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_for: + { + match(LITERAL_for); + TNode tmp83_AST = null; + tmp83_AST = (TNode)astFactory.create(LT(1)); + match(LPAREN); + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + expr(); + e1_AST = (TNode)returnAST; + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp84_AST = null; + tmp84_AST = (TNode)astFactory.create(LT(1)); + match(SEMI); + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + expr(); + e2_AST = (TNode)returnAST; + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp85_AST = null; + tmp85_AST = (TNode)astFactory.create(LT(1)); + match(SEMI); + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + expr(); + e3_AST = (TNode)returnAST; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp86_AST = null; + tmp86_AST = (TNode)astFactory.create(LT(1)); + match(RPAREN); + statement(); + s_AST = (TNode)returnAST; + if ( inputState.guessing==0 ) { + statement_AST = (TNode)currentAST.root; + + if ( e1_AST == null) { e1_AST = (TNode)astFactory.create(NEmptyExpression); } + if ( e2_AST == null) { e2_AST = (TNode)astFactory.create(NEmptyExpression); } + if ( e3_AST == null) { e3_AST = (TNode)astFactory.create(NEmptyExpression); } + statement_AST = (TNode)astFactory.make( (new ASTArray(5)).add((TNode)astFactory.create(LITERAL_for,"for")).add(e1_AST).add(e2_AST).add(e3_AST).add(s_AST)); + + currentAST.root = statement_AST; + currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? + statement_AST.getFirstChild() : statement_AST; + currentAST.advanceChildToEnd(); + } + break; + } + case LITERAL_goto: + { + TNode tmp87_AST = null; + tmp87_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp87_AST); + match(LITERAL_goto); + TNode tmp88_AST = null; + tmp88_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp88_AST); + match(ID); + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_continue: + { + TNode tmp90_AST = null; + tmp90_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp90_AST); + match(LITERAL_continue); + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_break: + { + TNode tmp92_AST = null; + tmp92_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp92_AST); + match(LITERAL_break); + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_return: + { + TNode tmp94_AST = null; + tmp94_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp94_AST); + match(LITERAL_return); + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + expr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_case: + { + TNode tmp96_AST = null; + tmp96_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp96_AST); + match(LITERAL_case); + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + match(COLON); + statement(); + astFactory.addASTChild(currentAST, returnAST); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_default: + { + TNode tmp98_AST = null; + tmp98_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp98_AST); + match(LITERAL_default); + match(COLON); + statement(); + astFactory.addASTChild(currentAST, returnAST); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_if: + { + TNode tmp100_AST = null; + tmp100_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp100_AST); + match(LITERAL_if); + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + statement(); + astFactory.addASTChild(currentAST, returnAST); + { + if ((LA(1)==LITERAL_else) && (_tokenSet_42.member(LA(2)))) { + TNode tmp103_AST = null; + tmp103_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp103_AST); + match(LITERAL_else); + statement(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_40.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_switch: + { + TNode tmp104_AST = null; + tmp104_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp104_AST); + match(LITERAL_switch); + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + statement(); + astFactory.addASTChild(currentAST, returnAST); + statement_AST = (TNode)currentAST.root; + break; + } + default: + if ((_tokenSet_11.member(LA(1))) && (_tokenSet_44.member(LA(2)))) { + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(SEMI); + if ( inputState.guessing==0 ) { + statement_AST = (TNode)currentAST.root; + statement_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStatementExpr)).add(statement_AST)); + currentAST.root = statement_AST; + currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? + statement_AST.getFirstChild() : statement_AST; + currentAST.advanceChildToEnd(); + } + statement_AST = (TNode)currentAST.root; + } + else if ((LA(1)==ID) && (LA(2)==COLON)) { + TNode tmp108_AST = null; + tmp108_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp108_AST); + match(ID); + match(COLON); + { + if ((_tokenSet_42.member(LA(1))) && (_tokenSet_45.member(LA(2)))) { + statement(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_40.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState.guessing==0 ) { + statement_AST = (TNode)currentAST.root; + statement_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NLabel)).add(statement_AST)); + currentAST.root = statement_AST; + currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? + statement_AST.getFirstChild() : statement_AST; + currentAST.advanceChildToEnd(); + } + statement_AST = (TNode)currentAST.root; + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_43); + } else { + throw ex; + } + } + returnAST = statement_AST; + } + + public final void conditionalExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode conditionalExpr_AST = null; + + try { // for error handling + logicalOrExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case QUESTION: + { + TNode tmp110_AST = null; + tmp110_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp110_AST); + match(QUESTION); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(COLON); + conditionalExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RCURLY: + case SEMI: + case COMMA: + case COLON: + case ASSIGN: + case RPAREN: + case RBRACKET: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + conditionalExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_46); + } else { + throw ex; + } + } + returnAST = conditionalExpr_AST; + } + + public final void assignOperator() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode assignOperator_AST = null; + + try { // for error handling + switch ( LA(1)) { + case ASSIGN: + { + TNode tmp112_AST = null; + tmp112_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp112_AST); + match(ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case DIV_ASSIGN: + { + TNode tmp113_AST = null; + tmp113_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp113_AST); + match(DIV_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case PLUS_ASSIGN: + { + TNode tmp114_AST = null; + tmp114_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp114_AST); + match(PLUS_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case MINUS_ASSIGN: + { + TNode tmp115_AST = null; + tmp115_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp115_AST); + match(MINUS_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case STAR_ASSIGN: + { + TNode tmp116_AST = null; + tmp116_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp116_AST); + match(STAR_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case MOD_ASSIGN: + { + TNode tmp117_AST = null; + tmp117_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp117_AST); + match(MOD_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case RSHIFT_ASSIGN: + { + TNode tmp118_AST = null; + tmp118_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp118_AST); + match(RSHIFT_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case LSHIFT_ASSIGN: + { + TNode tmp119_AST = null; + tmp119_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp119_AST); + match(LSHIFT_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case BAND_ASSIGN: + { + TNode tmp120_AST = null; + tmp120_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp120_AST); + match(BAND_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case BOR_ASSIGN: + { + TNode tmp121_AST = null; + tmp121_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp121_AST); + match(BOR_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case BXOR_ASSIGN: + { + TNode tmp122_AST = null; + tmp122_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp122_AST); + match(BXOR_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_11); + } else { + throw ex; + } + } + returnAST = assignOperator_AST; + } + + public final void logicalOrExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode logicalOrExpr_AST = null; + + try { // for error handling + logicalAndExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop138: + do { + if ((LA(1)==LOR)) { + TNode tmp123_AST = null; + tmp123_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp123_AST); + match(LOR); + logicalAndExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop138; + } + + } while (true); + } + logicalOrExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_47); + } else { + throw ex; + } + } + returnAST = logicalOrExpr_AST; + } + + public final void logicalAndExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode logicalAndExpr_AST = null; + + try { // for error handling + inclusiveOrExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop141: + do { + if ((LA(1)==LAND)) { + TNode tmp124_AST = null; + tmp124_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp124_AST); + match(LAND); + inclusiveOrExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop141; + } + + } while (true); + } + logicalAndExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_48); + } else { + throw ex; + } + } + returnAST = logicalAndExpr_AST; + } + + public final void inclusiveOrExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode inclusiveOrExpr_AST = null; + + try { // for error handling + exclusiveOrExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop144: + do { + if ((LA(1)==BOR)) { + TNode tmp125_AST = null; + tmp125_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp125_AST); + match(BOR); + exclusiveOrExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop144; + } + + } while (true); + } + inclusiveOrExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_49); + } else { + throw ex; + } + } + returnAST = inclusiveOrExpr_AST; + } + + public final void exclusiveOrExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode exclusiveOrExpr_AST = null; + + try { // for error handling + bitAndExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop147: + do { + if ((LA(1)==BXOR)) { + TNode tmp126_AST = null; + tmp126_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp126_AST); + match(BXOR); + bitAndExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop147; + } + + } while (true); + } + exclusiveOrExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_50); + } else { + throw ex; + } + } + returnAST = exclusiveOrExpr_AST; + } + + public final void bitAndExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode bitAndExpr_AST = null; + + try { // for error handling + equalityExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop150: + do { + if ((LA(1)==BAND)) { + TNode tmp127_AST = null; + tmp127_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp127_AST); + match(BAND); + equalityExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop150; + } + + } while (true); + } + bitAndExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_51); + } else { + throw ex; + } + } + returnAST = bitAndExpr_AST; + } + + public final void equalityExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode equalityExpr_AST = null; + + try { // for error handling + relationalExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop154: + do { + if ((LA(1)==EQUAL||LA(1)==NOT_EQUAL)) { + { + switch ( LA(1)) { + case EQUAL: + { + TNode tmp128_AST = null; + tmp128_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp128_AST); + match(EQUAL); + break; + } + case NOT_EQUAL: + { + TNode tmp129_AST = null; + tmp129_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp129_AST); + match(NOT_EQUAL); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + relationalExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop154; + } + + } while (true); + } + equalityExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_52); + } else { + throw ex; + } + } + returnAST = equalityExpr_AST; + } + + public final void relationalExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode relationalExpr_AST = null; + + try { // for error handling + shiftExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop158: + do { + if (((LA(1) >= LT && LA(1) <= GTE))) { + { + switch ( LA(1)) { + case LT: + { + TNode tmp130_AST = null; + tmp130_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp130_AST); + match(LT); + break; + } + case LTE: + { + TNode tmp131_AST = null; + tmp131_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp131_AST); + match(LTE); + break; + } + case GT: + { + TNode tmp132_AST = null; + tmp132_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp132_AST); + match(GT); + break; + } + case GTE: + { + TNode tmp133_AST = null; + tmp133_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp133_AST); + match(GTE); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + shiftExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop158; + } + + } while (true); + } + relationalExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_53); + } else { + throw ex; + } + } + returnAST = relationalExpr_AST; + } + + public final void shiftExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode shiftExpr_AST = null; + + try { // for error handling + additiveExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop162: + do { + if ((LA(1)==LSHIFT||LA(1)==RSHIFT)) { + { + switch ( LA(1)) { + case LSHIFT: + { + TNode tmp134_AST = null; + tmp134_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp134_AST); + match(LSHIFT); + break; + } + case RSHIFT: + { + TNode tmp135_AST = null; + tmp135_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp135_AST); + match(RSHIFT); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + additiveExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop162; + } + + } while (true); + } + shiftExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_54); + } else { + throw ex; + } + } + returnAST = shiftExpr_AST; + } + + public final void additiveExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode additiveExpr_AST = null; + + try { // for error handling + multExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop166: + do { + if ((LA(1)==PLUS||LA(1)==MINUS)) { + { + switch ( LA(1)) { + case PLUS: + { + TNode tmp136_AST = null; + tmp136_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp136_AST); + match(PLUS); + break; + } + case MINUS: + { + TNode tmp137_AST = null; + tmp137_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp137_AST); + match(MINUS); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + multExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop166; + } + + } while (true); + } + additiveExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_55); + } else { + throw ex; + } + } + returnAST = additiveExpr_AST; + } + + public final void multExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode multExpr_AST = null; + + try { // for error handling + castExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop170: + do { + if ((_tokenSet_56.member(LA(1)))) { + { + switch ( LA(1)) { + case STAR: + { + TNode tmp138_AST = null; + tmp138_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp138_AST); + match(STAR); + break; + } + case DIV: + { + TNode tmp139_AST = null; + tmp139_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp139_AST); + match(DIV); + break; + } + case MOD: + { + TNode tmp140_AST = null; + tmp140_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp140_AST); + match(MOD); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + castExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop170; + } + + } while (true); + } + multExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_57); + } else { + throw ex; + } + } + returnAST = multExpr_AST; + } + + public final void castExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode castExpr_AST = null; + + try { // for error handling + boolean synPredMatched173 = false; + if (((LA(1)==LPAREN) && (_tokenSet_20.member(LA(2))))) { + int _m173 = mark(); + synPredMatched173 = true; + inputState.guessing++; + try { + { + match(LPAREN); + typeName(); + match(RPAREN); + } + } + catch (RecognitionException pe) { + synPredMatched173 = false; + } + rewind(_m173); + inputState.guessing--; + } + if ( synPredMatched173 ) { + match(LPAREN); + typeName(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + { + castExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + if ( inputState.guessing==0 ) { + castExpr_AST = (TNode)currentAST.root; + castExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NCast,"(")).add(castExpr_AST)); + currentAST.root = castExpr_AST; + currentAST.child = castExpr_AST!=null &&castExpr_AST.getFirstChild()!=null ? + castExpr_AST.getFirstChild() : castExpr_AST; + currentAST.advanceChildToEnd(); + } + castExpr_AST = (TNode)currentAST.root; + } + else if ((_tokenSet_11.member(LA(1))) && (_tokenSet_58.member(LA(2)))) { + unaryExpr(); + astFactory.addASTChild(currentAST, returnAST); + castExpr_AST = (TNode)currentAST.root; + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_59); + } else { + throw ex; + } + } + returnAST = castExpr_AST; + } + + public final void typeName() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode typeName_AST = null; + + try { // for error handling + specifierQualifierList(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case STAR: + case LPAREN: + case LBRACKET: + { + nonemptyAbstractDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + typeName_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_33); + } else { + throw ex; + } + } + returnAST = typeName_AST; + } + + public final void unaryExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode unaryExpr_AST = null; + TNode u_AST = null; + + try { // for error handling + switch ( LA(1)) { + case ID: + case LPAREN: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + postfixExpr(); + astFactory.addASTChild(currentAST, returnAST); + unaryExpr_AST = (TNode)currentAST.root; + break; + } + case INC: + { + TNode tmp143_AST = null; + tmp143_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp143_AST); + match(INC); + unaryExpr(); + astFactory.addASTChild(currentAST, returnAST); + unaryExpr_AST = (TNode)currentAST.root; + break; + } + case DEC: + { + TNode tmp144_AST = null; + tmp144_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp144_AST); + match(DEC); + unaryExpr(); + astFactory.addASTChild(currentAST, returnAST); + unaryExpr_AST = (TNode)currentAST.root; + break; + } + case STAR: + case BAND: + case PLUS: + case MINUS: + case BNOT: + case LNOT: + { + unaryOperator(); + u_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + castExpr(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + unaryExpr_AST = (TNode)currentAST.root; + unaryExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NUnaryExpr)).add(unaryExpr_AST)); + currentAST.root = unaryExpr_AST; + currentAST.child = unaryExpr_AST!=null &&unaryExpr_AST.getFirstChild()!=null ? + unaryExpr_AST.getFirstChild() : unaryExpr_AST; + currentAST.advanceChildToEnd(); + } + unaryExpr_AST = (TNode)currentAST.root; + break; + } + case LITERAL_sizeof: + { + TNode tmp145_AST = null; + tmp145_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp145_AST); + match(LITERAL_sizeof); + { + boolean synPredMatched194 = false; + if (((LA(1)==LPAREN) && (_tokenSet_20.member(LA(2))))) { + int _m194 = mark(); + synPredMatched194 = true; + inputState.guessing++; + try { + { + match(LPAREN); + typeName(); + } + } + catch (RecognitionException pe) { + synPredMatched194 = false; + } + rewind(_m194); + inputState.guessing--; + } + if ( synPredMatched194 ) { + TNode tmp146_AST = null; + tmp146_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp146_AST); + match(LPAREN); + typeName(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp147_AST = null; + tmp147_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp147_AST); + match(RPAREN); + } + else if ((_tokenSet_11.member(LA(1))) && (_tokenSet_58.member(LA(2)))) { + unaryExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + unaryExpr_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_59); + } else { + throw ex; + } + } + returnAST = unaryExpr_AST; + } + + public final void postfixExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode postfixExpr_AST = null; + + try { // for error handling + primaryExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case LPAREN: + case LBRACKET: + case INC: + case DEC: + case PTR: + case DOT: + { + postfixSuffix(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + postfixExpr_AST = (TNode)currentAST.root; + postfixExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NPostfixExpr)).add(postfixExpr_AST)); + currentAST.root = postfixExpr_AST; + currentAST.child = postfixExpr_AST!=null &&postfixExpr_AST.getFirstChild()!=null ? + postfixExpr_AST.getFirstChild() : postfixExpr_AST; + currentAST.advanceChildToEnd(); + } + break; + } + case RCURLY: + case SEMI: + case COMMA: + case COLON: + case ASSIGN: + case STAR: + case RPAREN: + case RBRACKET: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + postfixExpr_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_59); + } else { + throw ex; + } + } + returnAST = postfixExpr_AST; + } + + public final void unaryOperator() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode unaryOperator_AST = null; + + try { // for error handling + switch ( LA(1)) { + case BAND: + { + TNode tmp148_AST = null; + tmp148_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp148_AST); + match(BAND); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case STAR: + { + TNode tmp149_AST = null; + tmp149_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp149_AST); + match(STAR); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case PLUS: + { + TNode tmp150_AST = null; + tmp150_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp150_AST); + match(PLUS); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case MINUS: + { + TNode tmp151_AST = null; + tmp151_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp151_AST); + match(MINUS); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case BNOT: + { + TNode tmp152_AST = null; + tmp152_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp152_AST); + match(BNOT); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case LNOT: + { + TNode tmp153_AST = null; + tmp153_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp153_AST); + match(LNOT); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_11); + } else { + throw ex; + } + } + returnAST = unaryOperator_AST; + } + + public final void primaryExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode primaryExpr_AST = null; + + try { // for error handling + switch ( LA(1)) { + case ID: + { + TNode tmp154_AST = null; + tmp154_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp154_AST); + match(ID); + primaryExpr_AST = (TNode)currentAST.root; + break; + } + case CharLiteral: + { + charConst(); + astFactory.addASTChild(currentAST, returnAST); + primaryExpr_AST = (TNode)currentAST.root; + break; + } + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + { + intConst(); + astFactory.addASTChild(currentAST, returnAST); + primaryExpr_AST = (TNode)currentAST.root; + break; + } + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + floatConst(); + astFactory.addASTChild(currentAST, returnAST); + primaryExpr_AST = (TNode)currentAST.root; + break; + } + case StringLiteral: + { + stringConst(); + astFactory.addASTChild(currentAST, returnAST); + primaryExpr_AST = (TNode)currentAST.root; + break; + } + case LPAREN: + { + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + if ( inputState.guessing==0 ) { + primaryExpr_AST = (TNode)currentAST.root; + primaryExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NExpressionGroup,"(")).add(primaryExpr_AST)); + currentAST.root = primaryExpr_AST; + currentAST.child = primaryExpr_AST!=null &&primaryExpr_AST.getFirstChild()!=null ? + primaryExpr_AST.getFirstChild() : primaryExpr_AST; + currentAST.advanceChildToEnd(); + } + primaryExpr_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_60); + } else { + throw ex; + } + } + returnAST = primaryExpr_AST; + } + + public final void postfixSuffix() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode postfixSuffix_AST = null; + + try { // for error handling + { + int _cnt200=0; + _loop200: + do { + switch ( LA(1)) { + case PTR: + { + TNode tmp157_AST = null; + tmp157_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp157_AST); + match(PTR); + TNode tmp158_AST = null; + tmp158_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp158_AST); + match(ID); + break; + } + case DOT: + { + TNode tmp159_AST = null; + tmp159_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp159_AST); + match(DOT); + TNode tmp160_AST = null; + tmp160_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp160_AST); + match(ID); + break; + } + case LPAREN: + { + functionCall(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LBRACKET: + { + TNode tmp161_AST = null; + tmp161_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp161_AST); + match(LBRACKET); + expr(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp162_AST = null; + tmp162_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp162_AST); + match(RBRACKET); + break; + } + case INC: + { + TNode tmp163_AST = null; + tmp163_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp163_AST); + match(INC); + break; + } + case DEC: + { + TNode tmp164_AST = null; + tmp164_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp164_AST); + match(DEC); + break; + } + default: + { + if ( _cnt200>=1 ) { break _loop200; } else {throw new NoViableAltException(LT(1), getFilename());} + } + } + _cnt200++; + } while (true); + } + postfixSuffix_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_59); + } else { + throw ex; + } + } + returnAST = postfixSuffix_AST; + } + + public final void functionCall() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode functionCall_AST = null; + TNode a_AST = null; + + try { // for error handling + TNode tmp165_AST = null; + tmp165_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp165_AST); + match(LPAREN); + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case IntOctalConst: + case LongOctalConst: + case UnsignedOctalConst: + case IntIntConst: + case LongIntConst: + case UnsignedIntConst: + case IntHexConst: + case LongHexConst: + case UnsignedHexConst: + case FloatDoubleConst: + case DoubleDoubleConst: + case LongDoubleConst: + { + argExprList(); + a_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp166_AST = null; + tmp166_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp166_AST); + match(RPAREN); + if ( inputState.guessing==0 ) { + functionCall_AST = (TNode)currentAST.root; + + functionCall_AST.setType( NFunctionCallArgs ); + + } + functionCall_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_60); + } else { + throw ex; + } + } + returnAST = functionCall_AST; + } + + public final void argExprList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode argExprList_AST = null; + + try { // for error handling + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop206: + do { + if ((LA(1)==COMMA)) { + match(COMMA); + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop206; + } + + } while (true); + } + argExprList_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_33); + } else { + throw ex; + } + } + returnAST = argExprList_AST; + } + + protected final void charConst() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode charConst_AST = null; + + try { // for error handling + TNode tmp168_AST = null; + tmp168_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp168_AST); + match(CharLiteral); + charConst_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_60); + } else { + throw ex; + } + } + returnAST = charConst_AST; + } + + protected final void intConst() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode intConst_AST = null; + + try { // for error handling + switch ( LA(1)) { + case IntOctalConst: + { + TNode tmp169_AST = null; + tmp169_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp169_AST); + match(IntOctalConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case LongOctalConst: + { + TNode tmp170_AST = null; + tmp170_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp170_AST); + match(LongOctalConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case UnsignedOctalConst: + { + TNode tmp171_AST = null; + tmp171_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp171_AST); + match(UnsignedOctalConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case IntIntConst: + { + TNode tmp172_AST = null; + tmp172_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp172_AST); + match(IntIntConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case LongIntConst: + { + TNode tmp173_AST = null; + tmp173_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp173_AST); + match(LongIntConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case UnsignedIntConst: + { + TNode tmp174_AST = null; + tmp174_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp174_AST); + match(UnsignedIntConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case IntHexConst: + { + TNode tmp175_AST = null; + tmp175_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp175_AST); + match(IntHexConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case LongHexConst: + { + TNode tmp176_AST = null; + tmp176_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp176_AST); + match(LongHexConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case UnsignedHexConst: + { + TNode tmp177_AST = null; + tmp177_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp177_AST); + match(UnsignedHexConst); + intConst_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_60); + } else { + throw ex; + } + } + returnAST = intConst_AST; + } + + protected final void floatConst() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode floatConst_AST = null; + + try { // for error handling + switch ( LA(1)) { + case FloatDoubleConst: + { + TNode tmp178_AST = null; + tmp178_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp178_AST); + match(FloatDoubleConst); + floatConst_AST = (TNode)currentAST.root; + break; + } + case DoubleDoubleConst: + { + TNode tmp179_AST = null; + tmp179_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp179_AST); + match(DoubleDoubleConst); + floatConst_AST = (TNode)currentAST.root; + break; + } + case LongDoubleConst: + { + TNode tmp180_AST = null; + tmp180_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp180_AST); + match(LongDoubleConst); + floatConst_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_60); + } else { + throw ex; + } + } + returnAST = floatConst_AST; + } + + protected final void stringConst() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode stringConst_AST = null; + + try { // for error handling + { + int _cnt210=0; + _loop210: + do { + if ((LA(1)==StringLiteral)) { + TNode tmp181_AST = null; + tmp181_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp181_AST); + match(StringLiteral); + } + else { + if ( _cnt210>=1 ) { break _loop210; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt210++; + } while (true); + } + if ( inputState.guessing==0 ) { + stringConst_AST = (TNode)currentAST.root; + stringConst_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStringSeq)).add(stringConst_AST)); + currentAST.root = stringConst_AST; + currentAST.child = stringConst_AST!=null &&stringConst_AST.getFirstChild()!=null ? + stringConst_AST.getFirstChild() : stringConst_AST; + currentAST.advanceChildToEnd(); + } + stringConst_AST = (TNode)currentAST.root; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_60); + } else { + throw ex; + } + } + returnAST = stringConst_AST; + } + + public final void dummy() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode dummy_AST = null; + + try { // for error handling + switch ( LA(1)) { + case NTypedefName: + { + TNode tmp182_AST = null; + tmp182_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp182_AST); + match(NTypedefName); + dummy_AST = (TNode)currentAST.root; + break; + } + case NInitDecl: + { + TNode tmp183_AST = null; + tmp183_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp183_AST); + match(NInitDecl); + dummy_AST = (TNode)currentAST.root; + break; + } + case NDeclarator: + { + TNode tmp184_AST = null; + tmp184_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp184_AST); + match(NDeclarator); + dummy_AST = (TNode)currentAST.root; + break; + } + case NStructDeclarator: + { + TNode tmp185_AST = null; + tmp185_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp185_AST); + match(NStructDeclarator); + dummy_AST = (TNode)currentAST.root; + break; + } + case NDeclaration: + { + TNode tmp186_AST = null; + tmp186_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp186_AST); + match(NDeclaration); + dummy_AST = (TNode)currentAST.root; + break; + } + case NCast: + { + TNode tmp187_AST = null; + tmp187_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp187_AST); + match(NCast); + dummy_AST = (TNode)currentAST.root; + break; + } + case NPointerGroup: + { + TNode tmp188_AST = null; + tmp188_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp188_AST); + match(NPointerGroup); + dummy_AST = (TNode)currentAST.root; + break; + } + case NExpressionGroup: + { + TNode tmp189_AST = null; + tmp189_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp189_AST); + match(NExpressionGroup); + dummy_AST = (TNode)currentAST.root; + break; + } + case NFunctionCallArgs: + { + TNode tmp190_AST = null; + tmp190_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp190_AST); + match(NFunctionCallArgs); + dummy_AST = (TNode)currentAST.root; + break; + } + case NNonemptyAbstractDeclarator: + { + TNode tmp191_AST = null; + tmp191_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp191_AST); + match(NNonemptyAbstractDeclarator); + dummy_AST = (TNode)currentAST.root; + break; + } + case NInitializer: + { + TNode tmp192_AST = null; + tmp192_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp192_AST); + match(NInitializer); + dummy_AST = (TNode)currentAST.root; + break; + } + case NStatementExpr: + { + TNode tmp193_AST = null; + tmp193_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp193_AST); + match(NStatementExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NEmptyExpression: + { + TNode tmp194_AST = null; + tmp194_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp194_AST); + match(NEmptyExpression); + dummy_AST = (TNode)currentAST.root; + break; + } + case NParameterTypeList: + { + TNode tmp195_AST = null; + tmp195_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp195_AST); + match(NParameterTypeList); + dummy_AST = (TNode)currentAST.root; + break; + } + case NFunctionDef: + { + TNode tmp196_AST = null; + tmp196_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp196_AST); + match(NFunctionDef); + dummy_AST = (TNode)currentAST.root; + break; + } + case NCompoundStatement: + { + TNode tmp197_AST = null; + tmp197_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp197_AST); + match(NCompoundStatement); + dummy_AST = (TNode)currentAST.root; + break; + } + case NParameterDeclaration: + { + TNode tmp198_AST = null; + tmp198_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp198_AST); + match(NParameterDeclaration); + dummy_AST = (TNode)currentAST.root; + break; + } + case NCommaExpr: + { + TNode tmp199_AST = null; + tmp199_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp199_AST); + match(NCommaExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NUnaryExpr: + { + TNode tmp200_AST = null; + tmp200_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp200_AST); + match(NUnaryExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NLabel: + { + TNode tmp201_AST = null; + tmp201_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp201_AST); + match(NLabel); + dummy_AST = (TNode)currentAST.root; + break; + } + case NPostfixExpr: + { + TNode tmp202_AST = null; + tmp202_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp202_AST); + match(NPostfixExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NRangeExpr: + { + TNode tmp203_AST = null; + tmp203_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp203_AST); + match(NRangeExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NStringSeq: + { + TNode tmp204_AST = null; + tmp204_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp204_AST); + match(NStringSeq); + dummy_AST = (TNode)currentAST.root; + break; + } + case NInitializerElementLabel: + { + TNode tmp205_AST = null; + tmp205_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp205_AST); + match(NInitializerElementLabel); + dummy_AST = (TNode)currentAST.root; + break; + } + case NLcurlyInitializer: + { + TNode tmp206_AST = null; + tmp206_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp206_AST); + match(NLcurlyInitializer); + dummy_AST = (TNode)currentAST.root; + break; + } + case NAsmAttribute: + { + TNode tmp207_AST = null; + tmp207_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp207_AST); + match(NAsmAttribute); + dummy_AST = (TNode)currentAST.root; + break; + } + case NGnuAsmExpr: + { + TNode tmp208_AST = null; + tmp208_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp208_AST); + match(NGnuAsmExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NTypeMissing: + { + TNode tmp209_AST = null; + tmp209_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp209_AST); + match(NTypeMissing); + dummy_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + consume(); + consumeUntil(_tokenSet_0); + } else { + throw ex; + } + } + returnAST = dummy_AST; + } + + + public static final String[] _tokenNames = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "\"typedef\"", + "\"asm\"", + "\"volatile\"", + "LCURLY", + "RCURLY", + "SEMI", + "\"struct\"", + "\"union\"", + "\"enum\"", + "\"auto\"", + "\"register\"", + "\"extern\"", + "\"static\"", + "\"const\"", + "\"void\"", + "\"char\"", + "\"short\"", + "\"int\"", + "\"long\"", + "\"float\"", + "\"double\"", + "\"signed\"", + "\"unsigned\"", + "ID", + "COMMA", + "COLON", + "ASSIGN", + "STAR", + "LPAREN", + "RPAREN", + "LBRACKET", + "RBRACKET", + "VARARGS", + "\"while\"", + "\"do\"", + "\"for\"", + "\"goto\"", + "\"continue\"", + "\"break\"", + "\"return\"", + "\"case\"", + "\"default\"", + "\"if\"", + "\"else\"", + "\"switch\"", + "DIV_ASSIGN", + "PLUS_ASSIGN", + "MINUS_ASSIGN", + "STAR_ASSIGN", + "MOD_ASSIGN", + "RSHIFT_ASSIGN", + "LSHIFT_ASSIGN", + "BAND_ASSIGN", + "BOR_ASSIGN", + "BXOR_ASSIGN", + "QUESTION", + "LOR", + "LAND", + "BOR", + "BXOR", + "BAND", + "EQUAL", + "NOT_EQUAL", + "LT", + "LTE", + "GT", + "GTE", + "LSHIFT", + "RSHIFT", + "PLUS", + "MINUS", + "DIV", + "MOD", + "INC", + "DEC", + "\"sizeof\"", + "BNOT", + "LNOT", + "PTR", + "DOT", + "CharLiteral", + "StringLiteral", + "IntOctalConst", + "LongOctalConst", + "UnsignedOctalConst", + "IntIntConst", + "LongIntConst", + "UnsignedIntConst", + "IntHexConst", + "LongHexConst", + "UnsignedHexConst", + "FloatDoubleConst", + "DoubleDoubleConst", + "LongDoubleConst", + "NTypedefName", + "NInitDecl", + "NDeclarator", + "NStructDeclarator", + "NDeclaration", + "NCast", + "NPointerGroup", + "NExpressionGroup", + "NFunctionCallArgs", + "NNonemptyAbstractDeclarator", + "NInitializer", + "NStatementExpr", + "NEmptyExpression", + "NParameterTypeList", + "NFunctionDef", + "NCompoundStatement", + "NParameterDeclaration", + "NCommaExpr", + "NUnaryExpr", + "NLabel", + "NPostfixExpr", + "NRangeExpr", + "NStringSeq", + "NInitializerElementLabel", + "NLcurlyInitializer", + "NAsmAttribute", + "NGnuAsmExpr", + "NTypeMissing", + "Vocabulary", + "Whitespace", + "Comment", + "CPPComment", + "a line directive", + "Space", + "LineDirective", + "BadStringLiteral", + "Escape", + "Digit", + "LongSuffix", + "UnsignedSuffix", + "FloatSuffix", + "Exponent", + "Number" + }; + + protected void buildTokenTypeASTClassMap() { + tokenTypeToASTClassMap=null; + }; + + private static final long[] mk_tokenSet_0() { + long[] data = { 2L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); + private static final long[] mk_tokenSet_1() { + long[] data = { 6710885488L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); + private static final long[] mk_tokenSet_2() { + long[] data = { 268434512L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); + private static final long[] mk_tokenSet_3() { + long[] data = { 6710886096L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); + private static final long[] mk_tokenSet_4() { + long[] data = { 6710860864L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); + private static final long[] mk_tokenSet_5() { + long[] data = { 92610232016L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); + private static final long[] mk_tokenSet_6() { + long[] data = { 6710885490L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6()); + private static final long[] mk_tokenSet_7() { + long[] data = { 422150456475634L, 17179076097L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7()); + private static final long[] mk_tokenSet_8() { + long[] data = { 268409920L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8()); + private static final long[] mk_tokenSet_9() { + long[] data = { 6710860992L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9()); + private static final long[] mk_tokenSet_10() { + long[] data = { 6576668672L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10()); + private static final long[] mk_tokenSet_11() { + long[] data = { 6576668672L, 17179076097L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11()); + private static final long[] mk_tokenSet_12() { + long[] data = { 43754980096L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); + private static final long[] mk_tokenSet_13() { + long[] data = { 268180480L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13()); + private static final long[] mk_tokenSet_14() { + long[] data = { 32749125328L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_14 = new BitSet(mk_tokenSet_14()); + private static final long[] mk_tokenSet_15() { + long[] data = { 32614908416L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_15 = new BitSet(mk_tokenSet_15()); + private static final long[] mk_tokenSet_16() { + long[] data = { 512L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_16 = new BitSet(mk_tokenSet_16()); + private static final long[] mk_tokenSet_17() { + long[] data = { 32749125200L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_17 = new BitSet(mk_tokenSet_17()); + private static final long[] mk_tokenSet_18() { + long[] data = { 33285996112L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_18 = new BitSet(mk_tokenSet_18()); + private static final long[] mk_tokenSet_19() { + long[] data = { 134217856L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_19 = new BitSet(mk_tokenSet_19()); + private static final long[] mk_tokenSet_20() { + long[] data = { 268311616L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_20 = new BitSet(mk_tokenSet_20()); + private static final long[] mk_tokenSet_21() { + long[] data = { 256L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_21 = new BitSet(mk_tokenSet_21()); + private static final long[] mk_tokenSet_22() { + long[] data = { 268311872L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_22 = new BitSet(mk_tokenSet_22()); + private static final long[] mk_tokenSet_23() { + long[] data = { 33017437376L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_23 = new BitSet(mk_tokenSet_23()); + private static final long[] mk_tokenSet_24() { + long[] data = { 32883343360L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_24 = new BitSet(mk_tokenSet_24()); + private static final long[] mk_tokenSet_25() { + long[] data = { 268435968L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_25 = new BitSet(mk_tokenSet_25()); + private static final long[] mk_tokenSet_26() { + long[] data = { 35165045504L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_26 = new BitSet(mk_tokenSet_26()); + private static final long[] mk_tokenSet_27() { + long[] data = { 32749124816L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_27 = new BitSet(mk_tokenSet_27()); + private static final long[] mk_tokenSet_28() { + long[] data = { 100931731152L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_28 = new BitSet(mk_tokenSet_28()); + private static final long[] mk_tokenSet_29() { + long[] data = { 79456894672L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_29 = new BitSet(mk_tokenSet_29()); + private static final long[] mk_tokenSet_30() { + long[] data = { 268435712L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_30 = new BitSet(mk_tokenSet_30()); + private static final long[] mk_tokenSet_31() { + long[] data = { 268436224L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_31 = new BitSet(mk_tokenSet_31()); + private static final long[] mk_tokenSet_32() { + long[] data = { 30467424256L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_32 = new BitSet(mk_tokenSet_32()); + private static final long[] mk_tokenSet_33() { + long[] data = { 8589934592L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_33 = new BitSet(mk_tokenSet_33()); + private static final long[] mk_tokenSet_34() { + long[] data = { 6576668800L, 17179076097L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_34 = new BitSet(mk_tokenSet_34()); + private static final long[] mk_tokenSet_35() { + long[] data = { 32615039040L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_35 = new BitSet(mk_tokenSet_35()); + private static final long[] mk_tokenSet_36() { + long[] data = { 23622320128L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_36 = new BitSet(mk_tokenSet_36()); + private static final long[] mk_tokenSet_37() { + long[] data = { 67108863056L, 17179076097L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_37 = new BitSet(mk_tokenSet_37()); + private static final long[] mk_tokenSet_38() { + long[] data = { 8858370048L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_38 = new BitSet(mk_tokenSet_38()); + private static final long[] mk_tokenSet_39() { + long[] data = { 422081602782080L, 17179076097L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_39 = new BitSet(mk_tokenSet_39()); + private static final long[] mk_tokenSet_40() { + long[] data = { -111669149710L, 17179869183L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_40 = new BitSet(mk_tokenSet_40()); + private static final long[] mk_tokenSet_41() { + long[] data = { 562819225354226L, 17179076097L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_41 = new BitSet(mk_tokenSet_41()); + private static final long[] mk_tokenSet_42() { + long[] data = { 422081602781824L, 17179076097L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_42 = new BitSet(mk_tokenSet_42()); + private static final long[] mk_tokenSet_43() { + long[] data = { 562819091137408L, 17179076097L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_43 = new BitSet(mk_tokenSet_43()); + private static final long[] mk_tokenSet_44() { + long[] data = { -562924720611776L, 17179869183L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_44 = new BitSet(mk_tokenSet_44()); + private static final long[] mk_tokenSet_45() { + long[] data = { -111669149744L, 17179869183L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_45 = new BitSet(mk_tokenSet_45()); + private static final long[] mk_tokenSet_46() { + long[] data = { 575897847178724096L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_46 = new BitSet(mk_tokenSet_46()); + private static final long[] mk_tokenSet_47() { + long[] data = { 1152358599482147584L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_47 = new BitSet(mk_tokenSet_47()); + private static final long[] mk_tokenSet_48() { + long[] data = { 2305280104088994560L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_48 = new BitSet(mk_tokenSet_48()); + private static final long[] mk_tokenSet_49() { + long[] data = { 4611123113302688512L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_49 = new BitSet(mk_tokenSet_49()); + private static final long[] mk_tokenSet_50() { + long[] data = { 9222809131730076416L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_50 = new BitSet(mk_tokenSet_50()); + private static final long[] mk_tokenSet_51() { + long[] data = { -562905124699392L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_51 = new BitSet(mk_tokenSet_51()); + private static final long[] mk_tokenSet_52() { + long[] data = { -562905124699392L, 1L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_52 = new BitSet(mk_tokenSet_52()); + private static final long[] mk_tokenSet_53() { + long[] data = { -562905124699392L, 7L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_53 = new BitSet(mk_tokenSet_53()); + private static final long[] mk_tokenSet_54() { + long[] data = { -562905124699392L, 127L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_54 = new BitSet(mk_tokenSet_54()); + private static final long[] mk_tokenSet_55() { + long[] data = { -562905124699392L, 511L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_55 = new BitSet(mk_tokenSet_55()); + private static final long[] mk_tokenSet_56() { + long[] data = { 2147483648L, 6144L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_56 = new BitSet(mk_tokenSet_56()); + private static final long[] mk_tokenSet_57() { + long[] data = { -562905124699392L, 2047L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_57 = new BitSet(mk_tokenSet_57()); + private static final long[] mk_tokenSet_58() { + long[] data = { -562881368161536L, 17179869183L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_58 = new BitSet(mk_tokenSet_58()); + private static final long[] mk_tokenSet_59() { + long[] data = { -562902977215744L, 8191L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_59 = new BitSet(mk_tokenSet_59()); + private static final long[] mk_tokenSet_60() { + long[] data = { -562881502379264L, 819199L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_60 = new BitSet(mk_tokenSet_60()); + + } diff --git a/app/preproc/WEmitter.java b/app/preproc/WEmitter.java index 6952356a8..e80b46488 100644 --- a/app/preproc/WEmitter.java +++ b/app/preproc/WEmitter.java @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "expandedWEmitter.g" -> "WEmitter.java"$ +// $ANTLR 2.7.2: "expandedWEmitter.g" -> "WEmitter.java"$ package processing.app.preproc; import processing.app.*; @@ -7,22 +7,22 @@ import java.util.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -import antlr.TreeParser; -import antlr.Token; -import antlr.collections.AST; -import antlr.RecognitionException; -import antlr.ANTLRException; -import antlr.NoViableAltException; -import antlr.MismatchedTokenException; -import antlr.SemanticException; -import antlr.collections.impl.BitSet; -import antlr.ASTPair; -import antlr.collections.impl.ASTArray; - - -public class WEmitter extends antlr.TreeParser implements WEmitterTokenTypes - { + +import antlr.TreeParser; +import antlr.Token; +import antlr.collections.AST; +import antlr.RecognitionException; +import antlr.ANTLRException; +import antlr.NoViableAltException; +import antlr.MismatchedTokenException; +import antlr.SemanticException; +import antlr.collections.impl.BitSet; +import antlr.ASTPair; +import antlr.collections.impl.ASTArray; + + +public class WEmitter extends antlr.TreeParser implements WEmitterTokenTypes + { @@ -365,6325 +365,6325 @@ void commaSep( TNode t ) { -public WEmitter() { - tokenNames = _tokenNames; -} - - public final void translationUnit(AST _t) throws RecognitionException { - - TNode translationUnit_AST_in = (TNode)_t; - - if ( inputState.guessing==0 ) { - initializePrinting(); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_asm: - case SEMI: - case NDeclaration: - case NFunctionDef: - case NTypeMissing: - { - externalList(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - if ( inputState.guessing==0 ) { - finalizePrinting(); - } - _retTree = _t; - } - - public final void externalList(AST _t) throws RecognitionException { - - TNode externalList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt5=0; - _loop5: - do { - if (_t==null) _t=ASTNULL; - if ((_tokenSet_0.member(_t.getType()))) { - externalDef(_t); - _t = _retTree; - } - else { - if ( _cnt5>=1 ) { break _loop5; } else {throw new NoViableAltException(_t);} - } - - _cnt5++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void externalDef(AST _t) throws RecognitionException { - - TNode externalDef_AST_in = (TNode)_t; - TNode s = null; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NDeclaration: - { - declaration(_t); - _t = _retTree; - break; - } - case NFunctionDef: - { - functionDef(_t); - _t = _retTree; - break; - } - case LITERAL_asm: - { - asm_expr(_t); - _t = _retTree; - break; - } - case NTypeMissing: - { - typelessDeclaration(_t); - _t = _retTree; - break; - } - case SEMI: - { - s = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( s ); - } - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void declaration(AST _t) throws RecognitionException { - - TNode declaration_AST_in = (TNode)_t; - TNode s = null; - - try { // for error handling - AST __t13 = _t; - TNode tmp1_AST_in = (TNode)_t; - match(_t,NDeclaration); - _t = _t.getFirstChild(); - declSpecifiers(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NInitDecl: - { - initDeclList(_t); - _t = _retTree; - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - int _cnt16=0; - _loop16: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==SEMI)) { - s = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( s ); - } - } - else { - if ( _cnt16>=1 ) { break _loop16; } else {throw new NoViableAltException(_t);} - } - - _cnt16++; - } while (true); - } - _t = __t13; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void functionDef(AST _t) throws RecognitionException { - - TNode functionDef_AST_in = (TNode)_t; - TNode v = null; - - try { // for error handling - AST __t123 = _t; - TNode tmp2_AST_in = (TNode)_t; - match(_t,NFunctionDef); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_inline: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - functionDeclSpecifiers(_t); - _t = _retTree; - break; - } - case NDeclarator: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - declarator(_t); - _t = _retTree; - { - _loop126: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NDeclaration: - { - declaration(_t); - _t = _retTree; - break; - } - case VARARGS: - { - v = (TNode)_t; - match(_t,VARARGS); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( v ); - } - break; - } - default: - { - break _loop126; - } - } - } while (true); - } - compoundStatement(_t); - _t = _retTree; - _t = __t123; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void asm_expr(AST _t) throws RecognitionException { - - TNode asm_expr_AST_in = (TNode)_t; - TNode a = null; - TNode v = null; - TNode lc = null; - TNode rc = null; - TNode s = null; - - try { // for error handling - AST __t10 = _t; - a = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_asm); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( a ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - { - v = (TNode)_t; - match(_t,LITERAL_volatile); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( v ); - } - break; - } - case LCURLY: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - lc = (TNode)_t; - match(_t,LCURLY); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lc ); tabs++; - } - expr(_t); - _t = _retTree; - rc = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - tabs--; print( rc ); - } - s = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( s ); - } - _t = __t10; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void typelessDeclaration(AST _t) throws RecognitionException { - - TNode typelessDeclaration_AST_in = (TNode)_t; - TNode s = null; - - try { // for error handling - AST __t8 = _t; - TNode tmp3_AST_in = (TNode)_t; - match(_t,NTypeMissing); - _t = _t.getFirstChild(); - initDeclList(_t); - _t = _retTree; - s = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - _t = __t8; - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( s ); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void initDeclList(AST _t) throws RecognitionException { - - TNode initDeclList_AST_in = (TNode)_t; - - try { // for error handling - initDecl(_t); - _t = _retTree; - { - _loop76: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NInitDecl)) { - if ( inputState.guessing==0 ) { - print( "," ); - } - initDecl(_t); - _t = _retTree; - } - else { - break _loop76; - } - - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void expr(AST _t) throws RecognitionException { - - TNode expr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - case STAR: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case NCommaExpr: - { - binaryExpr(_t); - _t = _retTree; - break; - } - case QUESTION: - { - conditionalExpr(_t); - _t = _retTree; - break; - } - case NCast: - { - castExpr(_t); - _t = _retTree; - break; - } - case INC: - case DEC: - case LITERAL_sizeof: - case NUnaryExpr: - case LITERAL___alignof: - { - unaryExpr(_t); - _t = _retTree; - break; - } - case NPostfixExpr: - { - postfixExpr(_t); - _t = _retTree; - break; - } - case ID: - case CharLiteral: - case NExpressionGroup: - case NStringSeq: - case Number: - { - primaryExpr(_t); - _t = _retTree; - break; - } - case NEmptyExpression: - { - emptyExpr(_t); - _t = _retTree; - break; - } - case LPAREN: - { - compoundStatementExpr(_t); - _t = _retTree; - break; - } - case NInitializer: - case NLcurlyInitializer: - { - initializer(_t); - _t = _retTree; - break; - } - case NRangeExpr: - { - rangeExpr(_t); - _t = _retTree; - break; - } - case NGnuAsmExpr: - { - gnuAsmExpr(_t); - _t = _retTree; - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void declSpecifiers(AST _t) throws RecognitionException { - - TNode declSpecifiers_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt19=0; - _loop19: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_typedef: - case LITERAL_auto: - case LITERAL_register: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_inline: - { - storageClassSpecifier(_t); - _t = _retTree; - break; - } - case LITERAL_volatile: - case LITERAL_const: - { - typeQualifier(_t); - _t = _retTree; - break; - } - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - typeSpecifier(_t); - _t = _retTree; - break; - } - default: - { - if ( _cnt19>=1 ) { break _loop19; } else {throw new NoViableAltException(_t);} - } - } - _cnt19++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void storageClassSpecifier(AST _t) throws RecognitionException { - - TNode storageClassSpecifier_AST_in = (TNode)_t; - TNode a = null; - TNode b = null; - TNode c = null; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_auto: - { - a = (TNode)_t; - match(_t,LITERAL_auto); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( a ); - } - break; - } - case LITERAL_register: - { - b = (TNode)_t; - match(_t,LITERAL_register); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( b ); - } - break; - } - case LITERAL_typedef: - { - c = (TNode)_t; - match(_t,LITERAL_typedef); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c ); - } - break; - } - case LITERAL_extern: - case LITERAL_static: - case LITERAL_inline: - { - functionStorageClassSpecifier(_t); - _t = _retTree; - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void typeQualifier(AST _t) throws RecognitionException { - - TNode typeQualifier_AST_in = (TNode)_t; - TNode a = null; - TNode b = null; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_const: - { - a = (TNode)_t; - match(_t,LITERAL_const); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( a ); - } - break; - } - case LITERAL_volatile: - { - b = (TNode)_t; - match(_t,LITERAL_volatile); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( b ); - } - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void typeSpecifier(AST _t) throws RecognitionException { - - TNode typeSpecifier_AST_in = (TNode)_t; - TNode a = null; - TNode b = null; - TNode c = null; - TNode d = null; - TNode e = null; - TNode f = null; - TNode g = null; - TNode h = null; - TNode i = null; - TNode j = null; - TNode k = null; - TNode l = null; - TNode m = null; - TNode n = null; - TNode lp = null; - TNode rp = null; - TNode p = null; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_void: - { - a = (TNode)_t; - match(_t,LITERAL_void); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( a ); - } - break; - } - case LITERAL_char: - { - b = (TNode)_t; - match(_t,LITERAL_char); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( b ); - } - break; - } - case LITERAL_short: - { - c = (TNode)_t; - match(_t,LITERAL_short); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c ); - } - break; - } - case LITERAL_int: - { - d = (TNode)_t; - match(_t,LITERAL_int); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( d ); - } - break; - } - case LITERAL_long: - { - e = (TNode)_t; - match(_t,LITERAL_long); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( e ); - } - break; - } - case LITERAL_float: - { - f = (TNode)_t; - match(_t,LITERAL_float); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( f ); - } - break; - } - case LITERAL_double: - { - g = (TNode)_t; - match(_t,LITERAL_double); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( g ); - } - break; - } - case LITERAL_signed: - { - h = (TNode)_t; - match(_t,LITERAL_signed); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( h ); - } - break; - } - case LITERAL_unsigned: - { - i = (TNode)_t; - match(_t,LITERAL_unsigned); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( i ); - } - break; - } - case LITERAL_byte: - { - j = (TNode)_t; - match(_t,LITERAL_byte); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( j ); - } - break; - } - case LITERAL_boolean: - { - k = (TNode)_t; - match(_t,LITERAL_boolean); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( k ); - } - break; - } - case LITERAL_Servo: - { - l = (TNode)_t; - match(_t,LITERAL_Servo); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( l ); - } - break; - } - case LITERAL_Wire: - { - m = (TNode)_t; - match(_t,LITERAL_Wire); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( m ); - } - break; - } - case LITERAL_struct: - { - structSpecifier(_t); - _t = _retTree; - { - _loop25: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { - attributeDecl(_t); - _t = _retTree; - } - else { - break _loop25; - } - - } while (true); - } - break; - } - case LITERAL_union: - { - unionSpecifier(_t); - _t = _retTree; - { - _loop27: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { - attributeDecl(_t); - _t = _retTree; - } - else { - break _loop27; - } - - } while (true); - } - break; - } - case LITERAL_enum: - { - enumSpecifier(_t); - _t = _retTree; - break; - } - case NTypedefName: - { - typedefName(_t); - _t = _retTree; - break; - } - case LITERAL_typeof: - { - AST __t28 = _t; - n = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_typeof); - _t = _t.getFirstChild(); - lp = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( n ); print( lp ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - typeName(_t); - _t = _retTree; - break; - } - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rp = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rp ); - } - _t = __t28; - _t = _t.getNextSibling(); - break; - } - case LITERAL___complex: - { - p = (TNode)_t; - match(_t,LITERAL___complex); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( p ); - } - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void functionStorageClassSpecifier(AST _t) throws RecognitionException { - - TNode functionStorageClassSpecifier_AST_in = (TNode)_t; - TNode a = null; - TNode b = null; - TNode c = null; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_extern: - { - a = (TNode)_t; - match(_t,LITERAL_extern); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( a ); - } - break; - } - case LITERAL_static: - { - b = (TNode)_t; - match(_t,LITERAL_static); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( b ); - } - break; - } - case LITERAL_inline: - { - c = (TNode)_t; - match(_t,LITERAL_inline); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c ); - } - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structSpecifier(AST _t) throws RecognitionException { - - TNode structSpecifier_AST_in = (TNode)_t; - TNode a = null; - - try { // for error handling - AST __t35 = _t; - a = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_struct); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( a ); - } - structOrUnionBody(_t); - _t = _retTree; - _t = __t35; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void attributeDecl(AST _t) throws RecognitionException { - - TNode attributeDecl_AST_in = (TNode)_t; - TNode a = null; - TNode b = null; - TNode n = null; - TNode lp = null; - TNode rp = null; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL___attribute: - { - AST __t70 = _t; - a = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL___attribute); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( a ); - } - { - _loop72: - do { - if (_t==null) _t=ASTNULL; - if (((_t.getType() >= LITERAL_typedef && _t.getType() <= LITERAL___imag))) { - b = (TNode)_t; - if ( _t==null ) throw new MismatchedTokenException(); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( b ); - } - } - else { - break _loop72; - } - - } while (true); - } - _t = __t70; - _t = _t.getNextSibling(); - break; - } - case NAsmAttribute: - { - AST __t73 = _t; - n = _t==ASTNULL ? null :(TNode)_t; - match(_t,NAsmAttribute); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( n ); - } - lp = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lp ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ")" ); - } - rp = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rp ); - } - _t = __t73; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void unionSpecifier(AST _t) throws RecognitionException { - - TNode unionSpecifier_AST_in = (TNode)_t; - TNode a = null; - - try { // for error handling - AST __t37 = _t; - a = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_union); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( a ); - } - structOrUnionBody(_t); - _t = _retTree; - _t = __t37; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void enumSpecifier(AST _t) throws RecognitionException { - - TNode enumSpecifier_AST_in = (TNode)_t; - TNode a = null; - TNode i = null; - TNode lc = null; - TNode rc = null; - - try { // for error handling - AST __t61 = _t; - a = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_enum); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( a ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - { - i = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( i ); - } - break; - } - case 3: - case LCURLY: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LCURLY: - { - lc = (TNode)_t; - match(_t,LCURLY); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lc ); tabs++; - } - enumList(_t); - _t = _retTree; - rc = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - tabs--; print( rc ); - } - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t61; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void typedefName(AST _t) throws RecognitionException { - - TNode typedefName_AST_in = (TNode)_t; - TNode i = null; - - try { // for error handling - AST __t33 = _t; - TNode tmp4_AST_in = (TNode)_t; - match(_t,NTypedefName); - _t = _t.getFirstChild(); - i = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( i ); - } - _t = __t33; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void typeName(AST _t) throws RecognitionException { - - TNode typeName_AST_in = (TNode)_t; - - try { // for error handling - specifierQualifierList(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NNonemptyAbstractDeclarator: - { - nonemptyAbstractDeclarator(_t); - _t = _retTree; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structOrUnionBody(AST _t) throws RecognitionException { - - TNode structOrUnionBody_AST_in = (TNode)_t; - TNode i1 = null; - TNode lc1 = null; - TNode rc1 = null; - TNode lc2 = null; - TNode rc2 = null; - TNode i2 = null; - - try { // for error handling - { - boolean synPredMatched41 = false; - if (((_t.getType()==ID))) { - AST __t41 = _t; - synPredMatched41 = true; - inputState.guessing++; - try { - { - TNode tmp5_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - TNode tmp6_AST_in = (TNode)_t; - match(_t,LCURLY); - _t = _t.getNextSibling(); - } - } - catch (RecognitionException pe) { - synPredMatched41 = false; - } - _t = __t41; - inputState.guessing--; - } - if ( synPredMatched41 ) { - i1 = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - lc1 = (TNode)_t; - match(_t,LCURLY); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( i1 ); print ( "{" ); tabs++; - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - structDeclarationList(_t); - _t = _retTree; - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rc1 = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - tabs--; print( rc1 ); - } - } - else if ((_t.getType()==LCURLY)) { - lc2 = (TNode)_t; - match(_t,LCURLY); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lc2 ); tabs++; - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - structDeclarationList(_t); - _t = _retTree; - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rc2 = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - tabs--; print( rc2 ); - } - } - else if ((_t.getType()==ID)) { - i2 = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( i2 ); - } - } - else { - throw new NoViableAltException(_t); - } - - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structDeclarationList(AST _t) throws RecognitionException { - - TNode structDeclarationList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt46=0; - _loop46: - do { - if (_t==null) _t=ASTNULL; - if ((_tokenSet_1.member(_t.getType()))) { - structDeclaration(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ";" ); - } - } - else { - if ( _cnt46>=1 ) { break _loop46; } else {throw new NoViableAltException(_t);} - } - - _cnt46++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structDeclaration(AST _t) throws RecognitionException { - - TNode structDeclaration_AST_in = (TNode)_t; - - try { // for error handling - specifierQualifierList(_t); - _t = _retTree; - structDeclaratorList(_t); - _t = _retTree; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void specifierQualifierList(AST _t) throws RecognitionException { - - TNode specifierQualifierList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt50=0; - _loop50: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - typeSpecifier(_t); - _t = _retTree; - break; - } - case LITERAL_volatile: - case LITERAL_const: - { - typeQualifier(_t); - _t = _retTree; - break; - } - default: - { - if ( _cnt50>=1 ) { break _loop50; } else {throw new NoViableAltException(_t);} - } - } - _cnt50++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structDeclaratorList(AST _t) throws RecognitionException { - - TNode structDeclaratorList_AST_in = (TNode)_t; - - try { // for error handling - structDeclarator(_t); - _t = _retTree; - { - _loop53: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NStructDeclarator)) { - if ( inputState.guessing==0 ) { - print(","); - } - structDeclarator(_t); - _t = _retTree; - } - else { - break _loop53; - } - - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structDeclarator(AST _t) throws RecognitionException { - - TNode structDeclarator_AST_in = (TNode)_t; - TNode c = null; - - try { // for error handling - AST __t55 = _t; - TNode tmp7_AST_in = (TNode)_t; - match(_t,NStructDeclarator); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NDeclarator: - { - declarator(_t); - _t = _retTree; - break; - } - case 3: - case COLON: - case NAsmAttribute: - case LITERAL___attribute: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case COLON: - { - c = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c ); - } - expr(_t); - _t = _retTree; - break; - } - case 3: - case NAsmAttribute: - case LITERAL___attribute: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - _loop59: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { - attributeDecl(_t); - _t = _retTree; - } - else { - break _loop59; - } - - } while (true); - } - _t = __t55; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void declarator(AST _t) throws RecognitionException { - - TNode declarator_AST_in = (TNode)_t; - TNode id = null; - TNode lp = null; - TNode rp = null; - TNode n = null; - TNode r = null; - TNode lb = null; - TNode rb = null; - - try { // for error handling - AST __t105 = _t; - TNode tmp8_AST_in = (TNode)_t; - match(_t,NDeclarator); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NPointerGroup: - { - pointerGroup(_t); - _t = _retTree; - break; - } - case ID: - case LPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - { - id = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( id ); - } - break; - } - case LPAREN: - { - lp = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lp ); - } - declarator(_t); - _t = _retTree; - rp = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rp ); - } - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - _loop113: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NParameterTypeList: - { - AST __t109 = _t; - n = _t==ASTNULL ? null :(TNode)_t; - match(_t,NParameterTypeList); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( n ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NParameterDeclaration: - { - parameterTypeList(_t); - _t = _retTree; - break; - } - case ID: - case RPAREN: - { - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - { - idList(_t); - _t = _retTree; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - r = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( r ); - } - _t = __t109; - _t = _t.getNextSibling(); - break; - } - case LBRACKET: - { - lb = (TNode)_t; - match(_t,LBRACKET); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lb ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rb = (TNode)_t; - match(_t,RBRACKET); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rb ); - } - break; - } - default: - { - break _loop113; - } - } - } while (true); - } - _t = __t105; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void enumList(AST _t) throws RecognitionException { - - TNode enumList_AST_in = (TNode)_t; - - try { // for error handling - enumerator(_t); - _t = _retTree; - { - _loop66: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==ID)) { - if ( inputState.guessing==0 ) { - print(","); - } - enumerator(_t); - _t = _retTree; - } - else { - break _loop66; - } - - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void enumerator(AST _t) throws RecognitionException { - - TNode enumerator_AST_in = (TNode)_t; - TNode i = null; - TNode b = null; - - try { // for error handling - i = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( i ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - { - b = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( b ); - } - expr(_t); - _t = _retTree; - break; - } - case RCURLY: - case ID: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void initDecl(AST _t) throws RecognitionException { - - TNode initDecl_AST_in = (TNode)_t; - TNode a = null; - TNode b = null; - String declName = ""; - - try { // for error handling - AST __t78 = _t; - TNode tmp9_AST_in = (TNode)_t; - match(_t,NInitDecl); - _t = _t.getFirstChild(); - declarator(_t); - _t = _retTree; - { - _loop80: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { - attributeDecl(_t); - _t = _retTree; - } - else { - break _loop80; - } - - } while (true); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - { - a = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( a ); - } - initializer(_t); - _t = _retTree; - break; - } - case COLON: - { - b = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( b ); - } - expr(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t78; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void initializer(AST _t) throws RecognitionException { - - TNode initializer_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NInitializer: - { - AST __t92 = _t; - TNode tmp10_AST_in = (TNode)_t; - match(_t,NInitializer); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NInitializerElementLabel: - { - initializerElementLabel(_t); - _t = _retTree; - break; - } - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - expr(_t); - _t = _retTree; - _t = __t92; - _t = _t.getNextSibling(); - break; - } - case NLcurlyInitializer: - { - lcurlyInitializer(_t); - _t = _retTree; - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void pointerGroup(AST _t) throws RecognitionException { - - TNode pointerGroup_AST_in = (TNode)_t; - TNode a = null; - - try { // for error handling - AST __t83 = _t; - TNode tmp11_AST_in = (TNode)_t; - match(_t,NPointerGroup); - _t = _t.getFirstChild(); - { - int _cnt87=0; - _loop87: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==STAR)) { - a = (TNode)_t; - match(_t,STAR); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( a ); - } - { - _loop86: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==LITERAL_volatile||_t.getType()==LITERAL_const)) { - typeQualifier(_t); - _t = _retTree; - } - else { - break _loop86; - } - - } while (true); - } - } - else { - if ( _cnt87>=1 ) { break _loop87; } else {throw new NoViableAltException(_t);} - } - - _cnt87++; - } while (true); - } - _t = __t83; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void idList(AST _t) throws RecognitionException { - - TNode idList_AST_in = (TNode)_t; - TNode i = null; - TNode c = null; - TNode id = null; - - try { // for error handling - i = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( i ); - } - { - _loop90: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COMMA)) { - c = (TNode)_t; - match(_t,COMMA); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c ); - } - id = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( id ); - } - } - else { - break _loop90; - } - - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void initializerElementLabel(AST _t) throws RecognitionException { - - TNode initializerElementLabel_AST_in = (TNode)_t; - TNode l = null; - TNode r = null; - TNode a1 = null; - TNode i1 = null; - TNode c = null; - TNode d = null; - TNode i2 = null; - TNode a2 = null; - - try { // for error handling - AST __t95 = _t; - TNode tmp12_AST_in = (TNode)_t; - match(_t,NInitializerElementLabel); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LBRACKET: - { - { - l = (TNode)_t; - match(_t,LBRACKET); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( l ); - } - expr(_t); - _t = _retTree; - r = (TNode)_t; - match(_t,RBRACKET); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( r ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - { - a1 = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( a1 ); - } - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - break; - } - case ID: - { - i1 = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - c = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( i1 ); print( c ); - } - break; - } - case DOT: - { - d = (TNode)_t; - match(_t,DOT); - _t = _t.getNextSibling(); - i2 = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - a2 = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( d ); print( i2 ); print( a2 ); - } - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t95; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void lcurlyInitializer(AST _t) throws RecognitionException { - - TNode lcurlyInitializer_AST_in = (TNode)_t; - TNode n = null; - TNode rc = null; - - try { // for error handling - AST __t100 = _t; - n = _t==ASTNULL ? null :(TNode)_t; - match(_t,NLcurlyInitializer); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( n ); tabs++; - } - initializerList(_t); - _t = _retTree; - rc = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - tabs--; print( rc ); - } - _t = __t100; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void initializerList(AST _t) throws RecognitionException { - - TNode initializerList_AST_in = (TNode)_t; - TNode i = null; - - try { // for error handling - { - _loop103: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NInitializer||_t.getType()==NLcurlyInitializer)) { - i = _t==ASTNULL ? null : (TNode)_t; - initializer(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - commaSep( i ); - } - } - else { - break _loop103; - } - - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void parameterTypeList(AST _t) throws RecognitionException { - - TNode parameterTypeList_AST_in = (TNode)_t; - TNode c = null; - TNode s = null; - TNode v = null; - - try { // for error handling - { - int _cnt117=0; - _loop117: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NParameterDeclaration)) { - parameterDeclaration(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case COMMA: - { - c = (TNode)_t; - match(_t,COMMA); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c ); - } - break; - } - case SEMI: - { - s = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( s ); - } - break; - } - case RPAREN: - case VARARGS: - case NParameterDeclaration: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - else { - if ( _cnt117>=1 ) { break _loop117; } else {throw new NoViableAltException(_t);} - } - - _cnt117++; - } while (true); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case VARARGS: - { - v = (TNode)_t; - match(_t,VARARGS); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( v ); - } - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void parameterDeclaration(AST _t) throws RecognitionException { - - TNode parameterDeclaration_AST_in = (TNode)_t; - - try { // for error handling - AST __t120 = _t; - TNode tmp13_AST_in = (TNode)_t; - match(_t,NParameterDeclaration); - _t = _t.getFirstChild(); - declSpecifiers(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NDeclarator: - { - declarator(_t); - _t = _retTree; - break; - } - case NNonemptyAbstractDeclarator: - { - nonemptyAbstractDeclarator(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t120; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void nonemptyAbstractDeclarator(AST _t) throws RecognitionException { - - TNode nonemptyAbstractDeclarator_AST_in = (TNode)_t; - TNode lp1 = null; - TNode rp1 = null; - TNode lb1 = null; - TNode rb1 = null; - TNode lp2 = null; - TNode rp2 = null; - TNode lb2 = null; - TNode rb2 = null; - - try { // for error handling - AST __t195 = _t; - TNode tmp14_AST_in = (TNode)_t; - match(_t,NNonemptyAbstractDeclarator); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NPointerGroup: - { - pointerGroup(_t); - _t = _retTree; - { - _loop202: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LPAREN: - { - { - lp1 = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lp1 ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NNonemptyAbstractDeclarator: - { - nonemptyAbstractDeclarator(_t); - _t = _retTree; - break; - } - case NParameterDeclaration: - { - parameterTypeList(_t); - _t = _retTree; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rp1 = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rp1 ); - } - } - break; - } - case LBRACKET: - { - { - lb1 = (TNode)_t; - match(_t,LBRACKET); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lb1 ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rb1 = (TNode)_t; - match(_t,RBRACKET); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rb1 ); - } - } - break; - } - default: - { - break _loop202; - } - } - } while (true); - } - break; - } - case LPAREN: - case LBRACKET: - { - { - int _cnt208=0; - _loop208: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LPAREN: - { - { - lp2 = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lp2 ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NNonemptyAbstractDeclarator: - { - nonemptyAbstractDeclarator(_t); - _t = _retTree; - break; - } - case NParameterDeclaration: - { - parameterTypeList(_t); - _t = _retTree; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rp2 = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rp2 ); - } - } - break; - } - case LBRACKET: - { - { - lb2 = (TNode)_t; - match(_t,LBRACKET); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lb2 ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rb2 = (TNode)_t; - match(_t,RBRACKET); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rb2 ); - } - } - break; - } - default: - { - if ( _cnt208>=1 ) { break _loop208; } else {throw new NoViableAltException(_t);} - } - } - _cnt208++; - } while (true); - } - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t195; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void functionDeclSpecifiers(AST _t) throws RecognitionException { - - TNode functionDeclSpecifiers_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt129=0; - _loop129: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_extern: - case LITERAL_static: - case LITERAL_inline: - { - functionStorageClassSpecifier(_t); - _t = _retTree; - break; - } - case LITERAL_volatile: - case LITERAL_const: - { - typeQualifier(_t); - _t = _retTree; - break; - } - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - typeSpecifier(_t); - _t = _retTree; - break; - } - default: - { - if ( _cnt129>=1 ) { break _loop129; } else {throw new NoViableAltException(_t);} - } - } - _cnt129++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void compoundStatement(AST _t) throws RecognitionException { - - TNode compoundStatement_AST_in = (TNode)_t; - TNode cs = null; - TNode rc = null; - - try { // for error handling - AST __t138 = _t; - cs = _t==ASTNULL ? null :(TNode)_t; - match(_t,NCompoundStatement); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( cs ); tabs++; - } - { - _loop140: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NDeclaration: - case LITERAL___label__: - { - declarationList(_t); - _t = _retTree; - break; - } - case NFunctionDef: - { - functionDef(_t); - _t = _retTree; - break; - } - default: - { - break _loop140; - } - } - } while (true); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case SEMI: - case LITERAL_while: - case LITERAL_do: - case LITERAL_for: - case LITERAL_goto: - case LITERAL_continue: - case LITERAL_break: - case LITERAL_return: - case LITERAL_case: - case LITERAL_default: - case LITERAL_if: - case LITERAL_switch: - case NStatementExpr: - case NCompoundStatement: - case NLabel: - { - statementList(_t); - _t = _retTree; - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rc = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - tabs--; print( rc ); - } - _t = __t138; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void declarationList(AST _t) throws RecognitionException { - - TNode declarationList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt132=0; - _loop132: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==LITERAL___label__)) { - localLabelDecl(_t); - _t = _retTree; - } - else if ((_t.getType()==NDeclaration)) { - declaration(_t); - _t = _retTree; - } - else { - if ( _cnt132>=1 ) { break _loop132; } else {throw new NoViableAltException(_t);} - } - - _cnt132++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void localLabelDecl(AST _t) throws RecognitionException { - - TNode localLabelDecl_AST_in = (TNode)_t; - TNode a = null; - TNode i = null; - - try { // for error handling - AST __t134 = _t; - a = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL___label__); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( a ); - } - { - int _cnt136=0; - _loop136: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==ID)) { - i = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - commaSep( i ); - } - } - else { - if ( _cnt136>=1 ) { break _loop136; } else {throw new NoViableAltException(_t);} - } - - _cnt136++; - } while (true); - } - if ( inputState.guessing==0 ) { - print( ";" ); - } - _t = __t134; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void statementList(AST _t) throws RecognitionException { - - TNode statementList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt144=0; - _loop144: - do { - if (_t==null) _t=ASTNULL; - if ((_tokenSet_2.member(_t.getType()))) { - statement(_t); - _t = _retTree; - } - else { - if ( _cnt144>=1 ) { break _loop144; } else {throw new NoViableAltException(_t);} - } - - _cnt144++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void statement(AST _t) throws RecognitionException { - - TNode statement_AST_in = (TNode)_t; - - try { // for error handling - statementBody(_t); - _t = _retTree; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void statementBody(AST _t) throws RecognitionException { - - TNode statementBody_AST_in = (TNode)_t; - TNode s = null; - TNode w = null; - TNode d = null; - TNode f = null; - TNode g = null; - TNode c = null; - TNode b = null; - TNode r = null; - TNode ni = null; - TNode ca = null; - TNode de = null; - TNode i = null; - TNode e = null; - TNode sw = null; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case SEMI: - { - s = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( s ); - } - break; - } - case NCompoundStatement: - { - compoundStatement(_t); - _t = _retTree; - break; - } - case NStatementExpr: - { - AST __t147 = _t; - TNode tmp15_AST_in = (TNode)_t; - match(_t,NStatementExpr); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ";" ); - } - _t = __t147; - _t = _t.getNextSibling(); - break; - } - case LITERAL_while: - { - AST __t148 = _t; - w = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_while); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( w ); print( "(" ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ")" ); - } - statement(_t); - _t = _retTree; - _t = __t148; - _t = _t.getNextSibling(); - break; - } - case LITERAL_do: - { - AST __t149 = _t; - d = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_do); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( d ); - } - statement(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( " while ( " ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( " );" ); - } - _t = __t149; - _t = _t.getNextSibling(); - break; - } - case LITERAL_for: - { - AST __t150 = _t; - f = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_for); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( f ); print( "(" ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ";" ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ";" ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ")" ); - } - statement(_t); - _t = _retTree; - _t = __t150; - _t = _t.getNextSibling(); - break; - } - case LITERAL_goto: - { - AST __t151 = _t; - g = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_goto); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( g ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ";" ); - } - _t = __t151; - _t = _t.getNextSibling(); - break; - } - case LITERAL_continue: - { - c = (TNode)_t; - match(_t,LITERAL_continue); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c ); print( ";" ); - } - break; - } - case LITERAL_break: - { - b = (TNode)_t; - match(_t,LITERAL_break); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( b ); print( ";" ); - } - break; - } - case LITERAL_return: - { - AST __t152 = _t; - r = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_return); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( r ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - if ( inputState.guessing==0 ) { - print( ";" ); - } - _t = __t152; - _t = _t.getNextSibling(); - break; - } - case NLabel: - { - AST __t154 = _t; - TNode tmp16_AST_in = (TNode)_t; - match(_t,NLabel); - _t = _t.getFirstChild(); - ni = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( ni ); print( ":" ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case SEMI: - case LITERAL_while: - case LITERAL_do: - case LITERAL_for: - case LITERAL_goto: - case LITERAL_continue: - case LITERAL_break: - case LITERAL_return: - case LITERAL_case: - case LITERAL_default: - case LITERAL_if: - case LITERAL_switch: - case NStatementExpr: - case NCompoundStatement: - case NLabel: - { - statement(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t154; - _t = _t.getNextSibling(); - break; - } - case LITERAL_case: - { - AST __t156 = _t; - ca = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_case); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( ca ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ":" ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case SEMI: - case LITERAL_while: - case LITERAL_do: - case LITERAL_for: - case LITERAL_goto: - case LITERAL_continue: - case LITERAL_break: - case LITERAL_return: - case LITERAL_case: - case LITERAL_default: - case LITERAL_if: - case LITERAL_switch: - case NStatementExpr: - case NCompoundStatement: - case NLabel: - { - statement(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t156; - _t = _t.getNextSibling(); - break; - } - case LITERAL_default: - { - AST __t158 = _t; - de = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_default); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( de ); print( ":" ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case SEMI: - case LITERAL_while: - case LITERAL_do: - case LITERAL_for: - case LITERAL_goto: - case LITERAL_continue: - case LITERAL_break: - case LITERAL_return: - case LITERAL_case: - case LITERAL_default: - case LITERAL_if: - case LITERAL_switch: - case NStatementExpr: - case NCompoundStatement: - case NLabel: - { - statement(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t158; - _t = _t.getNextSibling(); - break; - } - case LITERAL_if: - { - AST __t160 = _t; - i = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_if); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( i ); print( "(" ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ")" ); - } - statement(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_else: - { - e = (TNode)_t; - match(_t,LITERAL_else); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( e ); - } - statement(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t160; - _t = _t.getNextSibling(); - break; - } - case LITERAL_switch: - { - AST __t162 = _t; - sw = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_switch); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( sw ); print( "(" ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ")" ); - } - statement(_t); - _t = _retTree; - _t = __t162; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void binaryExpr(AST _t) throws RecognitionException { - - TNode binaryExpr_AST_in = (TNode)_t; - TNode b = null; - - try { // for error handling - b = _t==ASTNULL ? null : (TNode)_t; - binaryOperator(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - TNode e1, e2; - e1 = (TNode) b.getFirstChild(); - e2 = (TNode) e1.getNextSibling(); - expr( e1 ); - print( b ); - expr( e2 ); - - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void conditionalExpr(AST _t) throws RecognitionException { - - TNode conditionalExpr_AST_in = (TNode)_t; - TNode q = null; - TNode c = null; - - try { // for error handling - AST __t188 = _t; - q = _t==ASTNULL ? null :(TNode)_t; - match(_t,QUESTION); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( q ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - case COLON: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - c = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c ); - } - expr(_t); - _t = _retTree; - _t = __t188; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void castExpr(AST _t) throws RecognitionException { - - TNode castExpr_AST_in = (TNode)_t; - TNode c = null; - TNode rp = null; - - try { // for error handling - AST __t191 = _t; - c = _t==ASTNULL ? null :(TNode)_t; - match(_t,NCast); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( c ); - } - typeName(_t); - _t = _retTree; - rp = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rp ); - } - expr(_t); - _t = _retTree; - _t = __t191; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void unaryExpr(AST _t) throws RecognitionException { - - TNode unaryExpr_AST_in = (TNode)_t; - TNode i = null; - TNode d = null; - TNode u = null; - TNode s = null; - TNode lps = null; - TNode rps = null; - TNode a = null; - TNode lpa = null; - TNode rpa = null; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case INC: - { - AST __t210 = _t; - i = _t==ASTNULL ? null :(TNode)_t; - match(_t,INC); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( i ); - } - expr(_t); - _t = _retTree; - _t = __t210; - _t = _t.getNextSibling(); - break; - } - case DEC: - { - AST __t211 = _t; - d = _t==ASTNULL ? null :(TNode)_t; - match(_t,DEC); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( d ); - } - expr(_t); - _t = _retTree; - _t = __t211; - _t = _t.getNextSibling(); - break; - } - case NUnaryExpr: - { - AST __t212 = _t; - TNode tmp17_AST_in = (TNode)_t; - match(_t,NUnaryExpr); - _t = _t.getFirstChild(); - u = _t==ASTNULL ? null : (TNode)_t; - unaryOperator(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( u ); - } - expr(_t); - _t = _retTree; - _t = __t212; - _t = _t.getNextSibling(); - break; - } - case LITERAL_sizeof: - { - AST __t213 = _t; - s = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL_sizeof); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( s ); - } - { - boolean synPredMatched216 = false; - if (((_t.getType()==LPAREN))) { - AST __t216 = _t; - synPredMatched216 = true; - inputState.guessing++; - try { - { - TNode tmp18_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - typeName(_t); - _t = _retTree; - } - } - catch (RecognitionException pe) { - synPredMatched216 = false; - } - _t = __t216; - inputState.guessing--; - } - if ( synPredMatched216 ) { - lps = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lps ); - } - typeName(_t); - _t = _retTree; - rps = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rps ); - } - } - else if ((_tokenSet_3.member(_t.getType()))) { - expr(_t); - _t = _retTree; - } - else { - throw new NoViableAltException(_t); - } - - } - _t = __t213; - _t = _t.getNextSibling(); - break; - } - case LITERAL___alignof: - { - AST __t217 = _t; - a = _t==ASTNULL ? null :(TNode)_t; - match(_t,LITERAL___alignof); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( a ); - } - { - boolean synPredMatched220 = false; - if (((_t.getType()==LPAREN))) { - AST __t220 = _t; - synPredMatched220 = true; - inputState.guessing++; - try { - { - TNode tmp19_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - typeName(_t); - _t = _retTree; - } - } - catch (RecognitionException pe) { - synPredMatched220 = false; - } - _t = __t220; - inputState.guessing--; - } - if ( synPredMatched220 ) { - lpa = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lpa ); - } - typeName(_t); - _t = _retTree; - rpa = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rpa ); - } - } - else if ((_tokenSet_3.member(_t.getType()))) { - expr(_t); - _t = _retTree; - } - else { - throw new NoViableAltException(_t); - } - - } - _t = __t217; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void postfixExpr(AST _t) throws RecognitionException { - - TNode postfixExpr_AST_in = (TNode)_t; - TNode a = null; - TNode b = null; - TNode c = null; - TNode d = null; - TNode n = null; - TNode rp = null; - TNode lb = null; - TNode rb = null; - TNode f = null; - TNode g = null; - - try { // for error handling - AST __t223 = _t; - TNode tmp20_AST_in = (TNode)_t; - match(_t,NPostfixExpr); - _t = _t.getFirstChild(); - primaryExpr(_t); - _t = _retTree; - { - int _cnt227=0; - _loop227: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case PTR: - { - a = (TNode)_t; - match(_t,PTR); - _t = _t.getNextSibling(); - b = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( a ); print( b ); - } - break; - } - case DOT: - { - c = (TNode)_t; - match(_t,DOT); - _t = _t.getNextSibling(); - d = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c ); print( d ); - } - break; - } - case NFunctionCallArgs: - { - AST __t225 = _t; - n = _t==ASTNULL ? null :(TNode)_t; - match(_t,NFunctionCallArgs); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( n ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - argExprList(_t); - _t = _retTree; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rp = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rp ); - } - _t = __t225; - _t = _t.getNextSibling(); - break; - } - case LBRACKET: - { - lb = (TNode)_t; - match(_t,LBRACKET); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lb ); - } - expr(_t); - _t = _retTree; - rb = (TNode)_t; - match(_t,RBRACKET); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rb ); - } - break; - } - case INC: - { - f = (TNode)_t; - match(_t,INC); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( f ); - } - break; - } - case DEC: - { - g = (TNode)_t; - match(_t,DEC); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( g ); - } - break; - } - default: - { - if ( _cnt227>=1 ) { break _loop227; } else {throw new NoViableAltException(_t);} - } - } - _cnt227++; - } while (true); - } - _t = __t223; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void primaryExpr(AST _t) throws RecognitionException { - - TNode primaryExpr_AST_in = (TNode)_t; - TNode i = null; - TNode n = null; - TNode eg = null; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - { - i = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( i ); - } - break; - } - case Number: - { - n = (TNode)_t; - match(_t,Number); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( n ); - } - break; - } - case CharLiteral: - { - charConst(_t); - _t = _retTree; - break; - } - case NStringSeq: - { - stringConst(_t); - _t = _retTree; - break; - } - case NExpressionGroup: - { - AST __t229 = _t; - eg = _t==ASTNULL ? null :(TNode)_t; - match(_t,NExpressionGroup); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( eg ); - } - expr(_t); - _t = _retTree; - if ( inputState.guessing==0 ) { - print( ")" ); - } - _t = __t229; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void emptyExpr(AST _t) throws RecognitionException { - - TNode emptyExpr_AST_in = (TNode)_t; - - try { // for error handling - TNode tmp21_AST_in = (TNode)_t; - match(_t,NEmptyExpression); - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void compoundStatementExpr(AST _t) throws RecognitionException { - - TNode compoundStatementExpr_AST_in = (TNode)_t; - TNode l = null; - TNode r = null; - - try { // for error handling - AST __t166 = _t; - l = _t==ASTNULL ? null :(TNode)_t; - match(_t,LPAREN); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( l ); - } - compoundStatement(_t); - _t = _retTree; - r = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( r ); - } - _t = __t166; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void rangeExpr(AST _t) throws RecognitionException { - - TNode rangeExpr_AST_in = (TNode)_t; - TNode v = null; - - try { // for error handling - AST __t168 = _t; - TNode tmp22_AST_in = (TNode)_t; - match(_t,NRangeExpr); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - v = (TNode)_t; - match(_t,VARARGS); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( v ); - } - expr(_t); - _t = _retTree; - _t = __t168; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void gnuAsmExpr(AST _t) throws RecognitionException { - - TNode gnuAsmExpr_AST_in = (TNode)_t; - TNode n = null; - TNode v = null; - TNode lp = null; - TNode c1 = null; - TNode c2 = null; - TNode c3 = null; - TNode c4 = null; - TNode c5 = null; - TNode c6 = null; - TNode rp = null; - - try { // for error handling - AST __t170 = _t; - n = _t==ASTNULL ? null :(TNode)_t; - match(_t,NGnuAsmExpr); - _t = _t.getFirstChild(); - if ( inputState.guessing==0 ) { - print( n ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - { - v = (TNode)_t; - match(_t,LITERAL_volatile); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( v ); - } - break; - } - case LPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - lp = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( lp ); - } - stringConst(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COLON)) { - c1 = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c1 ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NStringSeq: - { - strOptExprPair(_t); - _t = _retTree; - { - _loop175: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COMMA)) { - c2 = (TNode)_t; - match(_t,COMMA); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c2 ); - } - strOptExprPair(_t); - _t = _retTree; - } - else { - break _loop175; - } - - } while (true); - } - break; - } - case COLON: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COLON)) { - c3 = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c3 ); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NStringSeq: - { - strOptExprPair(_t); - _t = _retTree; - { - _loop179: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COMMA)) { - c4 = (TNode)_t; - match(_t,COMMA); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c4 ); - } - strOptExprPair(_t); - _t = _retTree; - } - else { - break _loop179; - } - - } while (true); - } - break; - } - case COLON: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - else if ((_t.getType()==COLON||_t.getType()==RPAREN)) { - } - else { - throw new NoViableAltException(_t); - } - - } - } - else if ((_t.getType()==COLON||_t.getType()==RPAREN)) { - } - else { - throw new NoViableAltException(_t); - } - - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case COLON: - { - c5 = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c5 ); - } - stringConst(_t); - _t = _retTree; - { - _loop182: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COMMA)) { - c6 = (TNode)_t; - match(_t,COMMA); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c6 ); - } - stringConst(_t); - _t = _retTree; - } - else { - break _loop182; - } - - } while (true); - } - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - rp = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( rp ); - } - _t = __t170; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - protected final void stringConst(AST _t) throws RecognitionException { - - TNode stringConst_AST_in = (TNode)_t; - TNode s = null; - - try { // for error handling - AST __t235 = _t; - TNode tmp23_AST_in = (TNode)_t; - match(_t,NStringSeq); - _t = _t.getFirstChild(); - { - int _cnt237=0; - _loop237: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==StringLiteral)) { - s = (TNode)_t; - match(_t,StringLiteral); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( s ); - } - } - else { - if ( _cnt237>=1 ) { break _loop237; } else {throw new NoViableAltException(_t);} - } - - _cnt237++; - } while (true); - } - _t = __t235; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void strOptExprPair(AST _t) throws RecognitionException { - - TNode strOptExprPair_AST_in = (TNode)_t; - TNode l = null; - TNode r = null; - - try { // for error handling - stringConst(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LPAREN: - { - l = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( l ); - } - expr(_t); - _t = _retTree; - r = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( r ); - } - break; - } - case COMMA: - case COLON: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void binaryOperator(AST _t) throws RecognitionException { - - TNode binaryOperator_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - { - TNode tmp24_AST_in = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getNextSibling(); - break; - } - case DIV_ASSIGN: - { - TNode tmp25_AST_in = (TNode)_t; - match(_t,DIV_ASSIGN); - _t = _t.getNextSibling(); - break; - } - case PLUS_ASSIGN: - { - TNode tmp26_AST_in = (TNode)_t; - match(_t,PLUS_ASSIGN); - _t = _t.getNextSibling(); - break; - } - case MINUS_ASSIGN: - { - TNode tmp27_AST_in = (TNode)_t; - match(_t,MINUS_ASSIGN); - _t = _t.getNextSibling(); - break; - } - case STAR_ASSIGN: - { - TNode tmp28_AST_in = (TNode)_t; - match(_t,STAR_ASSIGN); - _t = _t.getNextSibling(); - break; - } - case MOD_ASSIGN: - { - TNode tmp29_AST_in = (TNode)_t; - match(_t,MOD_ASSIGN); - _t = _t.getNextSibling(); - break; - } - case RSHIFT_ASSIGN: - { - TNode tmp30_AST_in = (TNode)_t; - match(_t,RSHIFT_ASSIGN); - _t = _t.getNextSibling(); - break; - } - case LSHIFT_ASSIGN: - { - TNode tmp31_AST_in = (TNode)_t; - match(_t,LSHIFT_ASSIGN); - _t = _t.getNextSibling(); - break; - } - case BAND_ASSIGN: - { - TNode tmp32_AST_in = (TNode)_t; - match(_t,BAND_ASSIGN); - _t = _t.getNextSibling(); - break; - } - case BOR_ASSIGN: - { - TNode tmp33_AST_in = (TNode)_t; - match(_t,BOR_ASSIGN); - _t = _t.getNextSibling(); - break; - } - case BXOR_ASSIGN: - { - TNode tmp34_AST_in = (TNode)_t; - match(_t,BXOR_ASSIGN); - _t = _t.getNextSibling(); - break; - } - case LOR: - { - TNode tmp35_AST_in = (TNode)_t; - match(_t,LOR); - _t = _t.getNextSibling(); - break; - } - case LAND: - { - TNode tmp36_AST_in = (TNode)_t; - match(_t,LAND); - _t = _t.getNextSibling(); - break; - } - case BOR: - { - TNode tmp37_AST_in = (TNode)_t; - match(_t,BOR); - _t = _t.getNextSibling(); - break; - } - case BXOR: - { - TNode tmp38_AST_in = (TNode)_t; - match(_t,BXOR); - _t = _t.getNextSibling(); - break; - } - case BAND: - { - TNode tmp39_AST_in = (TNode)_t; - match(_t,BAND); - _t = _t.getNextSibling(); - break; - } - case EQUAL: - { - TNode tmp40_AST_in = (TNode)_t; - match(_t,EQUAL); - _t = _t.getNextSibling(); - break; - } - case NOT_EQUAL: - { - TNode tmp41_AST_in = (TNode)_t; - match(_t,NOT_EQUAL); - _t = _t.getNextSibling(); - break; - } - case LT: - { - TNode tmp42_AST_in = (TNode)_t; - match(_t,LT); - _t = _t.getNextSibling(); - break; - } - case LTE: - { - TNode tmp43_AST_in = (TNode)_t; - match(_t,LTE); - _t = _t.getNextSibling(); - break; - } - case GT: - { - TNode tmp44_AST_in = (TNode)_t; - match(_t,GT); - _t = _t.getNextSibling(); - break; - } - case GTE: - { - TNode tmp45_AST_in = (TNode)_t; - match(_t,GTE); - _t = _t.getNextSibling(); - break; - } - case LSHIFT: - { - TNode tmp46_AST_in = (TNode)_t; - match(_t,LSHIFT); - _t = _t.getNextSibling(); - break; - } - case RSHIFT: - { - TNode tmp47_AST_in = (TNode)_t; - match(_t,RSHIFT); - _t = _t.getNextSibling(); - break; - } - case PLUS: - { - TNode tmp48_AST_in = (TNode)_t; - match(_t,PLUS); - _t = _t.getNextSibling(); - break; - } - case MINUS: - { - TNode tmp49_AST_in = (TNode)_t; - match(_t,MINUS); - _t = _t.getNextSibling(); - break; - } - case STAR: - { - TNode tmp50_AST_in = (TNode)_t; - match(_t,STAR); - _t = _t.getNextSibling(); - break; - } - case DIV: - { - TNode tmp51_AST_in = (TNode)_t; - match(_t,DIV); - _t = _t.getNextSibling(); - break; - } - case MOD: - { - TNode tmp52_AST_in = (TNode)_t; - match(_t,MOD); - _t = _t.getNextSibling(); - break; - } - case NCommaExpr: - { - TNode tmp53_AST_in = (TNode)_t; - match(_t,NCommaExpr); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void unaryOperator(AST _t) throws RecognitionException { - - TNode unaryOperator_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case BAND: - { - TNode tmp54_AST_in = (TNode)_t; - match(_t,BAND); - _t = _t.getNextSibling(); - break; - } - case STAR: - { - TNode tmp55_AST_in = (TNode)_t; - match(_t,STAR); - _t = _t.getNextSibling(); - break; - } - case PLUS: - { - TNode tmp56_AST_in = (TNode)_t; - match(_t,PLUS); - _t = _t.getNextSibling(); - break; - } - case MINUS: - { - TNode tmp57_AST_in = (TNode)_t; - match(_t,MINUS); - _t = _t.getNextSibling(); - break; - } - case BNOT: - { - TNode tmp58_AST_in = (TNode)_t; - match(_t,BNOT); - _t = _t.getNextSibling(); - break; - } - case LNOT: - { - TNode tmp59_AST_in = (TNode)_t; - match(_t,LNOT); - _t = _t.getNextSibling(); - break; - } - case LAND: - { - TNode tmp60_AST_in = (TNode)_t; - match(_t,LAND); - _t = _t.getNextSibling(); - break; - } - case LITERAL___real: - { - TNode tmp61_AST_in = (TNode)_t; - match(_t,LITERAL___real); - _t = _t.getNextSibling(); - break; - } - case LITERAL___imag: - { - TNode tmp62_AST_in = (TNode)_t; - match(_t,LITERAL___imag); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void argExprList(AST _t) throws RecognitionException { - - TNode argExprList_AST_in = (TNode)_t; - - try { // for error handling - expr(_t); - _t = _retTree; - { - _loop232: - do { - if (_t==null) _t=ASTNULL; - if ((_tokenSet_3.member(_t.getType()))) { - if ( inputState.guessing==0 ) { - print( "," ); - } - expr(_t); - _t = _retTree; - } - else { - break _loop232; - } - - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - protected final void charConst(AST _t) throws RecognitionException { - - TNode charConst_AST_in = (TNode)_t; - TNode c = null; - - try { // for error handling - c = (TNode)_t; - match(_t,CharLiteral); - _t = _t.getNextSibling(); - if ( inputState.guessing==0 ) { - print( c ); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - protected final void intConst(AST _t) throws RecognitionException { - - TNode intConst_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case IntOctalConst: - { - TNode tmp63_AST_in = (TNode)_t; - match(_t,IntOctalConst); - _t = _t.getNextSibling(); - break; - } - case LongOctalConst: - { - TNode tmp64_AST_in = (TNode)_t; - match(_t,LongOctalConst); - _t = _t.getNextSibling(); - break; - } - case UnsignedOctalConst: - { - TNode tmp65_AST_in = (TNode)_t; - match(_t,UnsignedOctalConst); - _t = _t.getNextSibling(); - break; - } - case IntIntConst: - { - TNode tmp66_AST_in = (TNode)_t; - match(_t,IntIntConst); - _t = _t.getNextSibling(); - break; - } - case LongIntConst: - { - TNode tmp67_AST_in = (TNode)_t; - match(_t,LongIntConst); - _t = _t.getNextSibling(); - break; - } - case UnsignedIntConst: - { - TNode tmp68_AST_in = (TNode)_t; - match(_t,UnsignedIntConst); - _t = _t.getNextSibling(); - break; - } - case IntHexConst: - { - TNode tmp69_AST_in = (TNode)_t; - match(_t,IntHexConst); - _t = _t.getNextSibling(); - break; - } - case LongHexConst: - { - TNode tmp70_AST_in = (TNode)_t; - match(_t,LongHexConst); - _t = _t.getNextSibling(); - break; - } - case UnsignedHexConst: - { - TNode tmp71_AST_in = (TNode)_t; - match(_t,UnsignedHexConst); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - protected final void floatConst(AST _t) throws RecognitionException { - - TNode floatConst_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case FloatDoubleConst: - { - TNode tmp72_AST_in = (TNode)_t; - match(_t,FloatDoubleConst); - _t = _t.getNextSibling(); - break; - } - case DoubleDoubleConst: - { - TNode tmp73_AST_in = (TNode)_t; - match(_t,DoubleDoubleConst); - _t = _t.getNextSibling(); - break; - } - case LongDoubleConst: - { - TNode tmp74_AST_in = (TNode)_t; - match(_t,LongDoubleConst); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void commaExpr(AST _t) throws RecognitionException { - - TNode commaExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t241 = _t; - TNode tmp75_AST_in = (TNode)_t; - match(_t,NCommaExpr); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t241; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void assignExpr(AST _t) throws RecognitionException { - - TNode assignExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - { - AST __t243 = _t; - TNode tmp76_AST_in = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t243; - _t = _t.getNextSibling(); - break; - } - case DIV_ASSIGN: - { - AST __t244 = _t; - TNode tmp77_AST_in = (TNode)_t; - match(_t,DIV_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t244; - _t = _t.getNextSibling(); - break; - } - case PLUS_ASSIGN: - { - AST __t245 = _t; - TNode tmp78_AST_in = (TNode)_t; - match(_t,PLUS_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t245; - _t = _t.getNextSibling(); - break; - } - case MINUS_ASSIGN: - { - AST __t246 = _t; - TNode tmp79_AST_in = (TNode)_t; - match(_t,MINUS_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t246; - _t = _t.getNextSibling(); - break; - } - case STAR_ASSIGN: - { - AST __t247 = _t; - TNode tmp80_AST_in = (TNode)_t; - match(_t,STAR_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t247; - _t = _t.getNextSibling(); - break; - } - case MOD_ASSIGN: - { - AST __t248 = _t; - TNode tmp81_AST_in = (TNode)_t; - match(_t,MOD_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t248; - _t = _t.getNextSibling(); - break; - } - case RSHIFT_ASSIGN: - { - AST __t249 = _t; - TNode tmp82_AST_in = (TNode)_t; - match(_t,RSHIFT_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t249; - _t = _t.getNextSibling(); - break; - } - case LSHIFT_ASSIGN: - { - AST __t250 = _t; - TNode tmp83_AST_in = (TNode)_t; - match(_t,LSHIFT_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t250; - _t = _t.getNextSibling(); - break; - } - case BAND_ASSIGN: - { - AST __t251 = _t; - TNode tmp84_AST_in = (TNode)_t; - match(_t,BAND_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t251; - _t = _t.getNextSibling(); - break; - } - case BOR_ASSIGN: - { - AST __t252 = _t; - TNode tmp85_AST_in = (TNode)_t; - match(_t,BOR_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t252; - _t = _t.getNextSibling(); - break; - } - case BXOR_ASSIGN: - { - AST __t253 = _t; - TNode tmp86_AST_in = (TNode)_t; - match(_t,BXOR_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t253; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void logicalOrExpr(AST _t) throws RecognitionException { - - TNode logicalOrExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t255 = _t; - TNode tmp87_AST_in = (TNode)_t; - match(_t,LOR); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t255; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void logicalAndExpr(AST _t) throws RecognitionException { - - TNode logicalAndExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t257 = _t; - TNode tmp88_AST_in = (TNode)_t; - match(_t,LAND); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t257; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void inclusiveOrExpr(AST _t) throws RecognitionException { - - TNode inclusiveOrExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t259 = _t; - TNode tmp89_AST_in = (TNode)_t; - match(_t,BOR); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t259; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void exclusiveOrExpr(AST _t) throws RecognitionException { - - TNode exclusiveOrExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t261 = _t; - TNode tmp90_AST_in = (TNode)_t; - match(_t,BXOR); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t261; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void bitAndExpr(AST _t) throws RecognitionException { - - TNode bitAndExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t263 = _t; - TNode tmp91_AST_in = (TNode)_t; - match(_t,BAND); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t263; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void equalityExpr(AST _t) throws RecognitionException { - - TNode equalityExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case EQUAL: - { - AST __t265 = _t; - TNode tmp92_AST_in = (TNode)_t; - match(_t,EQUAL); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t265; - _t = _t.getNextSibling(); - break; - } - case NOT_EQUAL: - { - AST __t266 = _t; - TNode tmp93_AST_in = (TNode)_t; - match(_t,NOT_EQUAL); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t266; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void relationalExpr(AST _t) throws RecognitionException { - - TNode relationalExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LT: - { - AST __t268 = _t; - TNode tmp94_AST_in = (TNode)_t; - match(_t,LT); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t268; - _t = _t.getNextSibling(); - break; - } - case LTE: - { - AST __t269 = _t; - TNode tmp95_AST_in = (TNode)_t; - match(_t,LTE); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t269; - _t = _t.getNextSibling(); - break; - } - case GT: - { - AST __t270 = _t; - TNode tmp96_AST_in = (TNode)_t; - match(_t,GT); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t270; - _t = _t.getNextSibling(); - break; - } - case GTE: - { - AST __t271 = _t; - TNode tmp97_AST_in = (TNode)_t; - match(_t,GTE); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t271; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void shiftExpr(AST _t) throws RecognitionException { - - TNode shiftExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LSHIFT: - { - AST __t273 = _t; - TNode tmp98_AST_in = (TNode)_t; - match(_t,LSHIFT); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t273; - _t = _t.getNextSibling(); - break; - } - case RSHIFT: - { - AST __t274 = _t; - TNode tmp99_AST_in = (TNode)_t; - match(_t,RSHIFT); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t274; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void additiveExpr(AST _t) throws RecognitionException { - - TNode additiveExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case PLUS: - { - AST __t276 = _t; - TNode tmp100_AST_in = (TNode)_t; - match(_t,PLUS); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t276; - _t = _t.getNextSibling(); - break; - } - case MINUS: - { - AST __t277 = _t; - TNode tmp101_AST_in = (TNode)_t; - match(_t,MINUS); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t277; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void multExpr(AST _t) throws RecognitionException { - - TNode multExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case STAR: - { - AST __t279 = _t; - TNode tmp102_AST_in = (TNode)_t; - match(_t,STAR); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t279; - _t = _t.getNextSibling(); - break; - } - case DIV: - { - AST __t280 = _t; - TNode tmp103_AST_in = (TNode)_t; - match(_t,DIV); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t280; - _t = _t.getNextSibling(); - break; - } - case MOD: - { - AST __t281 = _t; - TNode tmp104_AST_in = (TNode)_t; - match(_t,MOD); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t281; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - - public static final String[] _tokenNames = { - "<0>", - "EOF", - "<2>", - "NULL_TREE_LOOKAHEAD", - "\"typedef\"", - "\"asm\"", - "\"volatile\"", - "LCURLY", - "RCURLY", - "SEMI", - "\"struct\"", - "\"union\"", - "\"enum\"", - "\"auto\"", - "\"register\"", - "\"extern\"", - "\"static\"", - "\"const\"", - "\"void\"", - "\"char\"", - "\"short\"", - "\"int\"", - "\"long\"", - "\"float\"", - "\"double\"", - "\"signed\"", - "\"unsigned\"", - "ID", - "COMMA", - "COLON", - "ASSIGN", - "STAR", - "LPAREN", - "RPAREN", - "LBRACKET", - "RBRACKET", - "VARARGS", - "\"while\"", - "\"do\"", - "\"for\"", - "\"goto\"", - "\"continue\"", - "\"break\"", - "\"return\"", - "\"case\"", - "\"default\"", - "\"if\"", - "\"else\"", - "\"switch\"", - "DIV_ASSIGN", - "PLUS_ASSIGN", - "MINUS_ASSIGN", - "STAR_ASSIGN", - "MOD_ASSIGN", - "RSHIFT_ASSIGN", - "LSHIFT_ASSIGN", - "BAND_ASSIGN", - "BOR_ASSIGN", - "BXOR_ASSIGN", - "QUESTION", - "LOR", - "LAND", - "BOR", - "BXOR", - "BAND", - "EQUAL", - "NOT_EQUAL", - "LT", - "LTE", - "GT", - "GTE", - "LSHIFT", - "RSHIFT", - "PLUS", - "MINUS", - "DIV", - "MOD", - "INC", - "DEC", - "\"sizeof\"", - "BNOT", - "LNOT", - "PTR", - "DOT", - "CharLiteral", - "StringLiteral", - "IntOctalConst", - "LongOctalConst", - "UnsignedOctalConst", - "IntIntConst", - "LongIntConst", - "UnsignedIntConst", - "IntHexConst", - "LongHexConst", - "UnsignedHexConst", - "FloatDoubleConst", - "DoubleDoubleConst", - "LongDoubleConst", - "NTypedefName", - "NInitDecl", - "NDeclarator", - "NStructDeclarator", - "NDeclaration", - "NCast", - "NPointerGroup", - "NExpressionGroup", - "NFunctionCallArgs", - "NNonemptyAbstractDeclarator", - "NInitializer", - "NStatementExpr", - "NEmptyExpression", - "NParameterTypeList", - "NFunctionDef", - "NCompoundStatement", - "NParameterDeclaration", - "NCommaExpr", - "NUnaryExpr", - "NLabel", - "NPostfixExpr", - "NRangeExpr", - "NStringSeq", - "NInitializerElementLabel", - "NLcurlyInitializer", - "NAsmAttribute", - "NGnuAsmExpr", - "NTypeMissing", - "Vocabulary", - "Whitespace", - "Comment", - "CPPComment", - "a line directive", - "Space", - "LineDirective", - "BadStringLiteral", - "Escape", - "Digit", - "LongSuffix", - "UnsignedSuffix", - "FloatSuffix", - "Exponent", - "Number", - "\"__label__\"", - "\"inline\"", - "\"byte\"", - "\"boolean\"", - "\"Servo\"", - "\"Wire\"", - "\"typeof\"", - "\"__complex\"", - "\"__attribute\"", - "\"__alignof\"", - "\"__real\"", - "\"__imag\"" - }; - - private static final long[] mk_tokenSet_0() { - long[] data = { 544L, 2306124759068311552L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); - private static final long[] mk_tokenSet_1() { - long[] data = { 134093888L, 17179869184L, 2064384L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); - private static final long[] mk_tokenSet_2() { - long[] data = { 422075026113024L, 9605333580251136L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); - private static final long[] mk_tokenSet_3() { - long[] data = { -562942303010816L, 1574098779476393983L, 4198400L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); - } - +public WEmitter() { + tokenNames = _tokenNames; +} + + public final void translationUnit(AST _t) throws RecognitionException { + + TNode translationUnit_AST_in = (TNode)_t; + + if ( inputState.guessing==0 ) { + initializePrinting(); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_asm: + case SEMI: + case NDeclaration: + case NFunctionDef: + case NTypeMissing: + { + externalList(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + if ( inputState.guessing==0 ) { + finalizePrinting(); + } + _retTree = _t; + } + + public final void externalList(AST _t) throws RecognitionException { + + TNode externalList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt5=0; + _loop5: + do { + if (_t==null) _t=ASTNULL; + if ((_tokenSet_0.member(_t.getType()))) { + externalDef(_t); + _t = _retTree; + } + else { + if ( _cnt5>=1 ) { break _loop5; } else {throw new NoViableAltException(_t);} + } + + _cnt5++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void externalDef(AST _t) throws RecognitionException { + + TNode externalDef_AST_in = (TNode)_t; + TNode s = null; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NDeclaration: + { + declaration(_t); + _t = _retTree; + break; + } + case NFunctionDef: + { + functionDef(_t); + _t = _retTree; + break; + } + case LITERAL_asm: + { + asm_expr(_t); + _t = _retTree; + break; + } + case NTypeMissing: + { + typelessDeclaration(_t); + _t = _retTree; + break; + } + case SEMI: + { + s = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( s ); + } + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void declaration(AST _t) throws RecognitionException { + + TNode declaration_AST_in = (TNode)_t; + TNode s = null; + + try { // for error handling + AST __t13 = _t; + TNode tmp1_AST_in = (TNode)_t; + match(_t,NDeclaration); + _t = _t.getFirstChild(); + declSpecifiers(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NInitDecl: + { + initDeclList(_t); + _t = _retTree; + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + int _cnt16=0; + _loop16: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==SEMI)) { + s = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( s ); + } + } + else { + if ( _cnt16>=1 ) { break _loop16; } else {throw new NoViableAltException(_t);} + } + + _cnt16++; + } while (true); + } + _t = __t13; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void functionDef(AST _t) throws RecognitionException { + + TNode functionDef_AST_in = (TNode)_t; + TNode v = null; + + try { // for error handling + AST __t123 = _t; + TNode tmp2_AST_in = (TNode)_t; + match(_t,NFunctionDef); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_inline: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + functionDeclSpecifiers(_t); + _t = _retTree; + break; + } + case NDeclarator: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + declarator(_t); + _t = _retTree; + { + _loop126: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NDeclaration: + { + declaration(_t); + _t = _retTree; + break; + } + case VARARGS: + { + v = (TNode)_t; + match(_t,VARARGS); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( v ); + } + break; + } + default: + { + break _loop126; + } + } + } while (true); + } + compoundStatement(_t); + _t = _retTree; + _t = __t123; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void asm_expr(AST _t) throws RecognitionException { + + TNode asm_expr_AST_in = (TNode)_t; + TNode a = null; + TNode v = null; + TNode lc = null; + TNode rc = null; + TNode s = null; + + try { // for error handling + AST __t10 = _t; + a = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_asm); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( a ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + { + v = (TNode)_t; + match(_t,LITERAL_volatile); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( v ); + } + break; + } + case LCURLY: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + lc = (TNode)_t; + match(_t,LCURLY); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lc ); tabs++; + } + expr(_t); + _t = _retTree; + rc = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + tabs--; print( rc ); + } + s = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( s ); + } + _t = __t10; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void typelessDeclaration(AST _t) throws RecognitionException { + + TNode typelessDeclaration_AST_in = (TNode)_t; + TNode s = null; + + try { // for error handling + AST __t8 = _t; + TNode tmp3_AST_in = (TNode)_t; + match(_t,NTypeMissing); + _t = _t.getFirstChild(); + initDeclList(_t); + _t = _retTree; + s = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + _t = __t8; + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( s ); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void initDeclList(AST _t) throws RecognitionException { + + TNode initDeclList_AST_in = (TNode)_t; + + try { // for error handling + initDecl(_t); + _t = _retTree; + { + _loop76: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NInitDecl)) { + if ( inputState.guessing==0 ) { + print( "," ); + } + initDecl(_t); + _t = _retTree; + } + else { + break _loop76; + } + + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void expr(AST _t) throws RecognitionException { + + TNode expr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + case STAR: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case NCommaExpr: + { + binaryExpr(_t); + _t = _retTree; + break; + } + case QUESTION: + { + conditionalExpr(_t); + _t = _retTree; + break; + } + case NCast: + { + castExpr(_t); + _t = _retTree; + break; + } + case INC: + case DEC: + case LITERAL_sizeof: + case NUnaryExpr: + case LITERAL___alignof: + { + unaryExpr(_t); + _t = _retTree; + break; + } + case NPostfixExpr: + { + postfixExpr(_t); + _t = _retTree; + break; + } + case ID: + case CharLiteral: + case NExpressionGroup: + case NStringSeq: + case Number: + { + primaryExpr(_t); + _t = _retTree; + break; + } + case NEmptyExpression: + { + emptyExpr(_t); + _t = _retTree; + break; + } + case LPAREN: + { + compoundStatementExpr(_t); + _t = _retTree; + break; + } + case NInitializer: + case NLcurlyInitializer: + { + initializer(_t); + _t = _retTree; + break; + } + case NRangeExpr: + { + rangeExpr(_t); + _t = _retTree; + break; + } + case NGnuAsmExpr: + { + gnuAsmExpr(_t); + _t = _retTree; + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void declSpecifiers(AST _t) throws RecognitionException { + + TNode declSpecifiers_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt19=0; + _loop19: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_typedef: + case LITERAL_auto: + case LITERAL_register: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_inline: + { + storageClassSpecifier(_t); + _t = _retTree; + break; + } + case LITERAL_volatile: + case LITERAL_const: + { + typeQualifier(_t); + _t = _retTree; + break; + } + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + typeSpecifier(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt19>=1 ) { break _loop19; } else {throw new NoViableAltException(_t);} + } + } + _cnt19++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void storageClassSpecifier(AST _t) throws RecognitionException { + + TNode storageClassSpecifier_AST_in = (TNode)_t; + TNode a = null; + TNode b = null; + TNode c = null; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_auto: + { + a = (TNode)_t; + match(_t,LITERAL_auto); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( a ); + } + break; + } + case LITERAL_register: + { + b = (TNode)_t; + match(_t,LITERAL_register); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( b ); + } + break; + } + case LITERAL_typedef: + { + c = (TNode)_t; + match(_t,LITERAL_typedef); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c ); + } + break; + } + case LITERAL_extern: + case LITERAL_static: + case LITERAL_inline: + { + functionStorageClassSpecifier(_t); + _t = _retTree; + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void typeQualifier(AST _t) throws RecognitionException { + + TNode typeQualifier_AST_in = (TNode)_t; + TNode a = null; + TNode b = null; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_const: + { + a = (TNode)_t; + match(_t,LITERAL_const); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( a ); + } + break; + } + case LITERAL_volatile: + { + b = (TNode)_t; + match(_t,LITERAL_volatile); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( b ); + } + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void typeSpecifier(AST _t) throws RecognitionException { + + TNode typeSpecifier_AST_in = (TNode)_t; + TNode a = null; + TNode b = null; + TNode c = null; + TNode d = null; + TNode e = null; + TNode f = null; + TNode g = null; + TNode h = null; + TNode i = null; + TNode j = null; + TNode k = null; + TNode l = null; + TNode m = null; + TNode n = null; + TNode lp = null; + TNode rp = null; + TNode p = null; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_void: + { + a = (TNode)_t; + match(_t,LITERAL_void); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( a ); + } + break; + } + case LITERAL_char: + { + b = (TNode)_t; + match(_t,LITERAL_char); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( b ); + } + break; + } + case LITERAL_short: + { + c = (TNode)_t; + match(_t,LITERAL_short); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c ); + } + break; + } + case LITERAL_int: + { + d = (TNode)_t; + match(_t,LITERAL_int); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( d ); + } + break; + } + case LITERAL_long: + { + e = (TNode)_t; + match(_t,LITERAL_long); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( e ); + } + break; + } + case LITERAL_float: + { + f = (TNode)_t; + match(_t,LITERAL_float); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( f ); + } + break; + } + case LITERAL_double: + { + g = (TNode)_t; + match(_t,LITERAL_double); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( g ); + } + break; + } + case LITERAL_signed: + { + h = (TNode)_t; + match(_t,LITERAL_signed); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( h ); + } + break; + } + case LITERAL_unsigned: + { + i = (TNode)_t; + match(_t,LITERAL_unsigned); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( i ); + } + break; + } + case LITERAL_byte: + { + j = (TNode)_t; + match(_t,LITERAL_byte); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( j ); + } + break; + } + case LITERAL_boolean: + { + k = (TNode)_t; + match(_t,LITERAL_boolean); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( k ); + } + break; + } + case LITERAL_Servo: + { + l = (TNode)_t; + match(_t,LITERAL_Servo); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( l ); + } + break; + } + case LITERAL_Wire: + { + m = (TNode)_t; + match(_t,LITERAL_Wire); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( m ); + } + break; + } + case LITERAL_struct: + { + structSpecifier(_t); + _t = _retTree; + { + _loop25: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { + attributeDecl(_t); + _t = _retTree; + } + else { + break _loop25; + } + + } while (true); + } + break; + } + case LITERAL_union: + { + unionSpecifier(_t); + _t = _retTree; + { + _loop27: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { + attributeDecl(_t); + _t = _retTree; + } + else { + break _loop27; + } + + } while (true); + } + break; + } + case LITERAL_enum: + { + enumSpecifier(_t); + _t = _retTree; + break; + } + case NTypedefName: + { + typedefName(_t); + _t = _retTree; + break; + } + case LITERAL_typeof: + { + AST __t28 = _t; + n = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_typeof); + _t = _t.getFirstChild(); + lp = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( n ); print( lp ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + typeName(_t); + _t = _retTree; + break; + } + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rp = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rp ); + } + _t = __t28; + _t = _t.getNextSibling(); + break; + } + case LITERAL___complex: + { + p = (TNode)_t; + match(_t,LITERAL___complex); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( p ); + } + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void functionStorageClassSpecifier(AST _t) throws RecognitionException { + + TNode functionStorageClassSpecifier_AST_in = (TNode)_t; + TNode a = null; + TNode b = null; + TNode c = null; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_extern: + { + a = (TNode)_t; + match(_t,LITERAL_extern); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( a ); + } + break; + } + case LITERAL_static: + { + b = (TNode)_t; + match(_t,LITERAL_static); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( b ); + } + break; + } + case LITERAL_inline: + { + c = (TNode)_t; + match(_t,LITERAL_inline); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c ); + } + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structSpecifier(AST _t) throws RecognitionException { + + TNode structSpecifier_AST_in = (TNode)_t; + TNode a = null; + + try { // for error handling + AST __t35 = _t; + a = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_struct); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( a ); + } + structOrUnionBody(_t); + _t = _retTree; + _t = __t35; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void attributeDecl(AST _t) throws RecognitionException { + + TNode attributeDecl_AST_in = (TNode)_t; + TNode a = null; + TNode b = null; + TNode n = null; + TNode lp = null; + TNode rp = null; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL___attribute: + { + AST __t70 = _t; + a = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL___attribute); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( a ); + } + { + _loop72: + do { + if (_t==null) _t=ASTNULL; + if (((_t.getType() >= LITERAL_typedef && _t.getType() <= LITERAL___imag))) { + b = (TNode)_t; + if ( _t==null ) throw new MismatchedTokenException(); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( b ); + } + } + else { + break _loop72; + } + + } while (true); + } + _t = __t70; + _t = _t.getNextSibling(); + break; + } + case NAsmAttribute: + { + AST __t73 = _t; + n = _t==ASTNULL ? null :(TNode)_t; + match(_t,NAsmAttribute); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( n ); + } + lp = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lp ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ")" ); + } + rp = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rp ); + } + _t = __t73; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void unionSpecifier(AST _t) throws RecognitionException { + + TNode unionSpecifier_AST_in = (TNode)_t; + TNode a = null; + + try { // for error handling + AST __t37 = _t; + a = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_union); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( a ); + } + structOrUnionBody(_t); + _t = _retTree; + _t = __t37; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void enumSpecifier(AST _t) throws RecognitionException { + + TNode enumSpecifier_AST_in = (TNode)_t; + TNode a = null; + TNode i = null; + TNode lc = null; + TNode rc = null; + + try { // for error handling + AST __t61 = _t; + a = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_enum); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( a ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + { + i = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( i ); + } + break; + } + case 3: + case LCURLY: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LCURLY: + { + lc = (TNode)_t; + match(_t,LCURLY); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lc ); tabs++; + } + enumList(_t); + _t = _retTree; + rc = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + tabs--; print( rc ); + } + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t61; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void typedefName(AST _t) throws RecognitionException { + + TNode typedefName_AST_in = (TNode)_t; + TNode i = null; + + try { // for error handling + AST __t33 = _t; + TNode tmp4_AST_in = (TNode)_t; + match(_t,NTypedefName); + _t = _t.getFirstChild(); + i = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( i ); + } + _t = __t33; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void typeName(AST _t) throws RecognitionException { + + TNode typeName_AST_in = (TNode)_t; + + try { // for error handling + specifierQualifierList(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NNonemptyAbstractDeclarator: + { + nonemptyAbstractDeclarator(_t); + _t = _retTree; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structOrUnionBody(AST _t) throws RecognitionException { + + TNode structOrUnionBody_AST_in = (TNode)_t; + TNode i1 = null; + TNode lc1 = null; + TNode rc1 = null; + TNode lc2 = null; + TNode rc2 = null; + TNode i2 = null; + + try { // for error handling + { + boolean synPredMatched41 = false; + if (((_t.getType()==ID))) { + AST __t41 = _t; + synPredMatched41 = true; + inputState.guessing++; + try { + { + TNode tmp5_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + TNode tmp6_AST_in = (TNode)_t; + match(_t,LCURLY); + _t = _t.getNextSibling(); + } + } + catch (RecognitionException pe) { + synPredMatched41 = false; + } + _t = __t41; + inputState.guessing--; + } + if ( synPredMatched41 ) { + i1 = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + lc1 = (TNode)_t; + match(_t,LCURLY); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( i1 ); print ( "{" ); tabs++; + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + structDeclarationList(_t); + _t = _retTree; + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rc1 = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + tabs--; print( rc1 ); + } + } + else if ((_t.getType()==LCURLY)) { + lc2 = (TNode)_t; + match(_t,LCURLY); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lc2 ); tabs++; + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + structDeclarationList(_t); + _t = _retTree; + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rc2 = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + tabs--; print( rc2 ); + } + } + else if ((_t.getType()==ID)) { + i2 = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( i2 ); + } + } + else { + throw new NoViableAltException(_t); + } + + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structDeclarationList(AST _t) throws RecognitionException { + + TNode structDeclarationList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt46=0; + _loop46: + do { + if (_t==null) _t=ASTNULL; + if ((_tokenSet_1.member(_t.getType()))) { + structDeclaration(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ";" ); + } + } + else { + if ( _cnt46>=1 ) { break _loop46; } else {throw new NoViableAltException(_t);} + } + + _cnt46++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structDeclaration(AST _t) throws RecognitionException { + + TNode structDeclaration_AST_in = (TNode)_t; + + try { // for error handling + specifierQualifierList(_t); + _t = _retTree; + structDeclaratorList(_t); + _t = _retTree; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void specifierQualifierList(AST _t) throws RecognitionException { + + TNode specifierQualifierList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt50=0; + _loop50: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + typeSpecifier(_t); + _t = _retTree; + break; + } + case LITERAL_volatile: + case LITERAL_const: + { + typeQualifier(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt50>=1 ) { break _loop50; } else {throw new NoViableAltException(_t);} + } + } + _cnt50++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structDeclaratorList(AST _t) throws RecognitionException { + + TNode structDeclaratorList_AST_in = (TNode)_t; + + try { // for error handling + structDeclarator(_t); + _t = _retTree; + { + _loop53: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NStructDeclarator)) { + if ( inputState.guessing==0 ) { + print(","); + } + structDeclarator(_t); + _t = _retTree; + } + else { + break _loop53; + } + + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structDeclarator(AST _t) throws RecognitionException { + + TNode structDeclarator_AST_in = (TNode)_t; + TNode c = null; + + try { // for error handling + AST __t55 = _t; + TNode tmp7_AST_in = (TNode)_t; + match(_t,NStructDeclarator); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NDeclarator: + { + declarator(_t); + _t = _retTree; + break; + } + case 3: + case COLON: + case NAsmAttribute: + case LITERAL___attribute: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case COLON: + { + c = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c ); + } + expr(_t); + _t = _retTree; + break; + } + case 3: + case NAsmAttribute: + case LITERAL___attribute: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + _loop59: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { + attributeDecl(_t); + _t = _retTree; + } + else { + break _loop59; + } + + } while (true); + } + _t = __t55; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void declarator(AST _t) throws RecognitionException { + + TNode declarator_AST_in = (TNode)_t; + TNode id = null; + TNode lp = null; + TNode rp = null; + TNode n = null; + TNode r = null; + TNode lb = null; + TNode rb = null; + + try { // for error handling + AST __t105 = _t; + TNode tmp8_AST_in = (TNode)_t; + match(_t,NDeclarator); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NPointerGroup: + { + pointerGroup(_t); + _t = _retTree; + break; + } + case ID: + case LPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + { + id = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( id ); + } + break; + } + case LPAREN: + { + lp = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lp ); + } + declarator(_t); + _t = _retTree; + rp = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rp ); + } + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + _loop113: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NParameterTypeList: + { + AST __t109 = _t; + n = _t==ASTNULL ? null :(TNode)_t; + match(_t,NParameterTypeList); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( n ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NParameterDeclaration: + { + parameterTypeList(_t); + _t = _retTree; + break; + } + case ID: + case RPAREN: + { + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + { + idList(_t); + _t = _retTree; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + r = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( r ); + } + _t = __t109; + _t = _t.getNextSibling(); + break; + } + case LBRACKET: + { + lb = (TNode)_t; + match(_t,LBRACKET); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lb ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rb = (TNode)_t; + match(_t,RBRACKET); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rb ); + } + break; + } + default: + { + break _loop113; + } + } + } while (true); + } + _t = __t105; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void enumList(AST _t) throws RecognitionException { + + TNode enumList_AST_in = (TNode)_t; + + try { // for error handling + enumerator(_t); + _t = _retTree; + { + _loop66: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==ID)) { + if ( inputState.guessing==0 ) { + print(","); + } + enumerator(_t); + _t = _retTree; + } + else { + break _loop66; + } + + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void enumerator(AST _t) throws RecognitionException { + + TNode enumerator_AST_in = (TNode)_t; + TNode i = null; + TNode b = null; + + try { // for error handling + i = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( i ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + { + b = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( b ); + } + expr(_t); + _t = _retTree; + break; + } + case RCURLY: + case ID: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void initDecl(AST _t) throws RecognitionException { + + TNode initDecl_AST_in = (TNode)_t; + TNode a = null; + TNode b = null; + String declName = ""; + + try { // for error handling + AST __t78 = _t; + TNode tmp9_AST_in = (TNode)_t; + match(_t,NInitDecl); + _t = _t.getFirstChild(); + declarator(_t); + _t = _retTree; + { + _loop80: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { + attributeDecl(_t); + _t = _retTree; + } + else { + break _loop80; + } + + } while (true); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + { + a = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( a ); + } + initializer(_t); + _t = _retTree; + break; + } + case COLON: + { + b = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( b ); + } + expr(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t78; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void initializer(AST _t) throws RecognitionException { + + TNode initializer_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NInitializer: + { + AST __t92 = _t; + TNode tmp10_AST_in = (TNode)_t; + match(_t,NInitializer); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NInitializerElementLabel: + { + initializerElementLabel(_t); + _t = _retTree; + break; + } + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + expr(_t); + _t = _retTree; + _t = __t92; + _t = _t.getNextSibling(); + break; + } + case NLcurlyInitializer: + { + lcurlyInitializer(_t); + _t = _retTree; + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void pointerGroup(AST _t) throws RecognitionException { + + TNode pointerGroup_AST_in = (TNode)_t; + TNode a = null; + + try { // for error handling + AST __t83 = _t; + TNode tmp11_AST_in = (TNode)_t; + match(_t,NPointerGroup); + _t = _t.getFirstChild(); + { + int _cnt87=0; + _loop87: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==STAR)) { + a = (TNode)_t; + match(_t,STAR); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( a ); + } + { + _loop86: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==LITERAL_volatile||_t.getType()==LITERAL_const)) { + typeQualifier(_t); + _t = _retTree; + } + else { + break _loop86; + } + + } while (true); + } + } + else { + if ( _cnt87>=1 ) { break _loop87; } else {throw new NoViableAltException(_t);} + } + + _cnt87++; + } while (true); + } + _t = __t83; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void idList(AST _t) throws RecognitionException { + + TNode idList_AST_in = (TNode)_t; + TNode i = null; + TNode c = null; + TNode id = null; + + try { // for error handling + i = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( i ); + } + { + _loop90: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COMMA)) { + c = (TNode)_t; + match(_t,COMMA); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c ); + } + id = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( id ); + } + } + else { + break _loop90; + } + + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void initializerElementLabel(AST _t) throws RecognitionException { + + TNode initializerElementLabel_AST_in = (TNode)_t; + TNode l = null; + TNode r = null; + TNode a1 = null; + TNode i1 = null; + TNode c = null; + TNode d = null; + TNode i2 = null; + TNode a2 = null; + + try { // for error handling + AST __t95 = _t; + TNode tmp12_AST_in = (TNode)_t; + match(_t,NInitializerElementLabel); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LBRACKET: + { + { + l = (TNode)_t; + match(_t,LBRACKET); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( l ); + } + expr(_t); + _t = _retTree; + r = (TNode)_t; + match(_t,RBRACKET); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( r ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + { + a1 = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( a1 ); + } + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + break; + } + case ID: + { + i1 = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + c = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( i1 ); print( c ); + } + break; + } + case DOT: + { + d = (TNode)_t; + match(_t,DOT); + _t = _t.getNextSibling(); + i2 = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + a2 = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( d ); print( i2 ); print( a2 ); + } + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t95; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void lcurlyInitializer(AST _t) throws RecognitionException { + + TNode lcurlyInitializer_AST_in = (TNode)_t; + TNode n = null; + TNode rc = null; + + try { // for error handling + AST __t100 = _t; + n = _t==ASTNULL ? null :(TNode)_t; + match(_t,NLcurlyInitializer); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( n ); tabs++; + } + initializerList(_t); + _t = _retTree; + rc = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + tabs--; print( rc ); + } + _t = __t100; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void initializerList(AST _t) throws RecognitionException { + + TNode initializerList_AST_in = (TNode)_t; + TNode i = null; + + try { // for error handling + { + _loop103: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NInitializer||_t.getType()==NLcurlyInitializer)) { + i = _t==ASTNULL ? null : (TNode)_t; + initializer(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + commaSep( i ); + } + } + else { + break _loop103; + } + + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void parameterTypeList(AST _t) throws RecognitionException { + + TNode parameterTypeList_AST_in = (TNode)_t; + TNode c = null; + TNode s = null; + TNode v = null; + + try { // for error handling + { + int _cnt117=0; + _loop117: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NParameterDeclaration)) { + parameterDeclaration(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case COMMA: + { + c = (TNode)_t; + match(_t,COMMA); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c ); + } + break; + } + case SEMI: + { + s = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( s ); + } + break; + } + case RPAREN: + case VARARGS: + case NParameterDeclaration: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + else { + if ( _cnt117>=1 ) { break _loop117; } else {throw new NoViableAltException(_t);} + } + + _cnt117++; + } while (true); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case VARARGS: + { + v = (TNode)_t; + match(_t,VARARGS); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( v ); + } + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void parameterDeclaration(AST _t) throws RecognitionException { + + TNode parameterDeclaration_AST_in = (TNode)_t; + + try { // for error handling + AST __t120 = _t; + TNode tmp13_AST_in = (TNode)_t; + match(_t,NParameterDeclaration); + _t = _t.getFirstChild(); + declSpecifiers(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NDeclarator: + { + declarator(_t); + _t = _retTree; + break; + } + case NNonemptyAbstractDeclarator: + { + nonemptyAbstractDeclarator(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t120; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void nonemptyAbstractDeclarator(AST _t) throws RecognitionException { + + TNode nonemptyAbstractDeclarator_AST_in = (TNode)_t; + TNode lp1 = null; + TNode rp1 = null; + TNode lb1 = null; + TNode rb1 = null; + TNode lp2 = null; + TNode rp2 = null; + TNode lb2 = null; + TNode rb2 = null; + + try { // for error handling + AST __t195 = _t; + TNode tmp14_AST_in = (TNode)_t; + match(_t,NNonemptyAbstractDeclarator); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NPointerGroup: + { + pointerGroup(_t); + _t = _retTree; + { + _loop202: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LPAREN: + { + { + lp1 = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lp1 ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NNonemptyAbstractDeclarator: + { + nonemptyAbstractDeclarator(_t); + _t = _retTree; + break; + } + case NParameterDeclaration: + { + parameterTypeList(_t); + _t = _retTree; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rp1 = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rp1 ); + } + } + break; + } + case LBRACKET: + { + { + lb1 = (TNode)_t; + match(_t,LBRACKET); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lb1 ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rb1 = (TNode)_t; + match(_t,RBRACKET); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rb1 ); + } + } + break; + } + default: + { + break _loop202; + } + } + } while (true); + } + break; + } + case LPAREN: + case LBRACKET: + { + { + int _cnt208=0; + _loop208: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LPAREN: + { + { + lp2 = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lp2 ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NNonemptyAbstractDeclarator: + { + nonemptyAbstractDeclarator(_t); + _t = _retTree; + break; + } + case NParameterDeclaration: + { + parameterTypeList(_t); + _t = _retTree; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rp2 = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rp2 ); + } + } + break; + } + case LBRACKET: + { + { + lb2 = (TNode)_t; + match(_t,LBRACKET); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lb2 ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rb2 = (TNode)_t; + match(_t,RBRACKET); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rb2 ); + } + } + break; + } + default: + { + if ( _cnt208>=1 ) { break _loop208; } else {throw new NoViableAltException(_t);} + } + } + _cnt208++; + } while (true); + } + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t195; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void functionDeclSpecifiers(AST _t) throws RecognitionException { + + TNode functionDeclSpecifiers_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt129=0; + _loop129: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_extern: + case LITERAL_static: + case LITERAL_inline: + { + functionStorageClassSpecifier(_t); + _t = _retTree; + break; + } + case LITERAL_volatile: + case LITERAL_const: + { + typeQualifier(_t); + _t = _retTree; + break; + } + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + typeSpecifier(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt129>=1 ) { break _loop129; } else {throw new NoViableAltException(_t);} + } + } + _cnt129++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void compoundStatement(AST _t) throws RecognitionException { + + TNode compoundStatement_AST_in = (TNode)_t; + TNode cs = null; + TNode rc = null; + + try { // for error handling + AST __t138 = _t; + cs = _t==ASTNULL ? null :(TNode)_t; + match(_t,NCompoundStatement); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( cs ); tabs++; + } + { + _loop140: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NDeclaration: + case LITERAL___label__: + { + declarationList(_t); + _t = _retTree; + break; + } + case NFunctionDef: + { + functionDef(_t); + _t = _retTree; + break; + } + default: + { + break _loop140; + } + } + } while (true); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case SEMI: + case LITERAL_while: + case LITERAL_do: + case LITERAL_for: + case LITERAL_goto: + case LITERAL_continue: + case LITERAL_break: + case LITERAL_return: + case LITERAL_case: + case LITERAL_default: + case LITERAL_if: + case LITERAL_switch: + case NStatementExpr: + case NCompoundStatement: + case NLabel: + { + statementList(_t); + _t = _retTree; + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rc = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + tabs--; print( rc ); + } + _t = __t138; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void declarationList(AST _t) throws RecognitionException { + + TNode declarationList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt132=0; + _loop132: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==LITERAL___label__)) { + localLabelDecl(_t); + _t = _retTree; + } + else if ((_t.getType()==NDeclaration)) { + declaration(_t); + _t = _retTree; + } + else { + if ( _cnt132>=1 ) { break _loop132; } else {throw new NoViableAltException(_t);} + } + + _cnt132++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void localLabelDecl(AST _t) throws RecognitionException { + + TNode localLabelDecl_AST_in = (TNode)_t; + TNode a = null; + TNode i = null; + + try { // for error handling + AST __t134 = _t; + a = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL___label__); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( a ); + } + { + int _cnt136=0; + _loop136: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==ID)) { + i = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + commaSep( i ); + } + } + else { + if ( _cnt136>=1 ) { break _loop136; } else {throw new NoViableAltException(_t);} + } + + _cnt136++; + } while (true); + } + if ( inputState.guessing==0 ) { + print( ";" ); + } + _t = __t134; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void statementList(AST _t) throws RecognitionException { + + TNode statementList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt144=0; + _loop144: + do { + if (_t==null) _t=ASTNULL; + if ((_tokenSet_2.member(_t.getType()))) { + statement(_t); + _t = _retTree; + } + else { + if ( _cnt144>=1 ) { break _loop144; } else {throw new NoViableAltException(_t);} + } + + _cnt144++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void statement(AST _t) throws RecognitionException { + + TNode statement_AST_in = (TNode)_t; + + try { // for error handling + statementBody(_t); + _t = _retTree; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void statementBody(AST _t) throws RecognitionException { + + TNode statementBody_AST_in = (TNode)_t; + TNode s = null; + TNode w = null; + TNode d = null; + TNode f = null; + TNode g = null; + TNode c = null; + TNode b = null; + TNode r = null; + TNode ni = null; + TNode ca = null; + TNode de = null; + TNode i = null; + TNode e = null; + TNode sw = null; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case SEMI: + { + s = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( s ); + } + break; + } + case NCompoundStatement: + { + compoundStatement(_t); + _t = _retTree; + break; + } + case NStatementExpr: + { + AST __t147 = _t; + TNode tmp15_AST_in = (TNode)_t; + match(_t,NStatementExpr); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ";" ); + } + _t = __t147; + _t = _t.getNextSibling(); + break; + } + case LITERAL_while: + { + AST __t148 = _t; + w = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_while); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( w ); print( "(" ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ")" ); + } + statement(_t); + _t = _retTree; + _t = __t148; + _t = _t.getNextSibling(); + break; + } + case LITERAL_do: + { + AST __t149 = _t; + d = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_do); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( d ); + } + statement(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( " while ( " ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( " );" ); + } + _t = __t149; + _t = _t.getNextSibling(); + break; + } + case LITERAL_for: + { + AST __t150 = _t; + f = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_for); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( f ); print( "(" ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ";" ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ";" ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ")" ); + } + statement(_t); + _t = _retTree; + _t = __t150; + _t = _t.getNextSibling(); + break; + } + case LITERAL_goto: + { + AST __t151 = _t; + g = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_goto); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( g ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ";" ); + } + _t = __t151; + _t = _t.getNextSibling(); + break; + } + case LITERAL_continue: + { + c = (TNode)_t; + match(_t,LITERAL_continue); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c ); print( ";" ); + } + break; + } + case LITERAL_break: + { + b = (TNode)_t; + match(_t,LITERAL_break); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( b ); print( ";" ); + } + break; + } + case LITERAL_return: + { + AST __t152 = _t; + r = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_return); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( r ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + if ( inputState.guessing==0 ) { + print( ";" ); + } + _t = __t152; + _t = _t.getNextSibling(); + break; + } + case NLabel: + { + AST __t154 = _t; + TNode tmp16_AST_in = (TNode)_t; + match(_t,NLabel); + _t = _t.getFirstChild(); + ni = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( ni ); print( ":" ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case SEMI: + case LITERAL_while: + case LITERAL_do: + case LITERAL_for: + case LITERAL_goto: + case LITERAL_continue: + case LITERAL_break: + case LITERAL_return: + case LITERAL_case: + case LITERAL_default: + case LITERAL_if: + case LITERAL_switch: + case NStatementExpr: + case NCompoundStatement: + case NLabel: + { + statement(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t154; + _t = _t.getNextSibling(); + break; + } + case LITERAL_case: + { + AST __t156 = _t; + ca = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_case); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( ca ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ":" ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case SEMI: + case LITERAL_while: + case LITERAL_do: + case LITERAL_for: + case LITERAL_goto: + case LITERAL_continue: + case LITERAL_break: + case LITERAL_return: + case LITERAL_case: + case LITERAL_default: + case LITERAL_if: + case LITERAL_switch: + case NStatementExpr: + case NCompoundStatement: + case NLabel: + { + statement(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t156; + _t = _t.getNextSibling(); + break; + } + case LITERAL_default: + { + AST __t158 = _t; + de = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_default); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( de ); print( ":" ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case SEMI: + case LITERAL_while: + case LITERAL_do: + case LITERAL_for: + case LITERAL_goto: + case LITERAL_continue: + case LITERAL_break: + case LITERAL_return: + case LITERAL_case: + case LITERAL_default: + case LITERAL_if: + case LITERAL_switch: + case NStatementExpr: + case NCompoundStatement: + case NLabel: + { + statement(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t158; + _t = _t.getNextSibling(); + break; + } + case LITERAL_if: + { + AST __t160 = _t; + i = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_if); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( i ); print( "(" ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ")" ); + } + statement(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_else: + { + e = (TNode)_t; + match(_t,LITERAL_else); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( e ); + } + statement(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t160; + _t = _t.getNextSibling(); + break; + } + case LITERAL_switch: + { + AST __t162 = _t; + sw = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_switch); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( sw ); print( "(" ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ")" ); + } + statement(_t); + _t = _retTree; + _t = __t162; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void binaryExpr(AST _t) throws RecognitionException { + + TNode binaryExpr_AST_in = (TNode)_t; + TNode b = null; + + try { // for error handling + b = _t==ASTNULL ? null : (TNode)_t; + binaryOperator(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + TNode e1, e2; + e1 = (TNode) b.getFirstChild(); + e2 = (TNode) e1.getNextSibling(); + expr( e1 ); + print( b ); + expr( e2 ); + + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void conditionalExpr(AST _t) throws RecognitionException { + + TNode conditionalExpr_AST_in = (TNode)_t; + TNode q = null; + TNode c = null; + + try { // for error handling + AST __t188 = _t; + q = _t==ASTNULL ? null :(TNode)_t; + match(_t,QUESTION); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( q ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + case COLON: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + c = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c ); + } + expr(_t); + _t = _retTree; + _t = __t188; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void castExpr(AST _t) throws RecognitionException { + + TNode castExpr_AST_in = (TNode)_t; + TNode c = null; + TNode rp = null; + + try { // for error handling + AST __t191 = _t; + c = _t==ASTNULL ? null :(TNode)_t; + match(_t,NCast); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( c ); + } + typeName(_t); + _t = _retTree; + rp = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rp ); + } + expr(_t); + _t = _retTree; + _t = __t191; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void unaryExpr(AST _t) throws RecognitionException { + + TNode unaryExpr_AST_in = (TNode)_t; + TNode i = null; + TNode d = null; + TNode u = null; + TNode s = null; + TNode lps = null; + TNode rps = null; + TNode a = null; + TNode lpa = null; + TNode rpa = null; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case INC: + { + AST __t210 = _t; + i = _t==ASTNULL ? null :(TNode)_t; + match(_t,INC); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( i ); + } + expr(_t); + _t = _retTree; + _t = __t210; + _t = _t.getNextSibling(); + break; + } + case DEC: + { + AST __t211 = _t; + d = _t==ASTNULL ? null :(TNode)_t; + match(_t,DEC); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( d ); + } + expr(_t); + _t = _retTree; + _t = __t211; + _t = _t.getNextSibling(); + break; + } + case NUnaryExpr: + { + AST __t212 = _t; + TNode tmp17_AST_in = (TNode)_t; + match(_t,NUnaryExpr); + _t = _t.getFirstChild(); + u = _t==ASTNULL ? null : (TNode)_t; + unaryOperator(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( u ); + } + expr(_t); + _t = _retTree; + _t = __t212; + _t = _t.getNextSibling(); + break; + } + case LITERAL_sizeof: + { + AST __t213 = _t; + s = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL_sizeof); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( s ); + } + { + boolean synPredMatched216 = false; + if (((_t.getType()==LPAREN))) { + AST __t216 = _t; + synPredMatched216 = true; + inputState.guessing++; + try { + { + TNode tmp18_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + typeName(_t); + _t = _retTree; + } + } + catch (RecognitionException pe) { + synPredMatched216 = false; + } + _t = __t216; + inputState.guessing--; + } + if ( synPredMatched216 ) { + lps = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lps ); + } + typeName(_t); + _t = _retTree; + rps = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rps ); + } + } + else if ((_tokenSet_3.member(_t.getType()))) { + expr(_t); + _t = _retTree; + } + else { + throw new NoViableAltException(_t); + } + + } + _t = __t213; + _t = _t.getNextSibling(); + break; + } + case LITERAL___alignof: + { + AST __t217 = _t; + a = _t==ASTNULL ? null :(TNode)_t; + match(_t,LITERAL___alignof); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( a ); + } + { + boolean synPredMatched220 = false; + if (((_t.getType()==LPAREN))) { + AST __t220 = _t; + synPredMatched220 = true; + inputState.guessing++; + try { + { + TNode tmp19_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + typeName(_t); + _t = _retTree; + } + } + catch (RecognitionException pe) { + synPredMatched220 = false; + } + _t = __t220; + inputState.guessing--; + } + if ( synPredMatched220 ) { + lpa = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lpa ); + } + typeName(_t); + _t = _retTree; + rpa = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rpa ); + } + } + else if ((_tokenSet_3.member(_t.getType()))) { + expr(_t); + _t = _retTree; + } + else { + throw new NoViableAltException(_t); + } + + } + _t = __t217; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void postfixExpr(AST _t) throws RecognitionException { + + TNode postfixExpr_AST_in = (TNode)_t; + TNode a = null; + TNode b = null; + TNode c = null; + TNode d = null; + TNode n = null; + TNode rp = null; + TNode lb = null; + TNode rb = null; + TNode f = null; + TNode g = null; + + try { // for error handling + AST __t223 = _t; + TNode tmp20_AST_in = (TNode)_t; + match(_t,NPostfixExpr); + _t = _t.getFirstChild(); + primaryExpr(_t); + _t = _retTree; + { + int _cnt227=0; + _loop227: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case PTR: + { + a = (TNode)_t; + match(_t,PTR); + _t = _t.getNextSibling(); + b = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( a ); print( b ); + } + break; + } + case DOT: + { + c = (TNode)_t; + match(_t,DOT); + _t = _t.getNextSibling(); + d = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c ); print( d ); + } + break; + } + case NFunctionCallArgs: + { + AST __t225 = _t; + n = _t==ASTNULL ? null :(TNode)_t; + match(_t,NFunctionCallArgs); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( n ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + argExprList(_t); + _t = _retTree; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rp = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rp ); + } + _t = __t225; + _t = _t.getNextSibling(); + break; + } + case LBRACKET: + { + lb = (TNode)_t; + match(_t,LBRACKET); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lb ); + } + expr(_t); + _t = _retTree; + rb = (TNode)_t; + match(_t,RBRACKET); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rb ); + } + break; + } + case INC: + { + f = (TNode)_t; + match(_t,INC); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( f ); + } + break; + } + case DEC: + { + g = (TNode)_t; + match(_t,DEC); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( g ); + } + break; + } + default: + { + if ( _cnt227>=1 ) { break _loop227; } else {throw new NoViableAltException(_t);} + } + } + _cnt227++; + } while (true); + } + _t = __t223; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void primaryExpr(AST _t) throws RecognitionException { + + TNode primaryExpr_AST_in = (TNode)_t; + TNode i = null; + TNode n = null; + TNode eg = null; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + { + i = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( i ); + } + break; + } + case Number: + { + n = (TNode)_t; + match(_t,Number); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( n ); + } + break; + } + case CharLiteral: + { + charConst(_t); + _t = _retTree; + break; + } + case NStringSeq: + { + stringConst(_t); + _t = _retTree; + break; + } + case NExpressionGroup: + { + AST __t229 = _t; + eg = _t==ASTNULL ? null :(TNode)_t; + match(_t,NExpressionGroup); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( eg ); + } + expr(_t); + _t = _retTree; + if ( inputState.guessing==0 ) { + print( ")" ); + } + _t = __t229; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void emptyExpr(AST _t) throws RecognitionException { + + TNode emptyExpr_AST_in = (TNode)_t; + + try { // for error handling + TNode tmp21_AST_in = (TNode)_t; + match(_t,NEmptyExpression); + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void compoundStatementExpr(AST _t) throws RecognitionException { + + TNode compoundStatementExpr_AST_in = (TNode)_t; + TNode l = null; + TNode r = null; + + try { // for error handling + AST __t166 = _t; + l = _t==ASTNULL ? null :(TNode)_t; + match(_t,LPAREN); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( l ); + } + compoundStatement(_t); + _t = _retTree; + r = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( r ); + } + _t = __t166; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void rangeExpr(AST _t) throws RecognitionException { + + TNode rangeExpr_AST_in = (TNode)_t; + TNode v = null; + + try { // for error handling + AST __t168 = _t; + TNode tmp22_AST_in = (TNode)_t; + match(_t,NRangeExpr); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + v = (TNode)_t; + match(_t,VARARGS); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( v ); + } + expr(_t); + _t = _retTree; + _t = __t168; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void gnuAsmExpr(AST _t) throws RecognitionException { + + TNode gnuAsmExpr_AST_in = (TNode)_t; + TNode n = null; + TNode v = null; + TNode lp = null; + TNode c1 = null; + TNode c2 = null; + TNode c3 = null; + TNode c4 = null; + TNode c5 = null; + TNode c6 = null; + TNode rp = null; + + try { // for error handling + AST __t170 = _t; + n = _t==ASTNULL ? null :(TNode)_t; + match(_t,NGnuAsmExpr); + _t = _t.getFirstChild(); + if ( inputState.guessing==0 ) { + print( n ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + { + v = (TNode)_t; + match(_t,LITERAL_volatile); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( v ); + } + break; + } + case LPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + lp = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( lp ); + } + stringConst(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COLON)) { + c1 = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c1 ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NStringSeq: + { + strOptExprPair(_t); + _t = _retTree; + { + _loop175: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COMMA)) { + c2 = (TNode)_t; + match(_t,COMMA); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c2 ); + } + strOptExprPair(_t); + _t = _retTree; + } + else { + break _loop175; + } + + } while (true); + } + break; + } + case COLON: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COLON)) { + c3 = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c3 ); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NStringSeq: + { + strOptExprPair(_t); + _t = _retTree; + { + _loop179: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COMMA)) { + c4 = (TNode)_t; + match(_t,COMMA); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c4 ); + } + strOptExprPair(_t); + _t = _retTree; + } + else { + break _loop179; + } + + } while (true); + } + break; + } + case COLON: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + else if ((_t.getType()==COLON||_t.getType()==RPAREN)) { + } + else { + throw new NoViableAltException(_t); + } + + } + } + else if ((_t.getType()==COLON||_t.getType()==RPAREN)) { + } + else { + throw new NoViableAltException(_t); + } + + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case COLON: + { + c5 = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c5 ); + } + stringConst(_t); + _t = _retTree; + { + _loop182: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COMMA)) { + c6 = (TNode)_t; + match(_t,COMMA); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c6 ); + } + stringConst(_t); + _t = _retTree; + } + else { + break _loop182; + } + + } while (true); + } + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + rp = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( rp ); + } + _t = __t170; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + protected final void stringConst(AST _t) throws RecognitionException { + + TNode stringConst_AST_in = (TNode)_t; + TNode s = null; + + try { // for error handling + AST __t235 = _t; + TNode tmp23_AST_in = (TNode)_t; + match(_t,NStringSeq); + _t = _t.getFirstChild(); + { + int _cnt237=0; + _loop237: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==StringLiteral)) { + s = (TNode)_t; + match(_t,StringLiteral); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( s ); + } + } + else { + if ( _cnt237>=1 ) { break _loop237; } else {throw new NoViableAltException(_t);} + } + + _cnt237++; + } while (true); + } + _t = __t235; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void strOptExprPair(AST _t) throws RecognitionException { + + TNode strOptExprPair_AST_in = (TNode)_t; + TNode l = null; + TNode r = null; + + try { // for error handling + stringConst(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LPAREN: + { + l = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( l ); + } + expr(_t); + _t = _retTree; + r = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( r ); + } + break; + } + case COMMA: + case COLON: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void binaryOperator(AST _t) throws RecognitionException { + + TNode binaryOperator_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + { + TNode tmp24_AST_in = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getNextSibling(); + break; + } + case DIV_ASSIGN: + { + TNode tmp25_AST_in = (TNode)_t; + match(_t,DIV_ASSIGN); + _t = _t.getNextSibling(); + break; + } + case PLUS_ASSIGN: + { + TNode tmp26_AST_in = (TNode)_t; + match(_t,PLUS_ASSIGN); + _t = _t.getNextSibling(); + break; + } + case MINUS_ASSIGN: + { + TNode tmp27_AST_in = (TNode)_t; + match(_t,MINUS_ASSIGN); + _t = _t.getNextSibling(); + break; + } + case STAR_ASSIGN: + { + TNode tmp28_AST_in = (TNode)_t; + match(_t,STAR_ASSIGN); + _t = _t.getNextSibling(); + break; + } + case MOD_ASSIGN: + { + TNode tmp29_AST_in = (TNode)_t; + match(_t,MOD_ASSIGN); + _t = _t.getNextSibling(); + break; + } + case RSHIFT_ASSIGN: + { + TNode tmp30_AST_in = (TNode)_t; + match(_t,RSHIFT_ASSIGN); + _t = _t.getNextSibling(); + break; + } + case LSHIFT_ASSIGN: + { + TNode tmp31_AST_in = (TNode)_t; + match(_t,LSHIFT_ASSIGN); + _t = _t.getNextSibling(); + break; + } + case BAND_ASSIGN: + { + TNode tmp32_AST_in = (TNode)_t; + match(_t,BAND_ASSIGN); + _t = _t.getNextSibling(); + break; + } + case BOR_ASSIGN: + { + TNode tmp33_AST_in = (TNode)_t; + match(_t,BOR_ASSIGN); + _t = _t.getNextSibling(); + break; + } + case BXOR_ASSIGN: + { + TNode tmp34_AST_in = (TNode)_t; + match(_t,BXOR_ASSIGN); + _t = _t.getNextSibling(); + break; + } + case LOR: + { + TNode tmp35_AST_in = (TNode)_t; + match(_t,LOR); + _t = _t.getNextSibling(); + break; + } + case LAND: + { + TNode tmp36_AST_in = (TNode)_t; + match(_t,LAND); + _t = _t.getNextSibling(); + break; + } + case BOR: + { + TNode tmp37_AST_in = (TNode)_t; + match(_t,BOR); + _t = _t.getNextSibling(); + break; + } + case BXOR: + { + TNode tmp38_AST_in = (TNode)_t; + match(_t,BXOR); + _t = _t.getNextSibling(); + break; + } + case BAND: + { + TNode tmp39_AST_in = (TNode)_t; + match(_t,BAND); + _t = _t.getNextSibling(); + break; + } + case EQUAL: + { + TNode tmp40_AST_in = (TNode)_t; + match(_t,EQUAL); + _t = _t.getNextSibling(); + break; + } + case NOT_EQUAL: + { + TNode tmp41_AST_in = (TNode)_t; + match(_t,NOT_EQUAL); + _t = _t.getNextSibling(); + break; + } + case LT: + { + TNode tmp42_AST_in = (TNode)_t; + match(_t,LT); + _t = _t.getNextSibling(); + break; + } + case LTE: + { + TNode tmp43_AST_in = (TNode)_t; + match(_t,LTE); + _t = _t.getNextSibling(); + break; + } + case GT: + { + TNode tmp44_AST_in = (TNode)_t; + match(_t,GT); + _t = _t.getNextSibling(); + break; + } + case GTE: + { + TNode tmp45_AST_in = (TNode)_t; + match(_t,GTE); + _t = _t.getNextSibling(); + break; + } + case LSHIFT: + { + TNode tmp46_AST_in = (TNode)_t; + match(_t,LSHIFT); + _t = _t.getNextSibling(); + break; + } + case RSHIFT: + { + TNode tmp47_AST_in = (TNode)_t; + match(_t,RSHIFT); + _t = _t.getNextSibling(); + break; + } + case PLUS: + { + TNode tmp48_AST_in = (TNode)_t; + match(_t,PLUS); + _t = _t.getNextSibling(); + break; + } + case MINUS: + { + TNode tmp49_AST_in = (TNode)_t; + match(_t,MINUS); + _t = _t.getNextSibling(); + break; + } + case STAR: + { + TNode tmp50_AST_in = (TNode)_t; + match(_t,STAR); + _t = _t.getNextSibling(); + break; + } + case DIV: + { + TNode tmp51_AST_in = (TNode)_t; + match(_t,DIV); + _t = _t.getNextSibling(); + break; + } + case MOD: + { + TNode tmp52_AST_in = (TNode)_t; + match(_t,MOD); + _t = _t.getNextSibling(); + break; + } + case NCommaExpr: + { + TNode tmp53_AST_in = (TNode)_t; + match(_t,NCommaExpr); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void unaryOperator(AST _t) throws RecognitionException { + + TNode unaryOperator_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case BAND: + { + TNode tmp54_AST_in = (TNode)_t; + match(_t,BAND); + _t = _t.getNextSibling(); + break; + } + case STAR: + { + TNode tmp55_AST_in = (TNode)_t; + match(_t,STAR); + _t = _t.getNextSibling(); + break; + } + case PLUS: + { + TNode tmp56_AST_in = (TNode)_t; + match(_t,PLUS); + _t = _t.getNextSibling(); + break; + } + case MINUS: + { + TNode tmp57_AST_in = (TNode)_t; + match(_t,MINUS); + _t = _t.getNextSibling(); + break; + } + case BNOT: + { + TNode tmp58_AST_in = (TNode)_t; + match(_t,BNOT); + _t = _t.getNextSibling(); + break; + } + case LNOT: + { + TNode tmp59_AST_in = (TNode)_t; + match(_t,LNOT); + _t = _t.getNextSibling(); + break; + } + case LAND: + { + TNode tmp60_AST_in = (TNode)_t; + match(_t,LAND); + _t = _t.getNextSibling(); + break; + } + case LITERAL___real: + { + TNode tmp61_AST_in = (TNode)_t; + match(_t,LITERAL___real); + _t = _t.getNextSibling(); + break; + } + case LITERAL___imag: + { + TNode tmp62_AST_in = (TNode)_t; + match(_t,LITERAL___imag); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void argExprList(AST _t) throws RecognitionException { + + TNode argExprList_AST_in = (TNode)_t; + + try { // for error handling + expr(_t); + _t = _retTree; + { + _loop232: + do { + if (_t==null) _t=ASTNULL; + if ((_tokenSet_3.member(_t.getType()))) { + if ( inputState.guessing==0 ) { + print( "," ); + } + expr(_t); + _t = _retTree; + } + else { + break _loop232; + } + + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + protected final void charConst(AST _t) throws RecognitionException { + + TNode charConst_AST_in = (TNode)_t; + TNode c = null; + + try { // for error handling + c = (TNode)_t; + match(_t,CharLiteral); + _t = _t.getNextSibling(); + if ( inputState.guessing==0 ) { + print( c ); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + protected final void intConst(AST _t) throws RecognitionException { + + TNode intConst_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case IntOctalConst: + { + TNode tmp63_AST_in = (TNode)_t; + match(_t,IntOctalConst); + _t = _t.getNextSibling(); + break; + } + case LongOctalConst: + { + TNode tmp64_AST_in = (TNode)_t; + match(_t,LongOctalConst); + _t = _t.getNextSibling(); + break; + } + case UnsignedOctalConst: + { + TNode tmp65_AST_in = (TNode)_t; + match(_t,UnsignedOctalConst); + _t = _t.getNextSibling(); + break; + } + case IntIntConst: + { + TNode tmp66_AST_in = (TNode)_t; + match(_t,IntIntConst); + _t = _t.getNextSibling(); + break; + } + case LongIntConst: + { + TNode tmp67_AST_in = (TNode)_t; + match(_t,LongIntConst); + _t = _t.getNextSibling(); + break; + } + case UnsignedIntConst: + { + TNode tmp68_AST_in = (TNode)_t; + match(_t,UnsignedIntConst); + _t = _t.getNextSibling(); + break; + } + case IntHexConst: + { + TNode tmp69_AST_in = (TNode)_t; + match(_t,IntHexConst); + _t = _t.getNextSibling(); + break; + } + case LongHexConst: + { + TNode tmp70_AST_in = (TNode)_t; + match(_t,LongHexConst); + _t = _t.getNextSibling(); + break; + } + case UnsignedHexConst: + { + TNode tmp71_AST_in = (TNode)_t; + match(_t,UnsignedHexConst); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + protected final void floatConst(AST _t) throws RecognitionException { + + TNode floatConst_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case FloatDoubleConst: + { + TNode tmp72_AST_in = (TNode)_t; + match(_t,FloatDoubleConst); + _t = _t.getNextSibling(); + break; + } + case DoubleDoubleConst: + { + TNode tmp73_AST_in = (TNode)_t; + match(_t,DoubleDoubleConst); + _t = _t.getNextSibling(); + break; + } + case LongDoubleConst: + { + TNode tmp74_AST_in = (TNode)_t; + match(_t,LongDoubleConst); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void commaExpr(AST _t) throws RecognitionException { + + TNode commaExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t241 = _t; + TNode tmp75_AST_in = (TNode)_t; + match(_t,NCommaExpr); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t241; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void assignExpr(AST _t) throws RecognitionException { + + TNode assignExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + { + AST __t243 = _t; + TNode tmp76_AST_in = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t243; + _t = _t.getNextSibling(); + break; + } + case DIV_ASSIGN: + { + AST __t244 = _t; + TNode tmp77_AST_in = (TNode)_t; + match(_t,DIV_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t244; + _t = _t.getNextSibling(); + break; + } + case PLUS_ASSIGN: + { + AST __t245 = _t; + TNode tmp78_AST_in = (TNode)_t; + match(_t,PLUS_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t245; + _t = _t.getNextSibling(); + break; + } + case MINUS_ASSIGN: + { + AST __t246 = _t; + TNode tmp79_AST_in = (TNode)_t; + match(_t,MINUS_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t246; + _t = _t.getNextSibling(); + break; + } + case STAR_ASSIGN: + { + AST __t247 = _t; + TNode tmp80_AST_in = (TNode)_t; + match(_t,STAR_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t247; + _t = _t.getNextSibling(); + break; + } + case MOD_ASSIGN: + { + AST __t248 = _t; + TNode tmp81_AST_in = (TNode)_t; + match(_t,MOD_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t248; + _t = _t.getNextSibling(); + break; + } + case RSHIFT_ASSIGN: + { + AST __t249 = _t; + TNode tmp82_AST_in = (TNode)_t; + match(_t,RSHIFT_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t249; + _t = _t.getNextSibling(); + break; + } + case LSHIFT_ASSIGN: + { + AST __t250 = _t; + TNode tmp83_AST_in = (TNode)_t; + match(_t,LSHIFT_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t250; + _t = _t.getNextSibling(); + break; + } + case BAND_ASSIGN: + { + AST __t251 = _t; + TNode tmp84_AST_in = (TNode)_t; + match(_t,BAND_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t251; + _t = _t.getNextSibling(); + break; + } + case BOR_ASSIGN: + { + AST __t252 = _t; + TNode tmp85_AST_in = (TNode)_t; + match(_t,BOR_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t252; + _t = _t.getNextSibling(); + break; + } + case BXOR_ASSIGN: + { + AST __t253 = _t; + TNode tmp86_AST_in = (TNode)_t; + match(_t,BXOR_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t253; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void logicalOrExpr(AST _t) throws RecognitionException { + + TNode logicalOrExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t255 = _t; + TNode tmp87_AST_in = (TNode)_t; + match(_t,LOR); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t255; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void logicalAndExpr(AST _t) throws RecognitionException { + + TNode logicalAndExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t257 = _t; + TNode tmp88_AST_in = (TNode)_t; + match(_t,LAND); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t257; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void inclusiveOrExpr(AST _t) throws RecognitionException { + + TNode inclusiveOrExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t259 = _t; + TNode tmp89_AST_in = (TNode)_t; + match(_t,BOR); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t259; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void exclusiveOrExpr(AST _t) throws RecognitionException { + + TNode exclusiveOrExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t261 = _t; + TNode tmp90_AST_in = (TNode)_t; + match(_t,BXOR); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t261; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void bitAndExpr(AST _t) throws RecognitionException { + + TNode bitAndExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t263 = _t; + TNode tmp91_AST_in = (TNode)_t; + match(_t,BAND); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t263; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void equalityExpr(AST _t) throws RecognitionException { + + TNode equalityExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case EQUAL: + { + AST __t265 = _t; + TNode tmp92_AST_in = (TNode)_t; + match(_t,EQUAL); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t265; + _t = _t.getNextSibling(); + break; + } + case NOT_EQUAL: + { + AST __t266 = _t; + TNode tmp93_AST_in = (TNode)_t; + match(_t,NOT_EQUAL); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t266; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void relationalExpr(AST _t) throws RecognitionException { + + TNode relationalExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LT: + { + AST __t268 = _t; + TNode tmp94_AST_in = (TNode)_t; + match(_t,LT); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t268; + _t = _t.getNextSibling(); + break; + } + case LTE: + { + AST __t269 = _t; + TNode tmp95_AST_in = (TNode)_t; + match(_t,LTE); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t269; + _t = _t.getNextSibling(); + break; + } + case GT: + { + AST __t270 = _t; + TNode tmp96_AST_in = (TNode)_t; + match(_t,GT); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t270; + _t = _t.getNextSibling(); + break; + } + case GTE: + { + AST __t271 = _t; + TNode tmp97_AST_in = (TNode)_t; + match(_t,GTE); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t271; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void shiftExpr(AST _t) throws RecognitionException { + + TNode shiftExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LSHIFT: + { + AST __t273 = _t; + TNode tmp98_AST_in = (TNode)_t; + match(_t,LSHIFT); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t273; + _t = _t.getNextSibling(); + break; + } + case RSHIFT: + { + AST __t274 = _t; + TNode tmp99_AST_in = (TNode)_t; + match(_t,RSHIFT); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t274; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void additiveExpr(AST _t) throws RecognitionException { + + TNode additiveExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case PLUS: + { + AST __t276 = _t; + TNode tmp100_AST_in = (TNode)_t; + match(_t,PLUS); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t276; + _t = _t.getNextSibling(); + break; + } + case MINUS: + { + AST __t277 = _t; + TNode tmp101_AST_in = (TNode)_t; + match(_t,MINUS); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t277; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void multExpr(AST _t) throws RecognitionException { + + TNode multExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case STAR: + { + AST __t279 = _t; + TNode tmp102_AST_in = (TNode)_t; + match(_t,STAR); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t279; + _t = _t.getNextSibling(); + break; + } + case DIV: + { + AST __t280 = _t; + TNode tmp103_AST_in = (TNode)_t; + match(_t,DIV); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t280; + _t = _t.getNextSibling(); + break; + } + case MOD: + { + AST __t281 = _t; + TNode tmp104_AST_in = (TNode)_t; + match(_t,MOD); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t281; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + + public static final String[] _tokenNames = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "\"typedef\"", + "\"asm\"", + "\"volatile\"", + "LCURLY", + "RCURLY", + "SEMI", + "\"struct\"", + "\"union\"", + "\"enum\"", + "\"auto\"", + "\"register\"", + "\"extern\"", + "\"static\"", + "\"const\"", + "\"void\"", + "\"char\"", + "\"short\"", + "\"int\"", + "\"long\"", + "\"float\"", + "\"double\"", + "\"signed\"", + "\"unsigned\"", + "ID", + "COMMA", + "COLON", + "ASSIGN", + "STAR", + "LPAREN", + "RPAREN", + "LBRACKET", + "RBRACKET", + "VARARGS", + "\"while\"", + "\"do\"", + "\"for\"", + "\"goto\"", + "\"continue\"", + "\"break\"", + "\"return\"", + "\"case\"", + "\"default\"", + "\"if\"", + "\"else\"", + "\"switch\"", + "DIV_ASSIGN", + "PLUS_ASSIGN", + "MINUS_ASSIGN", + "STAR_ASSIGN", + "MOD_ASSIGN", + "RSHIFT_ASSIGN", + "LSHIFT_ASSIGN", + "BAND_ASSIGN", + "BOR_ASSIGN", + "BXOR_ASSIGN", + "QUESTION", + "LOR", + "LAND", + "BOR", + "BXOR", + "BAND", + "EQUAL", + "NOT_EQUAL", + "LT", + "LTE", + "GT", + "GTE", + "LSHIFT", + "RSHIFT", + "PLUS", + "MINUS", + "DIV", + "MOD", + "INC", + "DEC", + "\"sizeof\"", + "BNOT", + "LNOT", + "PTR", + "DOT", + "CharLiteral", + "StringLiteral", + "IntOctalConst", + "LongOctalConst", + "UnsignedOctalConst", + "IntIntConst", + "LongIntConst", + "UnsignedIntConst", + "IntHexConst", + "LongHexConst", + "UnsignedHexConst", + "FloatDoubleConst", + "DoubleDoubleConst", + "LongDoubleConst", + "NTypedefName", + "NInitDecl", + "NDeclarator", + "NStructDeclarator", + "NDeclaration", + "NCast", + "NPointerGroup", + "NExpressionGroup", + "NFunctionCallArgs", + "NNonemptyAbstractDeclarator", + "NInitializer", + "NStatementExpr", + "NEmptyExpression", + "NParameterTypeList", + "NFunctionDef", + "NCompoundStatement", + "NParameterDeclaration", + "NCommaExpr", + "NUnaryExpr", + "NLabel", + "NPostfixExpr", + "NRangeExpr", + "NStringSeq", + "NInitializerElementLabel", + "NLcurlyInitializer", + "NAsmAttribute", + "NGnuAsmExpr", + "NTypeMissing", + "Vocabulary", + "Whitespace", + "Comment", + "CPPComment", + "a line directive", + "Space", + "LineDirective", + "BadStringLiteral", + "Escape", + "Digit", + "LongSuffix", + "UnsignedSuffix", + "FloatSuffix", + "Exponent", + "Number", + "\"__label__\"", + "\"inline\"", + "\"byte\"", + "\"boolean\"", + "\"Servo\"", + "\"Wire\"", + "\"typeof\"", + "\"__complex\"", + "\"__attribute\"", + "\"__alignof\"", + "\"__real\"", + "\"__imag\"" + }; + + private static final long[] mk_tokenSet_0() { + long[] data = { 544L, 2306124759068311552L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); + private static final long[] mk_tokenSet_1() { + long[] data = { 134093888L, 17179869184L, 2064384L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); + private static final long[] mk_tokenSet_2() { + long[] data = { 422075026113024L, 9605333580251136L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); + private static final long[] mk_tokenSet_3() { + long[] data = { -562942303010816L, 1574098779476393983L, 4198400L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); + } + diff --git a/app/preproc/WEmitterTokenTypes.java b/app/preproc/WEmitterTokenTypes.java index 1d874750c..7ecef70d5 100644 --- a/app/preproc/WEmitterTokenTypes.java +++ b/app/preproc/WEmitterTokenTypes.java @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "expandedWEmitter.g" -> "WEmitter.java"$ +// $ANTLR 2.7.2: "expandedWEmitter.g" -> "WEmitter.java"$ package processing.app.preproc; import processing.app.*; @@ -7,157 +7,157 @@ import java.util.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -public interface WEmitterTokenTypes { - int EOF = 1; - int NULL_TREE_LOOKAHEAD = 3; - int LITERAL_typedef = 4; - int LITERAL_asm = 5; - int LITERAL_volatile = 6; - int LCURLY = 7; - int RCURLY = 8; - int SEMI = 9; - int LITERAL_struct = 10; - int LITERAL_union = 11; - int LITERAL_enum = 12; - int LITERAL_auto = 13; - int LITERAL_register = 14; - int LITERAL_extern = 15; - int LITERAL_static = 16; - int LITERAL_const = 17; - int LITERAL_void = 18; - int LITERAL_char = 19; - int LITERAL_short = 20; - int LITERAL_int = 21; - int LITERAL_long = 22; - int LITERAL_float = 23; - int LITERAL_double = 24; - int LITERAL_signed = 25; - int LITERAL_unsigned = 26; - int ID = 27; - int COMMA = 28; - int COLON = 29; - int ASSIGN = 30; - int STAR = 31; - int LPAREN = 32; - int RPAREN = 33; - int LBRACKET = 34; - int RBRACKET = 35; - int VARARGS = 36; - int LITERAL_while = 37; - int LITERAL_do = 38; - int LITERAL_for = 39; - int LITERAL_goto = 40; - int LITERAL_continue = 41; - int LITERAL_break = 42; - int LITERAL_return = 43; - int LITERAL_case = 44; - int LITERAL_default = 45; - int LITERAL_if = 46; - int LITERAL_else = 47; - int LITERAL_switch = 48; - int DIV_ASSIGN = 49; - int PLUS_ASSIGN = 50; - int MINUS_ASSIGN = 51; - int STAR_ASSIGN = 52; - int MOD_ASSIGN = 53; - int RSHIFT_ASSIGN = 54; - int LSHIFT_ASSIGN = 55; - int BAND_ASSIGN = 56; - int BOR_ASSIGN = 57; - int BXOR_ASSIGN = 58; - int QUESTION = 59; - int LOR = 60; - int LAND = 61; - int BOR = 62; - int BXOR = 63; - int BAND = 64; - int EQUAL = 65; - int NOT_EQUAL = 66; - int LT = 67; - int LTE = 68; - int GT = 69; - int GTE = 70; - int LSHIFT = 71; - int RSHIFT = 72; - int PLUS = 73; - int MINUS = 74; - int DIV = 75; - int MOD = 76; - int INC = 77; - int DEC = 78; - int LITERAL_sizeof = 79; - int BNOT = 80; - int LNOT = 81; - int PTR = 82; - int DOT = 83; - int CharLiteral = 84; - int StringLiteral = 85; - int IntOctalConst = 86; - int LongOctalConst = 87; - int UnsignedOctalConst = 88; - int IntIntConst = 89; - int LongIntConst = 90; - int UnsignedIntConst = 91; - int IntHexConst = 92; - int LongHexConst = 93; - int UnsignedHexConst = 94; - int FloatDoubleConst = 95; - int DoubleDoubleConst = 96; - int LongDoubleConst = 97; - int NTypedefName = 98; - int NInitDecl = 99; - int NDeclarator = 100; - int NStructDeclarator = 101; - int NDeclaration = 102; - int NCast = 103; - int NPointerGroup = 104; - int NExpressionGroup = 105; - int NFunctionCallArgs = 106; - int NNonemptyAbstractDeclarator = 107; - int NInitializer = 108; - int NStatementExpr = 109; - int NEmptyExpression = 110; - int NParameterTypeList = 111; - int NFunctionDef = 112; - int NCompoundStatement = 113; - int NParameterDeclaration = 114; - int NCommaExpr = 115; - int NUnaryExpr = 116; - int NLabel = 117; - int NPostfixExpr = 118; - int NRangeExpr = 119; - int NStringSeq = 120; - int NInitializerElementLabel = 121; - int NLcurlyInitializer = 122; - int NAsmAttribute = 123; - int NGnuAsmExpr = 124; - int NTypeMissing = 125; - int Vocabulary = 126; - int Whitespace = 127; - int Comment = 128; - int CPPComment = 129; - int PREPROC_DIRECTIVE = 130; - int Space = 131; - int LineDirective = 132; - int BadStringLiteral = 133; - int Escape = 134; - int Digit = 135; - int LongSuffix = 136; - int UnsignedSuffix = 137; - int FloatSuffix = 138; - int Exponent = 139; - int Number = 140; - int LITERAL___label__ = 141; - int LITERAL_inline = 142; - int LITERAL_byte = 143; - int LITERAL_boolean = 144; - int LITERAL_Servo = 145; - int LITERAL_Wire = 146; - int LITERAL_typeof = 147; - int LITERAL___complex = 148; - int LITERAL___attribute = 149; - int LITERAL___alignof = 150; - int LITERAL___real = 151; - int LITERAL___imag = 152; -} + +public interface WEmitterTokenTypes { + int EOF = 1; + int NULL_TREE_LOOKAHEAD = 3; + int LITERAL_typedef = 4; + int LITERAL_asm = 5; + int LITERAL_volatile = 6; + int LCURLY = 7; + int RCURLY = 8; + int SEMI = 9; + int LITERAL_struct = 10; + int LITERAL_union = 11; + int LITERAL_enum = 12; + int LITERAL_auto = 13; + int LITERAL_register = 14; + int LITERAL_extern = 15; + int LITERAL_static = 16; + int LITERAL_const = 17; + int LITERAL_void = 18; + int LITERAL_char = 19; + int LITERAL_short = 20; + int LITERAL_int = 21; + int LITERAL_long = 22; + int LITERAL_float = 23; + int LITERAL_double = 24; + int LITERAL_signed = 25; + int LITERAL_unsigned = 26; + int ID = 27; + int COMMA = 28; + int COLON = 29; + int ASSIGN = 30; + int STAR = 31; + int LPAREN = 32; + int RPAREN = 33; + int LBRACKET = 34; + int RBRACKET = 35; + int VARARGS = 36; + int LITERAL_while = 37; + int LITERAL_do = 38; + int LITERAL_for = 39; + int LITERAL_goto = 40; + int LITERAL_continue = 41; + int LITERAL_break = 42; + int LITERAL_return = 43; + int LITERAL_case = 44; + int LITERAL_default = 45; + int LITERAL_if = 46; + int LITERAL_else = 47; + int LITERAL_switch = 48; + int DIV_ASSIGN = 49; + int PLUS_ASSIGN = 50; + int MINUS_ASSIGN = 51; + int STAR_ASSIGN = 52; + int MOD_ASSIGN = 53; + int RSHIFT_ASSIGN = 54; + int LSHIFT_ASSIGN = 55; + int BAND_ASSIGN = 56; + int BOR_ASSIGN = 57; + int BXOR_ASSIGN = 58; + int QUESTION = 59; + int LOR = 60; + int LAND = 61; + int BOR = 62; + int BXOR = 63; + int BAND = 64; + int EQUAL = 65; + int NOT_EQUAL = 66; + int LT = 67; + int LTE = 68; + int GT = 69; + int GTE = 70; + int LSHIFT = 71; + int RSHIFT = 72; + int PLUS = 73; + int MINUS = 74; + int DIV = 75; + int MOD = 76; + int INC = 77; + int DEC = 78; + int LITERAL_sizeof = 79; + int BNOT = 80; + int LNOT = 81; + int PTR = 82; + int DOT = 83; + int CharLiteral = 84; + int StringLiteral = 85; + int IntOctalConst = 86; + int LongOctalConst = 87; + int UnsignedOctalConst = 88; + int IntIntConst = 89; + int LongIntConst = 90; + int UnsignedIntConst = 91; + int IntHexConst = 92; + int LongHexConst = 93; + int UnsignedHexConst = 94; + int FloatDoubleConst = 95; + int DoubleDoubleConst = 96; + int LongDoubleConst = 97; + int NTypedefName = 98; + int NInitDecl = 99; + int NDeclarator = 100; + int NStructDeclarator = 101; + int NDeclaration = 102; + int NCast = 103; + int NPointerGroup = 104; + int NExpressionGroup = 105; + int NFunctionCallArgs = 106; + int NNonemptyAbstractDeclarator = 107; + int NInitializer = 108; + int NStatementExpr = 109; + int NEmptyExpression = 110; + int NParameterTypeList = 111; + int NFunctionDef = 112; + int NCompoundStatement = 113; + int NParameterDeclaration = 114; + int NCommaExpr = 115; + int NUnaryExpr = 116; + int NLabel = 117; + int NPostfixExpr = 118; + int NRangeExpr = 119; + int NStringSeq = 120; + int NInitializerElementLabel = 121; + int NLcurlyInitializer = 122; + int NAsmAttribute = 123; + int NGnuAsmExpr = 124; + int NTypeMissing = 125; + int Vocabulary = 126; + int Whitespace = 127; + int Comment = 128; + int CPPComment = 129; + int PREPROC_DIRECTIVE = 130; + int Space = 131; + int LineDirective = 132; + int BadStringLiteral = 133; + int Escape = 134; + int Digit = 135; + int LongSuffix = 136; + int UnsignedSuffix = 137; + int FloatSuffix = 138; + int Exponent = 139; + int Number = 140; + int LITERAL___label__ = 141; + int LITERAL_inline = 142; + int LITERAL_byte = 143; + int LITERAL_boolean = 144; + int LITERAL_Servo = 145; + int LITERAL_Wire = 146; + int LITERAL_typeof = 147; + int LITERAL___complex = 148; + int LITERAL___attribute = 149; + int LITERAL___alignof = 150; + int LITERAL___real = 151; + int LITERAL___imag = 152; +} diff --git a/app/preproc/WEmitterTokenTypes.txt b/app/preproc/WEmitterTokenTypes.txt index c01635992..f192158c5 100644 --- a/app/preproc/WEmitterTokenTypes.txt +++ b/app/preproc/WEmitterTokenTypes.txt @@ -1,151 +1,151 @@ -// $ANTLR 2.7.2: expandedWEmitter.g -> WEmitterTokenTypes.txt$ -WEmitter // output token vocab name -LITERAL_typedef="typedef"=4 -LITERAL_asm="asm"=5 -LITERAL_volatile="volatile"=6 -LCURLY=7 -RCURLY=8 -SEMI=9 -LITERAL_struct="struct"=10 -LITERAL_union="union"=11 -LITERAL_enum="enum"=12 -LITERAL_auto="auto"=13 -LITERAL_register="register"=14 -LITERAL_extern="extern"=15 -LITERAL_static="static"=16 -LITERAL_const="const"=17 -LITERAL_void="void"=18 -LITERAL_char="char"=19 -LITERAL_short="short"=20 -LITERAL_int="int"=21 -LITERAL_long="long"=22 -LITERAL_float="float"=23 -LITERAL_double="double"=24 -LITERAL_signed="signed"=25 -LITERAL_unsigned="unsigned"=26 -ID=27 -COMMA=28 -COLON=29 -ASSIGN=30 -STAR=31 -LPAREN=32 -RPAREN=33 -LBRACKET=34 -RBRACKET=35 -VARARGS=36 -LITERAL_while="while"=37 -LITERAL_do="do"=38 -LITERAL_for="for"=39 -LITERAL_goto="goto"=40 -LITERAL_continue="continue"=41 -LITERAL_break="break"=42 -LITERAL_return="return"=43 -LITERAL_case="case"=44 -LITERAL_default="default"=45 -LITERAL_if="if"=46 -LITERAL_else="else"=47 -LITERAL_switch="switch"=48 -DIV_ASSIGN=49 -PLUS_ASSIGN=50 -MINUS_ASSIGN=51 -STAR_ASSIGN=52 -MOD_ASSIGN=53 -RSHIFT_ASSIGN=54 -LSHIFT_ASSIGN=55 -BAND_ASSIGN=56 -BOR_ASSIGN=57 -BXOR_ASSIGN=58 -QUESTION=59 -LOR=60 -LAND=61 -BOR=62 -BXOR=63 -BAND=64 -EQUAL=65 -NOT_EQUAL=66 -LT=67 -LTE=68 -GT=69 -GTE=70 -LSHIFT=71 -RSHIFT=72 -PLUS=73 -MINUS=74 -DIV=75 -MOD=76 -INC=77 -DEC=78 -LITERAL_sizeof="sizeof"=79 -BNOT=80 -LNOT=81 -PTR=82 -DOT=83 -CharLiteral=84 -StringLiteral=85 -IntOctalConst=86 -LongOctalConst=87 -UnsignedOctalConst=88 -IntIntConst=89 -LongIntConst=90 -UnsignedIntConst=91 -IntHexConst=92 -LongHexConst=93 -UnsignedHexConst=94 -FloatDoubleConst=95 -DoubleDoubleConst=96 -LongDoubleConst=97 -NTypedefName=98 -NInitDecl=99 -NDeclarator=100 -NStructDeclarator=101 -NDeclaration=102 -NCast=103 -NPointerGroup=104 -NExpressionGroup=105 -NFunctionCallArgs=106 -NNonemptyAbstractDeclarator=107 -NInitializer=108 -NStatementExpr=109 -NEmptyExpression=110 -NParameterTypeList=111 -NFunctionDef=112 -NCompoundStatement=113 -NParameterDeclaration=114 -NCommaExpr=115 -NUnaryExpr=116 -NLabel=117 -NPostfixExpr=118 -NRangeExpr=119 -NStringSeq=120 -NInitializerElementLabel=121 -NLcurlyInitializer=122 -NAsmAttribute=123 -NGnuAsmExpr=124 -NTypeMissing=125 -Vocabulary=126 -Whitespace=127 -Comment=128 -CPPComment=129 -PREPROC_DIRECTIVE("a line directive")=130 -Space=131 -LineDirective=132 -BadStringLiteral=133 -Escape=134 -Digit=135 -LongSuffix=136 -UnsignedSuffix=137 -FloatSuffix=138 -Exponent=139 -Number=140 -LITERAL___label__="__label__"=141 -LITERAL_inline="inline"=142 -LITERAL_byte="byte"=143 -LITERAL_boolean="boolean"=144 -LITERAL_Servo="Servo"=145 -LITERAL_Wire="Wire"=146 -LITERAL_typeof="typeof"=147 -LITERAL___complex="__complex"=148 -LITERAL___attribute="__attribute"=149 -LITERAL___alignof="__alignof"=150 -LITERAL___real="__real"=151 -LITERAL___imag="__imag"=152 +// $ANTLR 2.7.2: expandedWEmitter.g -> WEmitterTokenTypes.txt$ +WEmitter // output token vocab name +LITERAL_typedef="typedef"=4 +LITERAL_asm="asm"=5 +LITERAL_volatile="volatile"=6 +LCURLY=7 +RCURLY=8 +SEMI=9 +LITERAL_struct="struct"=10 +LITERAL_union="union"=11 +LITERAL_enum="enum"=12 +LITERAL_auto="auto"=13 +LITERAL_register="register"=14 +LITERAL_extern="extern"=15 +LITERAL_static="static"=16 +LITERAL_const="const"=17 +LITERAL_void="void"=18 +LITERAL_char="char"=19 +LITERAL_short="short"=20 +LITERAL_int="int"=21 +LITERAL_long="long"=22 +LITERAL_float="float"=23 +LITERAL_double="double"=24 +LITERAL_signed="signed"=25 +LITERAL_unsigned="unsigned"=26 +ID=27 +COMMA=28 +COLON=29 +ASSIGN=30 +STAR=31 +LPAREN=32 +RPAREN=33 +LBRACKET=34 +RBRACKET=35 +VARARGS=36 +LITERAL_while="while"=37 +LITERAL_do="do"=38 +LITERAL_for="for"=39 +LITERAL_goto="goto"=40 +LITERAL_continue="continue"=41 +LITERAL_break="break"=42 +LITERAL_return="return"=43 +LITERAL_case="case"=44 +LITERAL_default="default"=45 +LITERAL_if="if"=46 +LITERAL_else="else"=47 +LITERAL_switch="switch"=48 +DIV_ASSIGN=49 +PLUS_ASSIGN=50 +MINUS_ASSIGN=51 +STAR_ASSIGN=52 +MOD_ASSIGN=53 +RSHIFT_ASSIGN=54 +LSHIFT_ASSIGN=55 +BAND_ASSIGN=56 +BOR_ASSIGN=57 +BXOR_ASSIGN=58 +QUESTION=59 +LOR=60 +LAND=61 +BOR=62 +BXOR=63 +BAND=64 +EQUAL=65 +NOT_EQUAL=66 +LT=67 +LTE=68 +GT=69 +GTE=70 +LSHIFT=71 +RSHIFT=72 +PLUS=73 +MINUS=74 +DIV=75 +MOD=76 +INC=77 +DEC=78 +LITERAL_sizeof="sizeof"=79 +BNOT=80 +LNOT=81 +PTR=82 +DOT=83 +CharLiteral=84 +StringLiteral=85 +IntOctalConst=86 +LongOctalConst=87 +UnsignedOctalConst=88 +IntIntConst=89 +LongIntConst=90 +UnsignedIntConst=91 +IntHexConst=92 +LongHexConst=93 +UnsignedHexConst=94 +FloatDoubleConst=95 +DoubleDoubleConst=96 +LongDoubleConst=97 +NTypedefName=98 +NInitDecl=99 +NDeclarator=100 +NStructDeclarator=101 +NDeclaration=102 +NCast=103 +NPointerGroup=104 +NExpressionGroup=105 +NFunctionCallArgs=106 +NNonemptyAbstractDeclarator=107 +NInitializer=108 +NStatementExpr=109 +NEmptyExpression=110 +NParameterTypeList=111 +NFunctionDef=112 +NCompoundStatement=113 +NParameterDeclaration=114 +NCommaExpr=115 +NUnaryExpr=116 +NLabel=117 +NPostfixExpr=118 +NRangeExpr=119 +NStringSeq=120 +NInitializerElementLabel=121 +NLcurlyInitializer=122 +NAsmAttribute=123 +NGnuAsmExpr=124 +NTypeMissing=125 +Vocabulary=126 +Whitespace=127 +Comment=128 +CPPComment=129 +PREPROC_DIRECTIVE("a line directive")=130 +Space=131 +LineDirective=132 +BadStringLiteral=133 +Escape=134 +Digit=135 +LongSuffix=136 +UnsignedSuffix=137 +FloatSuffix=138 +Exponent=139 +Number=140 +LITERAL___label__="__label__"=141 +LITERAL_inline="inline"=142 +LITERAL_byte="byte"=143 +LITERAL_boolean="boolean"=144 +LITERAL_Servo="Servo"=145 +LITERAL_Wire="Wire"=146 +LITERAL_typeof="typeof"=147 +LITERAL___complex="__complex"=148 +LITERAL___attribute="__attribute"=149 +LITERAL___alignof="__alignof"=150 +LITERAL___real="__real"=151 +LITERAL___imag="__imag"=152 diff --git a/app/preproc/WLexer.java b/app/preproc/WLexer.java index 44f99cb85..546512075 100644 --- a/app/preproc/WLexer.java +++ b/app/preproc/WLexer.java @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "expandedWParser.g" -> "WLexer.java"$ +// $ANTLR 2.7.2: "expandedWParser.g" -> "WLexer.java"$ package processing.app.preproc; @@ -6,38 +6,38 @@ import java.io.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -import java.io.InputStream; -import antlr.TokenStreamException; -import antlr.TokenStreamIOException; -import antlr.TokenStreamRecognitionException; -import antlr.CharStreamException; -import antlr.CharStreamIOException; -import antlr.ANTLRException; -import java.io.Reader; -import java.util.Hashtable; -import antlr.CharScanner; -import antlr.InputBuffer; -import antlr.ByteBuffer; -import antlr.CharBuffer; -import antlr.Token; -import antlr.CommonToken; -import antlr.RecognitionException; -import antlr.NoViableAltForCharException; -import antlr.MismatchedCharException; -import antlr.TokenStream; -import antlr.ANTLRHashString; -import antlr.LexerSharedInputState; -import antlr.collections.impl.BitSet; -import antlr.SemanticException; + +import java.io.InputStream; +import antlr.TokenStreamException; +import antlr.TokenStreamIOException; +import antlr.TokenStreamRecognitionException; +import antlr.CharStreamException; +import antlr.CharStreamIOException; +import antlr.ANTLRException; +import java.io.Reader; +import java.util.Hashtable; +import antlr.CharScanner; +import antlr.InputBuffer; +import antlr.ByteBuffer; +import antlr.CharBuffer; +import antlr.Token; +import antlr.CommonToken; +import antlr.RecognitionException; +import antlr.NoViableAltForCharException; +import antlr.MismatchedCharException; +import antlr.TokenStream; +import antlr.ANTLRHashString; +import antlr.LexerSharedInputState; +import antlr.collections.impl.BitSet; +import antlr.SemanticException; // import CToken; import java.io.*; // import LineObject; import antlr.*; - -public class WLexer extends antlr.CharScanner implements WLexerTokenTypes, TokenStream - { + +public class WLexer extends antlr.CharScanner implements WLexerTokenTypes, TokenStream + { public void initialize(String src) { @@ -133,2678 +133,2678 @@ public class WLexer extends antlr.CharScanner implements WLexerTokenTypes, Token -public WLexer(InputStream in) { - this(new ByteBuffer(in)); -} -public WLexer(Reader in) { - this(new CharBuffer(in)); -} -public WLexer(InputBuffer ib) { - this(new LexerSharedInputState(ib)); -} -public WLexer(LexerSharedInputState state) { - super(state); - caseSensitiveLiterals = true; - setCaseSensitive(true); - literals = new Hashtable(); - literals.put(new ANTLRHashString("byte", this), new Integer(143)); - literals.put(new ANTLRHashString("extern", this), new Integer(15)); - literals.put(new ANTLRHashString("__real", this), new Integer(151)); - literals.put(new ANTLRHashString("case", this), new Integer(44)); - literals.put(new ANTLRHashString("short", this), new Integer(20)); - literals.put(new ANTLRHashString("break", this), new Integer(42)); - literals.put(new ANTLRHashString("while", this), new Integer(37)); - literals.put(new ANTLRHashString("typeof", this), new Integer(147)); - literals.put(new ANTLRHashString("inline", this), new Integer(142)); - literals.put(new ANTLRHashString("unsigned", this), new Integer(26)); - literals.put(new ANTLRHashString("const", this), new Integer(17)); - literals.put(new ANTLRHashString("float", this), new Integer(23)); - literals.put(new ANTLRHashString("return", this), new Integer(43)); - literals.put(new ANTLRHashString("sizeof", this), new Integer(79)); - literals.put(new ANTLRHashString("do", this), new Integer(38)); - literals.put(new ANTLRHashString("__label__", this), new Integer(141)); - literals.put(new ANTLRHashString("typedef", this), new Integer(4)); - literals.put(new ANTLRHashString("if", this), new Integer(46)); - literals.put(new ANTLRHashString("double", this), new Integer(24)); - literals.put(new ANTLRHashString("volatile", this), new Integer(6)); - literals.put(new ANTLRHashString("__attribute", this), new Integer(149)); - literals.put(new ANTLRHashString("union", this), new Integer(11)); - literals.put(new ANTLRHashString("register", this), new Integer(14)); - literals.put(new ANTLRHashString("auto", this), new Integer(13)); - literals.put(new ANTLRHashString("goto", this), new Integer(40)); - literals.put(new ANTLRHashString("enum", this), new Integer(12)); - literals.put(new ANTLRHashString("Servo", this), new Integer(145)); - literals.put(new ANTLRHashString("int", this), new Integer(21)); - literals.put(new ANTLRHashString("for", this), new Integer(39)); - literals.put(new ANTLRHashString("boolean", this), new Integer(144)); - literals.put(new ANTLRHashString("Wire", this), new Integer(146)); - literals.put(new ANTLRHashString("char", this), new Integer(19)); - literals.put(new ANTLRHashString("default", this), new Integer(45)); - literals.put(new ANTLRHashString("__imag", this), new Integer(152)); - literals.put(new ANTLRHashString("__alignof", this), new Integer(150)); - literals.put(new ANTLRHashString("static", this), new Integer(16)); - literals.put(new ANTLRHashString("continue", this), new Integer(41)); - literals.put(new ANTLRHashString("struct", this), new Integer(10)); - literals.put(new ANTLRHashString("signed", this), new Integer(25)); - literals.put(new ANTLRHashString("else", this), new Integer(47)); - literals.put(new ANTLRHashString("void", this), new Integer(18)); - literals.put(new ANTLRHashString("switch", this), new Integer(48)); - literals.put(new ANTLRHashString("long", this), new Integer(22)); - literals.put(new ANTLRHashString("__extension__", this), new Integer(153)); - literals.put(new ANTLRHashString("asm", this), new Integer(5)); - literals.put(new ANTLRHashString("__complex", this), new Integer(148)); -} - -public Token nextToken() throws TokenStreamException { - Token theRetToken=null; -tryAgain: - for (;;) { - Token _token = null; - int _ttype = Token.INVALID_TYPE; - resetText(); - try { // for char stream error handling - try { // for lexical error handling - switch ( LA(1)) { - case '\t': case '\n': case '\u000c': case '\r': - case ' ': - { - mWhitespace(true); - theRetToken=_returnToken; - break; - } - case '.': case '0': case '1': case '2': - case '3': case '4': case '5': case '6': - case '7': case '8': case '9': - { - mNumber(true); - theRetToken=_returnToken; - break; - } - case '\'': - { - mCharLiteral(true); - theRetToken=_returnToken; - break; - } - case '"': - { - mStringLiteral(true); - theRetToken=_returnToken; - break; - } - case ':': - { - mCOLON(true); - theRetToken=_returnToken; - break; - } - case ',': - { - mCOMMA(true); - theRetToken=_returnToken; - break; - } - case '?': - { - mQUESTION(true); - theRetToken=_returnToken; - break; - } - case ';': - { - mSEMI(true); - theRetToken=_returnToken; - break; - } - case '(': - { - mLPAREN(true); - theRetToken=_returnToken; - break; - } - case ')': - { - mRPAREN(true); - theRetToken=_returnToken; - break; - } - case '[': - { - mLBRACKET(true); - theRetToken=_returnToken; - break; - } - case ']': - { - mRBRACKET(true); - theRetToken=_returnToken; - break; - } - case '{': - { - mLCURLY(true); - theRetToken=_returnToken; - break; - } - case '}': - { - mRCURLY(true); - theRetToken=_returnToken; - break; - } - case '~': - { - mBNOT(true); - theRetToken=_returnToken; - break; - } - case '#': - { - mPREPROC_DIRECTIVE(true); - theRetToken=_returnToken; - break; - } - default: - if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='=')) { - mRSHIFT_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='<') && (LA(2)=='<') && (LA(3)=='=')) { - mLSHIFT_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='L') && (LA(2)=='\'')) { - mWideCharLiteral(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='L') && (LA(2)=='"')) { - mWideStringLiteral(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='-') && (LA(2)=='>')) { - mPTR(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='=') && (LA(2)=='=')) { - mEQUAL(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='!') && (LA(2)=='=')) { - mNOT_EQUAL(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='<') && (LA(2)=='=')) { - mLTE(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='>') && (LA(2)=='=')) { - mGTE(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='/') && (LA(2)=='=')) { - mDIV_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='+') && (LA(2)=='=')) { - mPLUS_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='+') && (LA(2)=='+')) { - mINC(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='-') && (LA(2)=='=')) { - mMINUS_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='-') && (LA(2)=='-')) { - mDEC(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='*') && (LA(2)=='=')) { - mSTAR_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='%') && (LA(2)=='=')) { - mMOD_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='>') && (LA(2)=='>') && (true)) { - mRSHIFT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='<') && (LA(2)=='<') && (true)) { - mLSHIFT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='&') && (LA(2)=='&')) { - mLAND(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='|') && (LA(2)=='|')) { - mLOR(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='&') && (LA(2)=='=')) { - mBAND_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='|') && (LA(2)=='=')) { - mBOR_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='^') && (LA(2)=='=')) { - mBXOR_ASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='/') && (LA(2)=='*')) { - mComment(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='/') && (LA(2)=='/')) { - mCPPComment(true); - theRetToken=_returnToken; - } - else if ((_tokenSet_0.member(LA(1))) && (true)) { - mIDMEAT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='=') && (true)) { - mASSIGN(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='<') && (true)) { - mLT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='>') && (true)) { - mGT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='/') && (true)) { - mDIV(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='+') && (true)) { - mPLUS(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='-') && (true)) { - mMINUS(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='*') && (true)) { - mSTAR(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='%') && (true)) { - mMOD(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='!') && (true)) { - mLNOT(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='&') && (true)) { - mBAND(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='|') && (true)) { - mBOR(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='^') && (true)) { - mBXOR(true); - theRetToken=_returnToken; - } - else { - if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} - else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - } - if ( _returnToken==null ) continue tryAgain; // found SKIP token - _ttype = _returnToken.getType(); - _returnToken.setType(_ttype); - return _returnToken; - } - catch (RecognitionException e) { - throw new TokenStreamRecognitionException(e); - } - } - catch (CharStreamException cse) { - if ( cse instanceof CharStreamIOException ) { - throw new TokenStreamIOException(((CharStreamIOException)cse).io); - } - else { - throw new TokenStreamException(cse.getMessage()); - } - } - } -} - - public final void mWhitespace(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Whitespace; - int _saveIndex; - - { - if ((LA(1)=='\r') && (LA(2)=='\n')) { - match("\r\n"); - if ( inputState.guessing==0 ) { - newline(); - } - } - else if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ')) { - { - switch ( LA(1)) { - case ' ': - { - match(' '); - break; - } - case '\t': - { - match('\t'); - break; - } - case '\u000c': - { - match('\014'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - } - else if ((LA(1)=='\n'||LA(1)=='\r') && (true)) { - { - switch ( LA(1)) { - case '\n': - { - match('\n'); - break; - } - case '\r': - { - match('\r'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - if ( inputState.guessing==0 ) { - newline(); - } - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - if ( inputState.guessing==0 ) { - _ttype = Token.SKIP; - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mEscape(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Escape; - int _saveIndex; - - match('\\'); - { - switch ( LA(1)) { - case '0': case '1': case '2': case '3': - { - { - matchRange('0','3'); - } - { - _loop327: - do { - if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mDigit(false); - } - else { - break _loop327; - } - - } while (true); - } - break; - } - case '4': case '5': case '6': case '7': - { - { - matchRange('4','7'); - } - { - _loop330: - do { - if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mDigit(false); - } - else { - break _loop330; - } - - } while (true); - } - break; - } - case 'x': - { - match('x'); - { - int _cnt332=0; - _loop332: - do { - if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mDigit(false); - } - else if (((LA(1) >= 'a' && LA(1) <= 'f')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - matchRange('a','f'); - } - else if (((LA(1) >= 'A' && LA(1) <= 'F')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - matchRange('A','F'); - } - else { - if ( _cnt332>=1 ) { break _loop332; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt332++; - } while (true); - } - break; - } - default: - if ((_tokenSet_1.member(LA(1)))) { - { - match(_tokenSet_1); - } - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mDigit(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Digit; - int _saveIndex; - - matchRange('0','9'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mIntSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = IntSuffix; - int _saveIndex; - - switch ( LA(1)) { - case 'L': - { - match('L'); - break; - } - case 'l': - { - match('l'); - break; - } - case 'U': - { - match('U'); - break; - } - case 'u': - { - match('u'); - break; - } - case 'I': - { - match('I'); - break; - } - case 'i': - { - match('i'); - break; - } - case 'J': - { - match('J'); - break; - } - case 'j': - { - match('j'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mNumberSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = NumberSuffix; - int _saveIndex; - - switch ( LA(1)) { - case 'I': case 'J': case 'L': case 'U': - case 'i': case 'j': case 'l': case 'u': - { - mIntSuffix(false); - break; - } - case 'F': - { - match('F'); - break; - } - case 'f': - { - match('f'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mNumber(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Number; - int _saveIndex; - - boolean synPredMatched340 = false; - if ((((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_2.member(LA(2))) && (true))) { - int _m340 = mark(); - synPredMatched340 = true; - inputState.guessing++; - try { - { - { - int _cnt338=0; - _loop338: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - if ( _cnt338>=1 ) { break _loop338; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt338++; - } while (true); - } - { - switch ( LA(1)) { - case '.': - { - match('.'); - break; - } - case 'e': - { - match('e'); - break; - } - case 'E': - { - match('E'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - } - } - catch (RecognitionException pe) { - synPredMatched340 = false; - } - rewind(_m340); - inputState.guessing--; - } - if ( synPredMatched340 ) { - { - int _cnt342=0; - _loop342: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - if ( _cnt342>=1 ) { break _loop342; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt342++; - } while (true); - } - { - switch ( LA(1)) { - case '.': - { - match('.'); - { - _loop345: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - break _loop345; - } - - } while (true); - } - { - if ((LA(1)=='E'||LA(1)=='e')) { - mExponent(false); - } - else { - } - - } - break; - } - case 'E': case 'e': - { - mExponent(false); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - _loop348: - do { - if ((_tokenSet_3.member(LA(1)))) { - mNumberSuffix(false); - } - else { - break _loop348; - } - - } while (true); - } - } - else { - boolean synPredMatched350 = false; - if (((LA(1)=='.') && (LA(2)=='.'))) { - int _m350 = mark(); - synPredMatched350 = true; - inputState.guessing++; - try { - { - match("..."); - } - } - catch (RecognitionException pe) { - synPredMatched350 = false; - } - rewind(_m350); - inputState.guessing--; - } - if ( synPredMatched350 ) { - match("..."); - if ( inputState.guessing==0 ) { - _ttype = VARARGS; - } - } - else if ((LA(1)=='0') && (LA(2)=='X'||LA(2)=='x')) { - match('0'); - { - switch ( LA(1)) { - case 'x': - { - match('x'); - break; - } - case 'X': - { - match('X'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - int _cnt367=0; - _loop367: - do { - switch ( LA(1)) { - case 'a': case 'b': case 'c': case 'd': - case 'e': case 'f': - { - matchRange('a','f'); - break; - } - case 'A': case 'B': case 'C': case 'D': - case 'E': case 'F': - { - matchRange('A','F'); - break; - } - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': - { - mDigit(false); - break; - } - default: - { - if ( _cnt367>=1 ) { break _loop367; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - } - _cnt367++; - } while (true); - } - { - _loop369: - do { - if ((_tokenSet_4.member(LA(1)))) { - mIntSuffix(false); - } - else { - break _loop369; - } - - } while (true); - } - } - else if ((LA(1)=='.') && (true)) { - match('.'); - if ( inputState.guessing==0 ) { - _ttype = DOT; - } - { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - { - int _cnt353=0; - _loop353: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - if ( _cnt353>=1 ) { break _loop353; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt353++; - } while (true); - } - { - if ((LA(1)=='E'||LA(1)=='e')) { - mExponent(false); - } - else { - } - - } - if ( inputState.guessing==0 ) { - _ttype = Number; - } - { - _loop356: - do { - if ((_tokenSet_3.member(LA(1)))) { - mNumberSuffix(false); - } - else { - break _loop356; - } - - } while (true); - } - } - else { - } - - } - } - else if ((LA(1)=='0') && (true) && (true)) { - match('0'); - { - _loop358: - do { - if (((LA(1) >= '0' && LA(1) <= '7'))) { - matchRange('0','7'); - } - else { - break _loop358; - } - - } while (true); - } - { - _loop360: - do { - if ((_tokenSet_3.member(LA(1)))) { - mNumberSuffix(false); - } - else { - break _loop360; - } - - } while (true); - } - } - else if (((LA(1) >= '1' && LA(1) <= '9')) && (true) && (true)) { - matchRange('1','9'); - { - _loop362: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - break _loop362; - } - - } while (true); - } - { - _loop364: - do { - if ((_tokenSet_3.member(LA(1)))) { - mNumberSuffix(false); - } - else { - break _loop364; - } - - } while (true); - } - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mExponent(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Exponent; - int _saveIndex; - - { - switch ( LA(1)) { - case 'e': - { - match('e'); - break; - } - case 'E': - { - match('E'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - switch ( LA(1)) { - case '+': - { - match('+'); - break; - } - case '-': - { - match('-'); - break; - } - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': - { - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - int _cnt487=0; - _loop487: - do { - if (((LA(1) >= '0' && LA(1) <= '9'))) { - mDigit(false); - } - else { - if ( _cnt487>=1 ) { break _loop487; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt487++; - } while (true); - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mIDMEAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = IDMEAT; - int _saveIndex; - Token i=null; - - mID(true); - i=_returnToken; - if ( inputState.guessing==0 ) { - - - if ( i.getType() == LITERAL___extension__ ) { - _ttype = Token.SKIP; - } - else { - _ttype = i.getType(); - } - - - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = ID; - int _saveIndex; - - { - switch ( LA(1)) { - case 'a': case 'b': case 'c': case 'd': - case 'e': case 'f': case 'g': case 'h': - case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'p': - case 'q': case 'r': case 's': case 't': - case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - { - matchRange('a','z'); - break; - } - case 'A': case 'B': case 'C': case 'D': - case 'E': case 'F': case 'G': case 'H': - case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': - case 'Q': case 'R': case 'S': case 'T': - case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - { - matchRange('A','Z'); - break; - } - case '_': - { - match('_'); - break; - } - case '$': - { - match('$'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - _loop374: - do { - if (((LA(1) >= 'a' && LA(1) <= 'z')) && (true) && (true)) { - matchRange('a','z'); - } - else if (((LA(1) >= 'A' && LA(1) <= 'Z')) && (true) && (true)) { - matchRange('A','Z'); - } - else if ((LA(1)=='_') && (true) && (true)) { - match('_'); - } - else if ((LA(1)=='$') && (true) && (true)) { - match('$'); - } - else if (((LA(1) >= '0' && LA(1) <= '9')) && (true) && (true)) { - matchRange('0','9'); - } - else { - break _loop374; - } - - } while (true); - } - _ttype = testLiteralsTable(new String(text.getBuffer(),_begin,text.length()-_begin),_ttype); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mWideCharLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = WideCharLiteral; - int _saveIndex; - - match('L'); - mCharLiteral(false); - if ( inputState.guessing==0 ) { - _ttype = CharLiteral; - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mCharLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = CharLiteral; - int _saveIndex; - - match('\''); - { - if ((LA(1)=='\\') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (_tokenSet_5.member(LA(3)))) { - mEscape(false); - } - else if ((_tokenSet_6.member(LA(1))) && (LA(2)=='\'') && (true)) { - { - match(_tokenSet_6); - } - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - match('\''); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mWideStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = WideStringLiteral; - int _saveIndex; - - match('L'); - mStringLiteral(false); - if ( inputState.guessing==0 ) { - _ttype = StringLiteral; - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = StringLiteral; - int _saveIndex; - - match('"'); - { - _loop384: - do { - boolean synPredMatched381 = false; - if (((LA(1)=='\\') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff')))) { - int _m381 = mark(); - synPredMatched381 = true; - inputState.guessing++; - try { - { - match('\\'); - { - match(_tokenSet_7); - } - } - } - catch (RecognitionException pe) { - synPredMatched381 = false; - } - rewind(_m381); - inputState.guessing--; - } - if ( synPredMatched381 ) { - mEscape(false); - } - else if ((LA(1)=='\n'||LA(1)=='\r'||LA(1)=='\\') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - { - switch ( LA(1)) { - case '\r': - { - match('\r'); - if ( inputState.guessing==0 ) { - newline(); - } - break; - } - case '\n': - { - match('\n'); - if ( inputState.guessing==0 ) { - - newline(); - - } - break; - } - case '\\': - { - match('\\'); - match('\n'); - if ( inputState.guessing==0 ) { - - newline(); - - } - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - } - else if ((_tokenSet_8.member(LA(1)))) { - { - match(_tokenSet_8); - } - } - else { - break _loop384; - } - - } while (true); - } - match('"'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mVocabulary(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Vocabulary; - int _saveIndex; - - matchRange('\3','\377'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = ASSIGN; - int _saveIndex; - - match('='); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = COLON; - int _saveIndex; - - match(':'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = COMMA; - int _saveIndex; - - match(','); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mQUESTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = QUESTION; - int _saveIndex; - - match('?'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = SEMI; - int _saveIndex; - - match(';'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mPTR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = PTR; - int _saveIndex; - - match("->"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = DOT; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mVARARGS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = VARARGS; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LPAREN; - int _saveIndex; - - match('('); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = RPAREN; - int _saveIndex; - - match(')'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LBRACKET; - int _saveIndex; - - match('['); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mRBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = RBRACKET; - int _saveIndex; - - match(']'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LCURLY; - int _saveIndex; - - match('{'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = RCURLY; - int _saveIndex; - - match('}'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mEQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = EQUAL; - int _saveIndex; - - match("=="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mNOT_EQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = NOT_EQUAL; - int _saveIndex; - - match("!="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LTE; - int _saveIndex; - - match("<="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LT; - int _saveIndex; - - match("<"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mGTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = GTE; - int _saveIndex; - - match(">="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = GT; - int _saveIndex; - - match(">"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mDIV(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = DIV; - int _saveIndex; - - match('/'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mDIV_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = DIV_ASSIGN; - int _saveIndex; - - match("/="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = PLUS; - int _saveIndex; - - match('+'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mPLUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = PLUS_ASSIGN; - int _saveIndex; - - match("+="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mINC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = INC; - int _saveIndex; - - match("++"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = MINUS; - int _saveIndex; - - match('-'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mMINUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = MINUS_ASSIGN; - int _saveIndex; - - match("-="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mDEC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = DEC; - int _saveIndex; - - match("--"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = STAR; - int _saveIndex; - - match('*'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mSTAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = STAR_ASSIGN; - int _saveIndex; - - match("*="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mMOD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = MOD; - int _saveIndex; - - match('%'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mMOD_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = MOD_ASSIGN; - int _saveIndex; - - match("%="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mRSHIFT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = RSHIFT; - int _saveIndex; - - match(">>"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mRSHIFT_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = RSHIFT_ASSIGN; - int _saveIndex; - - match(">>="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLSHIFT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LSHIFT; - int _saveIndex; - - match("<<"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLSHIFT_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LSHIFT_ASSIGN; - int _saveIndex; - - match("<<="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LAND; - int _saveIndex; - - match("&&"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LNOT; - int _saveIndex; - - match('!'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mLOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LOR; - int _saveIndex; - - match("||"); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BAND; - int _saveIndex; - - match('&'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBAND_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BAND_ASSIGN; - int _saveIndex; - - match("&="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BNOT; - int _saveIndex; - - match('~'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BOR; - int _saveIndex; - - match('|'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BOR_ASSIGN; - int _saveIndex; - - match("|="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBXOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BXOR; - int _saveIndex; - - match('^'); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mBXOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BXOR_ASSIGN; - int _saveIndex; - - match("^="); - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mComment(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Comment; - int _saveIndex; - - match("/*"); - { - _loop436: - do { - if (((LA(1)=='*') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff')))&&( LA(2) != '/' )) { - match('*'); - } - else if ((LA(1)=='\r') && (LA(2)=='\n') && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { - match("\r\n"); - if ( inputState.guessing==0 ) { - deferredNewline(); - } - } - else if ((LA(1)=='\n'||LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { - { - switch ( LA(1)) { - case '\r': - { - match('\r'); - break; - } - case '\n': - { - match('\n'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - if ( inputState.guessing==0 ) { - deferredNewline(); - } - } - else if ((_tokenSet_9.member(LA(1)))) { - { - match(_tokenSet_9); - } - } - else { - break _loop436; - } - - } while (true); - } - match("*/"); - if ( inputState.guessing==0 ) { - _ttype = Token.SKIP; - - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mCPPComment(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = CPPComment; - int _saveIndex; - - match("//"); - { - _loop440: - do { - if ((_tokenSet_7.member(LA(1)))) { - { - match(_tokenSet_7); - } - } - else { - break _loop440; - } - - } while (true); - } - if ( inputState.guessing==0 ) { - - _ttype = Token.SKIP; - - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - public final void mPREPROC_DIRECTIVE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = PREPROC_DIRECTIVE; - int _saveIndex; - - match('#'); - { - boolean synPredMatched447 = false; - if (((_tokenSet_10.member(LA(1))) && (_tokenSet_11.member(LA(2))) && (_tokenSet_12.member(LA(3))))) { - int _m447 = mark(); - synPredMatched447 = true; - inputState.guessing++; - try { - { - switch ( LA(1)) { - case 'l': - { - match("line"); - break; - } - case '\t': case '\u000c': case ' ': - { - { - { - int _cnt446=0; - _loop446: - do { - switch ( LA(1)) { - case ' ': - { - match(' '); - break; - } - case '\t': - { - match('\t'); - break; - } - case '\u000c': - { - match('\014'); - break; - } - default: - { - if ( _cnt446>=1 ) { break _loop446; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - } - _cnt446++; - } while (true); - } - matchRange('0','9'); - } - break; - } - default: - { - } - } - } - } - catch (RecognitionException pe) { - synPredMatched447 = false; - } - rewind(_m447); - inputState.guessing--; - } - if ( synPredMatched447 ) { - mLineDirective(false); - } - else { - { - _loop449: - do { - if ((_tokenSet_7.member(LA(1)))) { - matchNot('\n'); - } - else { - break _loop449; - } - - } while (true); - } - if ( inputState.guessing==0 ) { - setPreprocessingDirective(getText()); - } - } - - } - if ( inputState.guessing==0 ) { - - _ttype = Token.SKIP; - - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLineDirective(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LineDirective; - int _saveIndex; - Token n=null; - Token fn=null; - Token fi=null; - - boolean oldCountingTokens = countingTokens; - countingTokens = false; - - - if ( inputState.guessing==0 ) { - - lineObject = new LineObject(); - deferredLineCount = 0; - - } - { - switch ( LA(1)) { - case 'l': - { - match("line"); - break; - } - case '\t': case '\u000c': case ' ': - { - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - { - int _cnt455=0; - _loop455: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ')) { - mSpace(false); - } - else { - if ( _cnt455>=1 ) { break _loop455; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt455++; - } while (true); - } - mNumber(true); - n=_returnToken; - if ( inputState.guessing==0 ) { - lineObject.setLine(Integer.parseInt(n.getText())); - } - { - int _cnt457=0; - _loop457: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mSpace(false); - } - else { - if ( _cnt457>=1 ) { break _loop457; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} - } - - _cnt457++; - } while (true); - } - { - if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { - mStringLiteral(true); - fn=_returnToken; - if ( inputState.guessing==0 ) { - try { - lineObject.setSource(fn.getText().substring(1,fn.getText().length()-1)); - } - catch (StringIndexOutOfBoundsException e) { /*not possible*/ } - - } - } - else if ((_tokenSet_0.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mID(true); - fi=_returnToken; - if ( inputState.guessing==0 ) { - lineObject.setSource(fi.getText()); - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - { - _loop460: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mSpace(false); - } - else { - break _loop460; - } - - } while (true); - } - { - if ((LA(1)=='1') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - match("1"); - if ( inputState.guessing==0 ) { - lineObject.setEnteringFile(true); - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - { - _loop463: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mSpace(false); - } - else { - break _loop463; - } - - } while (true); - } - { - if ((LA(1)=='2') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - match("2"); - if ( inputState.guessing==0 ) { - lineObject.setReturningToFile(true); - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - { - _loop466: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mSpace(false); - } - else { - break _loop466; - } - - } while (true); - } - { - if ((LA(1)=='3') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - match("3"); - if ( inputState.guessing==0 ) { - lineObject.setSystemHeader(true); - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - { - _loop469: - do { - if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - mSpace(false); - } - else { - break _loop469; - } - - } while (true); - } - { - if ((LA(1)=='4') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { - match("4"); - if ( inputState.guessing==0 ) { - lineObject.setTreatAsC(true); - } - } - else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - { - _loop473: - do { - if ((_tokenSet_13.member(LA(1)))) { - { - match(_tokenSet_13); - } - } - else { - break _loop473; - } - - } while (true); - } - { - if ((LA(1)=='\r') && (LA(2)=='\n')) { - match("\r\n"); - } - else if ((LA(1)=='\r') && (true)) { - match("\r"); - } - else if ((LA(1)=='\n')) { - match("\n"); - } - else { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - - } - if ( inputState.guessing==0 ) { - - preprocessorInfoChannel.addLineForTokenNumber(new LineObject(lineObject), new Integer(tokenNumber)); - countingTokens = oldCountingTokens; - - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mSpace(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = Space; - int _saveIndex; - - { - switch ( LA(1)) { - case ' ': - { - match(' '); - break; - } - case '\t': - { - match('\t'); - break; - } - case '\u000c': - { - match('\014'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mBadStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = BadStringLiteral; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLongSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LongSuffix; - int _saveIndex; - - switch ( LA(1)) { - case 'l': - { - match('l'); - break; - } - case 'L': - { - match('L'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mUnsignedSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = UnsignedSuffix; - int _saveIndex; - - switch ( LA(1)) { - case 'u': - { - match('u'); - break; - } - case 'U': - { - match('U'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mFloatSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = FloatSuffix; - int _saveIndex; - - switch ( LA(1)) { - case 'f': - { - match('f'); - break; - } - case 'F': - { - match('F'); - break; - } - default: - { - throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); - } - } - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mDoubleDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = DoubleDoubleConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mFloatDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = FloatDoubleConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLongDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LongDoubleConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mIntOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = IntOctalConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLongOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LongOctalConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mUnsignedOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = UnsignedOctalConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mIntIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = IntIntConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLongIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LongIntConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mUnsignedIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = UnsignedIntConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mIntHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = IntHexConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mLongHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = LongHexConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - protected final void mUnsignedHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { - int _ttype; Token _token=null; int _begin=text.length(); - _ttype = UnsignedHexConst; - int _saveIndex; - - if ( _createToken && _token==null && _ttype!=Token.SKIP ) { - _token = makeToken(_ttype); - _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); - } - _returnToken = _token; - } - - - private static final long[] mk_tokenSet_0() { - long[] data = { 68719476736L, 576460745995190270L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); - private static final long[] mk_tokenSet_1() { - long[] data = new long[8]; - data[0]=-71776119061217288L; - data[1]=-72057594037927937L; - for (int i = 2; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); - private static final long[] mk_tokenSet_2() { - long[] data = { 288019269919178752L, 137438953504L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); - private static final long[] mk_tokenSet_3() { - long[] data = { 0L, 9031663390561856L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); - private static final long[] mk_tokenSet_4() { - long[] data = { 0L, 9031388512654848L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); - private static final long[] mk_tokenSet_5() { - long[] data = { 287949450930814976L, 541165879422L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); - private static final long[] mk_tokenSet_6() { - long[] data = new long[8]; - data[0]=-549755813896L; - for (int i = 1; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6()); - private static final long[] mk_tokenSet_7() { - long[] data = new long[8]; - data[0]=-1032L; - for (int i = 1; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7()); - private static final long[] mk_tokenSet_8() { - long[] data = new long[8]; - data[0]=-17179878408L; - data[1]=-268435457L; - for (int i = 2; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8()); - private static final long[] mk_tokenSet_9() { - long[] data = new long[8]; - data[0]=-4398046520328L; - for (int i = 1; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9()); - private static final long[] mk_tokenSet_10() { - long[] data = { 4294971904L, 17592186044416L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10()); - private static final long[] mk_tokenSet_11() { - long[] data = { 288019274214150656L, 2199023255552L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11()); - private static final long[] mk_tokenSet_12() { - long[] data = { 288019274214150656L, 81159763628398176L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); - private static final long[] mk_tokenSet_13() { - long[] data = new long[8]; - data[0]=-9224L; - for (int i = 1; i<=3; i++) { data[i]=-1L; } - return data; - } - public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13()); - - } +public WLexer(InputStream in) { + this(new ByteBuffer(in)); +} +public WLexer(Reader in) { + this(new CharBuffer(in)); +} +public WLexer(InputBuffer ib) { + this(new LexerSharedInputState(ib)); +} +public WLexer(LexerSharedInputState state) { + super(state); + caseSensitiveLiterals = true; + setCaseSensitive(true); + literals = new Hashtable(); + literals.put(new ANTLRHashString("byte", this), new Integer(143)); + literals.put(new ANTLRHashString("extern", this), new Integer(15)); + literals.put(new ANTLRHashString("__real", this), new Integer(151)); + literals.put(new ANTLRHashString("case", this), new Integer(44)); + literals.put(new ANTLRHashString("short", this), new Integer(20)); + literals.put(new ANTLRHashString("break", this), new Integer(42)); + literals.put(new ANTLRHashString("while", this), new Integer(37)); + literals.put(new ANTLRHashString("typeof", this), new Integer(147)); + literals.put(new ANTLRHashString("inline", this), new Integer(142)); + literals.put(new ANTLRHashString("unsigned", this), new Integer(26)); + literals.put(new ANTLRHashString("const", this), new Integer(17)); + literals.put(new ANTLRHashString("float", this), new Integer(23)); + literals.put(new ANTLRHashString("return", this), new Integer(43)); + literals.put(new ANTLRHashString("sizeof", this), new Integer(79)); + literals.put(new ANTLRHashString("do", this), new Integer(38)); + literals.put(new ANTLRHashString("__label__", this), new Integer(141)); + literals.put(new ANTLRHashString("typedef", this), new Integer(4)); + literals.put(new ANTLRHashString("if", this), new Integer(46)); + literals.put(new ANTLRHashString("double", this), new Integer(24)); + literals.put(new ANTLRHashString("volatile", this), new Integer(6)); + literals.put(new ANTLRHashString("__attribute", this), new Integer(149)); + literals.put(new ANTLRHashString("union", this), new Integer(11)); + literals.put(new ANTLRHashString("register", this), new Integer(14)); + literals.put(new ANTLRHashString("auto", this), new Integer(13)); + literals.put(new ANTLRHashString("goto", this), new Integer(40)); + literals.put(new ANTLRHashString("enum", this), new Integer(12)); + literals.put(new ANTLRHashString("Servo", this), new Integer(145)); + literals.put(new ANTLRHashString("int", this), new Integer(21)); + literals.put(new ANTLRHashString("for", this), new Integer(39)); + literals.put(new ANTLRHashString("boolean", this), new Integer(144)); + literals.put(new ANTLRHashString("Wire", this), new Integer(146)); + literals.put(new ANTLRHashString("char", this), new Integer(19)); + literals.put(new ANTLRHashString("default", this), new Integer(45)); + literals.put(new ANTLRHashString("__imag", this), new Integer(152)); + literals.put(new ANTLRHashString("__alignof", this), new Integer(150)); + literals.put(new ANTLRHashString("static", this), new Integer(16)); + literals.put(new ANTLRHashString("continue", this), new Integer(41)); + literals.put(new ANTLRHashString("struct", this), new Integer(10)); + literals.put(new ANTLRHashString("signed", this), new Integer(25)); + literals.put(new ANTLRHashString("else", this), new Integer(47)); + literals.put(new ANTLRHashString("void", this), new Integer(18)); + literals.put(new ANTLRHashString("switch", this), new Integer(48)); + literals.put(new ANTLRHashString("long", this), new Integer(22)); + literals.put(new ANTLRHashString("__extension__", this), new Integer(153)); + literals.put(new ANTLRHashString("asm", this), new Integer(5)); + literals.put(new ANTLRHashString("__complex", this), new Integer(148)); +} + +public Token nextToken() throws TokenStreamException { + Token theRetToken=null; +tryAgain: + for (;;) { + Token _token = null; + int _ttype = Token.INVALID_TYPE; + resetText(); + try { // for char stream error handling + try { // for lexical error handling + switch ( LA(1)) { + case '\t': case '\n': case '\u000c': case '\r': + case ' ': + { + mWhitespace(true); + theRetToken=_returnToken; + break; + } + case '.': case '0': case '1': case '2': + case '3': case '4': case '5': case '6': + case '7': case '8': case '9': + { + mNumber(true); + theRetToken=_returnToken; + break; + } + case '\'': + { + mCharLiteral(true); + theRetToken=_returnToken; + break; + } + case '"': + { + mStringLiteral(true); + theRetToken=_returnToken; + break; + } + case ':': + { + mCOLON(true); + theRetToken=_returnToken; + break; + } + case ',': + { + mCOMMA(true); + theRetToken=_returnToken; + break; + } + case '?': + { + mQUESTION(true); + theRetToken=_returnToken; + break; + } + case ';': + { + mSEMI(true); + theRetToken=_returnToken; + break; + } + case '(': + { + mLPAREN(true); + theRetToken=_returnToken; + break; + } + case ')': + { + mRPAREN(true); + theRetToken=_returnToken; + break; + } + case '[': + { + mLBRACKET(true); + theRetToken=_returnToken; + break; + } + case ']': + { + mRBRACKET(true); + theRetToken=_returnToken; + break; + } + case '{': + { + mLCURLY(true); + theRetToken=_returnToken; + break; + } + case '}': + { + mRCURLY(true); + theRetToken=_returnToken; + break; + } + case '~': + { + mBNOT(true); + theRetToken=_returnToken; + break; + } + case '#': + { + mPREPROC_DIRECTIVE(true); + theRetToken=_returnToken; + break; + } + default: + if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='=')) { + mRSHIFT_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (LA(2)=='<') && (LA(3)=='=')) { + mLSHIFT_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='L') && (LA(2)=='\'')) { + mWideCharLiteral(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='L') && (LA(2)=='"')) { + mWideStringLiteral(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (LA(2)=='>')) { + mPTR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='=') && (LA(2)=='=')) { + mEQUAL(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='!') && (LA(2)=='=')) { + mNOT_EQUAL(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (LA(2)=='=')) { + mLTE(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (LA(2)=='=')) { + mGTE(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (LA(2)=='=')) { + mDIV_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='+') && (LA(2)=='=')) { + mPLUS_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='+') && (LA(2)=='+')) { + mINC(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (LA(2)=='=')) { + mMINUS_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (LA(2)=='-')) { + mDEC(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='*') && (LA(2)=='=')) { + mSTAR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='%') && (LA(2)=='=')) { + mMOD_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (LA(2)=='>') && (true)) { + mRSHIFT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (LA(2)=='<') && (true)) { + mLSHIFT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='&') && (LA(2)=='&')) { + mLAND(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='|') && (LA(2)=='|')) { + mLOR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='&') && (LA(2)=='=')) { + mBAND_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='|') && (LA(2)=='=')) { + mBOR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='^') && (LA(2)=='=')) { + mBXOR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (LA(2)=='*')) { + mComment(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (LA(2)=='/')) { + mCPPComment(true); + theRetToken=_returnToken; + } + else if ((_tokenSet_0.member(LA(1))) && (true)) { + mIDMEAT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='=') && (true)) { + mASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (true)) { + mLT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (true)) { + mGT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (true)) { + mDIV(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='+') && (true)) { + mPLUS(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (true)) { + mMINUS(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='*') && (true)) { + mSTAR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='%') && (true)) { + mMOD(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='!') && (true)) { + mLNOT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='&') && (true)) { + mBAND(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='|') && (true)) { + mBOR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='^') && (true)) { + mBXOR(true); + theRetToken=_returnToken; + } + else { + if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} + else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + } + if ( _returnToken==null ) continue tryAgain; // found SKIP token + _ttype = _returnToken.getType(); + _returnToken.setType(_ttype); + return _returnToken; + } + catch (RecognitionException e) { + throw new TokenStreamRecognitionException(e); + } + } + catch (CharStreamException cse) { + if ( cse instanceof CharStreamIOException ) { + throw new TokenStreamIOException(((CharStreamIOException)cse).io); + } + else { + throw new TokenStreamException(cse.getMessage()); + } + } + } +} + + public final void mWhitespace(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Whitespace; + int _saveIndex; + + { + if ((LA(1)=='\r') && (LA(2)=='\n')) { + match("\r\n"); + if ( inputState.guessing==0 ) { + newline(); + } + } + else if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ')) { + { + switch ( LA(1)) { + case ' ': + { + match(' '); + break; + } + case '\t': + { + match('\t'); + break; + } + case '\u000c': + { + match('\014'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + else if ((LA(1)=='\n'||LA(1)=='\r') && (true)) { + { + switch ( LA(1)) { + case '\n': + { + match('\n'); + break; + } + case '\r': + { + match('\r'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( inputState.guessing==0 ) { + newline(); + } + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + if ( inputState.guessing==0 ) { + _ttype = Token.SKIP; + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mEscape(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Escape; + int _saveIndex; + + match('\\'); + { + switch ( LA(1)) { + case '0': case '1': case '2': case '3': + { + { + matchRange('0','3'); + } + { + _loop327: + do { + if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mDigit(false); + } + else { + break _loop327; + } + + } while (true); + } + break; + } + case '4': case '5': case '6': case '7': + { + { + matchRange('4','7'); + } + { + _loop330: + do { + if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mDigit(false); + } + else { + break _loop330; + } + + } while (true); + } + break; + } + case 'x': + { + match('x'); + { + int _cnt332=0; + _loop332: + do { + if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mDigit(false); + } + else if (((LA(1) >= 'a' && LA(1) <= 'f')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + matchRange('a','f'); + } + else if (((LA(1) >= 'A' && LA(1) <= 'F')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + matchRange('A','F'); + } + else { + if ( _cnt332>=1 ) { break _loop332; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt332++; + } while (true); + } + break; + } + default: + if ((_tokenSet_1.member(LA(1)))) { + { + match(_tokenSet_1); + } + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mDigit(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Digit; + int _saveIndex; + + matchRange('0','9'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mIntSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = IntSuffix; + int _saveIndex; + + switch ( LA(1)) { + case 'L': + { + match('L'); + break; + } + case 'l': + { + match('l'); + break; + } + case 'U': + { + match('U'); + break; + } + case 'u': + { + match('u'); + break; + } + case 'I': + { + match('I'); + break; + } + case 'i': + { + match('i'); + break; + } + case 'J': + { + match('J'); + break; + } + case 'j': + { + match('j'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mNumberSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = NumberSuffix; + int _saveIndex; + + switch ( LA(1)) { + case 'I': case 'J': case 'L': case 'U': + case 'i': case 'j': case 'l': case 'u': + { + mIntSuffix(false); + break; + } + case 'F': + { + match('F'); + break; + } + case 'f': + { + match('f'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mNumber(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Number; + int _saveIndex; + + boolean synPredMatched340 = false; + if ((((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_2.member(LA(2))) && (true))) { + int _m340 = mark(); + synPredMatched340 = true; + inputState.guessing++; + try { + { + { + int _cnt338=0; + _loop338: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + if ( _cnt338>=1 ) { break _loop338; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt338++; + } while (true); + } + { + switch ( LA(1)) { + case '.': + { + match('.'); + break; + } + case 'e': + { + match('e'); + break; + } + case 'E': + { + match('E'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + } + catch (RecognitionException pe) { + synPredMatched340 = false; + } + rewind(_m340); + inputState.guessing--; + } + if ( synPredMatched340 ) { + { + int _cnt342=0; + _loop342: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + if ( _cnt342>=1 ) { break _loop342; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt342++; + } while (true); + } + { + switch ( LA(1)) { + case '.': + { + match('.'); + { + _loop345: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + break _loop345; + } + + } while (true); + } + { + if ((LA(1)=='E'||LA(1)=='e')) { + mExponent(false); + } + else { + } + + } + break; + } + case 'E': case 'e': + { + mExponent(false); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + _loop348: + do { + if ((_tokenSet_3.member(LA(1)))) { + mNumberSuffix(false); + } + else { + break _loop348; + } + + } while (true); + } + } + else { + boolean synPredMatched350 = false; + if (((LA(1)=='.') && (LA(2)=='.'))) { + int _m350 = mark(); + synPredMatched350 = true; + inputState.guessing++; + try { + { + match("..."); + } + } + catch (RecognitionException pe) { + synPredMatched350 = false; + } + rewind(_m350); + inputState.guessing--; + } + if ( synPredMatched350 ) { + match("..."); + if ( inputState.guessing==0 ) { + _ttype = VARARGS; + } + } + else if ((LA(1)=='0') && (LA(2)=='X'||LA(2)=='x')) { + match('0'); + { + switch ( LA(1)) { + case 'x': + { + match('x'); + break; + } + case 'X': + { + match('X'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + int _cnt367=0; + _loop367: + do { + switch ( LA(1)) { + case 'a': case 'b': case 'c': case 'd': + case 'e': case 'f': + { + matchRange('a','f'); + break; + } + case 'A': case 'B': case 'C': case 'D': + case 'E': case 'F': + { + matchRange('A','F'); + break; + } + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + { + mDigit(false); + break; + } + default: + { + if ( _cnt367>=1 ) { break _loop367; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + } + _cnt367++; + } while (true); + } + { + _loop369: + do { + if ((_tokenSet_4.member(LA(1)))) { + mIntSuffix(false); + } + else { + break _loop369; + } + + } while (true); + } + } + else if ((LA(1)=='.') && (true)) { + match('.'); + if ( inputState.guessing==0 ) { + _ttype = DOT; + } + { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + { + int _cnt353=0; + _loop353: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + if ( _cnt353>=1 ) { break _loop353; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt353++; + } while (true); + } + { + if ((LA(1)=='E'||LA(1)=='e')) { + mExponent(false); + } + else { + } + + } + if ( inputState.guessing==0 ) { + _ttype = Number; + } + { + _loop356: + do { + if ((_tokenSet_3.member(LA(1)))) { + mNumberSuffix(false); + } + else { + break _loop356; + } + + } while (true); + } + } + else { + } + + } + } + else if ((LA(1)=='0') && (true) && (true)) { + match('0'); + { + _loop358: + do { + if (((LA(1) >= '0' && LA(1) <= '7'))) { + matchRange('0','7'); + } + else { + break _loop358; + } + + } while (true); + } + { + _loop360: + do { + if ((_tokenSet_3.member(LA(1)))) { + mNumberSuffix(false); + } + else { + break _loop360; + } + + } while (true); + } + } + else if (((LA(1) >= '1' && LA(1) <= '9')) && (true) && (true)) { + matchRange('1','9'); + { + _loop362: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + break _loop362; + } + + } while (true); + } + { + _loop364: + do { + if ((_tokenSet_3.member(LA(1)))) { + mNumberSuffix(false); + } + else { + break _loop364; + } + + } while (true); + } + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mExponent(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Exponent; + int _saveIndex; + + { + switch ( LA(1)) { + case 'e': + { + match('e'); + break; + } + case 'E': + { + match('E'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + switch ( LA(1)) { + case '+': + { + match('+'); + break; + } + case '-': + { + match('-'); + break; + } + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + { + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + int _cnt487=0; + _loop487: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + mDigit(false); + } + else { + if ( _cnt487>=1 ) { break _loop487; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt487++; + } while (true); + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mIDMEAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = IDMEAT; + int _saveIndex; + Token i=null; + + mID(true); + i=_returnToken; + if ( inputState.guessing==0 ) { + + + if ( i.getType() == LITERAL___extension__ ) { + _ttype = Token.SKIP; + } + else { + _ttype = i.getType(); + } + + + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = ID; + int _saveIndex; + + { + switch ( LA(1)) { + case 'a': case 'b': case 'c': case 'd': + case 'e': case 'f': case 'g': case 'h': + case 'i': case 'j': case 'k': case 'l': + case 'm': case 'n': case 'o': case 'p': + case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': + case 'y': case 'z': + { + matchRange('a','z'); + break; + } + case 'A': case 'B': case 'C': case 'D': + case 'E': case 'F': case 'G': case 'H': + case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': + case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': + { + matchRange('A','Z'); + break; + } + case '_': + { + match('_'); + break; + } + case '$': + { + match('$'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + _loop374: + do { + if (((LA(1) >= 'a' && LA(1) <= 'z')) && (true) && (true)) { + matchRange('a','z'); + } + else if (((LA(1) >= 'A' && LA(1) <= 'Z')) && (true) && (true)) { + matchRange('A','Z'); + } + else if ((LA(1)=='_') && (true) && (true)) { + match('_'); + } + else if ((LA(1)=='$') && (true) && (true)) { + match('$'); + } + else if (((LA(1) >= '0' && LA(1) <= '9')) && (true) && (true)) { + matchRange('0','9'); + } + else { + break _loop374; + } + + } while (true); + } + _ttype = testLiteralsTable(new String(text.getBuffer(),_begin,text.length()-_begin),_ttype); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mWideCharLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = WideCharLiteral; + int _saveIndex; + + match('L'); + mCharLiteral(false); + if ( inputState.guessing==0 ) { + _ttype = CharLiteral; + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCharLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = CharLiteral; + int _saveIndex; + + match('\''); + { + if ((LA(1)=='\\') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (_tokenSet_5.member(LA(3)))) { + mEscape(false); + } + else if ((_tokenSet_6.member(LA(1))) && (LA(2)=='\'') && (true)) { + { + match(_tokenSet_6); + } + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + match('\''); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mWideStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = WideStringLiteral; + int _saveIndex; + + match('L'); + mStringLiteral(false); + if ( inputState.guessing==0 ) { + _ttype = StringLiteral; + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = StringLiteral; + int _saveIndex; + + match('"'); + { + _loop384: + do { + boolean synPredMatched381 = false; + if (((LA(1)=='\\') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff')))) { + int _m381 = mark(); + synPredMatched381 = true; + inputState.guessing++; + try { + { + match('\\'); + { + match(_tokenSet_7); + } + } + } + catch (RecognitionException pe) { + synPredMatched381 = false; + } + rewind(_m381); + inputState.guessing--; + } + if ( synPredMatched381 ) { + mEscape(false); + } + else if ((LA(1)=='\n'||LA(1)=='\r'||LA(1)=='\\') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + { + switch ( LA(1)) { + case '\r': + { + match('\r'); + if ( inputState.guessing==0 ) { + newline(); + } + break; + } + case '\n': + { + match('\n'); + if ( inputState.guessing==0 ) { + + newline(); + + } + break; + } + case '\\': + { + match('\\'); + match('\n'); + if ( inputState.guessing==0 ) { + + newline(); + + } + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + else if ((_tokenSet_8.member(LA(1)))) { + { + match(_tokenSet_8); + } + } + else { + break _loop384; + } + + } while (true); + } + match('"'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mVocabulary(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Vocabulary; + int _saveIndex; + + matchRange('\3','\377'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = ASSIGN; + int _saveIndex; + + match('='); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = COLON; + int _saveIndex; + + match(':'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = COMMA; + int _saveIndex; + + match(','); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mQUESTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = QUESTION; + int _saveIndex; + + match('?'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = SEMI; + int _saveIndex; + + match(';'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mPTR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = PTR; + int _saveIndex; + + match("->"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DOT; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mVARARGS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = VARARGS; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LPAREN; + int _saveIndex; + + match('('); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RPAREN; + int _saveIndex; + + match(')'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LBRACKET; + int _saveIndex; + + match('['); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RBRACKET; + int _saveIndex; + + match(']'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LCURLY; + int _saveIndex; + + match('{'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RCURLY; + int _saveIndex; + + match('}'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mEQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = EQUAL; + int _saveIndex; + + match("=="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mNOT_EQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = NOT_EQUAL; + int _saveIndex; + + match("!="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LTE; + int _saveIndex; + + match("<="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LT; + int _saveIndex; + + match("<"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mGTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = GTE; + int _saveIndex; + + match(">="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = GT; + int _saveIndex; + + match(">"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mDIV(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DIV; + int _saveIndex; + + match('/'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mDIV_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DIV_ASSIGN; + int _saveIndex; + + match("/="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = PLUS; + int _saveIndex; + + match('+'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mPLUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = PLUS_ASSIGN; + int _saveIndex; + + match("+="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mINC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = INC; + int _saveIndex; + + match("++"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MINUS; + int _saveIndex; + + match('-'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMINUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MINUS_ASSIGN; + int _saveIndex; + + match("-="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mDEC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DEC; + int _saveIndex; + + match("--"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = STAR; + int _saveIndex; + + match('*'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSTAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = STAR_ASSIGN; + int _saveIndex; + + match("*="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMOD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MOD; + int _saveIndex; + + match('%'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMOD_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MOD_ASSIGN; + int _saveIndex; + + match("%="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRSHIFT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RSHIFT; + int _saveIndex; + + match(">>"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRSHIFT_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RSHIFT_ASSIGN; + int _saveIndex; + + match(">>="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLSHIFT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LSHIFT; + int _saveIndex; + + match("<<"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLSHIFT_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LSHIFT_ASSIGN; + int _saveIndex; + + match("<<="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LAND; + int _saveIndex; + + match("&&"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LNOT; + int _saveIndex; + + match('!'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LOR; + int _saveIndex; + + match("||"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BAND; + int _saveIndex; + + match('&'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBAND_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BAND_ASSIGN; + int _saveIndex; + + match("&="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BNOT; + int _saveIndex; + + match('~'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BOR; + int _saveIndex; + + match('|'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BOR_ASSIGN; + int _saveIndex; + + match("|="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBXOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BXOR; + int _saveIndex; + + match('^'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBXOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BXOR_ASSIGN; + int _saveIndex; + + match("^="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mComment(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Comment; + int _saveIndex; + + match("/*"); + { + _loop436: + do { + if (((LA(1)=='*') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff')))&&( LA(2) != '/' )) { + match('*'); + } + else if ((LA(1)=='\r') && (LA(2)=='\n') && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { + match("\r\n"); + if ( inputState.guessing==0 ) { + deferredNewline(); + } + } + else if ((LA(1)=='\n'||LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { + { + switch ( LA(1)) { + case '\r': + { + match('\r'); + break; + } + case '\n': + { + match('\n'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( inputState.guessing==0 ) { + deferredNewline(); + } + } + else if ((_tokenSet_9.member(LA(1)))) { + { + match(_tokenSet_9); + } + } + else { + break _loop436; + } + + } while (true); + } + match("*/"); + if ( inputState.guessing==0 ) { + _ttype = Token.SKIP; + + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCPPComment(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = CPPComment; + int _saveIndex; + + match("//"); + { + _loop440: + do { + if ((_tokenSet_7.member(LA(1)))) { + { + match(_tokenSet_7); + } + } + else { + break _loop440; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + + _ttype = Token.SKIP; + + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mPREPROC_DIRECTIVE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = PREPROC_DIRECTIVE; + int _saveIndex; + + match('#'); + { + boolean synPredMatched447 = false; + if (((_tokenSet_10.member(LA(1))) && (_tokenSet_11.member(LA(2))) && (_tokenSet_12.member(LA(3))))) { + int _m447 = mark(); + synPredMatched447 = true; + inputState.guessing++; + try { + { + switch ( LA(1)) { + case 'l': + { + match("line"); + break; + } + case '\t': case '\u000c': case ' ': + { + { + { + int _cnt446=0; + _loop446: + do { + switch ( LA(1)) { + case ' ': + { + match(' '); + break; + } + case '\t': + { + match('\t'); + break; + } + case '\u000c': + { + match('\014'); + break; + } + default: + { + if ( _cnt446>=1 ) { break _loop446; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + } + _cnt446++; + } while (true); + } + matchRange('0','9'); + } + break; + } + default: + { + } + } + } + } + catch (RecognitionException pe) { + synPredMatched447 = false; + } + rewind(_m447); + inputState.guessing--; + } + if ( synPredMatched447 ) { + mLineDirective(false); + } + else { + { + _loop449: + do { + if ((_tokenSet_7.member(LA(1)))) { + matchNot('\n'); + } + else { + break _loop449; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + setPreprocessingDirective(getText()); + } + } + + } + if ( inputState.guessing==0 ) { + + _ttype = Token.SKIP; + + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLineDirective(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LineDirective; + int _saveIndex; + Token n=null; + Token fn=null; + Token fi=null; + + boolean oldCountingTokens = countingTokens; + countingTokens = false; + + + if ( inputState.guessing==0 ) { + + lineObject = new LineObject(); + deferredLineCount = 0; + + } + { + switch ( LA(1)) { + case 'l': + { + match("line"); + break; + } + case '\t': case '\u000c': case ' ': + { + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + int _cnt455=0; + _loop455: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ')) { + mSpace(false); + } + else { + if ( _cnt455>=1 ) { break _loop455; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt455++; + } while (true); + } + mNumber(true); + n=_returnToken; + if ( inputState.guessing==0 ) { + lineObject.setLine(Integer.parseInt(n.getText())); + } + { + int _cnt457=0; + _loop457: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mSpace(false); + } + else { + if ( _cnt457>=1 ) { break _loop457; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt457++; + } while (true); + } + { + if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) { + mStringLiteral(true); + fn=_returnToken; + if ( inputState.guessing==0 ) { + try { + lineObject.setSource(fn.getText().substring(1,fn.getText().length()-1)); + } + catch (StringIndexOutOfBoundsException e) { /*not possible*/ } + + } + } + else if ((_tokenSet_0.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mID(true); + fi=_returnToken; + if ( inputState.guessing==0 ) { + lineObject.setSource(fi.getText()); + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + { + _loop460: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mSpace(false); + } + else { + break _loop460; + } + + } while (true); + } + { + if ((LA(1)=='1') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + match("1"); + if ( inputState.guessing==0 ) { + lineObject.setEnteringFile(true); + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + { + _loop463: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mSpace(false); + } + else { + break _loop463; + } + + } while (true); + } + { + if ((LA(1)=='2') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + match("2"); + if ( inputState.guessing==0 ) { + lineObject.setReturningToFile(true); + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + { + _loop466: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mSpace(false); + } + else { + break _loop466; + } + + } while (true); + } + { + if ((LA(1)=='3') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + match("3"); + if ( inputState.guessing==0 ) { + lineObject.setSystemHeader(true); + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + { + _loop469: + do { + if ((LA(1)=='\t'||LA(1)=='\u000c'||LA(1)==' ') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + mSpace(false); + } + else { + break _loop469; + } + + } while (true); + } + { + if ((LA(1)=='4') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) { + match("4"); + if ( inputState.guessing==0 ) { + lineObject.setTreatAsC(true); + } + } + else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + { + _loop473: + do { + if ((_tokenSet_13.member(LA(1)))) { + { + match(_tokenSet_13); + } + } + else { + break _loop473; + } + + } while (true); + } + { + if ((LA(1)=='\r') && (LA(2)=='\n')) { + match("\r\n"); + } + else if ((LA(1)=='\r') && (true)) { + match("\r"); + } + else if ((LA(1)=='\n')) { + match("\n"); + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + if ( inputState.guessing==0 ) { + + preprocessorInfoChannel.addLineForTokenNumber(new LineObject(lineObject), new Integer(tokenNumber)); + countingTokens = oldCountingTokens; + + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mSpace(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = Space; + int _saveIndex; + + { + switch ( LA(1)) { + case ' ': + { + match(' '); + break; + } + case '\t': + { + match('\t'); + break; + } + case '\u000c': + { + match('\014'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mBadStringLiteral(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BadStringLiteral; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLongSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LongSuffix; + int _saveIndex; + + switch ( LA(1)) { + case 'l': + { + match('l'); + break; + } + case 'L': + { + match('L'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mUnsignedSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = UnsignedSuffix; + int _saveIndex; + + switch ( LA(1)) { + case 'u': + { + match('u'); + break; + } + case 'U': + { + match('U'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mFloatSuffix(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = FloatSuffix; + int _saveIndex; + + switch ( LA(1)) { + case 'f': + { + match('f'); + break; + } + case 'F': + { + match('F'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mDoubleDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DoubleDoubleConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mFloatDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = FloatDoubleConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLongDoubleConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LongDoubleConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mIntOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = IntOctalConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLongOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LongOctalConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mUnsignedOctalConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = UnsignedOctalConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mIntIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = IntIntConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLongIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LongIntConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mUnsignedIntConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = UnsignedIntConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mIntHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = IntHexConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mLongHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LongHexConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mUnsignedHexConst(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = UnsignedHexConst; + int _saveIndex; + + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + + private static final long[] mk_tokenSet_0() { + long[] data = { 68719476736L, 576460745995190270L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); + private static final long[] mk_tokenSet_1() { + long[] data = new long[8]; + data[0]=-71776119061217288L; + data[1]=-72057594037927937L; + for (int i = 2; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); + private static final long[] mk_tokenSet_2() { + long[] data = { 288019269919178752L, 137438953504L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); + private static final long[] mk_tokenSet_3() { + long[] data = { 0L, 9031663390561856L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); + private static final long[] mk_tokenSet_4() { + long[] data = { 0L, 9031388512654848L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); + private static final long[] mk_tokenSet_5() { + long[] data = { 287949450930814976L, 541165879422L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); + private static final long[] mk_tokenSet_6() { + long[] data = new long[8]; + data[0]=-549755813896L; + for (int i = 1; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6()); + private static final long[] mk_tokenSet_7() { + long[] data = new long[8]; + data[0]=-1032L; + for (int i = 1; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7()); + private static final long[] mk_tokenSet_8() { + long[] data = new long[8]; + data[0]=-17179878408L; + data[1]=-268435457L; + for (int i = 2; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8()); + private static final long[] mk_tokenSet_9() { + long[] data = new long[8]; + data[0]=-4398046520328L; + for (int i = 1; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9()); + private static final long[] mk_tokenSet_10() { + long[] data = { 4294971904L, 17592186044416L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10()); + private static final long[] mk_tokenSet_11() { + long[] data = { 288019274214150656L, 2199023255552L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11()); + private static final long[] mk_tokenSet_12() { + long[] data = { 288019274214150656L, 81159763628398176L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); + private static final long[] mk_tokenSet_13() { + long[] data = new long[8]; + data[0]=-9224L; + for (int i = 1; i<=3; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13()); + + } diff --git a/app/preproc/WLexerTokenTypes.java b/app/preproc/WLexerTokenTypes.java index a78628275..c9eb47159 100644 --- a/app/preproc/WLexerTokenTypes.java +++ b/app/preproc/WLexerTokenTypes.java @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "expandedWParser.g" -> "WLexer.java"$ +// $ANTLR 2.7.2: "expandedWParser.g" -> "WLexer.java"$ package processing.app.preproc; @@ -6,163 +6,163 @@ import java.io.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -public interface WLexerTokenTypes { - int EOF = 1; - int NULL_TREE_LOOKAHEAD = 3; - int LITERAL_typedef = 4; - int LITERAL_asm = 5; - int LITERAL_volatile = 6; - int LCURLY = 7; - int RCURLY = 8; - int SEMI = 9; - int LITERAL_struct = 10; - int LITERAL_union = 11; - int LITERAL_enum = 12; - int LITERAL_auto = 13; - int LITERAL_register = 14; - int LITERAL_extern = 15; - int LITERAL_static = 16; - int LITERAL_const = 17; - int LITERAL_void = 18; - int LITERAL_char = 19; - int LITERAL_short = 20; - int LITERAL_int = 21; - int LITERAL_long = 22; - int LITERAL_float = 23; - int LITERAL_double = 24; - int LITERAL_signed = 25; - int LITERAL_unsigned = 26; - int ID = 27; - int COMMA = 28; - int COLON = 29; - int ASSIGN = 30; - int STAR = 31; - int LPAREN = 32; - int RPAREN = 33; - int LBRACKET = 34; - int RBRACKET = 35; - int VARARGS = 36; - int LITERAL_while = 37; - int LITERAL_do = 38; - int LITERAL_for = 39; - int LITERAL_goto = 40; - int LITERAL_continue = 41; - int LITERAL_break = 42; - int LITERAL_return = 43; - int LITERAL_case = 44; - int LITERAL_default = 45; - int LITERAL_if = 46; - int LITERAL_else = 47; - int LITERAL_switch = 48; - int DIV_ASSIGN = 49; - int PLUS_ASSIGN = 50; - int MINUS_ASSIGN = 51; - int STAR_ASSIGN = 52; - int MOD_ASSIGN = 53; - int RSHIFT_ASSIGN = 54; - int LSHIFT_ASSIGN = 55; - int BAND_ASSIGN = 56; - int BOR_ASSIGN = 57; - int BXOR_ASSIGN = 58; - int QUESTION = 59; - int LOR = 60; - int LAND = 61; - int BOR = 62; - int BXOR = 63; - int BAND = 64; - int EQUAL = 65; - int NOT_EQUAL = 66; - int LT = 67; - int LTE = 68; - int GT = 69; - int GTE = 70; - int LSHIFT = 71; - int RSHIFT = 72; - int PLUS = 73; - int MINUS = 74; - int DIV = 75; - int MOD = 76; - int INC = 77; - int DEC = 78; - int LITERAL_sizeof = 79; - int BNOT = 80; - int LNOT = 81; - int PTR = 82; - int DOT = 83; - int CharLiteral = 84; - int StringLiteral = 85; - int IntOctalConst = 86; - int LongOctalConst = 87; - int UnsignedOctalConst = 88; - int IntIntConst = 89; - int LongIntConst = 90; - int UnsignedIntConst = 91; - int IntHexConst = 92; - int LongHexConst = 93; - int UnsignedHexConst = 94; - int FloatDoubleConst = 95; - int DoubleDoubleConst = 96; - int LongDoubleConst = 97; - int NTypedefName = 98; - int NInitDecl = 99; - int NDeclarator = 100; - int NStructDeclarator = 101; - int NDeclaration = 102; - int NCast = 103; - int NPointerGroup = 104; - int NExpressionGroup = 105; - int NFunctionCallArgs = 106; - int NNonemptyAbstractDeclarator = 107; - int NInitializer = 108; - int NStatementExpr = 109; - int NEmptyExpression = 110; - int NParameterTypeList = 111; - int NFunctionDef = 112; - int NCompoundStatement = 113; - int NParameterDeclaration = 114; - int NCommaExpr = 115; - int NUnaryExpr = 116; - int NLabel = 117; - int NPostfixExpr = 118; - int NRangeExpr = 119; - int NStringSeq = 120; - int NInitializerElementLabel = 121; - int NLcurlyInitializer = 122; - int NAsmAttribute = 123; - int NGnuAsmExpr = 124; - int NTypeMissing = 125; - int Vocabulary = 126; - int Whitespace = 127; - int Comment = 128; - int CPPComment = 129; - int PREPROC_DIRECTIVE = 130; - int Space = 131; - int LineDirective = 132; - int BadStringLiteral = 133; - int Escape = 134; - int Digit = 135; - int LongSuffix = 136; - int UnsignedSuffix = 137; - int FloatSuffix = 138; - int Exponent = 139; - int Number = 140; - int LITERAL___label__ = 141; - int LITERAL_inline = 142; - int LITERAL_byte = 143; - int LITERAL_boolean = 144; - int LITERAL_Servo = 145; - int LITERAL_Wire = 146; - int LITERAL_typeof = 147; - int LITERAL___complex = 148; - int LITERAL___attribute = 149; - int LITERAL___alignof = 150; - int LITERAL___real = 151; - int LITERAL___imag = 152; - int LITERAL___extension__ = 153; - int IntSuffix = 154; - int NumberSuffix = 155; - int IDMEAT = 156; - int WideCharLiteral = 157; - int WideStringLiteral = 158; -} + +public interface WLexerTokenTypes { + int EOF = 1; + int NULL_TREE_LOOKAHEAD = 3; + int LITERAL_typedef = 4; + int LITERAL_asm = 5; + int LITERAL_volatile = 6; + int LCURLY = 7; + int RCURLY = 8; + int SEMI = 9; + int LITERAL_struct = 10; + int LITERAL_union = 11; + int LITERAL_enum = 12; + int LITERAL_auto = 13; + int LITERAL_register = 14; + int LITERAL_extern = 15; + int LITERAL_static = 16; + int LITERAL_const = 17; + int LITERAL_void = 18; + int LITERAL_char = 19; + int LITERAL_short = 20; + int LITERAL_int = 21; + int LITERAL_long = 22; + int LITERAL_float = 23; + int LITERAL_double = 24; + int LITERAL_signed = 25; + int LITERAL_unsigned = 26; + int ID = 27; + int COMMA = 28; + int COLON = 29; + int ASSIGN = 30; + int STAR = 31; + int LPAREN = 32; + int RPAREN = 33; + int LBRACKET = 34; + int RBRACKET = 35; + int VARARGS = 36; + int LITERAL_while = 37; + int LITERAL_do = 38; + int LITERAL_for = 39; + int LITERAL_goto = 40; + int LITERAL_continue = 41; + int LITERAL_break = 42; + int LITERAL_return = 43; + int LITERAL_case = 44; + int LITERAL_default = 45; + int LITERAL_if = 46; + int LITERAL_else = 47; + int LITERAL_switch = 48; + int DIV_ASSIGN = 49; + int PLUS_ASSIGN = 50; + int MINUS_ASSIGN = 51; + int STAR_ASSIGN = 52; + int MOD_ASSIGN = 53; + int RSHIFT_ASSIGN = 54; + int LSHIFT_ASSIGN = 55; + int BAND_ASSIGN = 56; + int BOR_ASSIGN = 57; + int BXOR_ASSIGN = 58; + int QUESTION = 59; + int LOR = 60; + int LAND = 61; + int BOR = 62; + int BXOR = 63; + int BAND = 64; + int EQUAL = 65; + int NOT_EQUAL = 66; + int LT = 67; + int LTE = 68; + int GT = 69; + int GTE = 70; + int LSHIFT = 71; + int RSHIFT = 72; + int PLUS = 73; + int MINUS = 74; + int DIV = 75; + int MOD = 76; + int INC = 77; + int DEC = 78; + int LITERAL_sizeof = 79; + int BNOT = 80; + int LNOT = 81; + int PTR = 82; + int DOT = 83; + int CharLiteral = 84; + int StringLiteral = 85; + int IntOctalConst = 86; + int LongOctalConst = 87; + int UnsignedOctalConst = 88; + int IntIntConst = 89; + int LongIntConst = 90; + int UnsignedIntConst = 91; + int IntHexConst = 92; + int LongHexConst = 93; + int UnsignedHexConst = 94; + int FloatDoubleConst = 95; + int DoubleDoubleConst = 96; + int LongDoubleConst = 97; + int NTypedefName = 98; + int NInitDecl = 99; + int NDeclarator = 100; + int NStructDeclarator = 101; + int NDeclaration = 102; + int NCast = 103; + int NPointerGroup = 104; + int NExpressionGroup = 105; + int NFunctionCallArgs = 106; + int NNonemptyAbstractDeclarator = 107; + int NInitializer = 108; + int NStatementExpr = 109; + int NEmptyExpression = 110; + int NParameterTypeList = 111; + int NFunctionDef = 112; + int NCompoundStatement = 113; + int NParameterDeclaration = 114; + int NCommaExpr = 115; + int NUnaryExpr = 116; + int NLabel = 117; + int NPostfixExpr = 118; + int NRangeExpr = 119; + int NStringSeq = 120; + int NInitializerElementLabel = 121; + int NLcurlyInitializer = 122; + int NAsmAttribute = 123; + int NGnuAsmExpr = 124; + int NTypeMissing = 125; + int Vocabulary = 126; + int Whitespace = 127; + int Comment = 128; + int CPPComment = 129; + int PREPROC_DIRECTIVE = 130; + int Space = 131; + int LineDirective = 132; + int BadStringLiteral = 133; + int Escape = 134; + int Digit = 135; + int LongSuffix = 136; + int UnsignedSuffix = 137; + int FloatSuffix = 138; + int Exponent = 139; + int Number = 140; + int LITERAL___label__ = 141; + int LITERAL_inline = 142; + int LITERAL_byte = 143; + int LITERAL_boolean = 144; + int LITERAL_Servo = 145; + int LITERAL_Wire = 146; + int LITERAL_typeof = 147; + int LITERAL___complex = 148; + int LITERAL___attribute = 149; + int LITERAL___alignof = 150; + int LITERAL___real = 151; + int LITERAL___imag = 152; + int LITERAL___extension__ = 153; + int IntSuffix = 154; + int NumberSuffix = 155; + int IDMEAT = 156; + int WideCharLiteral = 157; + int WideStringLiteral = 158; +} diff --git a/app/preproc/WLexerTokenTypes.txt b/app/preproc/WLexerTokenTypes.txt index f91075fc5..ed1cc1589 100644 --- a/app/preproc/WLexerTokenTypes.txt +++ b/app/preproc/WLexerTokenTypes.txt @@ -1,157 +1,157 @@ -// $ANTLR 2.7.2: expandedWParser.g -> WLexerTokenTypes.txt$ -WLexer // output token vocab name -LITERAL_typedef="typedef"=4 -LITERAL_asm="asm"=5 -LITERAL_volatile="volatile"=6 -LCURLY=7 -RCURLY=8 -SEMI=9 -LITERAL_struct="struct"=10 -LITERAL_union="union"=11 -LITERAL_enum="enum"=12 -LITERAL_auto="auto"=13 -LITERAL_register="register"=14 -LITERAL_extern="extern"=15 -LITERAL_static="static"=16 -LITERAL_const="const"=17 -LITERAL_void="void"=18 -LITERAL_char="char"=19 -LITERAL_short="short"=20 -LITERAL_int="int"=21 -LITERAL_long="long"=22 -LITERAL_float="float"=23 -LITERAL_double="double"=24 -LITERAL_signed="signed"=25 -LITERAL_unsigned="unsigned"=26 -ID=27 -COMMA=28 -COLON=29 -ASSIGN=30 -STAR=31 -LPAREN=32 -RPAREN=33 -LBRACKET=34 -RBRACKET=35 -VARARGS=36 -LITERAL_while="while"=37 -LITERAL_do="do"=38 -LITERAL_for="for"=39 -LITERAL_goto="goto"=40 -LITERAL_continue="continue"=41 -LITERAL_break="break"=42 -LITERAL_return="return"=43 -LITERAL_case="case"=44 -LITERAL_default="default"=45 -LITERAL_if="if"=46 -LITERAL_else="else"=47 -LITERAL_switch="switch"=48 -DIV_ASSIGN=49 -PLUS_ASSIGN=50 -MINUS_ASSIGN=51 -STAR_ASSIGN=52 -MOD_ASSIGN=53 -RSHIFT_ASSIGN=54 -LSHIFT_ASSIGN=55 -BAND_ASSIGN=56 -BOR_ASSIGN=57 -BXOR_ASSIGN=58 -QUESTION=59 -LOR=60 -LAND=61 -BOR=62 -BXOR=63 -BAND=64 -EQUAL=65 -NOT_EQUAL=66 -LT=67 -LTE=68 -GT=69 -GTE=70 -LSHIFT=71 -RSHIFT=72 -PLUS=73 -MINUS=74 -DIV=75 -MOD=76 -INC=77 -DEC=78 -LITERAL_sizeof="sizeof"=79 -BNOT=80 -LNOT=81 -PTR=82 -DOT=83 -CharLiteral=84 -StringLiteral=85 -IntOctalConst=86 -LongOctalConst=87 -UnsignedOctalConst=88 -IntIntConst=89 -LongIntConst=90 -UnsignedIntConst=91 -IntHexConst=92 -LongHexConst=93 -UnsignedHexConst=94 -FloatDoubleConst=95 -DoubleDoubleConst=96 -LongDoubleConst=97 -NTypedefName=98 -NInitDecl=99 -NDeclarator=100 -NStructDeclarator=101 -NDeclaration=102 -NCast=103 -NPointerGroup=104 -NExpressionGroup=105 -NFunctionCallArgs=106 -NNonemptyAbstractDeclarator=107 -NInitializer=108 -NStatementExpr=109 -NEmptyExpression=110 -NParameterTypeList=111 -NFunctionDef=112 -NCompoundStatement=113 -NParameterDeclaration=114 -NCommaExpr=115 -NUnaryExpr=116 -NLabel=117 -NPostfixExpr=118 -NRangeExpr=119 -NStringSeq=120 -NInitializerElementLabel=121 -NLcurlyInitializer=122 -NAsmAttribute=123 -NGnuAsmExpr=124 -NTypeMissing=125 -Vocabulary=126 -Whitespace=127 -Comment=128 -CPPComment=129 -PREPROC_DIRECTIVE("a line directive")=130 -Space=131 -LineDirective=132 -BadStringLiteral=133 -Escape=134 -Digit=135 -LongSuffix=136 -UnsignedSuffix=137 -FloatSuffix=138 -Exponent=139 -Number=140 -LITERAL___label__="__label__"=141 -LITERAL_inline="inline"=142 -LITERAL_byte="byte"=143 -LITERAL_boolean="boolean"=144 -LITERAL_Servo="Servo"=145 -LITERAL_Wire="Wire"=146 -LITERAL_typeof="typeof"=147 -LITERAL___complex="__complex"=148 -LITERAL___attribute="__attribute"=149 -LITERAL___alignof="__alignof"=150 -LITERAL___real="__real"=151 -LITERAL___imag="__imag"=152 -LITERAL___extension__="__extension__"=153 -IntSuffix=154 -NumberSuffix=155 -IDMEAT=156 -WideCharLiteral=157 -WideStringLiteral=158 +// $ANTLR 2.7.2: expandedWParser.g -> WLexerTokenTypes.txt$ +WLexer // output token vocab name +LITERAL_typedef="typedef"=4 +LITERAL_asm="asm"=5 +LITERAL_volatile="volatile"=6 +LCURLY=7 +RCURLY=8 +SEMI=9 +LITERAL_struct="struct"=10 +LITERAL_union="union"=11 +LITERAL_enum="enum"=12 +LITERAL_auto="auto"=13 +LITERAL_register="register"=14 +LITERAL_extern="extern"=15 +LITERAL_static="static"=16 +LITERAL_const="const"=17 +LITERAL_void="void"=18 +LITERAL_char="char"=19 +LITERAL_short="short"=20 +LITERAL_int="int"=21 +LITERAL_long="long"=22 +LITERAL_float="float"=23 +LITERAL_double="double"=24 +LITERAL_signed="signed"=25 +LITERAL_unsigned="unsigned"=26 +ID=27 +COMMA=28 +COLON=29 +ASSIGN=30 +STAR=31 +LPAREN=32 +RPAREN=33 +LBRACKET=34 +RBRACKET=35 +VARARGS=36 +LITERAL_while="while"=37 +LITERAL_do="do"=38 +LITERAL_for="for"=39 +LITERAL_goto="goto"=40 +LITERAL_continue="continue"=41 +LITERAL_break="break"=42 +LITERAL_return="return"=43 +LITERAL_case="case"=44 +LITERAL_default="default"=45 +LITERAL_if="if"=46 +LITERAL_else="else"=47 +LITERAL_switch="switch"=48 +DIV_ASSIGN=49 +PLUS_ASSIGN=50 +MINUS_ASSIGN=51 +STAR_ASSIGN=52 +MOD_ASSIGN=53 +RSHIFT_ASSIGN=54 +LSHIFT_ASSIGN=55 +BAND_ASSIGN=56 +BOR_ASSIGN=57 +BXOR_ASSIGN=58 +QUESTION=59 +LOR=60 +LAND=61 +BOR=62 +BXOR=63 +BAND=64 +EQUAL=65 +NOT_EQUAL=66 +LT=67 +LTE=68 +GT=69 +GTE=70 +LSHIFT=71 +RSHIFT=72 +PLUS=73 +MINUS=74 +DIV=75 +MOD=76 +INC=77 +DEC=78 +LITERAL_sizeof="sizeof"=79 +BNOT=80 +LNOT=81 +PTR=82 +DOT=83 +CharLiteral=84 +StringLiteral=85 +IntOctalConst=86 +LongOctalConst=87 +UnsignedOctalConst=88 +IntIntConst=89 +LongIntConst=90 +UnsignedIntConst=91 +IntHexConst=92 +LongHexConst=93 +UnsignedHexConst=94 +FloatDoubleConst=95 +DoubleDoubleConst=96 +LongDoubleConst=97 +NTypedefName=98 +NInitDecl=99 +NDeclarator=100 +NStructDeclarator=101 +NDeclaration=102 +NCast=103 +NPointerGroup=104 +NExpressionGroup=105 +NFunctionCallArgs=106 +NNonemptyAbstractDeclarator=107 +NInitializer=108 +NStatementExpr=109 +NEmptyExpression=110 +NParameterTypeList=111 +NFunctionDef=112 +NCompoundStatement=113 +NParameterDeclaration=114 +NCommaExpr=115 +NUnaryExpr=116 +NLabel=117 +NPostfixExpr=118 +NRangeExpr=119 +NStringSeq=120 +NInitializerElementLabel=121 +NLcurlyInitializer=122 +NAsmAttribute=123 +NGnuAsmExpr=124 +NTypeMissing=125 +Vocabulary=126 +Whitespace=127 +Comment=128 +CPPComment=129 +PREPROC_DIRECTIVE("a line directive")=130 +Space=131 +LineDirective=132 +BadStringLiteral=133 +Escape=134 +Digit=135 +LongSuffix=136 +UnsignedSuffix=137 +FloatSuffix=138 +Exponent=139 +Number=140 +LITERAL___label__="__label__"=141 +LITERAL_inline="inline"=142 +LITERAL_byte="byte"=143 +LITERAL_boolean="boolean"=144 +LITERAL_Servo="Servo"=145 +LITERAL_Wire="Wire"=146 +LITERAL_typeof="typeof"=147 +LITERAL___complex="__complex"=148 +LITERAL___attribute="__attribute"=149 +LITERAL___alignof="__alignof"=150 +LITERAL___real="__real"=151 +LITERAL___imag="__imag"=152 +LITERAL___extension__="__extension__"=153 +IntSuffix=154 +NumberSuffix=155 +IDMEAT=156 +WideCharLiteral=157 +WideStringLiteral=158 diff --git a/app/preproc/WParser.java b/app/preproc/WParser.java index b022e83c2..7af46be37 100644 --- a/app/preproc/WParser.java +++ b/app/preproc/WParser.java @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "expandedWParser.g" -> "WParser.java"$ +// $ANTLR 2.7.2: "expandedWParser.g" -> "WParser.java"$ package processing.app.preproc; @@ -6,28 +6,28 @@ import java.io.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -import antlr.TokenBuffer; -import antlr.TokenStreamException; -import antlr.TokenStreamIOException; -import antlr.ANTLRException; -import antlr.LLkParser; -import antlr.Token; -import antlr.TokenStream; -import antlr.RecognitionException; -import antlr.NoViableAltException; -import antlr.MismatchedTokenException; -import antlr.SemanticException; -import antlr.ParserSharedInputState; -import antlr.collections.impl.BitSet; -import antlr.collections.AST; -import java.util.Hashtable; -import antlr.ASTFactory; -import antlr.ASTPair; -import antlr.collections.impl.ASTArray; - -public class WParser extends antlr.LLkParser implements WTokenTypes - { + +import antlr.TokenBuffer; +import antlr.TokenStreamException; +import antlr.TokenStreamIOException; +import antlr.ANTLRException; +import antlr.LLkParser; +import antlr.Token; +import antlr.TokenStream; +import antlr.RecognitionException; +import antlr.NoViableAltException; +import antlr.MismatchedTokenException; +import antlr.SemanticException; +import antlr.ParserSharedInputState; +import antlr.collections.impl.BitSet; +import antlr.collections.AST; +import java.util.Hashtable; +import antlr.ASTFactory; +import antlr.ASTPair; +import antlr.collections.impl.ASTArray; + +public class WParser extends antlr.LLkParser implements WTokenTypes + { // Suppport C++-style single-line comments? public static boolean CPPComments = true; @@ -134,6585 +134,6585 @@ public class WParser extends antlr.LLkParser implements WTokenTypes traceDepth -= 1; } - -protected WParser(TokenBuffer tokenBuf, int k) { - super(tokenBuf,k); - tokenNames = _tokenNames; - buildTokenTypeASTClassMap(); - astFactory = new ASTFactory(getTokenTypeToASTClassMap()); -} - -public WParser(TokenBuffer tokenBuf) { - this(tokenBuf,2); -} - -protected WParser(TokenStream lexer, int k) { - super(lexer,k); - tokenNames = _tokenNames; - buildTokenTypeASTClassMap(); - astFactory = new ASTFactory(getTokenTypeToASTClassMap()); -} - -public WParser(TokenStream lexer) { - this(lexer,2); -} - -public WParser(ParserSharedInputState state) { - super(state,2); - tokenNames = _tokenNames; - buildTokenTypeASTClassMap(); - astFactory = new ASTFactory(getTokenTypeToASTClassMap()); -} - - public final void translationUnit() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode translationUnit_AST = null; - - { - switch ( LA(1)) { - case LITERAL_typedef: - case LITERAL_asm: - case LITERAL_volatile: - case SEMI: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_auto: - case LITERAL_register: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case ID: - case STAR: - case LPAREN: - case LITERAL_inline: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - externalList(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case EOF: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - translationUnit_AST = (TNode)currentAST.root; - returnAST = translationUnit_AST; - } - - public final void externalList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode externalList_AST = null; - - { - int _cnt209=0; - _loop209: - do { - if ((_tokenSet_0.member(LA(1)))) { - externalDef(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt209>=1 ) { break _loop209; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt209++; - } while (true); - } - externalList_AST = (TNode)currentAST.root; - returnAST = externalList_AST; - } - - public final void asm_expr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode asm_expr_AST = null; - - TNode tmp1_AST = null; - tmp1_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp1_AST); - match(LITERAL_asm); - { - switch ( LA(1)) { - case LITERAL_volatile: - { - TNode tmp2_AST = null; - tmp2_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp2_AST); - match(LITERAL_volatile); - break; - } - case LCURLY: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp3_AST = null; - tmp3_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp3_AST); - match(LCURLY); - expr(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp4_AST = null; - tmp4_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp4_AST); - match(RCURLY); - { - int _cnt6=0; - _loop6: - do { - if ((LA(1)==SEMI) && (_tokenSet_1.member(LA(2)))) { - TNode tmp5_AST = null; - tmp5_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp5_AST); - match(SEMI); - } - else { - if ( _cnt6>=1 ) { break _loop6; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt6++; - } while (true); - } - asm_expr_AST = (TNode)currentAST.root; - returnAST = asm_expr_AST; - } - - public final void expr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode expr_AST = null; - Token c = null; - TNode c_AST = null; - - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop259: - do { - if ((LA(1)==COMMA) && (_tokenSet_2.member(LA(2)))) { - c = LT(1); - c_AST = (TNode)astFactory.create(c); - astFactory.makeASTRoot(currentAST, c_AST); - match(COMMA); - if ( inputState.guessing==0 ) { - c_AST.setType(NCommaExpr); - } - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop259; - } - - } while (true); - } - expr_AST = (TNode)currentAST.root; - returnAST = expr_AST; - } - - public final void idList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode idList_AST = null; - - TNode tmp6_AST = null; - tmp6_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp6_AST); - match(ID); - { - _loop9: - do { - if ((LA(1)==COMMA) && (LA(2)==ID)) { - TNode tmp7_AST = null; - tmp7_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp7_AST); - match(COMMA); - TNode tmp8_AST = null; - tmp8_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp8_AST); - match(ID); - } - else { - break _loop9; - } - - } while (true); - } - idList_AST = (TNode)currentAST.root; - returnAST = idList_AST; - } - - public final void externalDef() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode externalDef_AST = null; - - switch ( LA(1)) { - case LITERAL_asm: - { - asm_expr(); - astFactory.addASTChild(currentAST, returnAST); - externalDef_AST = (TNode)currentAST.root; - break; - } - case SEMI: - { - TNode tmp9_AST = null; - tmp9_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp9_AST); - match(SEMI); - externalDef_AST = (TNode)currentAST.root; - break; - } - default: - boolean synPredMatched12 = false; - if (((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2))))) { - int _m12 = mark(); - synPredMatched12 = true; - inputState.guessing++; - try { - { - if ((LA(1)==LITERAL_typedef) && (true)) { - match(LITERAL_typedef); - } - else if ((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2)))) { - declaration(); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - } - catch (RecognitionException pe) { - synPredMatched12 = false; - } - rewind(_m12); - inputState.guessing--; - } - if ( synPredMatched12 ) { - declaration(); - astFactory.addASTChild(currentAST, returnAST); - externalDef_AST = (TNode)currentAST.root; - } - else { - boolean synPredMatched14 = false; - if (((_tokenSet_5.member(LA(1))) && (_tokenSet_6.member(LA(2))))) { - int _m14 = mark(); - synPredMatched14 = true; - inputState.guessing++; - try { - { - functionPrefix(); - } - } - catch (RecognitionException pe) { - synPredMatched14 = false; - } - rewind(_m14); - inputState.guessing--; - } - if ( synPredMatched14 ) { - functionDef(); - astFactory.addASTChild(currentAST, returnAST); - externalDef_AST = (TNode)currentAST.root; - } - else if ((_tokenSet_7.member(LA(1))) && (_tokenSet_8.member(LA(2)))) { - typelessDeclaration(); - astFactory.addASTChild(currentAST, returnAST); - externalDef_AST = (TNode)currentAST.root; - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - }} - returnAST = externalDef_AST; - } - - public final void declaration() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declaration_AST = null; - TNode ds_AST = null; - AST ds1 = null; - - declSpecifiers(); - ds_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - ds1 = astFactory.dupList(ds_AST); - } - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - { - initDeclList(ds1); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - int _cnt78=0; - _loop78: - do { - if ((LA(1)==SEMI) && (_tokenSet_9.member(LA(2)))) { - TNode tmp10_AST = null; - tmp10_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp10_AST); - match(SEMI); - } - else { - if ( _cnt78>=1 ) { break _loop78; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt78++; - } while (true); - } - if ( inputState.guessing==0 ) { - declaration_AST = (TNode)currentAST.root; - declaration_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NDeclaration)).add(declaration_AST)); - currentAST.root = declaration_AST; - currentAST.child = declaration_AST!=null &&declaration_AST.getFirstChild()!=null ? - declaration_AST.getFirstChild() : declaration_AST; - currentAST.advanceChildToEnd(); - } - declaration_AST = (TNode)currentAST.root; - returnAST = declaration_AST; - } - - public final void functionPrefix() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode functionPrefix_AST = null; - TNode ds_AST = null; - TNode d_AST = null; - String declName; - - { - boolean synPredMatched18 = false; - if (((_tokenSet_10.member(LA(1))) && (_tokenSet_11.member(LA(2))))) { - int _m18 = mark(); - synPredMatched18 = true; - inputState.guessing++; - try { - { - functionDeclSpecifiers(); - } - } - catch (RecognitionException pe) { - synPredMatched18 = false; - } - rewind(_m18); - inputState.guessing--; - } - if ( synPredMatched18 ) { - functionDeclSpecifiers(); - ds_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_7.member(LA(1))) && (_tokenSet_6.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - declName=declarator(true); - d_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - { - _loop20: - do { - if ((_tokenSet_3.member(LA(1)))) { - declaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop20; - } - - } while (true); - } - { - switch ( LA(1)) { - case VARARGS: - { - TNode tmp11_AST = null; - tmp11_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp11_AST); - match(VARARGS); - break; - } - case LCURLY: - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - _loop23: - do { - if ((LA(1)==SEMI)) { - TNode tmp12_AST = null; - tmp12_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp12_AST); - match(SEMI); - } - else { - break _loop23; - } - - } while (true); - } - TNode tmp13_AST = null; - tmp13_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp13_AST); - match(LCURLY); - functionPrefix_AST = (TNode)currentAST.root; - returnAST = functionPrefix_AST; - } - - public final void functionDef() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode functionDef_AST = null; - TNode ds_AST = null; - TNode d_AST = null; - String declName; - - { - boolean synPredMatched241 = false; - if (((_tokenSet_10.member(LA(1))) && (_tokenSet_11.member(LA(2))))) { - int _m241 = mark(); - synPredMatched241 = true; - inputState.guessing++; - try { - { - functionDeclSpecifiers(); - } - } - catch (RecognitionException pe) { - synPredMatched241 = false; - } - rewind(_m241); - inputState.guessing--; - } - if ( synPredMatched241 ) { - functionDeclSpecifiers(); - ds_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_7.member(LA(1))) && (_tokenSet_6.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - declName=declarator(true); - d_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - - AST d2, ds2; - d2 = astFactory.dupList(d_AST); - ds2 = astFactory.dupList(ds_AST); - symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds2).add(d2))); - pushScope(declName); - - } - { - _loop243: - do { - if ((_tokenSet_3.member(LA(1)))) { - declaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop243; - } - - } while (true); - } - { - switch ( LA(1)) { - case VARARGS: - { - TNode tmp14_AST = null; - tmp14_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp14_AST); - match(VARARGS); - break; - } - case LCURLY: - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - _loop246: - do { - if ((LA(1)==SEMI)) { - match(SEMI); - } - else { - break _loop246; - } - - } while (true); - } - if ( inputState.guessing==0 ) { - popScope(); - } - compoundStatement(declName); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - functionDef_AST = (TNode)currentAST.root; - functionDef_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NFunctionDef)).add(functionDef_AST)); - currentAST.root = functionDef_AST; - currentAST.child = functionDef_AST!=null &&functionDef_AST.getFirstChild()!=null ? - functionDef_AST.getFirstChild() : functionDef_AST; - currentAST.advanceChildToEnd(); - } - functionDef_AST = (TNode)currentAST.root; - returnAST = functionDef_AST; - } - - public final void typelessDeclaration() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode typelessDeclaration_AST = null; - AST typeMissing = (TNode)astFactory.create(NTypeMissing); - - initDeclList(typeMissing); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp16_AST = null; - tmp16_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp16_AST); - match(SEMI); - if ( inputState.guessing==0 ) { - typelessDeclaration_AST = (TNode)currentAST.root; - typelessDeclaration_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NTypeMissing)).add(typelessDeclaration_AST)); - currentAST.root = typelessDeclaration_AST; - currentAST.child = typelessDeclaration_AST!=null &&typelessDeclaration_AST.getFirstChild()!=null ? - typelessDeclaration_AST.getFirstChild() : typelessDeclaration_AST; - currentAST.advanceChildToEnd(); - } - typelessDeclaration_AST = (TNode)currentAST.root; - returnAST = typelessDeclaration_AST; - } - - public final void functionDeclSpecifiers() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode functionDeclSpecifiers_AST = null; - int specCount = 0; - - { - int _cnt251=0; - _loop251: - do { - switch ( LA(1)) { - case LITERAL_extern: - case LITERAL_static: - case LITERAL_inline: - { - functionStorageClassSpecifier(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_volatile: - case LITERAL_const: - { - typeQualifier(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - default: - boolean synPredMatched250 = false; - if (((_tokenSet_12.member(LA(1))) && (_tokenSet_11.member(LA(2))))) { - int _m250 = mark(); - synPredMatched250 = true; - inputState.guessing++; - try { - { - if ((LA(1)==LITERAL_struct) && (true)) { - match(LITERAL_struct); - } - else if ((LA(1)==LITERAL_union) && (true)) { - match(LITERAL_union); - } - else if ((LA(1)==LITERAL_enum) && (true)) { - match(LITERAL_enum); - } - else if ((_tokenSet_12.member(LA(1))) && (true)) { - typeSpecifier(specCount); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - } - catch (RecognitionException pe) { - synPredMatched250 = false; - } - rewind(_m250); - inputState.guessing--; - } - if ( synPredMatched250 ) { - specCount=typeSpecifier(specCount); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt251>=1 ) { break _loop251; } else {throw new NoViableAltException(LT(1), getFilename());} - } - } - _cnt251++; - } while (true); - } - functionDeclSpecifiers_AST = (TNode)currentAST.root; - returnAST = functionDeclSpecifiers_AST; - } - - public final String declarator( - boolean isFunctionDefinition - ) throws RecognitionException, TokenStreamException { - String declName; - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declarator_AST = null; - Token id = null; - TNode id_AST = null; - declName = ""; - - { - switch ( LA(1)) { - case STAR: - { - pointerGroup(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case ID: - case LPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - switch ( LA(1)) { - case ID: - { - id = LT(1); - id_AST = (TNode)astFactory.create(id); - astFactory.addASTChild(currentAST, id_AST); - match(ID); - if ( inputState.guessing==0 ) { - declName = id.getText(); - } - break; - } - case LPAREN: - { - TNode tmp17_AST = null; - tmp17_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp17_AST); - match(LPAREN); - declName=declarator(false); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp18_AST = null; - tmp18_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp18_AST); - match(RPAREN); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - _loop50: - do { - switch ( LA(1)) { - case LPAREN: - { - declaratorParamaterList(isFunctionDefinition, declName); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LBRACKET: - { - TNode tmp19_AST = null; - tmp19_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp19_AST); - match(LBRACKET); - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - expr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp20_AST = null; - tmp20_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp20_AST); - match(RBRACKET); - break; - } - default: - { - break _loop50; - } - } - } while (true); - } - if ( inputState.guessing==0 ) { - declarator_AST = (TNode)currentAST.root; - declarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NDeclarator)).add(declarator_AST)); - currentAST.root = declarator_AST; - currentAST.child = declarator_AST!=null &&declarator_AST.getFirstChild()!=null ? - declarator_AST.getFirstChild() : declarator_AST; - currentAST.advanceChildToEnd(); - } - declarator_AST = (TNode)currentAST.root; - returnAST = declarator_AST; - return declName; - } - - public final void initDeclList( - AST declarationSpecifiers - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode initDeclList_AST = null; - - initDecl(declarationSpecifiers); - astFactory.addASTChild(currentAST, returnAST); - { - _loop115: - do { - if ((LA(1)==COMMA) && (_tokenSet_7.member(LA(2)))) { - match(COMMA); - initDecl(declarationSpecifiers); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop115; - } - - } while (true); - } - { - switch ( LA(1)) { - case COMMA: - { - match(COMMA); - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - initDeclList_AST = (TNode)currentAST.root; - returnAST = initDeclList_AST; - } - - public final void initializer() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode initializer_AST = null; - - { - if ((_tokenSet_13.member(LA(1))) && (_tokenSet_14.member(LA(2)))) { - { - { - boolean synPredMatched30 = false; - if (((_tokenSet_15.member(LA(1))) && (_tokenSet_16.member(LA(2))))) { - int _m30 = mark(); - synPredMatched30 = true; - inputState.guessing++; - try { - { - initializerElementLabel(); - } - } - catch (RecognitionException pe) { - synPredMatched30 = false; - } - rewind(_m30); - inputState.guessing--; - } - if ( synPredMatched30 ) { - initializerElementLabel(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_17.member(LA(1))) && (_tokenSet_18.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LCURLY: - { - lcurlyInitializer(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - initializer_AST = (TNode)currentAST.root; - initializer_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NInitializer)).add(initializer_AST)); - currentAST.root = initializer_AST; - currentAST.child = initializer_AST!=null &&initializer_AST.getFirstChild()!=null ? - initializer_AST.getFirstChild() : initializer_AST; - currentAST.advanceChildToEnd(); - } - } - } - else if ((LA(1)==LCURLY) && (_tokenSet_19.member(LA(2)))) { - lcurlyInitializer(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - initializer_AST = (TNode)currentAST.root; - returnAST = initializer_AST; - } - - public final void initializerElementLabel() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode initializerElementLabel_AST = null; - - { - switch ( LA(1)) { - case LBRACKET: - { - { - TNode tmp23_AST = null; - tmp23_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp23_AST); - match(LBRACKET); - { - boolean synPredMatched37 = false; - if (((_tokenSet_2.member(LA(1))) && (_tokenSet_20.member(LA(2))))) { - int _m37 = mark(); - synPredMatched37 = true; - inputState.guessing++; - try { - { - constExpr(); - match(VARARGS); - } - } - catch (RecognitionException pe) { - synPredMatched37 = false; - } - rewind(_m37); - inputState.guessing--; - } - if ( synPredMatched37 ) { - rangeExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_21.member(LA(2)))) { - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - TNode tmp24_AST = null; - tmp24_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp24_AST); - match(RBRACKET); - { - switch ( LA(1)) { - case ASSIGN: - { - TNode tmp25_AST = null; - tmp25_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp25_AST); - match(ASSIGN); - break; - } - case LITERAL_asm: - case LCURLY: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - } - break; - } - case ID: - { - TNode tmp26_AST = null; - tmp26_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp26_AST); - match(ID); - TNode tmp27_AST = null; - tmp27_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp27_AST); - match(COLON); - break; - } - case DOT: - { - TNode tmp28_AST = null; - tmp28_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp28_AST); - match(DOT); - TNode tmp29_AST = null; - tmp29_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp29_AST); - match(ID); - TNode tmp30_AST = null; - tmp30_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp30_AST); - match(ASSIGN); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - initializerElementLabel_AST = (TNode)currentAST.root; - initializerElementLabel_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NInitializerElementLabel)).add(initializerElementLabel_AST)) ; - currentAST.root = initializerElementLabel_AST; - currentAST.child = initializerElementLabel_AST!=null &&initializerElementLabel_AST.getFirstChild()!=null ? - initializerElementLabel_AST.getFirstChild() : initializerElementLabel_AST; - currentAST.advanceChildToEnd(); - } - initializerElementLabel_AST = (TNode)currentAST.root; - returnAST = initializerElementLabel_AST; - } - - public final void assignExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode assignExpr_AST = null; - TNode a_AST = null; - - conditionalExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case ASSIGN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - { - assignOperator(); - a_AST = (TNode)returnAST; - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - assignExpr_AST = (TNode)currentAST.root; - assignExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add(a_AST).add(assignExpr_AST)); - currentAST.root = assignExpr_AST; - currentAST.child = assignExpr_AST!=null &&assignExpr_AST.getFirstChild()!=null ? - assignExpr_AST.getFirstChild() : assignExpr_AST; - currentAST.advanceChildToEnd(); - } - break; - } - case RCURLY: - case SEMI: - case COMMA: - case COLON: - case RPAREN: - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - assignExpr_AST = (TNode)currentAST.root; - returnAST = assignExpr_AST; - } - - public final void lcurlyInitializer() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode lcurlyInitializer_AST = null; - - TNode tmp31_AST = null; - tmp31_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp31_AST); - match(LCURLY); - { - switch ( LA(1)) { - case LITERAL_asm: - case LCURLY: - case ID: - case STAR: - case LPAREN: - case LBRACKET: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case DOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - initializerList(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case COMMA: - { - match(COMMA); - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp33_AST = null; - tmp33_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp33_AST); - match(RCURLY); - if ( inputState.guessing==0 ) { - lcurlyInitializer_AST = (TNode)currentAST.root; - lcurlyInitializer_AST.setType( NLcurlyInitializer ); - } - lcurlyInitializer_AST = (TNode)currentAST.root; - returnAST = lcurlyInitializer_AST; - } - - public final void constExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode constExpr_AST = null; - - conditionalExpr(); - astFactory.addASTChild(currentAST, returnAST); - constExpr_AST = (TNode)currentAST.root; - returnAST = constExpr_AST; - } - - public final void rangeExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode rangeExpr_AST = null; - - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp34_AST = null; - tmp34_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp34_AST); - match(VARARGS); - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - rangeExpr_AST = (TNode)currentAST.root; - rangeExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NRangeExpr)).add(rangeExpr_AST)); - currentAST.root = rangeExpr_AST; - currentAST.child = rangeExpr_AST!=null &&rangeExpr_AST.getFirstChild()!=null ? - rangeExpr_AST.getFirstChild() : rangeExpr_AST; - currentAST.advanceChildToEnd(); - } - rangeExpr_AST = (TNode)currentAST.root; - returnAST = rangeExpr_AST; - } - - public final void initializerList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode initializerList_AST = null; - - initializer(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop44: - do { - if ((LA(1)==COMMA) && (_tokenSet_13.member(LA(2)))) { - match(COMMA); - initializer(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop44; - } - - } while (true); - } - initializerList_AST = (TNode)currentAST.root; - returnAST = initializerList_AST; - } - - public final void pointerGroup() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode pointerGroup_AST = null; - - { - int _cnt233=0; - _loop233: - do { - if ((LA(1)==STAR)) { - TNode tmp36_AST = null; - tmp36_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp36_AST); - match(STAR); - { - _loop232: - do { - if ((LA(1)==LITERAL_volatile||LA(1)==LITERAL_const)) { - typeQualifier(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop232; - } - - } while (true); - } - } - else { - if ( _cnt233>=1 ) { break _loop233; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt233++; - } while (true); - } - if ( inputState.guessing==0 ) { - pointerGroup_AST = (TNode)currentAST.root; - pointerGroup_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NPointerGroup)).add(pointerGroup_AST)); - currentAST.root = pointerGroup_AST; - currentAST.child = pointerGroup_AST!=null &&pointerGroup_AST.getFirstChild()!=null ? - pointerGroup_AST.getFirstChild() : pointerGroup_AST; - currentAST.advanceChildToEnd(); - } - pointerGroup_AST = (TNode)currentAST.root; - returnAST = pointerGroup_AST; - } - - public final void declaratorParamaterList( - boolean isFunctionDefinition, String declName - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declaratorParamaterList_AST = null; - - TNode tmp37_AST = null; - tmp37_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp37_AST); - match(LPAREN); - if ( inputState.guessing==0 ) { - - if (isFunctionDefinition) { - pushScope(declName); - } - else { - pushScope("!"+declName); - } - - } - { - boolean synPredMatched54 = false; - if (((_tokenSet_3.member(LA(1))) && (_tokenSet_22.member(LA(2))))) { - int _m54 = mark(); - synPredMatched54 = true; - inputState.guessing++; - try { - { - declSpecifiers(); - } - } - catch (RecognitionException pe) { - synPredMatched54 = false; - } - rewind(_m54); - inputState.guessing--; - } - if ( synPredMatched54 ) { - parameterTypeList(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_23.member(LA(1))) && (_tokenSet_24.member(LA(2)))) { - { - switch ( LA(1)) { - case ID: - { - idList(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case COMMA: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - if ( inputState.guessing==0 ) { - - popScope(); - - } - { - switch ( LA(1)) { - case COMMA: - { - match(COMMA); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp39_AST = null; - tmp39_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp39_AST); - match(RPAREN); - if ( inputState.guessing==0 ) { - declaratorParamaterList_AST = (TNode)currentAST.root; - declaratorParamaterList_AST.setType(NParameterTypeList); - } - declaratorParamaterList_AST = (TNode)currentAST.root; - returnAST = declaratorParamaterList_AST; - } - - public final void declSpecifiers() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declSpecifiers_AST = null; - TNode s_AST = null; - int specCount=0; - - { - int _cnt214=0; - _loop214: - do { - switch ( LA(1)) { - case LITERAL_typedef: - case LITERAL_auto: - case LITERAL_register: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_inline: - { - storageClassSpecifier(); - s_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_volatile: - case LITERAL_const: - { - typeQualifier(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - default: - boolean synPredMatched213 = false; - if (((_tokenSet_12.member(LA(1))) && (_tokenSet_22.member(LA(2))))) { - int _m213 = mark(); - synPredMatched213 = true; - inputState.guessing++; - try { - { - if ((LA(1)==LITERAL_struct) && (true)) { - match(LITERAL_struct); - } - else if ((LA(1)==LITERAL_union) && (true)) { - match(LITERAL_union); - } - else if ((LA(1)==LITERAL_enum) && (true)) { - match(LITERAL_enum); - } - else if ((_tokenSet_12.member(LA(1))) && (true)) { - typeSpecifier(specCount); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - } - catch (RecognitionException pe) { - synPredMatched213 = false; - } - rewind(_m213); - inputState.guessing--; - } - if ( synPredMatched213 ) { - specCount=typeSpecifier(specCount); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt214>=1 ) { break _loop214; } else {throw new NoViableAltException(LT(1), getFilename());} - } - } - _cnt214++; - } while (true); - } - declSpecifiers_AST = (TNode)currentAST.root; - returnAST = declSpecifiers_AST; - } - - public final void parameterTypeList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode parameterTypeList_AST = null; - - parameterDeclaration(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop60: - do { - if ((LA(1)==SEMI||LA(1)==COMMA) && (_tokenSet_3.member(LA(2)))) { - { - switch ( LA(1)) { - case COMMA: - { - TNode tmp40_AST = null; - tmp40_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp40_AST); - match(COMMA); - break; - } - case SEMI: - { - TNode tmp41_AST = null; - tmp41_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp41_AST); - match(SEMI); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - parameterDeclaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop60; - } - - } while (true); - } - { - if ((LA(1)==SEMI||LA(1)==COMMA) && (LA(2)==VARARGS)) { - { - switch ( LA(1)) { - case COMMA: - { - TNode tmp42_AST = null; - tmp42_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp42_AST); - match(COMMA); - break; - } - case SEMI: - { - TNode tmp43_AST = null; - tmp43_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp43_AST); - match(SEMI); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp44_AST = null; - tmp44_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp44_AST); - match(VARARGS); - } - else if ((LA(1)==COMMA||LA(1)==RPAREN) && (_tokenSet_24.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - parameterTypeList_AST = (TNode)currentAST.root; - returnAST = parameterTypeList_AST; - } - - public final void parameterDeclaration() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode parameterDeclaration_AST = null; - TNode ds_AST = null; - TNode d_AST = null; - String declName; - - declSpecifiers(); - ds_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - { - boolean synPredMatched237 = false; - if (((_tokenSet_7.member(LA(1))) && (_tokenSet_25.member(LA(2))))) { - int _m237 = mark(); - synPredMatched237 = true; - inputState.guessing++; - try { - { - declarator(false); - } - } - catch (RecognitionException pe) { - synPredMatched237 = false; - } - rewind(_m237); - inputState.guessing--; - } - if ( synPredMatched237 ) { - declName=declarator(false); - d_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - - AST d2, ds2; - d2 = astFactory.dupList(d_AST); - ds2 = astFactory.dupList(ds_AST); - symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds2).add(d2))); - - } - } - else if ((_tokenSet_26.member(LA(1))) && (_tokenSet_27.member(LA(2)))) { - nonemptyAbstractDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_28.member(LA(1)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - if ( inputState.guessing==0 ) { - parameterDeclaration_AST = (TNode)currentAST.root; - - parameterDeclaration_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NParameterDeclaration)).add(parameterDeclaration_AST)); - - currentAST.root = parameterDeclaration_AST; - currentAST.child = parameterDeclaration_AST!=null &¶meterDeclaration_AST.getFirstChild()!=null ? - parameterDeclaration_AST.getFirstChild() : parameterDeclaration_AST; - currentAST.advanceChildToEnd(); - } - parameterDeclaration_AST = (TNode)currentAST.root; - returnAST = parameterDeclaration_AST; - } - - public final void declarationList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declarationList_AST = null; - - { - int _cnt67=0; - _loop67: - do { - if ((LA(1)==LITERAL___label__) && (LA(2)==ID)) { - localLabelDeclaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - boolean synPredMatched66 = false; - if (((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2))))) { - int _m66 = mark(); - synPredMatched66 = true; - inputState.guessing++; - try { - { - declarationPredictor(); - } - } - catch (RecognitionException pe) { - synPredMatched66 = false; - } - rewind(_m66); - inputState.guessing--; - } - if ( synPredMatched66 ) { - declaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt67>=1 ) { break _loop67; } else {throw new NoViableAltException(LT(1), getFilename());} - } - } - _cnt67++; - } while (true); - } - declarationList_AST = (TNode)currentAST.root; - returnAST = declarationList_AST; - } - - public final void localLabelDeclaration() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode localLabelDeclaration_AST = null; - - { - TNode tmp45_AST = null; - tmp45_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp45_AST); - match(LITERAL___label__); - TNode tmp46_AST = null; - tmp46_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp46_AST); - match(ID); - { - _loop71: - do { - if ((LA(1)==COMMA) && (LA(2)==ID)) { - match(COMMA); - TNode tmp48_AST = null; - tmp48_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp48_AST); - match(ID); - } - else { - break _loop71; - } - - } while (true); - } - { - switch ( LA(1)) { - case COMMA: - { - match(COMMA); - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - int _cnt74=0; - _loop74: - do { - if ((LA(1)==SEMI) && (_tokenSet_29.member(LA(2)))) { - match(SEMI); - } - else { - if ( _cnt74>=1 ) { break _loop74; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt74++; - } while (true); - } - } - localLabelDeclaration_AST = (TNode)currentAST.root; - returnAST = localLabelDeclaration_AST; - } - - public final void declarationPredictor() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode declarationPredictor_AST = null; - - { - if ((LA(1)==LITERAL_typedef) && (LA(2)==EOF)) { - TNode tmp51_AST = null; - tmp51_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp51_AST); - match(LITERAL_typedef); - } - else if ((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2)))) { - declaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - declarationPredictor_AST = (TNode)currentAST.root; - returnAST = declarationPredictor_AST; - } - - public final void functionStorageClassSpecifier() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode functionStorageClassSpecifier_AST = null; - - switch ( LA(1)) { - case LITERAL_extern: - { - TNode tmp52_AST = null; - tmp52_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp52_AST); - match(LITERAL_extern); - functionStorageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_static: - { - TNode tmp53_AST = null; - tmp53_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp53_AST); - match(LITERAL_static); - functionStorageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_inline: - { - TNode tmp54_AST = null; - tmp54_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp54_AST); - match(LITERAL_inline); - functionStorageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = functionStorageClassSpecifier_AST; - } - - public final int typeSpecifier( - int specCount - ) throws RecognitionException, TokenStreamException { - int retSpecCount; - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode typeSpecifier_AST = null; - retSpecCount = specCount + 1; - - { - switch ( LA(1)) { - case LITERAL_void: - { - TNode tmp55_AST = null; - tmp55_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp55_AST); - match(LITERAL_void); - break; - } - case LITERAL_char: - { - TNode tmp56_AST = null; - tmp56_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp56_AST); - match(LITERAL_char); - break; - } - case LITERAL_short: - { - TNode tmp57_AST = null; - tmp57_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp57_AST); - match(LITERAL_short); - break; - } - case LITERAL_int: - { - TNode tmp58_AST = null; - tmp58_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp58_AST); - match(LITERAL_int); - break; - } - case LITERAL_long: - { - TNode tmp59_AST = null; - tmp59_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp59_AST); - match(LITERAL_long); - break; - } - case LITERAL_float: - { - TNode tmp60_AST = null; - tmp60_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp60_AST); - match(LITERAL_float); - break; - } - case LITERAL_double: - { - TNode tmp61_AST = null; - tmp61_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp61_AST); - match(LITERAL_double); - break; - } - case LITERAL_signed: - { - TNode tmp62_AST = null; - tmp62_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp62_AST); - match(LITERAL_signed); - break; - } - case LITERAL_unsigned: - { - TNode tmp63_AST = null; - tmp63_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp63_AST); - match(LITERAL_unsigned); - break; - } - case LITERAL_byte: - { - TNode tmp64_AST = null; - tmp64_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp64_AST); - match(LITERAL_byte); - break; - } - case LITERAL_boolean: - { - TNode tmp65_AST = null; - tmp65_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp65_AST); - match(LITERAL_boolean); - break; - } - case LITERAL_Servo: - { - TNode tmp66_AST = null; - tmp66_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp66_AST); - match(LITERAL_Servo); - break; - } - case LITERAL_Wire: - { - TNode tmp67_AST = null; - tmp67_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp67_AST); - match(LITERAL_Wire); - break; - } - case LITERAL_struct: - case LITERAL_union: - { - structOrUnionSpecifier(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop83: - do { - if ((LA(1)==LITERAL_asm||LA(1)==LITERAL___attribute) && (LA(2)==LPAREN)) { - attributeDecl(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop83; - } - - } while (true); - } - break; - } - case LITERAL_enum: - { - enumSpecifier(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_typeof: - { - TNode tmp68_AST = null; - tmp68_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp68_AST); - match(LITERAL_typeof); - TNode tmp69_AST = null; - tmp69_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp69_AST); - match(LPAREN); - { - boolean synPredMatched86 = false; - if (((_tokenSet_30.member(LA(1))) && (_tokenSet_31.member(LA(2))))) { - int _m86 = mark(); - synPredMatched86 = true; - inputState.guessing++; - try { - { - typeName(); - } - } - catch (RecognitionException pe) { - synPredMatched86 = false; - } - rewind(_m86); - inputState.guessing--; - } - if ( synPredMatched86 ) { - typeName(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_32.member(LA(2)))) { - expr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - TNode tmp70_AST = null; - tmp70_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp70_AST); - match(RPAREN); - break; - } - case LITERAL___complex: - { - TNode tmp71_AST = null; - tmp71_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp71_AST); - match(LITERAL___complex); - break; - } - default: - if (((LA(1)==ID))&&( specCount==0 )) { - typedefName(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - typeSpecifier_AST = (TNode)currentAST.root; - returnAST = typeSpecifier_AST; - return retSpecCount; - } - - public final void structOrUnionSpecifier() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structOrUnionSpecifier_AST = null; - TNode sou_AST = null; - Token i = null; - TNode i_AST = null; - Token l = null; - TNode l_AST = null; - Token l1 = null; - TNode l1_AST = null; - String scopeName; - - structOrUnion(); - sou_AST = (TNode)returnAST; - { - boolean synPredMatched90 = false; - if (((LA(1)==ID) && (LA(2)==LCURLY))) { - int _m90 = mark(); - synPredMatched90 = true; - inputState.guessing++; - try { - { - match(ID); - match(LCURLY); - } - } - catch (RecognitionException pe) { - synPredMatched90 = false; - } - rewind(_m90); - inputState.guessing--; - } - if ( synPredMatched90 ) { - i = LT(1); - i_AST = (TNode)astFactory.create(i); - astFactory.addASTChild(currentAST, i_AST); - match(ID); - l = LT(1); - l_AST = (TNode)astFactory.create(l); - astFactory.addASTChild(currentAST, l_AST); - match(LCURLY); - if ( inputState.guessing==0 ) { - - scopeName = sou_AST.getText() + " " + i_AST.getText(); - l_AST.setText(scopeName); - pushScope(scopeName); - - } - { - switch ( LA(1)) { - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case ID: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - structDeclarationList(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - popScope(); - } - TNode tmp72_AST = null; - tmp72_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp72_AST); - match(RCURLY); - } - else if ((LA(1)==LCURLY)) { - l1 = LT(1); - l1_AST = (TNode)astFactory.create(l1); - astFactory.addASTChild(currentAST, l1_AST); - match(LCURLY); - if ( inputState.guessing==0 ) { - - scopeName = getAScopeName(); - l1_AST.setText(scopeName); - pushScope(scopeName); - - } - { - switch ( LA(1)) { - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case ID: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - structDeclarationList(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - popScope(); - } - TNode tmp73_AST = null; - tmp73_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp73_AST); - match(RCURLY); - } - else if ((LA(1)==ID) && (_tokenSet_33.member(LA(2)))) { - TNode tmp74_AST = null; - tmp74_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp74_AST); - match(ID); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - if ( inputState.guessing==0 ) { - structOrUnionSpecifier_AST = (TNode)currentAST.root; - - structOrUnionSpecifier_AST = (TNode)astFactory.make( (new ASTArray(2)).add(sou_AST).add(structOrUnionSpecifier_AST)); - - currentAST.root = structOrUnionSpecifier_AST; - currentAST.child = structOrUnionSpecifier_AST!=null &&structOrUnionSpecifier_AST.getFirstChild()!=null ? - structOrUnionSpecifier_AST.getFirstChild() : structOrUnionSpecifier_AST; - currentAST.advanceChildToEnd(); - } - structOrUnionSpecifier_AST = (TNode)currentAST.root; - returnAST = structOrUnionSpecifier_AST; - } - - public final void attributeDecl() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode attributeDecl_AST = null; - - switch ( LA(1)) { - case LITERAL___attribute: - { - TNode tmp75_AST = null; - tmp75_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp75_AST); - match(LITERAL___attribute); - TNode tmp76_AST = null; - tmp76_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp76_AST); - match(LPAREN); - TNode tmp77_AST = null; - tmp77_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp77_AST); - match(LPAREN); - attributeList(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp78_AST = null; - tmp78_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp78_AST); - match(RPAREN); - TNode tmp79_AST = null; - tmp79_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp79_AST); - match(RPAREN); - attributeDecl_AST = (TNode)currentAST.root; - break; - } - case LITERAL_asm: - { - TNode tmp80_AST = null; - tmp80_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp80_AST); - match(LITERAL_asm); - TNode tmp81_AST = null; - tmp81_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp81_AST); - match(LPAREN); - stringConst(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp82_AST = null; - tmp82_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp82_AST); - match(RPAREN); - if ( inputState.guessing==0 ) { - attributeDecl_AST = (TNode)currentAST.root; - attributeDecl_AST.setType( NAsmAttribute ); - } - attributeDecl_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = attributeDecl_AST; - } - - public final void enumSpecifier() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode enumSpecifier_AST = null; - Token i = null; - TNode i_AST = null; - - TNode tmp83_AST = null; - tmp83_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp83_AST); - match(LITERAL_enum); - { - boolean synPredMatched108 = false; - if (((LA(1)==ID) && (LA(2)==LCURLY))) { - int _m108 = mark(); - synPredMatched108 = true; - inputState.guessing++; - try { - { - match(ID); - match(LCURLY); - } - } - catch (RecognitionException pe) { - synPredMatched108 = false; - } - rewind(_m108); - inputState.guessing--; - } - if ( synPredMatched108 ) { - i = LT(1); - i_AST = (TNode)astFactory.create(i); - astFactory.addASTChild(currentAST, i_AST); - match(ID); - TNode tmp84_AST = null; - tmp84_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp84_AST); - match(LCURLY); - enumList(i.getText()); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp85_AST = null; - tmp85_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp85_AST); - match(RCURLY); - } - else if ((LA(1)==LCURLY)) { - TNode tmp86_AST = null; - tmp86_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp86_AST); - match(LCURLY); - enumList("anonymous"); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp87_AST = null; - tmp87_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp87_AST); - match(RCURLY); - } - else if ((LA(1)==ID) && (_tokenSet_33.member(LA(2)))) { - TNode tmp88_AST = null; - tmp88_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp88_AST); - match(ID); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - enumSpecifier_AST = (TNode)currentAST.root; - returnAST = enumSpecifier_AST; - } - - public final void typedefName() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode typedefName_AST = null; - Token i = null; - TNode i_AST = null; - - if (!( isTypedefName ( LT(1).getText() ) )) - throw new SemanticException(" isTypedefName ( LT(1).getText() ) "); - i = LT(1); - i_AST = (TNode)astFactory.create(i); - astFactory.addASTChild(currentAST, i_AST); - match(ID); - if ( inputState.guessing==0 ) { - typedefName_AST = (TNode)currentAST.root; - typedefName_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NTypedefName)).add(i_AST)); - currentAST.root = typedefName_AST; - currentAST.child = typedefName_AST!=null &&typedefName_AST.getFirstChild()!=null ? - typedefName_AST.getFirstChild() : typedefName_AST; - currentAST.advanceChildToEnd(); - } - typedefName_AST = (TNode)currentAST.root; - returnAST = typedefName_AST; - } - - public final void typeName() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode typeName_AST = null; - - specifierQualifierList(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case STAR: - case LPAREN: - case LBRACKET: - { - nonemptyAbstractDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - typeName_AST = (TNode)currentAST.root; - returnAST = typeName_AST; - } - - public final void structOrUnion() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structOrUnion_AST = null; - - switch ( LA(1)) { - case LITERAL_struct: - { - TNode tmp89_AST = null; - tmp89_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp89_AST); - match(LITERAL_struct); - structOrUnion_AST = (TNode)currentAST.root; - break; - } - case LITERAL_union: - { - TNode tmp90_AST = null; - tmp90_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp90_AST); - match(LITERAL_union); - structOrUnion_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = structOrUnion_AST; - } - - public final void structDeclarationList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structDeclarationList_AST = null; - - { - int _cnt221=0; - _loop221: - do { - if ((_tokenSet_30.member(LA(1)))) { - structDeclaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt221>=1 ) { break _loop221; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt221++; - } while (true); - } - structDeclarationList_AST = (TNode)currentAST.root; - returnAST = structDeclarationList_AST; - } - - public final void structDeclaration() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structDeclaration_AST = null; - - specifierQualifierList(); - astFactory.addASTChild(currentAST, returnAST); - structDeclaratorList(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case COMMA: - { - match(COMMA); - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - int _cnt96=0; - _loop96: - do { - if ((LA(1)==SEMI)) { - match(SEMI); - } - else { - if ( _cnt96>=1 ) { break _loop96; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt96++; - } while (true); - } - structDeclaration_AST = (TNode)currentAST.root; - returnAST = structDeclaration_AST; - } - - public final void specifierQualifierList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode specifierQualifierList_AST = null; - int specCount = 0; - - { - int _cnt226=0; - _loop226: - do { - boolean synPredMatched225 = false; - if (((_tokenSet_12.member(LA(1))) && (_tokenSet_34.member(LA(2))))) { - int _m225 = mark(); - synPredMatched225 = true; - inputState.guessing++; - try { - { - if ((LA(1)==LITERAL_struct) && (true)) { - match(LITERAL_struct); - } - else if ((LA(1)==LITERAL_union) && (true)) { - match(LITERAL_union); - } - else if ((LA(1)==LITERAL_enum) && (true)) { - match(LITERAL_enum); - } - else if ((_tokenSet_12.member(LA(1))) && (true)) { - typeSpecifier(specCount); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - } - catch (RecognitionException pe) { - synPredMatched225 = false; - } - rewind(_m225); - inputState.guessing--; - } - if ( synPredMatched225 ) { - specCount=typeSpecifier(specCount); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((LA(1)==LITERAL_volatile||LA(1)==LITERAL_const)) { - typeQualifier(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt226>=1 ) { break _loop226; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt226++; - } while (true); - } - specifierQualifierList_AST = (TNode)currentAST.root; - returnAST = specifierQualifierList_AST; - } - - public final void structDeclaratorList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structDeclaratorList_AST = null; - - structDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop99: - do { - if ((LA(1)==COMMA) && (_tokenSet_35.member(LA(2)))) { - match(COMMA); - structDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop99; - } - - } while (true); - } - structDeclaratorList_AST = (TNode)currentAST.root; - returnAST = structDeclaratorList_AST; - } - - public final void structDeclarator() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode structDeclarator_AST = null; - - { - switch ( LA(1)) { - case ID: - case STAR: - case LPAREN: - { - declarator(false); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_asm: - case SEMI: - case COMMA: - case COLON: - case LITERAL___attribute: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - switch ( LA(1)) { - case COLON: - { - TNode tmp94_AST = null; - tmp94_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp94_AST); - match(COLON); - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_asm: - case SEMI: - case COMMA: - case LITERAL___attribute: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - _loop104: - do { - if ((LA(1)==LITERAL_asm||LA(1)==LITERAL___attribute)) { - attributeDecl(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop104; - } - - } while (true); - } - if ( inputState.guessing==0 ) { - structDeclarator_AST = (TNode)currentAST.root; - structDeclarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStructDeclarator)).add(structDeclarator_AST)); - currentAST.root = structDeclarator_AST; - currentAST.child = structDeclarator_AST!=null &&structDeclarator_AST.getFirstChild()!=null ? - structDeclarator_AST.getFirstChild() : structDeclarator_AST; - currentAST.advanceChildToEnd(); - } - structDeclarator_AST = (TNode)currentAST.root; - returnAST = structDeclarator_AST; - } - - public final void enumList( - String enumName - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode enumList_AST = null; - - enumerator(enumName); - astFactory.addASTChild(currentAST, returnAST); - { - _loop111: - do { - if ((LA(1)==COMMA) && (LA(2)==ID)) { - match(COMMA); - enumerator(enumName); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop111; - } - - } while (true); - } - { - switch ( LA(1)) { - case COMMA: - { - match(COMMA); - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - enumList_AST = (TNode)currentAST.root; - returnAST = enumList_AST; - } - - public final void enumerator( - String enumName - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode enumerator_AST = null; - Token i = null; - TNode i_AST = null; - - i = LT(1); - i_AST = (TNode)astFactory.create(i); - astFactory.addASTChild(currentAST, i_AST); - match(ID); - if ( inputState.guessing==0 ) { - symbolTable.add( i.getText(), - (TNode)astFactory.make( (new ASTArray(3)).add(null).add((TNode)astFactory.create(LITERAL_enum,"enum")).add((TNode)astFactory.create(ID,enumName))) - ); - - } - { - switch ( LA(1)) { - case ASSIGN: - { - TNode tmp97_AST = null; - tmp97_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp97_AST); - match(ASSIGN); - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RCURLY: - case COMMA: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - enumerator_AST = (TNode)currentAST.root; - returnAST = enumerator_AST; - } - - public final void initDecl( - AST declarationSpecifiers - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode initDecl_AST = null; - TNode d_AST = null; - String declName = ""; - - declName=declarator(false); - d_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - AST ds1, d1; - ds1 = astFactory.dupList(declarationSpecifiers); - d1 = astFactory.dupList(d_AST); - symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds1).add(d1)) ); - - } - { - _loop119: - do { - if ((LA(1)==LITERAL_asm||LA(1)==LITERAL___attribute)) { - attributeDecl(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop119; - } - - } while (true); - } - { - switch ( LA(1)) { - case ASSIGN: - { - TNode tmp98_AST = null; - tmp98_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp98_AST); - match(ASSIGN); - initializer(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case COLON: - { - TNode tmp99_AST = null; - tmp99_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp99_AST); - match(COLON); - expr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case SEMI: - case COMMA: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - initDecl_AST = (TNode)currentAST.root; - initDecl_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NInitDecl)).add(initDecl_AST)); - currentAST.root = initDecl_AST; - currentAST.child = initDecl_AST!=null &&initDecl_AST.getFirstChild()!=null ? - initDecl_AST.getFirstChild() : initDecl_AST; - currentAST.advanceChildToEnd(); - } - initDecl_AST = (TNode)currentAST.root; - returnAST = initDecl_AST; - } - - public final void attributeList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode attributeList_AST = null; - - attribute(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop124: - do { - if ((LA(1)==COMMA) && ((LA(2) >= LITERAL_typedef && LA(2) <= LITERAL___imag))) { - TNode tmp100_AST = null; - tmp100_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp100_AST); - match(COMMA); - attribute(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop124; - } - - } while (true); - } - { - switch ( LA(1)) { - case COMMA: - { - TNode tmp101_AST = null; - tmp101_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp101_AST); - match(COMMA); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - attributeList_AST = (TNode)currentAST.root; - returnAST = attributeList_AST; - } - - protected final void stringConst() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode stringConst_AST = null; - - { - int _cnt314=0; - _loop314: - do { - if ((LA(1)==StringLiteral)) { - TNode tmp102_AST = null; - tmp102_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp102_AST); - match(StringLiteral); - } - else { - if ( _cnt314>=1 ) { break _loop314; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt314++; - } while (true); - } - if ( inputState.guessing==0 ) { - stringConst_AST = (TNode)currentAST.root; - stringConst_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStringSeq)).add(stringConst_AST)); - currentAST.root = stringConst_AST; - currentAST.child = stringConst_AST!=null &&stringConst_AST.getFirstChild()!=null ? - stringConst_AST.getFirstChild() : stringConst_AST; - currentAST.advanceChildToEnd(); - } - stringConst_AST = (TNode)currentAST.root; - returnAST = stringConst_AST; - } - - public final void attribute() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode attribute_AST = null; - - { - _loop129: - do { - if ((_tokenSet_36.member(LA(1)))) { - { - TNode tmp103_AST = null; - tmp103_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp103_AST); - match(_tokenSet_36); - } - } - else if ((LA(1)==LPAREN)) { - TNode tmp104_AST = null; - tmp104_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp104_AST); - match(LPAREN); - attributeList(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp105_AST = null; - tmp105_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp105_AST); - match(RPAREN); - } - else { - break _loop129; - } - - } while (true); - } - attribute_AST = (TNode)currentAST.root; - returnAST = attribute_AST; - } - - public final void compoundStatement( - String scopeName - ) throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode compoundStatement_AST = null; - - TNode tmp106_AST = null; - tmp106_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp106_AST); - match(LCURLY); - if ( inputState.guessing==0 ) { - - pushScope(scopeName); - - } - { - _loop136: - do { - boolean synPredMatched133 = false; - if (((_tokenSet_37.member(LA(1))) && (_tokenSet_4.member(LA(2))))) { - int _m133 = mark(); - synPredMatched133 = true; - inputState.guessing++; - try { - { - if ((LA(1)==LITERAL_typedef) && (true)) { - match(LITERAL_typedef); - } - else if ((LA(1)==LITERAL___label__)) { - match(LITERAL___label__); - } - else if ((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2)))) { - declaration(); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - } - catch (RecognitionException pe) { - synPredMatched133 = false; - } - rewind(_m133); - inputState.guessing--; - } - if ( synPredMatched133 ) { - declarationList(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - boolean synPredMatched135 = false; - if (((_tokenSet_38.member(LA(1))) && (_tokenSet_39.member(LA(2))))) { - int _m135 = mark(); - synPredMatched135 = true; - inputState.guessing++; - try { - { - nestedFunctionDef(); - } - } - catch (RecognitionException pe) { - synPredMatched135 = false; - } - rewind(_m135); - inputState.guessing--; - } - if ( synPredMatched135 ) { - nestedFunctionDef(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop136; - } - } - } while (true); - } - { - switch ( LA(1)) { - case LITERAL_asm: - case LCURLY: - case SEMI: - case ID: - case STAR: - case LPAREN: - case LITERAL_while: - case LITERAL_do: - case LITERAL_for: - case LITERAL_goto: - case LITERAL_continue: - case LITERAL_break: - case LITERAL_return: - case LITERAL_case: - case LITERAL_default: - case LITERAL_if: - case LITERAL_switch: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - statementList(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - popScope(); - } - TNode tmp107_AST = null; - tmp107_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp107_AST); - match(RCURLY); - if ( inputState.guessing==0 ) { - compoundStatement_AST = (TNode)currentAST.root; - compoundStatement_AST.setType( NCompoundStatement ); compoundStatement_AST.setAttribute( "scopeName", scopeName ); - } - compoundStatement_AST = (TNode)currentAST.root; - returnAST = compoundStatement_AST; - } - - public final void nestedFunctionDef() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode nestedFunctionDef_AST = null; - TNode ds_AST = null; - TNode d_AST = null; - String declName; - - { - switch ( LA(1)) { - case LITERAL_auto: - { - TNode tmp108_AST = null; - tmp108_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp108_AST); - match(LITERAL_auto); - break; - } - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case ID: - case STAR: - case LPAREN: - case LITERAL_inline: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - boolean synPredMatched142 = false; - if (((_tokenSet_10.member(LA(1))) && (_tokenSet_11.member(LA(2))))) { - int _m142 = mark(); - synPredMatched142 = true; - inputState.guessing++; - try { - { - functionDeclSpecifiers(); - } - } - catch (RecognitionException pe) { - synPredMatched142 = false; - } - rewind(_m142); - inputState.guessing--; - } - if ( synPredMatched142 ) { - functionDeclSpecifiers(); - ds_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_7.member(LA(1))) && (_tokenSet_39.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - declName=declarator(false); - d_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - - AST d2, ds2; - d2 = astFactory.dupList(d_AST); - ds2 = astFactory.dupList(ds_AST); - symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds2).add(d2))); - pushScope(declName); - - } - { - _loop144: - do { - if ((_tokenSet_3.member(LA(1)))) { - declaration(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop144; - } - - } while (true); - } - if ( inputState.guessing==0 ) { - popScope(); - } - compoundStatement(declName); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - nestedFunctionDef_AST = (TNode)currentAST.root; - nestedFunctionDef_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NFunctionDef)).add(nestedFunctionDef_AST)); - currentAST.root = nestedFunctionDef_AST; - currentAST.child = nestedFunctionDef_AST!=null &&nestedFunctionDef_AST.getFirstChild()!=null ? - nestedFunctionDef_AST.getFirstChild() : nestedFunctionDef_AST; - currentAST.advanceChildToEnd(); - } - nestedFunctionDef_AST = (TNode)currentAST.root; - returnAST = nestedFunctionDef_AST; - } - - public final void statementList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode statementList_AST = null; - - { - int _cnt256=0; - _loop256: - do { - if ((_tokenSet_40.member(LA(1)))) { - statement(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - if ( _cnt256>=1 ) { break _loop256; } else {throw new NoViableAltException(LT(1), getFilename());} - } - - _cnt256++; - } while (true); - } - statementList_AST = (TNode)currentAST.root; - returnAST = statementList_AST; - } - - public final void statement() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode statement_AST = null; - TNode e1_AST = null; - TNode e2_AST = null; - TNode e3_AST = null; - TNode s_AST = null; - - switch ( LA(1)) { - case SEMI: - { - TNode tmp109_AST = null; - tmp109_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp109_AST); - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LCURLY: - { - compoundStatement(getAScopeName()); - astFactory.addASTChild(currentAST, returnAST); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_while: - { - TNode tmp110_AST = null; - tmp110_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp110_AST); - match(LITERAL_while); - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(RPAREN); - statement(); - astFactory.addASTChild(currentAST, returnAST); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_do: - { - TNode tmp113_AST = null; - tmp113_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp113_AST); - match(LITERAL_do); - statement(); - astFactory.addASTChild(currentAST, returnAST); - match(LITERAL_while); - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(RPAREN); - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_for: - { - match(LITERAL_for); - TNode tmp119_AST = null; - tmp119_AST = (TNode)astFactory.create(LT(1)); - match(LPAREN); - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - expr(); - e1_AST = (TNode)returnAST; - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp120_AST = null; - tmp120_AST = (TNode)astFactory.create(LT(1)); - match(SEMI); - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - expr(); - e2_AST = (TNode)returnAST; - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp121_AST = null; - tmp121_AST = (TNode)astFactory.create(LT(1)); - match(SEMI); - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - expr(); - e3_AST = (TNode)returnAST; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp122_AST = null; - tmp122_AST = (TNode)astFactory.create(LT(1)); - match(RPAREN); - statement(); - s_AST = (TNode)returnAST; - if ( inputState.guessing==0 ) { - statement_AST = (TNode)currentAST.root; - - if ( e1_AST == null) { e1_AST = (TNode)astFactory.create(NEmptyExpression); } - if ( e2_AST == null) { e2_AST = (TNode)astFactory.create(NEmptyExpression); } - if ( e3_AST == null) { e3_AST = (TNode)astFactory.create(NEmptyExpression); } - statement_AST = (TNode)astFactory.make( (new ASTArray(5)).add((TNode)astFactory.create(LITERAL_for,"for")).add(e1_AST).add(e2_AST).add(e3_AST).add(s_AST)); - - currentAST.root = statement_AST; - currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? - statement_AST.getFirstChild() : statement_AST; - currentAST.advanceChildToEnd(); - } - break; - } - case LITERAL_goto: - { - TNode tmp123_AST = null; - tmp123_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp123_AST); - match(LITERAL_goto); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_continue: - { - TNode tmp125_AST = null; - tmp125_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp125_AST); - match(LITERAL_continue); - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_break: - { - TNode tmp127_AST = null; - tmp127_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp127_AST); - match(LITERAL_break); - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_return: - { - TNode tmp129_AST = null; - tmp129_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp129_AST); - match(LITERAL_return); - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - expr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - match(SEMI); - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_case: - { - TNode tmp131_AST = null; - tmp131_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp131_AST); - match(LITERAL_case); - { - boolean synPredMatched153 = false; - if (((_tokenSet_2.member(LA(1))) && (_tokenSet_20.member(LA(2))))) { - int _m153 = mark(); - synPredMatched153 = true; - inputState.guessing++; - try { - { - constExpr(); - match(VARARGS); - } - } - catch (RecognitionException pe) { - synPredMatched153 = false; - } - rewind(_m153); - inputState.guessing--; - } - if ( synPredMatched153 ) { - rangeExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_41.member(LA(2)))) { - constExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - match(COLON); - { - if ((_tokenSet_40.member(LA(1))) && (_tokenSet_42.member(LA(2)))) { - statement(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_44.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_default: - { - TNode tmp133_AST = null; - tmp133_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp133_AST); - match(LITERAL_default); - match(COLON); - { - if ((_tokenSet_40.member(LA(1))) && (_tokenSet_42.member(LA(2)))) { - statement(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_44.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_if: - { - TNode tmp135_AST = null; - tmp135_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp135_AST); - match(LITERAL_if); - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(RPAREN); - statement(); - astFactory.addASTChild(currentAST, returnAST); - { - if ((LA(1)==LITERAL_else) && (_tokenSet_40.member(LA(2)))) { - TNode tmp138_AST = null; - tmp138_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp138_AST); - match(LITERAL_else); - statement(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_44.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - statement_AST = (TNode)currentAST.root; - break; - } - case LITERAL_switch: - { - TNode tmp139_AST = null; - tmp139_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp139_AST); - match(LITERAL_switch); - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(RPAREN); - statement(); - astFactory.addASTChild(currentAST, returnAST); - statement_AST = (TNode)currentAST.root; - break; - } - default: - if ((_tokenSet_2.member(LA(1))) && (_tokenSet_45.member(LA(2)))) { - expr(); - astFactory.addASTChild(currentAST, returnAST); - match(SEMI); - if ( inputState.guessing==0 ) { - statement_AST = (TNode)currentAST.root; - statement_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStatementExpr)).add(statement_AST)); - currentAST.root = statement_AST; - currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? - statement_AST.getFirstChild() : statement_AST; - currentAST.advanceChildToEnd(); - } - statement_AST = (TNode)currentAST.root; - } - else if ((LA(1)==ID) && (LA(2)==COLON)) { - TNode tmp143_AST = null; - tmp143_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp143_AST); - match(ID); - match(COLON); - { - if ((_tokenSet_40.member(LA(1))) && (_tokenSet_42.member(LA(2)))) { - statement(); - astFactory.addASTChild(currentAST, returnAST); - } - else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_44.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - if ( inputState.guessing==0 ) { - statement_AST = (TNode)currentAST.root; - statement_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NLabel)).add(statement_AST)); - currentAST.root = statement_AST; - currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? - statement_AST.getFirstChild() : statement_AST; - currentAST.advanceChildToEnd(); - } - statement_AST = (TNode)currentAST.root; - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = statement_AST; - } - - public final void conditionalExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode conditionalExpr_AST = null; - - logicalOrExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case QUESTION: - { - TNode tmp145_AST = null; - tmp145_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp145_AST); - match(QUESTION); - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - expr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case COLON: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp146_AST = null; - tmp146_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp146_AST); - match(COLON); - conditionalExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_asm: - case RCURLY: - case SEMI: - case COMMA: - case COLON: - case ASSIGN: - case RPAREN: - case RBRACKET: - case VARARGS: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case LITERAL___attribute: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - conditionalExpr_AST = (TNode)currentAST.root; - returnAST = conditionalExpr_AST; - } - - public final void logicalOrExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode logicalOrExpr_AST = null; - - logicalAndExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop266: - do { - if ((LA(1)==LOR)) { - TNode tmp147_AST = null; - tmp147_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp147_AST); - match(LOR); - logicalAndExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop266; - } - - } while (true); - } - logicalOrExpr_AST = (TNode)currentAST.root; - returnAST = logicalOrExpr_AST; - } - - public final void castExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode castExpr_AST = null; - - boolean synPredMatched163 = false; - if (((LA(1)==LPAREN) && (_tokenSet_30.member(LA(2))))) { - int _m163 = mark(); - synPredMatched163 = true; - inputState.guessing++; - try { - { - match(LPAREN); - typeName(); - match(RPAREN); - } - } - catch (RecognitionException pe) { - synPredMatched163 = false; - } - rewind(_m163); - inputState.guessing--; - } - if ( synPredMatched163 ) { - TNode tmp148_AST = null; - tmp148_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp148_AST); - match(LPAREN); - typeName(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp149_AST = null; - tmp149_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp149_AST); - match(RPAREN); - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - castExpr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LCURLY: - { - lcurlyInitializer(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - castExpr_AST = (TNode)currentAST.root; - castExpr_AST.setType(NCast); - } - castExpr_AST = (TNode)currentAST.root; - } - else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_46.member(LA(2)))) { - unaryExpr(); - astFactory.addASTChild(currentAST, returnAST); - castExpr_AST = (TNode)currentAST.root; - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - returnAST = castExpr_AST; - } - - public final void unaryExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode unaryExpr_AST = null; - TNode u_AST = null; - - switch ( LA(1)) { - case ID: - case LPAREN: - case CharLiteral: - case StringLiteral: - case Number: - { - postfixExpr(); - astFactory.addASTChild(currentAST, returnAST); - unaryExpr_AST = (TNode)currentAST.root; - break; - } - case INC: - { - TNode tmp150_AST = null; - tmp150_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp150_AST); - match(INC); - castExpr(); - astFactory.addASTChild(currentAST, returnAST); - unaryExpr_AST = (TNode)currentAST.root; - break; - } - case DEC: - { - TNode tmp151_AST = null; - tmp151_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp151_AST); - match(DEC); - castExpr(); - astFactory.addASTChild(currentAST, returnAST); - unaryExpr_AST = (TNode)currentAST.root; - break; - } - case STAR: - case LAND: - case BAND: - case PLUS: - case MINUS: - case BNOT: - case LNOT: - case LITERAL___real: - case LITERAL___imag: - { - unaryOperator(); - u_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - castExpr(); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - unaryExpr_AST = (TNode)currentAST.root; - unaryExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NUnaryExpr)).add(unaryExpr_AST)); - currentAST.root = unaryExpr_AST; - currentAST.child = unaryExpr_AST!=null &&unaryExpr_AST.getFirstChild()!=null ? - unaryExpr_AST.getFirstChild() : unaryExpr_AST; - currentAST.advanceChildToEnd(); - } - unaryExpr_AST = (TNode)currentAST.root; - break; - } - case LITERAL_sizeof: - { - TNode tmp152_AST = null; - tmp152_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp152_AST); - match(LITERAL_sizeof); - { - boolean synPredMatched184 = false; - if (((LA(1)==LPAREN) && (_tokenSet_30.member(LA(2))))) { - int _m184 = mark(); - synPredMatched184 = true; - inputState.guessing++; - try { - { - match(LPAREN); - typeName(); - } - } - catch (RecognitionException pe) { - synPredMatched184 = false; - } - rewind(_m184); - inputState.guessing--; - } - if ( synPredMatched184 ) { - TNode tmp153_AST = null; - tmp153_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp153_AST); - match(LPAREN); - typeName(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp154_AST = null; - tmp154_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp154_AST); - match(RPAREN); - } - else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_46.member(LA(2)))) { - unaryExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - unaryExpr_AST = (TNode)currentAST.root; - break; - } - case LITERAL___alignof: - { - TNode tmp155_AST = null; - tmp155_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp155_AST); - match(LITERAL___alignof); - { - boolean synPredMatched187 = false; - if (((LA(1)==LPAREN) && (_tokenSet_30.member(LA(2))))) { - int _m187 = mark(); - synPredMatched187 = true; - inputState.guessing++; - try { - { - match(LPAREN); - typeName(); - } - } - catch (RecognitionException pe) { - synPredMatched187 = false; - } - rewind(_m187); - inputState.guessing--; - } - if ( synPredMatched187 ) { - TNode tmp156_AST = null; - tmp156_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp156_AST); - match(LPAREN); - typeName(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp157_AST = null; - tmp157_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp157_AST); - match(RPAREN); - } - else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_46.member(LA(2)))) { - unaryExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - unaryExpr_AST = (TNode)currentAST.root; - break; - } - case LITERAL_asm: - { - gnuAsmExpr(); - astFactory.addASTChild(currentAST, returnAST); - unaryExpr_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = unaryExpr_AST; - } - - public final void nonemptyAbstractDeclarator() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode nonemptyAbstractDeclarator_AST = null; - - { - switch ( LA(1)) { - case STAR: - { - pointerGroup(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop173: - do { - switch ( LA(1)) { - case LPAREN: - { - { - TNode tmp158_AST = null; - tmp158_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp158_AST); - match(LPAREN); - { - switch ( LA(1)) { - case STAR: - case LPAREN: - case LBRACKET: - { - nonemptyAbstractDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_typedef: - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_auto: - case LITERAL_register: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case ID: - case LITERAL_inline: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - parameterTypeList(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case COMMA: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - switch ( LA(1)) { - case COMMA: - { - match(COMMA); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp160_AST = null; - tmp160_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp160_AST); - match(RPAREN); - } - break; - } - case LBRACKET: - { - { - TNode tmp161_AST = null; - tmp161_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp161_AST); - match(LBRACKET); - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - expr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp162_AST = null; - tmp162_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp162_AST); - match(RBRACKET); - } - break; - } - default: - { - break _loop173; - } - } - } while (true); - } - break; - } - case LPAREN: - case LBRACKET: - { - { - int _cnt180=0; - _loop180: - do { - switch ( LA(1)) { - case LPAREN: - { - { - TNode tmp163_AST = null; - tmp163_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp163_AST); - match(LPAREN); - { - switch ( LA(1)) { - case STAR: - case LPAREN: - case LBRACKET: - { - nonemptyAbstractDeclarator(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LITERAL_typedef: - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_auto: - case LITERAL_register: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case ID: - case LITERAL_inline: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - parameterTypeList(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case COMMA: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - switch ( LA(1)) { - case COMMA: - { - match(COMMA); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp165_AST = null; - tmp165_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp165_AST); - match(RPAREN); - } - break; - } - case LBRACKET: - { - { - TNode tmp166_AST = null; - tmp166_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp166_AST); - match(LBRACKET); - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - expr(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp167_AST = null; - tmp167_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp167_AST); - match(RBRACKET); - } - break; - } - default: - { - if ( _cnt180>=1 ) { break _loop180; } else {throw new NoViableAltException(LT(1), getFilename());} - } - } - _cnt180++; - } while (true); - } - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - if ( inputState.guessing==0 ) { - nonemptyAbstractDeclarator_AST = (TNode)currentAST.root; - nonemptyAbstractDeclarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NNonemptyAbstractDeclarator)).add(nonemptyAbstractDeclarator_AST)); - currentAST.root = nonemptyAbstractDeclarator_AST; - currentAST.child = nonemptyAbstractDeclarator_AST!=null &&nonemptyAbstractDeclarator_AST.getFirstChild()!=null ? - nonemptyAbstractDeclarator_AST.getFirstChild() : nonemptyAbstractDeclarator_AST; - currentAST.advanceChildToEnd(); - } - nonemptyAbstractDeclarator_AST = (TNode)currentAST.root; - returnAST = nonemptyAbstractDeclarator_AST; - } - - public final void postfixExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode postfixExpr_AST = null; - - primaryExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case LPAREN: - case LBRACKET: - case INC: - case DEC: - case PTR: - case DOT: - { - postfixSuffix(); - astFactory.addASTChild(currentAST, returnAST); - if ( inputState.guessing==0 ) { - postfixExpr_AST = (TNode)currentAST.root; - postfixExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NPostfixExpr)).add(postfixExpr_AST)); - currentAST.root = postfixExpr_AST; - currentAST.child = postfixExpr_AST!=null &&postfixExpr_AST.getFirstChild()!=null ? - postfixExpr_AST.getFirstChild() : postfixExpr_AST; - currentAST.advanceChildToEnd(); - } - break; - } - case LITERAL_asm: - case RCURLY: - case SEMI: - case COMMA: - case COLON: - case ASSIGN: - case STAR: - case RPAREN: - case RBRACKET: - case VARARGS: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case LITERAL___attribute: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - postfixExpr_AST = (TNode)currentAST.root; - returnAST = postfixExpr_AST; - } - - public final void unaryOperator() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode unaryOperator_AST = null; - - switch ( LA(1)) { - case BAND: - { - TNode tmp168_AST = null; - tmp168_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp168_AST); - match(BAND); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case STAR: - { - TNode tmp169_AST = null; - tmp169_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp169_AST); - match(STAR); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case PLUS: - { - TNode tmp170_AST = null; - tmp170_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp170_AST); - match(PLUS); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case MINUS: - { - TNode tmp171_AST = null; - tmp171_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp171_AST); - match(MINUS); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case BNOT: - { - TNode tmp172_AST = null; - tmp172_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp172_AST); - match(BNOT); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case LNOT: - { - TNode tmp173_AST = null; - tmp173_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp173_AST); - match(LNOT); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case LAND: - { - TNode tmp174_AST = null; - tmp174_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp174_AST); - match(LAND); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case LITERAL___real: - { - TNode tmp175_AST = null; - tmp175_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp175_AST); - match(LITERAL___real); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - case LITERAL___imag: - { - TNode tmp176_AST = null; - tmp176_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp176_AST); - match(LITERAL___imag); - unaryOperator_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = unaryOperator_AST; - } - - public final void gnuAsmExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode gnuAsmExpr_AST = null; - - TNode tmp177_AST = null; - tmp177_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp177_AST); - match(LITERAL_asm); - { - switch ( LA(1)) { - case LITERAL_volatile: - { - TNode tmp178_AST = null; - tmp178_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp178_AST); - match(LITERAL_volatile); - break; - } - case LPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp179_AST = null; - tmp179_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp179_AST); - match(LPAREN); - stringConst(); - astFactory.addASTChild(currentAST, returnAST); - { - if ((LA(1)==COLON) && (_tokenSet_47.member(LA(2)))) { - TNode tmp180_AST = null; - tmp180_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp180_AST); - match(COLON); - { - switch ( LA(1)) { - case StringLiteral: - { - strOptExprPair(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop194: - do { - if ((LA(1)==COMMA)) { - TNode tmp181_AST = null; - tmp181_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp181_AST); - match(COMMA); - strOptExprPair(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop194; - } - - } while (true); - } - break; - } - case COLON: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - { - if ((LA(1)==COLON) && (_tokenSet_47.member(LA(2)))) { - TNode tmp182_AST = null; - tmp182_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp182_AST); - match(COLON); - { - switch ( LA(1)) { - case StringLiteral: - { - strOptExprPair(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop198: - do { - if ((LA(1)==COMMA)) { - TNode tmp183_AST = null; - tmp183_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp183_AST); - match(COMMA); - strOptExprPair(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop198; - } - - } while (true); - } - break; - } - case COLON: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - } - else if ((LA(1)==COLON||LA(1)==RPAREN) && (_tokenSet_48.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - } - else if ((LA(1)==COLON||LA(1)==RPAREN) && (_tokenSet_48.member(LA(2)))) { - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - - } - { - switch ( LA(1)) { - case COLON: - { - TNode tmp184_AST = null; - tmp184_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp184_AST); - match(COLON); - stringConst(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop201: - do { - if ((LA(1)==COMMA)) { - TNode tmp185_AST = null; - tmp185_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp185_AST); - match(COMMA); - stringConst(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop201; - } - - } while (true); - } - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp186_AST = null; - tmp186_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp186_AST); - match(RPAREN); - if ( inputState.guessing==0 ) { - gnuAsmExpr_AST = (TNode)currentAST.root; - gnuAsmExpr_AST.setType(NGnuAsmExpr); - } - gnuAsmExpr_AST = (TNode)currentAST.root; - returnAST = gnuAsmExpr_AST; - } - - public final void strOptExprPair() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode strOptExprPair_AST = null; - - stringConst(); - astFactory.addASTChild(currentAST, returnAST); - { - switch ( LA(1)) { - case LPAREN: - { - TNode tmp187_AST = null; - tmp187_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp187_AST); - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp188_AST = null; - tmp188_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp188_AST); - match(RPAREN); - break; - } - case COMMA: - case COLON: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - strOptExprPair_AST = (TNode)currentAST.root; - returnAST = strOptExprPair_AST; - } - - public final void primaryExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode primaryExpr_AST = null; - - switch ( LA(1)) { - case ID: - { - TNode tmp189_AST = null; - tmp189_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp189_AST); - match(ID); - primaryExpr_AST = (TNode)currentAST.root; - break; - } - case Number: - { - TNode tmp190_AST = null; - tmp190_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp190_AST); - match(Number); - primaryExpr_AST = (TNode)currentAST.root; - break; - } - case CharLiteral: - { - charConst(); - astFactory.addASTChild(currentAST, returnAST); - primaryExpr_AST = (TNode)currentAST.root; - break; - } - case StringLiteral: - { - stringConst(); - astFactory.addASTChild(currentAST, returnAST); - primaryExpr_AST = (TNode)currentAST.root; - break; - } - default: - boolean synPredMatched206 = false; - if (((LA(1)==LPAREN) && (LA(2)==LCURLY))) { - int _m206 = mark(); - synPredMatched206 = true; - inputState.guessing++; - try { - { - match(LPAREN); - match(LCURLY); - } - } - catch (RecognitionException pe) { - synPredMatched206 = false; - } - rewind(_m206); - inputState.guessing--; - } - if ( synPredMatched206 ) { - TNode tmp191_AST = null; - tmp191_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp191_AST); - match(LPAREN); - compoundStatement(getAScopeName()); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp192_AST = null; - tmp192_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp192_AST); - match(RPAREN); - primaryExpr_AST = (TNode)currentAST.root; - } - else if ((LA(1)==LPAREN) && (_tokenSet_2.member(LA(2)))) { - TNode tmp193_AST = null; - tmp193_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp193_AST); - match(LPAREN); - expr(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp194_AST = null; - tmp194_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp194_AST); - match(RPAREN); - if ( inputState.guessing==0 ) { - primaryExpr_AST = (TNode)currentAST.root; - primaryExpr_AST.setType(NExpressionGroup); - } - primaryExpr_AST = (TNode)currentAST.root; - } - else { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = primaryExpr_AST; - } - - protected final void charConst() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode charConst_AST = null; - - TNode tmp195_AST = null; - tmp195_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp195_AST); - match(CharLiteral); - charConst_AST = (TNode)currentAST.root; - returnAST = charConst_AST; - } - - public final void storageClassSpecifier() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode storageClassSpecifier_AST = null; - - switch ( LA(1)) { - case LITERAL_auto: - { - TNode tmp196_AST = null; - tmp196_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp196_AST); - match(LITERAL_auto); - storageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_register: - { - TNode tmp197_AST = null; - tmp197_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp197_AST); - match(LITERAL_register); - storageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_typedef: - { - TNode tmp198_AST = null; - tmp198_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp198_AST); - match(LITERAL_typedef); - storageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_extern: - case LITERAL_static: - case LITERAL_inline: - { - functionStorageClassSpecifier(); - astFactory.addASTChild(currentAST, returnAST); - storageClassSpecifier_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = storageClassSpecifier_AST; - } - - public final void typeQualifier() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode typeQualifier_AST = null; - - switch ( LA(1)) { - case LITERAL_const: - { - TNode tmp199_AST = null; - tmp199_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp199_AST); - match(LITERAL_const); - typeQualifier_AST = (TNode)currentAST.root; - break; - } - case LITERAL_volatile: - { - TNode tmp200_AST = null; - tmp200_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp200_AST); - match(LITERAL_volatile); - typeQualifier_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = typeQualifier_AST; - } - - public final void assignOperator() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode assignOperator_AST = null; - - switch ( LA(1)) { - case ASSIGN: - { - TNode tmp201_AST = null; - tmp201_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp201_AST); - match(ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case DIV_ASSIGN: - { - TNode tmp202_AST = null; - tmp202_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp202_AST); - match(DIV_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case PLUS_ASSIGN: - { - TNode tmp203_AST = null; - tmp203_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp203_AST); - match(PLUS_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case MINUS_ASSIGN: - { - TNode tmp204_AST = null; - tmp204_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp204_AST); - match(MINUS_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case STAR_ASSIGN: - { - TNode tmp205_AST = null; - tmp205_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp205_AST); - match(STAR_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case MOD_ASSIGN: - { - TNode tmp206_AST = null; - tmp206_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp206_AST); - match(MOD_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case RSHIFT_ASSIGN: - { - TNode tmp207_AST = null; - tmp207_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp207_AST); - match(RSHIFT_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case LSHIFT_ASSIGN: - { - TNode tmp208_AST = null; - tmp208_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp208_AST); - match(LSHIFT_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case BAND_ASSIGN: - { - TNode tmp209_AST = null; - tmp209_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp209_AST); - match(BAND_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case BOR_ASSIGN: - { - TNode tmp210_AST = null; - tmp210_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp210_AST); - match(BOR_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - case BXOR_ASSIGN: - { - TNode tmp211_AST = null; - tmp211_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp211_AST); - match(BXOR_ASSIGN); - assignOperator_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = assignOperator_AST; - } - - public final void logicalAndExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode logicalAndExpr_AST = null; - - inclusiveOrExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop269: - do { - if ((LA(1)==LAND)) { - TNode tmp212_AST = null; - tmp212_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp212_AST); - match(LAND); - inclusiveOrExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop269; - } - - } while (true); - } - logicalAndExpr_AST = (TNode)currentAST.root; - returnAST = logicalAndExpr_AST; - } - - public final void inclusiveOrExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode inclusiveOrExpr_AST = null; - - exclusiveOrExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop272: - do { - if ((LA(1)==BOR)) { - TNode tmp213_AST = null; - tmp213_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp213_AST); - match(BOR); - exclusiveOrExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop272; - } - - } while (true); - } - inclusiveOrExpr_AST = (TNode)currentAST.root; - returnAST = inclusiveOrExpr_AST; - } - - public final void exclusiveOrExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode exclusiveOrExpr_AST = null; - - bitAndExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop275: - do { - if ((LA(1)==BXOR)) { - TNode tmp214_AST = null; - tmp214_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp214_AST); - match(BXOR); - bitAndExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop275; - } - - } while (true); - } - exclusiveOrExpr_AST = (TNode)currentAST.root; - returnAST = exclusiveOrExpr_AST; - } - - public final void bitAndExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode bitAndExpr_AST = null; - - equalityExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop278: - do { - if ((LA(1)==BAND)) { - TNode tmp215_AST = null; - tmp215_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp215_AST); - match(BAND); - equalityExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop278; - } - - } while (true); - } - bitAndExpr_AST = (TNode)currentAST.root; - returnAST = bitAndExpr_AST; - } - - public final void equalityExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode equalityExpr_AST = null; - - relationalExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop282: - do { - if ((LA(1)==EQUAL||LA(1)==NOT_EQUAL)) { - { - switch ( LA(1)) { - case EQUAL: - { - TNode tmp216_AST = null; - tmp216_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp216_AST); - match(EQUAL); - break; - } - case NOT_EQUAL: - { - TNode tmp217_AST = null; - tmp217_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp217_AST); - match(NOT_EQUAL); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - relationalExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop282; - } - - } while (true); - } - equalityExpr_AST = (TNode)currentAST.root; - returnAST = equalityExpr_AST; - } - - public final void relationalExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode relationalExpr_AST = null; - - shiftExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop286: - do { - if (((LA(1) >= LT && LA(1) <= GTE))) { - { - switch ( LA(1)) { - case LT: - { - TNode tmp218_AST = null; - tmp218_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp218_AST); - match(LT); - break; - } - case LTE: - { - TNode tmp219_AST = null; - tmp219_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp219_AST); - match(LTE); - break; - } - case GT: - { - TNode tmp220_AST = null; - tmp220_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp220_AST); - match(GT); - break; - } - case GTE: - { - TNode tmp221_AST = null; - tmp221_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp221_AST); - match(GTE); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - shiftExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop286; - } - - } while (true); - } - relationalExpr_AST = (TNode)currentAST.root; - returnAST = relationalExpr_AST; - } - - public final void shiftExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode shiftExpr_AST = null; - - additiveExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop290: - do { - if ((LA(1)==LSHIFT||LA(1)==RSHIFT)) { - { - switch ( LA(1)) { - case LSHIFT: - { - TNode tmp222_AST = null; - tmp222_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp222_AST); - match(LSHIFT); - break; - } - case RSHIFT: - { - TNode tmp223_AST = null; - tmp223_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp223_AST); - match(RSHIFT); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - additiveExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop290; - } - - } while (true); - } - shiftExpr_AST = (TNode)currentAST.root; - returnAST = shiftExpr_AST; - } - - public final void additiveExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode additiveExpr_AST = null; - - multExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop294: - do { - if ((LA(1)==PLUS||LA(1)==MINUS)) { - { - switch ( LA(1)) { - case PLUS: - { - TNode tmp224_AST = null; - tmp224_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp224_AST); - match(PLUS); - break; - } - case MINUS: - { - TNode tmp225_AST = null; - tmp225_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp225_AST); - match(MINUS); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - multExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop294; - } - - } while (true); - } - additiveExpr_AST = (TNode)currentAST.root; - returnAST = additiveExpr_AST; - } - - public final void multExpr() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode multExpr_AST = null; - - castExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop298: - do { - if ((_tokenSet_49.member(LA(1)))) { - { - switch ( LA(1)) { - case STAR: - { - TNode tmp226_AST = null; - tmp226_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp226_AST); - match(STAR); - break; - } - case DIV: - { - TNode tmp227_AST = null; - tmp227_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp227_AST); - match(DIV); - break; - } - case MOD: - { - TNode tmp228_AST = null; - tmp228_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp228_AST); - match(MOD); - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - castExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop298; - } - - } while (true); - } - multExpr_AST = (TNode)currentAST.root; - returnAST = multExpr_AST; - } - - public final void postfixSuffix() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode postfixSuffix_AST = null; - - { - int _cnt305=0; - _loop305: - do { - switch ( LA(1)) { - case PTR: - { - TNode tmp229_AST = null; - tmp229_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp229_AST); - match(PTR); - TNode tmp230_AST = null; - tmp230_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp230_AST); - match(ID); - break; - } - case DOT: - { - TNode tmp231_AST = null; - tmp231_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp231_AST); - match(DOT); - TNode tmp232_AST = null; - tmp232_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp232_AST); - match(ID); - break; - } - case LPAREN: - { - functionCall(); - astFactory.addASTChild(currentAST, returnAST); - break; - } - case LBRACKET: - { - TNode tmp233_AST = null; - tmp233_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp233_AST); - match(LBRACKET); - expr(); - astFactory.addASTChild(currentAST, returnAST); - TNode tmp234_AST = null; - tmp234_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp234_AST); - match(RBRACKET); - break; - } - case INC: - { - TNode tmp235_AST = null; - tmp235_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp235_AST); - match(INC); - break; - } - case DEC: - { - TNode tmp236_AST = null; - tmp236_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp236_AST); - match(DEC); - break; - } - default: - { - if ( _cnt305>=1 ) { break _loop305; } else {throw new NoViableAltException(LT(1), getFilename());} - } - } - _cnt305++; - } while (true); - } - postfixSuffix_AST = (TNode)currentAST.root; - returnAST = postfixSuffix_AST; - } - - public final void functionCall() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode functionCall_AST = null; - TNode a_AST = null; - - TNode tmp237_AST = null; - tmp237_AST = (TNode)astFactory.create(LT(1)); - astFactory.makeASTRoot(currentAST, tmp237_AST); - match(LPAREN); - { - switch ( LA(1)) { - case LITERAL_asm: - case ID: - case STAR: - case LPAREN: - case LAND: - case BAND: - case PLUS: - case MINUS: - case INC: - case DEC: - case LITERAL_sizeof: - case BNOT: - case LNOT: - case CharLiteral: - case StringLiteral: - case Number: - case LITERAL___alignof: - case LITERAL___real: - case LITERAL___imag: - { - argExprList(); - a_AST = (TNode)returnAST; - astFactory.addASTChild(currentAST, returnAST); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - } - TNode tmp238_AST = null; - tmp238_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp238_AST); - match(RPAREN); - if ( inputState.guessing==0 ) { - functionCall_AST = (TNode)currentAST.root; - - functionCall_AST.setType( NFunctionCallArgs ); - - } - functionCall_AST = (TNode)currentAST.root; - returnAST = functionCall_AST; - } - - public final void argExprList() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode argExprList_AST = null; - - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - { - _loop310: - do { - if ((LA(1)==COMMA)) { - match(COMMA); - assignExpr(); - astFactory.addASTChild(currentAST, returnAST); - } - else { - break _loop310; - } - - } while (true); - } - argExprList_AST = (TNode)currentAST.root; - returnAST = argExprList_AST; - } - - protected final void intConst() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode intConst_AST = null; - - switch ( LA(1)) { - case IntOctalConst: - { - TNode tmp240_AST = null; - tmp240_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp240_AST); - match(IntOctalConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case LongOctalConst: - { - TNode tmp241_AST = null; - tmp241_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp241_AST); - match(LongOctalConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case UnsignedOctalConst: - { - TNode tmp242_AST = null; - tmp242_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp242_AST); - match(UnsignedOctalConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case IntIntConst: - { - TNode tmp243_AST = null; - tmp243_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp243_AST); - match(IntIntConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case LongIntConst: - { - TNode tmp244_AST = null; - tmp244_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp244_AST); - match(LongIntConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case UnsignedIntConst: - { - TNode tmp245_AST = null; - tmp245_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp245_AST); - match(UnsignedIntConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case IntHexConst: - { - TNode tmp246_AST = null; - tmp246_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp246_AST); - match(IntHexConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case LongHexConst: - { - TNode tmp247_AST = null; - tmp247_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp247_AST); - match(LongHexConst); - intConst_AST = (TNode)currentAST.root; - break; - } - case UnsignedHexConst: - { - TNode tmp248_AST = null; - tmp248_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp248_AST); - match(UnsignedHexConst); - intConst_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = intConst_AST; - } - - protected final void floatConst() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode floatConst_AST = null; - - switch ( LA(1)) { - case FloatDoubleConst: - { - TNode tmp249_AST = null; - tmp249_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp249_AST); - match(FloatDoubleConst); - floatConst_AST = (TNode)currentAST.root; - break; - } - case DoubleDoubleConst: - { - TNode tmp250_AST = null; - tmp250_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp250_AST); - match(DoubleDoubleConst); - floatConst_AST = (TNode)currentAST.root; - break; - } - case LongDoubleConst: - { - TNode tmp251_AST = null; - tmp251_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp251_AST); - match(LongDoubleConst); - floatConst_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = floatConst_AST; - } - - public final void dummy() throws RecognitionException, TokenStreamException { - - returnAST = null; - ASTPair currentAST = new ASTPair(); - TNode dummy_AST = null; - - switch ( LA(1)) { - case NTypedefName: - { - TNode tmp252_AST = null; - tmp252_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp252_AST); - match(NTypedefName); - dummy_AST = (TNode)currentAST.root; - break; - } - case NInitDecl: - { - TNode tmp253_AST = null; - tmp253_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp253_AST); - match(NInitDecl); - dummy_AST = (TNode)currentAST.root; - break; - } - case NDeclarator: - { - TNode tmp254_AST = null; - tmp254_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp254_AST); - match(NDeclarator); - dummy_AST = (TNode)currentAST.root; - break; - } - case NStructDeclarator: - { - TNode tmp255_AST = null; - tmp255_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp255_AST); - match(NStructDeclarator); - dummy_AST = (TNode)currentAST.root; - break; - } - case NDeclaration: - { - TNode tmp256_AST = null; - tmp256_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp256_AST); - match(NDeclaration); - dummy_AST = (TNode)currentAST.root; - break; - } - case NCast: - { - TNode tmp257_AST = null; - tmp257_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp257_AST); - match(NCast); - dummy_AST = (TNode)currentAST.root; - break; - } - case NPointerGroup: - { - TNode tmp258_AST = null; - tmp258_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp258_AST); - match(NPointerGroup); - dummy_AST = (TNode)currentAST.root; - break; - } - case NExpressionGroup: - { - TNode tmp259_AST = null; - tmp259_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp259_AST); - match(NExpressionGroup); - dummy_AST = (TNode)currentAST.root; - break; - } - case NFunctionCallArgs: - { - TNode tmp260_AST = null; - tmp260_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp260_AST); - match(NFunctionCallArgs); - dummy_AST = (TNode)currentAST.root; - break; - } - case NNonemptyAbstractDeclarator: - { - TNode tmp261_AST = null; - tmp261_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp261_AST); - match(NNonemptyAbstractDeclarator); - dummy_AST = (TNode)currentAST.root; - break; - } - case NInitializer: - { - TNode tmp262_AST = null; - tmp262_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp262_AST); - match(NInitializer); - dummy_AST = (TNode)currentAST.root; - break; - } - case NStatementExpr: - { - TNode tmp263_AST = null; - tmp263_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp263_AST); - match(NStatementExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NEmptyExpression: - { - TNode tmp264_AST = null; - tmp264_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp264_AST); - match(NEmptyExpression); - dummy_AST = (TNode)currentAST.root; - break; - } - case NParameterTypeList: - { - TNode tmp265_AST = null; - tmp265_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp265_AST); - match(NParameterTypeList); - dummy_AST = (TNode)currentAST.root; - break; - } - case NFunctionDef: - { - TNode tmp266_AST = null; - tmp266_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp266_AST); - match(NFunctionDef); - dummy_AST = (TNode)currentAST.root; - break; - } - case NCompoundStatement: - { - TNode tmp267_AST = null; - tmp267_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp267_AST); - match(NCompoundStatement); - dummy_AST = (TNode)currentAST.root; - break; - } - case NParameterDeclaration: - { - TNode tmp268_AST = null; - tmp268_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp268_AST); - match(NParameterDeclaration); - dummy_AST = (TNode)currentAST.root; - break; - } - case NCommaExpr: - { - TNode tmp269_AST = null; - tmp269_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp269_AST); - match(NCommaExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NUnaryExpr: - { - TNode tmp270_AST = null; - tmp270_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp270_AST); - match(NUnaryExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NLabel: - { - TNode tmp271_AST = null; - tmp271_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp271_AST); - match(NLabel); - dummy_AST = (TNode)currentAST.root; - break; - } - case NPostfixExpr: - { - TNode tmp272_AST = null; - tmp272_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp272_AST); - match(NPostfixExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NRangeExpr: - { - TNode tmp273_AST = null; - tmp273_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp273_AST); - match(NRangeExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NStringSeq: - { - TNode tmp274_AST = null; - tmp274_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp274_AST); - match(NStringSeq); - dummy_AST = (TNode)currentAST.root; - break; - } - case NInitializerElementLabel: - { - TNode tmp275_AST = null; - tmp275_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp275_AST); - match(NInitializerElementLabel); - dummy_AST = (TNode)currentAST.root; - break; - } - case NLcurlyInitializer: - { - TNode tmp276_AST = null; - tmp276_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp276_AST); - match(NLcurlyInitializer); - dummy_AST = (TNode)currentAST.root; - break; - } - case NAsmAttribute: - { - TNode tmp277_AST = null; - tmp277_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp277_AST); - match(NAsmAttribute); - dummy_AST = (TNode)currentAST.root; - break; - } - case NGnuAsmExpr: - { - TNode tmp278_AST = null; - tmp278_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp278_AST); - match(NGnuAsmExpr); - dummy_AST = (TNode)currentAST.root; - break; - } - case NTypeMissing: - { - TNode tmp279_AST = null; - tmp279_AST = (TNode)astFactory.create(LT(1)); - astFactory.addASTChild(currentAST, tmp279_AST); - match(NTypeMissing); - dummy_AST = (TNode)currentAST.root; - break; - } - default: - { - throw new NoViableAltException(LT(1), getFilename()); - } - } - returnAST = dummy_AST; - } - - - public static final String[] _tokenNames = { - "<0>", - "EOF", - "<2>", - "NULL_TREE_LOOKAHEAD", - "\"typedef\"", - "\"asm\"", - "\"volatile\"", - "LCURLY", - "RCURLY", - "SEMI", - "\"struct\"", - "\"union\"", - "\"enum\"", - "\"auto\"", - "\"register\"", - "\"extern\"", - "\"static\"", - "\"const\"", - "\"void\"", - "\"char\"", - "\"short\"", - "\"int\"", - "\"long\"", - "\"float\"", - "\"double\"", - "\"signed\"", - "\"unsigned\"", - "ID", - "COMMA", - "COLON", - "ASSIGN", - "STAR", - "LPAREN", - "RPAREN", - "LBRACKET", - "RBRACKET", - "VARARGS", - "\"while\"", - "\"do\"", - "\"for\"", - "\"goto\"", - "\"continue\"", - "\"break\"", - "\"return\"", - "\"case\"", - "\"default\"", - "\"if\"", - "\"else\"", - "\"switch\"", - "DIV_ASSIGN", - "PLUS_ASSIGN", - "MINUS_ASSIGN", - "STAR_ASSIGN", - "MOD_ASSIGN", - "RSHIFT_ASSIGN", - "LSHIFT_ASSIGN", - "BAND_ASSIGN", - "BOR_ASSIGN", - "BXOR_ASSIGN", - "QUESTION", - "LOR", - "LAND", - "BOR", - "BXOR", - "BAND", - "EQUAL", - "NOT_EQUAL", - "LT", - "LTE", - "GT", - "GTE", - "LSHIFT", - "RSHIFT", - "PLUS", - "MINUS", - "DIV", - "MOD", - "INC", - "DEC", - "\"sizeof\"", - "BNOT", - "LNOT", - "PTR", - "DOT", - "CharLiteral", - "StringLiteral", - "IntOctalConst", - "LongOctalConst", - "UnsignedOctalConst", - "IntIntConst", - "LongIntConst", - "UnsignedIntConst", - "IntHexConst", - "LongHexConst", - "UnsignedHexConst", - "FloatDoubleConst", - "DoubleDoubleConst", - "LongDoubleConst", - "NTypedefName", - "NInitDecl", - "NDeclarator", - "NStructDeclarator", - "NDeclaration", - "NCast", - "NPointerGroup", - "NExpressionGroup", - "NFunctionCallArgs", - "NNonemptyAbstractDeclarator", - "NInitializer", - "NStatementExpr", - "NEmptyExpression", - "NParameterTypeList", - "NFunctionDef", - "NCompoundStatement", - "NParameterDeclaration", - "NCommaExpr", - "NUnaryExpr", - "NLabel", - "NPostfixExpr", - "NRangeExpr", - "NStringSeq", - "NInitializerElementLabel", - "NLcurlyInitializer", - "NAsmAttribute", - "NGnuAsmExpr", - "NTypeMissing", - "Vocabulary", - "Whitespace", - "Comment", - "CPPComment", - "a line directive", - "Space", - "LineDirective", - "BadStringLiteral", - "Escape", - "Digit", - "LongSuffix", - "UnsignedSuffix", - "FloatSuffix", - "Exponent", - "Number", - "\"__label__\"", - "\"inline\"", - "\"byte\"", - "\"boolean\"", - "\"Servo\"", - "\"Wire\"", - "\"typeof\"", - "\"__complex\"", - "\"__attribute\"", - "\"__alignof\"", - "\"__real\"", - "\"__imag\"" - }; - - protected void buildTokenTypeASTClassMap() { - tokenTypeToASTClassMap=null; - }; - - private static final long[] mk_tokenSet_0() { - long[] data = { 6710886000L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); - private static final long[] mk_tokenSet_1() { - long[] data = { 6710886002L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); - private static final long[] mk_tokenSet_2() { - long[] data = { 2305843015790362656L, 3401217L, 29364224L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); - private static final long[] mk_tokenSet_3() { - long[] data = { 268434512L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); - private static final long[] mk_tokenSet_4() { - long[] data = { 6710886096L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); - private static final long[] mk_tokenSet_5() { - long[] data = { 6710860864L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); - private static final long[] mk_tokenSet_6() { - long[] data = { 92610232016L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6()); - private static final long[] mk_tokenSet_7() { - long[] data = { 6576668672L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7()); - private static final long[] mk_tokenSet_8() { - long[] data = { 25635717728L, 0L, 2097152L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8()); - private static final long[] mk_tokenSet_9() { - long[] data = { 2306265159670169586L, 3401217L, 31453184L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9()); - private static final long[] mk_tokenSet_10() { - long[] data = { 268409920L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10()); - private static final long[] mk_tokenSet_11() { - long[] data = { 6710860992L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11()); - private static final long[] mk_tokenSet_12() { - long[] data = { 268180480L, 0L, 2064384L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); - private static final long[] mk_tokenSet_13() { - long[] data = { 2305843032970231968L, 3925505L, 29364224L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13()); - private static final long[] mk_tokenSet_14() { - long[] data = { -562924183740448L, 4194303L, 31428608L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_14 = new BitSet(mk_tokenSet_14()); - private static final long[] mk_tokenSet_15() { - long[] data = { 17314086912L, 524288L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_15 = new BitSet(mk_tokenSet_15()); - private static final long[] mk_tokenSet_16() { - long[] data = { 2305843016327233568L, 3401217L, 29364224L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_16 = new BitSet(mk_tokenSet_16()); - private static final long[] mk_tokenSet_17() { - long[] data = { 2305843015790362784L, 3401217L, 29364224L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_17 = new BitSet(mk_tokenSet_17()); - private static final long[] mk_tokenSet_18() { - long[] data = { -562924720611360L, 4194303L, 31428608L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_18 = new BitSet(mk_tokenSet_18()); - private static final long[] mk_tokenSet_19() { - long[] data = { 2305843032970232224L, 3925505L, 29364224L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_19 = new BitSet(mk_tokenSet_19()); - private static final long[] mk_tokenSet_20() { - long[] data = { -576460659693314848L, 4194303L, 31428608L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_20 = new BitSet(mk_tokenSet_20()); - private static final long[] mk_tokenSet_21() { - long[] data = { -576460694053053216L, 4194303L, 31428608L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_21 = new BitSet(mk_tokenSet_21()); - private static final long[] mk_tokenSet_22() { - long[] data = { 32749125328L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_22 = new BitSet(mk_tokenSet_22()); - private static final long[] mk_tokenSet_23() { - long[] data = { 8992587776L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_23 = new BitSet(mk_tokenSet_23()); - private static final long[] mk_tokenSet_24() { - long[] data = { 100931731184L, 0L, 4177920L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_24 = new BitSet(mk_tokenSet_24()); - private static final long[] mk_tokenSet_25() { - long[] data = { 32615039552L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_25 = new BitSet(mk_tokenSet_25()); - private static final long[] mk_tokenSet_26() { - long[] data = { 23622320128L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_26 = new BitSet(mk_tokenSet_26()); - private static final long[] mk_tokenSet_27() { - long[] data = { 2305843076322557552L, 3401217L, 31444992L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_27 = new BitSet(mk_tokenSet_27()); - private static final long[] mk_tokenSet_28() { - long[] data = { 8858370560L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_28 = new BitSet(mk_tokenSet_28()); - private static final long[] mk_tokenSet_29() { - long[] data = { 2306265090950692848L, 3401217L, 31453184L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_29 = new BitSet(mk_tokenSet_29()); - private static final long[] mk_tokenSet_30() { - long[] data = { 268311616L, 0L, 2064384L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_30 = new BitSet(mk_tokenSet_30()); - private static final long[] mk_tokenSet_31() { - long[] data = { 32480566464L, 0L, 2064384L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_31 = new BitSet(mk_tokenSet_31()); - private static final long[] mk_tokenSet_32() { - long[] data = { -562916130677536L, 4194303L, 31428608L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_32 = new BitSet(mk_tokenSet_32()); - private static final long[] mk_tokenSet_33() { - long[] data = { 33285996144L, 0L, 4177920L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_33 = new BitSet(mk_tokenSet_33()); - private static final long[] mk_tokenSet_34() { - long[] data = { 33285873376L, 0L, 4161536L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_34 = new BitSet(mk_tokenSet_34()); - private static final long[] mk_tokenSet_35() { - long[] data = { 7381975584L, 0L, 2097152L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_35 = new BitSet(mk_tokenSet_35()); - private static final long[] mk_tokenSet_36() { - long[] data = { -13153337360L, -1L, 33554431L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_36 = new BitSet(mk_tokenSet_36()); - private static final long[] mk_tokenSet_37() { - long[] data = { 268434512L, 0L, 2088960L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_37 = new BitSet(mk_tokenSet_37()); - private static final long[] mk_tokenSet_38() { - long[] data = { 6710869056L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_38 = new BitSet(mk_tokenSet_38()); - private static final long[] mk_tokenSet_39() { - long[] data = { 23890754768L, 0L, 2080768L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_39 = new BitSet(mk_tokenSet_39()); - private static final long[] mk_tokenSet_40() { - long[] data = { 2306265090816475808L, 3401217L, 29364224L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_40 = new BitSet(mk_tokenSet_40()); - private static final long[] mk_tokenSet_41() { - long[] data = { -576460727875920672L, 4194303L, 31428608L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_41 = new BitSet(mk_tokenSet_41()); - private static final long[] mk_tokenSet_42() { - long[] data = { -111669149712L, 4194303L, 31453184L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_42 = new BitSet(mk_tokenSet_42()); - private static final long[] mk_tokenSet_43() { - long[] data = { 2306405828304831392L, 3401217L, 29364224L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_43 = new BitSet(mk_tokenSet_43()); - private static final long[] mk_tokenSet_44() { - long[] data = { -103079215118L, 4194303L, 31453184L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_44 = new BitSet(mk_tokenSet_44()); - private static final long[] mk_tokenSet_45() { - long[] data = { -562924720611616L, 4194303L, 31428608L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_45 = new BitSet(mk_tokenSet_45()); - private static final long[] mk_tokenSet_46() { - long[] data = { -562812648684576L, 4194303L, 31461376L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_46 = new BitSet(mk_tokenSet_46()); - private static final long[] mk_tokenSet_47() { - long[] data = { 9126805504L, 2097152L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_47 = new BitSet(mk_tokenSet_47()); - private static final long[] mk_tokenSet_48() { - long[] data = { -562834257738976L, 2105343L, 2097152L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_48 = new BitSet(mk_tokenSet_48()); - private static final long[] mk_tokenSet_49() { - long[] data = { 2147483648L, 6144L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_49 = new BitSet(mk_tokenSet_49()); - - } + +protected WParser(TokenBuffer tokenBuf, int k) { + super(tokenBuf,k); + tokenNames = _tokenNames; + buildTokenTypeASTClassMap(); + astFactory = new ASTFactory(getTokenTypeToASTClassMap()); +} + +public WParser(TokenBuffer tokenBuf) { + this(tokenBuf,2); +} + +protected WParser(TokenStream lexer, int k) { + super(lexer,k); + tokenNames = _tokenNames; + buildTokenTypeASTClassMap(); + astFactory = new ASTFactory(getTokenTypeToASTClassMap()); +} + +public WParser(TokenStream lexer) { + this(lexer,2); +} + +public WParser(ParserSharedInputState state) { + super(state,2); + tokenNames = _tokenNames; + buildTokenTypeASTClassMap(); + astFactory = new ASTFactory(getTokenTypeToASTClassMap()); +} + + public final void translationUnit() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode translationUnit_AST = null; + + { + switch ( LA(1)) { + case LITERAL_typedef: + case LITERAL_asm: + case LITERAL_volatile: + case SEMI: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_auto: + case LITERAL_register: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case ID: + case STAR: + case LPAREN: + case LITERAL_inline: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + externalList(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case EOF: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + translationUnit_AST = (TNode)currentAST.root; + returnAST = translationUnit_AST; + } + + public final void externalList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode externalList_AST = null; + + { + int _cnt209=0; + _loop209: + do { + if ((_tokenSet_0.member(LA(1)))) { + externalDef(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt209>=1 ) { break _loop209; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt209++; + } while (true); + } + externalList_AST = (TNode)currentAST.root; + returnAST = externalList_AST; + } + + public final void asm_expr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode asm_expr_AST = null; + + TNode tmp1_AST = null; + tmp1_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp1_AST); + match(LITERAL_asm); + { + switch ( LA(1)) { + case LITERAL_volatile: + { + TNode tmp2_AST = null; + tmp2_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp2_AST); + match(LITERAL_volatile); + break; + } + case LCURLY: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp3_AST = null; + tmp3_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp3_AST); + match(LCURLY); + expr(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp4_AST = null; + tmp4_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp4_AST); + match(RCURLY); + { + int _cnt6=0; + _loop6: + do { + if ((LA(1)==SEMI) && (_tokenSet_1.member(LA(2)))) { + TNode tmp5_AST = null; + tmp5_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp5_AST); + match(SEMI); + } + else { + if ( _cnt6>=1 ) { break _loop6; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt6++; + } while (true); + } + asm_expr_AST = (TNode)currentAST.root; + returnAST = asm_expr_AST; + } + + public final void expr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode expr_AST = null; + Token c = null; + TNode c_AST = null; + + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop259: + do { + if ((LA(1)==COMMA) && (_tokenSet_2.member(LA(2)))) { + c = LT(1); + c_AST = (TNode)astFactory.create(c); + astFactory.makeASTRoot(currentAST, c_AST); + match(COMMA); + if ( inputState.guessing==0 ) { + c_AST.setType(NCommaExpr); + } + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop259; + } + + } while (true); + } + expr_AST = (TNode)currentAST.root; + returnAST = expr_AST; + } + + public final void idList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode idList_AST = null; + + TNode tmp6_AST = null; + tmp6_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp6_AST); + match(ID); + { + _loop9: + do { + if ((LA(1)==COMMA) && (LA(2)==ID)) { + TNode tmp7_AST = null; + tmp7_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp7_AST); + match(COMMA); + TNode tmp8_AST = null; + tmp8_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp8_AST); + match(ID); + } + else { + break _loop9; + } + + } while (true); + } + idList_AST = (TNode)currentAST.root; + returnAST = idList_AST; + } + + public final void externalDef() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode externalDef_AST = null; + + switch ( LA(1)) { + case LITERAL_asm: + { + asm_expr(); + astFactory.addASTChild(currentAST, returnAST); + externalDef_AST = (TNode)currentAST.root; + break; + } + case SEMI: + { + TNode tmp9_AST = null; + tmp9_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp9_AST); + match(SEMI); + externalDef_AST = (TNode)currentAST.root; + break; + } + default: + boolean synPredMatched12 = false; + if (((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2))))) { + int _m12 = mark(); + synPredMatched12 = true; + inputState.guessing++; + try { + { + if ((LA(1)==LITERAL_typedef) && (true)) { + match(LITERAL_typedef); + } + else if ((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2)))) { + declaration(); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + } + catch (RecognitionException pe) { + synPredMatched12 = false; + } + rewind(_m12); + inputState.guessing--; + } + if ( synPredMatched12 ) { + declaration(); + astFactory.addASTChild(currentAST, returnAST); + externalDef_AST = (TNode)currentAST.root; + } + else { + boolean synPredMatched14 = false; + if (((_tokenSet_5.member(LA(1))) && (_tokenSet_6.member(LA(2))))) { + int _m14 = mark(); + synPredMatched14 = true; + inputState.guessing++; + try { + { + functionPrefix(); + } + } + catch (RecognitionException pe) { + synPredMatched14 = false; + } + rewind(_m14); + inputState.guessing--; + } + if ( synPredMatched14 ) { + functionDef(); + astFactory.addASTChild(currentAST, returnAST); + externalDef_AST = (TNode)currentAST.root; + } + else if ((_tokenSet_7.member(LA(1))) && (_tokenSet_8.member(LA(2)))) { + typelessDeclaration(); + astFactory.addASTChild(currentAST, returnAST); + externalDef_AST = (TNode)currentAST.root; + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + }} + returnAST = externalDef_AST; + } + + public final void declaration() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declaration_AST = null; + TNode ds_AST = null; + AST ds1 = null; + + declSpecifiers(); + ds_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + ds1 = astFactory.dupList(ds_AST); + } + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + { + initDeclList(ds1); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + int _cnt78=0; + _loop78: + do { + if ((LA(1)==SEMI) && (_tokenSet_9.member(LA(2)))) { + TNode tmp10_AST = null; + tmp10_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp10_AST); + match(SEMI); + } + else { + if ( _cnt78>=1 ) { break _loop78; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt78++; + } while (true); + } + if ( inputState.guessing==0 ) { + declaration_AST = (TNode)currentAST.root; + declaration_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NDeclaration)).add(declaration_AST)); + currentAST.root = declaration_AST; + currentAST.child = declaration_AST!=null &&declaration_AST.getFirstChild()!=null ? + declaration_AST.getFirstChild() : declaration_AST; + currentAST.advanceChildToEnd(); + } + declaration_AST = (TNode)currentAST.root; + returnAST = declaration_AST; + } + + public final void functionPrefix() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode functionPrefix_AST = null; + TNode ds_AST = null; + TNode d_AST = null; + String declName; + + { + boolean synPredMatched18 = false; + if (((_tokenSet_10.member(LA(1))) && (_tokenSet_11.member(LA(2))))) { + int _m18 = mark(); + synPredMatched18 = true; + inputState.guessing++; + try { + { + functionDeclSpecifiers(); + } + } + catch (RecognitionException pe) { + synPredMatched18 = false; + } + rewind(_m18); + inputState.guessing--; + } + if ( synPredMatched18 ) { + functionDeclSpecifiers(); + ds_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_7.member(LA(1))) && (_tokenSet_6.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + declName=declarator(true); + d_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + { + _loop20: + do { + if ((_tokenSet_3.member(LA(1)))) { + declaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop20; + } + + } while (true); + } + { + switch ( LA(1)) { + case VARARGS: + { + TNode tmp11_AST = null; + tmp11_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp11_AST); + match(VARARGS); + break; + } + case LCURLY: + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + _loop23: + do { + if ((LA(1)==SEMI)) { + TNode tmp12_AST = null; + tmp12_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp12_AST); + match(SEMI); + } + else { + break _loop23; + } + + } while (true); + } + TNode tmp13_AST = null; + tmp13_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp13_AST); + match(LCURLY); + functionPrefix_AST = (TNode)currentAST.root; + returnAST = functionPrefix_AST; + } + + public final void functionDef() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode functionDef_AST = null; + TNode ds_AST = null; + TNode d_AST = null; + String declName; + + { + boolean synPredMatched241 = false; + if (((_tokenSet_10.member(LA(1))) && (_tokenSet_11.member(LA(2))))) { + int _m241 = mark(); + synPredMatched241 = true; + inputState.guessing++; + try { + { + functionDeclSpecifiers(); + } + } + catch (RecognitionException pe) { + synPredMatched241 = false; + } + rewind(_m241); + inputState.guessing--; + } + if ( synPredMatched241 ) { + functionDeclSpecifiers(); + ds_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_7.member(LA(1))) && (_tokenSet_6.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + declName=declarator(true); + d_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + + AST d2, ds2; + d2 = astFactory.dupList(d_AST); + ds2 = astFactory.dupList(ds_AST); + symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds2).add(d2))); + pushScope(declName); + + } + { + _loop243: + do { + if ((_tokenSet_3.member(LA(1)))) { + declaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop243; + } + + } while (true); + } + { + switch ( LA(1)) { + case VARARGS: + { + TNode tmp14_AST = null; + tmp14_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp14_AST); + match(VARARGS); + break; + } + case LCURLY: + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + _loop246: + do { + if ((LA(1)==SEMI)) { + match(SEMI); + } + else { + break _loop246; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + popScope(); + } + compoundStatement(declName); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + functionDef_AST = (TNode)currentAST.root; + functionDef_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NFunctionDef)).add(functionDef_AST)); + currentAST.root = functionDef_AST; + currentAST.child = functionDef_AST!=null &&functionDef_AST.getFirstChild()!=null ? + functionDef_AST.getFirstChild() : functionDef_AST; + currentAST.advanceChildToEnd(); + } + functionDef_AST = (TNode)currentAST.root; + returnAST = functionDef_AST; + } + + public final void typelessDeclaration() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode typelessDeclaration_AST = null; + AST typeMissing = (TNode)astFactory.create(NTypeMissing); + + initDeclList(typeMissing); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp16_AST = null; + tmp16_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp16_AST); + match(SEMI); + if ( inputState.guessing==0 ) { + typelessDeclaration_AST = (TNode)currentAST.root; + typelessDeclaration_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NTypeMissing)).add(typelessDeclaration_AST)); + currentAST.root = typelessDeclaration_AST; + currentAST.child = typelessDeclaration_AST!=null &&typelessDeclaration_AST.getFirstChild()!=null ? + typelessDeclaration_AST.getFirstChild() : typelessDeclaration_AST; + currentAST.advanceChildToEnd(); + } + typelessDeclaration_AST = (TNode)currentAST.root; + returnAST = typelessDeclaration_AST; + } + + public final void functionDeclSpecifiers() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode functionDeclSpecifiers_AST = null; + int specCount = 0; + + { + int _cnt251=0; + _loop251: + do { + switch ( LA(1)) { + case LITERAL_extern: + case LITERAL_static: + case LITERAL_inline: + { + functionStorageClassSpecifier(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_volatile: + case LITERAL_const: + { + typeQualifier(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + default: + boolean synPredMatched250 = false; + if (((_tokenSet_12.member(LA(1))) && (_tokenSet_11.member(LA(2))))) { + int _m250 = mark(); + synPredMatched250 = true; + inputState.guessing++; + try { + { + if ((LA(1)==LITERAL_struct) && (true)) { + match(LITERAL_struct); + } + else if ((LA(1)==LITERAL_union) && (true)) { + match(LITERAL_union); + } + else if ((LA(1)==LITERAL_enum) && (true)) { + match(LITERAL_enum); + } + else if ((_tokenSet_12.member(LA(1))) && (true)) { + typeSpecifier(specCount); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + } + catch (RecognitionException pe) { + synPredMatched250 = false; + } + rewind(_m250); + inputState.guessing--; + } + if ( synPredMatched250 ) { + specCount=typeSpecifier(specCount); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt251>=1 ) { break _loop251; } else {throw new NoViableAltException(LT(1), getFilename());} + } + } + _cnt251++; + } while (true); + } + functionDeclSpecifiers_AST = (TNode)currentAST.root; + returnAST = functionDeclSpecifiers_AST; + } + + public final String declarator( + boolean isFunctionDefinition + ) throws RecognitionException, TokenStreamException { + String declName; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declarator_AST = null; + Token id = null; + TNode id_AST = null; + declName = ""; + + { + switch ( LA(1)) { + case STAR: + { + pointerGroup(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case ID: + case LPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case ID: + { + id = LT(1); + id_AST = (TNode)astFactory.create(id); + astFactory.addASTChild(currentAST, id_AST); + match(ID); + if ( inputState.guessing==0 ) { + declName = id.getText(); + } + break; + } + case LPAREN: + { + TNode tmp17_AST = null; + tmp17_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp17_AST); + match(LPAREN); + declName=declarator(false); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp18_AST = null; + tmp18_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp18_AST); + match(RPAREN); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + _loop50: + do { + switch ( LA(1)) { + case LPAREN: + { + declaratorParamaterList(isFunctionDefinition, declName); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LBRACKET: + { + TNode tmp19_AST = null; + tmp19_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp19_AST); + match(LBRACKET); + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + expr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp20_AST = null; + tmp20_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp20_AST); + match(RBRACKET); + break; + } + default: + { + break _loop50; + } + } + } while (true); + } + if ( inputState.guessing==0 ) { + declarator_AST = (TNode)currentAST.root; + declarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NDeclarator)).add(declarator_AST)); + currentAST.root = declarator_AST; + currentAST.child = declarator_AST!=null &&declarator_AST.getFirstChild()!=null ? + declarator_AST.getFirstChild() : declarator_AST; + currentAST.advanceChildToEnd(); + } + declarator_AST = (TNode)currentAST.root; + returnAST = declarator_AST; + return declName; + } + + public final void initDeclList( + AST declarationSpecifiers + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode initDeclList_AST = null; + + initDecl(declarationSpecifiers); + astFactory.addASTChild(currentAST, returnAST); + { + _loop115: + do { + if ((LA(1)==COMMA) && (_tokenSet_7.member(LA(2)))) { + match(COMMA); + initDecl(declarationSpecifiers); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop115; + } + + } while (true); + } + { + switch ( LA(1)) { + case COMMA: + { + match(COMMA); + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + initDeclList_AST = (TNode)currentAST.root; + returnAST = initDeclList_AST; + } + + public final void initializer() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode initializer_AST = null; + + { + if ((_tokenSet_13.member(LA(1))) && (_tokenSet_14.member(LA(2)))) { + { + { + boolean synPredMatched30 = false; + if (((_tokenSet_15.member(LA(1))) && (_tokenSet_16.member(LA(2))))) { + int _m30 = mark(); + synPredMatched30 = true; + inputState.guessing++; + try { + { + initializerElementLabel(); + } + } + catch (RecognitionException pe) { + synPredMatched30 = false; + } + rewind(_m30); + inputState.guessing--; + } + if ( synPredMatched30 ) { + initializerElementLabel(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_17.member(LA(1))) && (_tokenSet_18.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LCURLY: + { + lcurlyInitializer(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + initializer_AST = (TNode)currentAST.root; + initializer_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NInitializer)).add(initializer_AST)); + currentAST.root = initializer_AST; + currentAST.child = initializer_AST!=null &&initializer_AST.getFirstChild()!=null ? + initializer_AST.getFirstChild() : initializer_AST; + currentAST.advanceChildToEnd(); + } + } + } + else if ((LA(1)==LCURLY) && (_tokenSet_19.member(LA(2)))) { + lcurlyInitializer(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + initializer_AST = (TNode)currentAST.root; + returnAST = initializer_AST; + } + + public final void initializerElementLabel() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode initializerElementLabel_AST = null; + + { + switch ( LA(1)) { + case LBRACKET: + { + { + TNode tmp23_AST = null; + tmp23_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp23_AST); + match(LBRACKET); + { + boolean synPredMatched37 = false; + if (((_tokenSet_2.member(LA(1))) && (_tokenSet_20.member(LA(2))))) { + int _m37 = mark(); + synPredMatched37 = true; + inputState.guessing++; + try { + { + constExpr(); + match(VARARGS); + } + } + catch (RecognitionException pe) { + synPredMatched37 = false; + } + rewind(_m37); + inputState.guessing--; + } + if ( synPredMatched37 ) { + rangeExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_21.member(LA(2)))) { + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + TNode tmp24_AST = null; + tmp24_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp24_AST); + match(RBRACKET); + { + switch ( LA(1)) { + case ASSIGN: + { + TNode tmp25_AST = null; + tmp25_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp25_AST); + match(ASSIGN); + break; + } + case LITERAL_asm: + case LCURLY: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + } + break; + } + case ID: + { + TNode tmp26_AST = null; + tmp26_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp26_AST); + match(ID); + TNode tmp27_AST = null; + tmp27_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp27_AST); + match(COLON); + break; + } + case DOT: + { + TNode tmp28_AST = null; + tmp28_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp28_AST); + match(DOT); + TNode tmp29_AST = null; + tmp29_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp29_AST); + match(ID); + TNode tmp30_AST = null; + tmp30_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp30_AST); + match(ASSIGN); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + initializerElementLabel_AST = (TNode)currentAST.root; + initializerElementLabel_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NInitializerElementLabel)).add(initializerElementLabel_AST)) ; + currentAST.root = initializerElementLabel_AST; + currentAST.child = initializerElementLabel_AST!=null &&initializerElementLabel_AST.getFirstChild()!=null ? + initializerElementLabel_AST.getFirstChild() : initializerElementLabel_AST; + currentAST.advanceChildToEnd(); + } + initializerElementLabel_AST = (TNode)currentAST.root; + returnAST = initializerElementLabel_AST; + } + + public final void assignExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode assignExpr_AST = null; + TNode a_AST = null; + + conditionalExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case ASSIGN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + { + assignOperator(); + a_AST = (TNode)returnAST; + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + assignExpr_AST = (TNode)currentAST.root; + assignExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add(a_AST).add(assignExpr_AST)); + currentAST.root = assignExpr_AST; + currentAST.child = assignExpr_AST!=null &&assignExpr_AST.getFirstChild()!=null ? + assignExpr_AST.getFirstChild() : assignExpr_AST; + currentAST.advanceChildToEnd(); + } + break; + } + case RCURLY: + case SEMI: + case COMMA: + case COLON: + case RPAREN: + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + assignExpr_AST = (TNode)currentAST.root; + returnAST = assignExpr_AST; + } + + public final void lcurlyInitializer() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode lcurlyInitializer_AST = null; + + TNode tmp31_AST = null; + tmp31_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp31_AST); + match(LCURLY); + { + switch ( LA(1)) { + case LITERAL_asm: + case LCURLY: + case ID: + case STAR: + case LPAREN: + case LBRACKET: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case DOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + initializerList(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case COMMA: + { + match(COMMA); + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp33_AST = null; + tmp33_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp33_AST); + match(RCURLY); + if ( inputState.guessing==0 ) { + lcurlyInitializer_AST = (TNode)currentAST.root; + lcurlyInitializer_AST.setType( NLcurlyInitializer ); + } + lcurlyInitializer_AST = (TNode)currentAST.root; + returnAST = lcurlyInitializer_AST; + } + + public final void constExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode constExpr_AST = null; + + conditionalExpr(); + astFactory.addASTChild(currentAST, returnAST); + constExpr_AST = (TNode)currentAST.root; + returnAST = constExpr_AST; + } + + public final void rangeExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode rangeExpr_AST = null; + + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp34_AST = null; + tmp34_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp34_AST); + match(VARARGS); + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + rangeExpr_AST = (TNode)currentAST.root; + rangeExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NRangeExpr)).add(rangeExpr_AST)); + currentAST.root = rangeExpr_AST; + currentAST.child = rangeExpr_AST!=null &&rangeExpr_AST.getFirstChild()!=null ? + rangeExpr_AST.getFirstChild() : rangeExpr_AST; + currentAST.advanceChildToEnd(); + } + rangeExpr_AST = (TNode)currentAST.root; + returnAST = rangeExpr_AST; + } + + public final void initializerList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode initializerList_AST = null; + + initializer(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop44: + do { + if ((LA(1)==COMMA) && (_tokenSet_13.member(LA(2)))) { + match(COMMA); + initializer(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop44; + } + + } while (true); + } + initializerList_AST = (TNode)currentAST.root; + returnAST = initializerList_AST; + } + + public final void pointerGroup() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode pointerGroup_AST = null; + + { + int _cnt233=0; + _loop233: + do { + if ((LA(1)==STAR)) { + TNode tmp36_AST = null; + tmp36_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp36_AST); + match(STAR); + { + _loop232: + do { + if ((LA(1)==LITERAL_volatile||LA(1)==LITERAL_const)) { + typeQualifier(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop232; + } + + } while (true); + } + } + else { + if ( _cnt233>=1 ) { break _loop233; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt233++; + } while (true); + } + if ( inputState.guessing==0 ) { + pointerGroup_AST = (TNode)currentAST.root; + pointerGroup_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NPointerGroup)).add(pointerGroup_AST)); + currentAST.root = pointerGroup_AST; + currentAST.child = pointerGroup_AST!=null &&pointerGroup_AST.getFirstChild()!=null ? + pointerGroup_AST.getFirstChild() : pointerGroup_AST; + currentAST.advanceChildToEnd(); + } + pointerGroup_AST = (TNode)currentAST.root; + returnAST = pointerGroup_AST; + } + + public final void declaratorParamaterList( + boolean isFunctionDefinition, String declName + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declaratorParamaterList_AST = null; + + TNode tmp37_AST = null; + tmp37_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp37_AST); + match(LPAREN); + if ( inputState.guessing==0 ) { + + if (isFunctionDefinition) { + pushScope(declName); + } + else { + pushScope("!"+declName); + } + + } + { + boolean synPredMatched54 = false; + if (((_tokenSet_3.member(LA(1))) && (_tokenSet_22.member(LA(2))))) { + int _m54 = mark(); + synPredMatched54 = true; + inputState.guessing++; + try { + { + declSpecifiers(); + } + } + catch (RecognitionException pe) { + synPredMatched54 = false; + } + rewind(_m54); + inputState.guessing--; + } + if ( synPredMatched54 ) { + parameterTypeList(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_23.member(LA(1))) && (_tokenSet_24.member(LA(2)))) { + { + switch ( LA(1)) { + case ID: + { + idList(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case COMMA: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState.guessing==0 ) { + + popScope(); + + } + { + switch ( LA(1)) { + case COMMA: + { + match(COMMA); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp39_AST = null; + tmp39_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp39_AST); + match(RPAREN); + if ( inputState.guessing==0 ) { + declaratorParamaterList_AST = (TNode)currentAST.root; + declaratorParamaterList_AST.setType(NParameterTypeList); + } + declaratorParamaterList_AST = (TNode)currentAST.root; + returnAST = declaratorParamaterList_AST; + } + + public final void declSpecifiers() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declSpecifiers_AST = null; + TNode s_AST = null; + int specCount=0; + + { + int _cnt214=0; + _loop214: + do { + switch ( LA(1)) { + case LITERAL_typedef: + case LITERAL_auto: + case LITERAL_register: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_inline: + { + storageClassSpecifier(); + s_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_volatile: + case LITERAL_const: + { + typeQualifier(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + default: + boolean synPredMatched213 = false; + if (((_tokenSet_12.member(LA(1))) && (_tokenSet_22.member(LA(2))))) { + int _m213 = mark(); + synPredMatched213 = true; + inputState.guessing++; + try { + { + if ((LA(1)==LITERAL_struct) && (true)) { + match(LITERAL_struct); + } + else if ((LA(1)==LITERAL_union) && (true)) { + match(LITERAL_union); + } + else if ((LA(1)==LITERAL_enum) && (true)) { + match(LITERAL_enum); + } + else if ((_tokenSet_12.member(LA(1))) && (true)) { + typeSpecifier(specCount); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + } + catch (RecognitionException pe) { + synPredMatched213 = false; + } + rewind(_m213); + inputState.guessing--; + } + if ( synPredMatched213 ) { + specCount=typeSpecifier(specCount); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt214>=1 ) { break _loop214; } else {throw new NoViableAltException(LT(1), getFilename());} + } + } + _cnt214++; + } while (true); + } + declSpecifiers_AST = (TNode)currentAST.root; + returnAST = declSpecifiers_AST; + } + + public final void parameterTypeList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode parameterTypeList_AST = null; + + parameterDeclaration(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop60: + do { + if ((LA(1)==SEMI||LA(1)==COMMA) && (_tokenSet_3.member(LA(2)))) { + { + switch ( LA(1)) { + case COMMA: + { + TNode tmp40_AST = null; + tmp40_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp40_AST); + match(COMMA); + break; + } + case SEMI: + { + TNode tmp41_AST = null; + tmp41_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp41_AST); + match(SEMI); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + parameterDeclaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop60; + } + + } while (true); + } + { + if ((LA(1)==SEMI||LA(1)==COMMA) && (LA(2)==VARARGS)) { + { + switch ( LA(1)) { + case COMMA: + { + TNode tmp42_AST = null; + tmp42_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp42_AST); + match(COMMA); + break; + } + case SEMI: + { + TNode tmp43_AST = null; + tmp43_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp43_AST); + match(SEMI); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp44_AST = null; + tmp44_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp44_AST); + match(VARARGS); + } + else if ((LA(1)==COMMA||LA(1)==RPAREN) && (_tokenSet_24.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + parameterTypeList_AST = (TNode)currentAST.root; + returnAST = parameterTypeList_AST; + } + + public final void parameterDeclaration() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode parameterDeclaration_AST = null; + TNode ds_AST = null; + TNode d_AST = null; + String declName; + + declSpecifiers(); + ds_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + { + boolean synPredMatched237 = false; + if (((_tokenSet_7.member(LA(1))) && (_tokenSet_25.member(LA(2))))) { + int _m237 = mark(); + synPredMatched237 = true; + inputState.guessing++; + try { + { + declarator(false); + } + } + catch (RecognitionException pe) { + synPredMatched237 = false; + } + rewind(_m237); + inputState.guessing--; + } + if ( synPredMatched237 ) { + declName=declarator(false); + d_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + + AST d2, ds2; + d2 = astFactory.dupList(d_AST); + ds2 = astFactory.dupList(ds_AST); + symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds2).add(d2))); + + } + } + else if ((_tokenSet_26.member(LA(1))) && (_tokenSet_27.member(LA(2)))) { + nonemptyAbstractDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_28.member(LA(1)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState.guessing==0 ) { + parameterDeclaration_AST = (TNode)currentAST.root; + + parameterDeclaration_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NParameterDeclaration)).add(parameterDeclaration_AST)); + + currentAST.root = parameterDeclaration_AST; + currentAST.child = parameterDeclaration_AST!=null &¶meterDeclaration_AST.getFirstChild()!=null ? + parameterDeclaration_AST.getFirstChild() : parameterDeclaration_AST; + currentAST.advanceChildToEnd(); + } + parameterDeclaration_AST = (TNode)currentAST.root; + returnAST = parameterDeclaration_AST; + } + + public final void declarationList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declarationList_AST = null; + + { + int _cnt67=0; + _loop67: + do { + if ((LA(1)==LITERAL___label__) && (LA(2)==ID)) { + localLabelDeclaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + boolean synPredMatched66 = false; + if (((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2))))) { + int _m66 = mark(); + synPredMatched66 = true; + inputState.guessing++; + try { + { + declarationPredictor(); + } + } + catch (RecognitionException pe) { + synPredMatched66 = false; + } + rewind(_m66); + inputState.guessing--; + } + if ( synPredMatched66 ) { + declaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt67>=1 ) { break _loop67; } else {throw new NoViableAltException(LT(1), getFilename());} + } + } + _cnt67++; + } while (true); + } + declarationList_AST = (TNode)currentAST.root; + returnAST = declarationList_AST; + } + + public final void localLabelDeclaration() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode localLabelDeclaration_AST = null; + + { + TNode tmp45_AST = null; + tmp45_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp45_AST); + match(LITERAL___label__); + TNode tmp46_AST = null; + tmp46_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp46_AST); + match(ID); + { + _loop71: + do { + if ((LA(1)==COMMA) && (LA(2)==ID)) { + match(COMMA); + TNode tmp48_AST = null; + tmp48_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp48_AST); + match(ID); + } + else { + break _loop71; + } + + } while (true); + } + { + switch ( LA(1)) { + case COMMA: + { + match(COMMA); + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + int _cnt74=0; + _loop74: + do { + if ((LA(1)==SEMI) && (_tokenSet_29.member(LA(2)))) { + match(SEMI); + } + else { + if ( _cnt74>=1 ) { break _loop74; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt74++; + } while (true); + } + } + localLabelDeclaration_AST = (TNode)currentAST.root; + returnAST = localLabelDeclaration_AST; + } + + public final void declarationPredictor() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode declarationPredictor_AST = null; + + { + if ((LA(1)==LITERAL_typedef) && (LA(2)==EOF)) { + TNode tmp51_AST = null; + tmp51_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp51_AST); + match(LITERAL_typedef); + } + else if ((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2)))) { + declaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + declarationPredictor_AST = (TNode)currentAST.root; + returnAST = declarationPredictor_AST; + } + + public final void functionStorageClassSpecifier() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode functionStorageClassSpecifier_AST = null; + + switch ( LA(1)) { + case LITERAL_extern: + { + TNode tmp52_AST = null; + tmp52_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp52_AST); + match(LITERAL_extern); + functionStorageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_static: + { + TNode tmp53_AST = null; + tmp53_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp53_AST); + match(LITERAL_static); + functionStorageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_inline: + { + TNode tmp54_AST = null; + tmp54_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp54_AST); + match(LITERAL_inline); + functionStorageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = functionStorageClassSpecifier_AST; + } + + public final int typeSpecifier( + int specCount + ) throws RecognitionException, TokenStreamException { + int retSpecCount; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode typeSpecifier_AST = null; + retSpecCount = specCount + 1; + + { + switch ( LA(1)) { + case LITERAL_void: + { + TNode tmp55_AST = null; + tmp55_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp55_AST); + match(LITERAL_void); + break; + } + case LITERAL_char: + { + TNode tmp56_AST = null; + tmp56_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp56_AST); + match(LITERAL_char); + break; + } + case LITERAL_short: + { + TNode tmp57_AST = null; + tmp57_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp57_AST); + match(LITERAL_short); + break; + } + case LITERAL_int: + { + TNode tmp58_AST = null; + tmp58_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp58_AST); + match(LITERAL_int); + break; + } + case LITERAL_long: + { + TNode tmp59_AST = null; + tmp59_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp59_AST); + match(LITERAL_long); + break; + } + case LITERAL_float: + { + TNode tmp60_AST = null; + tmp60_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp60_AST); + match(LITERAL_float); + break; + } + case LITERAL_double: + { + TNode tmp61_AST = null; + tmp61_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp61_AST); + match(LITERAL_double); + break; + } + case LITERAL_signed: + { + TNode tmp62_AST = null; + tmp62_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp62_AST); + match(LITERAL_signed); + break; + } + case LITERAL_unsigned: + { + TNode tmp63_AST = null; + tmp63_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp63_AST); + match(LITERAL_unsigned); + break; + } + case LITERAL_byte: + { + TNode tmp64_AST = null; + tmp64_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp64_AST); + match(LITERAL_byte); + break; + } + case LITERAL_boolean: + { + TNode tmp65_AST = null; + tmp65_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp65_AST); + match(LITERAL_boolean); + break; + } + case LITERAL_Servo: + { + TNode tmp66_AST = null; + tmp66_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp66_AST); + match(LITERAL_Servo); + break; + } + case LITERAL_Wire: + { + TNode tmp67_AST = null; + tmp67_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp67_AST); + match(LITERAL_Wire); + break; + } + case LITERAL_struct: + case LITERAL_union: + { + structOrUnionSpecifier(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop83: + do { + if ((LA(1)==LITERAL_asm||LA(1)==LITERAL___attribute) && (LA(2)==LPAREN)) { + attributeDecl(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop83; + } + + } while (true); + } + break; + } + case LITERAL_enum: + { + enumSpecifier(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_typeof: + { + TNode tmp68_AST = null; + tmp68_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp68_AST); + match(LITERAL_typeof); + TNode tmp69_AST = null; + tmp69_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp69_AST); + match(LPAREN); + { + boolean synPredMatched86 = false; + if (((_tokenSet_30.member(LA(1))) && (_tokenSet_31.member(LA(2))))) { + int _m86 = mark(); + synPredMatched86 = true; + inputState.guessing++; + try { + { + typeName(); + } + } + catch (RecognitionException pe) { + synPredMatched86 = false; + } + rewind(_m86); + inputState.guessing--; + } + if ( synPredMatched86 ) { + typeName(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_32.member(LA(2)))) { + expr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + TNode tmp70_AST = null; + tmp70_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp70_AST); + match(RPAREN); + break; + } + case LITERAL___complex: + { + TNode tmp71_AST = null; + tmp71_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp71_AST); + match(LITERAL___complex); + break; + } + default: + if (((LA(1)==ID))&&( specCount==0 )) { + typedefName(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + typeSpecifier_AST = (TNode)currentAST.root; + returnAST = typeSpecifier_AST; + return retSpecCount; + } + + public final void structOrUnionSpecifier() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structOrUnionSpecifier_AST = null; + TNode sou_AST = null; + Token i = null; + TNode i_AST = null; + Token l = null; + TNode l_AST = null; + Token l1 = null; + TNode l1_AST = null; + String scopeName; + + structOrUnion(); + sou_AST = (TNode)returnAST; + { + boolean synPredMatched90 = false; + if (((LA(1)==ID) && (LA(2)==LCURLY))) { + int _m90 = mark(); + synPredMatched90 = true; + inputState.guessing++; + try { + { + match(ID); + match(LCURLY); + } + } + catch (RecognitionException pe) { + synPredMatched90 = false; + } + rewind(_m90); + inputState.guessing--; + } + if ( synPredMatched90 ) { + i = LT(1); + i_AST = (TNode)astFactory.create(i); + astFactory.addASTChild(currentAST, i_AST); + match(ID); + l = LT(1); + l_AST = (TNode)astFactory.create(l); + astFactory.addASTChild(currentAST, l_AST); + match(LCURLY); + if ( inputState.guessing==0 ) { + + scopeName = sou_AST.getText() + " " + i_AST.getText(); + l_AST.setText(scopeName); + pushScope(scopeName); + + } + { + switch ( LA(1)) { + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case ID: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + structDeclarationList(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + popScope(); + } + TNode tmp72_AST = null; + tmp72_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp72_AST); + match(RCURLY); + } + else if ((LA(1)==LCURLY)) { + l1 = LT(1); + l1_AST = (TNode)astFactory.create(l1); + astFactory.addASTChild(currentAST, l1_AST); + match(LCURLY); + if ( inputState.guessing==0 ) { + + scopeName = getAScopeName(); + l1_AST.setText(scopeName); + pushScope(scopeName); + + } + { + switch ( LA(1)) { + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case ID: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + structDeclarationList(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + popScope(); + } + TNode tmp73_AST = null; + tmp73_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp73_AST); + match(RCURLY); + } + else if ((LA(1)==ID) && (_tokenSet_33.member(LA(2)))) { + TNode tmp74_AST = null; + tmp74_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp74_AST); + match(ID); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState.guessing==0 ) { + structOrUnionSpecifier_AST = (TNode)currentAST.root; + + structOrUnionSpecifier_AST = (TNode)astFactory.make( (new ASTArray(2)).add(sou_AST).add(structOrUnionSpecifier_AST)); + + currentAST.root = structOrUnionSpecifier_AST; + currentAST.child = structOrUnionSpecifier_AST!=null &&structOrUnionSpecifier_AST.getFirstChild()!=null ? + structOrUnionSpecifier_AST.getFirstChild() : structOrUnionSpecifier_AST; + currentAST.advanceChildToEnd(); + } + structOrUnionSpecifier_AST = (TNode)currentAST.root; + returnAST = structOrUnionSpecifier_AST; + } + + public final void attributeDecl() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode attributeDecl_AST = null; + + switch ( LA(1)) { + case LITERAL___attribute: + { + TNode tmp75_AST = null; + tmp75_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp75_AST); + match(LITERAL___attribute); + TNode tmp76_AST = null; + tmp76_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp76_AST); + match(LPAREN); + TNode tmp77_AST = null; + tmp77_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp77_AST); + match(LPAREN); + attributeList(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp78_AST = null; + tmp78_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp78_AST); + match(RPAREN); + TNode tmp79_AST = null; + tmp79_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp79_AST); + match(RPAREN); + attributeDecl_AST = (TNode)currentAST.root; + break; + } + case LITERAL_asm: + { + TNode tmp80_AST = null; + tmp80_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp80_AST); + match(LITERAL_asm); + TNode tmp81_AST = null; + tmp81_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp81_AST); + match(LPAREN); + stringConst(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp82_AST = null; + tmp82_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp82_AST); + match(RPAREN); + if ( inputState.guessing==0 ) { + attributeDecl_AST = (TNode)currentAST.root; + attributeDecl_AST.setType( NAsmAttribute ); + } + attributeDecl_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = attributeDecl_AST; + } + + public final void enumSpecifier() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode enumSpecifier_AST = null; + Token i = null; + TNode i_AST = null; + + TNode tmp83_AST = null; + tmp83_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp83_AST); + match(LITERAL_enum); + { + boolean synPredMatched108 = false; + if (((LA(1)==ID) && (LA(2)==LCURLY))) { + int _m108 = mark(); + synPredMatched108 = true; + inputState.guessing++; + try { + { + match(ID); + match(LCURLY); + } + } + catch (RecognitionException pe) { + synPredMatched108 = false; + } + rewind(_m108); + inputState.guessing--; + } + if ( synPredMatched108 ) { + i = LT(1); + i_AST = (TNode)astFactory.create(i); + astFactory.addASTChild(currentAST, i_AST); + match(ID); + TNode tmp84_AST = null; + tmp84_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp84_AST); + match(LCURLY); + enumList(i.getText()); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp85_AST = null; + tmp85_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp85_AST); + match(RCURLY); + } + else if ((LA(1)==LCURLY)) { + TNode tmp86_AST = null; + tmp86_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp86_AST); + match(LCURLY); + enumList("anonymous"); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp87_AST = null; + tmp87_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp87_AST); + match(RCURLY); + } + else if ((LA(1)==ID) && (_tokenSet_33.member(LA(2)))) { + TNode tmp88_AST = null; + tmp88_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp88_AST); + match(ID); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + enumSpecifier_AST = (TNode)currentAST.root; + returnAST = enumSpecifier_AST; + } + + public final void typedefName() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode typedefName_AST = null; + Token i = null; + TNode i_AST = null; + + if (!( isTypedefName ( LT(1).getText() ) )) + throw new SemanticException(" isTypedefName ( LT(1).getText() ) "); + i = LT(1); + i_AST = (TNode)astFactory.create(i); + astFactory.addASTChild(currentAST, i_AST); + match(ID); + if ( inputState.guessing==0 ) { + typedefName_AST = (TNode)currentAST.root; + typedefName_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NTypedefName)).add(i_AST)); + currentAST.root = typedefName_AST; + currentAST.child = typedefName_AST!=null &&typedefName_AST.getFirstChild()!=null ? + typedefName_AST.getFirstChild() : typedefName_AST; + currentAST.advanceChildToEnd(); + } + typedefName_AST = (TNode)currentAST.root; + returnAST = typedefName_AST; + } + + public final void typeName() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode typeName_AST = null; + + specifierQualifierList(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case STAR: + case LPAREN: + case LBRACKET: + { + nonemptyAbstractDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + typeName_AST = (TNode)currentAST.root; + returnAST = typeName_AST; + } + + public final void structOrUnion() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structOrUnion_AST = null; + + switch ( LA(1)) { + case LITERAL_struct: + { + TNode tmp89_AST = null; + tmp89_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp89_AST); + match(LITERAL_struct); + structOrUnion_AST = (TNode)currentAST.root; + break; + } + case LITERAL_union: + { + TNode tmp90_AST = null; + tmp90_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp90_AST); + match(LITERAL_union); + structOrUnion_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = structOrUnion_AST; + } + + public final void structDeclarationList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structDeclarationList_AST = null; + + { + int _cnt221=0; + _loop221: + do { + if ((_tokenSet_30.member(LA(1)))) { + structDeclaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt221>=1 ) { break _loop221; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt221++; + } while (true); + } + structDeclarationList_AST = (TNode)currentAST.root; + returnAST = structDeclarationList_AST; + } + + public final void structDeclaration() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structDeclaration_AST = null; + + specifierQualifierList(); + astFactory.addASTChild(currentAST, returnAST); + structDeclaratorList(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case COMMA: + { + match(COMMA); + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + int _cnt96=0; + _loop96: + do { + if ((LA(1)==SEMI)) { + match(SEMI); + } + else { + if ( _cnt96>=1 ) { break _loop96; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt96++; + } while (true); + } + structDeclaration_AST = (TNode)currentAST.root; + returnAST = structDeclaration_AST; + } + + public final void specifierQualifierList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode specifierQualifierList_AST = null; + int specCount = 0; + + { + int _cnt226=0; + _loop226: + do { + boolean synPredMatched225 = false; + if (((_tokenSet_12.member(LA(1))) && (_tokenSet_34.member(LA(2))))) { + int _m225 = mark(); + synPredMatched225 = true; + inputState.guessing++; + try { + { + if ((LA(1)==LITERAL_struct) && (true)) { + match(LITERAL_struct); + } + else if ((LA(1)==LITERAL_union) && (true)) { + match(LITERAL_union); + } + else if ((LA(1)==LITERAL_enum) && (true)) { + match(LITERAL_enum); + } + else if ((_tokenSet_12.member(LA(1))) && (true)) { + typeSpecifier(specCount); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + } + catch (RecognitionException pe) { + synPredMatched225 = false; + } + rewind(_m225); + inputState.guessing--; + } + if ( synPredMatched225 ) { + specCount=typeSpecifier(specCount); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((LA(1)==LITERAL_volatile||LA(1)==LITERAL_const)) { + typeQualifier(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt226>=1 ) { break _loop226; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt226++; + } while (true); + } + specifierQualifierList_AST = (TNode)currentAST.root; + returnAST = specifierQualifierList_AST; + } + + public final void structDeclaratorList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structDeclaratorList_AST = null; + + structDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop99: + do { + if ((LA(1)==COMMA) && (_tokenSet_35.member(LA(2)))) { + match(COMMA); + structDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop99; + } + + } while (true); + } + structDeclaratorList_AST = (TNode)currentAST.root; + returnAST = structDeclaratorList_AST; + } + + public final void structDeclarator() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode structDeclarator_AST = null; + + { + switch ( LA(1)) { + case ID: + case STAR: + case LPAREN: + { + declarator(false); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_asm: + case SEMI: + case COMMA: + case COLON: + case LITERAL___attribute: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case COLON: + { + TNode tmp94_AST = null; + tmp94_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp94_AST); + match(COLON); + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_asm: + case SEMI: + case COMMA: + case LITERAL___attribute: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + _loop104: + do { + if ((LA(1)==LITERAL_asm||LA(1)==LITERAL___attribute)) { + attributeDecl(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop104; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + structDeclarator_AST = (TNode)currentAST.root; + structDeclarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStructDeclarator)).add(structDeclarator_AST)); + currentAST.root = structDeclarator_AST; + currentAST.child = structDeclarator_AST!=null &&structDeclarator_AST.getFirstChild()!=null ? + structDeclarator_AST.getFirstChild() : structDeclarator_AST; + currentAST.advanceChildToEnd(); + } + structDeclarator_AST = (TNode)currentAST.root; + returnAST = structDeclarator_AST; + } + + public final void enumList( + String enumName + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode enumList_AST = null; + + enumerator(enumName); + astFactory.addASTChild(currentAST, returnAST); + { + _loop111: + do { + if ((LA(1)==COMMA) && (LA(2)==ID)) { + match(COMMA); + enumerator(enumName); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop111; + } + + } while (true); + } + { + switch ( LA(1)) { + case COMMA: + { + match(COMMA); + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + enumList_AST = (TNode)currentAST.root; + returnAST = enumList_AST; + } + + public final void enumerator( + String enumName + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode enumerator_AST = null; + Token i = null; + TNode i_AST = null; + + i = LT(1); + i_AST = (TNode)astFactory.create(i); + astFactory.addASTChild(currentAST, i_AST); + match(ID); + if ( inputState.guessing==0 ) { + symbolTable.add( i.getText(), + (TNode)astFactory.make( (new ASTArray(3)).add(null).add((TNode)astFactory.create(LITERAL_enum,"enum")).add((TNode)astFactory.create(ID,enumName))) + ); + + } + { + switch ( LA(1)) { + case ASSIGN: + { + TNode tmp97_AST = null; + tmp97_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp97_AST); + match(ASSIGN); + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RCURLY: + case COMMA: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + enumerator_AST = (TNode)currentAST.root; + returnAST = enumerator_AST; + } + + public final void initDecl( + AST declarationSpecifiers + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode initDecl_AST = null; + TNode d_AST = null; + String declName = ""; + + declName=declarator(false); + d_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + AST ds1, d1; + ds1 = astFactory.dupList(declarationSpecifiers); + d1 = astFactory.dupList(d_AST); + symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds1).add(d1)) ); + + } + { + _loop119: + do { + if ((LA(1)==LITERAL_asm||LA(1)==LITERAL___attribute)) { + attributeDecl(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop119; + } + + } while (true); + } + { + switch ( LA(1)) { + case ASSIGN: + { + TNode tmp98_AST = null; + tmp98_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp98_AST); + match(ASSIGN); + initializer(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case COLON: + { + TNode tmp99_AST = null; + tmp99_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp99_AST); + match(COLON); + expr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case SEMI: + case COMMA: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + initDecl_AST = (TNode)currentAST.root; + initDecl_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NInitDecl)).add(initDecl_AST)); + currentAST.root = initDecl_AST; + currentAST.child = initDecl_AST!=null &&initDecl_AST.getFirstChild()!=null ? + initDecl_AST.getFirstChild() : initDecl_AST; + currentAST.advanceChildToEnd(); + } + initDecl_AST = (TNode)currentAST.root; + returnAST = initDecl_AST; + } + + public final void attributeList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode attributeList_AST = null; + + attribute(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop124: + do { + if ((LA(1)==COMMA) && ((LA(2) >= LITERAL_typedef && LA(2) <= LITERAL___imag))) { + TNode tmp100_AST = null; + tmp100_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp100_AST); + match(COMMA); + attribute(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop124; + } + + } while (true); + } + { + switch ( LA(1)) { + case COMMA: + { + TNode tmp101_AST = null; + tmp101_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp101_AST); + match(COMMA); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + attributeList_AST = (TNode)currentAST.root; + returnAST = attributeList_AST; + } + + protected final void stringConst() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode stringConst_AST = null; + + { + int _cnt314=0; + _loop314: + do { + if ((LA(1)==StringLiteral)) { + TNode tmp102_AST = null; + tmp102_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp102_AST); + match(StringLiteral); + } + else { + if ( _cnt314>=1 ) { break _loop314; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt314++; + } while (true); + } + if ( inputState.guessing==0 ) { + stringConst_AST = (TNode)currentAST.root; + stringConst_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStringSeq)).add(stringConst_AST)); + currentAST.root = stringConst_AST; + currentAST.child = stringConst_AST!=null &&stringConst_AST.getFirstChild()!=null ? + stringConst_AST.getFirstChild() : stringConst_AST; + currentAST.advanceChildToEnd(); + } + stringConst_AST = (TNode)currentAST.root; + returnAST = stringConst_AST; + } + + public final void attribute() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode attribute_AST = null; + + { + _loop129: + do { + if ((_tokenSet_36.member(LA(1)))) { + { + TNode tmp103_AST = null; + tmp103_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp103_AST); + match(_tokenSet_36); + } + } + else if ((LA(1)==LPAREN)) { + TNode tmp104_AST = null; + tmp104_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp104_AST); + match(LPAREN); + attributeList(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp105_AST = null; + tmp105_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp105_AST); + match(RPAREN); + } + else { + break _loop129; + } + + } while (true); + } + attribute_AST = (TNode)currentAST.root; + returnAST = attribute_AST; + } + + public final void compoundStatement( + String scopeName + ) throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode compoundStatement_AST = null; + + TNode tmp106_AST = null; + tmp106_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp106_AST); + match(LCURLY); + if ( inputState.guessing==0 ) { + + pushScope(scopeName); + + } + { + _loop136: + do { + boolean synPredMatched133 = false; + if (((_tokenSet_37.member(LA(1))) && (_tokenSet_4.member(LA(2))))) { + int _m133 = mark(); + synPredMatched133 = true; + inputState.guessing++; + try { + { + if ((LA(1)==LITERAL_typedef) && (true)) { + match(LITERAL_typedef); + } + else if ((LA(1)==LITERAL___label__)) { + match(LITERAL___label__); + } + else if ((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2)))) { + declaration(); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + } + catch (RecognitionException pe) { + synPredMatched133 = false; + } + rewind(_m133); + inputState.guessing--; + } + if ( synPredMatched133 ) { + declarationList(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + boolean synPredMatched135 = false; + if (((_tokenSet_38.member(LA(1))) && (_tokenSet_39.member(LA(2))))) { + int _m135 = mark(); + synPredMatched135 = true; + inputState.guessing++; + try { + { + nestedFunctionDef(); + } + } + catch (RecognitionException pe) { + synPredMatched135 = false; + } + rewind(_m135); + inputState.guessing--; + } + if ( synPredMatched135 ) { + nestedFunctionDef(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop136; + } + } + } while (true); + } + { + switch ( LA(1)) { + case LITERAL_asm: + case LCURLY: + case SEMI: + case ID: + case STAR: + case LPAREN: + case LITERAL_while: + case LITERAL_do: + case LITERAL_for: + case LITERAL_goto: + case LITERAL_continue: + case LITERAL_break: + case LITERAL_return: + case LITERAL_case: + case LITERAL_default: + case LITERAL_if: + case LITERAL_switch: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + statementList(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + popScope(); + } + TNode tmp107_AST = null; + tmp107_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp107_AST); + match(RCURLY); + if ( inputState.guessing==0 ) { + compoundStatement_AST = (TNode)currentAST.root; + compoundStatement_AST.setType( NCompoundStatement ); compoundStatement_AST.setAttribute( "scopeName", scopeName ); + } + compoundStatement_AST = (TNode)currentAST.root; + returnAST = compoundStatement_AST; + } + + public final void nestedFunctionDef() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode nestedFunctionDef_AST = null; + TNode ds_AST = null; + TNode d_AST = null; + String declName; + + { + switch ( LA(1)) { + case LITERAL_auto: + { + TNode tmp108_AST = null; + tmp108_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp108_AST); + match(LITERAL_auto); + break; + } + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case ID: + case STAR: + case LPAREN: + case LITERAL_inline: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + boolean synPredMatched142 = false; + if (((_tokenSet_10.member(LA(1))) && (_tokenSet_11.member(LA(2))))) { + int _m142 = mark(); + synPredMatched142 = true; + inputState.guessing++; + try { + { + functionDeclSpecifiers(); + } + } + catch (RecognitionException pe) { + synPredMatched142 = false; + } + rewind(_m142); + inputState.guessing--; + } + if ( synPredMatched142 ) { + functionDeclSpecifiers(); + ds_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_7.member(LA(1))) && (_tokenSet_39.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + declName=declarator(false); + d_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + + AST d2, ds2; + d2 = astFactory.dupList(d_AST); + ds2 = astFactory.dupList(ds_AST); + symbolTable.add(declName, (TNode)astFactory.make( (new ASTArray(3)).add(null).add(ds2).add(d2))); + pushScope(declName); + + } + { + _loop144: + do { + if ((_tokenSet_3.member(LA(1)))) { + declaration(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop144; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + popScope(); + } + compoundStatement(declName); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + nestedFunctionDef_AST = (TNode)currentAST.root; + nestedFunctionDef_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NFunctionDef)).add(nestedFunctionDef_AST)); + currentAST.root = nestedFunctionDef_AST; + currentAST.child = nestedFunctionDef_AST!=null &&nestedFunctionDef_AST.getFirstChild()!=null ? + nestedFunctionDef_AST.getFirstChild() : nestedFunctionDef_AST; + currentAST.advanceChildToEnd(); + } + nestedFunctionDef_AST = (TNode)currentAST.root; + returnAST = nestedFunctionDef_AST; + } + + public final void statementList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode statementList_AST = null; + + { + int _cnt256=0; + _loop256: + do { + if ((_tokenSet_40.member(LA(1)))) { + statement(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + if ( _cnt256>=1 ) { break _loop256; } else {throw new NoViableAltException(LT(1), getFilename());} + } + + _cnt256++; + } while (true); + } + statementList_AST = (TNode)currentAST.root; + returnAST = statementList_AST; + } + + public final void statement() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode statement_AST = null; + TNode e1_AST = null; + TNode e2_AST = null; + TNode e3_AST = null; + TNode s_AST = null; + + switch ( LA(1)) { + case SEMI: + { + TNode tmp109_AST = null; + tmp109_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp109_AST); + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LCURLY: + { + compoundStatement(getAScopeName()); + astFactory.addASTChild(currentAST, returnAST); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_while: + { + TNode tmp110_AST = null; + tmp110_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp110_AST); + match(LITERAL_while); + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + statement(); + astFactory.addASTChild(currentAST, returnAST); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_do: + { + TNode tmp113_AST = null; + tmp113_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp113_AST); + match(LITERAL_do); + statement(); + astFactory.addASTChild(currentAST, returnAST); + match(LITERAL_while); + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_for: + { + match(LITERAL_for); + TNode tmp119_AST = null; + tmp119_AST = (TNode)astFactory.create(LT(1)); + match(LPAREN); + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + expr(); + e1_AST = (TNode)returnAST; + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp120_AST = null; + tmp120_AST = (TNode)astFactory.create(LT(1)); + match(SEMI); + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + expr(); + e2_AST = (TNode)returnAST; + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp121_AST = null; + tmp121_AST = (TNode)astFactory.create(LT(1)); + match(SEMI); + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + expr(); + e3_AST = (TNode)returnAST; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp122_AST = null; + tmp122_AST = (TNode)astFactory.create(LT(1)); + match(RPAREN); + statement(); + s_AST = (TNode)returnAST; + if ( inputState.guessing==0 ) { + statement_AST = (TNode)currentAST.root; + + if ( e1_AST == null) { e1_AST = (TNode)astFactory.create(NEmptyExpression); } + if ( e2_AST == null) { e2_AST = (TNode)astFactory.create(NEmptyExpression); } + if ( e3_AST == null) { e3_AST = (TNode)astFactory.create(NEmptyExpression); } + statement_AST = (TNode)astFactory.make( (new ASTArray(5)).add((TNode)astFactory.create(LITERAL_for,"for")).add(e1_AST).add(e2_AST).add(e3_AST).add(s_AST)); + + currentAST.root = statement_AST; + currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? + statement_AST.getFirstChild() : statement_AST; + currentAST.advanceChildToEnd(); + } + break; + } + case LITERAL_goto: + { + TNode tmp123_AST = null; + tmp123_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp123_AST); + match(LITERAL_goto); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_continue: + { + TNode tmp125_AST = null; + tmp125_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp125_AST); + match(LITERAL_continue); + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_break: + { + TNode tmp127_AST = null; + tmp127_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp127_AST); + match(LITERAL_break); + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_return: + { + TNode tmp129_AST = null; + tmp129_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp129_AST); + match(LITERAL_return); + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + expr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_case: + { + TNode tmp131_AST = null; + tmp131_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp131_AST); + match(LITERAL_case); + { + boolean synPredMatched153 = false; + if (((_tokenSet_2.member(LA(1))) && (_tokenSet_20.member(LA(2))))) { + int _m153 = mark(); + synPredMatched153 = true; + inputState.guessing++; + try { + { + constExpr(); + match(VARARGS); + } + } + catch (RecognitionException pe) { + synPredMatched153 = false; + } + rewind(_m153); + inputState.guessing--; + } + if ( synPredMatched153 ) { + rangeExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_41.member(LA(2)))) { + constExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + match(COLON); + { + if ((_tokenSet_40.member(LA(1))) && (_tokenSet_42.member(LA(2)))) { + statement(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_44.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_default: + { + TNode tmp133_AST = null; + tmp133_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp133_AST); + match(LITERAL_default); + match(COLON); + { + if ((_tokenSet_40.member(LA(1))) && (_tokenSet_42.member(LA(2)))) { + statement(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_44.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_if: + { + TNode tmp135_AST = null; + tmp135_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp135_AST); + match(LITERAL_if); + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + statement(); + astFactory.addASTChild(currentAST, returnAST); + { + if ((LA(1)==LITERAL_else) && (_tokenSet_40.member(LA(2)))) { + TNode tmp138_AST = null; + tmp138_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp138_AST); + match(LITERAL_else); + statement(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_44.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + statement_AST = (TNode)currentAST.root; + break; + } + case LITERAL_switch: + { + TNode tmp139_AST = null; + tmp139_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp139_AST); + match(LITERAL_switch); + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + statement(); + astFactory.addASTChild(currentAST, returnAST); + statement_AST = (TNode)currentAST.root; + break; + } + default: + if ((_tokenSet_2.member(LA(1))) && (_tokenSet_45.member(LA(2)))) { + expr(); + astFactory.addASTChild(currentAST, returnAST); + match(SEMI); + if ( inputState.guessing==0 ) { + statement_AST = (TNode)currentAST.root; + statement_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NStatementExpr)).add(statement_AST)); + currentAST.root = statement_AST; + currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? + statement_AST.getFirstChild() : statement_AST; + currentAST.advanceChildToEnd(); + } + statement_AST = (TNode)currentAST.root; + } + else if ((LA(1)==ID) && (LA(2)==COLON)) { + TNode tmp143_AST = null; + tmp143_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp143_AST); + match(ID); + match(COLON); + { + if ((_tokenSet_40.member(LA(1))) && (_tokenSet_42.member(LA(2)))) { + statement(); + astFactory.addASTChild(currentAST, returnAST); + } + else if ((_tokenSet_43.member(LA(1))) && (_tokenSet_44.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState.guessing==0 ) { + statement_AST = (TNode)currentAST.root; + statement_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NLabel)).add(statement_AST)); + currentAST.root = statement_AST; + currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ? + statement_AST.getFirstChild() : statement_AST; + currentAST.advanceChildToEnd(); + } + statement_AST = (TNode)currentAST.root; + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = statement_AST; + } + + public final void conditionalExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode conditionalExpr_AST = null; + + logicalOrExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case QUESTION: + { + TNode tmp145_AST = null; + tmp145_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp145_AST); + match(QUESTION); + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + expr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case COLON: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp146_AST = null; + tmp146_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp146_AST); + match(COLON); + conditionalExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_asm: + case RCURLY: + case SEMI: + case COMMA: + case COLON: + case ASSIGN: + case RPAREN: + case RBRACKET: + case VARARGS: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case LITERAL___attribute: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + conditionalExpr_AST = (TNode)currentAST.root; + returnAST = conditionalExpr_AST; + } + + public final void logicalOrExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode logicalOrExpr_AST = null; + + logicalAndExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop266: + do { + if ((LA(1)==LOR)) { + TNode tmp147_AST = null; + tmp147_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp147_AST); + match(LOR); + logicalAndExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop266; + } + + } while (true); + } + logicalOrExpr_AST = (TNode)currentAST.root; + returnAST = logicalOrExpr_AST; + } + + public final void castExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode castExpr_AST = null; + + boolean synPredMatched163 = false; + if (((LA(1)==LPAREN) && (_tokenSet_30.member(LA(2))))) { + int _m163 = mark(); + synPredMatched163 = true; + inputState.guessing++; + try { + { + match(LPAREN); + typeName(); + match(RPAREN); + } + } + catch (RecognitionException pe) { + synPredMatched163 = false; + } + rewind(_m163); + inputState.guessing--; + } + if ( synPredMatched163 ) { + TNode tmp148_AST = null; + tmp148_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp148_AST); + match(LPAREN); + typeName(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp149_AST = null; + tmp149_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp149_AST); + match(RPAREN); + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + castExpr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LCURLY: + { + lcurlyInitializer(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + castExpr_AST = (TNode)currentAST.root; + castExpr_AST.setType(NCast); + } + castExpr_AST = (TNode)currentAST.root; + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_46.member(LA(2)))) { + unaryExpr(); + astFactory.addASTChild(currentAST, returnAST); + castExpr_AST = (TNode)currentAST.root; + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + returnAST = castExpr_AST; + } + + public final void unaryExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode unaryExpr_AST = null; + TNode u_AST = null; + + switch ( LA(1)) { + case ID: + case LPAREN: + case CharLiteral: + case StringLiteral: + case Number: + { + postfixExpr(); + astFactory.addASTChild(currentAST, returnAST); + unaryExpr_AST = (TNode)currentAST.root; + break; + } + case INC: + { + TNode tmp150_AST = null; + tmp150_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp150_AST); + match(INC); + castExpr(); + astFactory.addASTChild(currentAST, returnAST); + unaryExpr_AST = (TNode)currentAST.root; + break; + } + case DEC: + { + TNode tmp151_AST = null; + tmp151_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp151_AST); + match(DEC); + castExpr(); + astFactory.addASTChild(currentAST, returnAST); + unaryExpr_AST = (TNode)currentAST.root; + break; + } + case STAR: + case LAND: + case BAND: + case PLUS: + case MINUS: + case BNOT: + case LNOT: + case LITERAL___real: + case LITERAL___imag: + { + unaryOperator(); + u_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + castExpr(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + unaryExpr_AST = (TNode)currentAST.root; + unaryExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NUnaryExpr)).add(unaryExpr_AST)); + currentAST.root = unaryExpr_AST; + currentAST.child = unaryExpr_AST!=null &&unaryExpr_AST.getFirstChild()!=null ? + unaryExpr_AST.getFirstChild() : unaryExpr_AST; + currentAST.advanceChildToEnd(); + } + unaryExpr_AST = (TNode)currentAST.root; + break; + } + case LITERAL_sizeof: + { + TNode tmp152_AST = null; + tmp152_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp152_AST); + match(LITERAL_sizeof); + { + boolean synPredMatched184 = false; + if (((LA(1)==LPAREN) && (_tokenSet_30.member(LA(2))))) { + int _m184 = mark(); + synPredMatched184 = true; + inputState.guessing++; + try { + { + match(LPAREN); + typeName(); + } + } + catch (RecognitionException pe) { + synPredMatched184 = false; + } + rewind(_m184); + inputState.guessing--; + } + if ( synPredMatched184 ) { + TNode tmp153_AST = null; + tmp153_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp153_AST); + match(LPAREN); + typeName(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp154_AST = null; + tmp154_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp154_AST); + match(RPAREN); + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_46.member(LA(2)))) { + unaryExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + unaryExpr_AST = (TNode)currentAST.root; + break; + } + case LITERAL___alignof: + { + TNode tmp155_AST = null; + tmp155_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp155_AST); + match(LITERAL___alignof); + { + boolean synPredMatched187 = false; + if (((LA(1)==LPAREN) && (_tokenSet_30.member(LA(2))))) { + int _m187 = mark(); + synPredMatched187 = true; + inputState.guessing++; + try { + { + match(LPAREN); + typeName(); + } + } + catch (RecognitionException pe) { + synPredMatched187 = false; + } + rewind(_m187); + inputState.guessing--; + } + if ( synPredMatched187 ) { + TNode tmp156_AST = null; + tmp156_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp156_AST); + match(LPAREN); + typeName(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp157_AST = null; + tmp157_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp157_AST); + match(RPAREN); + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_46.member(LA(2)))) { + unaryExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + unaryExpr_AST = (TNode)currentAST.root; + break; + } + case LITERAL_asm: + { + gnuAsmExpr(); + astFactory.addASTChild(currentAST, returnAST); + unaryExpr_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = unaryExpr_AST; + } + + public final void nonemptyAbstractDeclarator() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode nonemptyAbstractDeclarator_AST = null; + + { + switch ( LA(1)) { + case STAR: + { + pointerGroup(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop173: + do { + switch ( LA(1)) { + case LPAREN: + { + { + TNode tmp158_AST = null; + tmp158_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp158_AST); + match(LPAREN); + { + switch ( LA(1)) { + case STAR: + case LPAREN: + case LBRACKET: + { + nonemptyAbstractDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_typedef: + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_auto: + case LITERAL_register: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case ID: + case LITERAL_inline: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + parameterTypeList(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case COMMA: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case COMMA: + { + match(COMMA); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp160_AST = null; + tmp160_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp160_AST); + match(RPAREN); + } + break; + } + case LBRACKET: + { + { + TNode tmp161_AST = null; + tmp161_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp161_AST); + match(LBRACKET); + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + expr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp162_AST = null; + tmp162_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp162_AST); + match(RBRACKET); + } + break; + } + default: + { + break _loop173; + } + } + } while (true); + } + break; + } + case LPAREN: + case LBRACKET: + { + { + int _cnt180=0; + _loop180: + do { + switch ( LA(1)) { + case LPAREN: + { + { + TNode tmp163_AST = null; + tmp163_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp163_AST); + match(LPAREN); + { + switch ( LA(1)) { + case STAR: + case LPAREN: + case LBRACKET: + { + nonemptyAbstractDeclarator(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LITERAL_typedef: + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_auto: + case LITERAL_register: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case ID: + case LITERAL_inline: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + parameterTypeList(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case COMMA: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case COMMA: + { + match(COMMA); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp165_AST = null; + tmp165_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp165_AST); + match(RPAREN); + } + break; + } + case LBRACKET: + { + { + TNode tmp166_AST = null; + tmp166_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp166_AST); + match(LBRACKET); + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + expr(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp167_AST = null; + tmp167_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp167_AST); + match(RBRACKET); + } + break; + } + default: + { + if ( _cnt180>=1 ) { break _loop180; } else {throw new NoViableAltException(LT(1), getFilename());} + } + } + _cnt180++; + } while (true); + } + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState.guessing==0 ) { + nonemptyAbstractDeclarator_AST = (TNode)currentAST.root; + nonemptyAbstractDeclarator_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NNonemptyAbstractDeclarator)).add(nonemptyAbstractDeclarator_AST)); + currentAST.root = nonemptyAbstractDeclarator_AST; + currentAST.child = nonemptyAbstractDeclarator_AST!=null &&nonemptyAbstractDeclarator_AST.getFirstChild()!=null ? + nonemptyAbstractDeclarator_AST.getFirstChild() : nonemptyAbstractDeclarator_AST; + currentAST.advanceChildToEnd(); + } + nonemptyAbstractDeclarator_AST = (TNode)currentAST.root; + returnAST = nonemptyAbstractDeclarator_AST; + } + + public final void postfixExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode postfixExpr_AST = null; + + primaryExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case LPAREN: + case LBRACKET: + case INC: + case DEC: + case PTR: + case DOT: + { + postfixSuffix(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + postfixExpr_AST = (TNode)currentAST.root; + postfixExpr_AST = (TNode)astFactory.make( (new ASTArray(2)).add((TNode)astFactory.create(NPostfixExpr)).add(postfixExpr_AST)); + currentAST.root = postfixExpr_AST; + currentAST.child = postfixExpr_AST!=null &&postfixExpr_AST.getFirstChild()!=null ? + postfixExpr_AST.getFirstChild() : postfixExpr_AST; + currentAST.advanceChildToEnd(); + } + break; + } + case LITERAL_asm: + case RCURLY: + case SEMI: + case COMMA: + case COLON: + case ASSIGN: + case STAR: + case RPAREN: + case RBRACKET: + case VARARGS: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case LITERAL___attribute: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + postfixExpr_AST = (TNode)currentAST.root; + returnAST = postfixExpr_AST; + } + + public final void unaryOperator() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode unaryOperator_AST = null; + + switch ( LA(1)) { + case BAND: + { + TNode tmp168_AST = null; + tmp168_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp168_AST); + match(BAND); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case STAR: + { + TNode tmp169_AST = null; + tmp169_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp169_AST); + match(STAR); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case PLUS: + { + TNode tmp170_AST = null; + tmp170_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp170_AST); + match(PLUS); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case MINUS: + { + TNode tmp171_AST = null; + tmp171_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp171_AST); + match(MINUS); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case BNOT: + { + TNode tmp172_AST = null; + tmp172_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp172_AST); + match(BNOT); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case LNOT: + { + TNode tmp173_AST = null; + tmp173_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp173_AST); + match(LNOT); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case LAND: + { + TNode tmp174_AST = null; + tmp174_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp174_AST); + match(LAND); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case LITERAL___real: + { + TNode tmp175_AST = null; + tmp175_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp175_AST); + match(LITERAL___real); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + case LITERAL___imag: + { + TNode tmp176_AST = null; + tmp176_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp176_AST); + match(LITERAL___imag); + unaryOperator_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = unaryOperator_AST; + } + + public final void gnuAsmExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode gnuAsmExpr_AST = null; + + TNode tmp177_AST = null; + tmp177_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp177_AST); + match(LITERAL_asm); + { + switch ( LA(1)) { + case LITERAL_volatile: + { + TNode tmp178_AST = null; + tmp178_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp178_AST); + match(LITERAL_volatile); + break; + } + case LPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp179_AST = null; + tmp179_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp179_AST); + match(LPAREN); + stringConst(); + astFactory.addASTChild(currentAST, returnAST); + { + if ((LA(1)==COLON) && (_tokenSet_47.member(LA(2)))) { + TNode tmp180_AST = null; + tmp180_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp180_AST); + match(COLON); + { + switch ( LA(1)) { + case StringLiteral: + { + strOptExprPair(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop194: + do { + if ((LA(1)==COMMA)) { + TNode tmp181_AST = null; + tmp181_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp181_AST); + match(COMMA); + strOptExprPair(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop194; + } + + } while (true); + } + break; + } + case COLON: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + { + if ((LA(1)==COLON) && (_tokenSet_47.member(LA(2)))) { + TNode tmp182_AST = null; + tmp182_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp182_AST); + match(COLON); + { + switch ( LA(1)) { + case StringLiteral: + { + strOptExprPair(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop198: + do { + if ((LA(1)==COMMA)) { + TNode tmp183_AST = null; + tmp183_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp183_AST); + match(COMMA); + strOptExprPair(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop198; + } + + } while (true); + } + break; + } + case COLON: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + } + else if ((LA(1)==COLON||LA(1)==RPAREN) && (_tokenSet_48.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + } + else if ((LA(1)==COLON||LA(1)==RPAREN) && (_tokenSet_48.member(LA(2)))) { + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + + } + { + switch ( LA(1)) { + case COLON: + { + TNode tmp184_AST = null; + tmp184_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp184_AST); + match(COLON); + stringConst(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop201: + do { + if ((LA(1)==COMMA)) { + TNode tmp185_AST = null; + tmp185_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp185_AST); + match(COMMA); + stringConst(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop201; + } + + } while (true); + } + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp186_AST = null; + tmp186_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp186_AST); + match(RPAREN); + if ( inputState.guessing==0 ) { + gnuAsmExpr_AST = (TNode)currentAST.root; + gnuAsmExpr_AST.setType(NGnuAsmExpr); + } + gnuAsmExpr_AST = (TNode)currentAST.root; + returnAST = gnuAsmExpr_AST; + } + + public final void strOptExprPair() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode strOptExprPair_AST = null; + + stringConst(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case LPAREN: + { + TNode tmp187_AST = null; + tmp187_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp187_AST); + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp188_AST = null; + tmp188_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp188_AST); + match(RPAREN); + break; + } + case COMMA: + case COLON: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + strOptExprPair_AST = (TNode)currentAST.root; + returnAST = strOptExprPair_AST; + } + + public final void primaryExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode primaryExpr_AST = null; + + switch ( LA(1)) { + case ID: + { + TNode tmp189_AST = null; + tmp189_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp189_AST); + match(ID); + primaryExpr_AST = (TNode)currentAST.root; + break; + } + case Number: + { + TNode tmp190_AST = null; + tmp190_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp190_AST); + match(Number); + primaryExpr_AST = (TNode)currentAST.root; + break; + } + case CharLiteral: + { + charConst(); + astFactory.addASTChild(currentAST, returnAST); + primaryExpr_AST = (TNode)currentAST.root; + break; + } + case StringLiteral: + { + stringConst(); + astFactory.addASTChild(currentAST, returnAST); + primaryExpr_AST = (TNode)currentAST.root; + break; + } + default: + boolean synPredMatched206 = false; + if (((LA(1)==LPAREN) && (LA(2)==LCURLY))) { + int _m206 = mark(); + synPredMatched206 = true; + inputState.guessing++; + try { + { + match(LPAREN); + match(LCURLY); + } + } + catch (RecognitionException pe) { + synPredMatched206 = false; + } + rewind(_m206); + inputState.guessing--; + } + if ( synPredMatched206 ) { + TNode tmp191_AST = null; + tmp191_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp191_AST); + match(LPAREN); + compoundStatement(getAScopeName()); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp192_AST = null; + tmp192_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp192_AST); + match(RPAREN); + primaryExpr_AST = (TNode)currentAST.root; + } + else if ((LA(1)==LPAREN) && (_tokenSet_2.member(LA(2)))) { + TNode tmp193_AST = null; + tmp193_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp193_AST); + match(LPAREN); + expr(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp194_AST = null; + tmp194_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp194_AST); + match(RPAREN); + if ( inputState.guessing==0 ) { + primaryExpr_AST = (TNode)currentAST.root; + primaryExpr_AST.setType(NExpressionGroup); + } + primaryExpr_AST = (TNode)currentAST.root; + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = primaryExpr_AST; + } + + protected final void charConst() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode charConst_AST = null; + + TNode tmp195_AST = null; + tmp195_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp195_AST); + match(CharLiteral); + charConst_AST = (TNode)currentAST.root; + returnAST = charConst_AST; + } + + public final void storageClassSpecifier() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode storageClassSpecifier_AST = null; + + switch ( LA(1)) { + case LITERAL_auto: + { + TNode tmp196_AST = null; + tmp196_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp196_AST); + match(LITERAL_auto); + storageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_register: + { + TNode tmp197_AST = null; + tmp197_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp197_AST); + match(LITERAL_register); + storageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_typedef: + { + TNode tmp198_AST = null; + tmp198_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp198_AST); + match(LITERAL_typedef); + storageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_extern: + case LITERAL_static: + case LITERAL_inline: + { + functionStorageClassSpecifier(); + astFactory.addASTChild(currentAST, returnAST); + storageClassSpecifier_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = storageClassSpecifier_AST; + } + + public final void typeQualifier() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode typeQualifier_AST = null; + + switch ( LA(1)) { + case LITERAL_const: + { + TNode tmp199_AST = null; + tmp199_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp199_AST); + match(LITERAL_const); + typeQualifier_AST = (TNode)currentAST.root; + break; + } + case LITERAL_volatile: + { + TNode tmp200_AST = null; + tmp200_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp200_AST); + match(LITERAL_volatile); + typeQualifier_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = typeQualifier_AST; + } + + public final void assignOperator() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode assignOperator_AST = null; + + switch ( LA(1)) { + case ASSIGN: + { + TNode tmp201_AST = null; + tmp201_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp201_AST); + match(ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case DIV_ASSIGN: + { + TNode tmp202_AST = null; + tmp202_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp202_AST); + match(DIV_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case PLUS_ASSIGN: + { + TNode tmp203_AST = null; + tmp203_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp203_AST); + match(PLUS_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case MINUS_ASSIGN: + { + TNode tmp204_AST = null; + tmp204_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp204_AST); + match(MINUS_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case STAR_ASSIGN: + { + TNode tmp205_AST = null; + tmp205_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp205_AST); + match(STAR_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case MOD_ASSIGN: + { + TNode tmp206_AST = null; + tmp206_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp206_AST); + match(MOD_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case RSHIFT_ASSIGN: + { + TNode tmp207_AST = null; + tmp207_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp207_AST); + match(RSHIFT_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case LSHIFT_ASSIGN: + { + TNode tmp208_AST = null; + tmp208_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp208_AST); + match(LSHIFT_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case BAND_ASSIGN: + { + TNode tmp209_AST = null; + tmp209_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp209_AST); + match(BAND_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case BOR_ASSIGN: + { + TNode tmp210_AST = null; + tmp210_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp210_AST); + match(BOR_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + case BXOR_ASSIGN: + { + TNode tmp211_AST = null; + tmp211_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp211_AST); + match(BXOR_ASSIGN); + assignOperator_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = assignOperator_AST; + } + + public final void logicalAndExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode logicalAndExpr_AST = null; + + inclusiveOrExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop269: + do { + if ((LA(1)==LAND)) { + TNode tmp212_AST = null; + tmp212_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp212_AST); + match(LAND); + inclusiveOrExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop269; + } + + } while (true); + } + logicalAndExpr_AST = (TNode)currentAST.root; + returnAST = logicalAndExpr_AST; + } + + public final void inclusiveOrExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode inclusiveOrExpr_AST = null; + + exclusiveOrExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop272: + do { + if ((LA(1)==BOR)) { + TNode tmp213_AST = null; + tmp213_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp213_AST); + match(BOR); + exclusiveOrExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop272; + } + + } while (true); + } + inclusiveOrExpr_AST = (TNode)currentAST.root; + returnAST = inclusiveOrExpr_AST; + } + + public final void exclusiveOrExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode exclusiveOrExpr_AST = null; + + bitAndExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop275: + do { + if ((LA(1)==BXOR)) { + TNode tmp214_AST = null; + tmp214_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp214_AST); + match(BXOR); + bitAndExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop275; + } + + } while (true); + } + exclusiveOrExpr_AST = (TNode)currentAST.root; + returnAST = exclusiveOrExpr_AST; + } + + public final void bitAndExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode bitAndExpr_AST = null; + + equalityExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop278: + do { + if ((LA(1)==BAND)) { + TNode tmp215_AST = null; + tmp215_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp215_AST); + match(BAND); + equalityExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop278; + } + + } while (true); + } + bitAndExpr_AST = (TNode)currentAST.root; + returnAST = bitAndExpr_AST; + } + + public final void equalityExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode equalityExpr_AST = null; + + relationalExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop282: + do { + if ((LA(1)==EQUAL||LA(1)==NOT_EQUAL)) { + { + switch ( LA(1)) { + case EQUAL: + { + TNode tmp216_AST = null; + tmp216_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp216_AST); + match(EQUAL); + break; + } + case NOT_EQUAL: + { + TNode tmp217_AST = null; + tmp217_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp217_AST); + match(NOT_EQUAL); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + relationalExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop282; + } + + } while (true); + } + equalityExpr_AST = (TNode)currentAST.root; + returnAST = equalityExpr_AST; + } + + public final void relationalExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode relationalExpr_AST = null; + + shiftExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop286: + do { + if (((LA(1) >= LT && LA(1) <= GTE))) { + { + switch ( LA(1)) { + case LT: + { + TNode tmp218_AST = null; + tmp218_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp218_AST); + match(LT); + break; + } + case LTE: + { + TNode tmp219_AST = null; + tmp219_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp219_AST); + match(LTE); + break; + } + case GT: + { + TNode tmp220_AST = null; + tmp220_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp220_AST); + match(GT); + break; + } + case GTE: + { + TNode tmp221_AST = null; + tmp221_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp221_AST); + match(GTE); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + shiftExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop286; + } + + } while (true); + } + relationalExpr_AST = (TNode)currentAST.root; + returnAST = relationalExpr_AST; + } + + public final void shiftExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode shiftExpr_AST = null; + + additiveExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop290: + do { + if ((LA(1)==LSHIFT||LA(1)==RSHIFT)) { + { + switch ( LA(1)) { + case LSHIFT: + { + TNode tmp222_AST = null; + tmp222_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp222_AST); + match(LSHIFT); + break; + } + case RSHIFT: + { + TNode tmp223_AST = null; + tmp223_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp223_AST); + match(RSHIFT); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + additiveExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop290; + } + + } while (true); + } + shiftExpr_AST = (TNode)currentAST.root; + returnAST = shiftExpr_AST; + } + + public final void additiveExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode additiveExpr_AST = null; + + multExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop294: + do { + if ((LA(1)==PLUS||LA(1)==MINUS)) { + { + switch ( LA(1)) { + case PLUS: + { + TNode tmp224_AST = null; + tmp224_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp224_AST); + match(PLUS); + break; + } + case MINUS: + { + TNode tmp225_AST = null; + tmp225_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp225_AST); + match(MINUS); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + multExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop294; + } + + } while (true); + } + additiveExpr_AST = (TNode)currentAST.root; + returnAST = additiveExpr_AST; + } + + public final void multExpr() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode multExpr_AST = null; + + castExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop298: + do { + if ((_tokenSet_49.member(LA(1)))) { + { + switch ( LA(1)) { + case STAR: + { + TNode tmp226_AST = null; + tmp226_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp226_AST); + match(STAR); + break; + } + case DIV: + { + TNode tmp227_AST = null; + tmp227_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp227_AST); + match(DIV); + break; + } + case MOD: + { + TNode tmp228_AST = null; + tmp228_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp228_AST); + match(MOD); + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + castExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop298; + } + + } while (true); + } + multExpr_AST = (TNode)currentAST.root; + returnAST = multExpr_AST; + } + + public final void postfixSuffix() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode postfixSuffix_AST = null; + + { + int _cnt305=0; + _loop305: + do { + switch ( LA(1)) { + case PTR: + { + TNode tmp229_AST = null; + tmp229_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp229_AST); + match(PTR); + TNode tmp230_AST = null; + tmp230_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp230_AST); + match(ID); + break; + } + case DOT: + { + TNode tmp231_AST = null; + tmp231_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp231_AST); + match(DOT); + TNode tmp232_AST = null; + tmp232_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp232_AST); + match(ID); + break; + } + case LPAREN: + { + functionCall(); + astFactory.addASTChild(currentAST, returnAST); + break; + } + case LBRACKET: + { + TNode tmp233_AST = null; + tmp233_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp233_AST); + match(LBRACKET); + expr(); + astFactory.addASTChild(currentAST, returnAST); + TNode tmp234_AST = null; + tmp234_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp234_AST); + match(RBRACKET); + break; + } + case INC: + { + TNode tmp235_AST = null; + tmp235_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp235_AST); + match(INC); + break; + } + case DEC: + { + TNode tmp236_AST = null; + tmp236_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp236_AST); + match(DEC); + break; + } + default: + { + if ( _cnt305>=1 ) { break _loop305; } else {throw new NoViableAltException(LT(1), getFilename());} + } + } + _cnt305++; + } while (true); + } + postfixSuffix_AST = (TNode)currentAST.root; + returnAST = postfixSuffix_AST; + } + + public final void functionCall() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode functionCall_AST = null; + TNode a_AST = null; + + TNode tmp237_AST = null; + tmp237_AST = (TNode)astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp237_AST); + match(LPAREN); + { + switch ( LA(1)) { + case LITERAL_asm: + case ID: + case STAR: + case LPAREN: + case LAND: + case BAND: + case PLUS: + case MINUS: + case INC: + case DEC: + case LITERAL_sizeof: + case BNOT: + case LNOT: + case CharLiteral: + case StringLiteral: + case Number: + case LITERAL___alignof: + case LITERAL___real: + case LITERAL___imag: + { + argExprList(); + a_AST = (TNode)returnAST; + astFactory.addASTChild(currentAST, returnAST); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + TNode tmp238_AST = null; + tmp238_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp238_AST); + match(RPAREN); + if ( inputState.guessing==0 ) { + functionCall_AST = (TNode)currentAST.root; + + functionCall_AST.setType( NFunctionCallArgs ); + + } + functionCall_AST = (TNode)currentAST.root; + returnAST = functionCall_AST; + } + + public final void argExprList() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode argExprList_AST = null; + + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop310: + do { + if ((LA(1)==COMMA)) { + match(COMMA); + assignExpr(); + astFactory.addASTChild(currentAST, returnAST); + } + else { + break _loop310; + } + + } while (true); + } + argExprList_AST = (TNode)currentAST.root; + returnAST = argExprList_AST; + } + + protected final void intConst() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode intConst_AST = null; + + switch ( LA(1)) { + case IntOctalConst: + { + TNode tmp240_AST = null; + tmp240_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp240_AST); + match(IntOctalConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case LongOctalConst: + { + TNode tmp241_AST = null; + tmp241_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp241_AST); + match(LongOctalConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case UnsignedOctalConst: + { + TNode tmp242_AST = null; + tmp242_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp242_AST); + match(UnsignedOctalConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case IntIntConst: + { + TNode tmp243_AST = null; + tmp243_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp243_AST); + match(IntIntConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case LongIntConst: + { + TNode tmp244_AST = null; + tmp244_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp244_AST); + match(LongIntConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case UnsignedIntConst: + { + TNode tmp245_AST = null; + tmp245_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp245_AST); + match(UnsignedIntConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case IntHexConst: + { + TNode tmp246_AST = null; + tmp246_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp246_AST); + match(IntHexConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case LongHexConst: + { + TNode tmp247_AST = null; + tmp247_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp247_AST); + match(LongHexConst); + intConst_AST = (TNode)currentAST.root; + break; + } + case UnsignedHexConst: + { + TNode tmp248_AST = null; + tmp248_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp248_AST); + match(UnsignedHexConst); + intConst_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = intConst_AST; + } + + protected final void floatConst() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode floatConst_AST = null; + + switch ( LA(1)) { + case FloatDoubleConst: + { + TNode tmp249_AST = null; + tmp249_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp249_AST); + match(FloatDoubleConst); + floatConst_AST = (TNode)currentAST.root; + break; + } + case DoubleDoubleConst: + { + TNode tmp250_AST = null; + tmp250_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp250_AST); + match(DoubleDoubleConst); + floatConst_AST = (TNode)currentAST.root; + break; + } + case LongDoubleConst: + { + TNode tmp251_AST = null; + tmp251_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp251_AST); + match(LongDoubleConst); + floatConst_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = floatConst_AST; + } + + public final void dummy() throws RecognitionException, TokenStreamException { + + returnAST = null; + ASTPair currentAST = new ASTPair(); + TNode dummy_AST = null; + + switch ( LA(1)) { + case NTypedefName: + { + TNode tmp252_AST = null; + tmp252_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp252_AST); + match(NTypedefName); + dummy_AST = (TNode)currentAST.root; + break; + } + case NInitDecl: + { + TNode tmp253_AST = null; + tmp253_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp253_AST); + match(NInitDecl); + dummy_AST = (TNode)currentAST.root; + break; + } + case NDeclarator: + { + TNode tmp254_AST = null; + tmp254_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp254_AST); + match(NDeclarator); + dummy_AST = (TNode)currentAST.root; + break; + } + case NStructDeclarator: + { + TNode tmp255_AST = null; + tmp255_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp255_AST); + match(NStructDeclarator); + dummy_AST = (TNode)currentAST.root; + break; + } + case NDeclaration: + { + TNode tmp256_AST = null; + tmp256_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp256_AST); + match(NDeclaration); + dummy_AST = (TNode)currentAST.root; + break; + } + case NCast: + { + TNode tmp257_AST = null; + tmp257_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp257_AST); + match(NCast); + dummy_AST = (TNode)currentAST.root; + break; + } + case NPointerGroup: + { + TNode tmp258_AST = null; + tmp258_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp258_AST); + match(NPointerGroup); + dummy_AST = (TNode)currentAST.root; + break; + } + case NExpressionGroup: + { + TNode tmp259_AST = null; + tmp259_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp259_AST); + match(NExpressionGroup); + dummy_AST = (TNode)currentAST.root; + break; + } + case NFunctionCallArgs: + { + TNode tmp260_AST = null; + tmp260_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp260_AST); + match(NFunctionCallArgs); + dummy_AST = (TNode)currentAST.root; + break; + } + case NNonemptyAbstractDeclarator: + { + TNode tmp261_AST = null; + tmp261_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp261_AST); + match(NNonemptyAbstractDeclarator); + dummy_AST = (TNode)currentAST.root; + break; + } + case NInitializer: + { + TNode tmp262_AST = null; + tmp262_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp262_AST); + match(NInitializer); + dummy_AST = (TNode)currentAST.root; + break; + } + case NStatementExpr: + { + TNode tmp263_AST = null; + tmp263_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp263_AST); + match(NStatementExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NEmptyExpression: + { + TNode tmp264_AST = null; + tmp264_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp264_AST); + match(NEmptyExpression); + dummy_AST = (TNode)currentAST.root; + break; + } + case NParameterTypeList: + { + TNode tmp265_AST = null; + tmp265_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp265_AST); + match(NParameterTypeList); + dummy_AST = (TNode)currentAST.root; + break; + } + case NFunctionDef: + { + TNode tmp266_AST = null; + tmp266_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp266_AST); + match(NFunctionDef); + dummy_AST = (TNode)currentAST.root; + break; + } + case NCompoundStatement: + { + TNode tmp267_AST = null; + tmp267_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp267_AST); + match(NCompoundStatement); + dummy_AST = (TNode)currentAST.root; + break; + } + case NParameterDeclaration: + { + TNode tmp268_AST = null; + tmp268_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp268_AST); + match(NParameterDeclaration); + dummy_AST = (TNode)currentAST.root; + break; + } + case NCommaExpr: + { + TNode tmp269_AST = null; + tmp269_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp269_AST); + match(NCommaExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NUnaryExpr: + { + TNode tmp270_AST = null; + tmp270_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp270_AST); + match(NUnaryExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NLabel: + { + TNode tmp271_AST = null; + tmp271_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp271_AST); + match(NLabel); + dummy_AST = (TNode)currentAST.root; + break; + } + case NPostfixExpr: + { + TNode tmp272_AST = null; + tmp272_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp272_AST); + match(NPostfixExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NRangeExpr: + { + TNode tmp273_AST = null; + tmp273_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp273_AST); + match(NRangeExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NStringSeq: + { + TNode tmp274_AST = null; + tmp274_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp274_AST); + match(NStringSeq); + dummy_AST = (TNode)currentAST.root; + break; + } + case NInitializerElementLabel: + { + TNode tmp275_AST = null; + tmp275_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp275_AST); + match(NInitializerElementLabel); + dummy_AST = (TNode)currentAST.root; + break; + } + case NLcurlyInitializer: + { + TNode tmp276_AST = null; + tmp276_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp276_AST); + match(NLcurlyInitializer); + dummy_AST = (TNode)currentAST.root; + break; + } + case NAsmAttribute: + { + TNode tmp277_AST = null; + tmp277_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp277_AST); + match(NAsmAttribute); + dummy_AST = (TNode)currentAST.root; + break; + } + case NGnuAsmExpr: + { + TNode tmp278_AST = null; + tmp278_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp278_AST); + match(NGnuAsmExpr); + dummy_AST = (TNode)currentAST.root; + break; + } + case NTypeMissing: + { + TNode tmp279_AST = null; + tmp279_AST = (TNode)astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp279_AST); + match(NTypeMissing); + dummy_AST = (TNode)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = dummy_AST; + } + + + public static final String[] _tokenNames = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "\"typedef\"", + "\"asm\"", + "\"volatile\"", + "LCURLY", + "RCURLY", + "SEMI", + "\"struct\"", + "\"union\"", + "\"enum\"", + "\"auto\"", + "\"register\"", + "\"extern\"", + "\"static\"", + "\"const\"", + "\"void\"", + "\"char\"", + "\"short\"", + "\"int\"", + "\"long\"", + "\"float\"", + "\"double\"", + "\"signed\"", + "\"unsigned\"", + "ID", + "COMMA", + "COLON", + "ASSIGN", + "STAR", + "LPAREN", + "RPAREN", + "LBRACKET", + "RBRACKET", + "VARARGS", + "\"while\"", + "\"do\"", + "\"for\"", + "\"goto\"", + "\"continue\"", + "\"break\"", + "\"return\"", + "\"case\"", + "\"default\"", + "\"if\"", + "\"else\"", + "\"switch\"", + "DIV_ASSIGN", + "PLUS_ASSIGN", + "MINUS_ASSIGN", + "STAR_ASSIGN", + "MOD_ASSIGN", + "RSHIFT_ASSIGN", + "LSHIFT_ASSIGN", + "BAND_ASSIGN", + "BOR_ASSIGN", + "BXOR_ASSIGN", + "QUESTION", + "LOR", + "LAND", + "BOR", + "BXOR", + "BAND", + "EQUAL", + "NOT_EQUAL", + "LT", + "LTE", + "GT", + "GTE", + "LSHIFT", + "RSHIFT", + "PLUS", + "MINUS", + "DIV", + "MOD", + "INC", + "DEC", + "\"sizeof\"", + "BNOT", + "LNOT", + "PTR", + "DOT", + "CharLiteral", + "StringLiteral", + "IntOctalConst", + "LongOctalConst", + "UnsignedOctalConst", + "IntIntConst", + "LongIntConst", + "UnsignedIntConst", + "IntHexConst", + "LongHexConst", + "UnsignedHexConst", + "FloatDoubleConst", + "DoubleDoubleConst", + "LongDoubleConst", + "NTypedefName", + "NInitDecl", + "NDeclarator", + "NStructDeclarator", + "NDeclaration", + "NCast", + "NPointerGroup", + "NExpressionGroup", + "NFunctionCallArgs", + "NNonemptyAbstractDeclarator", + "NInitializer", + "NStatementExpr", + "NEmptyExpression", + "NParameterTypeList", + "NFunctionDef", + "NCompoundStatement", + "NParameterDeclaration", + "NCommaExpr", + "NUnaryExpr", + "NLabel", + "NPostfixExpr", + "NRangeExpr", + "NStringSeq", + "NInitializerElementLabel", + "NLcurlyInitializer", + "NAsmAttribute", + "NGnuAsmExpr", + "NTypeMissing", + "Vocabulary", + "Whitespace", + "Comment", + "CPPComment", + "a line directive", + "Space", + "LineDirective", + "BadStringLiteral", + "Escape", + "Digit", + "LongSuffix", + "UnsignedSuffix", + "FloatSuffix", + "Exponent", + "Number", + "\"__label__\"", + "\"inline\"", + "\"byte\"", + "\"boolean\"", + "\"Servo\"", + "\"Wire\"", + "\"typeof\"", + "\"__complex\"", + "\"__attribute\"", + "\"__alignof\"", + "\"__real\"", + "\"__imag\"" + }; + + protected void buildTokenTypeASTClassMap() { + tokenTypeToASTClassMap=null; + }; + + private static final long[] mk_tokenSet_0() { + long[] data = { 6710886000L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); + private static final long[] mk_tokenSet_1() { + long[] data = { 6710886002L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); + private static final long[] mk_tokenSet_2() { + long[] data = { 2305843015790362656L, 3401217L, 29364224L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); + private static final long[] mk_tokenSet_3() { + long[] data = { 268434512L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); + private static final long[] mk_tokenSet_4() { + long[] data = { 6710886096L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); + private static final long[] mk_tokenSet_5() { + long[] data = { 6710860864L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); + private static final long[] mk_tokenSet_6() { + long[] data = { 92610232016L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6()); + private static final long[] mk_tokenSet_7() { + long[] data = { 6576668672L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7()); + private static final long[] mk_tokenSet_8() { + long[] data = { 25635717728L, 0L, 2097152L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8()); + private static final long[] mk_tokenSet_9() { + long[] data = { 2306265159670169586L, 3401217L, 31453184L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9()); + private static final long[] mk_tokenSet_10() { + long[] data = { 268409920L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10()); + private static final long[] mk_tokenSet_11() { + long[] data = { 6710860992L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11()); + private static final long[] mk_tokenSet_12() { + long[] data = { 268180480L, 0L, 2064384L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); + private static final long[] mk_tokenSet_13() { + long[] data = { 2305843032970231968L, 3925505L, 29364224L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13()); + private static final long[] mk_tokenSet_14() { + long[] data = { -562924183740448L, 4194303L, 31428608L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_14 = new BitSet(mk_tokenSet_14()); + private static final long[] mk_tokenSet_15() { + long[] data = { 17314086912L, 524288L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_15 = new BitSet(mk_tokenSet_15()); + private static final long[] mk_tokenSet_16() { + long[] data = { 2305843016327233568L, 3401217L, 29364224L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_16 = new BitSet(mk_tokenSet_16()); + private static final long[] mk_tokenSet_17() { + long[] data = { 2305843015790362784L, 3401217L, 29364224L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_17 = new BitSet(mk_tokenSet_17()); + private static final long[] mk_tokenSet_18() { + long[] data = { -562924720611360L, 4194303L, 31428608L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_18 = new BitSet(mk_tokenSet_18()); + private static final long[] mk_tokenSet_19() { + long[] data = { 2305843032970232224L, 3925505L, 29364224L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_19 = new BitSet(mk_tokenSet_19()); + private static final long[] mk_tokenSet_20() { + long[] data = { -576460659693314848L, 4194303L, 31428608L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_20 = new BitSet(mk_tokenSet_20()); + private static final long[] mk_tokenSet_21() { + long[] data = { -576460694053053216L, 4194303L, 31428608L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_21 = new BitSet(mk_tokenSet_21()); + private static final long[] mk_tokenSet_22() { + long[] data = { 32749125328L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_22 = new BitSet(mk_tokenSet_22()); + private static final long[] mk_tokenSet_23() { + long[] data = { 8992587776L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_23 = new BitSet(mk_tokenSet_23()); + private static final long[] mk_tokenSet_24() { + long[] data = { 100931731184L, 0L, 4177920L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_24 = new BitSet(mk_tokenSet_24()); + private static final long[] mk_tokenSet_25() { + long[] data = { 32615039552L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_25 = new BitSet(mk_tokenSet_25()); + private static final long[] mk_tokenSet_26() { + long[] data = { 23622320128L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_26 = new BitSet(mk_tokenSet_26()); + private static final long[] mk_tokenSet_27() { + long[] data = { 2305843076322557552L, 3401217L, 31444992L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_27 = new BitSet(mk_tokenSet_27()); + private static final long[] mk_tokenSet_28() { + long[] data = { 8858370560L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_28 = new BitSet(mk_tokenSet_28()); + private static final long[] mk_tokenSet_29() { + long[] data = { 2306265090950692848L, 3401217L, 31453184L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_29 = new BitSet(mk_tokenSet_29()); + private static final long[] mk_tokenSet_30() { + long[] data = { 268311616L, 0L, 2064384L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_30 = new BitSet(mk_tokenSet_30()); + private static final long[] mk_tokenSet_31() { + long[] data = { 32480566464L, 0L, 2064384L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_31 = new BitSet(mk_tokenSet_31()); + private static final long[] mk_tokenSet_32() { + long[] data = { -562916130677536L, 4194303L, 31428608L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_32 = new BitSet(mk_tokenSet_32()); + private static final long[] mk_tokenSet_33() { + long[] data = { 33285996144L, 0L, 4177920L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_33 = new BitSet(mk_tokenSet_33()); + private static final long[] mk_tokenSet_34() { + long[] data = { 33285873376L, 0L, 4161536L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_34 = new BitSet(mk_tokenSet_34()); + private static final long[] mk_tokenSet_35() { + long[] data = { 7381975584L, 0L, 2097152L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_35 = new BitSet(mk_tokenSet_35()); + private static final long[] mk_tokenSet_36() { + long[] data = { -13153337360L, -1L, 33554431L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_36 = new BitSet(mk_tokenSet_36()); + private static final long[] mk_tokenSet_37() { + long[] data = { 268434512L, 0L, 2088960L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_37 = new BitSet(mk_tokenSet_37()); + private static final long[] mk_tokenSet_38() { + long[] data = { 6710869056L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_38 = new BitSet(mk_tokenSet_38()); + private static final long[] mk_tokenSet_39() { + long[] data = { 23890754768L, 0L, 2080768L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_39 = new BitSet(mk_tokenSet_39()); + private static final long[] mk_tokenSet_40() { + long[] data = { 2306265090816475808L, 3401217L, 29364224L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_40 = new BitSet(mk_tokenSet_40()); + private static final long[] mk_tokenSet_41() { + long[] data = { -576460727875920672L, 4194303L, 31428608L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_41 = new BitSet(mk_tokenSet_41()); + private static final long[] mk_tokenSet_42() { + long[] data = { -111669149712L, 4194303L, 31453184L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_42 = new BitSet(mk_tokenSet_42()); + private static final long[] mk_tokenSet_43() { + long[] data = { 2306405828304831392L, 3401217L, 29364224L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_43 = new BitSet(mk_tokenSet_43()); + private static final long[] mk_tokenSet_44() { + long[] data = { -103079215118L, 4194303L, 31453184L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_44 = new BitSet(mk_tokenSet_44()); + private static final long[] mk_tokenSet_45() { + long[] data = { -562924720611616L, 4194303L, 31428608L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_45 = new BitSet(mk_tokenSet_45()); + private static final long[] mk_tokenSet_46() { + long[] data = { -562812648684576L, 4194303L, 31461376L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_46 = new BitSet(mk_tokenSet_46()); + private static final long[] mk_tokenSet_47() { + long[] data = { 9126805504L, 2097152L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_47 = new BitSet(mk_tokenSet_47()); + private static final long[] mk_tokenSet_48() { + long[] data = { -562834257738976L, 2105343L, 2097152L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_48 = new BitSet(mk_tokenSet_48()); + private static final long[] mk_tokenSet_49() { + long[] data = { 2147483648L, 6144L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_49 = new BitSet(mk_tokenSet_49()); + + } diff --git a/app/preproc/WTokenTypes.java b/app/preproc/WTokenTypes.java index b4fe33013..67b13a844 100644 --- a/app/preproc/WTokenTypes.java +++ b/app/preproc/WTokenTypes.java @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "expandedWParser.g" -> "WLexer.java"$ +// $ANTLR 2.7.2: "expandedWParser.g" -> "WLexer.java"$ package processing.app.preproc; @@ -6,157 +6,157 @@ import java.io.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -public interface WTokenTypes { - int EOF = 1; - int NULL_TREE_LOOKAHEAD = 3; - int LITERAL_typedef = 4; - int LITERAL_asm = 5; - int LITERAL_volatile = 6; - int LCURLY = 7; - int RCURLY = 8; - int SEMI = 9; - int LITERAL_struct = 10; - int LITERAL_union = 11; - int LITERAL_enum = 12; - int LITERAL_auto = 13; - int LITERAL_register = 14; - int LITERAL_extern = 15; - int LITERAL_static = 16; - int LITERAL_const = 17; - int LITERAL_void = 18; - int LITERAL_char = 19; - int LITERAL_short = 20; - int LITERAL_int = 21; - int LITERAL_long = 22; - int LITERAL_float = 23; - int LITERAL_double = 24; - int LITERAL_signed = 25; - int LITERAL_unsigned = 26; - int ID = 27; - int COMMA = 28; - int COLON = 29; - int ASSIGN = 30; - int STAR = 31; - int LPAREN = 32; - int RPAREN = 33; - int LBRACKET = 34; - int RBRACKET = 35; - int VARARGS = 36; - int LITERAL_while = 37; - int LITERAL_do = 38; - int LITERAL_for = 39; - int LITERAL_goto = 40; - int LITERAL_continue = 41; - int LITERAL_break = 42; - int LITERAL_return = 43; - int LITERAL_case = 44; - int LITERAL_default = 45; - int LITERAL_if = 46; - int LITERAL_else = 47; - int LITERAL_switch = 48; - int DIV_ASSIGN = 49; - int PLUS_ASSIGN = 50; - int MINUS_ASSIGN = 51; - int STAR_ASSIGN = 52; - int MOD_ASSIGN = 53; - int RSHIFT_ASSIGN = 54; - int LSHIFT_ASSIGN = 55; - int BAND_ASSIGN = 56; - int BOR_ASSIGN = 57; - int BXOR_ASSIGN = 58; - int QUESTION = 59; - int LOR = 60; - int LAND = 61; - int BOR = 62; - int BXOR = 63; - int BAND = 64; - int EQUAL = 65; - int NOT_EQUAL = 66; - int LT = 67; - int LTE = 68; - int GT = 69; - int GTE = 70; - int LSHIFT = 71; - int RSHIFT = 72; - int PLUS = 73; - int MINUS = 74; - int DIV = 75; - int MOD = 76; - int INC = 77; - int DEC = 78; - int LITERAL_sizeof = 79; - int BNOT = 80; - int LNOT = 81; - int PTR = 82; - int DOT = 83; - int CharLiteral = 84; - int StringLiteral = 85; - int IntOctalConst = 86; - int LongOctalConst = 87; - int UnsignedOctalConst = 88; - int IntIntConst = 89; - int LongIntConst = 90; - int UnsignedIntConst = 91; - int IntHexConst = 92; - int LongHexConst = 93; - int UnsignedHexConst = 94; - int FloatDoubleConst = 95; - int DoubleDoubleConst = 96; - int LongDoubleConst = 97; - int NTypedefName = 98; - int NInitDecl = 99; - int NDeclarator = 100; - int NStructDeclarator = 101; - int NDeclaration = 102; - int NCast = 103; - int NPointerGroup = 104; - int NExpressionGroup = 105; - int NFunctionCallArgs = 106; - int NNonemptyAbstractDeclarator = 107; - int NInitializer = 108; - int NStatementExpr = 109; - int NEmptyExpression = 110; - int NParameterTypeList = 111; - int NFunctionDef = 112; - int NCompoundStatement = 113; - int NParameterDeclaration = 114; - int NCommaExpr = 115; - int NUnaryExpr = 116; - int NLabel = 117; - int NPostfixExpr = 118; - int NRangeExpr = 119; - int NStringSeq = 120; - int NInitializerElementLabel = 121; - int NLcurlyInitializer = 122; - int NAsmAttribute = 123; - int NGnuAsmExpr = 124; - int NTypeMissing = 125; - int Vocabulary = 126; - int Whitespace = 127; - int Comment = 128; - int CPPComment = 129; - int PREPROC_DIRECTIVE = 130; - int Space = 131; - int LineDirective = 132; - int BadStringLiteral = 133; - int Escape = 134; - int Digit = 135; - int LongSuffix = 136; - int UnsignedSuffix = 137; - int FloatSuffix = 138; - int Exponent = 139; - int Number = 140; - int LITERAL___label__ = 141; - int LITERAL_inline = 142; - int LITERAL_byte = 143; - int LITERAL_boolean = 144; - int LITERAL_Servo = 145; - int LITERAL_Wire = 146; - int LITERAL_typeof = 147; - int LITERAL___complex = 148; - int LITERAL___attribute = 149; - int LITERAL___alignof = 150; - int LITERAL___real = 151; - int LITERAL___imag = 152; -} + +public interface WTokenTypes { + int EOF = 1; + int NULL_TREE_LOOKAHEAD = 3; + int LITERAL_typedef = 4; + int LITERAL_asm = 5; + int LITERAL_volatile = 6; + int LCURLY = 7; + int RCURLY = 8; + int SEMI = 9; + int LITERAL_struct = 10; + int LITERAL_union = 11; + int LITERAL_enum = 12; + int LITERAL_auto = 13; + int LITERAL_register = 14; + int LITERAL_extern = 15; + int LITERAL_static = 16; + int LITERAL_const = 17; + int LITERAL_void = 18; + int LITERAL_char = 19; + int LITERAL_short = 20; + int LITERAL_int = 21; + int LITERAL_long = 22; + int LITERAL_float = 23; + int LITERAL_double = 24; + int LITERAL_signed = 25; + int LITERAL_unsigned = 26; + int ID = 27; + int COMMA = 28; + int COLON = 29; + int ASSIGN = 30; + int STAR = 31; + int LPAREN = 32; + int RPAREN = 33; + int LBRACKET = 34; + int RBRACKET = 35; + int VARARGS = 36; + int LITERAL_while = 37; + int LITERAL_do = 38; + int LITERAL_for = 39; + int LITERAL_goto = 40; + int LITERAL_continue = 41; + int LITERAL_break = 42; + int LITERAL_return = 43; + int LITERAL_case = 44; + int LITERAL_default = 45; + int LITERAL_if = 46; + int LITERAL_else = 47; + int LITERAL_switch = 48; + int DIV_ASSIGN = 49; + int PLUS_ASSIGN = 50; + int MINUS_ASSIGN = 51; + int STAR_ASSIGN = 52; + int MOD_ASSIGN = 53; + int RSHIFT_ASSIGN = 54; + int LSHIFT_ASSIGN = 55; + int BAND_ASSIGN = 56; + int BOR_ASSIGN = 57; + int BXOR_ASSIGN = 58; + int QUESTION = 59; + int LOR = 60; + int LAND = 61; + int BOR = 62; + int BXOR = 63; + int BAND = 64; + int EQUAL = 65; + int NOT_EQUAL = 66; + int LT = 67; + int LTE = 68; + int GT = 69; + int GTE = 70; + int LSHIFT = 71; + int RSHIFT = 72; + int PLUS = 73; + int MINUS = 74; + int DIV = 75; + int MOD = 76; + int INC = 77; + int DEC = 78; + int LITERAL_sizeof = 79; + int BNOT = 80; + int LNOT = 81; + int PTR = 82; + int DOT = 83; + int CharLiteral = 84; + int StringLiteral = 85; + int IntOctalConst = 86; + int LongOctalConst = 87; + int UnsignedOctalConst = 88; + int IntIntConst = 89; + int LongIntConst = 90; + int UnsignedIntConst = 91; + int IntHexConst = 92; + int LongHexConst = 93; + int UnsignedHexConst = 94; + int FloatDoubleConst = 95; + int DoubleDoubleConst = 96; + int LongDoubleConst = 97; + int NTypedefName = 98; + int NInitDecl = 99; + int NDeclarator = 100; + int NStructDeclarator = 101; + int NDeclaration = 102; + int NCast = 103; + int NPointerGroup = 104; + int NExpressionGroup = 105; + int NFunctionCallArgs = 106; + int NNonemptyAbstractDeclarator = 107; + int NInitializer = 108; + int NStatementExpr = 109; + int NEmptyExpression = 110; + int NParameterTypeList = 111; + int NFunctionDef = 112; + int NCompoundStatement = 113; + int NParameterDeclaration = 114; + int NCommaExpr = 115; + int NUnaryExpr = 116; + int NLabel = 117; + int NPostfixExpr = 118; + int NRangeExpr = 119; + int NStringSeq = 120; + int NInitializerElementLabel = 121; + int NLcurlyInitializer = 122; + int NAsmAttribute = 123; + int NGnuAsmExpr = 124; + int NTypeMissing = 125; + int Vocabulary = 126; + int Whitespace = 127; + int Comment = 128; + int CPPComment = 129; + int PREPROC_DIRECTIVE = 130; + int Space = 131; + int LineDirective = 132; + int BadStringLiteral = 133; + int Escape = 134; + int Digit = 135; + int LongSuffix = 136; + int UnsignedSuffix = 137; + int FloatSuffix = 138; + int Exponent = 139; + int Number = 140; + int LITERAL___label__ = 141; + int LITERAL_inline = 142; + int LITERAL_byte = 143; + int LITERAL_boolean = 144; + int LITERAL_Servo = 145; + int LITERAL_Wire = 146; + int LITERAL_typeof = 147; + int LITERAL___complex = 148; + int LITERAL___attribute = 149; + int LITERAL___alignof = 150; + int LITERAL___real = 151; + int LITERAL___imag = 152; +} diff --git a/app/preproc/WTokenTypes.txt b/app/preproc/WTokenTypes.txt index 7f58355f7..f6a6bd02d 100644 --- a/app/preproc/WTokenTypes.txt +++ b/app/preproc/WTokenTypes.txt @@ -1,151 +1,151 @@ -// $ANTLR 2.7.2: expandedWParser.g -> WTokenTypes.txt$ -W // output token vocab name -LITERAL_typedef="typedef"=4 -LITERAL_asm="asm"=5 -LITERAL_volatile="volatile"=6 -LCURLY=7 -RCURLY=8 -SEMI=9 -LITERAL_struct="struct"=10 -LITERAL_union="union"=11 -LITERAL_enum="enum"=12 -LITERAL_auto="auto"=13 -LITERAL_register="register"=14 -LITERAL_extern="extern"=15 -LITERAL_static="static"=16 -LITERAL_const="const"=17 -LITERAL_void="void"=18 -LITERAL_char="char"=19 -LITERAL_short="short"=20 -LITERAL_int="int"=21 -LITERAL_long="long"=22 -LITERAL_float="float"=23 -LITERAL_double="double"=24 -LITERAL_signed="signed"=25 -LITERAL_unsigned="unsigned"=26 -ID=27 -COMMA=28 -COLON=29 -ASSIGN=30 -STAR=31 -LPAREN=32 -RPAREN=33 -LBRACKET=34 -RBRACKET=35 -VARARGS=36 -LITERAL_while="while"=37 -LITERAL_do="do"=38 -LITERAL_for="for"=39 -LITERAL_goto="goto"=40 -LITERAL_continue="continue"=41 -LITERAL_break="break"=42 -LITERAL_return="return"=43 -LITERAL_case="case"=44 -LITERAL_default="default"=45 -LITERAL_if="if"=46 -LITERAL_else="else"=47 -LITERAL_switch="switch"=48 -DIV_ASSIGN=49 -PLUS_ASSIGN=50 -MINUS_ASSIGN=51 -STAR_ASSIGN=52 -MOD_ASSIGN=53 -RSHIFT_ASSIGN=54 -LSHIFT_ASSIGN=55 -BAND_ASSIGN=56 -BOR_ASSIGN=57 -BXOR_ASSIGN=58 -QUESTION=59 -LOR=60 -LAND=61 -BOR=62 -BXOR=63 -BAND=64 -EQUAL=65 -NOT_EQUAL=66 -LT=67 -LTE=68 -GT=69 -GTE=70 -LSHIFT=71 -RSHIFT=72 -PLUS=73 -MINUS=74 -DIV=75 -MOD=76 -INC=77 -DEC=78 -LITERAL_sizeof="sizeof"=79 -BNOT=80 -LNOT=81 -PTR=82 -DOT=83 -CharLiteral=84 -StringLiteral=85 -IntOctalConst=86 -LongOctalConst=87 -UnsignedOctalConst=88 -IntIntConst=89 -LongIntConst=90 -UnsignedIntConst=91 -IntHexConst=92 -LongHexConst=93 -UnsignedHexConst=94 -FloatDoubleConst=95 -DoubleDoubleConst=96 -LongDoubleConst=97 -NTypedefName=98 -NInitDecl=99 -NDeclarator=100 -NStructDeclarator=101 -NDeclaration=102 -NCast=103 -NPointerGroup=104 -NExpressionGroup=105 -NFunctionCallArgs=106 -NNonemptyAbstractDeclarator=107 -NInitializer=108 -NStatementExpr=109 -NEmptyExpression=110 -NParameterTypeList=111 -NFunctionDef=112 -NCompoundStatement=113 -NParameterDeclaration=114 -NCommaExpr=115 -NUnaryExpr=116 -NLabel=117 -NPostfixExpr=118 -NRangeExpr=119 -NStringSeq=120 -NInitializerElementLabel=121 -NLcurlyInitializer=122 -NAsmAttribute=123 -NGnuAsmExpr=124 -NTypeMissing=125 -Vocabulary=126 -Whitespace=127 -Comment=128 -CPPComment=129 -PREPROC_DIRECTIVE("a line directive")=130 -Space=131 -LineDirective=132 -BadStringLiteral=133 -Escape=134 -Digit=135 -LongSuffix=136 -UnsignedSuffix=137 -FloatSuffix=138 -Exponent=139 -Number=140 -LITERAL___label__="__label__"=141 -LITERAL_inline="inline"=142 -LITERAL_byte="byte"=143 -LITERAL_boolean="boolean"=144 -LITERAL_Servo="Servo"=145 -LITERAL_Wire="Wire"=146 -LITERAL_typeof="typeof"=147 -LITERAL___complex="__complex"=148 -LITERAL___attribute="__attribute"=149 -LITERAL___alignof="__alignof"=150 -LITERAL___real="__real"=151 -LITERAL___imag="__imag"=152 +// $ANTLR 2.7.2: expandedWParser.g -> WTokenTypes.txt$ +W // output token vocab name +LITERAL_typedef="typedef"=4 +LITERAL_asm="asm"=5 +LITERAL_volatile="volatile"=6 +LCURLY=7 +RCURLY=8 +SEMI=9 +LITERAL_struct="struct"=10 +LITERAL_union="union"=11 +LITERAL_enum="enum"=12 +LITERAL_auto="auto"=13 +LITERAL_register="register"=14 +LITERAL_extern="extern"=15 +LITERAL_static="static"=16 +LITERAL_const="const"=17 +LITERAL_void="void"=18 +LITERAL_char="char"=19 +LITERAL_short="short"=20 +LITERAL_int="int"=21 +LITERAL_long="long"=22 +LITERAL_float="float"=23 +LITERAL_double="double"=24 +LITERAL_signed="signed"=25 +LITERAL_unsigned="unsigned"=26 +ID=27 +COMMA=28 +COLON=29 +ASSIGN=30 +STAR=31 +LPAREN=32 +RPAREN=33 +LBRACKET=34 +RBRACKET=35 +VARARGS=36 +LITERAL_while="while"=37 +LITERAL_do="do"=38 +LITERAL_for="for"=39 +LITERAL_goto="goto"=40 +LITERAL_continue="continue"=41 +LITERAL_break="break"=42 +LITERAL_return="return"=43 +LITERAL_case="case"=44 +LITERAL_default="default"=45 +LITERAL_if="if"=46 +LITERAL_else="else"=47 +LITERAL_switch="switch"=48 +DIV_ASSIGN=49 +PLUS_ASSIGN=50 +MINUS_ASSIGN=51 +STAR_ASSIGN=52 +MOD_ASSIGN=53 +RSHIFT_ASSIGN=54 +LSHIFT_ASSIGN=55 +BAND_ASSIGN=56 +BOR_ASSIGN=57 +BXOR_ASSIGN=58 +QUESTION=59 +LOR=60 +LAND=61 +BOR=62 +BXOR=63 +BAND=64 +EQUAL=65 +NOT_EQUAL=66 +LT=67 +LTE=68 +GT=69 +GTE=70 +LSHIFT=71 +RSHIFT=72 +PLUS=73 +MINUS=74 +DIV=75 +MOD=76 +INC=77 +DEC=78 +LITERAL_sizeof="sizeof"=79 +BNOT=80 +LNOT=81 +PTR=82 +DOT=83 +CharLiteral=84 +StringLiteral=85 +IntOctalConst=86 +LongOctalConst=87 +UnsignedOctalConst=88 +IntIntConst=89 +LongIntConst=90 +UnsignedIntConst=91 +IntHexConst=92 +LongHexConst=93 +UnsignedHexConst=94 +FloatDoubleConst=95 +DoubleDoubleConst=96 +LongDoubleConst=97 +NTypedefName=98 +NInitDecl=99 +NDeclarator=100 +NStructDeclarator=101 +NDeclaration=102 +NCast=103 +NPointerGroup=104 +NExpressionGroup=105 +NFunctionCallArgs=106 +NNonemptyAbstractDeclarator=107 +NInitializer=108 +NStatementExpr=109 +NEmptyExpression=110 +NParameterTypeList=111 +NFunctionDef=112 +NCompoundStatement=113 +NParameterDeclaration=114 +NCommaExpr=115 +NUnaryExpr=116 +NLabel=117 +NPostfixExpr=118 +NRangeExpr=119 +NStringSeq=120 +NInitializerElementLabel=121 +NLcurlyInitializer=122 +NAsmAttribute=123 +NGnuAsmExpr=124 +NTypeMissing=125 +Vocabulary=126 +Whitespace=127 +Comment=128 +CPPComment=129 +PREPROC_DIRECTIVE("a line directive")=130 +Space=131 +LineDirective=132 +BadStringLiteral=133 +Escape=134 +Digit=135 +LongSuffix=136 +UnsignedSuffix=137 +FloatSuffix=138 +Exponent=139 +Number=140 +LITERAL___label__="__label__"=141 +LITERAL_inline="inline"=142 +LITERAL_byte="byte"=143 +LITERAL_boolean="boolean"=144 +LITERAL_Servo="Servo"=145 +LITERAL_Wire="Wire"=146 +LITERAL_typeof="typeof"=147 +LITERAL___complex="__complex"=148 +LITERAL___attribute="__attribute"=149 +LITERAL___alignof="__alignof"=150 +LITERAL___real="__real"=151 +LITERAL___imag="__imag"=152 diff --git a/app/preproc/WTreeParser.java b/app/preproc/WTreeParser.java index 2d0175c7f..b78d48716 100644 --- a/app/preproc/WTreeParser.java +++ b/app/preproc/WTreeParser.java @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "WTreeParser.g" -> "WTreeParser.java"$ +// $ANTLR 2.7.2: "WTreeParser.g" -> "WTreeParser.java"$ package processing.app.preproc; @@ -6,22 +6,22 @@ import java.io.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -import antlr.TreeParser; -import antlr.Token; -import antlr.collections.AST; -import antlr.RecognitionException; -import antlr.ANTLRException; -import antlr.NoViableAltException; -import antlr.MismatchedTokenException; -import antlr.SemanticException; -import antlr.collections.impl.BitSet; -import antlr.ASTPair; -import antlr.collections.impl.ASTArray; - - -public class WTreeParser extends antlr.TreeParser implements WTreeParserTokenTypes - { + +import antlr.TreeParser; +import antlr.Token; +import antlr.collections.AST; +import antlr.RecognitionException; +import antlr.ANTLRException; +import antlr.NoViableAltException; +import antlr.MismatchedTokenException; +import antlr.SemanticException; +import antlr.collections.impl.BitSet; +import antlr.ASTPair; +import antlr.collections.impl.ASTArray; + + +public class WTreeParser extends antlr.TreeParser implements WTreeParserTokenTypes + { int traceDepth = 0; public void reportError(RecognitionException ex) { @@ -72,5480 +72,5480 @@ public class WTreeParser extends antlr.TreeParser implements WTreeParserTo } -public WTreeParser() { - tokenNames = _tokenNames; -} - - public final void translationUnit(AST _t) throws RecognitionException { - - TNode translationUnit_AST_in = (TNode)_t; - - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_asm: - case SEMI: - case NDeclaration: - case NFunctionDef: - case NTypeMissing: - { - externalList(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _retTree = _t; - } - - public final void externalList(AST _t) throws RecognitionException { - - TNode externalList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt5=0; - _loop5: - do { - if (_t==null) _t=ASTNULL; - if ((_tokenSet_0.member(_t.getType()))) { - externalDef(_t); - _t = _retTree; - } - else { - if ( _cnt5>=1 ) { break _loop5; } else {throw new NoViableAltException(_t);} - } - - _cnt5++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void externalDef(AST _t) throws RecognitionException { - - TNode externalDef_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NDeclaration: - { - declaration(_t); - _t = _retTree; - break; - } - case NFunctionDef: - { - functionDef(_t); - _t = _retTree; - break; - } - case LITERAL_asm: - { - asm_expr(_t); - _t = _retTree; - break; - } - case SEMI: - { - TNode tmp1_AST_in = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - break; - } - case NTypeMissing: - { - typelessDeclaration(_t); - _t = _retTree; - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void declaration(AST _t) throws RecognitionException { - - TNode declaration_AST_in = (TNode)_t; - - try { // for error handling - AST __t15 = _t; - TNode tmp2_AST_in = (TNode)_t; - match(_t,NDeclaration); - _t = _t.getFirstChild(); - declSpecifiers(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NInitDecl: - { - initDeclList(_t); - _t = _retTree; - break; - } - case SEMI: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - int _cnt18=0; - _loop18: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==SEMI)) { - TNode tmp3_AST_in = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - } - else { - if ( _cnt18>=1 ) { break _loop18; } else {throw new NoViableAltException(_t);} - } - - _cnt18++; - } while (true); - } - _t = __t15; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void functionDef(AST _t) throws RecognitionException { - - TNode functionDef_AST_in = (TNode)_t; - - try { // for error handling - AST __t125 = _t; - TNode tmp4_AST_in = (TNode)_t; - match(_t,NFunctionDef); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_inline: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - functionDeclSpecifiers(_t); - _t = _retTree; - break; - } - case NDeclarator: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - declarator(_t); - _t = _retTree; - { - _loop128: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NDeclaration: - { - declaration(_t); - _t = _retTree; - break; - } - case VARARGS: - { - TNode tmp5_AST_in = (TNode)_t; - match(_t,VARARGS); - _t = _t.getNextSibling(); - break; - } - default: - { - break _loop128; - } - } - } while (true); - } - compoundStatement(_t); - _t = _retTree; - _t = __t125; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void asm_expr(AST _t) throws RecognitionException { - - TNode asm_expr_AST_in = (TNode)_t; - - try { // for error handling - AST __t10 = _t; - TNode tmp6_AST_in = (TNode)_t; - match(_t,LITERAL_asm); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - { - TNode tmp7_AST_in = (TNode)_t; - match(_t,LITERAL_volatile); - _t = _t.getNextSibling(); - break; - } - case LCURLY: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp8_AST_in = (TNode)_t; - match(_t,LCURLY); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - TNode tmp9_AST_in = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - { - int _cnt13=0; - _loop13: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==SEMI)) { - TNode tmp10_AST_in = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - } - else { - if ( _cnt13>=1 ) { break _loop13; } else {throw new NoViableAltException(_t);} - } - - _cnt13++; - } while (true); - } - _t = __t10; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void typelessDeclaration(AST _t) throws RecognitionException { - - TNode typelessDeclaration_AST_in = (TNode)_t; - - try { // for error handling - AST __t8 = _t; - TNode tmp11_AST_in = (TNode)_t; - match(_t,NTypeMissing); - _t = _t.getFirstChild(); - initDeclList(_t); - _t = _retTree; - TNode tmp12_AST_in = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - _t = __t8; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void initDeclList(AST _t) throws RecognitionException { - - TNode initDeclList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt78=0; - _loop78: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NInitDecl)) { - initDecl(_t); - _t = _retTree; - } - else { - if ( _cnt78>=1 ) { break _loop78; } else {throw new NoViableAltException(_t);} - } - - _cnt78++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void expr(AST _t) throws RecognitionException { - - TNode expr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - { - assignExpr(_t); - _t = _retTree; - break; - } - case QUESTION: - { - conditionalExpr(_t); - _t = _retTree; - break; - } - case LOR: - { - logicalOrExpr(_t); - _t = _retTree; - break; - } - case LAND: - { - logicalAndExpr(_t); - _t = _retTree; - break; - } - case BOR: - { - inclusiveOrExpr(_t); - _t = _retTree; - break; - } - case BXOR: - { - exclusiveOrExpr(_t); - _t = _retTree; - break; - } - case BAND: - { - bitAndExpr(_t); - _t = _retTree; - break; - } - case EQUAL: - case NOT_EQUAL: - { - equalityExpr(_t); - _t = _retTree; - break; - } - case LT: - case LTE: - case GT: - case GTE: - { - relationalExpr(_t); - _t = _retTree; - break; - } - case LSHIFT: - case RSHIFT: - { - shiftExpr(_t); - _t = _retTree; - break; - } - case PLUS: - case MINUS: - { - additiveExpr(_t); - _t = _retTree; - break; - } - case STAR: - case DIV: - case MOD: - { - multExpr(_t); - _t = _retTree; - break; - } - case NCast: - { - castExpr(_t); - _t = _retTree; - break; - } - case INC: - case DEC: - case LITERAL_sizeof: - case NUnaryExpr: - case LITERAL___alignof: - { - unaryExpr(_t); - _t = _retTree; - break; - } - case NPostfixExpr: - { - postfixExpr(_t); - _t = _retTree; - break; - } - case ID: - case CharLiteral: - case NExpressionGroup: - case NStringSeq: - case Number: - { - primaryExpr(_t); - _t = _retTree; - break; - } - case NCommaExpr: - { - commaExpr(_t); - _t = _retTree; - break; - } - case NEmptyExpression: - { - emptyExpr(_t); - _t = _retTree; - break; - } - case LPAREN: - { - compoundStatementExpr(_t); - _t = _retTree; - break; - } - case NInitializer: - case NLcurlyInitializer: - { - initializer(_t); - _t = _retTree; - break; - } - case NRangeExpr: - { - rangeExpr(_t); - _t = _retTree; - break; - } - case NGnuAsmExpr: - { - gnuAsmExpr(_t); - _t = _retTree; - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void declSpecifiers(AST _t) throws RecognitionException { - - TNode declSpecifiers_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt21=0; - _loop21: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_typedef: - case LITERAL_auto: - case LITERAL_register: - case LITERAL_extern: - case LITERAL_static: - case LITERAL_inline: - { - storageClassSpecifier(_t); - _t = _retTree; - break; - } - case LITERAL_volatile: - case LITERAL_const: - { - typeQualifier(_t); - _t = _retTree; - break; - } - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - typeSpecifier(_t); - _t = _retTree; - break; - } - default: - { - if ( _cnt21>=1 ) { break _loop21; } else {throw new NoViableAltException(_t);} - } - } - _cnt21++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void storageClassSpecifier(AST _t) throws RecognitionException { - - TNode storageClassSpecifier_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_auto: - { - TNode tmp13_AST_in = (TNode)_t; - match(_t,LITERAL_auto); - _t = _t.getNextSibling(); - break; - } - case LITERAL_register: - { - TNode tmp14_AST_in = (TNode)_t; - match(_t,LITERAL_register); - _t = _t.getNextSibling(); - break; - } - case LITERAL_typedef: - { - TNode tmp15_AST_in = (TNode)_t; - match(_t,LITERAL_typedef); - _t = _t.getNextSibling(); - break; - } - case LITERAL_extern: - case LITERAL_static: - case LITERAL_inline: - { - functionStorageClassSpecifier(_t); - _t = _retTree; - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void typeQualifier(AST _t) throws RecognitionException { - - TNode typeQualifier_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_const: - { - TNode tmp16_AST_in = (TNode)_t; - match(_t,LITERAL_const); - _t = _t.getNextSibling(); - break; - } - case LITERAL_volatile: - { - TNode tmp17_AST_in = (TNode)_t; - match(_t,LITERAL_volatile); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void typeSpecifier(AST _t) throws RecognitionException { - - TNode typeSpecifier_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_void: - { - TNode tmp18_AST_in = (TNode)_t; - match(_t,LITERAL_void); - _t = _t.getNextSibling(); - break; - } - case LITERAL_char: - { - TNode tmp19_AST_in = (TNode)_t; - match(_t,LITERAL_char); - _t = _t.getNextSibling(); - break; - } - case LITERAL_short: - { - TNode tmp20_AST_in = (TNode)_t; - match(_t,LITERAL_short); - _t = _t.getNextSibling(); - break; - } - case LITERAL_int: - { - TNode tmp21_AST_in = (TNode)_t; - match(_t,LITERAL_int); - _t = _t.getNextSibling(); - break; - } - case LITERAL_long: - { - TNode tmp22_AST_in = (TNode)_t; - match(_t,LITERAL_long); - _t = _t.getNextSibling(); - break; - } - case LITERAL_float: - { - TNode tmp23_AST_in = (TNode)_t; - match(_t,LITERAL_float); - _t = _t.getNextSibling(); - break; - } - case LITERAL_double: - { - TNode tmp24_AST_in = (TNode)_t; - match(_t,LITERAL_double); - _t = _t.getNextSibling(); - break; - } - case LITERAL_signed: - { - TNode tmp25_AST_in = (TNode)_t; - match(_t,LITERAL_signed); - _t = _t.getNextSibling(); - break; - } - case LITERAL_unsigned: - { - TNode tmp26_AST_in = (TNode)_t; - match(_t,LITERAL_unsigned); - _t = _t.getNextSibling(); - break; - } - case LITERAL_byte: - { - TNode tmp27_AST_in = (TNode)_t; - match(_t,LITERAL_byte); - _t = _t.getNextSibling(); - break; - } - case LITERAL_boolean: - { - TNode tmp28_AST_in = (TNode)_t; - match(_t,LITERAL_boolean); - _t = _t.getNextSibling(); - break; - } - case LITERAL_Servo: - { - TNode tmp29_AST_in = (TNode)_t; - match(_t,LITERAL_Servo); - _t = _t.getNextSibling(); - break; - } - case LITERAL_Wire: - { - TNode tmp30_AST_in = (TNode)_t; - match(_t,LITERAL_Wire); - _t = _t.getNextSibling(); - break; - } - case LITERAL_struct: - { - structSpecifier(_t); - _t = _retTree; - { - _loop27: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { - attributeDecl(_t); - _t = _retTree; - } - else { - break _loop27; - } - - } while (true); - } - break; - } - case LITERAL_union: - { - unionSpecifier(_t); - _t = _retTree; - { - _loop29: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { - attributeDecl(_t); - _t = _retTree; - } - else { - break _loop29; - } - - } while (true); - } - break; - } - case LITERAL_enum: - { - enumSpecifier(_t); - _t = _retTree; - break; - } - case NTypedefName: - { - typedefName(_t); - _t = _retTree; - break; - } - case LITERAL_typeof: - { - AST __t30 = _t; - TNode tmp31_AST_in = (TNode)_t; - match(_t,LITERAL_typeof); - _t = _t.getFirstChild(); - TNode tmp32_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - typeName(_t); - _t = _retTree; - break; - } - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp33_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - _t = __t30; - _t = _t.getNextSibling(); - break; - } - case LITERAL___complex: - { - TNode tmp34_AST_in = (TNode)_t; - match(_t,LITERAL___complex); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void functionStorageClassSpecifier(AST _t) throws RecognitionException { - - TNode functionStorageClassSpecifier_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_extern: - { - TNode tmp35_AST_in = (TNode)_t; - match(_t,LITERAL_extern); - _t = _t.getNextSibling(); - break; - } - case LITERAL_static: - { - TNode tmp36_AST_in = (TNode)_t; - match(_t,LITERAL_static); - _t = _t.getNextSibling(); - break; - } - case LITERAL_inline: - { - TNode tmp37_AST_in = (TNode)_t; - match(_t,LITERAL_inline); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structSpecifier(AST _t) throws RecognitionException { - - TNode structSpecifier_AST_in = (TNode)_t; - - try { // for error handling - AST __t37 = _t; - TNode tmp38_AST_in = (TNode)_t; - match(_t,LITERAL_struct); - _t = _t.getFirstChild(); - structOrUnionBody(_t); - _t = _retTree; - _t = __t37; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void attributeDecl(AST _t) throws RecognitionException { - - TNode attributeDecl_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL___attribute: - { - AST __t72 = _t; - TNode tmp39_AST_in = (TNode)_t; - match(_t,LITERAL___attribute); - _t = _t.getFirstChild(); - { - _loop74: - do { - if (_t==null) _t=ASTNULL; - if (((_t.getType() >= LITERAL_typedef && _t.getType() <= LITERAL___imag))) { - TNode tmp40_AST_in = (TNode)_t; - if ( _t==null ) throw new MismatchedTokenException(); - _t = _t.getNextSibling(); - } - else { - break _loop74; - } - - } while (true); - } - _t = __t72; - _t = _t.getNextSibling(); - break; - } - case NAsmAttribute: - { - AST __t75 = _t; - TNode tmp41_AST_in = (TNode)_t; - match(_t,NAsmAttribute); - _t = _t.getFirstChild(); - TNode tmp42_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - TNode tmp43_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - _t = __t75; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void unionSpecifier(AST _t) throws RecognitionException { - - TNode unionSpecifier_AST_in = (TNode)_t; - - try { // for error handling - AST __t39 = _t; - TNode tmp44_AST_in = (TNode)_t; - match(_t,LITERAL_union); - _t = _t.getFirstChild(); - structOrUnionBody(_t); - _t = _retTree; - _t = __t39; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void enumSpecifier(AST _t) throws RecognitionException { - - TNode enumSpecifier_AST_in = (TNode)_t; - - try { // for error handling - AST __t63 = _t; - TNode tmp45_AST_in = (TNode)_t; - match(_t,LITERAL_enum); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - { - TNode tmp46_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - break; - } - case 3: - case LCURLY: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LCURLY: - { - TNode tmp47_AST_in = (TNode)_t; - match(_t,LCURLY); - _t = _t.getNextSibling(); - enumList(_t); - _t = _retTree; - TNode tmp48_AST_in = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t63; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void typedefName(AST _t) throws RecognitionException { - - TNode typedefName_AST_in = (TNode)_t; - - try { // for error handling - AST __t35 = _t; - TNode tmp49_AST_in = (TNode)_t; - match(_t,NTypedefName); - _t = _t.getFirstChild(); - TNode tmp50_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - _t = __t35; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void typeName(AST _t) throws RecognitionException { - - TNode typeName_AST_in = (TNode)_t; - - try { // for error handling - specifierQualifierList(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NNonemptyAbstractDeclarator: - { - nonemptyAbstractDeclarator(_t); - _t = _retTree; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structOrUnionBody(AST _t) throws RecognitionException { - - TNode structOrUnionBody_AST_in = (TNode)_t; - - try { // for error handling - { - boolean synPredMatched43 = false; - if (((_t.getType()==ID))) { - AST __t43 = _t; - synPredMatched43 = true; - inputState.guessing++; - try { - { - TNode tmp51_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - TNode tmp52_AST_in = (TNode)_t; - match(_t,LCURLY); - _t = _t.getNextSibling(); - } - } - catch (RecognitionException pe) { - synPredMatched43 = false; - } - _t = __t43; - inputState.guessing--; - } - if ( synPredMatched43 ) { - TNode tmp53_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - TNode tmp54_AST_in = (TNode)_t; - match(_t,LCURLY); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - structDeclarationList(_t); - _t = _retTree; - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp55_AST_in = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - } - else if ((_t.getType()==LCURLY)) { - TNode tmp56_AST_in = (TNode)_t; - match(_t,LCURLY); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_const: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - structDeclarationList(_t); - _t = _retTree; - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp57_AST_in = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - } - else if ((_t.getType()==ID)) { - TNode tmp58_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - } - else { - throw new NoViableAltException(_t); - } - - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structDeclarationList(AST _t) throws RecognitionException { - - TNode structDeclarationList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt48=0; - _loop48: - do { - if (_t==null) _t=ASTNULL; - if ((_tokenSet_1.member(_t.getType()))) { - structDeclaration(_t); - _t = _retTree; - } - else { - if ( _cnt48>=1 ) { break _loop48; } else {throw new NoViableAltException(_t);} - } - - _cnt48++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structDeclaration(AST _t) throws RecognitionException { - - TNode structDeclaration_AST_in = (TNode)_t; - - try { // for error handling - specifierQualifierList(_t); - _t = _retTree; - structDeclaratorList(_t); - _t = _retTree; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void specifierQualifierList(AST _t) throws RecognitionException { - - TNode specifierQualifierList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt52=0; - _loop52: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - typeSpecifier(_t); - _t = _retTree; - break; - } - case LITERAL_volatile: - case LITERAL_const: - { - typeQualifier(_t); - _t = _retTree; - break; - } - default: - { - if ( _cnt52>=1 ) { break _loop52; } else {throw new NoViableAltException(_t);} - } - } - _cnt52++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structDeclaratorList(AST _t) throws RecognitionException { - - TNode structDeclaratorList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt55=0; - _loop55: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NStructDeclarator)) { - structDeclarator(_t); - _t = _retTree; - } - else { - if ( _cnt55>=1 ) { break _loop55; } else {throw new NoViableAltException(_t);} - } - - _cnt55++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void structDeclarator(AST _t) throws RecognitionException { - - TNode structDeclarator_AST_in = (TNode)_t; - - try { // for error handling - AST __t57 = _t; - TNode tmp59_AST_in = (TNode)_t; - match(_t,NStructDeclarator); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NDeclarator: - { - declarator(_t); - _t = _retTree; - break; - } - case 3: - case COLON: - case NAsmAttribute: - case LITERAL___attribute: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case COLON: - { - TNode tmp60_AST_in = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - break; - } - case 3: - case NAsmAttribute: - case LITERAL___attribute: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - _loop61: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { - attributeDecl(_t); - _t = _retTree; - } - else { - break _loop61; - } - - } while (true); - } - _t = __t57; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void declarator(AST _t) throws RecognitionException { - - TNode declarator_AST_in = (TNode)_t; - TNode id = null; - - try { // for error handling - AST __t107 = _t; - TNode tmp61_AST_in = (TNode)_t; - match(_t,NDeclarator); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NPointerGroup: - { - pointerGroup(_t); - _t = _retTree; - break; - } - case ID: - case LPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - { - id = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - break; - } - case LPAREN: - { - TNode tmp62_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - declarator(_t); - _t = _retTree; - TNode tmp63_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - _loop115: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NParameterTypeList: - { - AST __t111 = _t; - TNode tmp64_AST_in = (TNode)_t; - match(_t,NParameterTypeList); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NParameterDeclaration: - { - parameterTypeList(_t); - _t = _retTree; - break; - } - case ID: - case RPAREN: - { - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - { - idList(_t); - _t = _retTree; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp65_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - _t = __t111; - _t = _t.getNextSibling(); - break; - } - case LBRACKET: - { - TNode tmp66_AST_in = (TNode)_t; - match(_t,LBRACKET); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp67_AST_in = (TNode)_t; - match(_t,RBRACKET); - _t = _t.getNextSibling(); - break; - } - default: - { - break _loop115; - } - } - } while (true); - } - _t = __t107; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void enumList(AST _t) throws RecognitionException { - - TNode enumList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt68=0; - _loop68: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==ID)) { - enumerator(_t); - _t = _retTree; - } - else { - if ( _cnt68>=1 ) { break _loop68; } else {throw new NoViableAltException(_t);} - } - - _cnt68++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void enumerator(AST _t) throws RecognitionException { - - TNode enumerator_AST_in = (TNode)_t; - - try { // for error handling - TNode tmp68_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - { - TNode tmp69_AST_in = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - break; - } - case RCURLY: - case ID: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void initDecl(AST _t) throws RecognitionException { - - TNode initDecl_AST_in = (TNode)_t; - String declName = ""; - - try { // for error handling - AST __t80 = _t; - TNode tmp70_AST_in = (TNode)_t; - match(_t,NInitDecl); - _t = _t.getFirstChild(); - declarator(_t); - _t = _retTree; - { - _loop82: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { - attributeDecl(_t); - _t = _retTree; - } - else { - break _loop82; - } - - } while (true); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - { - TNode tmp71_AST_in = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getNextSibling(); - initializer(_t); - _t = _retTree; - break; - } - case COLON: - { - TNode tmp72_AST_in = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t80; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void initializer(AST _t) throws RecognitionException { - - TNode initializer_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NInitializer: - { - AST __t94 = _t; - TNode tmp73_AST_in = (TNode)_t; - match(_t,NInitializer); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NInitializerElementLabel: - { - initializerElementLabel(_t); - _t = _retTree; - break; - } - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - expr(_t); - _t = _retTree; - _t = __t94; - _t = _t.getNextSibling(); - break; - } - case NLcurlyInitializer: - { - lcurlyInitializer(_t); - _t = _retTree; - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void pointerGroup(AST _t) throws RecognitionException { - - TNode pointerGroup_AST_in = (TNode)_t; - - try { // for error handling - AST __t85 = _t; - TNode tmp74_AST_in = (TNode)_t; - match(_t,NPointerGroup); - _t = _t.getFirstChild(); - { - int _cnt89=0; - _loop89: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==STAR)) { - TNode tmp75_AST_in = (TNode)_t; - match(_t,STAR); - _t = _t.getNextSibling(); - { - _loop88: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==LITERAL_volatile||_t.getType()==LITERAL_const)) { - typeQualifier(_t); - _t = _retTree; - } - else { - break _loop88; - } - - } while (true); - } - } - else { - if ( _cnt89>=1 ) { break _loop89; } else {throw new NoViableAltException(_t);} - } - - _cnt89++; - } while (true); - } - _t = __t85; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void idList(AST _t) throws RecognitionException { - - TNode idList_AST_in = (TNode)_t; - - try { // for error handling - TNode tmp76_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - { - _loop92: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COMMA)) { - TNode tmp77_AST_in = (TNode)_t; - match(_t,COMMA); - _t = _t.getNextSibling(); - TNode tmp78_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - } - else { - break _loop92; - } - - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void initializerElementLabel(AST _t) throws RecognitionException { - - TNode initializerElementLabel_AST_in = (TNode)_t; - - try { // for error handling - AST __t97 = _t; - TNode tmp79_AST_in = (TNode)_t; - match(_t,NInitializerElementLabel); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LBRACKET: - { - { - TNode tmp80_AST_in = (TNode)_t; - match(_t,LBRACKET); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - TNode tmp81_AST_in = (TNode)_t; - match(_t,RBRACKET); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - { - TNode tmp82_AST_in = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getNextSibling(); - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - break; - } - case ID: - { - TNode tmp83_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - TNode tmp84_AST_in = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - break; - } - case DOT: - { - TNode tmp85_AST_in = (TNode)_t; - match(_t,DOT); - _t = _t.getNextSibling(); - TNode tmp86_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - TNode tmp87_AST_in = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t97; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void lcurlyInitializer(AST _t) throws RecognitionException { - - TNode lcurlyInitializer_AST_in = (TNode)_t; - - try { // for error handling - AST __t102 = _t; - TNode tmp88_AST_in = (TNode)_t; - match(_t,NLcurlyInitializer); - _t = _t.getFirstChild(); - initializerList(_t); - _t = _retTree; - TNode tmp89_AST_in = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - _t = __t102; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void initializerList(AST _t) throws RecognitionException { - - TNode initializerList_AST_in = (TNode)_t; - - try { // for error handling - { - _loop105: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NInitializer||_t.getType()==NLcurlyInitializer)) { - initializer(_t); - _t = _retTree; - } - else { - break _loop105; - } - - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void parameterTypeList(AST _t) throws RecognitionException { - - TNode parameterTypeList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt119=0; - _loop119: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==NParameterDeclaration)) { - parameterDeclaration(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case COMMA: - { - TNode tmp90_AST_in = (TNode)_t; - match(_t,COMMA); - _t = _t.getNextSibling(); - break; - } - case SEMI: - { - TNode tmp91_AST_in = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - break; - } - case RPAREN: - case VARARGS: - case NParameterDeclaration: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - else { - if ( _cnt119>=1 ) { break _loop119; } else {throw new NoViableAltException(_t);} - } - - _cnt119++; - } while (true); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case VARARGS: - { - TNode tmp92_AST_in = (TNode)_t; - match(_t,VARARGS); - _t = _t.getNextSibling(); - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void parameterDeclaration(AST _t) throws RecognitionException { - - TNode parameterDeclaration_AST_in = (TNode)_t; - - try { // for error handling - AST __t122 = _t; - TNode tmp93_AST_in = (TNode)_t; - match(_t,NParameterDeclaration); - _t = _t.getFirstChild(); - declSpecifiers(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NDeclarator: - { - declarator(_t); - _t = _retTree; - break; - } - case NNonemptyAbstractDeclarator: - { - nonemptyAbstractDeclarator(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t122; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void nonemptyAbstractDeclarator(AST _t) throws RecognitionException { - - TNode nonemptyAbstractDeclarator_AST_in = (TNode)_t; - - try { // for error handling - AST __t237 = _t; - TNode tmp94_AST_in = (TNode)_t; - match(_t,NNonemptyAbstractDeclarator); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NPointerGroup: - { - pointerGroup(_t); - _t = _retTree; - { - _loop244: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LPAREN: - { - { - TNode tmp95_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NNonemptyAbstractDeclarator: - { - nonemptyAbstractDeclarator(_t); - _t = _retTree; - break; - } - case NParameterDeclaration: - { - parameterTypeList(_t); - _t = _retTree; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp96_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - } - break; - } - case LBRACKET: - { - { - TNode tmp97_AST_in = (TNode)_t; - match(_t,LBRACKET); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp98_AST_in = (TNode)_t; - match(_t,RBRACKET); - _t = _t.getNextSibling(); - } - break; - } - default: - { - break _loop244; - } - } - } while (true); - } - break; - } - case LPAREN: - case LBRACKET: - { - { - int _cnt250=0; - _loop250: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LPAREN: - { - { - TNode tmp99_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NNonemptyAbstractDeclarator: - { - nonemptyAbstractDeclarator(_t); - _t = _retTree; - break; - } - case NParameterDeclaration: - { - parameterTypeList(_t); - _t = _retTree; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp100_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - } - break; - } - case LBRACKET: - { - { - TNode tmp101_AST_in = (TNode)_t; - match(_t,LBRACKET); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - case RBRACKET: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp102_AST_in = (TNode)_t; - match(_t,RBRACKET); - _t = _t.getNextSibling(); - } - break; - } - default: - { - if ( _cnt250>=1 ) { break _loop250; } else {throw new NoViableAltException(_t);} - } - } - _cnt250++; - } while (true); - } - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t237; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void functionDeclSpecifiers(AST _t) throws RecognitionException { - - TNode functionDeclSpecifiers_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt131=0; - _loop131: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_extern: - case LITERAL_static: - case LITERAL_inline: - { - functionStorageClassSpecifier(_t); - _t = _retTree; - break; - } - case LITERAL_volatile: - case LITERAL_const: - { - typeQualifier(_t); - _t = _retTree; - break; - } - case LITERAL_struct: - case LITERAL_union: - case LITERAL_enum: - case LITERAL_void: - case LITERAL_char: - case LITERAL_short: - case LITERAL_int: - case LITERAL_long: - case LITERAL_float: - case LITERAL_double: - case LITERAL_signed: - case LITERAL_unsigned: - case NTypedefName: - case LITERAL_byte: - case LITERAL_boolean: - case LITERAL_Servo: - case LITERAL_Wire: - case LITERAL_typeof: - case LITERAL___complex: - { - typeSpecifier(_t); - _t = _retTree; - break; - } - default: - { - if ( _cnt131>=1 ) { break _loop131; } else {throw new NoViableAltException(_t);} - } - } - _cnt131++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void compoundStatement(AST _t) throws RecognitionException { - - TNode compoundStatement_AST_in = (TNode)_t; - - try { // for error handling - AST __t140 = _t; - TNode tmp103_AST_in = (TNode)_t; - match(_t,NCompoundStatement); - _t = _t.getFirstChild(); - { - _loop142: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NDeclaration: - case LITERAL___label__: - { - declarationList(_t); - _t = _retTree; - break; - } - case NFunctionDef: - { - functionDef(_t); - _t = _retTree; - break; - } - default: - { - break _loop142; - } - } - } while (true); - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case SEMI: - case LITERAL_while: - case LITERAL_do: - case LITERAL_for: - case LITERAL_goto: - case LITERAL_continue: - case LITERAL_break: - case LITERAL_return: - case LITERAL_case: - case LITERAL_default: - case LITERAL_if: - case LITERAL_switch: - case NStatementExpr: - case NCompoundStatement: - case NLabel: - { - statementList(_t); - _t = _retTree; - break; - } - case RCURLY: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp104_AST_in = (TNode)_t; - match(_t,RCURLY); - _t = _t.getNextSibling(); - _t = __t140; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void declarationList(AST _t) throws RecognitionException { - - TNode declarationList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt134=0; - _loop134: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==LITERAL___label__)) { - localLabelDecl(_t); - _t = _retTree; - } - else if ((_t.getType()==NDeclaration)) { - declaration(_t); - _t = _retTree; - } - else { - if ( _cnt134>=1 ) { break _loop134; } else {throw new NoViableAltException(_t);} - } - - _cnt134++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void localLabelDecl(AST _t) throws RecognitionException { - - TNode localLabelDecl_AST_in = (TNode)_t; - - try { // for error handling - AST __t136 = _t; - TNode tmp105_AST_in = (TNode)_t; - match(_t,LITERAL___label__); - _t = _t.getFirstChild(); - { - int _cnt138=0; - _loop138: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==ID)) { - TNode tmp106_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - } - else { - if ( _cnt138>=1 ) { break _loop138; } else {throw new NoViableAltException(_t);} - } - - _cnt138++; - } while (true); - } - _t = __t136; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void statementList(AST _t) throws RecognitionException { - - TNode statementList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt146=0; - _loop146: - do { - if (_t==null) _t=ASTNULL; - if ((_tokenSet_2.member(_t.getType()))) { - statement(_t); - _t = _retTree; - } - else { - if ( _cnt146>=1 ) { break _loop146; } else {throw new NoViableAltException(_t);} - } - - _cnt146++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void statement(AST _t) throws RecognitionException { - - TNode statement_AST_in = (TNode)_t; - - try { // for error handling - statementBody(_t); - _t = _retTree; - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void statementBody(AST _t) throws RecognitionException { - - TNode statementBody_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case SEMI: - { - TNode tmp107_AST_in = (TNode)_t; - match(_t,SEMI); - _t = _t.getNextSibling(); - break; - } - case NCompoundStatement: - { - compoundStatement(_t); - _t = _retTree; - break; - } - case NStatementExpr: - { - AST __t149 = _t; - TNode tmp108_AST_in = (TNode)_t; - match(_t,NStatementExpr); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - _t = __t149; - _t = _t.getNextSibling(); - break; - } - case LITERAL_while: - { - AST __t150 = _t; - TNode tmp109_AST_in = (TNode)_t; - match(_t,LITERAL_while); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - statement(_t); - _t = _retTree; - _t = __t150; - _t = _t.getNextSibling(); - break; - } - case LITERAL_do: - { - AST __t151 = _t; - TNode tmp110_AST_in = (TNode)_t; - match(_t,LITERAL_do); - _t = _t.getFirstChild(); - statement(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t151; - _t = _t.getNextSibling(); - break; - } - case LITERAL_for: - { - AST __t152 = _t; - TNode tmp111_AST_in = (TNode)_t; - match(_t,LITERAL_for); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - statement(_t); - _t = _retTree; - _t = __t152; - _t = _t.getNextSibling(); - break; - } - case LITERAL_goto: - { - AST __t153 = _t; - TNode tmp112_AST_in = (TNode)_t; - match(_t,LITERAL_goto); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - _t = __t153; - _t = _t.getNextSibling(); - break; - } - case LITERAL_continue: - { - TNode tmp113_AST_in = (TNode)_t; - match(_t,LITERAL_continue); - _t = _t.getNextSibling(); - break; - } - case LITERAL_break: - { - TNode tmp114_AST_in = (TNode)_t; - match(_t,LITERAL_break); - _t = _t.getNextSibling(); - break; - } - case LITERAL_return: - { - AST __t154 = _t; - TNode tmp115_AST_in = (TNode)_t; - match(_t,LITERAL_return); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t154; - _t = _t.getNextSibling(); - break; - } - case NLabel: - { - AST __t156 = _t; - TNode tmp116_AST_in = (TNode)_t; - match(_t,NLabel); - _t = _t.getFirstChild(); - TNode tmp117_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case SEMI: - case LITERAL_while: - case LITERAL_do: - case LITERAL_for: - case LITERAL_goto: - case LITERAL_continue: - case LITERAL_break: - case LITERAL_return: - case LITERAL_case: - case LITERAL_default: - case LITERAL_if: - case LITERAL_switch: - case NStatementExpr: - case NCompoundStatement: - case NLabel: - { - statement(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t156; - _t = _t.getNextSibling(); - break; - } - case LITERAL_case: - { - AST __t158 = _t; - TNode tmp118_AST_in = (TNode)_t; - match(_t,LITERAL_case); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case SEMI: - case LITERAL_while: - case LITERAL_do: - case LITERAL_for: - case LITERAL_goto: - case LITERAL_continue: - case LITERAL_break: - case LITERAL_return: - case LITERAL_case: - case LITERAL_default: - case LITERAL_if: - case LITERAL_switch: - case NStatementExpr: - case NCompoundStatement: - case NLabel: - { - statement(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t158; - _t = _t.getNextSibling(); - break; - } - case LITERAL_default: - { - AST __t160 = _t; - TNode tmp119_AST_in = (TNode)_t; - match(_t,LITERAL_default); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case SEMI: - case LITERAL_while: - case LITERAL_do: - case LITERAL_for: - case LITERAL_goto: - case LITERAL_continue: - case LITERAL_break: - case LITERAL_return: - case LITERAL_case: - case LITERAL_default: - case LITERAL_if: - case LITERAL_switch: - case NStatementExpr: - case NCompoundStatement: - case NLabel: - { - statement(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t160; - _t = _t.getNextSibling(); - break; - } - case LITERAL_if: - { - AST __t162 = _t; - TNode tmp120_AST_in = (TNode)_t; - match(_t,LITERAL_if); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - statement(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_else: - { - TNode tmp121_AST_in = (TNode)_t; - match(_t,LITERAL_else); - _t = _t.getNextSibling(); - statement(_t); - _t = _retTree; - break; - } - case 3: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - _t = __t162; - _t = _t.getNextSibling(); - break; - } - case LITERAL_switch: - { - AST __t164 = _t; - TNode tmp122_AST_in = (TNode)_t; - match(_t,LITERAL_switch); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - statement(_t); - _t = _retTree; - _t = __t164; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void assignExpr(AST _t) throws RecognitionException { - - TNode assignExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ASSIGN: - { - AST __t190 = _t; - TNode tmp123_AST_in = (TNode)_t; - match(_t,ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t190; - _t = _t.getNextSibling(); - break; - } - case DIV_ASSIGN: - { - AST __t191 = _t; - TNode tmp124_AST_in = (TNode)_t; - match(_t,DIV_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t191; - _t = _t.getNextSibling(); - break; - } - case PLUS_ASSIGN: - { - AST __t192 = _t; - TNode tmp125_AST_in = (TNode)_t; - match(_t,PLUS_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t192; - _t = _t.getNextSibling(); - break; - } - case MINUS_ASSIGN: - { - AST __t193 = _t; - TNode tmp126_AST_in = (TNode)_t; - match(_t,MINUS_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t193; - _t = _t.getNextSibling(); - break; - } - case STAR_ASSIGN: - { - AST __t194 = _t; - TNode tmp127_AST_in = (TNode)_t; - match(_t,STAR_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t194; - _t = _t.getNextSibling(); - break; - } - case MOD_ASSIGN: - { - AST __t195 = _t; - TNode tmp128_AST_in = (TNode)_t; - match(_t,MOD_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t195; - _t = _t.getNextSibling(); - break; - } - case RSHIFT_ASSIGN: - { - AST __t196 = _t; - TNode tmp129_AST_in = (TNode)_t; - match(_t,RSHIFT_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t196; - _t = _t.getNextSibling(); - break; - } - case LSHIFT_ASSIGN: - { - AST __t197 = _t; - TNode tmp130_AST_in = (TNode)_t; - match(_t,LSHIFT_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t197; - _t = _t.getNextSibling(); - break; - } - case BAND_ASSIGN: - { - AST __t198 = _t; - TNode tmp131_AST_in = (TNode)_t; - match(_t,BAND_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t198; - _t = _t.getNextSibling(); - break; - } - case BOR_ASSIGN: - { - AST __t199 = _t; - TNode tmp132_AST_in = (TNode)_t; - match(_t,BOR_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t199; - _t = _t.getNextSibling(); - break; - } - case BXOR_ASSIGN: - { - AST __t200 = _t; - TNode tmp133_AST_in = (TNode)_t; - match(_t,BXOR_ASSIGN); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t200; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void conditionalExpr(AST _t) throws RecognitionException { - - TNode conditionalExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t202 = _t; - TNode tmp134_AST_in = (TNode)_t; - match(_t,QUESTION); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - expr(_t); - _t = _retTree; - break; - } - case COLON: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp135_AST_in = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - _t = __t202; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void logicalOrExpr(AST _t) throws RecognitionException { - - TNode logicalOrExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t205 = _t; - TNode tmp136_AST_in = (TNode)_t; - match(_t,LOR); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t205; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void logicalAndExpr(AST _t) throws RecognitionException { - - TNode logicalAndExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t207 = _t; - TNode tmp137_AST_in = (TNode)_t; - match(_t,LAND); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t207; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void inclusiveOrExpr(AST _t) throws RecognitionException { - - TNode inclusiveOrExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t209 = _t; - TNode tmp138_AST_in = (TNode)_t; - match(_t,BOR); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t209; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void exclusiveOrExpr(AST _t) throws RecognitionException { - - TNode exclusiveOrExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t211 = _t; - TNode tmp139_AST_in = (TNode)_t; - match(_t,BXOR); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t211; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void bitAndExpr(AST _t) throws RecognitionException { - - TNode bitAndExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t213 = _t; - TNode tmp140_AST_in = (TNode)_t; - match(_t,BAND); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t213; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void equalityExpr(AST _t) throws RecognitionException { - - TNode equalityExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case EQUAL: - { - AST __t215 = _t; - TNode tmp141_AST_in = (TNode)_t; - match(_t,EQUAL); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t215; - _t = _t.getNextSibling(); - break; - } - case NOT_EQUAL: - { - AST __t216 = _t; - TNode tmp142_AST_in = (TNode)_t; - match(_t,NOT_EQUAL); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t216; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void relationalExpr(AST _t) throws RecognitionException { - - TNode relationalExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LT: - { - AST __t218 = _t; - TNode tmp143_AST_in = (TNode)_t; - match(_t,LT); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t218; - _t = _t.getNextSibling(); - break; - } - case LTE: - { - AST __t219 = _t; - TNode tmp144_AST_in = (TNode)_t; - match(_t,LTE); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t219; - _t = _t.getNextSibling(); - break; - } - case GT: - { - AST __t220 = _t; - TNode tmp145_AST_in = (TNode)_t; - match(_t,GT); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t220; - _t = _t.getNextSibling(); - break; - } - case GTE: - { - AST __t221 = _t; - TNode tmp146_AST_in = (TNode)_t; - match(_t,GTE); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t221; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void shiftExpr(AST _t) throws RecognitionException { - - TNode shiftExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LSHIFT: - { - AST __t223 = _t; - TNode tmp147_AST_in = (TNode)_t; - match(_t,LSHIFT); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t223; - _t = _t.getNextSibling(); - break; - } - case RSHIFT: - { - AST __t224 = _t; - TNode tmp148_AST_in = (TNode)_t; - match(_t,RSHIFT); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t224; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void additiveExpr(AST _t) throws RecognitionException { - - TNode additiveExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case PLUS: - { - AST __t226 = _t; - TNode tmp149_AST_in = (TNode)_t; - match(_t,PLUS); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t226; - _t = _t.getNextSibling(); - break; - } - case MINUS: - { - AST __t227 = _t; - TNode tmp150_AST_in = (TNode)_t; - match(_t,MINUS); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t227; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void multExpr(AST _t) throws RecognitionException { - - TNode multExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case STAR: - { - AST __t229 = _t; - TNode tmp151_AST_in = (TNode)_t; - match(_t,STAR); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t229; - _t = _t.getNextSibling(); - break; - } - case DIV: - { - AST __t230 = _t; - TNode tmp152_AST_in = (TNode)_t; - match(_t,DIV); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t230; - _t = _t.getNextSibling(); - break; - } - case MOD: - { - AST __t231 = _t; - TNode tmp153_AST_in = (TNode)_t; - match(_t,MOD); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t231; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void castExpr(AST _t) throws RecognitionException { - - TNode castExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t233 = _t; - TNode tmp154_AST_in = (TNode)_t; - match(_t,NCast); - _t = _t.getFirstChild(); - typeName(_t); - _t = _retTree; - TNode tmp155_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - _t = __t233; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void unaryExpr(AST _t) throws RecognitionException { - - TNode unaryExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case INC: - { - AST __t252 = _t; - TNode tmp156_AST_in = (TNode)_t; - match(_t,INC); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - _t = __t252; - _t = _t.getNextSibling(); - break; - } - case DEC: - { - AST __t253 = _t; - TNode tmp157_AST_in = (TNode)_t; - match(_t,DEC); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - _t = __t253; - _t = _t.getNextSibling(); - break; - } - case NUnaryExpr: - { - AST __t254 = _t; - TNode tmp158_AST_in = (TNode)_t; - match(_t,NUnaryExpr); - _t = _t.getFirstChild(); - unaryOperator(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t254; - _t = _t.getNextSibling(); - break; - } - case LITERAL_sizeof: - { - AST __t255 = _t; - TNode tmp159_AST_in = (TNode)_t; - match(_t,LITERAL_sizeof); - _t = _t.getFirstChild(); - { - boolean synPredMatched258 = false; - if (((_t.getType()==LPAREN))) { - AST __t258 = _t; - synPredMatched258 = true; - inputState.guessing++; - try { - { - TNode tmp160_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - typeName(_t); - _t = _retTree; - } - } - catch (RecognitionException pe) { - synPredMatched258 = false; - } - _t = __t258; - inputState.guessing--; - } - if ( synPredMatched258 ) { - TNode tmp161_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - typeName(_t); - _t = _retTree; - TNode tmp162_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - } - else if ((_tokenSet_3.member(_t.getType()))) { - expr(_t); - _t = _retTree; - } - else { - throw new NoViableAltException(_t); - } - - } - _t = __t255; - _t = _t.getNextSibling(); - break; - } - case LITERAL___alignof: - { - AST __t259 = _t; - TNode tmp163_AST_in = (TNode)_t; - match(_t,LITERAL___alignof); - _t = _t.getFirstChild(); - { - boolean synPredMatched262 = false; - if (((_t.getType()==LPAREN))) { - AST __t262 = _t; - synPredMatched262 = true; - inputState.guessing++; - try { - { - TNode tmp164_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - typeName(_t); - _t = _retTree; - } - } - catch (RecognitionException pe) { - synPredMatched262 = false; - } - _t = __t262; - inputState.guessing--; - } - if ( synPredMatched262 ) { - TNode tmp165_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - typeName(_t); - _t = _retTree; - TNode tmp166_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - } - else if ((_tokenSet_3.member(_t.getType()))) { - expr(_t); - _t = _retTree; - } - else { - throw new NoViableAltException(_t); - } - - } - _t = __t259; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void postfixExpr(AST _t) throws RecognitionException { - - TNode postfixExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t265 = _t; - TNode tmp167_AST_in = (TNode)_t; - match(_t,NPostfixExpr); - _t = _t.getFirstChild(); - primaryExpr(_t); - _t = _retTree; - { - int _cnt269=0; - _loop269: - do { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case PTR: - { - TNode tmp168_AST_in = (TNode)_t; - match(_t,PTR); - _t = _t.getNextSibling(); - TNode tmp169_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - break; - } - case DOT: - { - TNode tmp170_AST_in = (TNode)_t; - match(_t,DOT); - _t = _t.getNextSibling(); - TNode tmp171_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - break; - } - case NFunctionCallArgs: - { - AST __t267 = _t; - TNode tmp172_AST_in = (TNode)_t; - match(_t,NFunctionCallArgs); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - case ASSIGN: - case STAR: - case LPAREN: - case DIV_ASSIGN: - case PLUS_ASSIGN: - case MINUS_ASSIGN: - case STAR_ASSIGN: - case MOD_ASSIGN: - case RSHIFT_ASSIGN: - case LSHIFT_ASSIGN: - case BAND_ASSIGN: - case BOR_ASSIGN: - case BXOR_ASSIGN: - case QUESTION: - case LOR: - case LAND: - case BOR: - case BXOR: - case BAND: - case EQUAL: - case NOT_EQUAL: - case LT: - case LTE: - case GT: - case GTE: - case LSHIFT: - case RSHIFT: - case PLUS: - case MINUS: - case DIV: - case MOD: - case INC: - case DEC: - case LITERAL_sizeof: - case CharLiteral: - case NCast: - case NExpressionGroup: - case NInitializer: - case NEmptyExpression: - case NCommaExpr: - case NUnaryExpr: - case NPostfixExpr: - case NRangeExpr: - case NStringSeq: - case NLcurlyInitializer: - case NGnuAsmExpr: - case Number: - case LITERAL___alignof: - { - argExprList(_t); - _t = _retTree; - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp173_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - _t = __t267; - _t = _t.getNextSibling(); - break; - } - case LBRACKET: - { - TNode tmp174_AST_in = (TNode)_t; - match(_t,LBRACKET); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - TNode tmp175_AST_in = (TNode)_t; - match(_t,RBRACKET); - _t = _t.getNextSibling(); - break; - } - case INC: - { - TNode tmp176_AST_in = (TNode)_t; - match(_t,INC); - _t = _t.getNextSibling(); - break; - } - case DEC: - { - TNode tmp177_AST_in = (TNode)_t; - match(_t,DEC); - _t = _t.getNextSibling(); - break; - } - default: - { - if ( _cnt269>=1 ) { break _loop269; } else {throw new NoViableAltException(_t);} - } - } - _cnt269++; - } while (true); - } - _t = __t265; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void primaryExpr(AST _t) throws RecognitionException { - - TNode primaryExpr_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case ID: - { - TNode tmp178_AST_in = (TNode)_t; - match(_t,ID); - _t = _t.getNextSibling(); - break; - } - case Number: - { - TNode tmp179_AST_in = (TNode)_t; - match(_t,Number); - _t = _t.getNextSibling(); - break; - } - case CharLiteral: - { - charConst(_t); - _t = _retTree; - break; - } - case NStringSeq: - { - stringConst(_t); - _t = _retTree; - break; - } - case NExpressionGroup: - { - AST __t271 = _t; - TNode tmp180_AST_in = (TNode)_t; - match(_t,NExpressionGroup); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - _t = __t271; - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void commaExpr(AST _t) throws RecognitionException { - - TNode commaExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t167 = _t; - TNode tmp181_AST_in = (TNode)_t; - match(_t,NCommaExpr); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - expr(_t); - _t = _retTree; - _t = __t167; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void emptyExpr(AST _t) throws RecognitionException { - - TNode emptyExpr_AST_in = (TNode)_t; - - try { // for error handling - TNode tmp182_AST_in = (TNode)_t; - match(_t,NEmptyExpression); - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void compoundStatementExpr(AST _t) throws RecognitionException { - - TNode compoundStatementExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t170 = _t; - TNode tmp183_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getFirstChild(); - compoundStatement(_t); - _t = _retTree; - TNode tmp184_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - _t = __t170; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void rangeExpr(AST _t) throws RecognitionException { - - TNode rangeExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t172 = _t; - TNode tmp185_AST_in = (TNode)_t; - match(_t,NRangeExpr); - _t = _t.getFirstChild(); - expr(_t); - _t = _retTree; - TNode tmp186_AST_in = (TNode)_t; - match(_t,VARARGS); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - _t = __t172; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void gnuAsmExpr(AST _t) throws RecognitionException { - - TNode gnuAsmExpr_AST_in = (TNode)_t; - - try { // for error handling - AST __t174 = _t; - TNode tmp187_AST_in = (TNode)_t; - match(_t,NGnuAsmExpr); - _t = _t.getFirstChild(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LITERAL_volatile: - { - TNode tmp188_AST_in = (TNode)_t; - match(_t,LITERAL_volatile); - _t = _t.getNextSibling(); - break; - } - case LPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp189_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - stringConst(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COLON)) { - TNode tmp190_AST_in = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NStringSeq: - { - strOptExprPair(_t); - _t = _retTree; - { - _loop179: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COMMA)) { - TNode tmp191_AST_in = (TNode)_t; - match(_t,COMMA); - _t = _t.getNextSibling(); - strOptExprPair(_t); - _t = _retTree; - } - else { - break _loop179; - } - - } while (true); - } - break; - } - case COLON: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COLON)) { - TNode tmp192_AST_in = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case NStringSeq: - { - strOptExprPair(_t); - _t = _retTree; - { - _loop183: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COMMA)) { - TNode tmp193_AST_in = (TNode)_t; - match(_t,COMMA); - _t = _t.getNextSibling(); - strOptExprPair(_t); - _t = _retTree; - } - else { - break _loop183; - } - - } while (true); - } - break; - } - case COLON: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - else if ((_t.getType()==COLON||_t.getType()==RPAREN)) { - } - else { - throw new NoViableAltException(_t); - } - - } - } - else if ((_t.getType()==COLON||_t.getType()==RPAREN)) { - } - else { - throw new NoViableAltException(_t); - } - - } - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case COLON: - { - TNode tmp194_AST_in = (TNode)_t; - match(_t,COLON); - _t = _t.getNextSibling(); - stringConst(_t); - _t = _retTree; - { - _loop186: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==COMMA)) { - TNode tmp195_AST_in = (TNode)_t; - match(_t,COMMA); - _t = _t.getNextSibling(); - stringConst(_t); - _t = _retTree; - } - else { - break _loop186; - } - - } while (true); - } - break; - } - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - TNode tmp196_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - _t = __t174; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - protected final void stringConst(AST _t) throws RecognitionException { - - TNode stringConst_AST_in = (TNode)_t; - - try { // for error handling - AST __t277 = _t; - TNode tmp197_AST_in = (TNode)_t; - match(_t,NStringSeq); - _t = _t.getFirstChild(); - { - int _cnt279=0; - _loop279: - do { - if (_t==null) _t=ASTNULL; - if ((_t.getType()==StringLiteral)) { - TNode tmp198_AST_in = (TNode)_t; - match(_t,StringLiteral); - _t = _t.getNextSibling(); - } - else { - if ( _cnt279>=1 ) { break _loop279; } else {throw new NoViableAltException(_t);} - } - - _cnt279++; - } while (true); - } - _t = __t277; - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void strOptExprPair(AST _t) throws RecognitionException { - - TNode strOptExprPair_AST_in = (TNode)_t; - - try { // for error handling - stringConst(_t); - _t = _retTree; - { - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case LPAREN: - { - TNode tmp199_AST_in = (TNode)_t; - match(_t,LPAREN); - _t = _t.getNextSibling(); - expr(_t); - _t = _retTree; - TNode tmp200_AST_in = (TNode)_t; - match(_t,RPAREN); - _t = _t.getNextSibling(); - break; - } - case COMMA: - case COLON: - case RPAREN: - { - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void unaryOperator(AST _t) throws RecognitionException { - - TNode unaryOperator_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case BAND: - { - TNode tmp201_AST_in = (TNode)_t; - match(_t,BAND); - _t = _t.getNextSibling(); - break; - } - case STAR: - { - TNode tmp202_AST_in = (TNode)_t; - match(_t,STAR); - _t = _t.getNextSibling(); - break; - } - case PLUS: - { - TNode tmp203_AST_in = (TNode)_t; - match(_t,PLUS); - _t = _t.getNextSibling(); - break; - } - case MINUS: - { - TNode tmp204_AST_in = (TNode)_t; - match(_t,MINUS); - _t = _t.getNextSibling(); - break; - } - case BNOT: - { - TNode tmp205_AST_in = (TNode)_t; - match(_t,BNOT); - _t = _t.getNextSibling(); - break; - } - case LNOT: - { - TNode tmp206_AST_in = (TNode)_t; - match(_t,LNOT); - _t = _t.getNextSibling(); - break; - } - case LAND: - { - TNode tmp207_AST_in = (TNode)_t; - match(_t,LAND); - _t = _t.getNextSibling(); - break; - } - case LITERAL___real: - { - TNode tmp208_AST_in = (TNode)_t; - match(_t,LITERAL___real); - _t = _t.getNextSibling(); - break; - } - case LITERAL___imag: - { - TNode tmp209_AST_in = (TNode)_t; - match(_t,LITERAL___imag); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - public final void argExprList(AST _t) throws RecognitionException { - - TNode argExprList_AST_in = (TNode)_t; - - try { // for error handling - { - int _cnt274=0; - _loop274: - do { - if (_t==null) _t=ASTNULL; - if ((_tokenSet_3.member(_t.getType()))) { - expr(_t); - _t = _retTree; - } - else { - if ( _cnt274>=1 ) { break _loop274; } else {throw new NoViableAltException(_t);} - } - - _cnt274++; - } while (true); - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - protected final void charConst(AST _t) throws RecognitionException { - - TNode charConst_AST_in = (TNode)_t; - - try { // for error handling - TNode tmp210_AST_in = (TNode)_t; - match(_t,CharLiteral); - _t = _t.getNextSibling(); - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - protected final void intConst(AST _t) throws RecognitionException { - - TNode intConst_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case IntOctalConst: - { - TNode tmp211_AST_in = (TNode)_t; - match(_t,IntOctalConst); - _t = _t.getNextSibling(); - break; - } - case LongOctalConst: - { - TNode tmp212_AST_in = (TNode)_t; - match(_t,LongOctalConst); - _t = _t.getNextSibling(); - break; - } - case UnsignedOctalConst: - { - TNode tmp213_AST_in = (TNode)_t; - match(_t,UnsignedOctalConst); - _t = _t.getNextSibling(); - break; - } - case IntIntConst: - { - TNode tmp214_AST_in = (TNode)_t; - match(_t,IntIntConst); - _t = _t.getNextSibling(); - break; - } - case LongIntConst: - { - TNode tmp215_AST_in = (TNode)_t; - match(_t,LongIntConst); - _t = _t.getNextSibling(); - break; - } - case UnsignedIntConst: - { - TNode tmp216_AST_in = (TNode)_t; - match(_t,UnsignedIntConst); - _t = _t.getNextSibling(); - break; - } - case IntHexConst: - { - TNode tmp217_AST_in = (TNode)_t; - match(_t,IntHexConst); - _t = _t.getNextSibling(); - break; - } - case LongHexConst: - { - TNode tmp218_AST_in = (TNode)_t; - match(_t,LongHexConst); - _t = _t.getNextSibling(); - break; - } - case UnsignedHexConst: - { - TNode tmp219_AST_in = (TNode)_t; - match(_t,UnsignedHexConst); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - protected final void floatConst(AST _t) throws RecognitionException { - - TNode floatConst_AST_in = (TNode)_t; - - try { // for error handling - if (_t==null) _t=ASTNULL; - switch ( _t.getType()) { - case FloatDoubleConst: - { - TNode tmp220_AST_in = (TNode)_t; - match(_t,FloatDoubleConst); - _t = _t.getNextSibling(); - break; - } - case DoubleDoubleConst: - { - TNode tmp221_AST_in = (TNode)_t; - match(_t,DoubleDoubleConst); - _t = _t.getNextSibling(); - break; - } - case LongDoubleConst: - { - TNode tmp222_AST_in = (TNode)_t; - match(_t,LongDoubleConst); - _t = _t.getNextSibling(); - break; - } - default: - { - throw new NoViableAltException(_t); - } - } - } - catch (RecognitionException ex) { - if (inputState.guessing==0) { - reportError(ex); - if (_t!=null) {_t = _t.getNextSibling();} - } else { - throw ex; - } - } - _retTree = _t; - } - - - public static final String[] _tokenNames = { - "<0>", - "EOF", - "<2>", - "NULL_TREE_LOOKAHEAD", - "\"typedef\"", - "\"asm\"", - "\"volatile\"", - "LCURLY", - "RCURLY", - "SEMI", - "\"struct\"", - "\"union\"", - "\"enum\"", - "\"auto\"", - "\"register\"", - "\"extern\"", - "\"static\"", - "\"const\"", - "\"void\"", - "\"char\"", - "\"short\"", - "\"int\"", - "\"long\"", - "\"float\"", - "\"double\"", - "\"signed\"", - "\"unsigned\"", - "ID", - "COMMA", - "COLON", - "ASSIGN", - "STAR", - "LPAREN", - "RPAREN", - "LBRACKET", - "RBRACKET", - "VARARGS", - "\"while\"", - "\"do\"", - "\"for\"", - "\"goto\"", - "\"continue\"", - "\"break\"", - "\"return\"", - "\"case\"", - "\"default\"", - "\"if\"", - "\"else\"", - "\"switch\"", - "DIV_ASSIGN", - "PLUS_ASSIGN", - "MINUS_ASSIGN", - "STAR_ASSIGN", - "MOD_ASSIGN", - "RSHIFT_ASSIGN", - "LSHIFT_ASSIGN", - "BAND_ASSIGN", - "BOR_ASSIGN", - "BXOR_ASSIGN", - "QUESTION", - "LOR", - "LAND", - "BOR", - "BXOR", - "BAND", - "EQUAL", - "NOT_EQUAL", - "LT", - "LTE", - "GT", - "GTE", - "LSHIFT", - "RSHIFT", - "PLUS", - "MINUS", - "DIV", - "MOD", - "INC", - "DEC", - "\"sizeof\"", - "BNOT", - "LNOT", - "PTR", - "DOT", - "CharLiteral", - "StringLiteral", - "IntOctalConst", - "LongOctalConst", - "UnsignedOctalConst", - "IntIntConst", - "LongIntConst", - "UnsignedIntConst", - "IntHexConst", - "LongHexConst", - "UnsignedHexConst", - "FloatDoubleConst", - "DoubleDoubleConst", - "LongDoubleConst", - "NTypedefName", - "NInitDecl", - "NDeclarator", - "NStructDeclarator", - "NDeclaration", - "NCast", - "NPointerGroup", - "NExpressionGroup", - "NFunctionCallArgs", - "NNonemptyAbstractDeclarator", - "NInitializer", - "NStatementExpr", - "NEmptyExpression", - "NParameterTypeList", - "NFunctionDef", - "NCompoundStatement", - "NParameterDeclaration", - "NCommaExpr", - "NUnaryExpr", - "NLabel", - "NPostfixExpr", - "NRangeExpr", - "NStringSeq", - "NInitializerElementLabel", - "NLcurlyInitializer", - "NAsmAttribute", - "NGnuAsmExpr", - "NTypeMissing", - "Vocabulary", - "Whitespace", - "Comment", - "CPPComment", - "a line directive", - "Space", - "LineDirective", - "BadStringLiteral", - "Escape", - "Digit", - "LongSuffix", - "UnsignedSuffix", - "FloatSuffix", - "Exponent", - "Number", - "\"__label__\"", - "\"inline\"", - "\"byte\"", - "\"boolean\"", - "\"Servo\"", - "\"Wire\"", - "\"typeof\"", - "\"__complex\"", - "\"__attribute\"", - "\"__alignof\"", - "\"__real\"", - "\"__imag\"" - }; - - private static final long[] mk_tokenSet_0() { - long[] data = { 544L, 2306124759068311552L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); - private static final long[] mk_tokenSet_1() { - long[] data = { 134093888L, 17179869184L, 2064384L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); - private static final long[] mk_tokenSet_2() { - long[] data = { 422075026113024L, 9605333580251136L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); - private static final long[] mk_tokenSet_3() { - long[] data = { -562942303010816L, 1574098779476393983L, 4198400L, 0L, 0L, 0L}; - return data; - } - public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); - } - +public WTreeParser() { + tokenNames = _tokenNames; +} + + public final void translationUnit(AST _t) throws RecognitionException { + + TNode translationUnit_AST_in = (TNode)_t; + + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_asm: + case SEMI: + case NDeclaration: + case NFunctionDef: + case NTypeMissing: + { + externalList(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _retTree = _t; + } + + public final void externalList(AST _t) throws RecognitionException { + + TNode externalList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt5=0; + _loop5: + do { + if (_t==null) _t=ASTNULL; + if ((_tokenSet_0.member(_t.getType()))) { + externalDef(_t); + _t = _retTree; + } + else { + if ( _cnt5>=1 ) { break _loop5; } else {throw new NoViableAltException(_t);} + } + + _cnt5++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void externalDef(AST _t) throws RecognitionException { + + TNode externalDef_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NDeclaration: + { + declaration(_t); + _t = _retTree; + break; + } + case NFunctionDef: + { + functionDef(_t); + _t = _retTree; + break; + } + case LITERAL_asm: + { + asm_expr(_t); + _t = _retTree; + break; + } + case SEMI: + { + TNode tmp1_AST_in = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + break; + } + case NTypeMissing: + { + typelessDeclaration(_t); + _t = _retTree; + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void declaration(AST _t) throws RecognitionException { + + TNode declaration_AST_in = (TNode)_t; + + try { // for error handling + AST __t15 = _t; + TNode tmp2_AST_in = (TNode)_t; + match(_t,NDeclaration); + _t = _t.getFirstChild(); + declSpecifiers(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NInitDecl: + { + initDeclList(_t); + _t = _retTree; + break; + } + case SEMI: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + int _cnt18=0; + _loop18: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==SEMI)) { + TNode tmp3_AST_in = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + } + else { + if ( _cnt18>=1 ) { break _loop18; } else {throw new NoViableAltException(_t);} + } + + _cnt18++; + } while (true); + } + _t = __t15; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void functionDef(AST _t) throws RecognitionException { + + TNode functionDef_AST_in = (TNode)_t; + + try { // for error handling + AST __t125 = _t; + TNode tmp4_AST_in = (TNode)_t; + match(_t,NFunctionDef); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_inline: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + functionDeclSpecifiers(_t); + _t = _retTree; + break; + } + case NDeclarator: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + declarator(_t); + _t = _retTree; + { + _loop128: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NDeclaration: + { + declaration(_t); + _t = _retTree; + break; + } + case VARARGS: + { + TNode tmp5_AST_in = (TNode)_t; + match(_t,VARARGS); + _t = _t.getNextSibling(); + break; + } + default: + { + break _loop128; + } + } + } while (true); + } + compoundStatement(_t); + _t = _retTree; + _t = __t125; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void asm_expr(AST _t) throws RecognitionException { + + TNode asm_expr_AST_in = (TNode)_t; + + try { // for error handling + AST __t10 = _t; + TNode tmp6_AST_in = (TNode)_t; + match(_t,LITERAL_asm); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + { + TNode tmp7_AST_in = (TNode)_t; + match(_t,LITERAL_volatile); + _t = _t.getNextSibling(); + break; + } + case LCURLY: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp8_AST_in = (TNode)_t; + match(_t,LCURLY); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + TNode tmp9_AST_in = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + { + int _cnt13=0; + _loop13: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==SEMI)) { + TNode tmp10_AST_in = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + } + else { + if ( _cnt13>=1 ) { break _loop13; } else {throw new NoViableAltException(_t);} + } + + _cnt13++; + } while (true); + } + _t = __t10; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void typelessDeclaration(AST _t) throws RecognitionException { + + TNode typelessDeclaration_AST_in = (TNode)_t; + + try { // for error handling + AST __t8 = _t; + TNode tmp11_AST_in = (TNode)_t; + match(_t,NTypeMissing); + _t = _t.getFirstChild(); + initDeclList(_t); + _t = _retTree; + TNode tmp12_AST_in = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + _t = __t8; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void initDeclList(AST _t) throws RecognitionException { + + TNode initDeclList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt78=0; + _loop78: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NInitDecl)) { + initDecl(_t); + _t = _retTree; + } + else { + if ( _cnt78>=1 ) { break _loop78; } else {throw new NoViableAltException(_t);} + } + + _cnt78++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void expr(AST _t) throws RecognitionException { + + TNode expr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + { + assignExpr(_t); + _t = _retTree; + break; + } + case QUESTION: + { + conditionalExpr(_t); + _t = _retTree; + break; + } + case LOR: + { + logicalOrExpr(_t); + _t = _retTree; + break; + } + case LAND: + { + logicalAndExpr(_t); + _t = _retTree; + break; + } + case BOR: + { + inclusiveOrExpr(_t); + _t = _retTree; + break; + } + case BXOR: + { + exclusiveOrExpr(_t); + _t = _retTree; + break; + } + case BAND: + { + bitAndExpr(_t); + _t = _retTree; + break; + } + case EQUAL: + case NOT_EQUAL: + { + equalityExpr(_t); + _t = _retTree; + break; + } + case LT: + case LTE: + case GT: + case GTE: + { + relationalExpr(_t); + _t = _retTree; + break; + } + case LSHIFT: + case RSHIFT: + { + shiftExpr(_t); + _t = _retTree; + break; + } + case PLUS: + case MINUS: + { + additiveExpr(_t); + _t = _retTree; + break; + } + case STAR: + case DIV: + case MOD: + { + multExpr(_t); + _t = _retTree; + break; + } + case NCast: + { + castExpr(_t); + _t = _retTree; + break; + } + case INC: + case DEC: + case LITERAL_sizeof: + case NUnaryExpr: + case LITERAL___alignof: + { + unaryExpr(_t); + _t = _retTree; + break; + } + case NPostfixExpr: + { + postfixExpr(_t); + _t = _retTree; + break; + } + case ID: + case CharLiteral: + case NExpressionGroup: + case NStringSeq: + case Number: + { + primaryExpr(_t); + _t = _retTree; + break; + } + case NCommaExpr: + { + commaExpr(_t); + _t = _retTree; + break; + } + case NEmptyExpression: + { + emptyExpr(_t); + _t = _retTree; + break; + } + case LPAREN: + { + compoundStatementExpr(_t); + _t = _retTree; + break; + } + case NInitializer: + case NLcurlyInitializer: + { + initializer(_t); + _t = _retTree; + break; + } + case NRangeExpr: + { + rangeExpr(_t); + _t = _retTree; + break; + } + case NGnuAsmExpr: + { + gnuAsmExpr(_t); + _t = _retTree; + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void declSpecifiers(AST _t) throws RecognitionException { + + TNode declSpecifiers_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt21=0; + _loop21: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_typedef: + case LITERAL_auto: + case LITERAL_register: + case LITERAL_extern: + case LITERAL_static: + case LITERAL_inline: + { + storageClassSpecifier(_t); + _t = _retTree; + break; + } + case LITERAL_volatile: + case LITERAL_const: + { + typeQualifier(_t); + _t = _retTree; + break; + } + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + typeSpecifier(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt21>=1 ) { break _loop21; } else {throw new NoViableAltException(_t);} + } + } + _cnt21++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void storageClassSpecifier(AST _t) throws RecognitionException { + + TNode storageClassSpecifier_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_auto: + { + TNode tmp13_AST_in = (TNode)_t; + match(_t,LITERAL_auto); + _t = _t.getNextSibling(); + break; + } + case LITERAL_register: + { + TNode tmp14_AST_in = (TNode)_t; + match(_t,LITERAL_register); + _t = _t.getNextSibling(); + break; + } + case LITERAL_typedef: + { + TNode tmp15_AST_in = (TNode)_t; + match(_t,LITERAL_typedef); + _t = _t.getNextSibling(); + break; + } + case LITERAL_extern: + case LITERAL_static: + case LITERAL_inline: + { + functionStorageClassSpecifier(_t); + _t = _retTree; + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void typeQualifier(AST _t) throws RecognitionException { + + TNode typeQualifier_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_const: + { + TNode tmp16_AST_in = (TNode)_t; + match(_t,LITERAL_const); + _t = _t.getNextSibling(); + break; + } + case LITERAL_volatile: + { + TNode tmp17_AST_in = (TNode)_t; + match(_t,LITERAL_volatile); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void typeSpecifier(AST _t) throws RecognitionException { + + TNode typeSpecifier_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_void: + { + TNode tmp18_AST_in = (TNode)_t; + match(_t,LITERAL_void); + _t = _t.getNextSibling(); + break; + } + case LITERAL_char: + { + TNode tmp19_AST_in = (TNode)_t; + match(_t,LITERAL_char); + _t = _t.getNextSibling(); + break; + } + case LITERAL_short: + { + TNode tmp20_AST_in = (TNode)_t; + match(_t,LITERAL_short); + _t = _t.getNextSibling(); + break; + } + case LITERAL_int: + { + TNode tmp21_AST_in = (TNode)_t; + match(_t,LITERAL_int); + _t = _t.getNextSibling(); + break; + } + case LITERAL_long: + { + TNode tmp22_AST_in = (TNode)_t; + match(_t,LITERAL_long); + _t = _t.getNextSibling(); + break; + } + case LITERAL_float: + { + TNode tmp23_AST_in = (TNode)_t; + match(_t,LITERAL_float); + _t = _t.getNextSibling(); + break; + } + case LITERAL_double: + { + TNode tmp24_AST_in = (TNode)_t; + match(_t,LITERAL_double); + _t = _t.getNextSibling(); + break; + } + case LITERAL_signed: + { + TNode tmp25_AST_in = (TNode)_t; + match(_t,LITERAL_signed); + _t = _t.getNextSibling(); + break; + } + case LITERAL_unsigned: + { + TNode tmp26_AST_in = (TNode)_t; + match(_t,LITERAL_unsigned); + _t = _t.getNextSibling(); + break; + } + case LITERAL_byte: + { + TNode tmp27_AST_in = (TNode)_t; + match(_t,LITERAL_byte); + _t = _t.getNextSibling(); + break; + } + case LITERAL_boolean: + { + TNode tmp28_AST_in = (TNode)_t; + match(_t,LITERAL_boolean); + _t = _t.getNextSibling(); + break; + } + case LITERAL_Servo: + { + TNode tmp29_AST_in = (TNode)_t; + match(_t,LITERAL_Servo); + _t = _t.getNextSibling(); + break; + } + case LITERAL_Wire: + { + TNode tmp30_AST_in = (TNode)_t; + match(_t,LITERAL_Wire); + _t = _t.getNextSibling(); + break; + } + case LITERAL_struct: + { + structSpecifier(_t); + _t = _retTree; + { + _loop27: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { + attributeDecl(_t); + _t = _retTree; + } + else { + break _loop27; + } + + } while (true); + } + break; + } + case LITERAL_union: + { + unionSpecifier(_t); + _t = _retTree; + { + _loop29: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { + attributeDecl(_t); + _t = _retTree; + } + else { + break _loop29; + } + + } while (true); + } + break; + } + case LITERAL_enum: + { + enumSpecifier(_t); + _t = _retTree; + break; + } + case NTypedefName: + { + typedefName(_t); + _t = _retTree; + break; + } + case LITERAL_typeof: + { + AST __t30 = _t; + TNode tmp31_AST_in = (TNode)_t; + match(_t,LITERAL_typeof); + _t = _t.getFirstChild(); + TNode tmp32_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + typeName(_t); + _t = _retTree; + break; + } + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp33_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + _t = __t30; + _t = _t.getNextSibling(); + break; + } + case LITERAL___complex: + { + TNode tmp34_AST_in = (TNode)_t; + match(_t,LITERAL___complex); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void functionStorageClassSpecifier(AST _t) throws RecognitionException { + + TNode functionStorageClassSpecifier_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_extern: + { + TNode tmp35_AST_in = (TNode)_t; + match(_t,LITERAL_extern); + _t = _t.getNextSibling(); + break; + } + case LITERAL_static: + { + TNode tmp36_AST_in = (TNode)_t; + match(_t,LITERAL_static); + _t = _t.getNextSibling(); + break; + } + case LITERAL_inline: + { + TNode tmp37_AST_in = (TNode)_t; + match(_t,LITERAL_inline); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structSpecifier(AST _t) throws RecognitionException { + + TNode structSpecifier_AST_in = (TNode)_t; + + try { // for error handling + AST __t37 = _t; + TNode tmp38_AST_in = (TNode)_t; + match(_t,LITERAL_struct); + _t = _t.getFirstChild(); + structOrUnionBody(_t); + _t = _retTree; + _t = __t37; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void attributeDecl(AST _t) throws RecognitionException { + + TNode attributeDecl_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL___attribute: + { + AST __t72 = _t; + TNode tmp39_AST_in = (TNode)_t; + match(_t,LITERAL___attribute); + _t = _t.getFirstChild(); + { + _loop74: + do { + if (_t==null) _t=ASTNULL; + if (((_t.getType() >= LITERAL_typedef && _t.getType() <= LITERAL___imag))) { + TNode tmp40_AST_in = (TNode)_t; + if ( _t==null ) throw new MismatchedTokenException(); + _t = _t.getNextSibling(); + } + else { + break _loop74; + } + + } while (true); + } + _t = __t72; + _t = _t.getNextSibling(); + break; + } + case NAsmAttribute: + { + AST __t75 = _t; + TNode tmp41_AST_in = (TNode)_t; + match(_t,NAsmAttribute); + _t = _t.getFirstChild(); + TNode tmp42_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + TNode tmp43_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + _t = __t75; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void unionSpecifier(AST _t) throws RecognitionException { + + TNode unionSpecifier_AST_in = (TNode)_t; + + try { // for error handling + AST __t39 = _t; + TNode tmp44_AST_in = (TNode)_t; + match(_t,LITERAL_union); + _t = _t.getFirstChild(); + structOrUnionBody(_t); + _t = _retTree; + _t = __t39; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void enumSpecifier(AST _t) throws RecognitionException { + + TNode enumSpecifier_AST_in = (TNode)_t; + + try { // for error handling + AST __t63 = _t; + TNode tmp45_AST_in = (TNode)_t; + match(_t,LITERAL_enum); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + { + TNode tmp46_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + break; + } + case 3: + case LCURLY: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LCURLY: + { + TNode tmp47_AST_in = (TNode)_t; + match(_t,LCURLY); + _t = _t.getNextSibling(); + enumList(_t); + _t = _retTree; + TNode tmp48_AST_in = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t63; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void typedefName(AST _t) throws RecognitionException { + + TNode typedefName_AST_in = (TNode)_t; + + try { // for error handling + AST __t35 = _t; + TNode tmp49_AST_in = (TNode)_t; + match(_t,NTypedefName); + _t = _t.getFirstChild(); + TNode tmp50_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + _t = __t35; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void typeName(AST _t) throws RecognitionException { + + TNode typeName_AST_in = (TNode)_t; + + try { // for error handling + specifierQualifierList(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NNonemptyAbstractDeclarator: + { + nonemptyAbstractDeclarator(_t); + _t = _retTree; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structOrUnionBody(AST _t) throws RecognitionException { + + TNode structOrUnionBody_AST_in = (TNode)_t; + + try { // for error handling + { + boolean synPredMatched43 = false; + if (((_t.getType()==ID))) { + AST __t43 = _t; + synPredMatched43 = true; + inputState.guessing++; + try { + { + TNode tmp51_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + TNode tmp52_AST_in = (TNode)_t; + match(_t,LCURLY); + _t = _t.getNextSibling(); + } + } + catch (RecognitionException pe) { + synPredMatched43 = false; + } + _t = __t43; + inputState.guessing--; + } + if ( synPredMatched43 ) { + TNode tmp53_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + TNode tmp54_AST_in = (TNode)_t; + match(_t,LCURLY); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + structDeclarationList(_t); + _t = _retTree; + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp55_AST_in = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + } + else if ((_t.getType()==LCURLY)) { + TNode tmp56_AST_in = (TNode)_t; + match(_t,LCURLY); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_const: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + structDeclarationList(_t); + _t = _retTree; + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp57_AST_in = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + } + else if ((_t.getType()==ID)) { + TNode tmp58_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + } + else { + throw new NoViableAltException(_t); + } + + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structDeclarationList(AST _t) throws RecognitionException { + + TNode structDeclarationList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt48=0; + _loop48: + do { + if (_t==null) _t=ASTNULL; + if ((_tokenSet_1.member(_t.getType()))) { + structDeclaration(_t); + _t = _retTree; + } + else { + if ( _cnt48>=1 ) { break _loop48; } else {throw new NoViableAltException(_t);} + } + + _cnt48++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structDeclaration(AST _t) throws RecognitionException { + + TNode structDeclaration_AST_in = (TNode)_t; + + try { // for error handling + specifierQualifierList(_t); + _t = _retTree; + structDeclaratorList(_t); + _t = _retTree; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void specifierQualifierList(AST _t) throws RecognitionException { + + TNode specifierQualifierList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt52=0; + _loop52: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + typeSpecifier(_t); + _t = _retTree; + break; + } + case LITERAL_volatile: + case LITERAL_const: + { + typeQualifier(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt52>=1 ) { break _loop52; } else {throw new NoViableAltException(_t);} + } + } + _cnt52++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structDeclaratorList(AST _t) throws RecognitionException { + + TNode structDeclaratorList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt55=0; + _loop55: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NStructDeclarator)) { + structDeclarator(_t); + _t = _retTree; + } + else { + if ( _cnt55>=1 ) { break _loop55; } else {throw new NoViableAltException(_t);} + } + + _cnt55++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void structDeclarator(AST _t) throws RecognitionException { + + TNode structDeclarator_AST_in = (TNode)_t; + + try { // for error handling + AST __t57 = _t; + TNode tmp59_AST_in = (TNode)_t; + match(_t,NStructDeclarator); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NDeclarator: + { + declarator(_t); + _t = _retTree; + break; + } + case 3: + case COLON: + case NAsmAttribute: + case LITERAL___attribute: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case COLON: + { + TNode tmp60_AST_in = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + break; + } + case 3: + case NAsmAttribute: + case LITERAL___attribute: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + _loop61: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { + attributeDecl(_t); + _t = _retTree; + } + else { + break _loop61; + } + + } while (true); + } + _t = __t57; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void declarator(AST _t) throws RecognitionException { + + TNode declarator_AST_in = (TNode)_t; + TNode id = null; + + try { // for error handling + AST __t107 = _t; + TNode tmp61_AST_in = (TNode)_t; + match(_t,NDeclarator); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NPointerGroup: + { + pointerGroup(_t); + _t = _retTree; + break; + } + case ID: + case LPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + { + id = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + break; + } + case LPAREN: + { + TNode tmp62_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + declarator(_t); + _t = _retTree; + TNode tmp63_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + _loop115: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NParameterTypeList: + { + AST __t111 = _t; + TNode tmp64_AST_in = (TNode)_t; + match(_t,NParameterTypeList); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NParameterDeclaration: + { + parameterTypeList(_t); + _t = _retTree; + break; + } + case ID: + case RPAREN: + { + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + { + idList(_t); + _t = _retTree; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp65_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + _t = __t111; + _t = _t.getNextSibling(); + break; + } + case LBRACKET: + { + TNode tmp66_AST_in = (TNode)_t; + match(_t,LBRACKET); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp67_AST_in = (TNode)_t; + match(_t,RBRACKET); + _t = _t.getNextSibling(); + break; + } + default: + { + break _loop115; + } + } + } while (true); + } + _t = __t107; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void enumList(AST _t) throws RecognitionException { + + TNode enumList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt68=0; + _loop68: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==ID)) { + enumerator(_t); + _t = _retTree; + } + else { + if ( _cnt68>=1 ) { break _loop68; } else {throw new NoViableAltException(_t);} + } + + _cnt68++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void enumerator(AST _t) throws RecognitionException { + + TNode enumerator_AST_in = (TNode)_t; + + try { // for error handling + TNode tmp68_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + { + TNode tmp69_AST_in = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + break; + } + case RCURLY: + case ID: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void initDecl(AST _t) throws RecognitionException { + + TNode initDecl_AST_in = (TNode)_t; + String declName = ""; + + try { // for error handling + AST __t80 = _t; + TNode tmp70_AST_in = (TNode)_t; + match(_t,NInitDecl); + _t = _t.getFirstChild(); + declarator(_t); + _t = _retTree; + { + _loop82: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) { + attributeDecl(_t); + _t = _retTree; + } + else { + break _loop82; + } + + } while (true); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + { + TNode tmp71_AST_in = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getNextSibling(); + initializer(_t); + _t = _retTree; + break; + } + case COLON: + { + TNode tmp72_AST_in = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t80; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void initializer(AST _t) throws RecognitionException { + + TNode initializer_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NInitializer: + { + AST __t94 = _t; + TNode tmp73_AST_in = (TNode)_t; + match(_t,NInitializer); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NInitializerElementLabel: + { + initializerElementLabel(_t); + _t = _retTree; + break; + } + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + expr(_t); + _t = _retTree; + _t = __t94; + _t = _t.getNextSibling(); + break; + } + case NLcurlyInitializer: + { + lcurlyInitializer(_t); + _t = _retTree; + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void pointerGroup(AST _t) throws RecognitionException { + + TNode pointerGroup_AST_in = (TNode)_t; + + try { // for error handling + AST __t85 = _t; + TNode tmp74_AST_in = (TNode)_t; + match(_t,NPointerGroup); + _t = _t.getFirstChild(); + { + int _cnt89=0; + _loop89: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==STAR)) { + TNode tmp75_AST_in = (TNode)_t; + match(_t,STAR); + _t = _t.getNextSibling(); + { + _loop88: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==LITERAL_volatile||_t.getType()==LITERAL_const)) { + typeQualifier(_t); + _t = _retTree; + } + else { + break _loop88; + } + + } while (true); + } + } + else { + if ( _cnt89>=1 ) { break _loop89; } else {throw new NoViableAltException(_t);} + } + + _cnt89++; + } while (true); + } + _t = __t85; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void idList(AST _t) throws RecognitionException { + + TNode idList_AST_in = (TNode)_t; + + try { // for error handling + TNode tmp76_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + { + _loop92: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COMMA)) { + TNode tmp77_AST_in = (TNode)_t; + match(_t,COMMA); + _t = _t.getNextSibling(); + TNode tmp78_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + } + else { + break _loop92; + } + + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void initializerElementLabel(AST _t) throws RecognitionException { + + TNode initializerElementLabel_AST_in = (TNode)_t; + + try { // for error handling + AST __t97 = _t; + TNode tmp79_AST_in = (TNode)_t; + match(_t,NInitializerElementLabel); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LBRACKET: + { + { + TNode tmp80_AST_in = (TNode)_t; + match(_t,LBRACKET); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + TNode tmp81_AST_in = (TNode)_t; + match(_t,RBRACKET); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + { + TNode tmp82_AST_in = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + break; + } + case ID: + { + TNode tmp83_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + TNode tmp84_AST_in = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + break; + } + case DOT: + { + TNode tmp85_AST_in = (TNode)_t; + match(_t,DOT); + _t = _t.getNextSibling(); + TNode tmp86_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + TNode tmp87_AST_in = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t97; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void lcurlyInitializer(AST _t) throws RecognitionException { + + TNode lcurlyInitializer_AST_in = (TNode)_t; + + try { // for error handling + AST __t102 = _t; + TNode tmp88_AST_in = (TNode)_t; + match(_t,NLcurlyInitializer); + _t = _t.getFirstChild(); + initializerList(_t); + _t = _retTree; + TNode tmp89_AST_in = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + _t = __t102; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void initializerList(AST _t) throws RecognitionException { + + TNode initializerList_AST_in = (TNode)_t; + + try { // for error handling + { + _loop105: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NInitializer||_t.getType()==NLcurlyInitializer)) { + initializer(_t); + _t = _retTree; + } + else { + break _loop105; + } + + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void parameterTypeList(AST _t) throws RecognitionException { + + TNode parameterTypeList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt119=0; + _loop119: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==NParameterDeclaration)) { + parameterDeclaration(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case COMMA: + { + TNode tmp90_AST_in = (TNode)_t; + match(_t,COMMA); + _t = _t.getNextSibling(); + break; + } + case SEMI: + { + TNode tmp91_AST_in = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + break; + } + case RPAREN: + case VARARGS: + case NParameterDeclaration: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + else { + if ( _cnt119>=1 ) { break _loop119; } else {throw new NoViableAltException(_t);} + } + + _cnt119++; + } while (true); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case VARARGS: + { + TNode tmp92_AST_in = (TNode)_t; + match(_t,VARARGS); + _t = _t.getNextSibling(); + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void parameterDeclaration(AST _t) throws RecognitionException { + + TNode parameterDeclaration_AST_in = (TNode)_t; + + try { // for error handling + AST __t122 = _t; + TNode tmp93_AST_in = (TNode)_t; + match(_t,NParameterDeclaration); + _t = _t.getFirstChild(); + declSpecifiers(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NDeclarator: + { + declarator(_t); + _t = _retTree; + break; + } + case NNonemptyAbstractDeclarator: + { + nonemptyAbstractDeclarator(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t122; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void nonemptyAbstractDeclarator(AST _t) throws RecognitionException { + + TNode nonemptyAbstractDeclarator_AST_in = (TNode)_t; + + try { // for error handling + AST __t237 = _t; + TNode tmp94_AST_in = (TNode)_t; + match(_t,NNonemptyAbstractDeclarator); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NPointerGroup: + { + pointerGroup(_t); + _t = _retTree; + { + _loop244: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LPAREN: + { + { + TNode tmp95_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NNonemptyAbstractDeclarator: + { + nonemptyAbstractDeclarator(_t); + _t = _retTree; + break; + } + case NParameterDeclaration: + { + parameterTypeList(_t); + _t = _retTree; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp96_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + } + break; + } + case LBRACKET: + { + { + TNode tmp97_AST_in = (TNode)_t; + match(_t,LBRACKET); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp98_AST_in = (TNode)_t; + match(_t,RBRACKET); + _t = _t.getNextSibling(); + } + break; + } + default: + { + break _loop244; + } + } + } while (true); + } + break; + } + case LPAREN: + case LBRACKET: + { + { + int _cnt250=0; + _loop250: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LPAREN: + { + { + TNode tmp99_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NNonemptyAbstractDeclarator: + { + nonemptyAbstractDeclarator(_t); + _t = _retTree; + break; + } + case NParameterDeclaration: + { + parameterTypeList(_t); + _t = _retTree; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp100_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + } + break; + } + case LBRACKET: + { + { + TNode tmp101_AST_in = (TNode)_t; + match(_t,LBRACKET); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + case RBRACKET: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp102_AST_in = (TNode)_t; + match(_t,RBRACKET); + _t = _t.getNextSibling(); + } + break; + } + default: + { + if ( _cnt250>=1 ) { break _loop250; } else {throw new NoViableAltException(_t);} + } + } + _cnt250++; + } while (true); + } + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t237; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void functionDeclSpecifiers(AST _t) throws RecognitionException { + + TNode functionDeclSpecifiers_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt131=0; + _loop131: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_extern: + case LITERAL_static: + case LITERAL_inline: + { + functionStorageClassSpecifier(_t); + _t = _retTree; + break; + } + case LITERAL_volatile: + case LITERAL_const: + { + typeQualifier(_t); + _t = _retTree; + break; + } + case LITERAL_struct: + case LITERAL_union: + case LITERAL_enum: + case LITERAL_void: + case LITERAL_char: + case LITERAL_short: + case LITERAL_int: + case LITERAL_long: + case LITERAL_float: + case LITERAL_double: + case LITERAL_signed: + case LITERAL_unsigned: + case NTypedefName: + case LITERAL_byte: + case LITERAL_boolean: + case LITERAL_Servo: + case LITERAL_Wire: + case LITERAL_typeof: + case LITERAL___complex: + { + typeSpecifier(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt131>=1 ) { break _loop131; } else {throw new NoViableAltException(_t);} + } + } + _cnt131++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void compoundStatement(AST _t) throws RecognitionException { + + TNode compoundStatement_AST_in = (TNode)_t; + + try { // for error handling + AST __t140 = _t; + TNode tmp103_AST_in = (TNode)_t; + match(_t,NCompoundStatement); + _t = _t.getFirstChild(); + { + _loop142: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NDeclaration: + case LITERAL___label__: + { + declarationList(_t); + _t = _retTree; + break; + } + case NFunctionDef: + { + functionDef(_t); + _t = _retTree; + break; + } + default: + { + break _loop142; + } + } + } while (true); + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case SEMI: + case LITERAL_while: + case LITERAL_do: + case LITERAL_for: + case LITERAL_goto: + case LITERAL_continue: + case LITERAL_break: + case LITERAL_return: + case LITERAL_case: + case LITERAL_default: + case LITERAL_if: + case LITERAL_switch: + case NStatementExpr: + case NCompoundStatement: + case NLabel: + { + statementList(_t); + _t = _retTree; + break; + } + case RCURLY: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp104_AST_in = (TNode)_t; + match(_t,RCURLY); + _t = _t.getNextSibling(); + _t = __t140; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void declarationList(AST _t) throws RecognitionException { + + TNode declarationList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt134=0; + _loop134: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==LITERAL___label__)) { + localLabelDecl(_t); + _t = _retTree; + } + else if ((_t.getType()==NDeclaration)) { + declaration(_t); + _t = _retTree; + } + else { + if ( _cnt134>=1 ) { break _loop134; } else {throw new NoViableAltException(_t);} + } + + _cnt134++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void localLabelDecl(AST _t) throws RecognitionException { + + TNode localLabelDecl_AST_in = (TNode)_t; + + try { // for error handling + AST __t136 = _t; + TNode tmp105_AST_in = (TNode)_t; + match(_t,LITERAL___label__); + _t = _t.getFirstChild(); + { + int _cnt138=0; + _loop138: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==ID)) { + TNode tmp106_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + } + else { + if ( _cnt138>=1 ) { break _loop138; } else {throw new NoViableAltException(_t);} + } + + _cnt138++; + } while (true); + } + _t = __t136; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void statementList(AST _t) throws RecognitionException { + + TNode statementList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt146=0; + _loop146: + do { + if (_t==null) _t=ASTNULL; + if ((_tokenSet_2.member(_t.getType()))) { + statement(_t); + _t = _retTree; + } + else { + if ( _cnt146>=1 ) { break _loop146; } else {throw new NoViableAltException(_t);} + } + + _cnt146++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void statement(AST _t) throws RecognitionException { + + TNode statement_AST_in = (TNode)_t; + + try { // for error handling + statementBody(_t); + _t = _retTree; + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void statementBody(AST _t) throws RecognitionException { + + TNode statementBody_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case SEMI: + { + TNode tmp107_AST_in = (TNode)_t; + match(_t,SEMI); + _t = _t.getNextSibling(); + break; + } + case NCompoundStatement: + { + compoundStatement(_t); + _t = _retTree; + break; + } + case NStatementExpr: + { + AST __t149 = _t; + TNode tmp108_AST_in = (TNode)_t; + match(_t,NStatementExpr); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + _t = __t149; + _t = _t.getNextSibling(); + break; + } + case LITERAL_while: + { + AST __t150 = _t; + TNode tmp109_AST_in = (TNode)_t; + match(_t,LITERAL_while); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + statement(_t); + _t = _retTree; + _t = __t150; + _t = _t.getNextSibling(); + break; + } + case LITERAL_do: + { + AST __t151 = _t; + TNode tmp110_AST_in = (TNode)_t; + match(_t,LITERAL_do); + _t = _t.getFirstChild(); + statement(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t151; + _t = _t.getNextSibling(); + break; + } + case LITERAL_for: + { + AST __t152 = _t; + TNode tmp111_AST_in = (TNode)_t; + match(_t,LITERAL_for); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + statement(_t); + _t = _retTree; + _t = __t152; + _t = _t.getNextSibling(); + break; + } + case LITERAL_goto: + { + AST __t153 = _t; + TNode tmp112_AST_in = (TNode)_t; + match(_t,LITERAL_goto); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + _t = __t153; + _t = _t.getNextSibling(); + break; + } + case LITERAL_continue: + { + TNode tmp113_AST_in = (TNode)_t; + match(_t,LITERAL_continue); + _t = _t.getNextSibling(); + break; + } + case LITERAL_break: + { + TNode tmp114_AST_in = (TNode)_t; + match(_t,LITERAL_break); + _t = _t.getNextSibling(); + break; + } + case LITERAL_return: + { + AST __t154 = _t; + TNode tmp115_AST_in = (TNode)_t; + match(_t,LITERAL_return); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t154; + _t = _t.getNextSibling(); + break; + } + case NLabel: + { + AST __t156 = _t; + TNode tmp116_AST_in = (TNode)_t; + match(_t,NLabel); + _t = _t.getFirstChild(); + TNode tmp117_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case SEMI: + case LITERAL_while: + case LITERAL_do: + case LITERAL_for: + case LITERAL_goto: + case LITERAL_continue: + case LITERAL_break: + case LITERAL_return: + case LITERAL_case: + case LITERAL_default: + case LITERAL_if: + case LITERAL_switch: + case NStatementExpr: + case NCompoundStatement: + case NLabel: + { + statement(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t156; + _t = _t.getNextSibling(); + break; + } + case LITERAL_case: + { + AST __t158 = _t; + TNode tmp118_AST_in = (TNode)_t; + match(_t,LITERAL_case); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case SEMI: + case LITERAL_while: + case LITERAL_do: + case LITERAL_for: + case LITERAL_goto: + case LITERAL_continue: + case LITERAL_break: + case LITERAL_return: + case LITERAL_case: + case LITERAL_default: + case LITERAL_if: + case LITERAL_switch: + case NStatementExpr: + case NCompoundStatement: + case NLabel: + { + statement(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t158; + _t = _t.getNextSibling(); + break; + } + case LITERAL_default: + { + AST __t160 = _t; + TNode tmp119_AST_in = (TNode)_t; + match(_t,LITERAL_default); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case SEMI: + case LITERAL_while: + case LITERAL_do: + case LITERAL_for: + case LITERAL_goto: + case LITERAL_continue: + case LITERAL_break: + case LITERAL_return: + case LITERAL_case: + case LITERAL_default: + case LITERAL_if: + case LITERAL_switch: + case NStatementExpr: + case NCompoundStatement: + case NLabel: + { + statement(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t160; + _t = _t.getNextSibling(); + break; + } + case LITERAL_if: + { + AST __t162 = _t; + TNode tmp120_AST_in = (TNode)_t; + match(_t,LITERAL_if); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + statement(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_else: + { + TNode tmp121_AST_in = (TNode)_t; + match(_t,LITERAL_else); + _t = _t.getNextSibling(); + statement(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + _t = __t162; + _t = _t.getNextSibling(); + break; + } + case LITERAL_switch: + { + AST __t164 = _t; + TNode tmp122_AST_in = (TNode)_t; + match(_t,LITERAL_switch); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + statement(_t); + _t = _retTree; + _t = __t164; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void assignExpr(AST _t) throws RecognitionException { + + TNode assignExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ASSIGN: + { + AST __t190 = _t; + TNode tmp123_AST_in = (TNode)_t; + match(_t,ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t190; + _t = _t.getNextSibling(); + break; + } + case DIV_ASSIGN: + { + AST __t191 = _t; + TNode tmp124_AST_in = (TNode)_t; + match(_t,DIV_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t191; + _t = _t.getNextSibling(); + break; + } + case PLUS_ASSIGN: + { + AST __t192 = _t; + TNode tmp125_AST_in = (TNode)_t; + match(_t,PLUS_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t192; + _t = _t.getNextSibling(); + break; + } + case MINUS_ASSIGN: + { + AST __t193 = _t; + TNode tmp126_AST_in = (TNode)_t; + match(_t,MINUS_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t193; + _t = _t.getNextSibling(); + break; + } + case STAR_ASSIGN: + { + AST __t194 = _t; + TNode tmp127_AST_in = (TNode)_t; + match(_t,STAR_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t194; + _t = _t.getNextSibling(); + break; + } + case MOD_ASSIGN: + { + AST __t195 = _t; + TNode tmp128_AST_in = (TNode)_t; + match(_t,MOD_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t195; + _t = _t.getNextSibling(); + break; + } + case RSHIFT_ASSIGN: + { + AST __t196 = _t; + TNode tmp129_AST_in = (TNode)_t; + match(_t,RSHIFT_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t196; + _t = _t.getNextSibling(); + break; + } + case LSHIFT_ASSIGN: + { + AST __t197 = _t; + TNode tmp130_AST_in = (TNode)_t; + match(_t,LSHIFT_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t197; + _t = _t.getNextSibling(); + break; + } + case BAND_ASSIGN: + { + AST __t198 = _t; + TNode tmp131_AST_in = (TNode)_t; + match(_t,BAND_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t198; + _t = _t.getNextSibling(); + break; + } + case BOR_ASSIGN: + { + AST __t199 = _t; + TNode tmp132_AST_in = (TNode)_t; + match(_t,BOR_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t199; + _t = _t.getNextSibling(); + break; + } + case BXOR_ASSIGN: + { + AST __t200 = _t; + TNode tmp133_AST_in = (TNode)_t; + match(_t,BXOR_ASSIGN); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t200; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void conditionalExpr(AST _t) throws RecognitionException { + + TNode conditionalExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t202 = _t; + TNode tmp134_AST_in = (TNode)_t; + match(_t,QUESTION); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + expr(_t); + _t = _retTree; + break; + } + case COLON: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp135_AST_in = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + _t = __t202; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void logicalOrExpr(AST _t) throws RecognitionException { + + TNode logicalOrExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t205 = _t; + TNode tmp136_AST_in = (TNode)_t; + match(_t,LOR); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t205; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void logicalAndExpr(AST _t) throws RecognitionException { + + TNode logicalAndExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t207 = _t; + TNode tmp137_AST_in = (TNode)_t; + match(_t,LAND); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t207; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void inclusiveOrExpr(AST _t) throws RecognitionException { + + TNode inclusiveOrExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t209 = _t; + TNode tmp138_AST_in = (TNode)_t; + match(_t,BOR); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t209; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void exclusiveOrExpr(AST _t) throws RecognitionException { + + TNode exclusiveOrExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t211 = _t; + TNode tmp139_AST_in = (TNode)_t; + match(_t,BXOR); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t211; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void bitAndExpr(AST _t) throws RecognitionException { + + TNode bitAndExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t213 = _t; + TNode tmp140_AST_in = (TNode)_t; + match(_t,BAND); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t213; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void equalityExpr(AST _t) throws RecognitionException { + + TNode equalityExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case EQUAL: + { + AST __t215 = _t; + TNode tmp141_AST_in = (TNode)_t; + match(_t,EQUAL); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t215; + _t = _t.getNextSibling(); + break; + } + case NOT_EQUAL: + { + AST __t216 = _t; + TNode tmp142_AST_in = (TNode)_t; + match(_t,NOT_EQUAL); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t216; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void relationalExpr(AST _t) throws RecognitionException { + + TNode relationalExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LT: + { + AST __t218 = _t; + TNode tmp143_AST_in = (TNode)_t; + match(_t,LT); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t218; + _t = _t.getNextSibling(); + break; + } + case LTE: + { + AST __t219 = _t; + TNode tmp144_AST_in = (TNode)_t; + match(_t,LTE); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t219; + _t = _t.getNextSibling(); + break; + } + case GT: + { + AST __t220 = _t; + TNode tmp145_AST_in = (TNode)_t; + match(_t,GT); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t220; + _t = _t.getNextSibling(); + break; + } + case GTE: + { + AST __t221 = _t; + TNode tmp146_AST_in = (TNode)_t; + match(_t,GTE); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t221; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void shiftExpr(AST _t) throws RecognitionException { + + TNode shiftExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LSHIFT: + { + AST __t223 = _t; + TNode tmp147_AST_in = (TNode)_t; + match(_t,LSHIFT); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t223; + _t = _t.getNextSibling(); + break; + } + case RSHIFT: + { + AST __t224 = _t; + TNode tmp148_AST_in = (TNode)_t; + match(_t,RSHIFT); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t224; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void additiveExpr(AST _t) throws RecognitionException { + + TNode additiveExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case PLUS: + { + AST __t226 = _t; + TNode tmp149_AST_in = (TNode)_t; + match(_t,PLUS); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t226; + _t = _t.getNextSibling(); + break; + } + case MINUS: + { + AST __t227 = _t; + TNode tmp150_AST_in = (TNode)_t; + match(_t,MINUS); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t227; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void multExpr(AST _t) throws RecognitionException { + + TNode multExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case STAR: + { + AST __t229 = _t; + TNode tmp151_AST_in = (TNode)_t; + match(_t,STAR); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t229; + _t = _t.getNextSibling(); + break; + } + case DIV: + { + AST __t230 = _t; + TNode tmp152_AST_in = (TNode)_t; + match(_t,DIV); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t230; + _t = _t.getNextSibling(); + break; + } + case MOD: + { + AST __t231 = _t; + TNode tmp153_AST_in = (TNode)_t; + match(_t,MOD); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t231; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void castExpr(AST _t) throws RecognitionException { + + TNode castExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t233 = _t; + TNode tmp154_AST_in = (TNode)_t; + match(_t,NCast); + _t = _t.getFirstChild(); + typeName(_t); + _t = _retTree; + TNode tmp155_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + _t = __t233; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void unaryExpr(AST _t) throws RecognitionException { + + TNode unaryExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case INC: + { + AST __t252 = _t; + TNode tmp156_AST_in = (TNode)_t; + match(_t,INC); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + _t = __t252; + _t = _t.getNextSibling(); + break; + } + case DEC: + { + AST __t253 = _t; + TNode tmp157_AST_in = (TNode)_t; + match(_t,DEC); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + _t = __t253; + _t = _t.getNextSibling(); + break; + } + case NUnaryExpr: + { + AST __t254 = _t; + TNode tmp158_AST_in = (TNode)_t; + match(_t,NUnaryExpr); + _t = _t.getFirstChild(); + unaryOperator(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t254; + _t = _t.getNextSibling(); + break; + } + case LITERAL_sizeof: + { + AST __t255 = _t; + TNode tmp159_AST_in = (TNode)_t; + match(_t,LITERAL_sizeof); + _t = _t.getFirstChild(); + { + boolean synPredMatched258 = false; + if (((_t.getType()==LPAREN))) { + AST __t258 = _t; + synPredMatched258 = true; + inputState.guessing++; + try { + { + TNode tmp160_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + typeName(_t); + _t = _retTree; + } + } + catch (RecognitionException pe) { + synPredMatched258 = false; + } + _t = __t258; + inputState.guessing--; + } + if ( synPredMatched258 ) { + TNode tmp161_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + typeName(_t); + _t = _retTree; + TNode tmp162_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + } + else if ((_tokenSet_3.member(_t.getType()))) { + expr(_t); + _t = _retTree; + } + else { + throw new NoViableAltException(_t); + } + + } + _t = __t255; + _t = _t.getNextSibling(); + break; + } + case LITERAL___alignof: + { + AST __t259 = _t; + TNode tmp163_AST_in = (TNode)_t; + match(_t,LITERAL___alignof); + _t = _t.getFirstChild(); + { + boolean synPredMatched262 = false; + if (((_t.getType()==LPAREN))) { + AST __t262 = _t; + synPredMatched262 = true; + inputState.guessing++; + try { + { + TNode tmp164_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + typeName(_t); + _t = _retTree; + } + } + catch (RecognitionException pe) { + synPredMatched262 = false; + } + _t = __t262; + inputState.guessing--; + } + if ( synPredMatched262 ) { + TNode tmp165_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + typeName(_t); + _t = _retTree; + TNode tmp166_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + } + else if ((_tokenSet_3.member(_t.getType()))) { + expr(_t); + _t = _retTree; + } + else { + throw new NoViableAltException(_t); + } + + } + _t = __t259; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void postfixExpr(AST _t) throws RecognitionException { + + TNode postfixExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t265 = _t; + TNode tmp167_AST_in = (TNode)_t; + match(_t,NPostfixExpr); + _t = _t.getFirstChild(); + primaryExpr(_t); + _t = _retTree; + { + int _cnt269=0; + _loop269: + do { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case PTR: + { + TNode tmp168_AST_in = (TNode)_t; + match(_t,PTR); + _t = _t.getNextSibling(); + TNode tmp169_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + break; + } + case DOT: + { + TNode tmp170_AST_in = (TNode)_t; + match(_t,DOT); + _t = _t.getNextSibling(); + TNode tmp171_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + break; + } + case NFunctionCallArgs: + { + AST __t267 = _t; + TNode tmp172_AST_in = (TNode)_t; + match(_t,NFunctionCallArgs); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + case ASSIGN: + case STAR: + case LPAREN: + case DIV_ASSIGN: + case PLUS_ASSIGN: + case MINUS_ASSIGN: + case STAR_ASSIGN: + case MOD_ASSIGN: + case RSHIFT_ASSIGN: + case LSHIFT_ASSIGN: + case BAND_ASSIGN: + case BOR_ASSIGN: + case BXOR_ASSIGN: + case QUESTION: + case LOR: + case LAND: + case BOR: + case BXOR: + case BAND: + case EQUAL: + case NOT_EQUAL: + case LT: + case LTE: + case GT: + case GTE: + case LSHIFT: + case RSHIFT: + case PLUS: + case MINUS: + case DIV: + case MOD: + case INC: + case DEC: + case LITERAL_sizeof: + case CharLiteral: + case NCast: + case NExpressionGroup: + case NInitializer: + case NEmptyExpression: + case NCommaExpr: + case NUnaryExpr: + case NPostfixExpr: + case NRangeExpr: + case NStringSeq: + case NLcurlyInitializer: + case NGnuAsmExpr: + case Number: + case LITERAL___alignof: + { + argExprList(_t); + _t = _retTree; + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp173_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + _t = __t267; + _t = _t.getNextSibling(); + break; + } + case LBRACKET: + { + TNode tmp174_AST_in = (TNode)_t; + match(_t,LBRACKET); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + TNode tmp175_AST_in = (TNode)_t; + match(_t,RBRACKET); + _t = _t.getNextSibling(); + break; + } + case INC: + { + TNode tmp176_AST_in = (TNode)_t; + match(_t,INC); + _t = _t.getNextSibling(); + break; + } + case DEC: + { + TNode tmp177_AST_in = (TNode)_t; + match(_t,DEC); + _t = _t.getNextSibling(); + break; + } + default: + { + if ( _cnt269>=1 ) { break _loop269; } else {throw new NoViableAltException(_t);} + } + } + _cnt269++; + } while (true); + } + _t = __t265; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void primaryExpr(AST _t) throws RecognitionException { + + TNode primaryExpr_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case ID: + { + TNode tmp178_AST_in = (TNode)_t; + match(_t,ID); + _t = _t.getNextSibling(); + break; + } + case Number: + { + TNode tmp179_AST_in = (TNode)_t; + match(_t,Number); + _t = _t.getNextSibling(); + break; + } + case CharLiteral: + { + charConst(_t); + _t = _retTree; + break; + } + case NStringSeq: + { + stringConst(_t); + _t = _retTree; + break; + } + case NExpressionGroup: + { + AST __t271 = _t; + TNode tmp180_AST_in = (TNode)_t; + match(_t,NExpressionGroup); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + _t = __t271; + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void commaExpr(AST _t) throws RecognitionException { + + TNode commaExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t167 = _t; + TNode tmp181_AST_in = (TNode)_t; + match(_t,NCommaExpr); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + expr(_t); + _t = _retTree; + _t = __t167; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void emptyExpr(AST _t) throws RecognitionException { + + TNode emptyExpr_AST_in = (TNode)_t; + + try { // for error handling + TNode tmp182_AST_in = (TNode)_t; + match(_t,NEmptyExpression); + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void compoundStatementExpr(AST _t) throws RecognitionException { + + TNode compoundStatementExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t170 = _t; + TNode tmp183_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getFirstChild(); + compoundStatement(_t); + _t = _retTree; + TNode tmp184_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + _t = __t170; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void rangeExpr(AST _t) throws RecognitionException { + + TNode rangeExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t172 = _t; + TNode tmp185_AST_in = (TNode)_t; + match(_t,NRangeExpr); + _t = _t.getFirstChild(); + expr(_t); + _t = _retTree; + TNode tmp186_AST_in = (TNode)_t; + match(_t,VARARGS); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + _t = __t172; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void gnuAsmExpr(AST _t) throws RecognitionException { + + TNode gnuAsmExpr_AST_in = (TNode)_t; + + try { // for error handling + AST __t174 = _t; + TNode tmp187_AST_in = (TNode)_t; + match(_t,NGnuAsmExpr); + _t = _t.getFirstChild(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LITERAL_volatile: + { + TNode tmp188_AST_in = (TNode)_t; + match(_t,LITERAL_volatile); + _t = _t.getNextSibling(); + break; + } + case LPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp189_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + stringConst(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COLON)) { + TNode tmp190_AST_in = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NStringSeq: + { + strOptExprPair(_t); + _t = _retTree; + { + _loop179: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COMMA)) { + TNode tmp191_AST_in = (TNode)_t; + match(_t,COMMA); + _t = _t.getNextSibling(); + strOptExprPair(_t); + _t = _retTree; + } + else { + break _loop179; + } + + } while (true); + } + break; + } + case COLON: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COLON)) { + TNode tmp192_AST_in = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case NStringSeq: + { + strOptExprPair(_t); + _t = _retTree; + { + _loop183: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COMMA)) { + TNode tmp193_AST_in = (TNode)_t; + match(_t,COMMA); + _t = _t.getNextSibling(); + strOptExprPair(_t); + _t = _retTree; + } + else { + break _loop183; + } + + } while (true); + } + break; + } + case COLON: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + else if ((_t.getType()==COLON||_t.getType()==RPAREN)) { + } + else { + throw new NoViableAltException(_t); + } + + } + } + else if ((_t.getType()==COLON||_t.getType()==RPAREN)) { + } + else { + throw new NoViableAltException(_t); + } + + } + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case COLON: + { + TNode tmp194_AST_in = (TNode)_t; + match(_t,COLON); + _t = _t.getNextSibling(); + stringConst(_t); + _t = _retTree; + { + _loop186: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==COMMA)) { + TNode tmp195_AST_in = (TNode)_t; + match(_t,COMMA); + _t = _t.getNextSibling(); + stringConst(_t); + _t = _retTree; + } + else { + break _loop186; + } + + } while (true); + } + break; + } + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + TNode tmp196_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + _t = __t174; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + protected final void stringConst(AST _t) throws RecognitionException { + + TNode stringConst_AST_in = (TNode)_t; + + try { // for error handling + AST __t277 = _t; + TNode tmp197_AST_in = (TNode)_t; + match(_t,NStringSeq); + _t = _t.getFirstChild(); + { + int _cnt279=0; + _loop279: + do { + if (_t==null) _t=ASTNULL; + if ((_t.getType()==StringLiteral)) { + TNode tmp198_AST_in = (TNode)_t; + match(_t,StringLiteral); + _t = _t.getNextSibling(); + } + else { + if ( _cnt279>=1 ) { break _loop279; } else {throw new NoViableAltException(_t);} + } + + _cnt279++; + } while (true); + } + _t = __t277; + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void strOptExprPair(AST _t) throws RecognitionException { + + TNode strOptExprPair_AST_in = (TNode)_t; + + try { // for error handling + stringConst(_t); + _t = _retTree; + { + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case LPAREN: + { + TNode tmp199_AST_in = (TNode)_t; + match(_t,LPAREN); + _t = _t.getNextSibling(); + expr(_t); + _t = _retTree; + TNode tmp200_AST_in = (TNode)_t; + match(_t,RPAREN); + _t = _t.getNextSibling(); + break; + } + case COMMA: + case COLON: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void unaryOperator(AST _t) throws RecognitionException { + + TNode unaryOperator_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case BAND: + { + TNode tmp201_AST_in = (TNode)_t; + match(_t,BAND); + _t = _t.getNextSibling(); + break; + } + case STAR: + { + TNode tmp202_AST_in = (TNode)_t; + match(_t,STAR); + _t = _t.getNextSibling(); + break; + } + case PLUS: + { + TNode tmp203_AST_in = (TNode)_t; + match(_t,PLUS); + _t = _t.getNextSibling(); + break; + } + case MINUS: + { + TNode tmp204_AST_in = (TNode)_t; + match(_t,MINUS); + _t = _t.getNextSibling(); + break; + } + case BNOT: + { + TNode tmp205_AST_in = (TNode)_t; + match(_t,BNOT); + _t = _t.getNextSibling(); + break; + } + case LNOT: + { + TNode tmp206_AST_in = (TNode)_t; + match(_t,LNOT); + _t = _t.getNextSibling(); + break; + } + case LAND: + { + TNode tmp207_AST_in = (TNode)_t; + match(_t,LAND); + _t = _t.getNextSibling(); + break; + } + case LITERAL___real: + { + TNode tmp208_AST_in = (TNode)_t; + match(_t,LITERAL___real); + _t = _t.getNextSibling(); + break; + } + case LITERAL___imag: + { + TNode tmp209_AST_in = (TNode)_t; + match(_t,LITERAL___imag); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + public final void argExprList(AST _t) throws RecognitionException { + + TNode argExprList_AST_in = (TNode)_t; + + try { // for error handling + { + int _cnt274=0; + _loop274: + do { + if (_t==null) _t=ASTNULL; + if ((_tokenSet_3.member(_t.getType()))) { + expr(_t); + _t = _retTree; + } + else { + if ( _cnt274>=1 ) { break _loop274; } else {throw new NoViableAltException(_t);} + } + + _cnt274++; + } while (true); + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + protected final void charConst(AST _t) throws RecognitionException { + + TNode charConst_AST_in = (TNode)_t; + + try { // for error handling + TNode tmp210_AST_in = (TNode)_t; + match(_t,CharLiteral); + _t = _t.getNextSibling(); + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + protected final void intConst(AST _t) throws RecognitionException { + + TNode intConst_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case IntOctalConst: + { + TNode tmp211_AST_in = (TNode)_t; + match(_t,IntOctalConst); + _t = _t.getNextSibling(); + break; + } + case LongOctalConst: + { + TNode tmp212_AST_in = (TNode)_t; + match(_t,LongOctalConst); + _t = _t.getNextSibling(); + break; + } + case UnsignedOctalConst: + { + TNode tmp213_AST_in = (TNode)_t; + match(_t,UnsignedOctalConst); + _t = _t.getNextSibling(); + break; + } + case IntIntConst: + { + TNode tmp214_AST_in = (TNode)_t; + match(_t,IntIntConst); + _t = _t.getNextSibling(); + break; + } + case LongIntConst: + { + TNode tmp215_AST_in = (TNode)_t; + match(_t,LongIntConst); + _t = _t.getNextSibling(); + break; + } + case UnsignedIntConst: + { + TNode tmp216_AST_in = (TNode)_t; + match(_t,UnsignedIntConst); + _t = _t.getNextSibling(); + break; + } + case IntHexConst: + { + TNode tmp217_AST_in = (TNode)_t; + match(_t,IntHexConst); + _t = _t.getNextSibling(); + break; + } + case LongHexConst: + { + TNode tmp218_AST_in = (TNode)_t; + match(_t,LongHexConst); + _t = _t.getNextSibling(); + break; + } + case UnsignedHexConst: + { + TNode tmp219_AST_in = (TNode)_t; + match(_t,UnsignedHexConst); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + protected final void floatConst(AST _t) throws RecognitionException { + + TNode floatConst_AST_in = (TNode)_t; + + try { // for error handling + if (_t==null) _t=ASTNULL; + switch ( _t.getType()) { + case FloatDoubleConst: + { + TNode tmp220_AST_in = (TNode)_t; + match(_t,FloatDoubleConst); + _t = _t.getNextSibling(); + break; + } + case DoubleDoubleConst: + { + TNode tmp221_AST_in = (TNode)_t; + match(_t,DoubleDoubleConst); + _t = _t.getNextSibling(); + break; + } + case LongDoubleConst: + { + TNode tmp222_AST_in = (TNode)_t; + match(_t,LongDoubleConst); + _t = _t.getNextSibling(); + break; + } + default: + { + throw new NoViableAltException(_t); + } + } + } + catch (RecognitionException ex) { + if (inputState.guessing==0) { + reportError(ex); + if (_t!=null) {_t = _t.getNextSibling();} + } else { + throw ex; + } + } + _retTree = _t; + } + + + public static final String[] _tokenNames = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "\"typedef\"", + "\"asm\"", + "\"volatile\"", + "LCURLY", + "RCURLY", + "SEMI", + "\"struct\"", + "\"union\"", + "\"enum\"", + "\"auto\"", + "\"register\"", + "\"extern\"", + "\"static\"", + "\"const\"", + "\"void\"", + "\"char\"", + "\"short\"", + "\"int\"", + "\"long\"", + "\"float\"", + "\"double\"", + "\"signed\"", + "\"unsigned\"", + "ID", + "COMMA", + "COLON", + "ASSIGN", + "STAR", + "LPAREN", + "RPAREN", + "LBRACKET", + "RBRACKET", + "VARARGS", + "\"while\"", + "\"do\"", + "\"for\"", + "\"goto\"", + "\"continue\"", + "\"break\"", + "\"return\"", + "\"case\"", + "\"default\"", + "\"if\"", + "\"else\"", + "\"switch\"", + "DIV_ASSIGN", + "PLUS_ASSIGN", + "MINUS_ASSIGN", + "STAR_ASSIGN", + "MOD_ASSIGN", + "RSHIFT_ASSIGN", + "LSHIFT_ASSIGN", + "BAND_ASSIGN", + "BOR_ASSIGN", + "BXOR_ASSIGN", + "QUESTION", + "LOR", + "LAND", + "BOR", + "BXOR", + "BAND", + "EQUAL", + "NOT_EQUAL", + "LT", + "LTE", + "GT", + "GTE", + "LSHIFT", + "RSHIFT", + "PLUS", + "MINUS", + "DIV", + "MOD", + "INC", + "DEC", + "\"sizeof\"", + "BNOT", + "LNOT", + "PTR", + "DOT", + "CharLiteral", + "StringLiteral", + "IntOctalConst", + "LongOctalConst", + "UnsignedOctalConst", + "IntIntConst", + "LongIntConst", + "UnsignedIntConst", + "IntHexConst", + "LongHexConst", + "UnsignedHexConst", + "FloatDoubleConst", + "DoubleDoubleConst", + "LongDoubleConst", + "NTypedefName", + "NInitDecl", + "NDeclarator", + "NStructDeclarator", + "NDeclaration", + "NCast", + "NPointerGroup", + "NExpressionGroup", + "NFunctionCallArgs", + "NNonemptyAbstractDeclarator", + "NInitializer", + "NStatementExpr", + "NEmptyExpression", + "NParameterTypeList", + "NFunctionDef", + "NCompoundStatement", + "NParameterDeclaration", + "NCommaExpr", + "NUnaryExpr", + "NLabel", + "NPostfixExpr", + "NRangeExpr", + "NStringSeq", + "NInitializerElementLabel", + "NLcurlyInitializer", + "NAsmAttribute", + "NGnuAsmExpr", + "NTypeMissing", + "Vocabulary", + "Whitespace", + "Comment", + "CPPComment", + "a line directive", + "Space", + "LineDirective", + "BadStringLiteral", + "Escape", + "Digit", + "LongSuffix", + "UnsignedSuffix", + "FloatSuffix", + "Exponent", + "Number", + "\"__label__\"", + "\"inline\"", + "\"byte\"", + "\"boolean\"", + "\"Servo\"", + "\"Wire\"", + "\"typeof\"", + "\"__complex\"", + "\"__attribute\"", + "\"__alignof\"", + "\"__real\"", + "\"__imag\"" + }; + + private static final long[] mk_tokenSet_0() { + long[] data = { 544L, 2306124759068311552L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); + private static final long[] mk_tokenSet_1() { + long[] data = { 134093888L, 17179869184L, 2064384L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); + private static final long[] mk_tokenSet_2() { + long[] data = { 422075026113024L, 9605333580251136L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); + private static final long[] mk_tokenSet_3() { + long[] data = { -562942303010816L, 1574098779476393983L, 4198400L, 0L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); + } + diff --git a/app/preproc/WTreeParserTokenTypes.java b/app/preproc/WTreeParserTokenTypes.java index 28d3e16a3..28cb8f164 100644 --- a/app/preproc/WTreeParserTokenTypes.java +++ b/app/preproc/WTreeParserTokenTypes.java @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "WTreeParser.g" -> "WTreeParser.java"$ +// $ANTLR 2.7.2: "WTreeParser.g" -> "WTreeParser.java"$ package processing.app.preproc; @@ -6,157 +6,157 @@ import java.io.*; import antlr.CommonAST; import antlr.DumpASTVisitor; - -public interface WTreeParserTokenTypes { - int EOF = 1; - int NULL_TREE_LOOKAHEAD = 3; - int LITERAL_typedef = 4; - int LITERAL_asm = 5; - int LITERAL_volatile = 6; - int LCURLY = 7; - int RCURLY = 8; - int SEMI = 9; - int LITERAL_struct = 10; - int LITERAL_union = 11; - int LITERAL_enum = 12; - int LITERAL_auto = 13; - int LITERAL_register = 14; - int LITERAL_extern = 15; - int LITERAL_static = 16; - int LITERAL_const = 17; - int LITERAL_void = 18; - int LITERAL_char = 19; - int LITERAL_short = 20; - int LITERAL_int = 21; - int LITERAL_long = 22; - int LITERAL_float = 23; - int LITERAL_double = 24; - int LITERAL_signed = 25; - int LITERAL_unsigned = 26; - int ID = 27; - int COMMA = 28; - int COLON = 29; - int ASSIGN = 30; - int STAR = 31; - int LPAREN = 32; - int RPAREN = 33; - int LBRACKET = 34; - int RBRACKET = 35; - int VARARGS = 36; - int LITERAL_while = 37; - int LITERAL_do = 38; - int LITERAL_for = 39; - int LITERAL_goto = 40; - int LITERAL_continue = 41; - int LITERAL_break = 42; - int LITERAL_return = 43; - int LITERAL_case = 44; - int LITERAL_default = 45; - int LITERAL_if = 46; - int LITERAL_else = 47; - int LITERAL_switch = 48; - int DIV_ASSIGN = 49; - int PLUS_ASSIGN = 50; - int MINUS_ASSIGN = 51; - int STAR_ASSIGN = 52; - int MOD_ASSIGN = 53; - int RSHIFT_ASSIGN = 54; - int LSHIFT_ASSIGN = 55; - int BAND_ASSIGN = 56; - int BOR_ASSIGN = 57; - int BXOR_ASSIGN = 58; - int QUESTION = 59; - int LOR = 60; - int LAND = 61; - int BOR = 62; - int BXOR = 63; - int BAND = 64; - int EQUAL = 65; - int NOT_EQUAL = 66; - int LT = 67; - int LTE = 68; - int GT = 69; - int GTE = 70; - int LSHIFT = 71; - int RSHIFT = 72; - int PLUS = 73; - int MINUS = 74; - int DIV = 75; - int MOD = 76; - int INC = 77; - int DEC = 78; - int LITERAL_sizeof = 79; - int BNOT = 80; - int LNOT = 81; - int PTR = 82; - int DOT = 83; - int CharLiteral = 84; - int StringLiteral = 85; - int IntOctalConst = 86; - int LongOctalConst = 87; - int UnsignedOctalConst = 88; - int IntIntConst = 89; - int LongIntConst = 90; - int UnsignedIntConst = 91; - int IntHexConst = 92; - int LongHexConst = 93; - int UnsignedHexConst = 94; - int FloatDoubleConst = 95; - int DoubleDoubleConst = 96; - int LongDoubleConst = 97; - int NTypedefName = 98; - int NInitDecl = 99; - int NDeclarator = 100; - int NStructDeclarator = 101; - int NDeclaration = 102; - int NCast = 103; - int NPointerGroup = 104; - int NExpressionGroup = 105; - int NFunctionCallArgs = 106; - int NNonemptyAbstractDeclarator = 107; - int NInitializer = 108; - int NStatementExpr = 109; - int NEmptyExpression = 110; - int NParameterTypeList = 111; - int NFunctionDef = 112; - int NCompoundStatement = 113; - int NParameterDeclaration = 114; - int NCommaExpr = 115; - int NUnaryExpr = 116; - int NLabel = 117; - int NPostfixExpr = 118; - int NRangeExpr = 119; - int NStringSeq = 120; - int NInitializerElementLabel = 121; - int NLcurlyInitializer = 122; - int NAsmAttribute = 123; - int NGnuAsmExpr = 124; - int NTypeMissing = 125; - int Vocabulary = 126; - int Whitespace = 127; - int Comment = 128; - int CPPComment = 129; - int PREPROC_DIRECTIVE = 130; - int Space = 131; - int LineDirective = 132; - int BadStringLiteral = 133; - int Escape = 134; - int Digit = 135; - int LongSuffix = 136; - int UnsignedSuffix = 137; - int FloatSuffix = 138; - int Exponent = 139; - int Number = 140; - int LITERAL___label__ = 141; - int LITERAL_inline = 142; - int LITERAL_byte = 143; - int LITERAL_boolean = 144; - int LITERAL_Servo = 145; - int LITERAL_Wire = 146; - int LITERAL_typeof = 147; - int LITERAL___complex = 148; - int LITERAL___attribute = 149; - int LITERAL___alignof = 150; - int LITERAL___real = 151; - int LITERAL___imag = 152; -} + +public interface WTreeParserTokenTypes { + int EOF = 1; + int NULL_TREE_LOOKAHEAD = 3; + int LITERAL_typedef = 4; + int LITERAL_asm = 5; + int LITERAL_volatile = 6; + int LCURLY = 7; + int RCURLY = 8; + int SEMI = 9; + int LITERAL_struct = 10; + int LITERAL_union = 11; + int LITERAL_enum = 12; + int LITERAL_auto = 13; + int LITERAL_register = 14; + int LITERAL_extern = 15; + int LITERAL_static = 16; + int LITERAL_const = 17; + int LITERAL_void = 18; + int LITERAL_char = 19; + int LITERAL_short = 20; + int LITERAL_int = 21; + int LITERAL_long = 22; + int LITERAL_float = 23; + int LITERAL_double = 24; + int LITERAL_signed = 25; + int LITERAL_unsigned = 26; + int ID = 27; + int COMMA = 28; + int COLON = 29; + int ASSIGN = 30; + int STAR = 31; + int LPAREN = 32; + int RPAREN = 33; + int LBRACKET = 34; + int RBRACKET = 35; + int VARARGS = 36; + int LITERAL_while = 37; + int LITERAL_do = 38; + int LITERAL_for = 39; + int LITERAL_goto = 40; + int LITERAL_continue = 41; + int LITERAL_break = 42; + int LITERAL_return = 43; + int LITERAL_case = 44; + int LITERAL_default = 45; + int LITERAL_if = 46; + int LITERAL_else = 47; + int LITERAL_switch = 48; + int DIV_ASSIGN = 49; + int PLUS_ASSIGN = 50; + int MINUS_ASSIGN = 51; + int STAR_ASSIGN = 52; + int MOD_ASSIGN = 53; + int RSHIFT_ASSIGN = 54; + int LSHIFT_ASSIGN = 55; + int BAND_ASSIGN = 56; + int BOR_ASSIGN = 57; + int BXOR_ASSIGN = 58; + int QUESTION = 59; + int LOR = 60; + int LAND = 61; + int BOR = 62; + int BXOR = 63; + int BAND = 64; + int EQUAL = 65; + int NOT_EQUAL = 66; + int LT = 67; + int LTE = 68; + int GT = 69; + int GTE = 70; + int LSHIFT = 71; + int RSHIFT = 72; + int PLUS = 73; + int MINUS = 74; + int DIV = 75; + int MOD = 76; + int INC = 77; + int DEC = 78; + int LITERAL_sizeof = 79; + int BNOT = 80; + int LNOT = 81; + int PTR = 82; + int DOT = 83; + int CharLiteral = 84; + int StringLiteral = 85; + int IntOctalConst = 86; + int LongOctalConst = 87; + int UnsignedOctalConst = 88; + int IntIntConst = 89; + int LongIntConst = 90; + int UnsignedIntConst = 91; + int IntHexConst = 92; + int LongHexConst = 93; + int UnsignedHexConst = 94; + int FloatDoubleConst = 95; + int DoubleDoubleConst = 96; + int LongDoubleConst = 97; + int NTypedefName = 98; + int NInitDecl = 99; + int NDeclarator = 100; + int NStructDeclarator = 101; + int NDeclaration = 102; + int NCast = 103; + int NPointerGroup = 104; + int NExpressionGroup = 105; + int NFunctionCallArgs = 106; + int NNonemptyAbstractDeclarator = 107; + int NInitializer = 108; + int NStatementExpr = 109; + int NEmptyExpression = 110; + int NParameterTypeList = 111; + int NFunctionDef = 112; + int NCompoundStatement = 113; + int NParameterDeclaration = 114; + int NCommaExpr = 115; + int NUnaryExpr = 116; + int NLabel = 117; + int NPostfixExpr = 118; + int NRangeExpr = 119; + int NStringSeq = 120; + int NInitializerElementLabel = 121; + int NLcurlyInitializer = 122; + int NAsmAttribute = 123; + int NGnuAsmExpr = 124; + int NTypeMissing = 125; + int Vocabulary = 126; + int Whitespace = 127; + int Comment = 128; + int CPPComment = 129; + int PREPROC_DIRECTIVE = 130; + int Space = 131; + int LineDirective = 132; + int BadStringLiteral = 133; + int Escape = 134; + int Digit = 135; + int LongSuffix = 136; + int UnsignedSuffix = 137; + int FloatSuffix = 138; + int Exponent = 139; + int Number = 140; + int LITERAL___label__ = 141; + int LITERAL_inline = 142; + int LITERAL_byte = 143; + int LITERAL_boolean = 144; + int LITERAL_Servo = 145; + int LITERAL_Wire = 146; + int LITERAL_typeof = 147; + int LITERAL___complex = 148; + int LITERAL___attribute = 149; + int LITERAL___alignof = 150; + int LITERAL___real = 151; + int LITERAL___imag = 152; +} diff --git a/app/preproc/WTreeParserTokenTypes.txt b/app/preproc/WTreeParserTokenTypes.txt index 56e723886..e4c9dee2e 100644 --- a/app/preproc/WTreeParserTokenTypes.txt +++ b/app/preproc/WTreeParserTokenTypes.txt @@ -1,151 +1,151 @@ -// $ANTLR 2.7.2: WTreeParser.g -> WTreeParserTokenTypes.txt$ -WTreeParser // output token vocab name -LITERAL_typedef="typedef"=4 -LITERAL_asm="asm"=5 -LITERAL_volatile="volatile"=6 -LCURLY=7 -RCURLY=8 -SEMI=9 -LITERAL_struct="struct"=10 -LITERAL_union="union"=11 -LITERAL_enum="enum"=12 -LITERAL_auto="auto"=13 -LITERAL_register="register"=14 -LITERAL_extern="extern"=15 -LITERAL_static="static"=16 -LITERAL_const="const"=17 -LITERAL_void="void"=18 -LITERAL_char="char"=19 -LITERAL_short="short"=20 -LITERAL_int="int"=21 -LITERAL_long="long"=22 -LITERAL_float="float"=23 -LITERAL_double="double"=24 -LITERAL_signed="signed"=25 -LITERAL_unsigned="unsigned"=26 -ID=27 -COMMA=28 -COLON=29 -ASSIGN=30 -STAR=31 -LPAREN=32 -RPAREN=33 -LBRACKET=34 -RBRACKET=35 -VARARGS=36 -LITERAL_while="while"=37 -LITERAL_do="do"=38 -LITERAL_for="for"=39 -LITERAL_goto="goto"=40 -LITERAL_continue="continue"=41 -LITERAL_break="break"=42 -LITERAL_return="return"=43 -LITERAL_case="case"=44 -LITERAL_default="default"=45 -LITERAL_if="if"=46 -LITERAL_else="else"=47 -LITERAL_switch="switch"=48 -DIV_ASSIGN=49 -PLUS_ASSIGN=50 -MINUS_ASSIGN=51 -STAR_ASSIGN=52 -MOD_ASSIGN=53 -RSHIFT_ASSIGN=54 -LSHIFT_ASSIGN=55 -BAND_ASSIGN=56 -BOR_ASSIGN=57 -BXOR_ASSIGN=58 -QUESTION=59 -LOR=60 -LAND=61 -BOR=62 -BXOR=63 -BAND=64 -EQUAL=65 -NOT_EQUAL=66 -LT=67 -LTE=68 -GT=69 -GTE=70 -LSHIFT=71 -RSHIFT=72 -PLUS=73 -MINUS=74 -DIV=75 -MOD=76 -INC=77 -DEC=78 -LITERAL_sizeof="sizeof"=79 -BNOT=80 -LNOT=81 -PTR=82 -DOT=83 -CharLiteral=84 -StringLiteral=85 -IntOctalConst=86 -LongOctalConst=87 -UnsignedOctalConst=88 -IntIntConst=89 -LongIntConst=90 -UnsignedIntConst=91 -IntHexConst=92 -LongHexConst=93 -UnsignedHexConst=94 -FloatDoubleConst=95 -DoubleDoubleConst=96 -LongDoubleConst=97 -NTypedefName=98 -NInitDecl=99 -NDeclarator=100 -NStructDeclarator=101 -NDeclaration=102 -NCast=103 -NPointerGroup=104 -NExpressionGroup=105 -NFunctionCallArgs=106 -NNonemptyAbstractDeclarator=107 -NInitializer=108 -NStatementExpr=109 -NEmptyExpression=110 -NParameterTypeList=111 -NFunctionDef=112 -NCompoundStatement=113 -NParameterDeclaration=114 -NCommaExpr=115 -NUnaryExpr=116 -NLabel=117 -NPostfixExpr=118 -NRangeExpr=119 -NStringSeq=120 -NInitializerElementLabel=121 -NLcurlyInitializer=122 -NAsmAttribute=123 -NGnuAsmExpr=124 -NTypeMissing=125 -Vocabulary=126 -Whitespace=127 -Comment=128 -CPPComment=129 -PREPROC_DIRECTIVE("a line directive")=130 -Space=131 -LineDirective=132 -BadStringLiteral=133 -Escape=134 -Digit=135 -LongSuffix=136 -UnsignedSuffix=137 -FloatSuffix=138 -Exponent=139 -Number=140 -LITERAL___label__="__label__"=141 -LITERAL_inline="inline"=142 -LITERAL_byte="byte"=143 -LITERAL_boolean="boolean"=144 -LITERAL_Servo="Servo"=145 -LITERAL_Wire="Wire"=146 -LITERAL_typeof="typeof"=147 -LITERAL___complex="__complex"=148 -LITERAL___attribute="__attribute"=149 -LITERAL___alignof="__alignof"=150 -LITERAL___real="__real"=151 -LITERAL___imag="__imag"=152 +// $ANTLR 2.7.2: WTreeParser.g -> WTreeParserTokenTypes.txt$ +WTreeParser // output token vocab name +LITERAL_typedef="typedef"=4 +LITERAL_asm="asm"=5 +LITERAL_volatile="volatile"=6 +LCURLY=7 +RCURLY=8 +SEMI=9 +LITERAL_struct="struct"=10 +LITERAL_union="union"=11 +LITERAL_enum="enum"=12 +LITERAL_auto="auto"=13 +LITERAL_register="register"=14 +LITERAL_extern="extern"=15 +LITERAL_static="static"=16 +LITERAL_const="const"=17 +LITERAL_void="void"=18 +LITERAL_char="char"=19 +LITERAL_short="short"=20 +LITERAL_int="int"=21 +LITERAL_long="long"=22 +LITERAL_float="float"=23 +LITERAL_double="double"=24 +LITERAL_signed="signed"=25 +LITERAL_unsigned="unsigned"=26 +ID=27 +COMMA=28 +COLON=29 +ASSIGN=30 +STAR=31 +LPAREN=32 +RPAREN=33 +LBRACKET=34 +RBRACKET=35 +VARARGS=36 +LITERAL_while="while"=37 +LITERAL_do="do"=38 +LITERAL_for="for"=39 +LITERAL_goto="goto"=40 +LITERAL_continue="continue"=41 +LITERAL_break="break"=42 +LITERAL_return="return"=43 +LITERAL_case="case"=44 +LITERAL_default="default"=45 +LITERAL_if="if"=46 +LITERAL_else="else"=47 +LITERAL_switch="switch"=48 +DIV_ASSIGN=49 +PLUS_ASSIGN=50 +MINUS_ASSIGN=51 +STAR_ASSIGN=52 +MOD_ASSIGN=53 +RSHIFT_ASSIGN=54 +LSHIFT_ASSIGN=55 +BAND_ASSIGN=56 +BOR_ASSIGN=57 +BXOR_ASSIGN=58 +QUESTION=59 +LOR=60 +LAND=61 +BOR=62 +BXOR=63 +BAND=64 +EQUAL=65 +NOT_EQUAL=66 +LT=67 +LTE=68 +GT=69 +GTE=70 +LSHIFT=71 +RSHIFT=72 +PLUS=73 +MINUS=74 +DIV=75 +MOD=76 +INC=77 +DEC=78 +LITERAL_sizeof="sizeof"=79 +BNOT=80 +LNOT=81 +PTR=82 +DOT=83 +CharLiteral=84 +StringLiteral=85 +IntOctalConst=86 +LongOctalConst=87 +UnsignedOctalConst=88 +IntIntConst=89 +LongIntConst=90 +UnsignedIntConst=91 +IntHexConst=92 +LongHexConst=93 +UnsignedHexConst=94 +FloatDoubleConst=95 +DoubleDoubleConst=96 +LongDoubleConst=97 +NTypedefName=98 +NInitDecl=99 +NDeclarator=100 +NStructDeclarator=101 +NDeclaration=102 +NCast=103 +NPointerGroup=104 +NExpressionGroup=105 +NFunctionCallArgs=106 +NNonemptyAbstractDeclarator=107 +NInitializer=108 +NStatementExpr=109 +NEmptyExpression=110 +NParameterTypeList=111 +NFunctionDef=112 +NCompoundStatement=113 +NParameterDeclaration=114 +NCommaExpr=115 +NUnaryExpr=116 +NLabel=117 +NPostfixExpr=118 +NRangeExpr=119 +NStringSeq=120 +NInitializerElementLabel=121 +NLcurlyInitializer=122 +NAsmAttribute=123 +NGnuAsmExpr=124 +NTypeMissing=125 +Vocabulary=126 +Whitespace=127 +Comment=128 +CPPComment=129 +PREPROC_DIRECTIVE("a line directive")=130 +Space=131 +LineDirective=132 +BadStringLiteral=133 +Escape=134 +Digit=135 +LongSuffix=136 +UnsignedSuffix=137 +FloatSuffix=138 +Exponent=139 +Number=140 +LITERAL___label__="__label__"=141 +LITERAL_inline="inline"=142 +LITERAL_byte="byte"=143 +LITERAL_boolean="boolean"=144 +LITERAL_Servo="Servo"=145 +LITERAL_Wire="Wire"=146 +LITERAL_typeof="typeof"=147 +LITERAL___complex="__complex"=148 +LITERAL___attribute="__attribute"=149 +LITERAL___alignof="__alignof"=150 +LITERAL___real="__real"=151 +LITERAL___imag="__imag"=152 diff --git a/app/preproc/expandedWEmitter.g b/app/preproc/expandedWEmitter.g index cab90fd99..98241a915 100644 --- a/app/preproc/expandedWEmitter.g +++ b/app/preproc/expandedWEmitter.g @@ -6,17 +6,17 @@ import java.util.*; import antlr.CommonAST; import antlr.DumpASTVisitor; -} -class WEmitter extends TreeParser; - -options { - importVocab= W; - buildAST= false; - ASTLabelType= "TNode"; - codeGenMakeSwitchThreshold= 2; - codeGenBitsetTestThreshold= 3; -} - +} +class WEmitter extends TreeParser; + +options { + importVocab= W; + buildAST= false; + ASTLabelType= "TNode"; + codeGenMakeSwitchThreshold= 2; + codeGenBitsetTestThreshold= 3; +} + { @@ -359,29 +359,29 @@ void commaSep( TNode t ) { -} -translationUnit -options { - defaultErrorHandler=false; -} +} +translationUnit +options { + defaultErrorHandler=false; +} :{ initializePrinting(); } ( externalList )? { finalizePrinting(); } - ; - + ; + externalList :( externalDef )+ - ; - + ; + externalDef :declaration | functionDef | asm_expr | typelessDeclaration | s:SEMI { print( s ); } - ; - + ; + typelessDeclaration :#(NTypeMissing initDeclList s: SEMI) { print( s ); } - ; - + ; + asm_expr :#( a:"asm" { print( a ); } ( v:"volatile" { print( v ); } )? @@ -390,8 +390,8 @@ asm_expr :#( a:"asm" { print( a ); } rc:RCURLY { tabs--; print( rc ); } s:SEMI { print( s ); } ) - ; - + ; + declaration :#( NDeclaration declSpecifiers ( @@ -399,29 +399,29 @@ declaration :#( NDeclaration )? ( s:SEMI { print( s ); } )+ ) - ; - + ; + declSpecifiers :( storageClassSpecifier | typeQualifier | typeSpecifier )+ - ; - + ; + storageClassSpecifier :a:"auto" { print( a ); } | b:"register" { print( b ); } | c:"typedef" { print( c ); } | functionStorageClassSpecifier - ; - + ; + functionStorageClassSpecifier :a:"extern" { print( a ); } | b:"static" { print( b ); } | c:"inline" { print( c ); } - ; - + ; + typeQualifier :a:"const" { print( a ); } | b:"volatile" { print( b ); } - ; - + ; + typeSpecifier :a:"void" { print( a ); } | b:"char" { print( b ); } | c:"short" { print( c ); } @@ -446,21 +446,21 @@ typeSpecifier :a:"void" { print( a ); } rp:RPAREN { print( rp ); } ) | p:"__complex" { print( p ); } - ; - + ; + typedefName :#(NTypedefName i:ID { print( i ); } ) - ; - + ; + structSpecifier :#( a:"struct" { print( a ); } structOrUnionBody ) - ; - + ; + unionSpecifier :#( a:"union" { print( a ); } structOrUnionBody ) - ; - + ; + structOrUnionBody :( (ID LCURLY) => i1:ID lc1:LCURLY { print( i1 ); print ( "{" ); tabs++; } ( structDeclarationList )? rc1:RCURLY { tabs--; print( rc1 ); } @@ -469,32 +469,32 @@ structOrUnionBody :( (ID LCURLY) => i1:ID lc1:LCURLY { print( i1 ); print ( "{ rc2:RCURLY { tabs--; print( rc2 ); } | i2:ID { print( i2 ); } ) - ; - + ; + structDeclarationList :( structDeclaration { print( ";" ); } )+ - ; - + ; + structDeclaration :specifierQualifierList structDeclaratorList - ; - + ; + specifierQualifierList :( typeSpecifier | typeQualifier )+ - ; - + ; + structDeclaratorList :structDeclarator ( { print(","); } structDeclarator )* - ; - + ; + structDeclarator :#( NStructDeclarator ( declarator )? ( c:COLON { print( c ); } expr )? ( attributeDecl )* ) - ; - + ; + enumSpecifier :#( a:"enum" { print( a ); } ( i:ID { print( i ); } )? ( lc:LCURLY { print( lc ); tabs++; } @@ -502,17 +502,17 @@ enumSpecifier :#( a:"enum" { print( a ); } rc:RCURLY { tabs--; print( rc ); } )? ) - ; - + ; + enumList :enumerator ( {print(",");} enumerator)* - ; - + ; + enumerator :i:ID { print( i ); } ( b:ASSIGN { print( b ); } expr )? - ; - + ; + attributeDecl :#( a:"__attribute" { print( a ); } (b:. { print( b ); } )* ) @@ -521,13 +521,13 @@ attributeDecl :#( a:"__attribute" { print( a ); } expr { print( ")" ); } rp:RPAREN { print( rp ); } ) - ; - + ; + initDeclList :initDecl ( { print( "," ); } initDecl )* - ; - -initDecl { String declName = ""; } + ; + +initDecl { String declName = ""; } :#(NInitDecl declarator ( attributeDecl )* @@ -537,25 +537,25 @@ initDecl { String declName = ""; } expr )? ) - ; - + ; + pointerGroup :#( NPointerGroup ( a:STAR { print( a ); } ( typeQualifier )* )+ ) - ; - + ; + idList :i:ID { print( i ); } ( c:COMMA { print( c ); } id:ID { print( id ); } )* - ; - + ; + initializer :#( NInitializer (initializerElementLabel)? expr ) | lcurlyInitializer - ; - + ; + initializerElementLabel :#( NInitializerElementLabel ( ( l:LBRACKET { print( l ); } @@ -567,18 +567,18 @@ initializerElementLabel :#( NInitializerElementLabel | d:DOT i2:ID a2:ASSIGN { print( d ); print( i2 ); print( a2 ); } ) ) - ; - + ; + lcurlyInitializer :#(n:NLcurlyInitializer { print( n ); tabs++; } initializerList rc:RCURLY { tabs--; print( rc ); } ) - ; - + ; + initializerList :( i:initializer { commaSep( i ); } )* - ; - + ; + declarator :#( NDeclarator ( pointerGroup )? @@ -596,22 +596,22 @@ declarator :#( NDeclarator | lb:LBRACKET { print( lb );} ( expr )? rb:RBRACKET { print( rb ); } )* ) - ; - + ; + parameterTypeList :( parameterDeclaration ( c:COMMA { print( c ); } | s:SEMI { print( s ); } )? )+ ( v:VARARGS { print( v ); } )? - ; - + ; + parameterDeclaration :#( NParameterDeclaration declSpecifiers (declarator | nonemptyAbstractDeclarator)? ) - ; - + ; + functionDef :#( NFunctionDef ( functionDeclSpecifiers)? declarator @@ -620,14 +620,14 @@ functionDef :#( NFunctionDef )* compoundStatement ) - ; - + ; + functionDeclSpecifiers :( functionStorageClassSpecifier | typeQualifier | typeSpecifier )+ - ; - + ; + declarationList :( //ANTLR doesn't know that declarationList properly eats all the declarations //so it warns about the ambiguity options { @@ -636,15 +636,15 @@ declarationList :( //ANTLR doesn't know that declarationList properly eats all localLabelDecl | declaration )+ - ; - + ; + localLabelDecl :#(a:"__label__" { print( a ); } ( i:ID { commaSep( i ); } )+ { print( ";" ); } ) - ; - + ; + compoundStatement :#( cs:NCompoundStatement { print( cs ); tabs++; } ( declarationList | functionDef @@ -653,14 +653,14 @@ compoundStatement :#( cs:NCompoundStatement { print( cs ); tabs++ rc:RCURLY { tabs--; print( rc ); } ) - ; - + ; + statementList :( statement )+ - ; - + ; + statement :statementBody - ; - + ; + statementBody :s:SEMI { print( s ); } | compoundStatement // Group of statements @@ -738,8 +738,8 @@ statementBody :s:SEMI { print( s ); } - ; - + ; + expr :binaryExpr | conditionalExpr | castExpr @@ -751,20 +751,20 @@ expr :binaryExpr | initializer | rangeExpr | gnuAsmExpr - ; - + ; + emptyExpr :NEmptyExpression - ; - + ; + compoundStatementExpr :#(l:LPAREN { print( l ); } compoundStatement r:RPAREN { print( r ); } ) - ; - + ; + rangeExpr :#(NRangeExpr expr v:VARARGS{ print( v ); } expr) - ; - + ; + gnuAsmExpr :#(n:NGnuAsmExpr { print( n ); } (v:"volatile" { print( v ); } )? lp:LPAREN { print( lp ); } @@ -789,16 +789,16 @@ gnuAsmExpr :#(n:NGnuAsmExpr { print( n ); } )? rp:RPAREN { print( rp ); } ) - ; - + ; + strOptExprPair :stringConst ( l:LPAREN { print( l ); } expr r:RPAREN { print( r ); } )? - ; - + ; + binaryOperator :ASSIGN | DIV_ASSIGN | PLUS_ASSIGN @@ -829,8 +829,8 @@ binaryOperator :ASSIGN | DIV | MOD | NCommaExpr - ; - + ; + binaryExpr :b:binaryOperator // no rules allowed as roots, so here I manually get // the first and second children of the binary operator @@ -843,27 +843,27 @@ binaryExpr :b:binaryOperator expr( e2 ); } - ; - + ; + conditionalExpr :#( q:QUESTION expr { print( q ); } ( expr )? c:COLON { print( c ); } expr ) - ; - + ; + castExpr :#( c:NCast { print( c ); } typeName rp:RPAREN { print( rp ); } expr ) - ; - + ; + typeName :specifierQualifierList (nonemptyAbstractDeclarator)? - ; - + ; + nonemptyAbstractDeclarator :#( NNonemptyAbstractDeclarator ( pointerGroup ( (lp1:LPAREN { print( lp1 ); } @@ -893,8 +893,8 @@ nonemptyAbstractDeclarator :#( NNonemptyAbstractDeclarator )+ ) ) - ; - + ; + unaryExpr :#( i:INC { print( i ); } expr ) | #( d:DEC { print( d ); } expr ) | #( NUnaryExpr u:unaryOperator { print( u ); } expr) @@ -914,8 +914,8 @@ unaryExpr :#( i:INC { print( i ); } expr ) | expr ) ) - ; - + ; + unaryOperator :BAND | STAR | PLUS @@ -925,8 +925,8 @@ unaryOperator :BAND | LAND | "__real" | "__imag" - ; - + ; + postfixExpr :#( NPostfixExpr primaryExpr ( a:PTR b:ID { print( a ); print( b ); } @@ -942,8 +942,8 @@ postfixExpr :#( NPostfixExpr | g:DEC { print( g ); } )+ ) - ; - + ; + primaryExpr :i:ID { print( i ); } | n:Number { print( n ); } | charConst @@ -957,21 +957,21 @@ primaryExpr :i:ID { print( i ); } | #( eg:NExpressionGroup { print( eg ); } expr { print( ")" ); } ) - ; - + ; + argExprList :expr ( {print( "," );} expr )* - ; - + ; + protected charConst :c:CharLiteral { print( c ); } - ; - + ; + protected stringConst :#( NStringSeq ( s:StringLiteral { print( s ); } )+ ) - ; - + ; + protected intConst :IntOctalConst | LongOctalConst | UnsignedOctalConst @@ -981,18 +981,18 @@ protected intConst :IntOctalConst | IntHexConst | LongHexConst | UnsignedHexConst - ; - + ; + protected floatConst :FloatDoubleConst | DoubleDoubleConst | LongDoubleConst - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser commaExpr :#(NCommaExpr expr expr) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser assignExpr :#( ASSIGN expr expr) | #( DIV_ASSIGN expr expr) | #( PLUS_ASSIGN expr expr) @@ -1004,54 +1004,54 @@ assignExpr :#( ASSIGN expr expr) | #( BAND_ASSIGN expr expr) | #( BOR_ASSIGN expr expr) | #( BXOR_ASSIGN expr expr) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser logicalOrExpr :#( LOR expr expr) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser logicalAndExpr :#( LAND expr expr ) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser inclusiveOrExpr :#( BOR expr expr ) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser exclusiveOrExpr :#( BXOR expr expr ) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser bitAndExpr :#( BAND expr expr ) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser equalityExpr :#( EQUAL expr expr) | #( NOT_EQUAL expr expr) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser relationalExpr :#( LT expr expr) | #( LTE expr expr) | #( GT expr expr) | #( GTE expr expr) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser shiftExpr :#( LSHIFT expr expr) | #( RSHIFT expr expr) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser additiveExpr :#( PLUS expr expr) | #( MINUS expr expr) - ; - -// inherited from grammar WTreeParser + ; + +// inherited from grammar WTreeParser multExpr :#( STAR expr expr) | #( DIV expr expr) | #( MOD expr expr) - ; - - + ; + + diff --git a/app/preproc/expandedWParser.g b/app/preproc/expandedWParser.g index 94a8dc7df..b23ba3a57 100644 --- a/app/preproc/expandedWParser.g +++ b/app/preproc/expandedWParser.g @@ -5,20 +5,20 @@ import java.io.*; import antlr.CommonAST; import antlr.DumpASTVisitor; -} -class WParser extends Parser; - -options { - k= 2; - exportVocab= W; - buildAST= true; - ASTLabelType= "TNode"; - defaultErrorHandler= false; - codeGenMakeSwitchThreshold= 2; - codeGenBitsetTestThreshold= 3; - importVocab=STDC; -} - +} +class WParser extends Parser; + +options { + k= 2; + exportVocab= W; + buildAST= true; + ASTLabelType= "TNode"; + defaultErrorHandler= false; + codeGenMakeSwitchThreshold= 2; + codeGenBitsetTestThreshold= 3; + importVocab=STDC; +} + { // Suppport C++-style single-line comments? public static boolean CPPComments = true; @@ -125,59 +125,59 @@ options { traceDepth -= 1; } -} +} translationUnit :( externalList )? /* Empty source files are allowed. */ - ; - + ; + asm_expr :"asm"^ ("volatile")? LCURLY expr RCURLY ( SEMI )+ - ; - + ; + idList :ID ( options{warnWhenFollowAmbig=false;}: COMMA ID )* - ; - + ; + externalDef :( "typedef" | declaration )=> declaration | ( functionPrefix )=> functionDef | typelessDeclaration | asm_expr | SEMI - ; - -functionPrefix { String declName; } + ; + +functionPrefix { String declName; } :( (functionDeclSpecifiers)=> ds:functionDeclSpecifiers | //epsilon ) declName = d:declarator[true] ( declaration )* (VARARGS)? ( SEMI )* LCURLY - ; - -typelessDeclaration { AST typeMissing = #[NTypeMissing]; } + ; + +typelessDeclaration { AST typeMissing = #[NTypeMissing]; } :initDeclList[typeMissing] SEMI { ## = #( #[NTypeMissing], ##); } - ; - + ; + initializer :( ( ( (initializerElementLabel)=> initializerElementLabel )? ( assignExpr | lcurlyInitializer ) { ## = #( #[NInitializer], ## ); } ) | lcurlyInitializer ) - ; - + ; + initializerElementLabel :( ( LBRACKET ((constExpr VARARGS)=> rangeExpr | constExpr) RBRACKET (ASSIGN)? ) | ID COLON | DOT ID ASSIGN ) { ## = #( #[NInitializerElementLabel], ##) ; } - ; - + ; + lcurlyInitializer :LCURLY^ (initializerList ( COMMA! )? )? RCURLY { ##.setType( NLcurlyInitializer ); } - ; - + ; + initializerList :initializer ( options{warnWhenFollowAmbig=false;}:COMMA! initializer )* - ; - -declarator[boolean isFunctionDefinition] returns [String declName]{ declName = ""; } + ; + +declarator[boolean isFunctionDefinition] returns [String declName]{ declName = ""; } :( pointerGroup )? ( id:ID { declName = id.getText(); } @@ -188,8 +188,8 @@ declarator[boolean isFunctionDefinition] returns [String declName]{ declName = " | LBRACKET ( expr )? RBRACKET )* { ## = #( #[NDeclarator], ## ); } - ; - + ; + declaratorParamaterList[boolean isFunctionDefinition, String declName] :LPAREN^ { if (isFunctionDefinition) { @@ -209,8 +209,8 @@ declaratorParamaterList[boolean isFunctionDefinition, String declName] :LPAREN^ ( COMMA! )? RPAREN { ##.setType(NParameterTypeList); } - ; - + ; + parameterTypeList :parameterDeclaration ( options { warnWhenFollowAmbig = false; @@ -221,8 +221,8 @@ parameterTypeList :parameterDeclaration ( ( COMMA | SEMI ) VARARGS )? - ; - + ; + declarationList :( options { // this loop properly aborts when // it finds a non-typedefName ID MBZ warnWhenFollowAmbig = false; @@ -231,14 +231,14 @@ declarationList :( options { // this loop properly aborts when localLabelDeclaration | ( declarationPredictor )=> declaration )+ - ; - + ; + localLabelDeclaration :( //GNU note: any __label__ declarations must come before regular declarations. "__label__"^ ID (options{warnWhenFollowAmbig=false;}: COMMA! ID)* ( COMMA! )? ( SEMI! )+ ) - ; - -declaration { AST ds1 = null; } + ; + +declaration { AST ds1 = null; } :ds:declSpecifiers { ds1 = astFactory.dupList(#ds); } ( initDeclList[ds1] @@ -246,14 +246,14 @@ declaration { AST ds1 = null; } ( SEMI )+ { ## = #( #[NDeclaration], ##); } - ; - + ; + functionStorageClassSpecifier :"extern" | "static" | "inline" - ; - -typeSpecifier[int specCount] returns [int retSpecCount]{ retSpecCount = specCount + 1; } + ; + +typeSpecifier[int specCount] returns [int retSpecCount]{ retSpecCount = specCount + 1; } :( "void" | "char" | "short" @@ -277,9 +277,9 @@ typeSpecifier[int specCount] returns [int retSpecCount]{ retSpecCount = specCoun RPAREN | "__complex" ) - ; - -structOrUnionSpecifier { String scopeName; } + ; + +structOrUnionSpecifier { String scopeName; } :sou:structOrUnion! ( ( ID LCURLY )=> i:ID l:LCURLY { @@ -304,36 +304,36 @@ structOrUnionSpecifier { String scopeName; } { ## = #( #sou, ## ); } - ; - + ; + structDeclaration :specifierQualifierList structDeclaratorList ( COMMA! )? ( SEMI! )+ - ; - + ; + structDeclaratorList :structDeclarator ( options{warnWhenFollowAmbig=false;}: COMMA! structDeclarator )* - ; - + ; + structDeclarator :( declarator[false] )? ( COLON constExpr )? ( attributeDecl )* { ## = #( #[NStructDeclarator], ##); } - ; - + ; + enumSpecifier :"enum"^ ( ( ID LCURLY )=> i:ID LCURLY enumList[i.getText()] RCURLY | LCURLY enumList["anonymous"] RCURLY | ID ) - ; - + ; + enumList[String enumName] :enumerator[enumName] ( options{warnWhenFollowAmbig=false;}: COMMA! enumerator[enumName] )* ( COMMA! )? - ; - + ; + initDeclList[AST declarationSpecifiers] :initDecl[declarationSpecifiers] ( options{warnWhenFollowAmbig=false;}: COMMA! initDecl[declarationSpecifiers] )* ( COMMA! )? - ; - -initDecl[AST declarationSpecifiers] { String declName = ""; } + ; + +initDecl[AST declarationSpecifiers] { String declName = ""; } :declName = d:declarator[false] { AST ds1, d1; ds1 = astFactory.dupList(declarationSpecifiers); @@ -345,20 +345,20 @@ initDecl[AST declarationSpecifiers] { String declName = ""; } | COLON expr )? { ## = #( #[NInitDecl], ## ); } - ; - + ; + attributeDecl :"__attribute"^ LPAREN LPAREN attributeList RPAREN RPAREN | "asm"^ LPAREN stringConst RPAREN { ##.setType( NAsmAttribute ); } - ; - + ; + attributeList :attribute ( options{warnWhenFollowAmbig=false;}: COMMA attribute)* ( COMMA )? - ; - + ; + attribute :( ~(LPAREN | RPAREN | COMMA) | LPAREN attributeList RPAREN )* - ; - + ; + compoundStatement[String scopeName] :LCURLY^ { @@ -375,9 +375,9 @@ compoundStatement[String scopeName] :LCURLY^ { popScope(); } RCURLY { ##.setType( NCompoundStatement ); ##.setAttribute( "scopeName", scopeName ); } - ; - -nestedFunctionDef { String declName; } + ; + +nestedFunctionDef { String declName; } :( "auto" )? //only for nested functions ( (functionDeclSpecifiers)=> ds:functionDeclSpecifiers )? @@ -393,8 +393,8 @@ nestedFunctionDef { String declName; } { popScope(); } compoundStatement[declName] { ## = #( #[NFunctionDef], ## );} - ; - + ; + statement :SEMI // Empty statements | compoundStatement[getAScopeName()] // Group of statements @@ -439,23 +439,23 @@ statement :SEMI // Empty statements } : "else" statement )? | "switch"^ LPAREN! expr RPAREN! statement - ; - + ; + conditionalExpr :logicalOrExpr ( QUESTION^ (expr)? COLON conditionalExpr )? - ; - + ; + rangeExpr :constExpr VARARGS constExpr { ## = #(#[NRangeExpr], ##); } - ; - + ; + castExpr :( LPAREN typeName RPAREN )=> LPAREN^ typeName RPAREN ( castExpr | lcurlyInitializer ) { ##.setType(NCast); } | unaryExpr - ; - + ; + nonemptyAbstractDeclarator :( pointerGroup ( (LPAREN @@ -478,8 +478,8 @@ nonemptyAbstractDeclarator :( ) { ## = #( #[NNonemptyAbstractDeclarator], ## ); } - ; - + ; + unaryExpr :postfixExpr | INC^ castExpr | DEC^ castExpr @@ -494,8 +494,8 @@ unaryExpr :postfixExpr | unaryExpr ) | gnuAsmExpr - ; - + ; + unaryOperator :BAND | STAR | PLUS @@ -505,8 +505,8 @@ unaryOperator :BAND | LAND //for label dereference (&&label) | "__real" | "__imag" - ; - + ; + gnuAsmExpr :"asm"^ ("volatile")? LPAREN stringConst ( options { warnWhenFollowAmbig = false; }: @@ -518,11 +518,11 @@ gnuAsmExpr :"asm"^ ("volatile")? ( COLON stringConst ( COMMA stringConst)* )? RPAREN { ##.setType(NGnuAsmExpr); } - ; - + ; + strOptExprPair :stringConst ( LPAREN expr RPAREN )? - ; - + ; + primaryExpr :ID | Number | charConst @@ -533,14 +533,14 @@ primaryExpr :ID // | enumerator | (LPAREN LCURLY) => LPAREN^ compoundStatement[getAScopeName()] RPAREN | LPAREN^ expr RPAREN { ##.setType(NExpressionGroup); } - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser externalList :( externalDef )+ - ; - -// inherited from grammar StdCParser -declSpecifiers { int specCount=0; } + ; + +// inherited from grammar StdCParser +declSpecifiers { int specCount=0; } :( options { // this loop properly aborts when // it finds a non-typedefName ID MBZ warnWhenFollowAmbig = false; @@ -550,36 +550,36 @@ declSpecifiers { int specCount=0; } | ( "struct" | "union" | "enum" | typeSpecifier[specCount] )=> specCount = typeSpecifier[specCount] )+ - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser storageClassSpecifier :"auto" | "register" | "typedef" | functionStorageClassSpecifier - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser typeQualifier :"const" | "volatile" - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser typedefName :{ isTypedefName ( LT(1).getText() ) }? i:ID { ## = #(#[NTypedefName], #i); } - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser structOrUnion :"struct" | "union" - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser structDeclarationList :( structDeclaration )+ - ; - -// inherited from grammar StdCParser -specifierQualifierList { int specCount = 0; } + ; + +// inherited from grammar StdCParser +specifierQualifierList { int specCount = 0; } :( options { // this loop properly aborts when // it finds a non-typedefName ID MBZ warnWhenFollowAmbig = false; @@ -588,9 +588,9 @@ specifierQualifierList { int specCount = 0; } specCount = typeSpecifier[specCount] | typeQualifier )+ - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser enumerator[String enumName] :i:ID { symbolTable.add( i.getText(), #( null, #[LITERAL_enum, "enum"], @@ -599,14 +599,14 @@ enumerator[String enumName] :i:ID { symbolTable.add( i.getText() ); } (ASSIGN constExpr)? - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser pointerGroup :( STAR ( typeQualifier )* )+ { ## = #( #[NPointerGroup], ##); } - ; - -// inherited from grammar StdCParser -parameterDeclaration { String declName; } + ; + +// inherited from grammar StdCParser +parameterDeclaration { String declName; } :ds:declSpecifiers ( ( declarator[false] )=> declName = d:declarator[false] { @@ -620,10 +620,10 @@ parameterDeclaration { String declName; } { ## = #( #[NParameterDeclaration], ## ); } - ; - -// inherited from grammar StdCParser -functionDef { String declName; } + ; + +// inherited from grammar StdCParser +functionDef { String declName; } :( (functionDeclSpecifiers)=> ds:functionDeclSpecifiers | //epsilon ) @@ -639,10 +639,10 @@ functionDef { String declName; } { popScope(); } compoundStatement[declName] { ## = #( #[NFunctionDef], ## );} - ; - -// inherited from grammar StdCParser -functionDeclSpecifiers { int specCount = 0; } + ; + +// inherited from grammar StdCParser +functionDeclSpecifiers { int specCount = 0; } :( options { // this loop properly aborts when // it finds a non-typedefName ID MBZ warnWhenFollowAmbig = false; @@ -652,22 +652,22 @@ functionDeclSpecifiers { int specCount = 0; } | ( "struct" | "union" | "enum" | typeSpecifier[specCount] )=> specCount = typeSpecifier[specCount] )+ - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser declarationPredictor :(options { //only want to look at declaration if I don't see typedef warnWhenFollowAmbig = false; }: "typedef" | declaration ) - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser statementList :( statement )+ - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser expr :assignExpr (options { /* MBZ: COMMA is ambiguous between comma expressions and @@ -679,13 +679,13 @@ expr :assignExpr (options { } : c:COMMA^ { #c.setType(NCommaExpr); } assignExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser assignExpr :conditionalExpr ( a:assignOperator! assignExpr { ## = #( #a, ## );} )? - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser assignOperator :ASSIGN | DIV_ASSIGN | PLUS_ASSIGN @@ -697,69 +697,69 @@ assignOperator :ASSIGN | BAND_ASSIGN | BOR_ASSIGN | BXOR_ASSIGN - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser constExpr :conditionalExpr - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser logicalOrExpr :logicalAndExpr ( LOR^ logicalAndExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser logicalAndExpr :inclusiveOrExpr ( LAND^ inclusiveOrExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser inclusiveOrExpr :exclusiveOrExpr ( BOR^ exclusiveOrExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser exclusiveOrExpr :bitAndExpr ( BXOR^ bitAndExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser bitAndExpr :equalityExpr ( BAND^ equalityExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser equalityExpr :relationalExpr ( ( EQUAL^ | NOT_EQUAL^ ) relationalExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser relationalExpr :shiftExpr ( ( LT^ | LTE^ | GT^ | GTE^ ) shiftExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser shiftExpr :additiveExpr ( ( LSHIFT^ | RSHIFT^ ) additiveExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser additiveExpr :multExpr ( ( PLUS^ | MINUS^ ) multExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser multExpr :castExpr ( ( STAR^ | DIV^ | MOD^ ) castExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser typeName :specifierQualifierList (nonemptyAbstractDeclarator)? - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser postfixExpr :primaryExpr ( postfixSuffix {## = #( #[NPostfixExpr], ## );} )? - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser postfixSuffix :( PTR ID | DOT ID | functionCall @@ -767,28 +767,28 @@ postfixSuffix :( PTR ID | INC | DEC )+ - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser functionCall :LPAREN^ (a:argExprList)? RPAREN { ##.setType( NFunctionCallArgs ); } - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser argExprList :assignExpr ( COMMA! assignExpr )* - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser protected charConst :CharLiteral - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser protected stringConst :(StringLiteral)+ { ## = #(#[NStringSeq], ##); } - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser protected intConst :IntOctalConst | LongOctalConst | UnsignedOctalConst @@ -798,15 +798,15 @@ protected intConst :IntOctalConst | IntHexConst | LongHexConst | UnsignedHexConst - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser protected floatConst :FloatDoubleConst | DoubleDoubleConst | LongDoubleConst - ; - -// inherited from grammar StdCParser + ; + +// inherited from grammar StdCParser dummy :NTypedefName | NInitDecl | NDeclarator @@ -835,21 +835,21 @@ dummy :NTypedefName | NAsmAttribute | NGnuAsmExpr | NTypeMissing - ; - + ; + { // import CToken; import java.io.*; // import LineObject; import antlr.*; -}class WLexer extends Lexer; - -options { - k= 3; - importVocab= W; - testLiterals= false; -} - +}class WLexer extends Lexer; + +options { + k= 3; + importVocab= W; + testLiterals= false; +} + tokens { LITERAL___extension__ = "__extension__"; } @@ -948,13 +948,13 @@ tokens { -} +} Whitespace :( ( ' ' | '\t' | '\014') | "\r\n" { newline(); } | ( '\n' | '\r' ) { newline(); } ) { _ttype = Token.SKIP; } - ; - + ; + protected Escape :'\\' ( options{warnWhenFollowAmbig=false;}: ~('0'..'7' | 'x') @@ -962,8 +962,8 @@ protected Escape :'\\' | ('4'..'7') ( options{warnWhenFollowAmbig=false;}: Digit )* | 'x' ( options{warnWhenFollowAmbig=false;}: Digit | 'a'..'f' | 'A'..'F' )+ ) - ; - + ; + protected IntSuffix :'L' | 'l' | 'U' @@ -972,13 +972,13 @@ protected IntSuffix :'L' | 'i' | 'J' | 'j' - ; - + ; + protected NumberSuffix :IntSuffix | 'F' | 'f' - ; - + ; + Number :( ( Digit )+ ( '.' | 'e' | 'E' ) )=> ( Digit )+ ( '.' ( Digit )* ( Exponent )? | Exponent @@ -1006,8 +1006,8 @@ Number :( ( Digit )+ ( '.' | 'e' | 'E' ) )=> ( Digit )+ | '0' ( 'x' | 'X' ) ( 'a'..'f' | 'A'..'F' | Digit )+ ( IntSuffix )* - ; - + ; + IDMEAT :i:ID { if ( i.getType() == LITERAL___extension__ ) { @@ -1018,24 +1018,24 @@ IDMEAT :i:ID { } } - ; - -protected ID -options { - testLiterals= true; -} + ; + +protected ID +options { + testLiterals= true; +} :( 'a'..'z' | 'A'..'Z' | '_' | '$') ( 'a'..'z' | 'A'..'Z' | '_' | '$' | '0'..'9' )* - ; - + ; + WideCharLiteral :'L' CharLiteral { $setType(CharLiteral); } - ; - + ; + WideStringLiteral :'L' StringLiteral { $setType(StringLiteral); } - ; - + ; + StringLiteral :'"' ( ('\\' ~('\n'))=> Escape | ( '\r' { newline(); } @@ -1049,151 +1049,151 @@ StringLiteral :'"' | ~( '"' | '\r' | '\n' | '\\' ) )* '"' - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer protected Vocabulary :'\3'..'\377' - ; - -// inherited from grammar StdCLexer -ASSIGN :'=' ; - -// inherited from grammar StdCLexer -COLON :':' ; - -// inherited from grammar StdCLexer -COMMA :',' ; - -// inherited from grammar StdCLexer -QUESTION :'?' ; - -// inherited from grammar StdCLexer -SEMI :';' ; - -// inherited from grammar StdCLexer -PTR :"->" ; - -// inherited from grammar StdCLexer -protected DOT :; - -// inherited from grammar StdCLexer -protected VARARGS :; - -// inherited from grammar StdCLexer -LPAREN :'(' ; - -// inherited from grammar StdCLexer -RPAREN :')' ; - -// inherited from grammar StdCLexer -LBRACKET :'[' ; - -// inherited from grammar StdCLexer -RBRACKET :']' ; - -// inherited from grammar StdCLexer -LCURLY :'{' ; - -// inherited from grammar StdCLexer -RCURLY :'}' ; - -// inherited from grammar StdCLexer -EQUAL :"==" ; - -// inherited from grammar StdCLexer -NOT_EQUAL :"!=" ; - -// inherited from grammar StdCLexer -LTE :"<=" ; - -// inherited from grammar StdCLexer -LT :"<" ; - -// inherited from grammar StdCLexer -GTE :">=" ; - -// inherited from grammar StdCLexer -GT :">" ; - -// inherited from grammar StdCLexer -DIV :'/' ; - -// inherited from grammar StdCLexer -DIV_ASSIGN :"/=" ; - -// inherited from grammar StdCLexer -PLUS :'+' ; - -// inherited from grammar StdCLexer -PLUS_ASSIGN :"+=" ; - -// inherited from grammar StdCLexer -INC :"++" ; - -// inherited from grammar StdCLexer -MINUS :'-' ; - -// inherited from grammar StdCLexer -MINUS_ASSIGN :"-=" ; - -// inherited from grammar StdCLexer -DEC :"--" ; - -// inherited from grammar StdCLexer -STAR :'*' ; - -// inherited from grammar StdCLexer -STAR_ASSIGN :"*=" ; - -// inherited from grammar StdCLexer -MOD :'%' ; - -// inherited from grammar StdCLexer -MOD_ASSIGN :"%=" ; - -// inherited from grammar StdCLexer -RSHIFT :">>" ; - -// inherited from grammar StdCLexer -RSHIFT_ASSIGN :">>=" ; - -// inherited from grammar StdCLexer -LSHIFT :"<<" ; - -// inherited from grammar StdCLexer -LSHIFT_ASSIGN :"<<=" ; - -// inherited from grammar StdCLexer -LAND :"&&" ; - -// inherited from grammar StdCLexer -LNOT :'!' ; - -// inherited from grammar StdCLexer -LOR :"||" ; - -// inherited from grammar StdCLexer -BAND :'&' ; - -// inherited from grammar StdCLexer -BAND_ASSIGN :"&=" ; - -// inherited from grammar StdCLexer -BNOT :'~' ; - -// inherited from grammar StdCLexer -BOR :'|' ; - -// inherited from grammar StdCLexer -BOR_ASSIGN :"|=" ; - -// inherited from grammar StdCLexer -BXOR :'^' ; - -// inherited from grammar StdCLexer -BXOR_ASSIGN :"^=" ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer +ASSIGN :'=' ; + +// inherited from grammar StdCLexer +COLON :':' ; + +// inherited from grammar StdCLexer +COMMA :',' ; + +// inherited from grammar StdCLexer +QUESTION :'?' ; + +// inherited from grammar StdCLexer +SEMI :';' ; + +// inherited from grammar StdCLexer +PTR :"->" ; + +// inherited from grammar StdCLexer +protected DOT :; + +// inherited from grammar StdCLexer +protected VARARGS :; + +// inherited from grammar StdCLexer +LPAREN :'(' ; + +// inherited from grammar StdCLexer +RPAREN :')' ; + +// inherited from grammar StdCLexer +LBRACKET :'[' ; + +// inherited from grammar StdCLexer +RBRACKET :']' ; + +// inherited from grammar StdCLexer +LCURLY :'{' ; + +// inherited from grammar StdCLexer +RCURLY :'}' ; + +// inherited from grammar StdCLexer +EQUAL :"==" ; + +// inherited from grammar StdCLexer +NOT_EQUAL :"!=" ; + +// inherited from grammar StdCLexer +LTE :"<=" ; + +// inherited from grammar StdCLexer +LT :"<" ; + +// inherited from grammar StdCLexer +GTE :">=" ; + +// inherited from grammar StdCLexer +GT :">" ; + +// inherited from grammar StdCLexer +DIV :'/' ; + +// inherited from grammar StdCLexer +DIV_ASSIGN :"/=" ; + +// inherited from grammar StdCLexer +PLUS :'+' ; + +// inherited from grammar StdCLexer +PLUS_ASSIGN :"+=" ; + +// inherited from grammar StdCLexer +INC :"++" ; + +// inherited from grammar StdCLexer +MINUS :'-' ; + +// inherited from grammar StdCLexer +MINUS_ASSIGN :"-=" ; + +// inherited from grammar StdCLexer +DEC :"--" ; + +// inherited from grammar StdCLexer +STAR :'*' ; + +// inherited from grammar StdCLexer +STAR_ASSIGN :"*=" ; + +// inherited from grammar StdCLexer +MOD :'%' ; + +// inherited from grammar StdCLexer +MOD_ASSIGN :"%=" ; + +// inherited from grammar StdCLexer +RSHIFT :">>" ; + +// inherited from grammar StdCLexer +RSHIFT_ASSIGN :">>=" ; + +// inherited from grammar StdCLexer +LSHIFT :"<<" ; + +// inherited from grammar StdCLexer +LSHIFT_ASSIGN :"<<=" ; + +// inherited from grammar StdCLexer +LAND :"&&" ; + +// inherited from grammar StdCLexer +LNOT :'!' ; + +// inherited from grammar StdCLexer +LOR :"||" ; + +// inherited from grammar StdCLexer +BAND :'&' ; + +// inherited from grammar StdCLexer +BAND_ASSIGN :"&=" ; + +// inherited from grammar StdCLexer +BNOT :'~' ; + +// inherited from grammar StdCLexer +BOR :'|' ; + +// inherited from grammar StdCLexer +BOR_ASSIGN :"|=" ; + +// inherited from grammar StdCLexer +BXOR :'^' ; + +// inherited from grammar StdCLexer +BXOR_ASSIGN :"^=" ; + +// inherited from grammar StdCLexer Comment :"/*" ( { LA(2) != '/' }? '*' | "\r\n" { deferredNewline(); } @@ -1202,20 +1202,20 @@ Comment :"/*" )* "*/" { _ttype = Token.SKIP; } - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer CPPComment :"//" ( ~('\n') )* { _ttype = Token.SKIP; } - ; - -// inherited from grammar StdCLexer -PREPROC_DIRECTIVE -options { - paraphrase= "a line directive"; -} + ; + +// inherited from grammar StdCLexer +PREPROC_DIRECTIVE +options { + paraphrase= "a line directive"; +} :'#' ( ( "line" || (( ' ' | '\t' | '\014')+ '0'..'9')) => LineDirective | (~'\n')* { setPreprocessingDirective(getText()); } @@ -1223,17 +1223,17 @@ options { { _ttype = Token.SKIP; } - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer protected Space :( ' ' | '\t' | '\014') - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer protected LineDirective { boolean oldCountingTokens = countingTokens; countingTokens = false; -} +} :{ lineObject = new LineObject(); deferredLineCount = 0; @@ -1263,73 +1263,73 @@ protected LineDirective { preprocessorInfoChannel.addLineForTokenNumber(new LineObject(lineObject), new Integer(tokenNumber)); countingTokens = oldCountingTokens; } - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer CharLiteral :'\'' ( Escape | ~( '\'' ) ) '\'' - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer protected BadStringLiteral :// Imaginary token. - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer protected Digit :'0'..'9' - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer protected LongSuffix :'l' | 'L' - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer protected UnsignedSuffix :'u' | 'U' - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer protected FloatSuffix :'f' | 'F' - ; - -// inherited from grammar StdCLexer + ; + +// inherited from grammar StdCLexer protected Exponent :( 'e' | 'E' ) ( '+' | '-' )? ( Digit )+ - ; - -// inherited from grammar StdCLexer -protected DoubleDoubleConst :; - -// inherited from grammar StdCLexer -protected FloatDoubleConst :; - -// inherited from grammar StdCLexer -protected LongDoubleConst :; - -// inherited from grammar StdCLexer -protected IntOctalConst :; - -// inherited from grammar StdCLexer -protected LongOctalConst :; - -// inherited from grammar StdCLexer -protected UnsignedOctalConst :; - -// inherited from grammar StdCLexer -protected IntIntConst :; - -// inherited from grammar StdCLexer -protected LongIntConst :; - -// inherited from grammar StdCLexer -protected UnsignedIntConst :; - -// inherited from grammar StdCLexer -protected IntHexConst :; - -// inherited from grammar StdCLexer -protected LongHexConst :; - -// inherited from grammar StdCLexer -protected UnsignedHexConst :; - - + ; + +// inherited from grammar StdCLexer +protected DoubleDoubleConst :; + +// inherited from grammar StdCLexer +protected FloatDoubleConst :; + +// inherited from grammar StdCLexer +protected LongDoubleConst :; + +// inherited from grammar StdCLexer +protected IntOctalConst :; + +// inherited from grammar StdCLexer +protected LongOctalConst :; + +// inherited from grammar StdCLexer +protected UnsignedOctalConst :; + +// inherited from grammar StdCLexer +protected IntIntConst :; + +// inherited from grammar StdCLexer +protected LongIntConst :; + +// inherited from grammar StdCLexer +protected UnsignedIntConst :; + +// inherited from grammar StdCLexer +protected IntHexConst :; + +// inherited from grammar StdCLexer +protected LongHexConst :; + +// inherited from grammar StdCLexer +protected UnsignedHexConst :; + + diff --git a/build/shared/Makefile_CygWin b/build/shared/Makefile_CygWin deleted file mode 100644 index a086d0d28..000000000 --- a/build/shared/Makefile_CygWin +++ /dev/null @@ -1,54 +0,0 @@ -# Arduino Makefile (for Windows XP) -# Nick Zambetti, David A. Mellis, and D. Cuartielles -# $Id: makefile.win,v 1.10 2005/08/31 02:47:04 cuartielles Exp $ - -# By default, this makefile uses the serial device specified by -# Wiring (either in the Tools | Serial Port menu or the Wiring -# preferences file in the sketchbook directory) and passed as -# an argument to make. To override this value, uncomment the -# following line and change the value to the desired device. -# SERIAL=com1 - -# The Wiring Lite IDE runs the "compile" rule when you click the play button. -compile: - -tools/rm tmp/* - tools/cat core/wiringlite.inc > tmp/prog.c - tools/cat lib/build/*.c >> tmp/prog.c - tools/cp core/* tmp - tools/cp lib/cyg*.dll tmp - tools/gnumake -s -C tmp - -# The IDE runs the "program" rule when you hit the export button. -# The string after the colon determines the method used to -# program the microcontroller: program-using-bootloader, -# program-with-isp, or program-over-parallel-port. -program: program-using-bootloader-avrdude - -# This rule is for uploading code using a bootloader already on -# the microcontroller. It should run at the baud rate specified -# in the bootloader's code, current 9600 baud. -program-using-bootloader-avrdude: - tools/avrdude -p atmega8 -P ${SERIAL} -c stk500@9600 -V -q -U flash:w:tmp/prog.hex - -# This rule is for uploading code using a bootloader already on -# the microcontroller. It should run at the baud rate specified -# in the bootloader's code, current 9600 baud. On Windows, use -# program-using-bootloader-avrdude instead, as uisp seems to have -# problems talking to the bootloader over the serial port (though -# it appears to work fine with a Keyspan USB-to-serial adapter). -program-using-bootloader: - # cp lib/cyg*.dll . - tools/uisp -dprog=stk500 -dspeed=9600 -dserial=${SERIAL} -dpart=ATmega8 if=tmp/prog.hex --upload - -# This rule is for uploading code using an in-system programmer, -# e.g. the one sold by Atmel. In this case, you want to erase the -# microcontroller, upload the code, and then verify it. -# Atmel's isp follows the stk500 protocol and works at 115200 baud. -program-with-isp: - # cp lib/cyg*.dll . - tools/uisp -dprog=stk500 -dspeed=115200 -dserial=${SERIAL} -dpart=ATmega8 if=tmp/prog.hex --erase --upload --verify - -# This rule is for uploading code using a parallel port programmer. -program-over-parallel-port: - # cp lib/cyg*.dll . - tools/uisp -dprog=dapa -dpart=ATmega8 if=tmp/prog.hex -dlpt=0x378 --erase --upload diff --git a/build/shared/Makefile_noCygWin b/build/shared/Makefile_noCygWin deleted file mode 100644 index 3b4ae9d94..000000000 --- a/build/shared/Makefile_noCygWin +++ /dev/null @@ -1,54 +0,0 @@ -# Arduino Makefile (for Windows XP) -# Nick Zambetti, David A. Mellis, and D. Cuartielles -# $Id: makefile.win,v 1.10 2005/08/31 02:47:04 cuartielles Exp $ - -# By default, this makefile uses the serial device specified by -# Wiring (either in the Tools | Serial Port menu or the Wiring -# preferences file in the sketchbook directory) and passed as -# an argument to make. To override this value, uncomment the -# following line and change the value to the desired device. -# SERIAL=com1 - -# The Wiring Lite IDE runs the "compile" rule when you click the play button. -compile: - -tools\rm tmp/* - tools\cat core/wiringlite.inc > tmp/prog.c - tools\cat lib/build/*.c >> tmp/prog.c - tools\cp core/* tmp - tools\cp lib/cyg*.dll tmp - tools\gnumake -s -C tmp - -# The IDE runs the "program" rule when you hit the export button. -# The string after the colon determines the method used to -# program the microcontroller: program-using-bootloader, -# program-with-isp, or program-over-parallel-port. -program: program-using-bootloader-avrdude - -# This rule is for uploading code using a bootloader already on -# the microcontroller. It should run at the baud rate specified -# in the bootloader's code, current 9600 baud. -program-using-bootloader-avrdude: - tools\avrdude -p atmega8 -P ${SERIAL} -c stk500@9600 -V -q -U flash:w:tmp/prog.hex - -# This rule is for uploading code using a bootloader already on -# the microcontroller. It should run at the baud rate specified -# in the bootloader's code, current 9600 baud. On Windows, use -# program-using-bootloader-avrdude instead, as uisp seems to have -# problems talking to the bootloader over the serial port (though -# it appears to work fine with a Keyspan USB-to-serial adapter). -program-using-bootloader: - # cp lib/cyg*.dll . - tools\uisp -dprog=stk500 -dspeed=9600 -dserial=${SERIAL} -dpart=ATmega8 if=tmp/prog.hex --upload - -# This rule is for uploading code using an in-system programmer, -# e.g. the one sold by Atmel. In this case, you want to erase the -# microcontroller, upload the code, and then verify it. -# Atmel's isp follows the stk500 protocol and works at 115200 baud. -program-with-isp: - # cp lib/cyg*.dll . - tools\uisp -dprog=stk500 -dspeed=115200 -dserial=${SERIAL} -dpart=ATmega8 if=tmp/prog.hex --erase --upload --verify - -# This rule is for uploading code using a parallel port programmer. -program-over-parallel-port: - # cp lib/cyg*.dll . - tools\uisp -dprog=dapa -dpart=ATmega8 if=tmp/prog.hex -dlpt=0x378 --erase --upload diff --git a/build/shared/lib/icon.gif b/build/shared/lib/icon.gif index 9d8142a6a..62597c0cf 100644 Binary files a/build/shared/lib/icon.gif and b/build/shared/lib/icon.gif differ diff --git a/build/shared/lib/loading.gif b/build/shared/lib/loading.gif index cc5b0f4bb..133635807 100755 Binary files a/build/shared/lib/loading.gif and b/build/shared/lib/loading.gif differ diff --git a/build/windows/dist.sh b/build/windows/dist.sh index 1ad2ab905..b1bde5864 100755 --- a/build/windows/dist.sh +++ b/build/windows/dist.sh @@ -17,88 +17,80 @@ echo Creating P5 distribution for revision $REVISION... echo # remove any old boogers -rm -rf processing -rm -rf processing-* +rm -rf arduino +rm -rf arduino-* # use 'shared' files as starting point -cp -r ../shared processing - -# add the libraries folder with source -cp -r ../../net processing/libraries/ -cp -r ../../opengl processing/libraries/ -cp -r ../../serial processing/libraries/ -cp -r ../../video processing/libraries/ +cp -r ../shared arduino +cp -r work/lib/targets arduino/lib # new style examples thing ala reas -cd processing -unzip -q examples.zip -rm examples.zip -cd .. - -# new style reference -cd processing -unzip -q reference.zip -# necessary for launching reference from shell/command prompt -# which is done internally to view reference -chmod +x reference/*.html -# needed by 'help' menu -chmod +x reference/environment/*.html -# get rid of the zip file -rm reference.zip +cd arduino +mkdir examples +unzip -d examples -q dist/examples.zip +rm dist/examples.zip +rm -rf dist cd .. # add java (jre) files -unzip -q -d processing jre.zip +unzip -q -d arduino jre.zip + +# copy tools from work/ +cp -r work/tools arduino # directories used by the app -#mkdir processing/lib/build +#mkdir arduino/lib/build # grab pde.jar and export from the working dir -cp work/lib/pde.jar processing/lib/ -cp work/lib/core.jar processing/lib/ -#cp -r work/lib/export processing/lib/ -#rm -rf processing/lib/export/CVS +cp work/lib/pde.jar arduino/lib/ +cp work/java/lib/rt.jar arduino/lib/ +#cp work/lib/core.jar arduino/lib/ +#cp -r work/lib/export arduino/lib/ +#rm -rf arduino/lib/export/CVS # get jikes and depedencies -#gunzip < dist/jikes.gz > processing/jikes.exe -cp dist/jikes.exe processing/ -chmod +x processing/jikes.exe +#gunzip < dist/jikes.gz > arduino/jikes.exe +cp dist/jikes.exe arduino/ +chmod +x arduino/jikes.exe -cp dist/ICE_JNIRegistry.dll processing/ -chmod +x processing/ICE_JNIRegistry.dll +cp dist/ICE_JNIRegistry.dll arduino/ +chmod +x arduino/ICE_JNIRegistry.dll +cp work/rxtxSerial.dll arduino/ +chmod +x arduino/rxtxSerial.dll +cp work/*.dll arduino +chmod +x arduino/*.dll # get platform-specific goodies from the dist dir -cp launcher/processing.exe processing/ -cp dist/run.bat processing/ +cp launcher/arduino.exe arduino/ +#cp dist/run.bat arduino/ # convert notes.txt to windows LFs # the 2> is because the app is a little chatty -unix2dos processing/revisions.txt 2> /dev/null -unix2dos processing/lib/preferences.txt 2> /dev/null -unix2dos processing/lib/keywords.txt 2> /dev/null -rm -f processing/*.bak -rm -f processing/lib/*.bak +unix2dos arduino/revisions.txt 2> /dev/null +unix2dos arduino/lib/preferences.txt 2> /dev/null +unix2dos arduino/lib/keywords.txt 2> /dev/null +rm -f arduino/*.bak +rm -f arduino/lib/*.bak # remove boogers -find processing -name "*~" -exec rm -f {} ';' -find processing -name ".DS_Store" -exec rm -f {} ';' -find processing -name "._*" -exec rm -f {} ';' -find processing -name "Thumbs.db" -exec rm -f {} ';' +find arduino -name "*~" -exec rm -f {} ';' +find arduino -name ".DS_Store" -exec rm -f {} ';' +find arduino -name "._*" -exec rm -f {} ';' +find arduino -name "Thumbs.db" -exec rm -f {} ';' # chmod +x the crew -find processing -name "*.dll" -exec chmod +x {} ';' -find processing -name "*.exe" -exec chmod +x {} ';' -find processing -name "*.html" -exec chmod +x {} ';' +find arduino -name "*.dll" -exec chmod +x {} ';' +find arduino -name "*.exe" -exec chmod +x {} ';' +find arduino -name "*.html" -exec chmod +x {} ';' -# clean out the cvs entries -find processing -name "CVS" -exec rm -rf {} ';' 2> /dev/null -find processing -name ".cvsignore" -exec rm -rf {} ';' +# clean out the svn entries +find arduino -name ".svn" -exec rm -rf {} ';' 2> /dev/null # zip it all up for release echo Packaging standard release... echo -P5=processing-$REVISION -mv processing $P5 +P5=arduino-$REVISION +mv arduino $P5 zip -rq $P5.zip $P5 # nah, keep the new directory around #rm -rf $P5 diff --git a/build/windows/dist/avr_tools.zip b/build/windows/dist/avr_tools.zip new file mode 100644 index 000000000..79fd82d48 Binary files /dev/null and b/build/windows/dist/avr_tools.zip differ diff --git a/build/windows/dist/run.bat b/build/windows/dist/run.bat index 48ce3bd70..eb659f57c 100755 --- a/build/windows/dist/run.bat +++ b/build/windows/dist/run.bat @@ -6,7 +6,7 @@ REM --- (which means 128 megabytes) to something higher. set SAVEDCP=%CLASSPATH% set SAVEDPATH=%PATH% -set CLASSPATH=java\lib\rt.jar;lib;lib\build;lib\pde.jar;lib\core.jar;lib\antlr.jar;lib\oro.jar;lib\registry.jar;lib\mrj.jar;%windir%\system32\qtjava.zip;%windir%\system\qtjava.zip +set CLASSPATH=java\lib\rt.jar;lib;lib\build;lib\pde.jar;lib\core.jar;lib\antlr.jar;lib\oro.jar;lib\registry.jar;lib\mrj.jar set PATH=java\bin;%PATH% start javaw -ms128m -mx128m processing.app.Base diff --git a/build/windows/jre.zip b/build/windows/jre.zip new file mode 100644 index 000000000..01426c5c3 Binary files /dev/null and b/build/windows/jre.zip differ diff --git a/build/windows/launcher/Makefile b/build/windows/launcher/Makefile index 38540deca..cfd1b1683 100644 --- a/build/windows/launcher/Makefile +++ b/build/windows/launcher/Makefile @@ -1,9 +1,9 @@ CXXFLAGS = -mwindows -mno-cygwin -O2 -Wall OBJS = launcher.o launcher-rc.o -processing.exe: $(OBJS) +arduino.exe: $(OBJS) $(LINK.cc) $(CXXFLAGS) -o $@ $(OBJS) - cp processing.exe ../work/ + cp arduino.exe ../work/ $(OBJS): Makefile @@ -11,4 +11,4 @@ launcher-rc.o: launcher.rc windres -i $< -o $@ clean: - $(RM) $(OBJS) processing.exe + $(RM) $(OBJS) arduino.exe diff --git a/build/windows/make.sh b/build/windows/make.sh index 96d65b54c..215f11210 100755 --- a/build/windows/make.sh +++ b/build/windows/make.sh @@ -12,6 +12,8 @@ else cp -r ../shared work rm -rf work/CVS rm -f work/.DS_Store + cp ../../lib/*.dll work + cp dist/lib/*.dll work # needs to make the dir because of packaging goofiness mkdir -p work/classes/arduino/app/preproc @@ -80,7 +82,7 @@ else # take care of the examples mkdir work/examples cd work/examples - cp ../shared/dist/examples.zip . + cp ../../../shared/dist/examples.zip . echo Extracting examples ... unzip -q -d . examples.zip rm -f examples.zip @@ -112,12 +114,14 @@ cd app/preproc # first build the default java goop ../../build/windows/work/java/bin/java \ - -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool java.g - + -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool StdCParser.g # now build the pde stuff that extends the java classes ../../build/windows/work/java/bin/java \ - -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool \ - -glib java.g pde.g + -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool -glib StdCParser.g WParser.g +../../build/windows/work/java/bin/java \ + -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool WTreeParser.g +../../build/windows/work/java/bin/java \ + -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool -glib WTreeParser.g WEmitter.g # back to base arduino dir cd ../.. @@ -127,8 +131,8 @@ fi ### -- BUILD BOOTLOADER ----------------------------------------- cd bootloader -export AVRDIR=../build/windows/work/tools/avr -make +export DIRAVR=../build/windows/work/tools/avr +make cp ATmegaBOOT.hex ../build/windows/work/bootloader cd .. @@ -136,13 +140,14 @@ cd .. cd app -CLASSPATH="..\\build\\windows\\work\\lib\\RXTXcomm.jar;..\\build\\windows\\work\\lib\\core.jar;..\\build\\windows\\work\\lib\\mrj.jar;..\\build\\windows\\work\\lib\antlr.jar;..\\build\\windows\\work\\lib\\oro.jar;..\\build\\windows\\work\\lib\\registry.jar;..\\build\\windows\\work\\java\\lib\\rt.jar" +CLASSPATH="..\\build\\windows\\work\\lib\\RXTXcomm.jar;..\\build\\windows\\work\\lib\\mrj.jar;..\\build\\windows\\work\\lib\antlr.jar;..\\build\\windows\\work\\lib\\oro.jar;..\\build\\windows\\work\\lib\\registry.jar;..\\build\\windows\\work\\java\\lib\\rt.jar" # compile the code as java 1.3, so that the application will run and # show the user an error, rather than crapping out with some strange # "class not found" crap -../build/windows/work/jikes -target 1.3 +D -classpath "$CLASSPATH;..\\build\\windows\\work\\classes" -d ..\\build\\windows\\work\\classes *.java preproc/*.java syntax/*.java tools/*.java -#/cygdrive/c/jdk-1.4.2_05/bin/javac.exe -classpath $CLASSPATH -d ..\\build\\windows\\work\\classes *.java jeditsyntax/*.java preprocessor/*.java +# need to do this twice because otherwise dependencies aren't resolved right. +../build/windows/work/jikes -target 1.3 +D -classpath "$CLASSPATH;..\\build\\windows\\work\\classes" -d ..\\build\\windows\\work\\classes preproc/*.java syntax/*.java tools/*.java *.java +../build/windows/work/jikes -target 1.3 +D -classpath "$CLASSPATH;..\\build\\windows\\work\\classes" -d ..\\build\\windows\\work\\classes preproc/*.java syntax/*.java tools/*.java *.java cd ../build/windows/work/classes rm -f ../lib/pde.jar @@ -152,27 +157,6 @@ zip -0rq ../lib/pde.jar . cd ../.. -### -- BUILD LIBRARIES ------------------------------------------------ - - -PLATFORM=windows - - -CLASSPATH="..\\build\\$PLATFORM\\work\\lib\\core.jar;..\\build\\$PLATFORM\\work\\java\\lib\\rt.jar" -JIKES=../build/$PLATFORM/work/jikes -CORE="..\\build\\$PLATFORM\\work\\lib\\core.jar" -LIBRARIES="..\\build\\$PLATFORM\\work\\libraries" - -# move to arduino/build -cd .. - - - -CLASSPATH="..\\..\\build\\$PLATFORM\\work\\lib\\core.jar;..\\..\\build\\$PLATFORM\\work\\java\\lib\\rt.jar" -JIKES=../../build/$PLATFORM/work/jikes -CORE=..\\..\\build\\$PLATFORM\\work\\lib\\core.jar -LIBRARIES=..\\..\\build\\$PLATFORM\\work\\libraries - echo echo Done. diff --git a/targets/arduino/Makefile_CygWin b/targets/arduino/Makefile_CygWin deleted file mode 100644 index f52134213..000000000 --- a/targets/arduino/Makefile_CygWin +++ /dev/null @@ -1,421 +0,0 @@ -# Hey Emacs, this is a -*- makefile -*- -# -# WinAVR Sample makefile written by Eric B. Weddington, Jörg Wunsch, et al. -# Released to the Public Domain -# Please read the make user manual! -# -# Additional material for this makefile was submitted by: -# Tim Henigan -# Peter Fleury -# Reiner Patommel -# Sander Pool -# Frederik Rouleau -# Markus Pfaff -# -# On command line: -# -# make all = Make software. -# -# make clean = Clean out built project files. -# -# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB). -# -# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio -# 4.07 or greater). -# -# make program = Download the hex file to the device, using avrdude. Please -# customize the avrdude settings below first! -# -# make filename.s = Just compile filename.c into the assembler code only -# -# To rebuild project do "make clean" then "make all". -# - - -# MCU name -MCU = atmega8 - -# Output format. (can be srec, ihex, binary) -FORMAT = ihex - -# Target file name (without extension). -TARGET = prog - - -# List C source files here. (C dependencies are automatically generated.) -#SRC = pins_arduino.c wiring.c ../avrlib/uart.c ../avrlib/buffer.c ../avrlib/timer.c ../avrlib/a2d.c $(TARGET).c -#SRC = pins_arduino.c wiring.c ../avrlib/uart.c ../avrlib/buffer.c ../avrlib/timer.c $(TARGET).c -SRC = pins_arduino.c wiring.c ../lib/avrlib/uart.c ../lib/avrlib/buffer.c ../lib/avrlib/timer.c $(TARGET).c - -# List Assembler source files here. -# Make them always end in a capital .S. Files ending in a lowercase .s -# will not be considered source files but generated files (assembler -# output from the compiler), and will be deleted upon "make clean"! -# Even though the DOS/Win* filesystem matches both .s and .S the same, -# it will preserve the spelling of the filenames, and gcc itself does -# care about how the name is spelled on its command-line. -ASRC = - - - -# Optimization level, can be [0, 1, 2, 3, s]. -# 0 = turn off optimization. s = optimize for size. -# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) -OPT = s - - -# List any extra directories to look for include files here. -# Each directory must be seperated by a space. -EXTRAINCDIRS = ../lib/avrlib - - -# Compiler flag to set the C Standard level. -# c89 - "ANSI" C -# gnu89 - c89 plus GCC extensions -# c99 - ISO C99 standard (not yet fully implemented) -# gnu99 - c99 plus GCC extensions -CSTANDARD = -std=gnu99 - -# Place -D or -U options here -CDEFS = -D F_CPU=16000000L - -# Place -I options here -CINCS = - - -# Compiler flags. -# -g: generate debugging information -# -O*: optimization level -# -f...: tuning, see GCC manual and avr-libc documentation -# -Wall...: warning level -# -Wa,...: tell GCC to pass this to the assembler. -# -adhlns...: create assembler listing -CFLAGS = -g -CFLAGS += $(CDEFS) $(CINCS) -CFLAGS += -O$(OPT) -CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -CFLAGS += -Wall -Wstrict-prototypes -CFLAGS += -Wa,-adhlns=$(<:.c=.lst) -CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -CFLAGS += $(CSTANDARD) - - - -# Assembler flags. -# -Wa,...: tell GCC to pass this to the assembler. -# -ahlms: create listing -# -gstabs: have the assembler create line number information; note that -# for use in COFF files, additional information about filenames -# and function names needs to be present in the assembler source -# files -- see avr-libc docs [FIXME: not yet described there] -ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs - - - -#Additional libraries. - -# Minimalistic printf version -PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min - -# Floating point printf version (requires MATH_LIB = -lm below) -PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt - -PRINTF_LIB = - -# Minimalistic scanf version -SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min - -# Floating point + %[ scanf version (requires MATH_LIB = -lm below) -SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt - -SCANF_LIB = - -MATH_LIB = -lm - -# External memory options - -# 64 KB of external RAM, starting after internal RAM (ATmega128!), -# used for variables (.data/.bss) and heap (malloc()). -#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff - -# 64 KB of external RAM, starting after internal RAM (ATmega128!), -# only used for heap (malloc()). -#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff - -EXTMEMOPTS = - -# Linker flags. -# -Wl,...: tell GCC to pass this to linker. -# -Map: create map file -# --cref: add cross reference to map file -LDFLAGS = -Wl,-Map=$(TARGET).map,--cref -LDFLAGS += $(EXTMEMOPTS) -LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) - - - - -# Programming support using avrdude. Settings and variables. - -# Programming hardware: alf avr910 avrisp bascom bsd -# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 -# -# Type: avrdude -c ? -# to get a full listing. -# -AVRDUDE_PROGRAMMER = stk500 - -# com1 = serial port. Use lpt1 to connect to parallel port. -AVRDUDE_PORT = com1 # programmer connected to serial device - -AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex -#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep - - -# Uncomment the following if you want avrdude's erase cycle counter. -# Note that this counter needs to be initialized first using -Yn, -# see avrdude manual. -#AVRDUDE_ERASE_COUNTER = -y - -# Uncomment the following if you do /not/ wish a verification to be -# performed after programming the device. -#AVRDUDE_NO_VERIFY = -V - -# Increase verbosity level. Please use this when submitting bug -# reports about avrdude. See -# to submit bug reports. -#AVRDUDE_VERBOSE = -v -v - -AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) -AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) -AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) - - - -# --------------------------------------------------------------------------- - -# Define directories, if needed. -DIRAVR = ../tools/avr -DIRAVRBIN = $(DIRAVR)/bin - -# Define programs and commands. -SHELL = sh -CC = ${DIRAVRBIN}/avr-gcc -OBJCOPY = ${DIRAVRBIN}/avr-objcopy -OBJDUMP = ${DIRAVRBIN}/avr-objdump -SIZE = ${DIRAVRBIN}/avr-size -NM = ${DIRAVRBIN}/avr-nm -AVRDUDE = avrdude -REMOVE = rm -f -COPY = cp - - - - -# Define Messages -# English -MSG_ERRORS_NONE = Errors: none -MSG_BEGIN = -------- begin -------- -MSG_END = -------- end -------- -MSG_SIZE_BEFORE = Size before: -MSG_SIZE_AFTER = Size after: -MSG_COFF = Converting to AVR COFF: -MSG_EXTENDED_COFF = Converting to AVR Extended COFF: -MSG_FLASH = Creating load file for Flash: -MSG_EEPROM = Creating load file for EEPROM: -MSG_EXTENDED_LISTING = Creating Extended Listing: -MSG_SYMBOL_TABLE = Creating Symbol Table: -MSG_LINKING = Linking: -MSG_COMPILING = Compiling: -MSG_ASSEMBLING = Assembling: -MSG_CLEANING = Cleaning project: - - - - -# Define all object files. -OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) - -# Define all listing files. -LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) - - -# Compiler flags to generate dependency files. -GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,dep/$(@F).d - - -# Combine all necessary flags and optional flags. -# Add target processor to flags. -ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) -ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) - - - - - -# Default target. -#all: begin gccversion sizebefore build sizeafter finished end -all: begin gccversion build finished end - -build: elf hex eep lss sym - -elf: $(TARGET).elf -hex: $(TARGET).hex -eep: $(TARGET).eep -lss: $(TARGET).lss -sym: $(TARGET).sym - - - -# Eye candy. -# AVR Studio 3.x does not check make's exit code but relies on -# the following magic strings to be generated by the compile job. -begin: - @echo - @echo $(MSG_BEGIN) - -finished: - @echo $(MSG_ERRORS_NONE) - -end: - @echo $(MSG_END) - @echo - - -# Display size of file. -HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex -ELFSIZE = $(SIZE) -A $(TARGET).elf -sizebefore: - @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi - -sizeafter: - @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi - - - -# Display compiler version information. -gccversion : - @$(CC) --version - - - -# Program the device. -program: $(TARGET).hex $(TARGET).eep - $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) - - - - -# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. -COFFCONVERT=$(OBJCOPY) --debugging \ ---change-section-address .data-0x800000 \ ---change-section-address .bss-0x800000 \ ---change-section-address .noinit-0x800000 \ ---change-section-address .eeprom-0x810000 - - -coff: $(TARGET).elf - @echo - @echo $(MSG_COFF) $(TARGET).cof - $(COFFCONVERT) -O coff-avr $< $(TARGET).cof - - -extcoff: $(TARGET).elf - @echo - @echo $(MSG_EXTENDED_COFF) $(TARGET).cof - $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof - - - -# Create final output files (.hex, .eep) from ELF output file. -%.hex: %.elf - @echo - @echo $(MSG_FLASH) $@ - $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ - -%.eep: %.elf - @echo - @echo $(MSG_EEPROM) $@ - -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ - --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ - -# Create extended listing file from ELF output file. -%.lss: %.elf - @echo - @echo $(MSG_EXTENDED_LISTING) $@ - $(OBJDUMP) -h -S $< > $@ - -# Create a symbol table from ELF output file. -%.sym: %.elf - @echo - @echo $(MSG_SYMBOL_TABLE) $@ - $(NM) -n $< > $@ - - - -# Link: create ELF output file from object files. -.SECONDARY : $(TARGET).elf -.PRECIOUS : $(OBJ) -%.elf: $(OBJ) - @echo - @echo $(MSG_LINKING) $@ - $(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) - - -# Compile: create object files from C source files. -%.o : %.c - @echo - @echo $(MSG_COMPILING) $< - $(CC) -c $(ALL_CFLAGS) $< -o $@ - - -# Compile: create assembler files from C source files. -%.s : %.c - $(CC) -S $(ALL_CFLAGS) $< -o $@ - - -# Assemble: create object files from assembler source files. -%.o : %.S - @echo - @echo $(MSG_ASSEMBLING) $< - $(CC) -c $(ALL_ASFLAGS) $< -o $@ - - - -# Target: clean project. -clean: begin clean_list finished end - -clean_list : - @echo - @echo $(MSG_CLEANING) - $(REMOVE) $(TARGET).hex - $(REMOVE) $(TARGET).eep - $(REMOVE) $(TARGET).obj - $(REMOVE) $(TARGET).cof - $(REMOVE) $(TARGET).elf - $(REMOVE) $(TARGET).map - $(REMOVE) $(TARGET).obj - $(REMOVE) $(TARGET).a90 - $(REMOVE) $(TARGET).sym - $(REMOVE) $(TARGET).lnk - $(REMOVE) $(TARGET).lss - $(REMOVE) $(OBJ) - $(REMOVE) $(LST) - $(REMOVE) $(SRC:.c=.s) - $(REMOVE) $(SRC:.c=.d) - $(REMOVE) dep/* - - - -# Include the dependency files. --include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) - - -# Listing of phony targets. -.PHONY : all begin finish end sizebefore sizeafter gccversion \ -build elf hex eep lss sym coff extcoff \ -clean clean_list program - - - diff --git a/targets/arduino/Makefile_noCygWin b/targets/arduino/Makefile_noCygWin deleted file mode 100644 index fcf85c63e..000000000 --- a/targets/arduino/Makefile_noCygWin +++ /dev/null @@ -1,421 +0,0 @@ -# Hey Emacs, this is a -*- makefile -*- -# -# WinAVR Sample makefile written by Eric B. Weddington, Jörg Wunsch, et al. -# Released to the Public Domain -# Please read the make user manual! -# -# Additional material for this makefile was submitted by: -# Tim Henigan -# Peter Fleury -# Reiner Patommel -# Sander Pool -# Frederik Rouleau -# Markus Pfaff -# -# On command line: -# -# make all = Make software. -# -# make clean = Clean out built project files. -# -# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB). -# -# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio -# 4.07 or greater). -# -# make program = Download the hex file to the device, using avrdude. Please -# customize the avrdude settings below first! -# -# make filename.s = Just compile filename.c into the assembler code only -# -# To rebuild project do "make clean" then "make all". -# - - -# MCU name -MCU = atmega8 - -# Output format. (can be srec, ihex, binary) -FORMAT = ihex - -# Target file name (without extension). -TARGET = prog - - -# List C source files here. (C dependencies are automatically generated.) -#SRC = pins_arduino.c wiring.c ../avrlib/uart.c ../avrlib/buffer.c ../avrlib/timer.c ../avrlib/a2d.c $(TARGET).c -#SRC = pins_arduino.c wiring.c ../avrlib/uart.c ../avrlib/buffer.c ../avrlib/timer.c $(TARGET).c -SRC = pins_arduino.c wiring.c ../lib/avrlib/uart.c ../lib/avrlib/buffer.c ../lib/avrlib/timer.c $(TARGET).c - -# List Assembler source files here. -# Make them always end in a capital .S. Files ending in a lowercase .s -# will not be considered source files but generated files (assembler -# output from the compiler), and will be deleted upon "make clean"! -# Even though the DOS/Win* filesystem matches both .s and .S the same, -# it will preserve the spelling of the filenames, and gcc itself does -# care about how the name is spelled on its command-line. -ASRC = - - - -# Optimization level, can be [0, 1, 2, 3, s]. -# 0 = turn off optimization. s = optimize for size. -# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) -OPT = s - - -# List any extra directories to look for include files here. -# Each directory must be seperated by a space. -EXTRAINCDIRS = ../lib/avrlib - - -# Compiler flag to set the C Standard level. -# c89 - "ANSI" C -# gnu89 - c89 plus GCC extensions -# c99 - ISO C99 standard (not yet fully implemented) -# gnu99 - c99 plus GCC extensions -CSTANDARD = -std=gnu99 - -# Place -D or -U options here -CDEFS = -D F_CPU=16000000L - -# Place -I options here -CINCS = - - -# Compiler flags. -# -g: generate debugging information -# -O*: optimization level -# -f...: tuning, see GCC manual and avr-libc documentation -# -Wall...: warning level -# -Wa,...: tell GCC to pass this to the assembler. -# -adhlns...: create assembler listing -CFLAGS = -g -CFLAGS += $(CDEFS) $(CINCS) -CFLAGS += -O$(OPT) -CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -CFLAGS += -Wall -Wstrict-prototypes -CFLAGS += -Wa,-adhlns=$(<:.c=.lst) -CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -CFLAGS += $(CSTANDARD) - - - -# Assembler flags. -# -Wa,...: tell GCC to pass this to the assembler. -# -ahlms: create listing -# -gstabs: have the assembler create line number information; note that -# for use in COFF files, additional information about filenames -# and function names needs to be present in the assembler source -# files -- see avr-libc docs [FIXME: not yet described there] -ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs - - - -#Additional libraries. - -# Minimalistic printf version -PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min - -# Floating point printf version (requires MATH_LIB = -lm below) -PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt - -PRINTF_LIB = - -# Minimalistic scanf version -SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min - -# Floating point + %[ scanf version (requires MATH_LIB = -lm below) -SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt - -SCANF_LIB = - -MATH_LIB = -lm - -# External memory options - -# 64 KB of external RAM, starting after internal RAM (ATmega128!), -# used for variables (.data/.bss) and heap (malloc()). -#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff - -# 64 KB of external RAM, starting after internal RAM (ATmega128!), -# only used for heap (malloc()). -#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff - -EXTMEMOPTS = - -# Linker flags. -# -Wl,...: tell GCC to pass this to linker. -# -Map: create map file -# --cref: add cross reference to map file -LDFLAGS = -Wl,-Map=$(TARGET).map,--cref -LDFLAGS += $(EXTMEMOPTS) -LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) - - - - -# Programming support using avrdude. Settings and variables. - -# Programming hardware: alf avr910 avrisp bascom bsd -# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 -# -# Type: avrdude -c ? -# to get a full listing. -# -AVRDUDE_PROGRAMMER = stk500 - -# com1 = serial port. Use lpt1 to connect to parallel port. -AVRDUDE_PORT = com1 # programmer connected to serial device - -AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex -#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep - - -# Uncomment the following if you want avrdude's erase cycle counter. -# Note that this counter needs to be initialized first using -Yn, -# see avrdude manual. -#AVRDUDE_ERASE_COUNTER = -y - -# Uncomment the following if you do /not/ wish a verification to be -# performed after programming the device. -#AVRDUDE_NO_VERIFY = -V - -# Increase verbosity level. Please use this when submitting bug -# reports about avrdude. See -# to submit bug reports. -#AVRDUDE_VERBOSE = -v -v - -AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) -AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) -AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) - - - -# --------------------------------------------------------------------------- - -# Define directories, if needed. -DIRAVR = ..\tools\avr -DIRAVRBIN = $(DIRAVR)\bin - -# Define programs and commands. -SHELL = sh -CC = ${DIRAVRBIN}\avr-gcc -OBJCOPY = ${DIRAVRBIN}\avr-objcopy -OBJDUMP = ${DIRAVRBIN}\avr-objdump -SIZE = ${DIRAVRBIN}\avr-size -NM = ${DIRAVRBIN}\avr-nm -AVRDUDE = avrdude -REMOVE = rm -f -COPY = cp - - - - -# Define Messages -# English -MSG_ERRORS_NONE = Errors: none -MSG_BEGIN = -------- begin -------- -MSG_END = -------- end -------- -MSG_SIZE_BEFORE = Size before: -MSG_SIZE_AFTER = Size after: -MSG_COFF = Converting to AVR COFF: -MSG_EXTENDED_COFF = Converting to AVR Extended COFF: -MSG_FLASH = Creating load file for Flash: -MSG_EEPROM = Creating load file for EEPROM: -MSG_EXTENDED_LISTING = Creating Extended Listing: -MSG_SYMBOL_TABLE = Creating Symbol Table: -MSG_LINKING = Linking: -MSG_COMPILING = Compiling: -MSG_ASSEMBLING = Assembling: -MSG_CLEANING = Cleaning project: - - - - -# Define all object files. -OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) - -# Define all listing files. -LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) - - -# Compiler flags to generate dependency files. -GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,dep/$(@F).d - - -# Combine all necessary flags and optional flags. -# Add target processor to flags. -ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) -ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) - - - - - -# Default target. -#all: begin gccversion sizebefore build sizeafter finished end -all: begin gccversion build finished end - -build: elf hex eep lss sym - -elf: $(TARGET).elf -hex: $(TARGET).hex -eep: $(TARGET).eep -lss: $(TARGET).lss -sym: $(TARGET).sym - - - -# Eye candy. -# AVR Studio 3.x does not check make's exit code but relies on -# the following magic strings to be generated by the compile job. -begin: - @echo - @echo $(MSG_BEGIN) - -finished: - @echo $(MSG_ERRORS_NONE) - -end: - @echo $(MSG_END) - @echo - - -# Display size of file. -HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex -ELFSIZE = $(SIZE) -A $(TARGET).elf -sizebefore: - @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi - -sizeafter: - @if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi - - - -# Display compiler version information. -gccversion : - @$(CC) --version - - - -# Program the device. -program: $(TARGET).hex $(TARGET).eep - $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) - - - - -# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. -COFFCONVERT=$(OBJCOPY) --debugging \ ---change-section-address .data-0x800000 \ ---change-section-address .bss-0x800000 \ ---change-section-address .noinit-0x800000 \ ---change-section-address .eeprom-0x810000 - - -coff: $(TARGET).elf - @echo - @echo $(MSG_COFF) $(TARGET).cof - $(COFFCONVERT) -O coff-avr $< $(TARGET).cof - - -extcoff: $(TARGET).elf - @echo - @echo $(MSG_EXTENDED_COFF) $(TARGET).cof - $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof - - - -# Create final output files (.hex, .eep) from ELF output file. -%.hex: %.elf - @echo - @echo $(MSG_FLASH) $@ - $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ - -%.eep: %.elf - @echo - @echo $(MSG_EEPROM) $@ - -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ - --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ - -# Create extended listing file from ELF output file. -%.lss: %.elf - @echo - @echo $(MSG_EXTENDED_LISTING) $@ - $(OBJDUMP) -h -S $< > $@ - -# Create a symbol table from ELF output file. -%.sym: %.elf - @echo - @echo $(MSG_SYMBOL_TABLE) $@ - $(NM) -n $< > $@ - - - -# Link: create ELF output file from object files. -.SECONDARY : $(TARGET).elf -.PRECIOUS : $(OBJ) -%.elf: $(OBJ) - @echo - @echo $(MSG_LINKING) $@ - $(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) - - -# Compile: create object files from C source files. -%.o : %.c - @echo - @echo $(MSG_COMPILING) $< - $(CC) -c $(ALL_CFLAGS) $< -o $@ - - -# Compile: create assembler files from C source files. -%.s : %.c - $(CC) -S $(ALL_CFLAGS) $< -o $@ - - -# Assemble: create object files from assembler source files. -%.o : %.S - @echo - @echo $(MSG_ASSEMBLING) $< - $(CC) -c $(ALL_ASFLAGS) $< -o $@ - - - -# Target: clean project. -clean: begin clean_list finished end - -clean_list : - @echo - @echo $(MSG_CLEANING) - $(REMOVE) $(TARGET).hex - $(REMOVE) $(TARGET).eep - $(REMOVE) $(TARGET).obj - $(REMOVE) $(TARGET).cof - $(REMOVE) $(TARGET).elf - $(REMOVE) $(TARGET).map - $(REMOVE) $(TARGET).obj - $(REMOVE) $(TARGET).a90 - $(REMOVE) $(TARGET).sym - $(REMOVE) $(TARGET).lnk - $(REMOVE) $(TARGET).lss - $(REMOVE) $(OBJ) - $(REMOVE) $(LST) - $(REMOVE) $(SRC:.c=.s) - $(REMOVE) $(SRC:.c=.d) - $(REMOVE) dep/* - - - -# Include the dependency files. --include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) - - -# Listing of phony targets. -.PHONY : all begin finish end sizebefore sizeafter gccversion \ -build elf hex eep lss sym coff extcoff \ -clean clean_list program - - -