//### This file created by BYACC 1.8(/Java extension 1.15) //### Java capabilities added 7 Jan 97, Bob Jamison //### Updated : 27 Nov 97 -- Bob Jamison, Joe Nieten //### 01 Jan 98 -- Bob Jamison -- fixed generic semantic constructor //### 01 Jun 99 -- Bob Jamison -- added Runnable support //### 06 Aug 00 -- Bob Jamison -- made state variables class-global //### 03 Jan 01 -- Bob Jamison -- improved flags, tracing //### 16 May 01 -- Bob Jamison -- added custom stack sizing //### 04 Mar 02 -- Yuval Oren -- improved java performance, added options //### 14 Mar 02 -- Tomas Hurka -- -d support, static initializer workaround //### Please send bug reports to tom@hukatronic.cz //### static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/90"; //#line 16 "YYParser.y" import java.io.*; import java.lang.*; import java.util.*; //#line 21 "Parser.java" public class Parser { boolean yydebug; //do I want debug output? int yynerrs; //number of errors so far int yyerrflag; //was there an error? int yychar; //the current working character //########## MESSAGES ########## //############################################################### // method: debug //############################################################### void debug(String msg) { if (yydebug) System.out.println(msg); } //########## STATE STACK ########## final static int YYSTACKSIZE = 500; //maximum stack size int statestk[] = new int[YYSTACKSIZE]; //state stack int stateptr; int stateptrmax; //highest index of stackptr int statemax; //state when highest index reached //############################################################### // methods: state stack push,pop,drop,peek //############################################################### final void state_push(int state) { try { stateptr++; statestk[stateptr]=state; } catch (ArrayIndexOutOfBoundsException e) { int oldsize = statestk.length; int newsize = oldsize * 2; int[] newstack = new int[newsize]; System.arraycopy(statestk,0,newstack,0,oldsize); statestk = newstack; statestk[stateptr]=state; } } final int state_pop() { return statestk[stateptr--]; } final void state_drop(int cnt) { stateptr -= cnt; } final int state_peek(int relative) { return statestk[stateptr-relative]; } //############################################################### // method: init_stacks : allocate and prepare stacks //############################################################### final boolean init_stacks() { stateptr = -1; val_init(); return true; } //############################################################### // method: dump_stacks : show n levels of the stacks //############################################################### void dump_stacks(int count) { int i; System.out.println("=index==state====value= s:"+stateptr+" v:"+valptr); for (i=0;i=YYSTACKSIZE) return; valstk[++valptr]=val; } ParserVal val_pop() { if (valptr<0) return new ParserVal(); return valstk[valptr--]; } void val_drop(int cnt) { int ptr; ptr=valptr-cnt; if (ptr<0) return; valptr = ptr; } ParserVal val_peek(int relative) { int ptr=0; Globals.actions_out.printf("val peek relative = %d\n",relative); Globals.actions_out.printf("val peek valptr = %d\n",valptr); Globals.actions_out.printf("val peek ptr = %d\n",ptr); ptr=valptr-relative; if (ptr<0) return new ParserVal(); return valstk[ptr]; } final ParserVal dup_yyval(ParserVal val) { ParserVal dup = new ParserVal(); dup.ival = val.ival; dup.dval = val.dval; dup.sval = val.sval; dup.obj = val.obj; return dup; } //#### end semantic value section #### public final static short CHARACTERS=257; public final static short CONSTANTS=258; public final static short DO=259; public final static short ELSE=260; public final static short ELSIF=261; public final static short END=262; public final static short ENUM=263; public final static short EXPORT=264; public final static short FI=265; public final static short FIELD=266; public final static short FUNC=267; public final static short HIDE=268; public final static short IF=269; public final static short IN=270; public final static short EXTEND=271; public final static short LET=272; public final static short NI=273; public final static short OD=274; public final static short READONLY=275; public final static short RECORD=276; public final static short THEN=277; public final static short TYPE=278; public final static short UNION=279; public final static short USE=280; public final static short VAL=281; public final static short VAR=282; public final static short WITH=283; public final static short RIGHT_ARROW=284; public final static short EQUALS_EQUALS=285; public final static short EQUALS_EQUALS_EQUALS=286; public final static short COLON=287; public final static short WORDID=288; public final static short OPID=289; public final static short PROD=290; public final static short QSTRING=291; public final static short UQSTRING=292; public final static short LEFT_ANGLE_BRACKET=293; public final static short RIGHT_ANGLE_BRACKET=294; public final static short EXTERN=295; public final static short SIGNATURE=296; public final static short COR=297; public final static short CAND=298; public final static short YYERRCODE=256; final static short yylhs[] = { -1, 2, 0, 0, 4, 0, 5, 5, 5, 7, 7, 9, 9, 10, 10, 6, 6, 8, 8, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 15, 15, 18, 18, 19, 14, 14, 20, 20, 17, 17, 16, 16, 21, 21, 21, 21, 21, 22, 22, 1, 1, 13, 13, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 3, 3, 3, 33, 33, 26, 26, 34, 34, 34, 27, 27, 27, 27, 28, 28, 28, 28, 28, 42, 42, 42, 25, 32, 32, 32, 31, 31, 43, 43, 43, 43, 44, 44, 37, 39, 40, 40, 38, 38, 41, 41, 45, 45, 46, 46, 47, 29, 29, 48, 48, 49, 49, 49, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 35, 35, 54, 54, 55, 55, 30, 30, 30, 30, 56, 11, 11, 36, 36, }; final static short yylen[] = { 2, 0, 2, 1, 0, 3, 3, 1, 1, 1, 0, 1, 0, 1, 3, 1, 3, 1, 1, 1, 2, 2, 1, 14, 13, 12, 10, 8, 5, 1, 0, 4, 0, 5, 7, 6, 1, 0, 1, 3, 1, 0, 3, 5, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 3, 3, 3, 5, 5, 4, 3, 1, 1, 1, 0, 4, 5, 1, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 0, 1, 3, 4, 4, 0, 1, 2, 0, 4, 4, 5, 2, 4, 2, 5, 2, 1, 3, 1, 0, 3, 1, 1, 5, 2, 5, 2, 2, 1, 1, 1, 3, 0, 3, 1, 1, 1, 0, 3, 0, 1, 0, 2, 5, 1, 3, 4, 1, 3, 1, 1, 1, 1, }; final static short yydefred[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 145, 0, 146, 147, 0, 19, 60, 59, 0, 0, 52, 2, 0, 49, 50, 0, 0, 0, 54, 57, 58, 61, 0, 82, 83, 84, 85, 86, 87, 71, 70, 0, 0, 89, 0, 0, 0, 139, 0, 0, 0, 0, 0, 0, 100, 0, 15, 0, 95, 108, 0, 0, 40, 0, 110, 0, 0, 0, 21, 76, 20, 106, 0, 0, 0, 0, 0, 81, 0, 56, 0, 0, 0, 0, 62, 116, 117, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 64, 0, 9, 0, 0, 0, 0, 0, 0, 0, 111, 113, 29, 0, 0, 0, 0, 0, 0, 0, 63, 91, 0, 0, 17, 18, 22, 121, 122, 119, 0, 0, 80, 0, 0, 0, 72, 69, 0, 90, 88, 140, 0, 103, 0, 0, 8, 11, 0, 7, 13, 0, 0, 0, 0, 104, 16, 101, 0, 0, 0, 96, 0, 0, 107, 0, 0, 46, 45, 0, 0, 0, 38, 36, 0, 93, 0, 0, 68, 0, 0, 133, 0, 79, 0, 0, 74, 0, 0, 141, 135, 31, 0, 0, 0, 0, 0, 97, 98, 66, 115, 112, 0, 0, 0, 0, 28, 109, 67, 105, 0, 0, 0, 130, 129, 0, 0, 0, 75, 0, 0, 33, 6, 14, 35, 0, 0, 0, 0, 47, 42, 0, 39, 0, 0, 118, 0, 120, 0, 0, 34, 0, 0, 0, 0, 0, 0, 131, 128, 126, 0, 0, 0, 0, 27, 43, 0, 138, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 25, 0, 24, 23, }; final static short yydgoto[] = { 2, 48, 3, 49, 4, 154, 155, 111, 156, 157, 158, 30, 31, 32, 33, 120, 71, 178, 58, 59, 179, 180, 238, 34, 35, 36, 37, 38, 39, 92, 53, 65, 75, 144, 40, 85, 41, 42, 43, 44, 45, 46, 54, 66, 112, 116, 117, 118, 93, 94, 95, 223, 224, 255, 196, 197, 55, }; final static short yysindex[] = { -229, 0, 0, 430, 261, 168, -73, 4, 168, -70, -170, -103, -6, -79, 430, 560, 560, 0, 0, 153, 0, 0, -64, 0, 0, 0, 261, 430, 0, 0, -220, 0, 0, 0, -40, 41, 0, 0, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, -196, -29, -184, 0, -74, -74, 30, 67, -28, 430, 0, -41, 0, -36, 0, 0, -74, -74, 0, 25, 0, 35, 87, -131, 0, 0, 0, 0, 40, -120, -2, 90, 641, 0, 41, 0, -96, -66, 163, -91, 0, 0, 0, -74, 389, 430, 261, 0, 216, 261, -14, -86, 305, -74, 108, 0, 92, 0, -74, 641, -65, 261, -170, -41, -26, 0, 0, 0, -32, -225, 305, 430, 261, 305, 97, 0, 0, 4, -88, 0, 0, 0, 0, 0, 0, 89, -220, 0, 120, -105, -13, 0, 0, -19, 0, 0, 0, 16, 0, 253, 19, 0, 0, -41, 0, 0, 11, 0, 9, 305, 0, 0, 0, 430, 430, -48, 0, 430, -74, 0, 27, -74, 0, 0, -41, 0, -12, 0, 0, -5, 0, -45, -3, 0, 235, 67, 0, -170, 0, 137, 205, 0, 261, 430, 0, 0, 0, 295, 641, 305, 641, 58, 0, 0, 0, 0, 0, -37, 219, 324, -225, 0, 0, 0, 0, 305, 248, 8, 0, 0, -220, 218, 285, 0, 16, 68, 0, 0, 0, 0, 641, 59, -74, -225, 0, 0, 80, 0, 81, 305, 0, -175, 0, 137, 261, 0, -39, 231, 12, 560, 641, 91, 0, 0, 0, -19, -24, -74, -225, 0, 0, 641, 0, 315, -74, 240, 13, -74, 243, -225, 0, 246, -225, 17, -225, 37, 0, 39, 0, 0, }; final static short yyrindex[] = { 475, 125, 0, 0, 0, 0, 0, 279, 0, 0, 6, 0, 252, 252, 101, 0, 0, 0, 0, 252, 0, 0, 0, 0, 0, 0, 0, 297, 0, 0, 1, 0, 0, 825, 803, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 399, 124, 0, 116, 0, 0, 0, 0, 0, 0, 279, 0, 0, 0, 657, 0, 0, 0, 0, 42, -25, 0, 0, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, -101, -94, 252, 0, 0, 0, 0, 252, 0, 614, 0, 0, 0, 0, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, -46, 520, 0, 0, 0, 0, 0, 44, 47, -78, 0, 47, 0, 0, 0, 279, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -30, 0, 0, 0, -27, 0, 0, 0, 0, 0, 680, 0, 0, 0, 848, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 252, 0, 0, 307, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 279, 0, 50, 0, 286, 0, 0, 0, 0, 0, 0, 0, 0, 0, -35, 287, 0, 0, 0, 0, 0, 0, 0, 0, 146, 44, 0, 0, 0, 0, 98, 0, 0, 0, 0, 57, 0, 293, 0, 14, 0, 0, 0, 0, 0, 310, 0, 252, 44, 0, 0, 0, 0, 0, 98, 0, 55, 0, 286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -30, 0, 252, 44, 0, 0, 0, 0, 0, 252, 0, 0, 252, 0, 44, 0, 0, 44, 0, 44, 0, 0, 0, 0, 0, }; final static short yygindex[] = { 0, 875, 0, -16, 0, 0, 720, -20, -59, 229, -87, 921, -56, 46, 950, 0, 634, 294, -38, 309, 222, 0, 0, 0, 402, 409, 0, 0, 0, 0, 437, 264, -8, 0, 0, -112, 363, 0, 0, 0, 0, 0, 0, 341, 0, 0, 291, 0, 0, 224, 0, 217, 0, 0, 212, 0, 371, }; final static int YYTABLESIZE=1213; static short yytable[]; static { yytable();} static void yytable(){ yytable = new short[]{ 26, 134, 259, 110, 234, 136, 100, 100, 143, 173, 82, 97, 92, 99, 97, 94, 30, 266, 81, 83, 68, 106, 123, 114, 12, 130, 190, 1, 132, 124, 110, 174, 175, 170, 69, 181, 134, 134, 184, 127, 97, 134, 134, 53, 57, 134, 97, 212, 132, 137, 56, 27, 164, 61, 201, 132, 201, 97, 12, 81, 134, 76, 78, 17, 18, 99, 132, 114, 96, 132, 201, 212, 212, 84, 203, 97, 212, 91, 53, 99, 142, 98, 145, 53, 53, 149, 62, 53, 55, 88, 12, 186, 134, 89, 134, 169, 212, 167, 212, 171, 101, 114, 53, 37, 202, 132, 12, 105, 183, 99, 243, 150, 193, 213, 132, 182, 134, 201, 17, 18, 214, 104, 216, 55, 134, 3, 134, 4, 55, 55, 240, 123, 55, 242, 53, 200, 53, 261, 272, 124, 201, 229, 278, 231, 132, 132, 132, 55, 121, 218, 201, 232, 237, 67, 253, 132, 211, 12, 122, 142, 134, 132, 280, 125, 281, 4, 53, 114, 53, 37, 28, 126, 12, 247, 252, 99, 132, 72, 226, 55, 132, 55, 134, 128, 263, 132, 192, 123, 123, 92, 135, 12, 94, 231, 124, 124, 132, 17, 18, 161, 20, 21, 17, 18, 247, 151, 188, 132, 26, 17, 18, 55, 189, 55, 17, 18, 4, 162, 28, 5, 165, 166, 185, 6, 99, 206, 172, 7, 215, 8, 257, 9, 10, 30, 113, 136, 11, 107, 143, 13, 14, 194, 195, 191, 136, 99, 109, 143, 17, 18, 19, 20, 21, 258, 233, 22, 26, 24, 25, 27, 134, 134, 134, 28, 134, 134, 134, 265, 134, 134, 134, 134, 134, 134, 134, 134, 99, 134, 134, 137, 134, 134, 17, 18, 134, 134, 134, 134, 137, 134, 134, 134, 134, 134, 198, 134, 134, 262, 134, 134, 151, 26, 53, 53, 53, 88, 53, 27, 53, 89, 53, 199, 53, 53, 53, 53, 53, 53, 209, 53, 53, 134, 53, 53, 90, 134, 217, 53, 53, 53, 225, 53, 53, 53, 53, 53, 228, 53, 53, 241, 53, 53, 235, 244, 245, 246, 251, 55, 55, 55, 248, 55, 27, 55, 260, 55, 269, 55, 55, 55, 55, 55, 55, 271, 55, 55, 274, 55, 55, 276, 32, 94, 55, 55, 55, 41, 55, 55, 55, 55, 55, 4, 55, 55, 4, 55, 55, 15, 4, 142, 94, 28, 4, 220, 4, 221, 4, 4, 142, 5, 88, 4, 44, 4, 4, 4, 4, 4, 90, 79, 78, 127, 48, 4, 4, 4, 4, 4, 125, 136, 4, 4, 4, 4, 50, 17, 18, 5, 51, 26, 230, 6, 28, 77, 239, 7, 86, 8, 187, 9, 10, 17, 18, 87, 11, 60, 12, 13, 14, 15, 16, 17, 18, 219, 139, 168, 17, 18, 19, 20, 21, 208, 256, 22, 23, 24, 25, 254, 44, 264, 26, 148, 146, 0, 0, 5, 51, 1, 0, 6, 27, 0, 0, 7, 0, 8, 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, 15, 16, 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, 0, 0, 22, 23, 24, 25, 1, 0, 47, 0, 0, 5, 27, 10, 0, 6, 0, 0, 0, 7, 250, 8, 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, 15, 16, 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, 268, 0, 22, 23, 24, 25, 10, 153, 28, 0, 0, 275, 1, 0, 277, 0, 279, 0, 129, 10, 10, 0, 0, 0, 0, 0, 0, 0, 10, 12, 0, 10, 15, 16, 10, 10, 0, 129, 0, 17, 18, 10, 10, 0, 0, 236, 26, 23, 12, 10, 0, 15, 16, 0, 0, 15, 15, 10, 17, 18, 73, 0, 0, 0, 15, 0, 23, 15, 0, 0, 15, 15, 0, 0, 0, 0, 15, 15, 15, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 47, 0, 73, 5, 73, 0, 27, 6, 80, 0, 73, 7, 0, 8, 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, 15, 16, 0, 73, 0, 0, 0, 17, 18, 19, 20, 21, 0, 0, 141, 23, 24, 25, 0, 5, 0, 0, 0, 6, 0, 0, 0, 7, 0, 8, 0, 9, 10, 0, 0, 0, 11, 0, 12, 13, 14, 15, 16, 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, 0, 137, 22, 23, 24, 25, 140, 63, 0, 0, 0, 1, 0, 0, 0, 1, 73, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 102, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 10, 115, 10, 0, 10, 10, 0, 0, 0, 10, 0, 10, 10, 10, 10, 10, 51, 0, 0, 0, 210, 10, 10, 10, 10, 10, 0, 0, 10, 10, 10, 10, 5, 0, 0, 0, 6, 0, 22, 0, 7, 0, 8, 0, 9, 10, 0, 63, 0, 11, 0, 51, 13, 14, 176, 0, 0, 51, 0, 0, 51, 17, 18, 19, 20, 21, 0, 0, 22, 0, 24, 25, 0, 22, 0, 51, 0, 0, 0, 22, 0, 249, 22, 0, 0, 0, 0, 73, 73, 0, 0, 29, 73, 52, 0, 0, 52, 22, 0, 0, 73, 73, 74, 115, 0, 15, 267, 0, 0, 51, 0, 0, 0, 270, 0, 74, 273, 0, 0, 0, 17, 129, 63, 0, 0, 0, 0, 0, 0, 0, 0, 22, 12, 0, 0, 15, 16, 10, 0, 51, 0, 51, 17, 18, 64, 176, 70, 70, 10, 108, 23, 10, 10, 70, 17, 102, 102, 0, 10, 10, 10, 76, 0, 22, 0, 0, 10, 0, 176, 0, 0, 10, 0, 0, 10, 10, 0, 0, 77, 77, 0, 10, 10, 0, 0, 143, 17, 0, 147, 10, 64, 103, 0, 176, 0, 0, 0, 77, 0, 0, 0, 0, 64, 119, 176, 0, 0, 176, 0, 176, 0, 74, 0, 0, 0, 0, 0, 0, 131, 0, 0, 0, 0, 0, 70, 138, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 152, 159, 160, 0, 0, 0, 0, 163, 131, 0, 133, 64, 0, 0, 0, 0, 204, 205, 177, 159, 207, 0, 159, 0, 0, 0, 0, 0, 0, 0, 133, 0, 0, 0, 0, 0, 0, 133, 0, 51, 51, 0, 0, 0, 51, 0, 227, 0, 133, 51, 0, 133, 51, 51, 0, 0, 51, 0, 159, 0, 0, 22, 22, 51, 51, 51, 22, 64, 0, 0, 70, 22, 0, 51, 22, 22, 0, 0, 22, 0, 0, 0, 0, 0, 0, 22, 64, 133, 222, 0, 0, 15, 0, 0, 0, 0, 0, 131, 159, 131, 0, 0, 15, 0, 0, 15, 15, 0, 131, 177, 0, 15, 15, 15, 159, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 133, 133, 133, 131, 0, 70, 177, 0, 0, 0, 0, 133, 159, 0, 0, 0, 222, 133, 0, 0, 0, 0, 0, 131, 0, 0, 0, 0, 0, 0, 70, 177, 133, 0, 131, 0, 0, 70, 0, 0, 70, 133, 177, 0, 0, 177, 0, 177, 0, 0, 0, 77, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, }; } static short yycheck[]; static { yycheck(); } static void yycheck() { yycheck = new short[] { 40, 0, 41, 44, 41, 35, 35, 35, 35, 41, 26, 59, 93, 59, 59, 93, 41, 41, 123, 27, 123, 59, 123, 59, 59, 84, 138, 256, 84, 123, 44, 256, 257, 59, 40, 122, 35, 36, 125, 41, 59, 40, 41, 0, 40, 44, 59, 59, 104, 35, 123, 91, 111, 123, 59, 111, 59, 59, 93, 123, 59, 15, 16, 288, 289, 59, 122, 59, 123, 125, 59, 59, 59, 293, 161, 59, 59, 36, 35, 125, 96, 277, 98, 40, 41, 101, 256, 44, 0, 264, 125, 129, 91, 268, 93, 115, 59, 113, 59, 125, 284, 59, 59, 59, 93, 161, 59, 40, 124, 59, 222, 125, 125, 125, 59, 123, 59, 59, 288, 289, 125, 91, 125, 35, 123, 0, 125, 2, 40, 41, 217, 44, 44, 125, 91, 155, 93, 125, 125, 270, 59, 200, 125, 202, 200, 201, 202, 59, 123, 187, 59, 93, 211, 256, 241, 211, 176, 59, 123, 35, 256, 217, 125, 123, 125, 40, 123, 125, 125, 125, 2, 291, 125, 232, 93, 125, 232, 256, 194, 91, 125, 93, 125, 93, 93, 241, 291, 288, 289, 270, 256, 93, 270, 252, 288, 289, 252, 288, 289, 91, 291, 292, 288, 289, 263, 291, 294, 263, 40, 288, 289, 123, 123, 125, 288, 289, 91, 125, 2, 259, 285, 286, 125, 263, 270, 273, 258, 267, 273, 269, 246, 271, 272, 258, 270, 265, 276, 265, 265, 279, 280, 260, 261, 123, 274, 274, 287, 274, 288, 289, 290, 291, 292, 292, 291, 295, 40, 297, 298, 91, 259, 260, 261, 2, 263, 264, 265, 291, 267, 268, 269, 270, 271, 272, 273, 274, 270, 276, 277, 265, 279, 280, 288, 289, 283, 284, 285, 286, 274, 288, 289, 290, 291, 292, 41, 294, 295, 251, 297, 298, 291, 40, 259, 260, 261, 264, 263, 91, 265, 268, 267, 292, 269, 270, 271, 272, 273, 274, 291, 276, 277, 264, 279, 280, 283, 268, 91, 284, 285, 286, 125, 288, 289, 290, 291, 292, 41, 294, 295, 91, 297, 298, 123, 125, 59, 277, 266, 259, 260, 261, 291, 263, 91, 265, 123, 267, 41, 269, 270, 271, 272, 273, 274, 123, 276, 277, 123, 279, 280, 123, 91, 270, 284, 285, 286, 123, 288, 289, 290, 291, 292, 256, 294, 295, 259, 297, 298, 44, 263, 265, 93, 2, 267, 256, 269, 258, 271, 272, 274, 0, 284, 276, 59, 278, 279, 280, 281, 282, 284, 256, 123, 125, 266, 288, 289, 290, 291, 292, 125, 256, 295, 296, 297, 298, 256, 288, 289, 259, 260, 40, 201, 263, 2, 123, 212, 267, 34, 269, 129, 271, 272, 288, 289, 34, 276, 8, 278, 279, 280, 281, 282, 288, 289, 189, 91, 114, 288, 289, 290, 291, 292, 170, 245, 295, 296, 297, 298, 243, 125, 257, 40, 100, 256, -1, -1, 259, 260, 2, -1, 263, 91, -1, -1, 267, -1, 269, -1, 271, 272, -1, -1, -1, 276, -1, 278, 279, 280, 281, 282, -1, -1, -1, -1, -1, 288, 289, 290, 291, 292, -1, -1, 295, 296, 297, 298, 40, -1, 256, -1, -1, 259, 91, 2, -1, 263, -1, -1, -1, 267, 235, 269, -1, 271, 272, -1, -1, -1, 276, -1, 278, 279, 280, 281, 282, -1, -1, -1, -1, -1, 288, 289, 290, 291, 292, 260, -1, 295, 296, 297, 298, 40, 256, 2, -1, -1, 271, 91, -1, 274, -1, 276, -1, 267, 266, 267, -1, -1, -1, -1, -1, -1, -1, 275, 278, -1, 278, 281, 282, 281, 282, -1, 267, -1, 288, 289, 288, 289, -1, -1, 275, 40, 296, 278, 296, -1, 281, 282, -1, -1, 266, 267, 91, 288, 289, 0, -1, -1, -1, 275, -1, 296, 278, -1, -1, 281, 282, -1, -1, -1, -1, 287, 288, 289, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, 256, -1, 13, 259, 35, -1, 91, 263, 19, -1, 41, 267, -1, 269, -1, 271, 272, -1, -1, -1, 276, -1, 278, 279, 280, 281, 282, -1, 59, -1, -1, -1, 288, 289, 290, 291, 292, -1, -1, 295, 296, 297, 298, -1, 259, -1, -1, -1, 263, -1, -1, -1, 267, -1, 269, -1, 271, 272, -1, -1, -1, 276, -1, 278, 279, 280, 281, 282, -1, -1, -1, -1, -1, 288, 289, 290, 291, 292, -1, 90, 295, 296, 297, 298, 95, 10, -1, -1, -1, 259, -1, -1, -1, 263, 125, -1, -1, 267, -1, 269, -1, 271, 272, -1, -1, -1, 276, -1, 278, 279, 280, 281, 282, -1, -1, -1, -1, -1, 288, 289, 290, 291, 292, -1, -1, 295, 296, 297, 298, -1, -1, 56, -1, -1, 259, -1, -1, -1, 263, -1, -1, -1, 267, 68, 269, -1, 271, 272, -1, -1, -1, 276, -1, 278, 279, 280, 281, 282, 0, -1, -1, -1, 173, 288, 289, 290, 291, 292, -1, -1, 295, 296, 297, 298, 259, -1, -1, -1, 263, -1, 0, -1, 267, -1, 269, -1, 271, 272, -1, 114, -1, 276, -1, 35, 279, 280, 121, -1, -1, 41, -1, -1, 44, 288, 289, 290, 291, 292, -1, -1, 295, -1, 297, 298, -1, 35, -1, 59, -1, -1, -1, 41, -1, 234, 44, -1, -1, -1, -1, 260, 261, -1, -1, 3, 265, 5, -1, -1, 8, 59, -1, -1, 273, 274, 14, 170, -1, 44, 259, -1, -1, 93, -1, -1, -1, 266, -1, 27, 269, -1, -1, -1, 59, 267, 189, -1, -1, -1, -1, -1, -1, -1, -1, 93, 278, -1, -1, 281, 282, 267, -1, 123, -1, 125, 288, 289, 10, 212, 12, 13, 278, 61, 296, 281, 282, 19, 93, 285, 286, -1, 288, 289, 267, 123, -1, 125, -1, -1, 296, -1, 235, -1, -1, 278, -1, -1, 281, 282, -1, -1, 15, 16, -1, 288, 289, -1, -1, 97, 125, -1, 100, 296, 56, 57, -1, 260, -1, -1, -1, 34, -1, -1, -1, -1, 68, 69, 271, -1, -1, 274, -1, 276, -1, 123, -1, -1, -1, -1, -1, -1, 84, -1, -1, -1, -1, -1, 90, 91, -1, -1, -1, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, -1, -1, -1, -1, 110, 111, -1, 84, 114, -1, -1, -1, -1, 165, 166, 121, 122, 169, -1, 125, -1, -1, -1, -1, -1, -1, -1, 104, -1, -1, -1, -1, -1, -1, 111, -1, 260, 261, -1, -1, -1, 265, -1, 195, -1, 122, 270, -1, 125, 273, 274, -1, -1, 277, -1, 161, -1, -1, 260, 261, 284, 285, 286, 265, 170, -1, -1, 173, 270, -1, 294, 273, 274, -1, -1, 277, -1, -1, -1, -1, -1, -1, 284, 189, 161, 191, -1, -1, 267, -1, -1, -1, -1, -1, 200, 201, 202, -1, -1, 278, -1, -1, 281, 282, -1, 211, 212, -1, 287, 288, 289, 217, -1, -1, -1, -1, -1, 296, -1, -1, -1, -1, -1, 200, 201, 202, 232, -1, 234, 235, -1, -1, -1, -1, 211, 241, -1, -1, -1, 245, 217, -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, -1, -1, 259, 260, 232, -1, 263, -1, -1, 266, -1, -1, 269, 241, 271, -1, -1, 274, -1, 276, -1, -1, -1, 251, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 263, }; } final static short YYFINAL=2; final static short YYMAXTOKEN=298; final static String yyname[] = { "end-of-file",null,"'\\002'",null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,"'#'","'$'",null,null,null,"'('","')'",null,null, "','",null,null,null,null,null,null,null,null,null,null,null,null,null,null, "';'",null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,"'['",null,"']'",null,null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,null,"'{'",null,"'}'",null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,"CHARACTERS","CONSTANTS","DO", "ELSE","ELSIF","END","ENUM","EXPORT","FI","FIELD","FUNC","HIDE","IF","IN", "EXTEND","LET","NI","OD","READONLY","RECORD","THEN","TYPE","UNION","USE","VAL", "VAR","WITH","RIGHT_ARROW","EQUALS_EQUALS","EQUALS_EQUALS_EQUALS","COLON", "WORDID","OPID","PROD","QSTRING","UQSTRING","LEFT_ANGLE_BRACKET", "RIGHT_ANGLE_BRACKET","EXTERN","SIGNATURE","COR","CAND", }; final static String yyrule[] = { "$accept : Program", "$$1 :", "Program : $$1 Denotation", "Program : error", "$$2 :", "Program : error $$2 Denotation.seq", "Parameters : Id.list Opt.Colon Signature", "Parameters : Signature", "Parameters : error", "Opt.Colon : COLON", "Opt.Colon :", "Opt.Parameters : Parameters", "Opt.Parameters :", "Opt.Parameter.list : Opt.Parameters", "Opt.Parameter.list : Opt.Parameter.list ';' Opt.Parameters", "Id.list : ID", "Id.list : Id.list ',' ID", "Signature : ID", "Signature : ManifestSignature", "ManifestSignature : SIGNATURE", "ManifestSignature : VAR BasicDenotation", "ManifestSignature : VAL BasicDenotation", "ManifestSignature : FuncSignature", "ManifestSignature : TYPE '(' Opt.Simple CONSTANTS QSTRING QSTRING QSTRING UQSTRING QSTRING ')' Opt.Id '{' Opt.TypeSignatureComponent.list '}'", "ManifestSignature : TYPE '(' Opt.Simple CONSTANTS QSTRING QSTRING QSTRING UQSTRING ')' Opt.Id '{' Opt.TypeSignatureComponent.list '}'", "ManifestSignature : TYPE '(' Opt.Simple CONSTANTS QSTRING QSTRING QSTRING ')' Opt.Id '{' Opt.TypeSignatureComponent.list '}'", "ManifestSignature : TYPE '(' Opt.Simple CONSTANTS QSTRING ')' Opt.Id '{' Opt.TypeSignatureComponent.list '}'", "ManifestSignature : TYPE '(' Opt.Simple ')' Opt.Id '{' Opt.TypeSignatureComponent.list '}'", "ManifestSignature : TYPE Opt.Id '{' Opt.TypeSignatureComponent.list '}'", "Opt.Simple : ID", "Opt.Simple :", "Opt.InLine : '(' ID QSTRING ')'", "Opt.InLine :", "Special : '(' ID ID UQSTRING ')'", "FuncSignature : FUNC Special Opt.InLine '[' Opt.Parameter.list ']' Signature", "FuncSignature : FUNC Opt.InLine '[' Opt.Parameter.list ']' Signature", "Opt.TypeSignatureComponents : TypeSignatureComponents", "Opt.TypeSignatureComponents :", "Opt.TypeSignatureComponent.list : Opt.TypeSignatureComponents", "Opt.TypeSignatureComponent.list : Opt.TypeSignatureComponent.list ';' Opt.TypeSignatureComponents", "Opt.Id : ID", "Opt.Id :", "TypeSignatureComponents : Id.list Opt.Colon Signature", "TypeSignatureComponents : Id.list Opt.Colon Opt.Readonly FIELD BasicDenotation", "TypeSignatureComponents : ID", "TypeSignatureComponents : CHARACTERS", "TypeSignatureComponents : error", "Opt.Readonly : READONLY", "Opt.Readonly :", "Denotation : ManifestSignature", "Denotation : BasicDenotation", "BasicDenotation : Primary.list", "BasicDenotation : '\\002'", "Primary.list : Primary", "Primary.list : ArgList", "Primary.list : Primary.list Primary", "Primary.list : Primary.list ArgList", "Primary : FuncConstruction", "Primary : Selection", "Primary : CAND", "Primary : COR", "Primary : TypeConstruction", "Primary : Primary TypeModifier", "Primary : '(' Denotation.seq ')'", "Primary : IF GuardedDenotation.list FI", "Primary : DO GuardedDenotation.list OD", "Primary : LET Opt.Declaration.list IN Denotation.seq NI", "Primary : USE Opt.Denotation.list IN Denotation.seq NI", "Primary : EXTERN '{' QSTRING '}'", "Denotation.seq : Denotation.seq ';' Opt.Denotation", "Denotation.seq : Denotation", "Denotation.seq : error", "Opt.Denotation : Denotation", "Opt.Denotation :", "FuncConstruction : IncompleteFuncSignature '{' Denotation.seq '}'", "FuncConstruction : IncompleteFuncSignature '{' EXTERN QSTRING '}'", "IncompleteFuncSignature : FuncSignature", "IncompleteFuncSignature : FUNC Special Opt.InLine '[' Opt.Parameter.list ']'", "IncompleteFuncSignature : FUNC Opt.InLine '[' Opt.Parameter.list ']'", "Selection : Primary '$' ID Opt.SigClause", "Selection : Primary '$' STRING", "Selection : ID Opt.SigClause", "Selection : STRING", "TypeConstruction : Enumeration", "TypeConstruction : Record", "TypeConstruction : Extension", "TypeConstruction : Product", "TypeConstruction : Union", "Guard : Denotation", "Guard : ELSE", "Guard : error", "ArgList : '[' Opt.Denotation.list ']'", "Opt.Denotation.list : Denotation", "Opt.Denotation.list : Denotation ',' Opt.Denotation.list", "Opt.Denotation.list :", "Opt.Declaration.list : Opt.Declarations", "Opt.Declaration.list : Opt.Declaration.list ';' Opt.Declarations", "Opt.Declarations : Id.list Opt.ColonSignature EQUALS_EQUALS Denotation", "Opt.Declarations : Id.list Opt.ColonSignature EQUALS_EQUALS_EQUALS Denotation", "Opt.Declarations :", "Opt.Declarations : error", "Opt.ColonSignature : Opt.Colon Signature", "Opt.ColonSignature :", "Enumeration : ENUM '{' Id.list '}'", "Extension : EXTEND '{' Denotation '}'", "Product : PROD Opt.Id '{' Opt.Parameter.list '}'", "Product : PROD error", "Record : RECORD '{' Opt.RecordElement.list '}'", "Record : RECORD error", "Union : UNION Opt.Id '{' Opt.Parameter.list '}'", "Union : UNION error", "Opt.RecordElement.list : Opt.RecordElements", "Opt.RecordElement.list : Opt.RecordElement.list ';' Opt.RecordElements", "Opt.RecordElements : RecordElements", "Opt.RecordElements :", "RecordElements : Id.list Opt.Colon Denotation", "TypeModifier : WithList", "TypeModifier : ExportList", "WithList : WITH Opt.Id '{' Opt.Declaration.list '}'", "WithList : WITH error", "ExportList : Start.ExportList Opt.Id '{' ExportElement.list '}'", "ExportList : EXPORT error", "ExportList : HIDE error", "Start.ExportList : EXPORT", "Start.ExportList : HIDE", "ExportElement.list : ExportElement", "ExportElement.list : ExportElement ';' ExportElement.list", "ExportElement.list :", "ExportElement : ID Opt.SigClause Opt.ExportList", "ExportElement : CONSTANTS", "ExportElement : error", "Opt.ExportList : ExportList", "Opt.ExportList :", "Opt.SigClause : LEFT_ANGLE_BRACKET Signature RIGHT_ANGLE_BRACKET", "Opt.SigClause :", "Opt.ElseList : ElseList", "Opt.ElseList :", "ElseList : ELSE Denotation.seq", "ElseList : ELSIF Denotation THEN Denotation.seq Opt.ElseList", "GuardedDenotation.list : GuardedDenotation", "GuardedDenotation.list : GuardedDenotation.list '#' GuardedDenotation", "GuardedDenotation.list : Denotation THEN Denotation.seq Opt.ElseList", "GuardedDenotation.list : error", "GuardedDenotation : Guard RIGHT_ARROW Denotation.seq", "ID : WORDID", "ID : OPID", "STRING : QSTRING", "STRING : UQSTRING", }; //#line 1047 "YYParser.y" private static void abort() { Mine.russinfo("Parser: Aborting"); System.exit(0); } private static int yylex() { return Lexer.yylex(); } private static Node first(ParserVal l) { Object obj = l.obj; ListHeaderNode it = ListHeaderNode.class.cast(obj); Node it2 = Node.class.cast(it.lh_first()); // Node it = Node.class.cast(l.obj.lh_first.cn_hd_field); return it2; } private static Node last(ParserVal l) { Object obj = l.obj; ListHeaderNode it = ListHeaderNode.class.cast(obj); Node it2 = Node.class.cast(it.lh_last()); // Node it = Node.class.cast(l.obj.lh_first.cn_hd_field); return it2; } private boolean is_empty(Node it) { return (it == null); } private static int[] condstop = new int[] /* stop symbols for error recovery in various */ /* conditional constructs */ { Lexer.OD, Lexer.FI, Lexer.RIGHT_ARROW, '#', ';', Lexer.LET, Lexer.DO, Lexer.IF, Lexer.THEN, Lexer.ELSE, '(', Lexer.EOF, Lexer.LIST_END }; private static int[] declstop = new int[] /* stop symbols for error recovery in declarations */ { Lexer.EQUALS_EQUALS, Lexer.EQUALS_EQUALS_EQUALS, ';', '}', Lexer.IN, Lexer.NI, Lexer.IF, Lexer.DO, Lexer.LET, '(', Lexer.EOF, Lexer.LIST_END }; private static int[] paramstop = new int[] { ';', ']', '{', Lexer.VAR, Lexer.VAL, Lexer.FUNC, Lexer.TYPE, Lexer.SIGNATURE, Lexer.EOF, Lexer.LIST_END }; private static int maxskip = 8; private static void yywarn(String str) { Lexer.yywarn(str); } private static void yyerror(String str) { Lexer.yyerror(str); } private static void yyperror(String str) { Lexer.yyperror(str); } private static boolean in(int element,int list[]) { int i; int LIST_END = 0x7fff; i = 0; while (element != list[i] && list[i] != LIST_END) ++i; return (element == list[i]); } private static void rec_on(int c) { if ( c < 0400 ) { // Mine.russinfo ( "recovery attempted on %c\n", c); Mine.russinfo ( "recovery attempted on %c\n"); } else { // Mine.russinfo ( "recovery attempted on token number %d\n", c); Mine.russinfo ( "recovery attempted on token number %d\n"); } } public static void yyclearin() { } public static void yyunlex(int ch) { } public static ParserVal special(int a, int b) { ParserVal x; x = null; return x; } //#line 845 "Parser.java" //############################################################### // method: yylexdebug : check lexer state //############################################################### void yylexdebug(int state,int ch) { String s=null; if (ch < 0) ch=0; if (ch <= YYMAXTOKEN) //check index bounds s = yyname[ch]; //now get it if (s==null) s = "illegal-symbol"; debug("state "+state+", reading "+ch+" ("+s+")"); } //The following are now global, to aid in error reporting int yyn; //next next thing to do int yym; // int yystate; //current parsing state from state table String yys; //current token string //############################################################### // method: yyparse : parse input and execute indicated items //############################################################### int yyparse() { boolean doaction; init_stacks(); yynerrs = 0; yyerrflag = 0; yychar = -1; //impossible char forces a read yystate=0; //initial state state_push(yystate); //save it val_push(yylval); //save empty value while (true) //until parsing is done, either correctly, or w/error { doaction=true; if (yydebug) debug("loop"); //#### NEXT ACTION (from reduction table) for (yyn=yydefred[yystate];yyn==0;yyn=yydefred[yystate]) { if (yydebug) debug("yyn:"+yyn+" state:"+yystate+" yychar:"+yychar); if (yychar < 0) //we want a char? { yychar = yylex(); //get next token if (yydebug) debug(" next yychar:"+yychar); //#### ERROR CHECK #### if (yychar < 0) //it it didn't work/error { yychar = 0; //change it to default string (no -1!) if (yydebug) yylexdebug(yystate,yychar); } }//yychar<0 yyn = yysindex[yystate]; //get amount to shift by (shift index) if ((yyn != 0) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { if (yydebug) debug("state "+yystate+", shifting to state "+yytable[yyn]); //#### NEXT STATE #### yystate = yytable[yyn];//we are in a new state state_push(yystate); //save it val_push(yylval); //push our lval as the input for next rule yychar = -1; //since we have 'eaten' a token, say we need another if (yyerrflag > 0) //have we recovered an error? --yyerrflag; //give ourselves credit doaction=false; //but don't process yet break; //quit the yyn=0 loop } yyn = yyrindex[yystate]; //reduce if ((yyn !=0 ) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { //we reduced! if (yydebug) debug("reduce"); yyn = yytable[yyn]; doaction=true; //get ready to execute break; //drop down to actions } else //ERROR RECOVERY { if (yyerrflag==0) { yyerror("syntax error"); yynerrs++; } if (yyerrflag < 3) //low error count? { yyerrflag = 3; while (true) //do until break { if (stateptr<0) //check for under & overflow here { yyerror("stack underflow. aborting..."); //note lower case 's' return 1; } yyn = yysindex[state_peek(0)]; if ((yyn != 0) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) { if (yydebug) debug("state "+state_peek(0)+", error recovery shifting to state "+yytable[yyn]+" "); yystate = yytable[yyn]; state_push(yystate); val_push(yylval); doaction=false; break; } else { if (yydebug) debug("error recovery discarding state "+state_peek(0)+" "); if (stateptr<0) //check for under & overflow here { yyerror("Stack underflow. aborting..."); //capital 'S' return 1; } state_pop(); val_pop(); } } } else //discard this token { if (yychar == 0) return 1; //yyabort if (yydebug) { yys = null; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (yys == null) yys = "illegal-symbol"; debug("state "+yystate+", error recovery discards token "+yychar+" ("+yys+")"); } yychar = -1; //read another } }//end error recovery }//yyn=0 loop if (!doaction) //any reason not to proceed? continue; //skip action yym = yylen[yyn]; //get count of terminals on rhs if (yydebug) debug("state "+yystate+", reducing "+yym+" by rule "+yyn+" ("+yyrule[yyn]+")"); Mine.write_debug_line("peek yym", yym); if (yym>0) //if count of rhs not 'nil' yyval = val_peek(yym-1); //get current semantic value yyval = dup_yyval(yyval); //duplicate yyval if ParserVal is used as semantic value switch(yyn) { //########## USER-SUPPLIED ACTIONS ########## case 1: //#line 66 "YYParser.y" { yyval = Globals.insrtptr; /* Remember original value */ } break; case 2: //#line 67 "YYParser.y" { if (Globals.stxtree != null) { /* insert new syntax tree in standard prologue */ if (val_peek(1) != null) ; /* HELP!!! chgfld(($1 . bld_den_seq),ListHeaderNode.mklist($2));*/ else yyperror("No insertion marker in standard prologue"); } else { Globals.stxtree = val_peek(0); } } break; case 3: //#line 80 "YYParser.y" { yyperror("Syntax error"); } break; case 4: //#line 82 "YYParser.y" { yyperror("Syntax error"); } break; case 6: //#line 86 "YYParser.y" { Node p; if (val_peek(1) == null) { yyperror("Missing colon in parameter specification"); } if (first(val_peek(2)) . id_str_table_index() == Initids.indx_Boolean && (Initids.id_Boolean . id_last_definition() == null)) { yyval = new ParserVal (p = Node.split(Const.PARAMETER, val_peek(2).NodeCvt(), val_peek(0).NodeCvt(),null,null,null,null)); /* HELP!!! chgfld ( (id_Boolean . id_last_definition()), first(p) );*/ /* this is the actual definition */ Initids. id_Boolean . set_id_def_found(true); if (!Globals. initflag) { yywarn ("No builtin type Boolean"); } } else if (first(val_peek(2)) . id_str_table_index() == Initids. indx_Void && (Initids. id_Void . id_last_definition() == null)) { yyval = new ParserVal( p = Node.split(Const.PARAMETER, val_peek(2).NodeCvt(), val_peek(0).NodeCvt(),null,null,null,null)); /* HELP!!! chgfld ( (Initids. id_Void . id_last_definition()), first(p) );*/ Initids. id_Void . set_id_def_found(true); if (!Globals.initflag) { yywarn ("No builtin type Void"); } } else if (first(val_peek(2)) . id_str_table_index() == Initids.indx_Integer && (Initids.id_Integer . id_last_definition() == null)) { yyval = new ParserVal (p = Node.split(Const.PARAMETER, val_peek(2).NodeCvt(), val_peek(0).NodeCvt(),null,null,null,null)); /* HELP!!! chgfld ( (Initids.id_Integer . id_last_definition()), first(p) );*/ Initids.id_Integer . set_id_def_found(true); if (!Globals.initflag) { yywarn ("No builtin type Integer"); } } else if (first(val_peek(2)) . id_str_table_index() == Initids.indx_Null && (Initids.id_Null . id_last_definition() == null)) { yyval = new ParserVal(p = Node.split(Const.PARAMETER, val_peek(2).NodeCvt(), val_peek(0).NodeCvt(),null,null,null,null)); /* HELP!!! chgfld ( (Initids.id_Null . id_last_definition()), first(p) );*/ Initids.id_Null . set_id_def_found(true); if (!Globals.initflag) { yywarn ("No builtin constant Null"); } } else { yyval = new ParserVal(Node.split(Const.PARAMETER, val_peek(2).NodeCvt(), val_peek(0).NodeCvt(),null,null,null,null)); } /* vfree($1); vfree($3);*/ } break; case 7: //#line 131 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.mklist( new ParameterNode(Const.PARAMETER,null,val_peek(0).NodeCvt()))); } break; case 8: //#line 134 "YYParser.y" { int i = 0; int c; yyperror("Error in Parameter Specification"); for ( c = yychar; !in(c, paramstop); c = yylex() ) if ( ++i > maxskip ) break; yyclearin(); switch (c) { case VAL: case VAR: case FUNC: yyunlex(c); yyunlex(';'); break; case '{': yyunlex(c); yyunlex(WORDID); yyunlex(VAL); yyunlex(']'); break; case ';': case ']': yyunlex(c); break; case Lexer.EOF: System.exit(1); default: /* recover at outer level */ yyunlex(c); yyunlex(']'); } if ( yydebug ) rec_on(c); yyval = new ParserVal(ListHeaderNode.emptylist()); } break; case 9: //#line 164 "YYParser.y" { yyval = new ParserVal(true); } break; case 10: //#line 166 "YYParser.y" { yyval = new ParserVal(false); } break; case 11: //#line 169 "YYParser.y" { yyval = val_peek(0); } break; case 12: //#line 171 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.emptylist()); } break; case 13: //#line 175 "YYParser.y" { yyval = val_peek(0); } break; case 14: //#line 177 "YYParser.y" { yyval = ParserVal.conc(val_peek(2),val_peek(0)); } break; case 15: //#line 181 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.mklist(val_peek(0).NodeCvt())); } break; case 16: //#line 183 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.addright(ListHeaderNode.ListHeaderNodeCvt(val_peek(2).NodeCvt()),ListHeaderNode.ListHeaderNodeCvt(val_peek(0).NodeCvt()))); } break; case 17: //#line 188 "YYParser.y" { yyval = val_peek(0); } break; case 18: //#line 190 "YYParser.y" { yyval = val_peek(0); } break; case 19: //#line 194 "YYParser.y" { yyval = new ParserVal(Initids.sig_Signature); } break; case 20: //#line 197 "YYParser.y" { yyval = new ParserVal(new VarSignature(Const.VARSIGNATURE,val_peek(0).NodeCvt())); } break; case 21: //#line 201 "YYParser.y" { yyval = new ParserVal(new ValSignature(Const.VALSIGNATURE,val_peek(0).NodeCvt())); } break; case 22: //#line 205 "YYParser.y" { yyval = val_peek(0); } break; case 23: //#line 208 "YYParser.y" { if (!Globals.initflag) { yywarn("Compiler directive outside initialization"); } yyval = new ParserVal(new TSignature(Const.TYPESIGNATURE,val_peek(3).NodeCvt(),val_peek(1),val_peek(9),val_peek(8).NodeCvt(),val_peek(7).NodeCvt(),val_peek(5).NodeCvt())); /* HELP $$ . ts_string_max = atoi($8);*/ /* HELP $$ . ts_simple_type = (int)$3;*/ } break; case 24: //#line 218 "YYParser.y" { if (!Globals.initflag) { yywarn("Compiler directive outside initialization"); } yyval = new ParserVal(new TSignature(Const.TYPESIGNATURE,val_peek(3).NodeCvt(),val_peek(1),val_peek(8),val_peek(7).NodeCvt(),val_peek(6).NodeCvt(),null)); /*HELP $$ . ts_string_max = atoi($8);*/ /* HELP $$ . ts_simple_type = (int)$3;*/ } break; case 25: //#line 228 "YYParser.y" { if (!Globals.initflag) { yywarn("Compiler directive outside initialization"); } yyval = new ParserVal(new TSignature(Const.TYPESIGNATURE,val_peek(3).NodeCvt(),val_peek(1),val_peek(7),val_peek(6).NodeCvt(),val_peek(5).NodeCvt(),null)); /* HELP $$ . ts_string_max = -1;*/ /* HELP $$ . ts_simple_type = (int)$3;*/ } break; case 26: //#line 238 "YYParser.y" { if (!Globals.initflag) { yywarn("Compiler directive outside initialization"); } yyval = new ParserVal(new TSignature(Const.TYPESIGNATURE,val_peek(3).NodeCvt(),val_peek(1),val_peek(5),null,null,null)); /* HELP $$ . ts_string_max = -1;*/ /* HELP $$ . ts_simple_type = (int)$3;*/ } break; case 27: //#line 248 "YYParser.y" { if (!Globals.initflag) { yywarn("Compiler directive outside initialization"); } yyval = new ParserVal(new TSignature(Const.TYPESIGNATURE,val_peek(3).NodeCvt(),val_peek(1),null,null,null,null)); /*HELP $$ . ts_string_max = -1;*/ /* HELP $$ . ts_simple_type = (int)$3;*/ } break; case 28: //#line 257 "YYParser.y" { yyval = new ParserVal(new TSignature(Const.TYPESIGNATURE,val_peek(3).NodeCvt(),val_peek(1),null,null,null,null)); /* HELP $$ . ts_string_max = -1;*/ /* HELP $$ . ts_simple_type = false;*/ } break; case 29: //#line 265 "YYParser.y" { if (val_peek(0).NodeCvt() . id_str_table_index() == Initids.indx_simple) { yyval = new ParserVal(true); /* simple type, no pointers to activation records */ } else { yywarn("Compiler directive not understood"); yyval = new ParserVal(false); } /* HELP vfree($1);*/ } break; case 30: //#line 275 "YYParser.y" { yyval = new ParserVal(false); } break; case 31: //#line 280 "YYParser.y" { if (!Globals.initflag) { yywarn("Compiler directive outside initialization"); } if (val_peek(2).NodeCvt() . id_str_table_index() == Initids.indx_inline) { /* $$ = ((inline_cnvt)($3));*/ yyval = new ParserVal(val_peek(1).NodeCvt()); } else { yywarn("Compiler directive not understood"); yyval = null; } /* HELP vfree($2);*/ } break; case 32: //#line 293 "YYParser.y" { yyval = null; } break; case 33: //#line 298 "YYParser.y" { if (!Globals.initflag) { yywarn("Compiler directive outside initialization"); } if (val_peek(3).NodeCvt() . id_str_table_index() == Initids.indx_standard) { int num_arg = 1; /* HELP atoi($4);*/ if (val_peek(2) . NodeCvt() . id_str_table_index() == Initids.indx_New) { yyval = special(Const.STD_NEW, num_arg); } else if (val_peek(2) . NodeCvt(). id_str_table_index() == Initids.indx_ptr_New) { yyval = special(Const.PTR_NEW, num_arg); } else if (val_peek(2) . NodeCvt() . id_str_table_index() == Initids.indx_init_New) { yyval = special(Const.INIT_NEW, num_arg); } else if (val_peek(2) . NodeCvt() . id_str_table_index() == Initids.indx_ValueOf) { yyval = special(Const.STD_VALUEOF, num_arg); } else if (val_peek(2) . NodeCvt() . id_str_table_index() == Initids.indx_assign) { yyval = special(Const.STD_ASSIGN, num_arg); } else if (val_peek(2) . NodeCvt() . id_str_table_index() == Initids.indx_put) { yyval = special(Const.STD_PUT, num_arg); } else if (val_peek(2) . NodeCvt() . id_str_table_index() == Initids.indx_Callcc) { yyval = special(Const.STD_CALLCC, num_arg); } else if (val_peek(2) . NodeCvt() . id_str_table_index() == Initids.indx_Array) { yyval = special(Const.STD_ARRAY, num_arg); } else if (val_peek(2) . NodeCvt() . id_str_table_index() == Initids.indx_passign) { yyval = special(Const.STD_PASSIGN, num_arg); } else if (val_peek(2) . NodeCvt() . id_str_table_index() == Initids.indx_massign) { yyval = special(Const.STD_MASSIGN, num_arg); } else { yywarn("Bad standard directive"); /* HELP $$ = 0;*/ yyval = null; } } else { yywarn("Compiler directive not understood"); yyval = null; } /* HELP vfree($2); vfree($3);*/ } break; case 34: //#line 338 "YYParser.y" { yyval = new ParserVal(new FSignature(Const.FUNCSIGNATURE,val_peek(4).NodeCvt(),val_peek(2).NodelstCvt(),val_peek(0).NodeCvt())); /* HELP $$ . fsig_special = (int)$2;*/ } break; case 35: //#line 343 "YYParser.y" { yyval = new ParserVal(new FSignature(Const.FUNCSIGNATURE,val_peek(4).NodeCvt(),val_peek(2).NodelstCvt(),val_peek(0).NodeCvt())); if (val_peek(4) != null) { /* Remember that this is a primitive other than put or callcc */ /*HELP $$ . fsig_special = special(OTHER_BUILTIN, 0);*/ } } break; case 36: //#line 353 "YYParser.y" { yyval = val_peek(0); } break; case 37: //#line 355 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.emptylist()); } break; case 38: //#line 359 "YYParser.y" { yyval = val_peek(0); } break; case 39: //#line 361 "YYParser.y" { yyval = ParserVal.conc(val_peek(2),val_peek(0)); } break; case 40: //#line 365 "YYParser.y" { yyval = val_peek(0); } break; case 41: //#line 367 "YYParser.y" { yyval = null; } break; case 42: //#line 371 "YYParser.y" { if (val_peek(1) == null) { yyperror("Missing colon in type component"); } /* lock($1); lock($3);*/ if (val_peek(0).NodeCvt() . kind == Const.VARSIGNATURE) { yyperror("Variable as type signature component"); } yyval = new ParserVal(Node.split(Const.TSCOMPONENT, val_peek(2).NodeCvt(), val_peek(0).NodeCvt(),null,null,null,null)); /* vfree(unlock($1)); vfree(unlock($3));*/ } break; case 43: //#line 383 "YYParser.y" { Node vl_field_sig; Node vr_field_sig; if (val_peek(3) == null) { yyperror("Missing colon in field specification"); } vl_field_sig = new FSignature(Const.FUNCSIGNATURE, null, /* in-line code */ new ParserVal(ListHeaderNode.mklist(new ParameterNode(Const.PARAMETER, null, new ValSignature(Const.VALSIGNATURE, new LetterId(Const.LETTERID,-1))) )).NodelstCvt(), new ValSignature(Const.VALSIGNATURE, val_peek(0).NodeCvt())); /* lock($1); lock($5);*/ if ( ParserVal.is_present(val_peek(2)) ) { yyval = new ParserVal(Node.split(Const.TSCOMPONENT,val_peek(4).NodeCvt(),Globals.vl_field_sig,null,null,null,null)); } else { vr_field_sig = new FSignature(Const.FUNCSIGNATURE, null, /* in-line code */ new ParserVal(ListHeaderNode.mklist(new ParameterNode(Const.PARAMETER, null, new VarSignature(Const.VARSIGNATURE, new LetterId(Const.LETTERID,-1))) )).NodelstCvt(), new VarSignature(Const.VARSIGNATURE, val_peek(0).NodeCvt())); yyval = ParserVal.conc(new ParserVal(Node.split(Const.TSCOMPONENT,val_peek(4).NodeCvt(),Globals.vl_field_sig,null,null,null,null)), new ParserVal(Node.split(Const.TSCOMPONENT,val_peek(4).NodeCvt(),Globals.vr_field_sig,null,null,null,null))); } /* vfree(unlock($1)); vfree(unlock($5));*/ } break; case 44: //#line 416 "YYParser.y" { int i; Node result = null; switch (val_peek(0).NodeCvt() . kind) { case Const.OPRID: i = val_peek(0) . NodeCvt() . id_str_table_index(); if ( i == Initids.indx_assign ) result = new TSComponentNode(Const.TSCOMPONENT,val_peek(0).NodeCvt(),Initids.sig_assign); else if (i == Initids.indx_less || i == Initids.indx_le ) result = new TSComponentNode(Const.TSCOMPONENT,val_peek(0).NodeCvt(),Initids.sig_less); else if ( i == Initids.indx_greater || i == Initids.indx_ge ) result = new TSComponentNode(Const.TSCOMPONENT,val_peek(0).NodeCvt(),Initids.sig_greater); else if ( i == Initids.indx_equals || i == Initids.indx_ne ) result = new TSComponentNode(Const.TSCOMPONENT,val_peek(0).NodeCvt(),Initids.sig_equals); else if ( i == Initids.indx_sconc ) result = new TSComponentNode(Const.TSCOMPONENT,val_peek(0).NodeCvt(),Initids.sig_sconc); else if ( i == Initids.indx_pconc ) result = new TSComponentNode(Const.TSCOMPONENT,val_peek(0).NodeCvt(),Initids.sig_pconc); else yyperror("Missing signature"); break; case Const.LETTERID: i = val_peek(0).NodeCvt() . id_str_table_index(); if ( i == Initids.indx_New ) result = new TSComponentNode(Const.TSCOMPONENT,val_peek(0).NodeCvt(),Initids.sig_New); else if ( i == Initids.indx_ValueOf ) result = new TSComponentNode(Const.TSCOMPONENT,val_peek(0).NodeCvt(),Initids.sig_ValueOf); else if ( (Stt.getname(i)).equals("\'")) /* quoted id */ result = new TSComponentNode(Const.TSCOMPONENT,val_peek(0).NodeCvt(),Initids.sig_const); else yyperror("Missing signature"); break; default: Mine.russinfo("parser: incorrect id structure"); } yyval = new ParserVal(ListHeaderNode.mklist(result)); } break; case 45: //#line 456 "YYParser.y" { /* return a singleton list containing a DEFCHARSIGS node with */ /* all bits corresponding to valid RUSSELL characters set. */ /* Note machine dependence. */ yyval = new ParserVal(ListHeaderNode.mklist(new DefCharSigNode(Const.DEFCHARSIGS, Const.RCS0, Const.RCS1, Const.RCS2, Const.RCS3))); } break; case 46: //#line 464 "YYParser.y" { yyperror("Error in type signature component"); yyval = new ParserVal(ListHeaderNode.emptylist()); } break; case 47: //#line 470 "YYParser.y" { yyval = new ParserVal(true); } break; case 48: //#line 472 "YYParser.y" { yyval = new ParserVal(false); } break; case 49: //#line 477 "YYParser.y" { yyval = val_peek(0); } break; case 51: //#line 481 "YYParser.y" { /* if (BADflag)*/ /* flcheck(0,0);*/ /* else*/ /* flcheck(0,1);*/ /* lock($1);*/ yyval = new ParserVal(Mkappl.mkappl(val_peek(0).NodeCvt())); /* lock($$);*/ /* vfree(unlock($1));*/ /* unlock($$);*/ /* if (Globals.bADflag)*/ /* flcheck(0,0);*/ /* else*/ /* flcheck(0,1);*/ } break; case 52: //#line 498 "YYParser.y" { if (!Globals.initflag) { yyperror("use of insertion character in non-initialization run"); } else { yyval = Globals.insrtptr = new ParserVal(new BlDenotationNode(Const.BLOCKDENOTATION,ListHeaderNode.emptylist(),null)); /*HELP Globals.insrtptr . bld_precedence = INFINITE;*/ } } break; case 53: //#line 509 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.mklist(val_peek(0).NodeCvt())); } break; case 54: //#line 512 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.mklist(val_peek(0).NodeCvt())); } break; case 55: //#line 514 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.addright(ListHeaderNode.ListHeaderNodeCvt(val_peek(1).NodeCvt()),ListHeaderNode.ListHeaderNodeCvt(val_peek(0).NodeCvt()))); } break; case 56: //#line 516 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.addright(ListHeaderNode.ListHeaderNodeCvt(val_peek(1).NodeCvt()),ListHeaderNode.ListHeaderNodeCvt(val_peek(0).NodeCvt()))); } break; case 57: //#line 520 "YYParser.y" { yyval = val_peek(0); } break; case 58: //#line 522 "YYParser.y" { yyval = val_peek(0); } break; case 59: //#line 524 "YYParser.y" { yyval = new ParserVal(new WordCandNode(Const.WORDCAND)); } break; case 60: //#line 526 "YYParser.y" { yyval = new ParserVal(new WordCorNode(Const.WORDCOR)); } break; case 61: //#line 528 "YYParser.y" { yyval = val_peek(0); } break; case 62: //#line 530 "YYParser.y" { yyval = new ParserVal(new ModPrimaryNode(Const.MODPRIMARY,val_peek(1).NodeCvt(),val_peek(0).NodeCvt(),null)); } break; case 63: //#line 532 "YYParser.y" { int prec; Node p; if ( is_empty(val_peek(1).NodeCvt()) ) { Mine.russinfo("parser: empty denotation seq\n"); abort(); } if (first(val_peek(1)) == last(val_peek(1))) { /* just return the single denotation in the sequence */ yyval = new ParserVal(p = last(val_peek(1))); /* lock(p);*/ /*vfree($2);*/ /*unlock(p);*/ } else { prec = Precedence.precedence( last(val_peek(1)) ); yyval = new ParserVal(p = new BlDenotationNode(Const.BLOCKDENOTATION,ListHeaderNode.emptylist(),val_peek(1).NodeCvt())); p.set_precedence( prec); } } break; case 64: //#line 551 "YYParser.y" { yyval = new ParserVal( new GuardedListNode(Const.GUARDEDLIST,val_peek(1).NodeCvt())); } break; case 65: //#line 553 "YYParser.y" { yyval = new ParserVal(new LoopDenotationNode(Const.LOOPDENOTATION,val_peek(1).NodeCvt())); } break; case 66: //#line 555 "YYParser.y" { int prec; Node p; prec = Precedence.precedence( last(val_peek(1)) ); yyval = new ParserVal( p = new BlDenotationNode(Const.BLOCKDENOTATION,val_peek(3).NodeCvt(),val_peek(1).NodeCvt())); p . set_precedence(prec); } break; case 67: //#line 561 "YYParser.y" { int prec; Node p; prec = Precedence.precedence( last(val_peek(1)) ); yyval = new ParserVal( p = new UseListNode(Const.USELIST,val_peek(3).NodeCvt(),val_peek(1).NodeCvt())); p.set_precedence (prec); } break; case 68: //#line 567 "YYParser.y" { /* HELP has_externs = true;*/ /* HELP $$ = mknode(REXTERNDEF, read_signature($3), $3);*/ /* HELP $$ . sig_done = SIG_DONE;*/ } break; case 69: //#line 575 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.addright(ListHeaderNode.ListHeaderNodeCvt(val_peek(2).NodeCvt()),ListHeaderNode.ListHeaderNodeCvt(val_peek(0).NodeCvt()))); } break; case 70: //#line 577 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.mklist(val_peek(0).NodeCvt())); } break; case 71: //#line 580 "YYParser.y" { int c; yyperror("Error in Expression Sequence"); for (c = yychar; !in(c, Globals.denseqstop); c = yylex()); yyclearin(); switch(c) { case ';': case '#': case FI: case ELSIF: case ELSE: case OD: case ')': case NI: case '}': yyunlex(c); break; case IF: case DO: case LET: case FUNC: case '(': yyunlex(c); yyunlex(';'); break; case WITH: yyunlex(c); yyunlex(WORDID); yyunlex(';'); break; case IN: yyunlex(c); yyunlex(LET); yyunlex(';'); break; case Lexer.EOF: System.exit(1); default: yyunlex(c); } if (yydebug) rec_on(c); yyval = new ParserVal(ListHeaderNode.mklist(Initids.id_Integer)); /* fake it */ } break; case 72: //#line 625 "YYParser.y" { yyval = val_peek(0); } break; case 73: //#line 627 "YYParser.y" { yyval = null; } break; case 74: //#line 631 "YYParser.y" { if ((val_peek(1).NodeCvt().length()) == 1) { yyval = new ParserVal(new FConstruction(Const.FUNCCONSTR,val_peek(3).NodeCvt(),first(val_peek(1)))); } else { yyval = new ParserVal(new FConstruction(Const.FUNCCONSTR,val_peek(3).NodeCvt(), new BlDenotationNode(Const.BLOCKDENOTATION,ListHeaderNode.emptylist(),val_peek(1).NodeCvt()))); /* HELP $$.fc_body.bld_precedence = Const.INFINITE; /* doesn't matter * /*/ } /* HELP $1 . fsig_construction = $$;*/ if (Globals.initflag) { /* Make sure that global functions receive the same name */ /* in all compilations. */ Integer djdno = new Integer(Globals.global_fn_count++); Globals.global_fn_count_str = djdno.toString(); String name = new String("fn_global_" + Globals.global_fn_count_str); /* HELP $$ . fc_code_label = name;*/ } } break; case 75: //#line 650 "YYParser.y" { if (val_peek(4).NodeCvt() . fsig_result_sig() == null) { yyperror("Must specify result signature for extern"); } yyval = new ParserVal(new FConstruction(Const.FUNCCONSTR, val_peek(4).NodeCvt(), new ExternDefNode(Const.EXTERNDEF, val_peek(1).NodeCvt()))); } break; case 76: //#line 659 "YYParser.y" { yyval = val_peek(0); } break; case 77: //#line 661 "YYParser.y" { yyval = new ParserVal(new FSignature(Const.FUNCSIGNATURE, val_peek(3).NodeCvt(), val_peek(1).NodelstCvt(), null)); /* HELP!!! $$ . NodeCvt().set_fsig_special($2);*/ } break; case 78: //#line 666 "YYParser.y" { yyval = new ParserVal(new FSignature(Const.FUNCSIGNATURE, val_peek(3).NodeCvt(), val_peek(1).NodelstCvt(), null)); } break; case 79: //#line 670 "YYParser.y" { /* HELP initfld(($3.sel_type), $1);*/ /* HELP initfld(($3.signature), $4);*/ yyval = val_peek(1); } break; case 80: //#line 676 "YYParser.y" { /*HELP initfld(($3.sel_type), $1);*/ yyval = val_peek(0); } break; case 81: //#line 681 "YYParser.y" { /* HELP initfld(($1.signature), $2);*/ yyval = val_peek(1); } break; case 82: //#line 686 "YYParser.y" { yyval = val_peek(0); } break; case 83: //#line 692 "YYParser.y" { yyval = val_peek(0); } break; case 84: //#line 694 "YYParser.y" { yyval = val_peek(0); } break; case 85: //#line 696 "YYParser.y" { yyval = val_peek(0); } break; case 86: //#line 698 "YYParser.y" { yyval = val_peek(0); } break; case 87: //#line 700 "YYParser.y" { yyval = val_peek(0); } break; case 88: //#line 704 "YYParser.y" { yyval = val_peek(0); } break; case 89: //#line 706 "YYParser.y" { yyval = new ParserVal(new WordElseNode(Const.WORDELSE)); } break; case 90: //#line 709 "YYParser.y" { yyperror("Error while trying to parse guard"); } break; case 91: //#line 712 "YYParser.y" { yyval = val_peek(1); } break; case 92: //#line 716 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.mklist(val_peek(0).NodeCvt())); } break; case 93: //#line 718 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.addleft(ListHeaderNode.ListHeaderNodeCvt(val_peek(0).NodeCvt()),ListHeaderNode.ListHeaderNodeCvt(val_peek(2).NodeCvt()))); } break; case 94: //#line 722 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.emptylist()); } break; case 95: //#line 726 "YYParser.y" { yyval = val_peek(0); } break; case 96: //#line 728 "YYParser.y" { yyval = ParserVal.conc(val_peek(2),val_peek(0)); } break; case 97: //#line 732 "YYParser.y" { /* lock($1); lock($2); lock($4);*/ yyval = new ParserVal(Node.split(Const.DECLARATION,val_peek(3).NodeCvt(),val_peek(0).NodeCvt(),val_peek(2).NodeCvt(),null,null,null)); /* vfree(unlock($1)); vfree(unlock($2)); vfree(unlock($4));*/ } break; case 98: //#line 738 "YYParser.y" { Node q; /* lock($1); lock($2); lock($4);*/ yyval = new ParserVal(q = Node.split(Const.DECLARATION,val_peek(3).NodeCvt(),val_peek(0).NodeCvt(),val_peek(2).NodeCvt(),null,null,null)); /* HELP!!! maplist(p, q, {*/ /* HELP!!! p . decl_sig_transp = true;*/ /* HELP!!!});*/ /* vfree(unlock($1)); vfree(unlock($2)); vfree(unlock($4));*/ } break; case 99: //#line 748 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.emptylist()); } break; case 100: //#line 750 "YYParser.y" { int c; int i = 0; yyperror("Error in declaration"); for ( c = yychar; !in(c, declstop); c = yylex() ) if ( ++i > maxskip ) break; yyclearin(); switch (c) { case EQUALS_EQUALS: yyunlex(c); yyunlex(WORDID); yyunlex(';'); break; case ';' : case '}' : case IN: yyunlex(c); break; case NI: yyunlex(c); yyunlex(WORDID); yyunlex(IN); break; case IF: case DO: case LET: case '(': yyunlex(c); yyunlex(EQUALS_EQUALS); yyunlex(WORDID); break; case Lexer.EOF: System.exit(1); default : yyunlex(c); yyunlex(NI); yyunlex(IN); } if (yydebug) rec_on(c); yyval = new ParserVal(ListHeaderNode.emptylist()); } break; case 101: //#line 793 "YYParser.y" { yyval = val_peek(0); } break; case 102: //#line 795 "YYParser.y" { yyval = null; } break; case 103: //#line 799 "YYParser.y" { yyval = new ParserVal(new EnumerationNode(Const.ENUMERATION,val_peek(1).NodeCvt())); } break; case 104: //#line 803 "YYParser.y" { yyval = new ParserVal(new ExtensionNode(Const.EXTENSION,val_peek(1).NodeCvt())); } break; case 105: //#line 807 "YYParser.y" { /* HELP!!! maplist (s, $4, {*/ /* HELP!!! if (s . par_id == null) {*/ /* HELP!!! yyperror("Anonymous fields not allowed in product");*/ /* HELP!!! }*/ /* HELP!!!});*/ yyval = new ParserVal(new ProductNode(Const.PRODCONSTRUCTION,val_peek(3).NodeCvt(),val_peek(1).NodeCvt())); } break; case 106: //#line 817 "YYParser.y" { yyperror("Error in product construction"); } break; case 107: //#line 820 "YYParser.y" { yyval = new ParserVal(new RecordConstructionNode(Const.RECORDCONSTRUCTION,val_peek(1).NodeCvt())); } break; case 108: //#line 823 "YYParser.y" { yyperror("Error in record construction"); } break; case 109: //#line 826 "YYParser.y" { /* HELP!!! maplist (s, $4, {*/ /* HELP!!! if (s . par_id == null) {*/ /* HELP!!! yyperror("Anonymous fields not allowed in union");*/ /* HELP!!! }*/ /* HELP!!!});*/ yyval = new ParserVal(new UnionConstructionNode(Const.UNIONCONSTRUCTION,val_peek(3).NodeCvt(),val_peek(1).NodeCvt())); } break; case 110: //#line 836 "YYParser.y" { yyperror("Error in union construction"); } break; case 111: //#line 839 "YYParser.y" { yyval = val_peek(0); } break; case 112: //#line 841 "YYParser.y" { yyval = ParserVal.conc(val_peek(2),val_peek(0)); } break; case 113: //#line 845 "YYParser.y" { yyval = val_peek(0); } break; case 114: //#line 847 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.emptylist()); } break; case 115: //#line 851 "YYParser.y" { if (val_peek(1).NodeCvt() != null) { yyperror("Missing colon in record element specification"); } /* lock($1); lock($3);*/ yyval = new ParserVal(Node.split(Const.RECORDELEMENT,val_peek(2).NodeCvt(),val_peek(0).NodeCvt(),null,null,null,null)); /* vfree(unlock($1)); vfree(unlock($3));*/ } break; case 116: //#line 862 "YYParser.y" { yyval = val_peek(0); } break; case 117: //#line 864 "YYParser.y" { yyval = val_peek(0); } break; case 118: //#line 868 "YYParser.y" { yyval = new ParserVal(new WithListNode(Const.WITHLIST,val_peek(3).NodeCvt(),val_peek(1).NodeCvt())); } break; case 119: //#line 871 "YYParser.y" { yyperror("Error in \"with\" type modification"); } break; case 120: //#line 874 "YYParser.y" { /* HELP $$ = mknode($1,$2,$4); */ } break; case 121: //#line 879 "YYParser.y" { yyperror("Error in \"export\" type modification"); } break; case 122: //#line 881 "YYParser.y" { yyperror("Error in \"hide\" type modification"); } break; case 123: //#line 884 "YYParser.y" { /* HELP $$ = EXPORTLIST; */ } break; case 124: //#line 888 "YYParser.y" { /* HELP $$ = HIDELIST; */ } break; case 125: //#line 894 "YYParser.y" { /* HELP $$ = ListHeaderNode.mklist($1.NodeCvt()); */ } break; case 126: //#line 898 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.addleft(ListHeaderNode.ListHeaderNodeCvt(val_peek(0).NodeCvt()),ListHeaderNode.ListHeaderNodeCvt(val_peek(2).NodeCvt()))); } break; case 127: //#line 900 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.emptylist()); } break; case 128: //#line 904 "YYParser.y" { yyval = new ParserVal(new ExportElementNode(Const.EXPORTELEMENT,val_peek(2).NodeCvt(),val_peek(1).NodeCvt(),val_peek(0).NodeCvt())); } break; case 129: //#line 906 "YYParser.y" { yyval = new ParserVal(new AllConstantsNode(Const.ALLCONSTANTS)); } break; case 130: //#line 909 "YYParser.y" { yyperror("Error in \"export\"ed or hidden element specification"); } break; case 131: //#line 912 "YYParser.y" { yyval = val_peek(0); } break; case 132: //#line 914 "YYParser.y" { yyval = null; } break; case 133: //#line 918 "YYParser.y" { yyval = val_peek(1); } break; case 134: //#line 920 "YYParser.y" { yyval = null; } break; case 135: //#line 925 "YYParser.y" { yyval = val_peek(0); } break; case 136: //#line 927 "YYParser.y" { /* Node appl_Null;*/ yyval = new ParserVal(Initids.appl_Null); } break; case 137: //#line 934 "YYParser.y" { if ((val_peek(0).NodeCvt().length()) == 1) { yyval = new ParserVal(first(val_peek(0))); } else { Node p = new BlDenotationNode(Const.BLOCKDENOTATION,ListHeaderNode.emptylist(),val_peek(0).NodeCvt()); yyval = new ParserVal(p); /* HELP p . bld_precedence = INFINITE; /* doesnt matter * /*/ } } break; case 138: //#line 944 "YYParser.y" { Node ge1; /* First guarded element */ Node ge2; /* Second guarded element */ if ((val_peek(1).NodeCvt().length()) == 1) { ge1 = new GuardedElementNode(Const.GUARDEDELEMENT,val_peek(3).NodeCvt(),first(val_peek(1))); } else { ge1 = new GuardedElementNode(Const.GUARDEDELEMENT,val_peek(3).NodeCvt(), new BlDenotationNode(Const.BLOCKDENOTATION,ListHeaderNode.emptylist(),val_peek(1).NodeCvt())); /* HELP ge1.ge_element.bld_precedence = INFINITE; /* doesn't matter * /*/ } /* $5 is a denotation to be executed if orignal */ /* guard does not apply */ ge2 = new GuardedElementNode(Const.GUARDEDELEMENT, new WordElseNode(Const.WORDELSE), val_peek(0).NodeCvt()); /* OLD (HELP) $$ = ParserVal(new GuardedElementNode(Const.GUARDEDLIST, ListHeaderNode.mklist(ge1, ge2)));*/ yyval = new ParserVal(new GuardedElementNode(Const.GUARDEDLIST, ge1,ge2)); } break; case 139: //#line 963 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.mklist(val_peek(0).NodeCvt())); } break; case 140: //#line 965 "YYParser.y" { yyval = new ParserVal(ListHeaderNode.addright(ListHeaderNode.ListHeaderNodeCvt(val_peek(2).NodeCvt()),ListHeaderNode.ListHeaderNodeCvt(val_peek(0).NodeCvt()))); } break; case 141: //#line 968 "YYParser.y" { Node ge1; /* First guarded element */ Node ge2; /* Second guarded element */ if ((val_peek(1).NodeCvt().length()) == 1) { ge1 = new GuardedElementNode(Const.GUARDEDELEMENT,val_peek(3).NodeCvt(),first(val_peek(1))); } else { ge1 = new GuardedElementNode(Const.GUARDEDELEMENT,val_peek(3).NodeCvt(), new BlDenotationNode(Const.BLOCKDENOTATION,ListHeaderNode.emptylist(),val_peek(1).NodeCvt())); /*HELP ge1.ge_element.bld_precedence = INFINITE; /* doesn't matter * /*/ } /* $4 is a denotation to be executed if orignal */ /* guard does not apply */ ge2 = new GuardedElementNode(Const.GUARDEDELEMENT, new WordElseNode(Const.WORDELSE), val_peek(0).NodeCvt()); yyval = new ParserVal(ListHeaderNode.mklist(ge1, ge2)); } break; case 142: //#line 985 "YYParser.y" { int i = 0; int c; yyperror("Error in Loop or If"); for (c = yychar; !in(c,condstop); c = yylex() ) if ( ++i > maxskip ) break; yyclearin(); switch(c) { case '#' : case FI : case OD : yyunlex(c); break; case RIGHT_ARROW : case ELSE : case THEN : case ';' : yyunlex(RIGHT_ARROW); yyunlex(WORDID); yyunlex('#'); break; case LET : case '(' : case DO : case IF : yyunlex(c); yyunlex(RIGHT_ARROW); yyunlex(WORDID); yyunlex('#'); break; case Lexer.EOF: System.exit(1); default : yyunlex(c); yyunlex(END); } if (yydebug) rec_on(c); yyval = new ParserVal(ListHeaderNode.emptylist()); } break; case 143: //#line 1022 "YYParser.y" { if ((val_peek(0).NodeCvt().length()) == 1) { yyval = new ParserVal(new GuardedElementNode(Const.GUARDEDELEMENT,val_peek(2).NodeCvt(),first(val_peek(0)))); } else { Node p = new GuardedElementNode(Const.GUARDEDELEMENT,val_peek(2).NodeCvt(), new BlDenotationNode(Const.BLOCKDENOTATION,ListHeaderNode.emptylist(),val_peek(0).NodeCvt())); yyval = new ParserVal(p); /*HELP p.ge_element.bld_precedence = INFINITE; /* doesn't matter * /*/ } } break; case 144: //#line 1034 "YYParser.y" { yyval = new ParserVal(new LetterId(Const.LETTERID,val_peek(0).NodeCvt())); } break; case 145: //#line 1036 "YYParser.y" { yyval = new ParserVal(new OpridNode(Const.OPRID,val_peek(0).NodeCvt())); } break; case 146: //#line 1040 "YYParser.y" { yyval = new ParserVal(new QStrNode(Const.QSTR,val_peek(0).NodeCvt())); } break; case 147: //#line 1042 "YYParser.y" { yyval = new ParserVal(new UQStrNode(Const.UQSTR,val_peek(0).NodeCvt())); } break; //#line 2252 "Parser.java" //########## END OF USER-SUPPLIED ACTIONS ########## }//switch //#### Now let's reduce... #### if (yydebug) debug("reduce"); state_drop(yym); //we just reduced yylen states yystate = state_peek(0); //get new state val_drop(yym); //corresponding value drop yym = yylhs[yyn]; //select next TERMINAL(on lhs) if (yystate == 0 && yym == 0)//done? 'rest' state and at first TERMINAL { if (yydebug) debug("After reduction, shifting from state 0 to state "+YYFINAL+""); yystate = YYFINAL; //explicitly say we're done state_push(YYFINAL); //and save it val_push(yyval); //also save the semantic value of parsing if (yychar < 0) //we want another character? { yychar = yylex(); //get next character if (yychar<0) yychar=0; //clean, if necessary if (yydebug) yylexdebug(yystate,yychar); } if (yychar == 0) //Good exit (if lex returns 0 ;-) break; //quit the loop--all DONE }//if yystate else //else not done yet { //get next state and push, for next yydefred[] yyn = yygindex[yym]; //find out where to go if ((yyn != 0) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yystate) yystate = yytable[yyn]; //get new state else yystate = yydgoto[yym]; //else go to new defred if (yydebug) debug("after reduction, shifting from state "+state_peek(0)+" to state "+yystate+""); state_push(yystate); //going again, so push state & val... val_push(yyval); //for next action } }//main loop return 0;//yyaccept!! } //## end of method parse() ###################################### //## run() --- for Thread ####################################### //## The -Jnorun option was used ## //## end of method run() ######################################## //## Constructors ############################################### /** * Default constructor. Turn off with -Jnoconstruct . */ public Parser() { //nothing to do } /** * Create a parser, setting the debug to true or false. * @param debugMe true for debugging, false for no debug. */ public Parser(boolean debugMe) { yydebug=debugMe; } //############################################################### } //################### END OF CLASS ##############################