/* * $Log: yyparse.template,v $ * Revision 1.1.1.1 1997/03/12 23:09:29 nsl * changed dir struct * * Revision 1.1.1.1 1997/02/20 08:04:36 nsl * Importing pp * * Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* This is a parser template file, in java, for running parsers generated by the GNU Bison parser generator. */ /**************************************************/ /**************************************************/ /* package patch.src; import java.util.*; import java.io.*; import patch.src.util.*; import pp.src.jbf.*; */ /**************************************************/ // PREFIX /********************* header ********************************/ package npp.src; import java.util.*; import java.io.*; import npp.src.util.*; import pp.src.jbf.*; /*****************************************************/ /**************************************************/ public class YYparse extends YYparser { // Set up the fake goto mechanism protected int Goto; protected static final int yynewstate = 0; protected static final int yybackup = 1; protected static final int yydefault = 2; protected static final int yyreduce = 3; protected static final int yyerrlab = 4; protected static final int yyerrlab1 = 5; protected static final int yyerrdefault = 6; protected static final int yyerrpop = 7; protected static final int yyerrhandle = 8; public static final int YYCONTINUE = 1; public static final int YYACCEPT = 0; public static final int YYABORT = -1; public static final int YYEOF = 0; protected static final int YYEMPTY = -2; protected static final int YYTERROR = 1; protected static final int YYTERRCODE = 256; // CONSTANTS public static final int YYFINAL = 602; public static final int YYFLAG = -32768; public static final int YYNTBASE = 126; public static final int YYLAST = 2961; // TOKENTYPES public static final int ERROR = 258; public static final int ABSTRACT = 259; public static final int BOOLEAN = 260; public static final int BREAK = 261; public static final int BYTE = 262; public static final int CASE = 263; public static final int CATCH = 264; public static final int CHAR = 265; public static final int CLASS = 266; public static final int CONTINUE = 267; public static final int DEFAULT = 268; public static final int DO = 269; public static final int DOUBLE = 270; public static final int EXTENDS = 271; public static final int FALSE_TOKEN = 272; public static final int FINAL = 273; public static final int FINALLY = 274; public static final int FLOAT = 275; public static final int FOR = 276; public static final int IF = 277; public static final int IMPLEMENTS = 278; public static final int NSLIMPORT = 279; public static final int INSTANCEOF = 280; public static final int INT = 281; public static final int INTERFACE = 282; public static final int LONG = 283; public static final int NATIVE = 284; public static final int NULL_TOKEN = 285; public static final int PACKAGE = 286; public static final int PRIVATE = 287; public static final int PROTECTED = 288; public static final int PUBLIC = 289; public static final int RETURN = 290; public static final int SHORT = 291; public static final int STATIC = 292; public static final int SUPER = 293; public static final int SWITCH = 294; public static final int SYNCHRONIZED = 295; public static final int THIS = 296; public static final int THROW = 297; public static final int THROWS = 298; public static final int TRANSIENT = 299; public static final int VOLATILE = 300; public static final int TRUE_TOKEN = 301; public static final int TRY = 302; public static final int VOID = 303; public static final int WHILE = 304; public static final int VERBATIM_OFF = 305; public static final int VERBATIM_NSLJ = 306; public static final int VERBATIM_NSLC = 307; public static final int NSLJ = 308; public static final int NSLMULTI = 309; public static final int CONNECT = 310; public static final int SPECIAL = 311; public static final int NSLMODULE = 312; public static final int NSLMODEL = 313; public static final int NSLCLASS = 314; public static final int ARRAY = 315; public static final int INT_LITERAL = 316; public static final int CHARACTER_LITERAL = 317; public static final int LONG_LITERAL = 318; public static final int FLOAT_LITERAL = 319; public static final int DOUBLE_LITERAL = 320; public static final int SYMBOL = 321; public static final int STRING_LITERAL = 322; public static final int BIT_MUL = 323; public static final int STRING = 324; public static final int NOT_AN_OPERATOR = 325; public static final int SHIFT_RIGHT_EQUALS = 326; public static final int FILL_SHIFT_RIGHT_EQUALS = 327; public static final int SHIFT_LEFT_EQUALS = 328; public static final int ADD_EQUALS = 329; public static final int SUB_EQUALS = 330; public static final int MUL_EQUALS = 331; public static final int DIV_EQUALS = 332; public static final int MOD_EQUALS = 333; public static final int AND_EQUALS = 334; public static final int XOR_EQUALS = 335; public static final int OR_EQUALS = 336; public static final int OR = 337; public static final int AND = 338; public static final int EQUAL_COMPARE = 339; public static final int NOT_EQUAL = 340; public static final int LTEQ = 341; public static final int GTEQ = 342; public static final int BITSHIFT_RIGHT = 343; public static final int FILL_SHIFT_RIGHT = 344; public static final int SHIFT_LEFT = 345; public static final int CAST = 346; public static final int INCR = 347; public static final int DECR = 348; public static final int UMINUS = 349; public static final int UPLUS = 350; public static final int POST_INCR = 351; public static final int POST_DECR = 352; public static final int NEW = 353; public static final int LOWER_THAN_ELSE = 354; public static final int ELSE = 355; protected int yyreturn; // see ACTIONS switch protected int yystate; protected int yyn; protected int yylen; protected int yychar; /* the lookahead symbol */ protected int yychar1; /* lookahead token as an internal (translated) Token number */ protected int yynerrs; /* number of parse errors so far */ protected int yydebug; /* nonzero means print parse trace */ protected int yyerrstatus; /* number of tokens to shift before error messages enabled */ protected YYtoken yylval; /* the semantic value of the lookahead symbol*/ /*protected YYnode yyval; */ protected YYtoken yyval; /* the variable used to return semantic values from the action routines */ protected Int_Stack yyss; protected YYtoken_Stack yyvs; /* protected YYnode_Stack yyvs;*/ /* protected loc_stack yyls;*/ protected YYlex yylex; protected java.io.PrintStream yyout; // PROCS public static final int YYTRANSLATE(int x) { return ((x) <= 355 ? yytranslate[x] : 215);} public YYparse(YYlex yyl, java.io.PrintStream fout) { yyss = new Int_Stack(); /* yyvs = new YYnode_Stack();*/ yyvs = new YYtoken_Stack(); yylex = yyl; yydebug = 0; yyout = fout; } public YYparse(YYlex yyl) {this(yyl, System.out);} public int yyparse() throws Exception, IOException, EmptyStackException { int ok; yychar1 = 0; /* lookahead Token as an internal (translated) */ yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a Token to be read. */ yyval = null; /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyss.clear(); yyvs.clear(); /* yyls.clear();*/ /* need to push a null value to match state 0 */ yyvs.push(yyval); if(yydebug > 0) yyout.print("Starting parse\n"); /* Push a new state, which is found in yystate . */ /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ for(;;) { branch: switch (Goto) { case yynewstate: yyss.push(yystate); if (yydebug > 0) { yyout.print("Entering state "); yyout.print(yystate); yyout.print("\n"); } // {Goto = yybackup; break branch;} case yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) {Goto = yydefault; break branch;} /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { if(yydebug > 0) yyout.print("Reading a token: "); if((yylval = yylex.yylex()) == null) { yylval = new YYtoken(YYEOF,""); } yychar = yylval.tokentype; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ if(yydebug > 0) yyout.print("Now at end of input.\n"); } else { yychar1 = YYTRANSLATE(yychar); if (yydebug >= 10) { yyout.print("Next token is "); yyout.print(yychar); yyout.print(" ("); yyout.print(yytname[yychar1]); yyout.print(")\n"); } } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) {Goto = yydefault; break branch;} yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) {Goto = yyerrlab; break branch;} yyn = -yyn; {Goto = yyreduce; break branch;} } else if (yyn == 0) {Goto = yyerrlab; break branch;} if (yyn == YYFINAL) return YYACCEPT; /* Shift the lookahead token. */ if (yydebug > 0) { yyout.print("Shifting token "); yyout.print(yychar); yyout.print(" ("); yyout.print(yytname[yychar1]); yyout.print("), "); } /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; yyvs.push(yylval); /* yyls.push(yylloc);*/ /* count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus > 0) yyerrstatus--; yystate = yyn; {Goto = yynewstate; break branch;} /* Do the default action for the current state. */ case yydefault: yyn = yydefact[yystate]; if (yyn == 0) {Goto = yyerrlab; break branch;} /* Do a reduction. yyn is the number of a rule to reduce with. */ case yyreduce: yylen = yyr2[yyn]; if (yylen > 0) yyval = yyvs.tth(1-yylen); /* implement default value of the action */ if (yydebug > 0) { int i; yyout.print("Reducing via rule "); yyout.print(yyn); yyout.print(" (line "); yyout.print(yyrline[yyn]); yyout.print("), "); /* Print the symbols being reduced, and their result. */ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) { yyout.print(yytname[yyrhs[i]]); yyout.print(" "); } yyout.print(" -> "); yyout.print(yytname[yyr1[yyn]]); yyout.print("\n"); } /*$*/ /* the action file gets copied in in place of this dollarsign */ /* Provide a way to avoid having return statements in the actions and so avoid "statement not reached" errors" */ yyreturn = YYCONTINUE; switch (yyn) { case 3: { npp.setPackage(yyvs.tth(-1)); ; break;} case 7: { //System.err.println("Adding 1: "+$1.text+" "+$2.text+" "+$3.text+" "); // Have to solve globing npp.addGenCode("import",yyvs.tth(-3)); npp.addModList(yyvs.tth(-2).text+yyvs.tth(-1).text); ; break;} case 8: {// System.err.println("Adding 3: "+$1.text+" "+$2.text+" "+$3.text+" "); npp.addGenCode("import",yyvs.tth(-2)); npp.addModList(yyvs.tth(-1).text); ; break;} case 9: { //System.err.println("Adding 4: "+$1.text+" "+$2.text+" "+$3.text+" "); if (yyvs.tth(-1).text.equals("nslAllImports")) { npp.addGenCode("",yyvs.tth(-3)); npp.addGenCode("import nslj.src.system.*; \n import nslj.src.cmd.*; \n import nslj.src.lang.*; \n import nslj.src.math.*; \n import nslj.src.display.*;", yyvs.tth(-2)); npp.addGenCode("",yyvs.tth(-1)); npp.addGenCode("",yyvs.tth(0)); // System.err.println("nslAllImports added!"); } else { //System.err.println("could not find nslAllImports"); npp.addGenCode("",yyvs.tth(-3)); npp.addGenCode("import",yyvs.tth(-2)); npp.addModList(yyvs.tth(-1).text); npp.parseClass(yyvs.tth(-1).text, true); } ; break;} case 19: { //System.err.println("I'm here!"); //System.err.println("open NSLMODULE:"+$4.text+" pars:"+$6.text); npp.startClass(new ClassNode(yyvs.tth(-3),(ParamsNode)yyvs.tth(-1),"NslModule", null)); // thr if (yyvs.tth(-1) != null) npp.addLocalVar((ParamsNode)(yyvs.tth(-1))); npp.addGenCode("",yyvs.tth(-6)); npp.addGenCode("public class",yyvs.tth(-4)); if ((yyvs.tth(-4).text).equals("nslOutModule")) npp.addGenCode(yyvs.tth(-3).text+" extends NslOutModule",yyvs.tth(-3)); else if ((yyvs.tth(-4).text).equals("nslInModule")) npp.addGenCode(yyvs.tth(-3).text+" extends NslInModule",yyvs.tth(-3)); else if ((yyvs.tth(-4).text).equals("nslModule")) npp.addGenCode(yyvs.tth(-3).text+" extends NslModule",yyvs.tth(-3)); npp.addGenCode("/*"+yyvs.tth(-2).text,yyvs.tth(-2)); npp.addGenCode(yyvs.tth(0).text+"*/",yyvs.tth(0)); // if ($5==null) npp.getCurClass().set_constructor_pars(""); // else npp.getCurClass().set_constructor_pars(((ParamsNode)$5).code0); ; break;} case 20: {npp.startClass(new ClassNode(yyvs.tth(-3),(ParamsNode)yyvs.tth(-1),"NslModel", null)); // thr if (yyvs.tth(-1) != null) npp.addLocalVar((ParamsNode)(yyvs.tth(-1))); npp.addGenCode("",yyvs.tth(-6)); npp.addGenCode("public class",yyvs.tth(-4)); //just puts public class npp.addGenCode(yyvs.tth(-3).text+" extends NslModel",yyvs.tth(-3)); npp.addGenCode("/*"+yyvs.tth(-2).text,yyvs.tth(-2)); npp.addGenCode(yyvs.tth(0).text+"*/",yyvs.tth(0)); ; break;} case 21: {npp.startClass(new ClassNode(yyvs.tth(-3),(ParamsNode)yyvs.tth(-1),"NslClass", null)); // thr if (yyvs.tth(-1) != null) npp.addLocalVar((ParamsNode)(yyvs.tth(-1))); npp.addGenCode("",yyvs.tth(-6)); npp.addGenCode("public class",yyvs.tth(-4)); //just puts public class npp.addGenCode(yyvs.tth(-3).text+" extends NslClass",yyvs.tth(-3)); npp.addGenCode("/*"+yyvs.tth(-2).text,yyvs.tth(-2)); npp.addGenCode(yyvs.tth(0).text+"*/",yyvs.tth(0)); ; break;} case 22: {//System.err.println("GOT EXTEND.."); // thr // add_var_to_relvant_scope(npp, $8.text); // System.err.println("parse BASECLASS:"+$8.text+" for "+$3.text); boolean addVar = true; // Add public variables of parent class to its scope //npp.parseClass($8.text, addVar); // thr npp.startClass(new ClassNode(yyvs.tth(-8),(ParamsNode)yyvs.tth(-6),"NslModule", null)); // thr if (yyvs.tth(-6) != null) npp.addLocalVar((ParamsNode)(yyvs.tth(-6))); npp.addGenCode("public class",yyvs.tth(-9)); npp.addGenCode("/*"+yyvs.tth(-7).text,yyvs.tth(-7)); npp.addGenCode(yyvs.tth(-5).text+"*/",yyvs.tth(-5)); npp.addGenCode("/*"+yyvs.tth(-2).text,yyvs.tth(-2)); npp.addGenCode(yyvs.tth(0).text+"*/",yyvs.tth(0)); if (yyvs.tth(-1)==null) npp.getCurClass().set_superargs(""); else npp.getCurClass().set_superargs(((ExprsNode)yyvs.tth(-1)).code0); ; break;} case 23: {//System.err.println("GOT EXTEND.."); // System.err.println("model line: "+$1.text+":"+ $2.text+":"+ $3.text+":"+ $4.text+":"+ $5.text+":"+ $6.text+":"+ $7.text+":"+ $8.text+":"+ $9.text); // thr // add_var_to_relvant_scope(npp, $8.text); // System.err.println("parse BASECLASS:"+$8.text+" for "+$3.text); boolean addVar = true; // Add public variables of parent class to its scope //npp.parseClass($8.text, addVar); // thr npp.startClass(new ClassNode(yyvs.tth(-8),(ParamsNode)yyvs.tth(-6), "NslModel", null)); // thr if (yyvs.tth(-6) != null) npp.addLocalVar((ParamsNode)(yyvs.tth(-6))); npp.addGenCode("public class",yyvs.tth(-9)); //just puts public class //npp.addGenCode($3.text+" extends NslModel",$3); npp.addGenCode("/*"+yyvs.tth(-7).text,yyvs.tth(-7)); npp.addGenCode(yyvs.tth(-5).text+"*/",yyvs.tth(-5)); npp.addGenCode("/*"+yyvs.tth(-2).text,yyvs.tth(-2)); npp.addGenCode(yyvs.tth(0).text+"*/",yyvs.tth(0)); if (yyvs.tth(-1)==null) npp.getCurClass().set_superargs(""); else npp.getCurClass().set_superargs(((ExprsNode)yyvs.tth(-1)).code0); ; break;} case 24: { // thr // add_var_to_relvant_scope(npp, $8.text); // System.err.println("parse BASECLASS:"+$8.text+" for "+$3.text); boolean addVar = true; // Add public variables of parent class to its scope //npp.parseClass($8.text, addVar); // thr npp.startClass(new ClassNode(yyvs.tth(-8),(ParamsNode)yyvs.tth(-6),"NslClass", null)); // thr if (yyvs.tth(-6) != null) npp.addLocalVar((ParamsNode)(yyvs.tth(-6))); npp.addGenCode("public class",yyvs.tth(-9)); //just puts public class npp.addGenCode("/*"+yyvs.tth(-7).text,yyvs.tth(-7)); npp.addGenCode(yyvs.tth(-5).text+"*/",yyvs.tth(-5)); npp.addGenCode("/*"+yyvs.tth(-2).text,yyvs.tth(-2)); npp.addGenCode(yyvs.tth(0).text+"*/",yyvs.tth(0)); if (yyvs.tth(-1)==null) npp.getCurClass().set_superargs(""); else npp.getCurClass().set_superargs(((ExprsNode)yyvs.tth(-1)).code0); ; break;} case 25: { npp.endClass(yyvs.tth(0)); //System.err.println("nslModule closed"); ; break;} case 27: {npp.addGenCode("",yyvs.tth(-1));; break;} case 29: {npp.addGenCode("",yyvs.tth(-1));; break;} case 31: {npp.startClass(new ClassNode(yyvs.tth(-2), yyvs.tth(-1), yyvs.tth(0)));; break;} case 32: {npp.endClass(yyvs.tth(0));; break;} case 34: {npp.startClass(new ClassNode(yyvs.tth(-1),null,yyvs.tth(0)));; break;} case 35: { npp.endClass(yyvs.tth(0));; break;} case 39: { npp.addGenCode("external",yyvs.tth(0));; break;} case 43: {npp.addGenCode("",yyvs.tth(-2));; break;} case 46: {npp.addGenCode("",yyvs.tth(-2));; break;} case 49: { yyval = yyvs.tth(0); ; break;} case 50: { yyval = yyvs.tth(0); ; break;} case 51: { npp.addGenCode("",yyvs.tth(0)); yyval = yyvs.tth(-1); ; break;} case 52: { npp.addGenCode("",yyvs.tth(0)); yyval = yyvs.tth(-1); ; break;} case 57: { npp.getCurClass().add_nsldecl((yyvs.tth(0).text).substring(2)); npp.addGenCode("",yyvs.tth(0)); ; break;} case 58: { /*if ($1!=null) System.err.println("----------------"+$1.text+"-------------"); */ //npp.addGenCode(((NslInstNode)$2).typestring+" "+ npp.addGenCode( /* no need for type string*/ ((NslInstNode)yyvs.tth(-1)).variablename+" ; /*",yyvs.tth(-1)); npp.getCurClass().add_nsldecl(((NslInstNode)yyvs.tth(-1)).variablename+"=new "+ ((NslInstNode)yyvs.tth(-1)).typestring+" "+ Expand(((NslInstNode)yyvs.tth(-1)).variablename, ((NslInstNode)yyvs.tth(-1)).arguments) ); npp.addGenCode("*/",yyvs.tth(0)); ; break;} case 59: { npp.addGenCode("; /*NO WORK*/ ",yyvs.tth(0)); ; break;} case 62: {/* creates class level variable if not exists, check compatibility if created */ ; break;} case 65: { String s=remArrDims(yyvs.tth(0).text); if (s!=null) { npp.addGenCode(yyvs.tth(-3).text+s+" "+yyvs.tth(-2).text+" = new ",yyvs.tth(-4)); npp.addGenCode("",yyvs.tth(-2)); //System.err.println("debug:C ARRAY ARGS: ["+$2.text+$3.text+$5.text); } else npp.addGenCode("",yyvs.tth(-4)); ; break;} case 66: { String s=remArrDims(yyvs.tth(0).text); if (s!=null) { npp.addGenCode(yyvs.tth(-3).text+s+" "+yyvs.tth(-2).text+" = new ", yyvs.tth(-4)); npp.addGenCode("",yyvs.tth(-2)); //System.err.println("debug:C ARRAY ARGS: ["+$2.text+$3.text+$5.text); FormalNode fn = (new FormalNode(yyvs.tth(-3), yyvs.tth(-2))); fn.type.addDim(s.length()/2); npp.addLocalVar(fn); } else npp.addGenCode("",yyvs.tth(-4)); ; break;} case 67: { /* ERH: if we wished we could have expressions instead */ //System.err.println("debug:Carray1:["+$1.text+"]"); yyval.text=yyvs.tth(-1).text+']'; yyval.charno = yyvs.tth(0).charno; yyval.lineno = yyvs.tth(0).lineno; ; break;} case 68: { //System.err.println("debug:Carray2:["+$1.text+"]"); yyval.text=yyvs.tth(-3).text+']'+'['+yyvs.tth(0).text; yyval.charno = yyvs.tth(0).charno; yyval.lineno = yyvs.tth(0).lineno; ; break;} case 70: { //System.err.println("debug:Carray3:["+$1.text+"]"); yyval.text="]"+"["+yyvs.tth(0).text; yyval.charno = yyvs.tth(0).charno; yyval.lineno = yyvs.tth(0).lineno; ; break;} case 71: {yyval=new NslInstNode((NslCoupleNode)yyvs.tth(-1),yyvs.tth(0).text); yyval.text=yyvs.tth(-1).text; yyval.charno = yyvs.tth(-1).charno; yyval.lineno = yyvs.tth(-1).lineno; npp.addLocalVar(((NslInstNode)yyval).formal); ; break;} case 72: {yyval=new NslInstNode((NslCoupleNode)yyvs.tth(-1),"(/* VOID */)"); yyval.text=yyvs.tth(-1).text; yyval.charno = yyvs.tth(-1).charno; yyval.lineno = yyvs.tth(-1).lineno; npp.addLocalVar(((NslInstNode)yyval).formal); ; break;} case 73: { //System.err.println("COUPLE FORMED:"+$1.text+" - "+$2.text); boolean addVar = false; // Don't add variables to current scope //npp.parseClass($1.text, addVar); yyval=new NslCoupleNode(yyvs.tth(-1),yyvs.tth(0)); //npp.addGenCode(" /*[ ",$2); yyval.text=yyvs.tth(0).text; yyval.charno = yyvs.tth(0).charno; //+($2.text).length(); yyval.lineno = yyvs.tth(0).lineno; ; break;} case 74: { // thr // System.err.println("COUPLE FORMED:"+$3.text+" - "+$4.text); yyval=new NslCoupleNode(yyvs.tth(-1),yyvs.tth(0)); //npp.addGenCode(" /*[ ",$2); yyval.text=yyvs.tth(0).text; yyval.charno = yyvs.tth(0).charno; //+($4.text).length(); yyval.lineno = yyvs.tth(0).lineno; ; break;} case 75: { //if ($2!=null) System.err.println("nslInst2: done "+$2.text); //else System.err.println("nslInst2: done: VOID ARGS"); if (yyvs.tth(-1)==null) { yyval=yyvs.tth(-2); yyval.text="()"; } else { yyval=yyvs.tth(-2); yyval.text="("+((ExprsNode)yyvs.tth(-1)).code0+")";} //npp.addGenCode($3.text+"]*/",$3); //if ($2!=null)System.err.println("I'm in nslArgs: "+$2.text); ; break;} case 76: { if (yyvs.tth(-1)!=null) System.err.println("Error: Module must be abstract! "+yyvs.tth(-1).text); else { //System.err.println("debug: nslInst2: done: VOID PARS"); } // thr if (yyvs.tth(-1) != null) npp.addLocalVar((ParamsNode)(yyvs.tth(-1))); yyval=yyvs.tth(-1); //npp.addGenCode($3.text+"]*/",$3); //if ($2!=null)System.err.println("I'm in nslPars: "+$2.text); ; break;} case 79: { npp.addGenCode("",yyvs.tth(-7)); MethodNode mn = new MethodNode((new FormalNode(yyvs.tth(-6), yyvs.tth(-5)))); npp.startMethod(mn); // thr if (yyvs.tth(-3) != null) npp.addLocalVar((ParamsNode)(yyvs.tth(-3))); // 98/7/30 aa: changed CALLFROMCONST to CALLFROMCONSTRBOTTOM and // changed flag name to exists_callFromConstructor if (mn.method_type==MethodNode.CALLFROMCONSTR) (npp.getCurClass()).exists_callFromConstructor=true; // System.err.println("^^^^^^^^ GOT callfromConst"); if (mn.method_type==MethodNode.CALLFROMCONSTRBOTTOM) (npp.getCurClass()).exists_callFromConstructorBottom=true; // System.err.println("^^^^^^^^ GOT callfromConst"); if (mn.method_type==MethodNode.CALLFROMCONSTRTOP) (npp.getCurClass()).exists_callFromConstructorTop=true; //System.err.println("^^^^^^^^ GOT callfromConst"); // npp.setCurMethodParams((ParamsNode)$6); npp.getCurMethod().makeInstSpecialProcess(npp); /* ((TypeNode)$2).addDim($7);*/ ; break;} case 80: { /* check name: makeinst, makeconn, init, execute, finalprint. check access flag check return value check duplicates check parameter: any parameter set in the mentioned method? */ npp.endMethod(yyvs.tth(0)); yyval = yyvs.tth(0); ; break;} case 82: { // 98/8/25 aa took out //System.err.println("debug: ============= CONSTRUCTOR ==========******"); npp.addGenCode("",yyvs.tth(-3)); ConstructorNode cn = new ConstructorNode(yyvs.tth(-1)); npp.startConstructor(cn); ; break;} case 83: { /* check name-match check parameter */ npp.setCurConstructorParams((ParamsNode)yyvs.tth(-5)); // thr if (yyvs.tth(-5) != null) npp.addLocalVar((ParamsNode)(yyvs.tth(-5))); npp.endConstructor(yyvs.tth(-5)); yyval = yyvs.tth(-5); ; break;} case 88: { ; break;} case 89: { ; break;} case 90: { yyval = yyvs.tth(0); ; break;} case 91: { yyval = yyvs.tth(0); ; break;} case 92: { yyval = null; ; break;} case 93: { yyval = yyvs.tth(0); //System.err.println(" >>>>>>>>> PARAMS:"+$$.text); ; break;} case 94: { yyval = new ParamsNode((FormalNode)yyvs.tth(0)); ; break;} case 95: { yyval = yyvs.tth(-2); ((ParamsNode)yyval).addTail((FormalNode)yyvs.tth(0)); ; break;} case 96: { ((TypeNode)yyvs.tth(-2)).addDim(yyvs.tth(0)); yyval = (YYtoken) (new FormalNode(yyvs.tth(-2), yyvs.tth(-1))); // thr- addLocalVar done later // npp.addLocalVar((FormalNode)($$)); /* | JAVAREFDECL | CARRAYDECL ';' */ ; break;} case 97: {//System.out.println("GOT SPECIAL on :"+$2.text); npp.addGenCode("",yyvs.tth(-1));; break;} case 100: { /* create local symbols */ yyval = yyvs.tth(-3); FormalNode fn = (new FormalNode(yyvs.tth(-3), yyvs.tth(-2))); fn.type.addDim(yyvs.tth(-1)); npp.addLocalVar(fn); if ((yyvs.tth(-3).text).equals("NslFloat0") || (yyvs.tth(-3).text).equals("NslFloat1") || (yyvs.tth(-3).text).equals("NslFloat2") || (yyvs.tth(-3).text).equals("NslFloat3") || (yyvs.tth(-3).text).equals("NslFloat4") || (yyvs.tth(-3).text).equals("NslInt0") || (yyvs.tth(-3).text).equals("NslInt1") || (yyvs.tth(-3).text).equals("NslInt2") || (yyvs.tth(-3).text).equals("NslInt3") || (yyvs.tth(-3).text).equals("NslInt4") || (yyvs.tth(-3).text).equals("NslDouble0") || (yyvs.tth(-3).text).equals("NslDouble1") || (yyvs.tth(-3).text).equals("NslDouble2") || (yyvs.tth(-3).text).equals("NslDouble3") || (yyvs.tth(-3).text).equals("NslDouble4") || (yyvs.tth(-3).text).equals("NslString0") ) System.err.println("warning- Expected paranthesis after \""+yyvs.tth(-3).text+"\" in line "+(yyval.lineno+1)); ; break;} case 101: { yyval = yyvs.tth(-4); FormalNode fn = (new FormalNode(new TypeNode((TypeNode)yyvs.tth(-4)), yyvs.tth(-2))); fn.type.addDim(yyvs.tth(-1)); npp.addLocalVar(fn); ; break;} case 112: { yyval = yyvs.tth(0);; break;} case 113: { yyval = yyvs.tth(0); npp.pushScope();; break;} case 114: { yyval = yyvs.tth(0); npp.popScope();; break;} case 117: { /* YmodifierList is non null */ NslInstNode ni=(NslInstNode)yyvs.tth(0); npp.addGenCode( ni.typestring+" "+ni.variablename+" = new "+ ni.typestring+ni.arguments ,yyvs.tth(0)); // System.err.println("debug: nslInstantiation-"+ni.variablename+" = new "+ni.typestring); ; break;} case 122: { yyval = yyvs.tth(-1); //System.err.println("-- Expression Statement"); if (!(yyvs.tth(-1) instanceof NslInstNode)) { ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(0)); } ; break;} case 124: { //System.out.print("if "+$1.charno+" 1st p "+$2.charno+" expr "+$3.charno+" 2nd p "+$4.charno); //System.err.println("-- if Statement"); yyval = yyvs.tth(-2); ((ExprNode)yyval).genCode(npp); //System.out.println(" output "+$$.charno+" end "+$4.charno); npp.addGenCode((ExprNode)yyval, yyvs.tth(-1)); ; break;} case 125: { //System.err.println("-- if-else Statement"); yyval = yyvs.tth(-4); ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(-3)); ; break;} case 126: { //System.err.println("-- while Statement"); yyval = yyvs.tth(-2); ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(-1) ); ; break;} case 127: { //System.err.println("-- do-while Statement"); yyval = yyvs.tth(-2); ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(-1)); ; break;} case 129: {// MULTIPLEX //System.err.println("-- multpiple to multiple connect Statement"); npp.addGenCode(" /* conn",yyvs.tth(-10)) ; npp.addGenCode("; */",yyvs.tth(0)) ; String expandedconn=((PortListNode)yyvs.tth(-7)).multiplex((PortListNode)yyvs.tth(-3)); npp.addGenCode(expandedconn,yyvs.tth(-10).lineno+1,0, 0,-1); ; break;} case 130: {// FAN-IN //System.err.println("-- multiple to one connect Statement"); npp.addGenCode(" /* conn",yyvs.tth(-8)) ; npp.addGenCode("; */",yyvs.tth(0)) ; String expandedconn=((PortListNode)yyvs.tth(-5)).fanin(yyvs.tth(-2).text); npp.addGenCode(expandedconn,yyvs.tth(-8).lineno+1,0, 0,-1); ; break;} case 131: {// FAN-OUT //System.err.println("-- one to multiple connect Statement"); npp.addGenCode(" /* conn",yyvs.tth(-8)) ; npp.addGenCode("; */",yyvs.tth(0)) ; npp.addGenCode(" /* conn",yyvs.tth(-8)) ; npp.addGenCode("; */",yyvs.tth(0)) ; String expandedconn=((PortListNode)yyvs.tth(-3)).fanout(yyvs.tth(-6).text); npp.addGenCode(expandedconn,yyvs.tth(-8).lineno+1,0, 0,-1); ; break;} case 132: { //System.err.println("-- one to one connect Statement"); npp.addGenCode("nslConnect",yyvs.tth(-6)); //npp.addGenCode(PortListNode.root(($3).text)+",\""+PortListNode.tail(($3).text)+"\"",$3); //npp.addGenCode(PortListNode.root(($5).text)+",\""+PortListNode.tail(($5).text)+"\"",$5); yyval=yyvs.tth(0); ; break;} case 133: { //System.err.println("-- nsl operators Statement"); npp.addGenCode(NslConvert(yyvs.tth(-3).text),yyvs.tth(-3));; break;} case 139: { //System.err.println("-- nsl return ? Statement"); yyval = yyvs.tth(-1); ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(0)); ; break;} case 141: { //System.err.println("-- throw Statement"); yyval = yyvs.tth(-1); ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(0)); ; break;} case 142: { //System.err.println("-- synchronized Statement"); yyval = yyvs.tth(-2); ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(-1)); ; break;} case 146: { //System.err.println("-- switch Statement"); yyval = yyvs.tth(-2); ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(-1)); ; break;} case 147: { //System.err.println("-- case Statement"); yyval = yyvs.tth(-2); ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(-1)); ; break;} case 150: { //System.err.println("-- optExpression"); yyval = yyvs.tth(-1); ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(0)); ; break;} case 152: { //System.err.println("-- forInit"); yyval = yyvs.tth(-1); ((ExprNode)yyval).genCode(npp); npp.addGenCode((ExprNode)yyval, yyvs.tth(0)); ; break;} case 154: { yyval=yyvs.tth(-1); ; break;} case 155: { npp.addGenCode("/* verbatim NSLJ */",yyvs.tth(0)); vlang='J'; ; break;} case 156: { npp.addGenCode("/* verbatim NSLC */",yyvs.tth(0)); vlang='C'; ; break;} case 157: { if (vlang=='J') { npp.addGenCode("/* verbatim off */",yyvs.tth(0)); } else { npp.addGenCode("off */",yyvs.tth(0)); } ; break;} case 160: { //System.err.println("-- expressionStatement"); yyval = yyvs.tth(0); ((ExprNode)yyval).genCode(npp); ; break;} case 161: { // System.err.println("-- expressionStatement list"); ((ExprsNode)(yyvs.tth(-2))).addTail(yyvs.tth(0)); ((ExprNode)yyvs.tth(0)).genCode(npp); yyval = yyvs.tth(-2); ; break;} case 166: { ; break;} case 168: { yyval = npp.resolveVar(yyvs.tth(0)); TypeNode t= ((ExprNode)(yyval)).type; if (t==null) ((ExprNode)yyval).nslSymbol=false; else if (t.nslNumeric || t.nslBool) ((ExprNode)yyval).nslSymbol=true; else ((ExprNode)yyval).nslSymbol=false; /* System.err.println("&&&&&& HEY HEY &&&&&& for "+$1.text); if (((ExprNode)($$)).type==null) System.err.println(" && Cannot resolve variable: "+($1).text); else System.err.println(" && Resolved Variable: "+($1).text+" with type:"+((ExprNode)($$)).type); */ ; break;} case 169: { yyval = yyvs.tth(0); ; break;} case 170: { YYtoken n = npp.resolveVar(yyvs.tth(-2)); yyval = new ArrayIndexNode((ExprNode)n, ((ExprNode)(yyvs.tth(-1)))); // System.err.println("The begining of an array: "+$1.text+" ["+$2+"]"); if (((ArrayIndexNode)yyval).getDim()<0) { yyerror("Invalid Array - addressing Dim="+((ArrayIndexNode)yyval).getDim()); } // int errcode = ((ArrayIndexNode)$$).genCode(npp); // System.out.println("code#"+errcode+"\t"+((ArrayIndexNode)$$).code); ; break;} case 171: { yyval = yyvs.tth(0);; break;} case 172: { yyval = new TrinaryExprNode((ExprNode)yyvs.tth(-4), (ExprNode)yyvs.tth(-2), (ExprNode)yyvs.tth(0)); ; break;} case 173: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 174: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 175: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 176: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 177: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 178: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 179: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 180: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 181: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 182: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 183: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 184: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 185: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 186: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 187: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 188: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 189: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 190: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 191: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 192: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 193: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 194: { yyvs.tth(0).charno = yyvs.tth(-1).charno; yyvs.tth(0).lineno = yyvs.tth(-1).lineno; yyval = new UnaryExprNode((ExprNode)yyvs.tth(0), '-'); ; break;} case 195: { yyvs.tth(0).charno = yyvs.tth(-1).charno; yyvs.tth(0).lineno = yyvs.tth(-1).lineno; yyval = new UnaryExprNode((ExprNode)yyvs.tth(0), '+'); ; break;} case 196: { yyvs.tth(0).charno = yyvs.tth(-1).charno; yyvs.tth(0).lineno = yyvs.tth(-1).lineno; yyval = new UnaryExprNode((ExprNode)yyvs.tth(0), '!'); ; break;} case 197: { yyvs.tth(0).charno = yyvs.tth(-1).charno; yyvs.tth(0).lineno = yyvs.tth(-1).lineno; yyval = new UnaryExprNode((ExprNode)yyvs.tth(0), '~'); ; break;} case 198: { yyval = yyvs.tth(-2); ; break;} case 199: {yyval=yyvs.tth(0);; break;} case 200: {yyval = yyvs.tth(0);; break;} case 201: {yyval = new SpecialExprNode(yyvs.tth(0), SpecialExprNode.SUPER);; break;} case 202: {yyval =new SpecialExprNode(yyvs.tth(0), SpecialExprNode.THIS);; break;} case 203: {yyval =new SpecialExprNode(yyvs.tth(0), SpecialExprNode.NULL);; break;} case 204: { yyval = yyvs.tth(0);; break;} case 205: { yyvs.tth(-1).charno = yyvs.tth(-2).charno; yyvs.tth(-1).lineno = yyvs.tth(-2).lineno; yyval = yyvs.tth(-1);; break;} case 206: { yyvs.tth(-1).charno = yyvs.tth(-2).charno; yyvs.tth(-1).lineno = yyvs.tth(-2).lineno; yyval = npp.resolveVar(yyvs.tth(-1)); /* if (((ExprNode)($$)).type==null) System.out.println("Cannot resolve variable: "+($2).text); else System.out.println("Resolved Variable: "+($2).text); */ ; break;} case 207: { yyval = new ArrayIndexNode((ExprNode)yyvs.tth(-3),(ExprNode)yyvs.tth(-1)); // System.err.println("Array continued: "+$1.text+" ["+$3+"]"); if (((ArrayIndexNode)yyval).getDim()<0) { yyerror("Invalid Array -- addressing.Dim="+((ArrayIndexNode)yyval).getDim()); } // ((ArrayIndexNode)$$).genCode(npp); ; break;} case 208: { yyval = new ArrayIndexNode((ExprNode)yyvs.tth(-3),(ExprNode)yyvs.tth(-1)); if (((ArrayIndexNode)yyval).getDim()<0) { yyerror("Invalid Array --- addressing.Dim="+((ArrayIndexNode)yyval).getDim()); } // ((ArrayIndexNode)$$).genCode(npp); ; break;} case 209: { yyval = yyvs.tth(-2); ((ExprNode)yyval).code += ('.'+yyvs.tth(0).text); ; break;} case 210: { yyval = yyvs.tth(0);; break;} case 211: { //System.err.println("Asignment: "+$1.text+" = "+$3.text); yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); // ((BinaryExprNode)$$).genCode(npp); ; break;} case 212: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 213: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 214: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 215: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 216: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 217: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 218: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 219: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 220: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 221: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 222: { yyval = new BinaryExprNode((ExprNode)yyvs.tth(-2), yyvs.tth(-1), (ExprNode)yyvs.tth(0)); ; break;} case 223: { yyvs.tth(0).charno = yyvs.tth(-1).charno; yyvs.tth(0).lineno = yyvs.tth(-1).lineno; yyval = new UnaryExprNode((ExprNode)yyvs.tth(0), UnaryExprNode.PRE_INCR); ; break;} case 224: { yyvs.tth(0).charno = yyvs.tth(-1).charno; yyvs.tth(0).lineno = yyvs.tth(-1).lineno; yyval = new UnaryExprNode((ExprNode)yyvs.tth(0), UnaryExprNode.PRE_DECR); ; break;} case 225: { yyval = new UnaryExprNode((ExprNode)yyvs.tth(-1), UnaryExprNode.POST_INCR); ; break;} case 226: { yyval = new UnaryExprNode((ExprNode)yyvs.tth(-1), UnaryExprNode.POST_DECR); ; break;} case 227: { yyval = yyvs.tth(0);; break;} case 228: { yyval = yyvs.tth(0);; break;} case 229: { NslInstNode ni=(NslInstNode)yyvs.tth(0); npp.addGenCode( ni.variablename+" = new "+ ni.typestring,yyvs.tth(0)); // Catch NslNumerics within methods and add new // System.err.println("debug: nslInstantiation-"+ni.variablename+" = new "+ni.typestring); ; break;} case 230: { int separator = yyvs.tth(-3).text.lastIndexOf('.'); if(separator != -1 && yyvs.tth(-3).text.indexOf('.')==separator) { // contains dot YYtoken tmptoken = new YYtoken(YYtokentypes.SYMBOL, yyvs.tth(-3).text.substring(0,separator), yyvs.tth(-3).lineno, yyvs.tth(-3).charno, yyvs.tth(-3).charno0); // token.text =method_sym.text.substring(0,separator); yyvs.tth(-3).text = yyvs.tth(-3).text.substring(separator+1); ExprNode expr = (ExprNode)npp.resolveVar(tmptoken); /* if (expr.type == null) { System.out.println("null type error!!!"); } */ yyval = new MethodCallNode((ExprNode)npp.resolveVar(tmptoken), yyvs.tth(-3), (ExprsNode)yyvs.tth(-1)); } else /* we do nothing to the methodCall at the current stage */ yyval = new MethodCallNode(yyvs.tth(-3), (ExprsNode)yyvs.tth(-1)); ; break;} case 231: { yyval = new MethodCallNode((ExprNode)yyvs.tth(-5), yyvs.tth(-3), (ExprsNode)yyvs.tth(-1)); ; break;} case 232: { //System.err.println("HERE!@!@@#!# for "+$1.text); // $1.charno = $2.charno; // $1.lineno = $2.lineno; // npp.addGenCode("[",$2); // npp.addGenCode(NslConvert($1.text),$1); yyval = new MethodCallNode((YYtoken)(yyvs.tth(-3)), (ExprsNode)yyvs.tth(-1)); ((MethodCallNode)yyval).expandedname=NslConvert(yyvs.tth(-3).text); ((MethodCallNode)yyval).processed=true; ; break;} case 233: { if (!(yyvs.tth(-1) instanceof ExprsNode)) yyval = new MethodCallNode((YYtoken)(yyvs.tth(-3)), (ExprsNode)(new ExprsNode(yyvs.tth(-1)))); else yyval = new MethodCallNode((YYtoken)(yyvs.tth(-3)), (ExprsNode)yyvs.tth(-1)); ((MethodCallNode)yyval).expandedname=NslConvert(yyvs.tth(-3).text); ((MethodCallNode)yyval).processed=true; ; break;} case 234: { yyvs.tth(-3).charno = yyvs.tth(-4).charno; yyvs.tth(-3).lineno = yyvs.tth(-4).lineno; /* check things like (NslDouble2d) x, where x is a NslInt2d */ ((TypeNode)yyvs.tth(-3)).addDim(yyvs.tth(-2)); /* check dimension */ /* do some process in expression creation */ yyval = new CastNode((TypeNode)(yyvs.tth(-3)), (ExprNode)(yyvs.tth(0))); // ((CastNode)$$).genCode(npp); ; break;} case 235: { yyvs.tth(-2).charno = yyvs.tth(-3).charno; yyvs.tth(-2).lineno = yyvs.tth(-3).lineno; yyval = new CastNode(new TypeNode(TypeNode.CLASS, (yyvs.tth(-2))), (ExprNode)(yyvs.tth(0))); // ((CastNode)$$).genCode(npp); ; break;} case 236: { yyvs.tth(-4).charno = yyvs.tth(-5).charno; yyvs.tth(-4).lineno = yyvs.tth(-5).lineno; TypeNode n = new TypeNode(TypeNode.CLASS, yyvs.tth(-4)); n.addDim(1); n.addDim(yyvs.tth(-2)); yyval = new CastNode(n, (ExprNode)(yyvs.tth(0))); // ((CastNode)$$).genCode(npp); ; break;} case 237: { //(new TypeNode($2)).addDim(((ExprsNode) ($4)).list.size()); TypeNode tn = new TypeNode(yyvs.tth(-2)); tn.addDim(((ExprsNode) (yyvs.tth(0))).list.size()); yyval = (YYtoken)(new NewNode(tn, (ExprsNode)(yyvs.tth(0)), null)); ; break;} case 238: { TypeNode tn = new TypeNode(yyvs.tth(-2)); tn.addDim(((ExprsNode) (yyvs.tth(0))).list.size()); yyval = (YYtoken)(new NewNode(tn, (ExprsNode)(yyvs.tth(0)), null)); ; break;} case 239: { yyval = (YYtoken)(new NewNode(new TypeNode(yyvs.tth(0)), null, null)); ; break;} case 240: { yyval = (YYtoken)(new NewNode(new TypeNode(yyvs.tth(-3)), null, (ExprsNode)(yyvs.tth(-1)))); //npp.addGenCode("new",$1); ; break;} case 241: { yyval = (YYtoken)(new NewNode(new TypeNode(yyvs.tth(-3)), null, (ExprsNode)(yyvs.tth(-1)))); ; break;} case 242: { npp.addGenCode("",yyvs.tth(-5)); /* remove the first word */ yyval = (YYtoken)(new NewNode(new TypeNode(yyvs.tth(-3)),null,(ExprsNode)(yyvs.tth(-1)))); ((NewNode)yyval).processed=true; //-ERH:not required ExprNode left = new ExprNode(yyvs.tth(-5)); left.charno = yyvs.tth(-5).charno; left.lineno = yyvs.tth(-5).lineno; YYtoken op = new YYtoken('=',"="); //ERH: check this ExprNode right = (ExprNode)yyval; yyval = new BinaryExprNode(left,op,right); ((BinaryExprNode)yyval).processed=true; ; break;} case 243: { /* This was once used to lexically convert new-less instantiations to reguler new statements //convert newless statement /// System.out.println("// CATCH:"+$1.text+" "+$2.text+" "+$4.text); //#1 npp.addGenCode($2.text+" = new "+$1.text,$1); //#1 npp.addGenCode("",$2); // remove variable name */ npp.addGenCode("",yyvs.tth(-4)); /* remove the first word */ yyval = (YYtoken)(new NewNode(new TypeNode(yyvs.tth(-4)),null,(ExprsNode)(yyvs.tth(-2)))); ((NewNode)yyval).processed=true; //-ERH:not required ExprNode left = new ExprNode(yyvs.tth(0)); left.charno = yyvs.tth(-4).charno; left.lineno = yyvs.tth(-4).lineno; YYtoken op = new YYtoken('=',"="); //ERH: check this ExprNode right = (ExprNode)yyval; yyval = new BinaryExprNode(left,op,right); ((BinaryExprNode)yyval).processed=true; ; break;} case 244: { yyval=new ExprsNode(yyvs.tth(-1)); ; break;} case 245: { yyval=yyvs.tth(0); ((ExprsNode)(yyval)).addHead(yyvs.tth(-3)); ; break;} case 246: { yyval=yyvs.tth(-1); { int count = ((Int_Token)(yyvs.tth(0))).int_val; while (count-- > 0) ((ExprsNode)(yyval)).addTail((YYtoken)null); } ; break;} case 247: { yyval = null; ; break;} case 248: { if (yyvs.tth(-2)==null) yyval = (YYtoken) (new Int_Token(YYtokentypes.nt_optArrayBounds, yyvs.tth(-1), 1)); else { ((Int_Token)(yyvs.tth(-2))).int_val ++; yyval = yyvs.tth(-2); } ; break;} case 249: {yyval = new ExprNode(new TypeNode(TypeNode.INT, yyvs.tth(0)), yyvs.tth(0));; break;} case 250: {yyval = new ExprNode(new TypeNode(TypeNode.STRING, yyvs.tth(0)), yyvs.tth(0));; break;} case 251: {yyval = new ExprNode(new TypeNode(TypeNode.CHAR, yyvs.tth(0)), yyvs.tth(0));; break;} case 252: {yyval = new ExprNode(new TypeNode(TypeNode.LONG, yyvs.tth(0)), yyvs.tth(0));; break;} case 253: {yyval = new ExprNode(new TypeNode(TypeNode.FLOAT, yyvs.tth(0)), yyvs.tth(0));; break;} case 254: {yyval = new ExprNode(new TypeNode(TypeNode.DOUBLE, yyvs.tth(0)), yyvs.tth(0));; break;} case 255: {yyval = new ExprNode(new TypeNode(TypeNode.BOOL, yyvs.tth(0)), yyvs.tth(0));; break;} case 256: {yyval = new ExprNode(new TypeNode(TypeNode.BOOL, yyvs.tth(0)), yyvs.tth(0));; break;} case 257: { yyval = null; // System.err.println("optArgumentList: returning NULL"); ; break;} case 258: { yyval = yyvs.tth(0); // System.err.println("optArgumentList: returning: "+$1.text); ; break;} case 259: { yyval = new ExprsNode(yyvs.tth(0)); // System.err.println("argumentList: evluating the last expression "+$1.text); ; break;} case 260: { if(yyvs.tth(0)!=null)((ExprsNode)yyvs.tth(-2)).addTail(yyvs.tth(0)); yyval = yyvs.tth(-2); // System.err.println("argumentList: evluating an expression "+$3.text); ; break;} case 261: { yyval = (YYtoken) (new TypeNode(TypeNode.CLASS, yyvs.tth(-2))); ((TypeNode)yyval).addDim(1); // for the first pair of blanket ((TypeNode)yyval).addDim(yyvs.tth(-1)); ; break;} case 262: { yyval = (YYtoken) (new TypeNode(TypeNode.CLASS, yyvs.tth(0))); ; break;} case 263: { if((yyvs.tth(0))!=null) { ((TypeNode)yyvs.tth(-1)).addDim(yyvs.tth(0)); } yyval = yyvs.tth(-1); ; break;} case 264: { yyval=yyvs.tth(-1); /* = npp.resolveVar($1); if (((ExprNode)($$)).type==null) System.out.println("Cannot resolve variable: "+($1).text); else System.out.println("Resolved Variable: "+($1).text); */ ; break;} case 266: {yyval=yyvs.tth(0);; break;} case 267: { yyval = (YYtoken) (new TypeNode(TypeNode.BOOL, yyvs.tth(0))); ; break;} case 268: { yyval = (YYtoken) (new TypeNode(TypeNode.BYTE, yyvs.tth(0))); ; break;} case 269: { yyval = (YYtoken) (new TypeNode(TypeNode.CHAR, yyvs.tth(0))); ; break;} case 270: { yyval = (YYtoken) (new TypeNode(TypeNode.SHORT, yyvs.tth(0))); ; break;} case 271: { yyval = (YYtoken) (new TypeNode(TypeNode.INT, yyvs.tth(0))); ; break;} case 272: { yyval = (YYtoken) (new TypeNode(TypeNode.FLOAT, yyvs.tth(0))); ; break;} case 273: { yyval = (YYtoken) (new TypeNode(TypeNode.LONG, yyvs.tth(0))); ; break;} case 274: { yyval = (YYtoken) (new TypeNode(TypeNode.DOUBLE, yyvs.tth(0))); ; break;} case 275: { yyval = (YYtoken) (new TypeNode(TypeNode.STRING, yyvs.tth(0))); yyval.text = "String"; npp.addGenCode("String", yyvs.tth(0)); ; break;} case 276: { yyval = (YYtoken) (new TypeNode(TypeNode.VOID, yyvs.tth(0))); ; break;} case 307: { yyval = yyvs.tth(0); ; break;} case 308: { (yyvs.tth(-2)).text += ("."+(yyvs.tth(0)).text); (yyvs.tth(-2)).tokentype = YYtokentypes.nt_qualifiedSymbol; yyval = yyvs.tth(-2);; break;} case 309: { yyval = yyvs.tth(0); ; break;} case 310: { (yyvs.tth(0)).text = ((yyvs.tth(-2)).text+"."+(yyvs.tth(0)).text); (yyvs.tth(0)).tokentype = YYtokentypes.nt_qualifiedSymbol; yyval = yyvs.tth(0);; break;} case 311: { (yyvs.tth(0)).text = ((yyvs.tth(-2)).text+"."+(yyvs.tth(0)).text); (yyvs.tth(0)).tokentype = YYtokentypes.nt_qualifiedSymbol; yyval = yyvs.tth(0);; break;} case 312: { yyval = new PortListNode(yyvs.tth(0)); ; break;} case 313: { /* if($3!=null)((PortListNode)$1).addHead($3); $$=$1; */ if(yyvs.tth(-2)!=null)((PortListNode)yyvs.tth(0)).addHead(yyvs.tth(-2)); yyval=yyvs.tth(0); yyval.text =yyvs.tth(-2).text+yyvs.tth(-1).text+yyval.text; ; break;} case 316: { yyval = yyvs.tth(0) ; ; break;} } if(yyreturn != YYCONTINUE) return yyreturn; yyvs.popn(yylen); yyss.popn(yylen); /* yyls.popn(yylen)*/ if (yydebug > 0) { stackdump("state stack now"); } yyvs.push(yyval); /* yylsp++;*/ if (yylen == 0) { /*remind: yyls.push(yylloc); yyls.last_line = (yylsp-1)->last_line; yyls.last_column = (yylsp-1)->last_column; yyls.text = 0; */ } else { /* remind: yylsp.last_line = (yylsp+yylen-1)->last_line; yylsp.last_column = (yylsp+yylen-1)->last_column; */ } /* Now "shift" the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + yyss.peek(); if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == yyss.peek()) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; {Goto = yynewstate; break branch;} case yyerrlab: /* here on detecting error */ if (yyerrstatus == 0) /* If not already recovering from an error, report this error. */ { ++yynerrs; yyverror("parse error"); } // {Goto = yyerrlab1; break branch;} case yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { /* if just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) return YYABORT; if (yydebug > 0) { yyout.print("Discarding token "); yyout.print(yychar); yyout.print(" ("); yyout.print(yytname[yychar1]); yyout.print(").\n"); } yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ {Goto = yyerrhandle; break branch;} case yyerrdefault: /* current state does not do anything special for the error token. */ /* if 0 // This is wrong; only states that explicitly want error tokens // should shift them. yyn = yydefact[yystate]; // If its default is to accept any token, ok. Otherwise pop it. if (yyn) {Goto = yydefault; break branch;} */ case yyerrpop: /* pop the current state because it cannot handle the error token */ if (yyss.empty()) return YYABORT; yyvs.popn(1); yystate = yyss.pop(); /* yyls.popn(1);*/ if (yydebug > 0) { stackdump("Error: state stack now"); } case yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) {Goto = yyerrdefault; break branch;} yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) {Goto = yyerrdefault; break branch;} yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) {Goto = yyerrpop; break branch;} yyn = -yyn; {Goto = yyreduce; break branch;} } else if (yyn == 0) {Goto = yyerrpop; break branch;} if (yyn == YYFINAL) return YYACCEPT; if (yydebug > 0) {yyout.println("Shifting error token, ");} yyvs.push(yylval); /* yyls.push(yyloc);*/ yystate = yyn; // {Goto = yynewstate; break branch;} }//switch }//for(;;) } // parse protected void stackdump(String s) { int i; int x; int ssp1 = yyss.depth(); yyout.print(s); for(i=0;i YYFLAG && yyn < YYLAST) { int size = msg0.length(); StringBuffer msg; int yychar1; // a TRANSLATEd char value int count; count = 0; /* Start yychar1 at -yyn if nec to avoid negative indexes in yycheck.*/ for (yychar1 = (yyn < 0 ? -yyn : 0); (yyn+yychar1) < (yytname.length); yychar1++) { if((yyn+yychar1) < yycheck.length && yycheck[yyn+yychar1] == yychar1) { size += (yytname[yychar1].length()) + 15; count++; } } msg = new StringBuffer(size+15); msg.append(msg0); msg.append("(state " + Integer.toString(yystate) + ")"); yychar1 = (yyn < 0)? - yyn :0; for(count=0,yychar1 = (yyn < 0 ? -yyn : 0); (yyn+yychar1) < (yytname.length) && count < 5; yychar1++) { if((yyn+yychar1) < yycheck.length && yycheck[yyn+yychar1] == yychar1) { msg.append(count == 0 ? ", expecting `" : " or `"); msg.append(yytname[yychar1]); msg.append("'"); count++; } } return msg.toString(); } return msg0; } public void yyerror(String msg, boolean verbose, boolean dumpstack) throws ParseException { String s; if(verbose) { s = yyerror_verbose(msg); } else { s = msg; } yyout.print("yyerror: "); if(yylval.tokentype == YYEOF) { yyout.print("at end of file"); } else { yyout.print("line "); yyout.print(yylval.lineno()+1); yyout.print(" char "); yyout.print(yylval.charno()+1); } yyout.println(" ; " + s); if(dumpstack) { stackdump("yyerror: state stack"); } throw new ParseException(s); } public void yyerror(String s, boolean verbose) throws ParseException { yyerror(s,verbose,false); } public void yyerror(String s) throws ParseException { yyerror(s,false,false); } public void yyreturn(int t) {yyreturn = t;} public void setdebug(boolean i) {yydebug = i?1:0;} public void setdebug(int i) {yydebug = i>0?i:0;} // SUFFIX /* put suffix code here */ /* Override yyerror */ public void yyverror(String s) throws ParseException { /* String msg = yyerror_verbose(s); System.out.println("yyverror:" + msg); */ yyerror(s, true); //throw new ParseException(s); } protected NslPreProcessor npp; public void init(NslPreProcessor p) { npp = p; // YYtoken.npp = p; } String remArrDims(String s) { String res; char c,oldc; res="["; oldc='['; // 98/8/25 aa: too many print statements //System.err.println("debug: Entering:"+s); for (int i=0;i CONVERT: ["+s+"]"); if (s.equals("nslPrint")) return("System.out.print"); if (s.equals("nslPrintln")) return("System.out.println"); if (s.equals("nslprint")) return("System.out.print"); if (s.equals("nslprintln")) return("System.out.println"); if (s.equals("NslPrint")) return("System.out.print"); if (s.equals("NslPrintln")) return("System.out.println"); //if (s.equals("nslAdd")) return "system.nsladd.eval"; if (s.equals("nslAdd")) return "NslAdd.eval"; if (s.equals("nslConv")) return "NslConv.eval"; if (s.equals("nslConvzero")) return "NslConvZero.eval"; if (s.equals("nslConvW")) return "NslConvW.eval"; if (s.equals("nslConvC")) return "NslConvC.eval"; // cannot have NslDiff because we would need static // and abstract methods cannot also be static if (s.equals("nslDiff")) return "system.nsldiff.eval"; if (s.equals("nslFillColumns")) return "NslFillColumns.eval"; if (s.equals("nslFillRows")) return "NslFillRows.eval"; if (s.equals("nslMath")) return "system.nslmath.eval"; if (s.equals("nslMaxValue")) return "NslMaxValue.eval"; if (s.equals("nslMinValue")) return "NslMinValue.eval"; if (s.equals("nslProd")) return "NslProd.eval"; if (s.equals("nslProduct")) return "NslProd.eval"; if (s.equals("nslRamp")) return "NslRamp.eval"; if (s.equals("nslSaturation")) return "NslSaturation.eval"; if (s.equals("nslSigmoid")) return "NslSigmoid.eval"; if (s.equals("nslSigmoid2")) return "NslSigmoid2.eval"; if (s.equals("nslStep")) return "NslStep.eval"; if (s.equals("nslSub")) return "NslSub.eval"; if (s.equals("nslTrans")) return "NslTrans.eval"; if (s.equals("nslSum")) return "NslSum.eval"; if (s.equals("nslSumRows")) return "NslSumRows.eval"; if (s.equals("nslSumColumns")) return "NslSumColumns.eval"; if (s.equals("nslMaxElem")) return "NslMaxElem.eval"; if (s.equals("nslMinElem")) return "NslMinElem.eval"; if (s.equals("nslGetSector")) return "NslGetSector.eval"; if (s.equals("nslSetSector")) return "NslSetSector.eval"; if (s.equals("nslElemMult")) return "NslElemMult.eval"; if (s.equals("nslElemDiv")) return "NslElemDiv.eval"; if (s.equals("nslConcatenateRows")) return "NslConcatenateRows.eval"; if (s.equals("nslConcatenateColumns")) return "NslConcatenateColumns.eval"; if (s.equals("nslGetRow")) return "NslGetRow.eval"; if (s.equals("nslGetColumn")) return "NslGetColumn.eval"; if (s.equals("nslRandom")) return "NslRandom.eval"; if (s.equals("nslGuassian")) return "NslGuassian.eval"; if (s.equals("nslAll")) return "NslAll.eval"; if (s.equals("nslSome")) return "NslSome.eval"; if (s.equals("nslNone")) return "NslNone.eval"; if (s.equals("nslBound")) return "NslBound.eval"; if (s.equals("nslDotProd")) return "NslDotProd.eval"; // NslOperations if (s.equals("nslRint")) return "NslOperator.rint.eval"; if (s.equals("nslAbs")) return "NslOperator.abs.eval"; if (s.equals("nslPow")) return "NslOperator.pow.eval"; if (s.equals("nslExp")) return "NslOperator.exp.eval"; if (s.equals("nslLog")) return "NslOperator.log.eval"; if (s.equals("nslMaxMerge")) return "NslOperator.max.eval"; if (s.equals("nslMinMerge")) return "NslOperator.min.eval"; if (s.equals("nslCos")) return "NslOperator.cos.eval"; if (s.equals("nslSin")) return "NslOperator.sin.eval"; if (s.equals("nslTan")) return "NslOperator.tan.eval"; if (s.equals("nslArcCos")) return "NslOperator.acos.eval"; if (s.equals("nslArcSin")) return "NslOperator.asin.eval"; if (s.equals("nslArcTan")) return "NslOperator.atan.eval"; if (s.equals("nslSqrt")) return "NslOperator.sqrt.eval"; if (s.equals("nslDistance")) return "NslOperator.distance.eval"; return "UNRECOGNIZED"; } public static final String yytname[] = { "$","error","$undefined.","ERROR", "ABSTRACT","BOOLEAN","BREAK","BYTE","CASE","CATCH","CHAR","CLASS","CONTINUE", "DEFAULT","DO","DOUBLE","EXTENDS","FALSE_TOKEN","FINAL","FINALLY","FLOAT","FOR", "IF","IMPLEMENTS","NSLIMPORT","INSTANCEOF","INT","INTERFACE","LONG","NATIVE", "NULL_TOKEN","PACKAGE","PRIVATE","PROTECTED","PUBLIC","RETURN","SHORT","STATIC", "SUPER","SWITCH","SYNCHRONIZED","THIS","THROW","THROWS","TRANSIENT","VOLATILE", "TRUE_TOKEN","TRY","VOID","WHILE","VERBATIM_OFF","VERBATIM_NSLJ","VERBATIM_NSLC", "NSLJ","NSLMULTI","CONNECT","SPECIAL","NSLMODULE","NSLMODEL","NSLCLASS","ARRAY", "INT_LITERAL","CHARACTER_LITERAL","LONG_LITERAL","FLOAT_LITERAL","DOUBLE_LITERAL", "SYMBOL","STRING_LITERAL","BIT_MUL","STRING","NOT_AN_OPERATOR","SHIFT_RIGHT_EQUALS", "FILL_SHIFT_RIGHT_EQUALS","SHIFT_LEFT_EQUALS","ADD_EQUALS","SUB_EQUALS","MUL_EQUALS", "DIV_EQUALS","MOD_EQUALS","AND_EQUALS","XOR_EQUALS","OR_EQUALS","'='","'?'", "':'","OR","AND","'|'","'&'","'^'","EQUAL_COMPARE","NOT_EQUAL","LTEQ","GTEQ", "'<'","'>'","BITSHIFT_RIGHT","FILL_SHIFT_RIGHT","SHIFT_LEFT","'+'","'-'","'*'", "'/'","'%'","'@'","CAST","INCR","DECR","'!'","'~'","UMINUS","UPLUS","POST_INCR", "POST_DECR","NEW","'('","')'","'['","']'","'.'","LOWER_THAN_ELSE","ELSE","';'", "'{'","'}'","','","compilationUnit","optPackage","importList","nslImport","typeDeclarationList", "typeDeclaration","classDeclaration","nslclassDecl1","nslclassDecl2","nslextends", "nslreturn","nslclassBlock","classDecl1","classDecl2","interfaceDeclaration", "interfaceDecl1","interfaceDecl2","classModifierList","extends","interfaceExtends", "interfaces","classBlock","fieldList","field","CARRAYDECL","Carray","nslInstantiation", "nslCouple","nslArgs","nslPars","staticInitializer","methodDeclaration","methodDecl1", "methodDecl3","constructorDeclaration","constructorDecl1","constructorDecl2", "optThrows","optConstructorStatements","methodBlock","optParameterList","parameterList", "parameter","variableDeclaration","subvariableDeclaration","partialVariable", "optInitializer","initializer","optVariableInitializerList","variableInitializerList", "optComma","compoundStatement","compoundStatement1","compoundStatement2","statementList", "statement","optExpression","forInit","verbatim_line","forIncr","expressionStatements", "optFinally","finally","catchList","catchItem","expression","symbolArrayExpression", "nonSymbolExpression","nonSymbolComplexPrimary","expressionStatement","methodCall", "cast","newExpression","allocationBounds","optArrayBounds","literal","optArgumentList", "argumentList","type","qualifiedSymbolWithLBracket","simpleType","Erh_simpleType", "XmodifierList","modifierList","qualifiedSymbol","portrefSymbol","portrefList", "qualifiedSymbolList","simpleSymbol", null }; public static final int yycheck[] = { 11, 67, 358, 72, 69, 289, 72, 57, 152, 153, 0, 148, 451, 124, 189, 138, 139, 140, 141, 142, 143, 400, 122, 123, 43, 171, 41, 57, 41, 175, 4, 1, 4, 509, 45, 66, 47, 66, 165, 50, 51, 52, 165, 13, 55, 56, 57, 50, 51, 52, 20, 66, 189, 66, 66, 115, 66, 122, 123, 119, 50, 51, 52, 53, 16, 115, 116, 117, 4, 119, 68, 82, 41, 138, 139, 140, 141, 142, 143, 4, 119, 53, 41, 122, 56, 115, 151, 117, 60, 119, 119, 122, 66, 569, 66, 241, 107, 66, 117, 69, 165, 53, 72, 82, 279, 205, 250, 66, 219, 220, 123, 81, 122, 124, 50, 51, 52, 53, 54, 24, 123, 119, 16, 16, 122, 50, 51, 52, 53, 54, 72, 9, 122, 122, 528, 201, 530, 148, 117, 81, 205, 19, 279, 116, 281, 156, 585, 586, 159, 160, 161, 123, 122, 123, 123, 220, 512, 168, 302, 53, 53, 122, 132, 119, 123, 135, 122, 115, 138, 139, 140, 141, 142, 143, 185, 350, 187, 352, 189, 125, 115, 151, 561, 115, 119, 579, 122, 115, 124, 117, 66, 119, 0, 549, 115, 165, 371, 122, 24, 124, 170, 171, 10, 487, 115, 175, 306, 104, 16, 106, 107, 355, 281, 350, 115, 352, 17, 25, 26, 57, 28, 117, 349, 119, 50, 51, 52, 35, 66, 30, 56, 354, 122, 116, 371, 205, 206, 38, 249, 122, 41, 306, 125, 122, 116, 46, 125, 119, 116, 219, 220, 122, 123, 54, 122, 63, 57, 125, 402, 115, 61, 62, 63, 64, 65, 66, 67, 31, 279, 122, 397, 241, 399, 122, 558, 118, 125, 115, 289, 117, 5, 119, 7, 106, 107, 10, 50, 51, 52, 354, 15, 122, 4, 124, 264, 20, 26, 472, 28, 474, 122, 26, 115, 28, 119, 480, 18, 108, 109, 116, 117, 36, 16, 114, 115, 68, 106, 107, 23, 385, 116, 117, 34, 48, 267, 268, 16, 25, 40, 122, 115, 468, 343, 43, 471, 472, 306, 474, 117, 350, 66, 352, 119, 480, 69, 57, 58, 59, 101, 102, 103, 104, 125, 106, 107, 116, 367, 368, 369, 116, 371, 116, 116, 507, 116, 116, 84, 115, 115, 506, 68, 498, 115, 115, 501, 115, 503, 504, 348, 554, 555, 115, 123, 394, 354, 117, 115, 514, 515, 516, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 473, 106, 107, 119, 122, 84, 66, 117, 123, 118, 554, 555, 115, 117, 115, 117, 116, 116, 125, 18, 49, 16, 117, 115, 122, 115, 122, 116, 122, 115, 29, 17, 583, 32, 33, 34, 119, 125, 37, 119, 116, 40, 115, 115, 30, 44, 45, 124, 116, 593, 594, 165, 38, 117, 472, 41, 474, 115, 68, 115, 46, 115, 480, 125, 116, 124, 484, 66, 54, 487, 488, 57, 186, 116, 116, 61, 62, 63, 64, 65, 66, 67, 117, 121, 125, 199, 125, 117, 506, 99, 100, 101, 102, 103, 104, 116, 106, 107, 475, 213, 214, 215, 216, 217, 218, 578, 124, 525, 116, 223, 528, 116, 530, 99, 100, 116, 116, 0, 125, 116, 106, 107, 108, 109, 238, 502, 116, 4, 114, 115, 122, 116, 118, 18, 11, 116, 554, 555, 122, 122, 558, 18, 124, 122, 29, 259, 116, 32, 33, 34, 27, 116, 37, 124, 122, 40, 122, 34, 116, 44, 45, 579, 122, 40, 0, 21, 63, 220, 282, 283, 284, 544, 453, 287, 288, 593, 594, 151, 387, 468, 57, 58, 59, 387, 101, 58, -1, 301, 59, -1, -1, -1, -1, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, -1, -1, -1, 344, 5, 346, 7, -1, 349, 10, 68, -1, -1, -1, 15, -1, 357, 358, 359, 20, -1, 362, -1, -1, -1, 26, -1, 28, -1, -1, -1, -1, -1, -1, 35, 36, 377, -1, 96, 97, 98, 99, 100, 101, 102, 103, 104, 48, 106, 107, -1, -1, -1, -1, -1, 56, 397, 398, 399, 400, -1, -1, -1, 404, -1, 66, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 6, -1, 8, -1, -1, -1, 12, 13, 14, -1, -1, 17, -1, -1, -1, 21, 22, -1, -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, 35, 454, -1, 38, 39, 40, 41, 42, -1, -1, -1, 46, 47, 466, 49, 50, 51, 52, -1, 54, 55, 56, 57, -1, -1, 60, 61, 62, 63, 64, 65, 66, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, 495, -1, 497, 498, -1, -1, 501, -1, 503, 504, -1, -1, -1, -1, 509, -1, -1, 512, -1, 514, 515, 516, 99, 100, -1, -1, -1, -1, -1, 106, 107, 108, 109, -1, -1, -1, -1, 114, 115, -1, -1, 536, -1, -1, 1, 122, 123, 124, -1, 6, -1, 8, -1, 25, 549, 12, 13, 14, -1, -1, 17, -1, -1, -1, 21, 22, 561, -1, -1, -1, -1, -1, -1, 30, 569, -1, -1, -1, 35, -1, -1, 38, 39, 40, 41, 42, -1, -1, -1, 46, 47, -1, 49, 50, 51, 52, 68, 54, 55, 56, 57, -1, -1, 60, 61, 62, 63, 64, 65, 66, 67, 83, -1, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, 99, 100, -1, -1, -1, -1, 1, 106, 107, 108, 109, 6, -1, 8, -1, 114, 115, 12, 13, 14, 25, -1, 17, 122, 123, 124, 21, 22, -1, -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, 39, 40, 41, 42, -1, -1, -1, 46, 47, -1, 49, 50, 51, 52, -1, 54, 55, 56, 57, 68, -1, 60, 61, 62, 63, 64, 65, 66, 67, -1, -1, -1, -1, -1, -1, -1, -1, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, 99, 100, -1, -1, -1, -1, 1, 106, 107, 108, 109, 6, -1, 8, -1, 114, 115, 12, 13, 14, 25, -1, 17, 122, 123, 124, 21, 22, -1, -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, 39, 40, 41, 42, -1, -1, -1, 46, 47, -1, 49, 50, 51, 52, -1, 54, 55, 56, 57, 68, -1, 60, 61, 62, 63, 64, 65, 66, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, 99, 100, -1, -1, -1, -1, 1, 106, 107, 108, 109, 6, -1, 8, -1, 114, 115, 12, 13, 14, 25, -1, 17, 122, 123, 124, 21, 22, -1, -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, 39, 40, 41, 42, -1, -1, -1, 46, 47, -1, 49, 50, 51, 52, -1, 54, 55, 56, 57, 68, -1, 60, 61, 62, 63, 64, 65, 66, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, 99, 100, -1, -1, -1, -1, 1, 106, 107, 108, 109, 6, -1, 8, -1, 114, 115, 12, 13, 14, 25, -1, 17, 122, 123, 124, 21, 22, -1, -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, 39, 40, 41, 42, -1, -1, -1, 46, 47, -1, 49, 50, 51, 52, -1, 54, 55, 56, 57, 68, -1, 60, 61, 62, 63, 64, 65, 66, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, 99, 100, -1, -1, -1, -1, -1, 106, 107, 108, 109, -1, -1, -1, -1, 114, 115, 5, -1, 7, -1, -1, 10, 122, 123, -1, -1, 15, -1, 17, -1, -1, 20, -1, -1, -1, -1, -1, 26, -1, 28, -1, 30, -1, -1, -1, -1, -1, 36, -1, 38, -1, -1, 41, -1, -1, -1, -1, 46, 17, 48, -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, -1, 30, 61, 62, 63, 64, 65, 66, 67, 38, 69, -1, 41, -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, 57, -1, -1, -1, 61, 62, 63, 64, 65, 66, 67, -1, 99, 100, -1, -1, -1, -1, -1, 106, 107, 108, 109, -1, 17, -1, -1, 114, 115, -1, -1, -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, 99, 100, -1, 38, -1, -1, 41, 106, 107, 108, 109, 46, -1, -1, -1, 114, 115, -1, -1, 54, -1, 56, 57, -1, 123, 60, 61, 62, 63, 64, 65, 66, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, 99, 100, -1, 38, -1, -1, 41, 106, 107, 108, 109, 46, 17, -1, -1, 114, 115, -1, -1, 54, -1, -1, 57, 122, -1, 30, 61, 62, 63, 64, 65, 66, 67, 38, -1, -1, 41, -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, 57, -1, -1, -1, 61, 62, 63, 64, 65, 66, 67, -1, 99, 100, -1, -1, -1, -1, -1, 106, 107, 108, 109, -1, 17, -1, -1, 114, 115, -1, -1, -1, -1, -1, -1, 122, -1, 30, -1, -1, -1, -1, 99, 100, -1, 38, -1, -1, 41, 106, 107, 108, 109, 46, 17, -1, -1, 114, 115, -1, -1, 54, -1, -1, 57, 122, -1, 30, 61, 62, 63, 64, 65, 66, 67, 38, -1, -1, 41, -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, 57, -1, -1, -1, 61, 62, 63, 64, 65, 66, 67, -1, 99, 100, -1, -1, -1, -1, -1, 106, 107, 108, 109, -1, -1, -1, -1, 114, 115, -1, -1, 118, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, 99, 100, -1, -1, -1, -1, 30, 106, 107, 108, 109, -1, -1, -1, 38, 114, 115, 41, -1, 118, -1, -1, 46, 17, -1, -1, -1, -1, -1, -1, 54, -1, -1, 57, -1, -1, 30, 61, 62, 63, 64, 65, 66, 67, 38, -1, -1, 41, -1, -1, -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, 57, -1, -1, 25, 61, 62, 63, 64, 65, 66, 67, -1, 99, 100, -1, -1, 17, -1, -1, 106, 107, 108, 109, -1, -1, -1, -1, 114, 115, 30, -1, 118, -1, -1, -1, -1, -1, 38, -1, -1, 41, -1, 99, 100, -1, 46, 68, -1, -1, 106, 107, 108, 109, 54, -1, -1, 57, 114, 115, 116, 61, 62, 63, 64, 65, 66, 67, -1, -1, 25, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, -1, -1, -1, -1, -1, 106, 107, 108, 109, -1, -1, -1, 68, 114, 115, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 122, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 122, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 122, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 118, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 118, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 118, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 118, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 118, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 25, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, 116, -1, -1, -1, -1, 25, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 68, 106, 107, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 25, 106, 107, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, 107, 5, -1, 7, -1, -1, 10, -1, -1, -1, -1, 15, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, 26, -1, 28, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, 69 }; char vlang; /* used by verbatim stuff */ // thr // This method would recursively call itself // For now its assumed that the java profiler would have generated the // relevant tmp file. /* public Stack addBClassVar(NslPreProcessor p, String bClass){ // invoke new parser to parse bClass // return appropriate stack of variables static varStack = new Stack(); yybl = new YYBlex(bClass.tmp); yybl.init(patch); yybp = new YYBparse(yyl, System.err); yybp.init(patch); yybp.yyparse(); varStack = patch.getVarStack(); String bbClass = yyparse.init(bClass.tmp); varStack.push(addBClassVar(p, bbClass); } public Stack YYBparse::init(String tmpClass) { } */ }; /*class*/