0001: //----------------------------------------------------
0002: // The following code was generated by CUP v0.10k
0003: // Tue Oct 19 10:42:24 EEST 2004
0004: //----------------------------------------------------
0005:
0006: package ro.infoiasi.donald.compiler.parser;
0007:
0008: import ro.infoiasi.donald.compiler.cfg.*;
0009: import java.util.*;
0010:
0011: /** CUP v0.10k generated parser.
0012: * @version Tue Oct 19 10:42:24 EEST 2004
0013: */
0014: public class SpecParser extends java_cup.runtime.lr_parser {
0015:
0016: /** Default constructor. */
0017: public SpecParser() {
0018: super ();
0019: }
0020:
0021: /** Constructor which sets the default scanner. */
0022: public SpecParser(java_cup.runtime.Scanner s) {
0023: super (s);
0024: }
0025:
0026: /** Production table. */
0027: protected static final short _production_table[][] = unpackFromStrings(new String[] { "\000\114\000\002\003\011\000\002\002\004\000\002\004"
0028: + "\005\000\002\004\003\000\002\005\004\000\002\005\003"
0029: + "\000\002\006\005\000\002\007\005\000\002\007\003\000"
0030: + "\002\010\004\000\002\010\003\000\002\011\003\000\002"
0031: + "\011\003\000\002\011\003\000\002\011\003\000\002\012"
0032: + "\006\000\002\013\006\000\002\014\006\000\002\015\006"
0033: + "\000\002\016\004\000\002\016\003\000\002\017\004\000"
0034: + "\002\017\005\000\002\017\004\000\002\020\004\000\002"
0035: + "\052\002\000\002\020\006\000\002\021\004\000\002\053"
0036: + "\002\000\002\021\006\000\002\022\003\000\002\022\005"
0037: + "\000\002\023\005\000\002\023\003\000\002\024\005\000"
0038: + "\002\024\003\000\002\025\003\000\002\025\003\000\002"
0039: + "\026\004\000\002\026\003\000\002\054\002\000\002\027"
0040: + "\007\000\002\055\002\000\002\027\007\000\002\056\002"
0041: + "\000\002\027\007\000\002\030\005\000\002\030\003\000"
0042: + "\002\031\006\000\002\031\002\000\002\032\004\000\002"
0043: + "\032\003\000\002\057\002\000\002\033\007\000\002\060"
0044: + "\002\000\002\034\006\000\002\034\003\000\002\035\005"
0045: + "\000\002\035\003\000\002\036\004\000\002\036\003\000"
0046: + "\002\037\004\000\002\037\003\000\002\040\004\000\002"
0047: + "\040\003\000\002\041\003\000\002\047\005\000\002\047"
0048: + "\003\000\002\042\003\000\002\043\003\000\002\044\003"
0049: + "\000\002\045\003\000\002\046\003\000\002\050\003\000"
0050: + "\002\050\003\000\002\051\002" });
0051:
0052: /** Access to production table. */
0053: public short[][] production_table() {
0054: return _production_table;
0055: }
0056:
0057: /** Parse-action table. */
0058: protected static final short[][] _action_table = unpackFromStrings(new String[] { "\000\205\000\024\004\007\005\uffb6\006\uffb6\007\uffb6\011"
0059: + "\uffb6\012\uffb6\014\uffb6\015\uffb6\016\uffb6\001\002\000\022"
0060: + "\005\uffb6\006\uffb6\007\uffb6\011\uffb6\012\uffb6\014\uffb6\015"
0061: + "\uffb6\016\uffb6\001\002\000\004\002\015\001\002\000\022"
0062: + "\005\ufffe\006\ufffe\007\ufffe\011\ufffe\012\ufffe\014\ufffe\015"
0063: + "\ufffe\016\ufffe\001\002\000\004\036\010\001\002\000\006"
0064: + "\030\uffbe\032\uffbe\001\002\000\006\030\012\032\013\001"
0065: + "\002\000\022\005\uffff\006\uffff\007\uffff\011\uffff\012\uffff"
0066: + "\014\uffff\015\uffff\016\uffff\001\002\000\004\036\014\001"
0067: + "\002\000\012\030\uffbf\032\uffbf\034\uffbf\036\uffbf\001\002"
0068: + "\000\004\002\000\001\002\000\022\005\021\006\uffb6\007"
0069: + "\uffb6\011\uffb6\012\uffb6\014\uffb6\015\uffb6\016\uffb6\001\002"
0070: + "\000\022\005\ufffc\006\ufffc\007\ufffc\011\ufffc\012\ufffc\014"
0071: + "\ufffc\015\ufffc\016\ufffc\001\002\000\022\005\ufffd\006\ufffd"
0072: + "\007\ufffd\011\ufffd\012\ufffd\014\ufffd\015\ufffd\016\ufffd\001"
0073: + "\002\000\004\036\010\001\002\000\020\006\025\007\026"
0074: + "\011\037\012\040\014\030\015\034\016\033\001\002\000"
0075: + "\020\006\ufff7\007\ufff7\011\ufff7\012\ufff7\014\ufff7\015\ufff7"
0076: + "\016\ufff7\001\002\000\020\006\ufff8\007\ufff8\011\ufff8\012"
0077: + "\ufff8\014\ufff8\015\ufff8\016\ufff8\001\002\000\004\010\200"
0078: + "\001\002\000\004\010\175\001\002\000\020\006\ufff5\007"
0079: + "\ufff5\011\ufff5\012\ufff5\014\ufff5\015\ufff5\016\ufff5\001\002"
0080: + "\000\004\015\173\001\002\000\016\014\uffed\015\uffed\016"
0081: + "\uffed\017\uffed\023\uffed\036\uffed\001\002\000\020\006\ufff3"
0082: + "\007\ufff3\011\ufff3\012\ufff3\014\ufff3\015\ufff3\016\ufff3\001"
0083: + "\002\000\004\036\160\001\002\000\004\036\140\001\002"
0084: + "\000\020\006\ufff6\007\ufff6\011\ufff6\012\ufff6\014\ufff6\015"
0085: + "\ufff6\016\ufff6\001\002\000\016\014\030\015\034\016\033"
0086: + "\017\054\023\uffb6\036\uffb6\001\002\000\004\013\047\001"
0087: + "\002\000\004\013\042\001\002\000\020\006\ufff4\007\ufff4"
0088: + "\011\ufff4\012\ufff4\014\ufff4\015\ufff4\016\ufff4\001\002\000"
0089: + "\004\037\043\001\002\000\022\006\uffb6\007\uffb6\011\uffb6"
0090: + "\012\uffb6\014\uffb6\015\uffb6\016\uffb6\030\045\001\002\000"
0091: + "\020\006\uffef\007\uffef\011\uffef\012\uffef\014\uffef\015\uffef"
0092: + "\016\uffef\001\002\000\020\006\uffb8\007\uffb8\011\uffb8\012"
0093: + "\uffb8\014\uffb8\015\uffb8\016\uffb8\001\002\000\020\006\uffb7"
0094: + "\007\uffb7\011\uffb7\012\uffb7\014\uffb7\015\uffb7\016\uffb7\001"
0095: + "\002\000\004\037\050\001\002\000\022\006\uffb6\007\uffb6"
0096: + "\011\uffb6\012\uffb6\014\uffb6\015\uffb6\016\uffb6\030\045\001"
0097: + "\002\000\020\006\ufff0\007\ufff0\011\ufff0\012\ufff0\014\ufff0"
0098: + "\015\ufff0\016\ufff0\001\002\000\006\023\102\036\uffd0\001"
0099: + "\002\000\010\017\uffda\023\uffda\036\uffda\001\002\000\010"
0100: + "\020\061\021\062\022\063\001\002\000\016\014\uffee\015"
0101: + "\uffee\016\uffee\017\uffee\023\uffee\036\uffee\001\002\000\006"
0102: + "\023\uffdc\036\uffdc\001\002\000\010\017\054\023\uffdd\036"
0103: + "\uffdd\001\002\000\010\017\uffdb\023\uffdb\036\uffdb\001\002"
0104: + "\000\004\036\uffd9\001\002\000\004\036\uffd7\001\002\000"
0105: + "\004\036\uffd5\001\002\000\004\036\065\001\002\000\010"
0106: + "\026\uffbb\027\uffbb\030\uffbb\001\002\000\006\027\uffd2\030"
0107: + "\uffd2\001\002\000\006\027\070\030\071\001\002\000\004"
0108: + "\036\065\001\002\000\010\017\uffd4\023\uffd4\036\uffd4\001"
0109: + "\002\000\006\027\uffd3\030\uffd3\001\002\000\004\036\065"
0110: + "\001\002\000\006\027\070\030\075\001\002\000\010\017"
0111: + "\uffd6\023\uffd6\036\uffd6\001\002\000\004\036\065\001\002"
0112: + "\000\006\027\070\030\100\001\002\000\010\017\uffd8\023"
0113: + "\uffd8\036\uffd8\001\002\000\004\036\104\001\002\000\004"
0114: + "\013\103\001\002\000\004\036\104\001\002\000\006\025"
0115: + "\uffba\030\uffba\001\002\000\004\030\106\001\002\000\004"
0116: + "\036\uffd1\001\002\000\004\025\113\001\002\000\006\002"
0117: + "\001\036\104\001\002\000\006\002\uffce\036\uffce\001\002"
0118: + "\000\006\002\uffcf\036\uffcf\001\002\000\014\024\uffcd\026"
0119: + "\uffcd\030\uffcd\036\uffcd\037\uffcd\001\002\000\014\024\uffb6"
0120: + "\026\uffb6\030\uffb6\036\uffb6\037\uffb6\001\002\000\006\026"
0121: + "\134\030\135\001\002\000\014\024\uffc5\026\uffc5\030\uffc5"
0122: + "\036\uffc5\037\uffc5\001\002\000\006\026\uffc9\030\uffc9\001"
0123: + "\002\000\014\024\124\026\uffc7\030\uffc7\036\121\037\122"
0124: + "\001\002\000\016\024\uffb9\026\uffb9\030\uffb9\031\uffb9\036"
0125: + "\uffb9\037\uffb9\001\002\000\014\024\uffc3\026\uffc3\030\uffc3"
0126: + "\036\uffc3\037\uffc3\001\002\000\016\024\uffb6\026\uffb6\030"
0127: + "\uffb6\031\127\036\uffb6\037\uffb6\001\002\000\004\036\065"
0128: + "\001\002\000\014\024\uffc6\026\uffc6\030\uffc6\036\uffc6\037"
0129: + "\uffc6\001\002\000\006\026\uffc8\030\uffc8\001\002\000\004"
0130: + "\036\132\001\002\000\014\024\uffc1\026\uffc1\030\uffc1\036"
0131: + "\uffc1\037\uffc1\001\002\000\014\024\uffc4\026\uffc4\030\uffc4"
0132: + "\036\uffc4\037\uffc4\001\002\000\014\024\uffc0\026\uffc0\030"
0133: + "\uffc0\036\uffc0\037\uffc0\001\002\000\014\024\uffc2\026\uffc2"
0134: + "\030\uffc2\036\uffc2\037\uffc2\001\002\000\014\024\uffcb\026"
0135: + "\uffcb\030\uffcb\036\uffcb\037\uffcb\001\002\000\006\002\uffcc"
0136: + "\036\uffcc\001\002\000\014\024\uffb6\026\uffb6\030\uffb6\036"
0137: + "\uffb6\037\uffb6\001\002\000\006\026\uffca\030\uffca\001\002"
0138: + "\000\014\027\uffbd\030\uffbd\032\uffbe\034\uffbe\036\uffbe\001"
0139: + "\002\000\010\032\013\034\uffe3\036\uffe3\001\002\000\006"
0140: + "\027\uffe0\030\uffe0\001\002\000\006\027\153\030\156\001"
0141: + "\002\000\016\014\uffec\015\uffec\016\uffec\017\uffec\023\uffec"
0142: + "\036\uffec\001\002\000\006\034\147\036\uffe8\001\002\000"
0143: + "\004\036\151\001\002\000\004\035\150\001\002\000\006"
0144: + "\034\uffe2\036\uffe2\001\002\000\006\027\uffbd\030\uffbd\001"
0145: + "\002\000\006\027\153\030\154\001\002\000\004\036\151"
0146: + "\001\002\000\016\014\uffe7\015\uffe7\016\uffe7\017\uffe7\023"
0147: + "\uffe7\036\uffe7\001\002\000\006\027\uffe1\030\uffe1\001\002"
0148: + "\000\016\014\uffe9\015\uffe9\016\uffe9\017\uffe9\023\uffe9\036"
0149: + "\uffe9\001\002\000\016\014\uffea\015\uffea\016\uffea\017\uffea"
0150: + "\023\uffea\036\uffea\001\002\000\014\027\uffbc\030\uffbc\032"
0151: + "\uffbe\034\uffbe\036\uffbe\001\002\000\006\027\uffde\030\uffde"
0152: + "\001\002\000\006\027\167\030\172\001\002\000\006\034"
0153: + "\147\036\uffe5\001\002\000\004\036\165\001\002\000\006"
0154: + "\027\uffbc\030\uffbc\001\002\000\006\027\167\030\170\001"
0155: + "\002\000\004\036\165\001\002\000\016\014\uffe4\015\uffe4"
0156: + "\016\uffe4\017\uffe4\023\uffe4\036\uffe4\001\002\000\006\027"
0157: + "\uffdf\030\uffdf\001\002\000\016\014\uffe6\015\uffe6\016\uffe6"
0158: + "\017\uffe6\023\uffe6\036\uffe6\001\002\000\004\036\160\001"
0159: + "\002\000\016\014\uffeb\015\uffeb\016\uffeb\017\uffeb\023\uffeb"
0160: + "\036\uffeb\001\002\000\004\037\176\001\002\000\022\006"
0161: + "\uffb6\007\uffb6\011\uffb6\012\uffb6\014\uffb6\015\uffb6\016\uffb6"
0162: + "\030\045\001\002\000\020\006\ufff1\007\ufff1\011\ufff1\012"
0163: + "\ufff1\014\ufff1\015\ufff1\016\ufff1\001\002\000\004\037\201"
0164: + "\001\002\000\022\006\uffb6\007\uffb6\011\uffb6\012\uffb6\014"
0165: + "\uffb6\015\uffb6\016\uffb6\030\045\001\002\000\020\006\ufff2"
0166: + "\007\ufff2\011\ufff2\012\ufff2\014\ufff2\015\ufff2\016\ufff2\001"
0167: + "\002\000\006\030\ufff9\032\206\001\002\000\004\030\205"
0168: + "\001\002\000\022\005\ufffb\006\ufffb\007\ufffb\011\ufffb\012"
0169: + "\ufffb\014\ufffb\015\ufffb\016\ufffb\001\002\000\006\033\207"
0170: + "\036\014\001\002\000\004\030\ufffa\001\002" });
0171:
0172: /** Access to parse-action table. */
0173: public short[][] action_table() {
0174: return _action_table;
0175: }
0176:
0177: /** <code>reduce_goto</code> table. */
0178: protected static final short[][] _reduce_table = unpackFromStrings(new String[] { "\000\205\000\010\003\004\004\003\051\005\001\001\000"
0179: + "\006\005\015\051\016\001\001\000\002\001\001\000\002"
0180: + "\001\001\000\004\047\010\001\001\000\002\001\001\000"
0181: + "\002\001\001\000\002\001\001\000\002\001\001\000\002"
0182: + "\001\001\000\002\001\001\000\010\006\017\010\021\051"
0183: + "\022\001\001\000\002\001\001\000\002\001\001\000\006"
0184: + "\007\203\047\202\001\001\000\020\011\023\012\034\013"
0185: + "\026\014\040\015\031\016\035\017\030\001\001\000\002"
0186: + "\001\001\000\002\001\001\000\002\001\001\000\002\001"
0187: + "\001\000\002\001\001\000\002\001\001\000\002\001\001"
0188: + "\000\002\001\001\000\014\021\156\022\162\024\161\043"
0189: + "\160\047\140\001\001\000\014\020\143\022\144\023\142"
0190: + "\042\141\047\140\001\001\000\002\001\001\000\014\017"
0191: + "\054\025\051\026\056\027\052\051\055\001\001\000\002"
0192: + "\001\001\000\002\001\001\000\002\001\001\000\002\001"
0193: + "\001\000\006\050\043\051\045\001\001\000\002\001\001"
0194: + "\000\002\001\001\000\002\001\001\000\002\001\001\000"
0195: + "\006\050\050\051\045\001\001\000\002\001\001\000\004"
0196: + "\031\100\001\001\000\002\001\001\000\002\001\001\000"
0197: + "\002\001\001\000\002\001\001\000\004\027\057\001\001"
0198: + "\000\002\001\001\000\004\054\075\001\001\000\004\055"
0199: + "\072\001\001\000\004\056\063\001\001\000\006\030\066"
0200: + "\044\065\001\001\000\002\001\001\000\002\001\001\000"
0201: + "\002\001\001\000\004\044\071\001\001\000\002\001\001"
0202: + "\000\002\001\001\000\006\030\073\044\065\001\001\000"
0203: + "\002\001\001\000\002\001\001\000\006\030\076\044\065"
0204: + "\001\001\000\002\001\001\000\002\001\001\000\010\032"
0205: + "\107\033\110\045\106\001\001\000\002\001\001\000\004"
0206: + "\045\104\001\001\000\002\001\001\000\002\001\001\000"
0207: + "\002\001\001\000\002\001\001\000\006\033\111\045\106"
0208: + "\001\001\000\002\001\001\000\002\001\001\000\004\057"
0209: + "\113\001\001\000\012\034\114\035\116\036\117\051\115"
0210: + "\001\001\000\002\001\001\000\002\001\001\000\002\001"
0211: + "\001\000\006\037\124\046\122\001\001\000\002\001\001"
0212: + "\000\002\001\001\000\006\040\130\051\127\001\001\000"
0213: + "\004\044\125\001\001\000\002\001\001\000\002\001\001"
0214: + "\000\004\041\132\001\001\000\002\001\001\000\002\001"
0215: + "\001\000\002\001\001\000\002\001\001\000\004\060\135"
0216: + "\001\001\000\002\001\001\000\010\035\136\036\117\051"
0217: + "\115\001\001\000\002\001\001\000\002\001\001\000\002"
0218: + "\001\001\000\002\001\001\000\002\001\001\000\002\001"
0219: + "\001\000\004\052\145\001\001\000\006\023\151\042\141"
0220: + "\001\001\000\002\001\001\000\002\001\001\000\002\001"
0221: + "\001\000\002\001\001\000\004\042\154\001\001\000\002"
0222: + "\001\001\000\002\001\001\000\002\001\001\000\002\001"
0223: + "\001\000\002\001\001\000\002\001\001\000\002\001\001"
0224: + "\000\004\053\163\001\001\000\006\024\165\043\160\001"
0225: + "\001\000\002\001\001\000\002\001\001\000\004\043\170"
0226: + "\001\001\000\002\001\001\000\002\001\001\000\002\001"
0227: + "\001\000\014\021\173\022\162\024\161\043\160\047\140"
0228: + "\001\001\000\002\001\001\000\002\001\001\000\006\050"
0229: + "\176\051\045\001\001\000\002\001\001\000\002\001\001"
0230: + "\000\006\050\201\051\045\001\001\000\002\001\001\000"
0231: + "\002\001\001\000\002\001\001\000\002\001\001\000\002"
0232: + "\001\001\000\002\001\001" });
0233:
0234: /** Access to <code>reduce_goto</code> table. */
0235: public short[][] reduce_table() {
0236: return _reduce_table;
0237: }
0238:
0239: /** Instance of action encapsulation class. */
0240: protected CUP$SpecParser$actions action_obj;
0241:
0242: /** Action encapsulation object initializer. */
0243: protected void init_actions() {
0244: action_obj = new CUP$SpecParser$actions(this );
0245: }
0246:
0247: /** Invoke a user supplied parse action. */
0248: public java_cup.runtime.Symbol do_action(int act_num,
0249: java_cup.runtime.lr_parser parser, java.util.Stack stack,
0250: int top) throws java.lang.Exception {
0251: /* call code in generated class */
0252: return action_obj.CUP$SpecParser$do_action(act_num, parser,
0253: stack, top);
0254: }
0255:
0256: /** Indicates start state. */
0257: public int start_state() {
0258: return 0;
0259: }
0260:
0261: /** Indicates start production. */
0262: public int start_production() {
0263: return 1;
0264: }
0265:
0266: /** <code>EOF</code> Symbol index. */
0267: public int EOF_sym() {
0268: return 0;
0269: }
0270:
0271: /** <code>error</code> Symbol index. */
0272: public int error_sym() {
0273: return 1;
0274: }
0275:
0276: // Parser code to change the way the parser reports errors
0277: public void report_error(String message, Object info) {
0278: StringBuffer m = new StringBuffer("Error");
0279: if (info instanceof java_cup.runtime.Symbol) {
0280: java_cup.runtime.Symbol symbol = ((java_cup.runtime.Symbol) info);
0281: if (symbol.left >= 0) {
0282: m.append(" in line " + (symbol.left + 1));
0283: if (symbol.right >= 0)
0284: m.append(", column " + (symbol.right + 1));
0285: }
0286: }
0287: m.append(" : " + message);
0288: System.err.println(m);
0289: }
0290:
0291: public void report_fatal_error(String message, Object info)
0292: throws SpecParseException {
0293: report_error(message, info);
0294: throw new SpecParseException(message);
0295: }
0296:
0297: }
0298:
0299: /** Cup generated class to encapsulate user supplied action code.*/
0300: class CUP$SpecParser$actions {
0301:
0302: class Pair {
0303: Object first;
0304: Object second;
0305:
0306: Pair(Object first, Object second) {
0307: this .first = first;
0308: this .second = second;
0309: }
0310: }
0311:
0312: private String packageName = null;
0313: private List importsList = new LinkedList();
0314: private String actionCode = null;
0315: private String parserCode = null;
0316: private String initCode = null;
0317: private String scanCode = null;
0318:
0319: private NonTerminals v = new NonTerminals();
0320: private Terminals t = new Terminals();
0321: private NonTerminal s = null;
0322: private Productions p = new Productions();
0323:
0324: private String type;
0325:
0326: private int countNewNonTerminals = 0;
0327: private int precedence = Terminal.NO_PRECEDENCE;
0328: private int associativity;
0329:
0330: private int prodPrecedence;
0331: private NonTerminal lhs;
0332: private List RHSList;
0333: private List prodPartList;
0334: private String prodPartLabel;
0335: private List prodPartLabels;
0336: private SemanticAction action;
0337:
0338: private final SpecParser parser;
0339:
0340: /** Constructor */
0341: CUP$SpecParser$actions(SpecParser parser) {
0342: this .parser = parser;
0343: }
0344:
0345: /** Method with the actual generated action code. */
0346: public final java_cup.runtime.Symbol CUP$SpecParser$do_action(
0347: int CUP$SpecParser$act_num,
0348: java_cup.runtime.lr_parser CUP$SpecParser$parser,
0349: java.util.Stack CUP$SpecParser$stack, int CUP$SpecParser$top)
0350: throws java.lang.Exception {
0351: /* Symbol object for return from actions */
0352: java_cup.runtime.Symbol CUP$SpecParser$result;
0353:
0354: /* select the action based on the action number */
0355: switch (CUP$SpecParser$act_num) {
0356: /*. . . . . . . . . . . . . . . . . . . .*/
0357: case 75: // empty ::=
0358: {
0359: Object RESULT = null;
0360:
0361: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0362: 39/*empty*/,
0363: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0364: .elementAt(CUP$SpecParser$top - 0)).right,
0365: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0366: .elementAt(CUP$SpecParser$top - 0)).right,
0367: RESULT);
0368: }
0369: return CUP$SpecParser$result;
0370:
0371: /*. . . . . . . . . . . . . . . . . . . .*/
0372: case 74: // opt_semi ::= empty
0373: {
0374: Object RESULT = null;
0375:
0376: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0377: 38/*opt_semi*/,
0378: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0379: .elementAt(CUP$SpecParser$top - 0)).left,
0380: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0381: .elementAt(CUP$SpecParser$top - 0)).right,
0382: RESULT);
0383: }
0384: return CUP$SpecParser$result;
0385:
0386: /*. . . . . . . . . . . . . . . . . . . .*/
0387: case 73: // opt_semi ::= SEMI
0388: {
0389: Object RESULT = null;
0390:
0391: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0392: 38/*opt_semi*/,
0393: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0394: .elementAt(CUP$SpecParser$top - 0)).left,
0395: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0396: .elementAt(CUP$SpecParser$top - 0)).right,
0397: RESULT);
0398: }
0399: return CUP$SpecParser$result;
0400:
0401: /*. . . . . . . . . . . . . . . . . . . .*/
0402: case 72: // symbol_id ::= ID
0403: {
0404: ro.infoiasi.donald.compiler.cfg.Symbol RESULT = null;
0405: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0406: .elementAt(CUP$SpecParser$top - 0)).left;
0407: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0408: .elementAt(CUP$SpecParser$top - 0)).right;
0409: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0410: .elementAt(CUP$SpecParser$top - 0)).value;
0411:
0412: RESULT = t.find(id);
0413: if (RESULT == null) {
0414: RESULT = v.find(id);
0415: }
0416: if (RESULT == null) {
0417: parser.report_fatal_error("symbol \"" + id
0418: + "\" not found", null);
0419: }
0420:
0421: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0422: 36/*symbol_id*/,
0423: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0424: .elementAt(CUP$SpecParser$top - 0)).left,
0425: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0426: .elementAt(CUP$SpecParser$top - 0)).right,
0427: RESULT);
0428: }
0429: return CUP$SpecParser$result;
0430:
0431: /*. . . . . . . . . . . . . . . . . . . .*/
0432: case 71: // nonterminal_id ::= ID
0433: {
0434: NonTerminal RESULT = null;
0435: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0436: .elementAt(CUP$SpecParser$top - 0)).left;
0437: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0438: .elementAt(CUP$SpecParser$top - 0)).right;
0439: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0440: .elementAt(CUP$SpecParser$top - 0)).value;
0441:
0442: RESULT = v.find(id);
0443: if (RESULT == null) {
0444: parser.report_fatal_error("non-terminal \"" + id
0445: + "\" not found", null);
0446: }
0447:
0448: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0449: 35/*nonterminal_id*/,
0450: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0451: .elementAt(CUP$SpecParser$top - 0)).left,
0452: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0453: .elementAt(CUP$SpecParser$top - 0)).right,
0454: RESULT);
0455: }
0456: return CUP$SpecParser$result;
0457:
0458: /*. . . . . . . . . . . . . . . . . . . .*/
0459: case 70: // terminal_id ::= ID
0460: {
0461: Terminal RESULT = null;
0462: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0463: .elementAt(CUP$SpecParser$top - 0)).left;
0464: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0465: .elementAt(CUP$SpecParser$top - 0)).right;
0466: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0467: .elementAt(CUP$SpecParser$top - 0)).value;
0468:
0469: RESULT = t.find(id);
0470: if (RESULT == null) {
0471: parser.report_fatal_error("terminal \"" + id
0472: + "\" not found", null);
0473: }
0474:
0475: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0476: 34/*terminal_id*/,
0477: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0478: .elementAt(CUP$SpecParser$top - 0)).left,
0479: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0480: .elementAt(CUP$SpecParser$top - 0)).right,
0481: RESULT);
0482: }
0483: return CUP$SpecParser$result;
0484:
0485: /*. . . . . . . . . . . . . . . . . . . .*/
0486: case 69: // new_non_term_id ::= ID
0487: {
0488: Object RESULT = null;
0489: int nameleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0490: .elementAt(CUP$SpecParser$top - 0)).left;
0491: int nameright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0492: .elementAt(CUP$SpecParser$top - 0)).right;
0493: String name = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0494: .elementAt(CUP$SpecParser$top - 0)).value;
0495: v.addNew(name, type);
0496: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0497: 33/*new_non_term_id*/,
0498: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0499: .elementAt(CUP$SpecParser$top - 0)).left,
0500: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0501: .elementAt(CUP$SpecParser$top - 0)).right,
0502: RESULT);
0503: }
0504: return CUP$SpecParser$result;
0505:
0506: /*. . . . . . . . . . . . . . . . . . . .*/
0507: case 68: // new_term_id ::= ID
0508: {
0509: Object RESULT = null;
0510: int nameleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0511: .elementAt(CUP$SpecParser$top - 0)).left;
0512: int nameright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0513: .elementAt(CUP$SpecParser$top - 0)).right;
0514: String name = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0515: .elementAt(CUP$SpecParser$top - 0)).value;
0516: t.addNew(name, type);
0517: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0518: 32/*new_term_id*/,
0519: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0520: .elementAt(CUP$SpecParser$top - 0)).left,
0521: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0522: .elementAt(CUP$SpecParser$top - 0)).right,
0523: RESULT);
0524: }
0525: return CUP$SpecParser$result;
0526:
0527: /*. . . . . . . . . . . . . . . . . . . .*/
0528: case 67: // multipart_id ::= ID
0529: {
0530: String RESULT = null;
0531: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0532: .elementAt(CUP$SpecParser$top - 0)).left;
0533: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0534: .elementAt(CUP$SpecParser$top - 0)).right;
0535: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0536: .elementAt(CUP$SpecParser$top - 0)).value;
0537:
0538: RESULT = id;
0539:
0540: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0541: 37/*multipart_id*/,
0542: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0543: .elementAt(CUP$SpecParser$top - 0)).left,
0544: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0545: .elementAt(CUP$SpecParser$top - 0)).right,
0546: RESULT);
0547: }
0548: return CUP$SpecParser$result;
0549:
0550: /*. . . . . . . . . . . . . . . . . . . .*/
0551: case 66: // multipart_id ::= multipart_id DOT ID
0552: {
0553: String RESULT = null;
0554: int id1left = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0555: .elementAt(CUP$SpecParser$top - 2)).left;
0556: int id1right = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0557: .elementAt(CUP$SpecParser$top - 2)).right;
0558: String id1 = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0559: .elementAt(CUP$SpecParser$top - 2)).value;
0560: int id2left = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0561: .elementAt(CUP$SpecParser$top - 0)).left;
0562: int id2right = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0563: .elementAt(CUP$SpecParser$top - 0)).right;
0564: String id2 = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0565: .elementAt(CUP$SpecParser$top - 0)).value;
0566:
0567: RESULT = id1 + "." + id2;
0568:
0569: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0570: 37/*multipart_id*/,
0571: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0572: .elementAt(CUP$SpecParser$top - 2)).left,
0573: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0574: .elementAt(CUP$SpecParser$top - 0)).right,
0575: RESULT);
0576: }
0577: return CUP$SpecParser$result;
0578:
0579: /*. . . . . . . . . . . . . . . . . . . .*/
0580: case 65: // label_id ::= ID
0581: {
0582: String RESULT = null;
0583: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0584: .elementAt(CUP$SpecParser$top - 0)).left;
0585: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0586: .elementAt(CUP$SpecParser$top - 0)).right;
0587: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0588: .elementAt(CUP$SpecParser$top - 0)).value;
0589:
0590: RESULT = id;
0591:
0592: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0593: 31/*label_id*/,
0594: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0595: .elementAt(CUP$SpecParser$top - 0)).left,
0596: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0597: .elementAt(CUP$SpecParser$top - 0)).right,
0598: RESULT);
0599: }
0600: return CUP$SpecParser$result;
0601:
0602: /*. . . . . . . . . . . . . . . . . . . .*/
0603: case 64: // opt_label ::= empty
0604: {
0605: Object RESULT = null;
0606:
0607: prodPartLabel = null;
0608:
0609: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0610: 30/*opt_label*/,
0611: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0612: .elementAt(CUP$SpecParser$top - 0)).left,
0613: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0614: .elementAt(CUP$SpecParser$top - 0)).right,
0615: RESULT);
0616: }
0617: return CUP$SpecParser$result;
0618:
0619: /*. . . . . . . . . . . . . . . . . . . .*/
0620: case 63: // opt_label ::= COLON label_id
0621: {
0622: Object RESULT = null;
0623: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0624: .elementAt(CUP$SpecParser$top - 0)).left;
0625: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0626: .elementAt(CUP$SpecParser$top - 0)).right;
0627: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0628: .elementAt(CUP$SpecParser$top - 0)).value;
0629:
0630: prodPartLabel = id;
0631:
0632: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0633: 30/*opt_label*/,
0634: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0635: .elementAt(CUP$SpecParser$top - 1)).left,
0636: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0637: .elementAt(CUP$SpecParser$top - 0)).right,
0638: RESULT);
0639: }
0640: return CUP$SpecParser$result;
0641:
0642: /*. . . . . . . . . . . . . . . . . . . .*/
0643: case 62: // prod_part ::= CODE_STRING
0644: {
0645: Object RESULT = null;
0646: int codeStringleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0647: .elementAt(CUP$SpecParser$top - 0)).left;
0648: int codeStringright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0649: .elementAt(CUP$SpecParser$top - 0)).right;
0650: String codeString = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0651: .elementAt(CUP$SpecParser$top - 0)).value;
0652:
0653: prodPartList.add(new SemanticAction(lhs.getType(),
0654: prodPartLabels, prodPartList.size(), codeString));
0655:
0656: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0657: 29/*prod_part*/,
0658: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0659: .elementAt(CUP$SpecParser$top - 0)).left,
0660: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0661: .elementAt(CUP$SpecParser$top - 0)).right,
0662: RESULT);
0663: }
0664: return CUP$SpecParser$result;
0665:
0666: /*. . . . . . . . . . . . . . . . . . . .*/
0667: case 61: // prod_part ::= symbol_id opt_label
0668: {
0669: Object RESULT = null;
0670: int symleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0671: .elementAt(CUP$SpecParser$top - 1)).left;
0672: int symright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0673: .elementAt(CUP$SpecParser$top - 1)).right;
0674: ro.infoiasi.donald.compiler.cfg.Symbol sym = (ro.infoiasi.donald.compiler.cfg.Symbol) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0675: .elementAt(CUP$SpecParser$top - 1)).value;
0676:
0677: if (prodPartLabel != null) {
0678: prodPartLabels.add(new Label(prodPartLabel, sym,
0679: prodPartList.size()));
0680: }
0681: prodPartList.add(sym);
0682:
0683: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0684: 29/*prod_part*/,
0685: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0686: .elementAt(CUP$SpecParser$top - 1)).left,
0687: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0688: .elementAt(CUP$SpecParser$top - 0)).right,
0689: RESULT);
0690: }
0691: return CUP$SpecParser$result;
0692:
0693: /*. . . . . . . . . . . . . . . . . . . .*/
0694: case 60: // prod_part_list ::= empty
0695: {
0696: Object RESULT = null;
0697:
0698: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0699: 28/*prod_part_list*/,
0700: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0701: .elementAt(CUP$SpecParser$top - 0)).left,
0702: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0703: .elementAt(CUP$SpecParser$top - 0)).right,
0704: RESULT);
0705: }
0706: return CUP$SpecParser$result;
0707:
0708: /*. . . . . . . . . . . . . . . . . . . .*/
0709: case 59: // prod_part_list ::= prod_part_list prod_part
0710: {
0711: Object RESULT = null;
0712:
0713: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0714: 28/*prod_part_list*/,
0715: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0716: .elementAt(CUP$SpecParser$top - 1)).left,
0717: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0718: .elementAt(CUP$SpecParser$top - 0)).right,
0719: RESULT);
0720: }
0721: return CUP$SpecParser$result;
0722:
0723: /*. . . . . . . . . . . . . . . . . . . .*/
0724: case 58: // rhs ::= prod_part_list
0725: {
0726: Object RESULT = null;
0727:
0728: prodPrecedence = Production.LAST_TERMINAL_PRECEDENCE;
0729:
0730: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0731: 27/*rhs*/,
0732: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0733: .elementAt(CUP$SpecParser$top - 0)).left,
0734: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0735: .elementAt(CUP$SpecParser$top - 0)).right,
0736: RESULT);
0737: }
0738: return CUP$SpecParser$result;
0739:
0740: /*. . . . . . . . . . . . . . . . . . . .*/
0741: case 57: // rhs ::= prod_part_list PERCENT_PREC terminal_id
0742: {
0743: Object RESULT = null;
0744: int termleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0745: .elementAt(CUP$SpecParser$top - 0)).left;
0746: int termright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0747: .elementAt(CUP$SpecParser$top - 0)).right;
0748: Terminal term = (Terminal) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0749: .elementAt(CUP$SpecParser$top - 0)).value;
0750:
0751: prodPrecedence = term.getPrecedence();
0752:
0753: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0754: 27/*rhs*/,
0755: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0756: .elementAt(CUP$SpecParser$top - 2)).left,
0757: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0758: .elementAt(CUP$SpecParser$top - 0)).right,
0759: RESULT);
0760: }
0761: return CUP$SpecParser$result;
0762:
0763: /*. . . . . . . . . . . . . . . . . . . .*/
0764: case 56: // rhs_list ::= rhs
0765: {
0766: Object RESULT = null;
0767:
0768: Word w = new Word();
0769: SemanticAction action = null;
0770: Iterator it = prodPartList.iterator();
0771: while (it.hasNext()) {
0772: Object obj = it.next();
0773: ro.infoiasi.donald.compiler.cfg.Symbol sym;
0774: if (obj instanceof SemanticAction) {
0775: SemanticAction sa = (SemanticAction) obj;
0776: if (it.hasNext()) {
0777: NonTerminal nt = v.addNew("$ACTION"
0778: + countNewNonTerminals++);
0779: p.addNew(nt, new Word(), sa);
0780: w.addLast(nt);
0781: } else {
0782: action = sa;
0783: }
0784: } else {
0785: sym = (ro.infoiasi.donald.compiler.cfg.Symbol) obj;
0786: w.addLast(sym);
0787: }
0788: }
0789: RHSList.add(new Pair(w, action));
0790:
0791: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0792: 26/*rhs_list*/,
0793: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0794: .elementAt(CUP$SpecParser$top - 0)).left,
0795: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0796: .elementAt(CUP$SpecParser$top - 0)).right,
0797: RESULT);
0798: }
0799: return CUP$SpecParser$result;
0800:
0801: /*. . . . . . . . . . . . . . . . . . . .*/
0802: case 55: // rhs_list ::= rhs_list BAR NT$6 rhs
0803: {
0804: Object RESULT = null;
0805: // propagate RESULT from NT$6
0806: if (((java_cup.runtime.Symbol) CUP$SpecParser$stack
0807: .elementAt(CUP$SpecParser$top - 1)).value != null)
0808: RESULT = (Object) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0809: .elementAt(CUP$SpecParser$top - 1)).value;
0810:
0811: Word w = new Word();
0812: SemanticAction action = null;
0813: Iterator it = prodPartList.iterator();
0814: while (it.hasNext()) {
0815: Object obj = it.next();
0816: ro.infoiasi.donald.compiler.cfg.Symbol sym;
0817: if (obj instanceof SemanticAction) {
0818: SemanticAction sa = (SemanticAction) obj;
0819: if (it.hasNext()) {
0820: NonTerminal nt = v.addNew("$ACTION"
0821: + countNewNonTerminals++);
0822: p.addNew(nt, new Word(), sa);
0823: w.addLast(nt);
0824: } else {
0825: action = sa;
0826: }
0827: } else {
0828: sym = (ro.infoiasi.donald.compiler.cfg.Symbol) obj;
0829: w.addLast(sym);
0830: }
0831: }
0832: RHSList.add(new Pair(w, action));
0833:
0834: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0835: 26/*rhs_list*/,
0836: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0837: .elementAt(CUP$SpecParser$top - 3)).left,
0838: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0839: .elementAt(CUP$SpecParser$top - 0)).right,
0840: RESULT);
0841: }
0842: return CUP$SpecParser$result;
0843:
0844: /*. . . . . . . . . . . . . . . . . . . .*/
0845: case 54: // NT$6 ::=
0846: {
0847: Object RESULT = null;
0848:
0849: prodPartList = new LinkedList();
0850: prodPartLabels = new LinkedList();
0851: action = null;
0852:
0853: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0854: 46/*NT$6*/,
0855: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0856: .elementAt(CUP$SpecParser$top - 0)).right,
0857: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0858: .elementAt(CUP$SpecParser$top - 0)).right,
0859: RESULT);
0860: }
0861: return CUP$SpecParser$result;
0862:
0863: /*. . . . . . . . . . . . . . . . . . . .*/
0864: case 53: // production ::= nonterminal_id COLON_COLON_EQUALS NT$5 rhs_list SEMI
0865: {
0866: Object RESULT = null;
0867: // propagate RESULT from NT$5
0868: if (((java_cup.runtime.Symbol) CUP$SpecParser$stack
0869: .elementAt(CUP$SpecParser$top - 2)).value != null)
0870: RESULT = (Object) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0871: .elementAt(CUP$SpecParser$top - 2)).value;
0872: int ntleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0873: .elementAt(CUP$SpecParser$top - 4)).left;
0874: int ntright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0875: .elementAt(CUP$SpecParser$top - 4)).right;
0876: NonTerminal nt = (NonTerminal) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0877: .elementAt(CUP$SpecParser$top - 4)).value;
0878:
0879: Iterator it = RHSList.iterator();
0880: while (it.hasNext()) {
0881: Pair pair = (Pair) it.next();
0882: p.addNew(lhs, (Word) pair.first,
0883: (SemanticAction) pair.second);
0884: }
0885:
0886: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0887: 25/*production*/,
0888: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0889: .elementAt(CUP$SpecParser$top - 4)).left,
0890: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0891: .elementAt(CUP$SpecParser$top - 0)).right,
0892: RESULT);
0893: }
0894: return CUP$SpecParser$result;
0895:
0896: /*. . . . . . . . . . . . . . . . . . . .*/
0897: case 52: // NT$5 ::=
0898: {
0899: Object RESULT = null;
0900: int ntleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0901: .elementAt(CUP$SpecParser$top - 1)).left;
0902: int ntright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0903: .elementAt(CUP$SpecParser$top - 1)).right;
0904: NonTerminal nt = (NonTerminal) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0905: .elementAt(CUP$SpecParser$top - 1)).value;
0906:
0907: lhs = nt;
0908: RHSList = new LinkedList();
0909: prodPartList = new LinkedList();
0910: prodPartLabels = new LinkedList();
0911:
0912: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0913: 45/*NT$5*/,
0914: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0915: .elementAt(CUP$SpecParser$top - 0)).right,
0916: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0917: .elementAt(CUP$SpecParser$top - 0)).right,
0918: RESULT);
0919: }
0920: return CUP$SpecParser$result;
0921:
0922: /*. . . . . . . . . . . . . . . . . . . .*/
0923: case 51: // production_list ::= production
0924: {
0925: Object RESULT = null;
0926:
0927: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0928: 24/*production_list*/,
0929: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0930: .elementAt(CUP$SpecParser$top - 0)).left,
0931: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0932: .elementAt(CUP$SpecParser$top - 0)).right,
0933: RESULT);
0934: }
0935: return CUP$SpecParser$result;
0936:
0937: /*. . . . . . . . . . . . . . . . . . . .*/
0938: case 50: // production_list ::= production_list production
0939: {
0940: Object RESULT = null;
0941:
0942: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0943: 24/*production_list*/,
0944: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0945: .elementAt(CUP$SpecParser$top - 1)).left,
0946: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0947: .elementAt(CUP$SpecParser$top - 0)).right,
0948: RESULT);
0949: }
0950: return CUP$SpecParser$result;
0951:
0952: /*. . . . . . . . . . . . . . . . . . . .*/
0953: case 49: // start_spec ::=
0954: {
0955: Object RESULT = null;
0956:
0957: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0958: 23/*start_spec*/,
0959: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0960: .elementAt(CUP$SpecParser$top - 0)).right,
0961: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0962: .elementAt(CUP$SpecParser$top - 0)).right,
0963: RESULT);
0964: }
0965: return CUP$SpecParser$result;
0966:
0967: /*. . . . . . . . . . . . . . . . . . . .*/
0968: case 48: // start_spec ::= START WITH nonterminal_id SEMI
0969: {
0970: Object RESULT = null;
0971: int ntleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0972: .elementAt(CUP$SpecParser$top - 1)).left;
0973: int ntright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0974: .elementAt(CUP$SpecParser$top - 1)).right;
0975: NonTerminal nt = (NonTerminal) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0976: .elementAt(CUP$SpecParser$top - 1)).value;
0977:
0978: s = nt;
0979:
0980: CUP$SpecParser$result = new java_cup.runtime.Symbol(
0981: 23/*start_spec*/,
0982: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0983: .elementAt(CUP$SpecParser$top - 3)).left,
0984: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0985: .elementAt(CUP$SpecParser$top - 0)).right,
0986: RESULT);
0987: }
0988: return CUP$SpecParser$result;
0989:
0990: /*. . . . . . . . . . . . . . . . . . . .*/
0991: case 47: // terminal_list ::= terminal_id
0992: {
0993: Object RESULT = null;
0994: int termleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0995: .elementAt(CUP$SpecParser$top - 0)).left;
0996: int termright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0997: .elementAt(CUP$SpecParser$top - 0)).right;
0998: Terminal term = (Terminal) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
0999: .elementAt(CUP$SpecParser$top - 0)).value;
1000:
1001: term.setPrecedence(precedence, associativity);
1002:
1003: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1004: 22/*terminal_list*/,
1005: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1006: .elementAt(CUP$SpecParser$top - 0)).left,
1007: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1008: .elementAt(CUP$SpecParser$top - 0)).right,
1009: RESULT);
1010: }
1011: return CUP$SpecParser$result;
1012:
1013: /*. . . . . . . . . . . . . . . . . . . .*/
1014: case 46: // terminal_list ::= terminal_list COMMA terminal_id
1015: {
1016: Object RESULT = null;
1017: int termleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1018: .elementAt(CUP$SpecParser$top - 0)).left;
1019: int termright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1020: .elementAt(CUP$SpecParser$top - 0)).right;
1021: Terminal term = (Terminal) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1022: .elementAt(CUP$SpecParser$top - 0)).value;
1023:
1024: term.setPrecedence(precedence, associativity);
1025:
1026: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1027: 22/*terminal_list*/,
1028: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1029: .elementAt(CUP$SpecParser$top - 2)).left,
1030: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1031: .elementAt(CUP$SpecParser$top - 0)).right,
1032: RESULT);
1033: }
1034: return CUP$SpecParser$result;
1035:
1036: /*. . . . . . . . . . . . . . . . . . . .*/
1037: case 45: // preced ::= PRECEDENCE NONASSOC NT$4 terminal_list SEMI
1038: {
1039: Object RESULT = null;
1040: // propagate RESULT from NT$4
1041: if (((java_cup.runtime.Symbol) CUP$SpecParser$stack
1042: .elementAt(CUP$SpecParser$top - 2)).value != null)
1043: RESULT = (Object) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1044: .elementAt(CUP$SpecParser$top - 2)).value;
1045:
1046: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1047: 21/*preced*/,
1048: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1049: .elementAt(CUP$SpecParser$top - 4)).left,
1050: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1051: .elementAt(CUP$SpecParser$top - 0)).right,
1052: RESULT);
1053: }
1054: return CUP$SpecParser$result;
1055:
1056: /*. . . . . . . . . . . . . . . . . . . .*/
1057: case 44: // NT$4 ::=
1058: {
1059: Object RESULT = null;
1060:
1061: precedence++;
1062: associativity = Terminal.NON_ASSOCIATIVE;
1063:
1064: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1065: 44/*NT$4*/,
1066: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1067: .elementAt(CUP$SpecParser$top - 0)).right,
1068: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1069: .elementAt(CUP$SpecParser$top - 0)).right,
1070: RESULT);
1071: }
1072: return CUP$SpecParser$result;
1073:
1074: /*. . . . . . . . . . . . . . . . . . . .*/
1075: case 43: // preced ::= PRECEDENCE RIGHT NT$3 terminal_list SEMI
1076: {
1077: Object RESULT = null;
1078: // propagate RESULT from NT$3
1079: if (((java_cup.runtime.Symbol) CUP$SpecParser$stack
1080: .elementAt(CUP$SpecParser$top - 2)).value != null)
1081: RESULT = (Object) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1082: .elementAt(CUP$SpecParser$top - 2)).value;
1083:
1084: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1085: 21/*preced*/,
1086: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1087: .elementAt(CUP$SpecParser$top - 4)).left,
1088: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1089: .elementAt(CUP$SpecParser$top - 0)).right,
1090: RESULT);
1091: }
1092: return CUP$SpecParser$result;
1093:
1094: /*. . . . . . . . . . . . . . . . . . . .*/
1095: case 42: // NT$3 ::=
1096: {
1097: Object RESULT = null;
1098:
1099: precedence++;
1100: associativity = Terminal.RIGHT_ASSOCIATIVE;
1101:
1102: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1103: 43/*NT$3*/,
1104: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1105: .elementAt(CUP$SpecParser$top - 0)).right,
1106: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1107: .elementAt(CUP$SpecParser$top - 0)).right,
1108: RESULT);
1109: }
1110: return CUP$SpecParser$result;
1111:
1112: /*. . . . . . . . . . . . . . . . . . . .*/
1113: case 41: // preced ::= PRECEDENCE LEFT NT$2 terminal_list SEMI
1114: {
1115: Object RESULT = null;
1116: // propagate RESULT from NT$2
1117: if (((java_cup.runtime.Symbol) CUP$SpecParser$stack
1118: .elementAt(CUP$SpecParser$top - 2)).value != null)
1119: RESULT = (Object) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1120: .elementAt(CUP$SpecParser$top - 2)).value;
1121:
1122: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1123: 21/*preced*/,
1124: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1125: .elementAt(CUP$SpecParser$top - 4)).left,
1126: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1127: .elementAt(CUP$SpecParser$top - 0)).right,
1128: RESULT);
1129: }
1130: return CUP$SpecParser$result;
1131:
1132: /*. . . . . . . . . . . . . . . . . . . .*/
1133: case 40: // NT$2 ::=
1134: {
1135: Object RESULT = null;
1136:
1137: precedence++;
1138: associativity = Terminal.LEFT_ASSOCIATIVE;
1139:
1140: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1141: 42/*NT$2*/,
1142: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1143: .elementAt(CUP$SpecParser$top - 0)).right,
1144: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1145: .elementAt(CUP$SpecParser$top - 0)).right,
1146: RESULT);
1147: }
1148: return CUP$SpecParser$result;
1149:
1150: /*. . . . . . . . . . . . . . . . . . . .*/
1151: case 39: // precedence_l ::= preced
1152: {
1153: Object RESULT = null;
1154:
1155: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1156: 20/*precedence_l*/,
1157: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1158: .elementAt(CUP$SpecParser$top - 0)).left,
1159: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1160: .elementAt(CUP$SpecParser$top - 0)).right,
1161: RESULT);
1162: }
1163: return CUP$SpecParser$result;
1164:
1165: /*. . . . . . . . . . . . . . . . . . . .*/
1166: case 38: // precedence_l ::= precedence_l preced
1167: {
1168: Object RESULT = null;
1169:
1170: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1171: 20/*precedence_l*/,
1172: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1173: .elementAt(CUP$SpecParser$top - 1)).left,
1174: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1175: .elementAt(CUP$SpecParser$top - 0)).right,
1176: RESULT);
1177: }
1178: return CUP$SpecParser$result;
1179:
1180: /*. . . . . . . . . . . . . . . . . . . .*/
1181: case 37: // precedence_list ::= empty
1182: {
1183: Object RESULT = null;
1184:
1185: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1186: 19/*precedence_list*/,
1187: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1188: .elementAt(CUP$SpecParser$top - 0)).left,
1189: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1190: .elementAt(CUP$SpecParser$top - 0)).right,
1191: RESULT);
1192: }
1193: return CUP$SpecParser$result;
1194:
1195: /*. . . . . . . . . . . . . . . . . . . .*/
1196: case 36: // precedence_list ::= precedence_l
1197: {
1198: Object RESULT = null;
1199:
1200: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1201: 19/*precedence_list*/,
1202: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1203: .elementAt(CUP$SpecParser$top - 0)).left,
1204: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1205: .elementAt(CUP$SpecParser$top - 0)).right,
1206: RESULT);
1207: }
1208: return CUP$SpecParser$result;
1209:
1210: /*. . . . . . . . . . . . . . . . . . . .*/
1211: case 35: // non_term_name_list ::= new_non_term_id
1212: {
1213: Object RESULT = null;
1214:
1215: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1216: 18/*non_term_name_list*/,
1217: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1218: .elementAt(CUP$SpecParser$top - 0)).left,
1219: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1220: .elementAt(CUP$SpecParser$top - 0)).right,
1221: RESULT);
1222: }
1223: return CUP$SpecParser$result;
1224:
1225: /*. . . . . . . . . . . . . . . . . . . .*/
1226: case 34: // non_term_name_list ::= non_term_name_list COMMA new_non_term_id
1227: {
1228: Object RESULT = null;
1229:
1230: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1231: 18/*non_term_name_list*/,
1232: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1233: .elementAt(CUP$SpecParser$top - 2)).left,
1234: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1235: .elementAt(CUP$SpecParser$top - 0)).right,
1236: RESULT);
1237: }
1238: return CUP$SpecParser$result;
1239:
1240: /*. . . . . . . . . . . . . . . . . . . .*/
1241: case 33: // term_name_list ::= new_term_id
1242: {
1243: Object RESULT = null;
1244:
1245: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1246: 17/*term_name_list*/,
1247: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1248: .elementAt(CUP$SpecParser$top - 0)).left,
1249: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1250: .elementAt(CUP$SpecParser$top - 0)).right,
1251: RESULT);
1252: }
1253: return CUP$SpecParser$result;
1254:
1255: /*. . . . . . . . . . . . . . . . . . . .*/
1256: case 32: // term_name_list ::= term_name_list COMMA new_term_id
1257: {
1258: Object RESULT = null;
1259:
1260: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1261: 17/*term_name_list*/,
1262: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1263: .elementAt(CUP$SpecParser$top - 2)).left,
1264: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1265: .elementAt(CUP$SpecParser$top - 0)).right,
1266: RESULT);
1267: }
1268: return CUP$SpecParser$result;
1269:
1270: /*. . . . . . . . . . . . . . . . . . . .*/
1271: case 31: // type_id ::= type_id LBRACK RBRACK
1272: {
1273: String RESULT = null;
1274: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1275: .elementAt(CUP$SpecParser$top - 2)).left;
1276: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1277: .elementAt(CUP$SpecParser$top - 2)).right;
1278: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1279: .elementAt(CUP$SpecParser$top - 2)).value;
1280:
1281: RESULT = id + "[]";
1282:
1283: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1284: 16/*type_id*/,
1285: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1286: .elementAt(CUP$SpecParser$top - 2)).left,
1287: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1288: .elementAt(CUP$SpecParser$top - 0)).right,
1289: RESULT);
1290: }
1291: return CUP$SpecParser$result;
1292:
1293: /*. . . . . . . . . . . . . . . . . . . .*/
1294: case 30: // type_id ::= multipart_id
1295: {
1296: String RESULT = null;
1297: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1298: .elementAt(CUP$SpecParser$top - 0)).left;
1299: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1300: .elementAt(CUP$SpecParser$top - 0)).right;
1301: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1302: .elementAt(CUP$SpecParser$top - 0)).value;
1303:
1304: RESULT = id;
1305:
1306: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1307: 16/*type_id*/,
1308: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1309: .elementAt(CUP$SpecParser$top - 0)).left,
1310: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1311: .elementAt(CUP$SpecParser$top - 0)).right,
1312: RESULT);
1313: }
1314: return CUP$SpecParser$result;
1315:
1316: /*. . . . . . . . . . . . . . . . . . . .*/
1317: case 29: // declares_non_term ::= type_id NT$1 non_term_name_list SEMI
1318: {
1319: Object RESULT = null;
1320: // propagate RESULT from NT$1
1321: if (((java_cup.runtime.Symbol) CUP$SpecParser$stack
1322: .elementAt(CUP$SpecParser$top - 2)).value != null)
1323: RESULT = (Object) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1324: .elementAt(CUP$SpecParser$top - 2)).value;
1325: int type_nameleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1326: .elementAt(CUP$SpecParser$top - 3)).left;
1327: int type_nameright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1328: .elementAt(CUP$SpecParser$top - 3)).right;
1329: String type_name = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1330: .elementAt(CUP$SpecParser$top - 3)).value;
1331:
1332: type = null;
1333:
1334: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1335: 15/*declares_non_term*/,
1336: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1337: .elementAt(CUP$SpecParser$top - 3)).left,
1338: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1339: .elementAt(CUP$SpecParser$top - 0)).right,
1340: RESULT);
1341: }
1342: return CUP$SpecParser$result;
1343:
1344: /*. . . . . . . . . . . . . . . . . . . .*/
1345: case 28: // NT$1 ::=
1346: {
1347: Object RESULT = null;
1348: int type_nameleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1349: .elementAt(CUP$SpecParser$top - 0)).left;
1350: int type_nameright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1351: .elementAt(CUP$SpecParser$top - 0)).right;
1352: String type_name = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1353: .elementAt(CUP$SpecParser$top - 0)).value;
1354:
1355: type = type_name;
1356:
1357: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1358: 41/*NT$1*/,
1359: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1360: .elementAt(CUP$SpecParser$top - 0)).right,
1361: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1362: .elementAt(CUP$SpecParser$top - 0)).right,
1363: RESULT);
1364: }
1365: return CUP$SpecParser$result;
1366:
1367: /*. . . . . . . . . . . . . . . . . . . .*/
1368: case 27: // declares_non_term ::= non_term_name_list SEMI
1369: {
1370: Object RESULT = null;
1371:
1372: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1373: 15/*declares_non_term*/,
1374: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1375: .elementAt(CUP$SpecParser$top - 1)).left,
1376: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1377: .elementAt(CUP$SpecParser$top - 0)).right,
1378: RESULT);
1379: }
1380: return CUP$SpecParser$result;
1381:
1382: /*. . . . . . . . . . . . . . . . . . . .*/
1383: case 26: // declares_term ::= type_id NT$0 term_name_list SEMI
1384: {
1385: Object RESULT = null;
1386: // propagate RESULT from NT$0
1387: if (((java_cup.runtime.Symbol) CUP$SpecParser$stack
1388: .elementAt(CUP$SpecParser$top - 2)).value != null)
1389: RESULT = (Object) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1390: .elementAt(CUP$SpecParser$top - 2)).value;
1391: int type_nameleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1392: .elementAt(CUP$SpecParser$top - 3)).left;
1393: int type_nameright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1394: .elementAt(CUP$SpecParser$top - 3)).right;
1395: String type_name = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1396: .elementAt(CUP$SpecParser$top - 3)).value;
1397:
1398: type = null;
1399:
1400: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1401: 14/*declares_term*/,
1402: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1403: .elementAt(CUP$SpecParser$top - 3)).left,
1404: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1405: .elementAt(CUP$SpecParser$top - 0)).right,
1406: RESULT);
1407: }
1408: return CUP$SpecParser$result;
1409:
1410: /*. . . . . . . . . . . . . . . . . . . .*/
1411: case 25: // NT$0 ::=
1412: {
1413: Object RESULT = null;
1414: int type_nameleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1415: .elementAt(CUP$SpecParser$top - 0)).left;
1416: int type_nameright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1417: .elementAt(CUP$SpecParser$top - 0)).right;
1418: String type_name = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1419: .elementAt(CUP$SpecParser$top - 0)).value;
1420:
1421: type = type_name;
1422:
1423: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1424: 40/*NT$0*/,
1425: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1426: .elementAt(CUP$SpecParser$top - 0)).right,
1427: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1428: .elementAt(CUP$SpecParser$top - 0)).right,
1429: RESULT);
1430: }
1431: return CUP$SpecParser$result;
1432:
1433: /*. . . . . . . . . . . . . . . . . . . .*/
1434: case 24: // declares_term ::= term_name_list SEMI
1435: {
1436: Object RESULT = null;
1437:
1438: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1439: 14/*declares_term*/,
1440: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1441: .elementAt(CUP$SpecParser$top - 1)).left,
1442: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1443: .elementAt(CUP$SpecParser$top - 0)).right,
1444: RESULT);
1445: }
1446: return CUP$SpecParser$result;
1447:
1448: /*. . . . . . . . . . . . . . . . . . . .*/
1449: case 23: // symbol ::= NONTERMINAL declares_non_term
1450: {
1451: Object RESULT = null;
1452:
1453: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1454: 13/*symbol*/,
1455: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1456: .elementAt(CUP$SpecParser$top - 1)).left,
1457: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1458: .elementAt(CUP$SpecParser$top - 0)).right,
1459: RESULT);
1460: }
1461: return CUP$SpecParser$result;
1462:
1463: /*. . . . . . . . . . . . . . . . . . . .*/
1464: case 22: // symbol ::= NON TERMINAL declares_non_term
1465: {
1466: Object RESULT = null;
1467:
1468: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1469: 13/*symbol*/,
1470: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1471: .elementAt(CUP$SpecParser$top - 2)).left,
1472: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1473: .elementAt(CUP$SpecParser$top - 0)).right,
1474: RESULT);
1475: }
1476: return CUP$SpecParser$result;
1477:
1478: /*. . . . . . . . . . . . . . . . . . . .*/
1479: case 21: // symbol ::= TERMINAL declares_term
1480: {
1481: Object RESULT = null;
1482:
1483: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1484: 13/*symbol*/,
1485: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1486: .elementAt(CUP$SpecParser$top - 1)).left,
1487: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1488: .elementAt(CUP$SpecParser$top - 0)).right,
1489: RESULT);
1490: }
1491: return CUP$SpecParser$result;
1492:
1493: /*. . . . . . . . . . . . . . . . . . . .*/
1494: case 20: // symbol_list ::= symbol
1495: {
1496: Object RESULT = null;
1497:
1498: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1499: 12/*symbol_list*/,
1500: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1501: .elementAt(CUP$SpecParser$top - 0)).left,
1502: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1503: .elementAt(CUP$SpecParser$top - 0)).right,
1504: RESULT);
1505: }
1506: return CUP$SpecParser$result;
1507:
1508: /*. . . . . . . . . . . . . . . . . . . .*/
1509: case 19: // symbol_list ::= symbol_list symbol
1510: {
1511: Object RESULT = null;
1512:
1513: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1514: 12/*symbol_list*/,
1515: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1516: .elementAt(CUP$SpecParser$top - 1)).left,
1517: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1518: .elementAt(CUP$SpecParser$top - 0)).right,
1519: RESULT);
1520: }
1521: return CUP$SpecParser$result;
1522:
1523: /*. . . . . . . . . . . . . . . . . . . .*/
1524: case 18: // scan_code ::= SCAN WITH CODE_STRING opt_semi
1525: {
1526: Object RESULT = null;
1527: int codeStringleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1528: .elementAt(CUP$SpecParser$top - 1)).left;
1529: int codeStringright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1530: .elementAt(CUP$SpecParser$top - 1)).right;
1531: String codeString = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1532: .elementAt(CUP$SpecParser$top - 1)).value;
1533:
1534: if (scanCode == null) {
1535: scanCode = codeString;
1536: } else {
1537: parser.report_error("Redundant scan code (skipping)",
1538: null);
1539: }
1540:
1541: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1542: 11/*scan_code*/,
1543: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1544: .elementAt(CUP$SpecParser$top - 3)).left,
1545: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1546: .elementAt(CUP$SpecParser$top - 0)).right,
1547: RESULT);
1548: }
1549: return CUP$SpecParser$result;
1550:
1551: /*. . . . . . . . . . . . . . . . . . . .*/
1552: case 17: // init_code ::= INIT WITH CODE_STRING opt_semi
1553: {
1554: Object RESULT = null;
1555: int codeStringleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1556: .elementAt(CUP$SpecParser$top - 1)).left;
1557: int codeStringright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1558: .elementAt(CUP$SpecParser$top - 1)).right;
1559: String codeString = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1560: .elementAt(CUP$SpecParser$top - 1)).value;
1561:
1562: if (initCode == null) {
1563: initCode = codeString;
1564: } else {
1565: parser.report_error("Redundant init code (skipping)",
1566: null);
1567: }
1568:
1569: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1570: 10/*init_code*/,
1571: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1572: .elementAt(CUP$SpecParser$top - 3)).left,
1573: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1574: .elementAt(CUP$SpecParser$top - 0)).right,
1575: RESULT);
1576: }
1577: return CUP$SpecParser$result;
1578:
1579: /*. . . . . . . . . . . . . . . . . . . .*/
1580: case 16: // parser_code_part ::= PARSER CODE CODE_STRING opt_semi
1581: {
1582: Object RESULT = null;
1583: int codeStringleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1584: .elementAt(CUP$SpecParser$top - 1)).left;
1585: int codeStringright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1586: .elementAt(CUP$SpecParser$top - 1)).right;
1587: String codeString = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1588: .elementAt(CUP$SpecParser$top - 1)).value;
1589:
1590: if (parserCode == null) {
1591: parserCode = codeString;
1592: } else {
1593: parser.report_error("Redundant parser code (skipping)",
1594: null);
1595: }
1596:
1597: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1598: 9/*parser_code_part*/,
1599: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1600: .elementAt(CUP$SpecParser$top - 3)).left,
1601: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1602: .elementAt(CUP$SpecParser$top - 0)).right,
1603: RESULT);
1604: }
1605: return CUP$SpecParser$result;
1606:
1607: /*. . . . . . . . . . . . . . . . . . . .*/
1608: case 15: // action_code_part ::= ACTION CODE CODE_STRING opt_semi
1609: {
1610: Object RESULT = null;
1611: int codeStringleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1612: .elementAt(CUP$SpecParser$top - 1)).left;
1613: int codeStringright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1614: .elementAt(CUP$SpecParser$top - 1)).right;
1615: String codeString = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1616: .elementAt(CUP$SpecParser$top - 1)).value;
1617:
1618: if (actionCode == null) {
1619: actionCode = codeString;
1620: } else {
1621: parser.report_error("Redundant action code (skipping)",
1622: null);
1623: }
1624:
1625: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1626: 8/*action_code_part*/,
1627: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1628: .elementAt(CUP$SpecParser$top - 3)).left,
1629: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1630: .elementAt(CUP$SpecParser$top - 0)).right,
1631: RESULT);
1632: }
1633: return CUP$SpecParser$result;
1634:
1635: /*. . . . . . . . . . . . . . . . . . . .*/
1636: case 14: // code_part ::= scan_code
1637: {
1638: Object RESULT = null;
1639:
1640: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1641: 7/*code_part*/,
1642: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1643: .elementAt(CUP$SpecParser$top - 0)).left,
1644: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1645: .elementAt(CUP$SpecParser$top - 0)).right,
1646: RESULT);
1647: }
1648: return CUP$SpecParser$result;
1649:
1650: /*. . . . . . . . . . . . . . . . . . . .*/
1651: case 13: // code_part ::= init_code
1652: {
1653: Object RESULT = null;
1654:
1655: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1656: 7/*code_part*/,
1657: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1658: .elementAt(CUP$SpecParser$top - 0)).left,
1659: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1660: .elementAt(CUP$SpecParser$top - 0)).right,
1661: RESULT);
1662: }
1663: return CUP$SpecParser$result;
1664:
1665: /*. . . . . . . . . . . . . . . . . . . .*/
1666: case 12: // code_part ::= parser_code_part
1667: {
1668: Object RESULT = null;
1669:
1670: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1671: 7/*code_part*/,
1672: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1673: .elementAt(CUP$SpecParser$top - 0)).left,
1674: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1675: .elementAt(CUP$SpecParser$top - 0)).right,
1676: RESULT);
1677: }
1678: return CUP$SpecParser$result;
1679:
1680: /*. . . . . . . . . . . . . . . . . . . .*/
1681: case 11: // code_part ::= action_code_part
1682: {
1683: Object RESULT = null;
1684:
1685: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1686: 7/*code_part*/,
1687: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1688: .elementAt(CUP$SpecParser$top - 0)).left,
1689: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1690: .elementAt(CUP$SpecParser$top - 0)).right,
1691: RESULT);
1692: }
1693: return CUP$SpecParser$result;
1694:
1695: /*. . . . . . . . . . . . . . . . . . . .*/
1696: case 10: // code_parts ::= empty
1697: {
1698: Object RESULT = null;
1699:
1700: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1701: 6/*code_parts*/,
1702: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1703: .elementAt(CUP$SpecParser$top - 0)).left,
1704: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1705: .elementAt(CUP$SpecParser$top - 0)).right,
1706: RESULT);
1707: }
1708: return CUP$SpecParser$result;
1709:
1710: /*. . . . . . . . . . . . . . . . . . . .*/
1711: case 9: // code_parts ::= code_parts code_part
1712: {
1713: Object RESULT = null;
1714:
1715: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1716: 6/*code_parts*/,
1717: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1718: .elementAt(CUP$SpecParser$top - 1)).left,
1719: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1720: .elementAt(CUP$SpecParser$top - 0)).right,
1721: RESULT);
1722: }
1723: return CUP$SpecParser$result;
1724:
1725: /*. . . . . . . . . . . . . . . . . . . .*/
1726: case 8: // import_id ::= multipart_id
1727: {
1728: String RESULT = null;
1729: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1730: .elementAt(CUP$SpecParser$top - 0)).left;
1731: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1732: .elementAt(CUP$SpecParser$top - 0)).right;
1733: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1734: .elementAt(CUP$SpecParser$top - 0)).value;
1735:
1736: RESULT = id;
1737:
1738: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1739: 5/*import_id*/,
1740: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1741: .elementAt(CUP$SpecParser$top - 0)).left,
1742: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1743: .elementAt(CUP$SpecParser$top - 0)).right,
1744: RESULT);
1745: }
1746: return CUP$SpecParser$result;
1747:
1748: /*. . . . . . . . . . . . . . . . . . . .*/
1749: case 7: // import_id ::= multipart_id DOT STAR
1750: {
1751: String RESULT = null;
1752: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1753: .elementAt(CUP$SpecParser$top - 2)).left;
1754: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1755: .elementAt(CUP$SpecParser$top - 2)).right;
1756: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1757: .elementAt(CUP$SpecParser$top - 2)).value;
1758:
1759: RESULT = id + ".*";
1760:
1761: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1762: 5/*import_id*/,
1763: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1764: .elementAt(CUP$SpecParser$top - 2)).left,
1765: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1766: .elementAt(CUP$SpecParser$top - 0)).right,
1767: RESULT);
1768: }
1769: return CUP$SpecParser$result;
1770:
1771: /*. . . . . . . . . . . . . . . . . . . .*/
1772: case 6: // import_spec ::= IMPORT import_id SEMI
1773: {
1774: Object RESULT = null;
1775: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1776: .elementAt(CUP$SpecParser$top - 1)).left;
1777: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1778: .elementAt(CUP$SpecParser$top - 1)).right;
1779: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1780: .elementAt(CUP$SpecParser$top - 1)).value;
1781:
1782: importsList.add(id);
1783:
1784: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1785: 4/*import_spec*/,
1786: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1787: .elementAt(CUP$SpecParser$top - 2)).left,
1788: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1789: .elementAt(CUP$SpecParser$top - 0)).right,
1790: RESULT);
1791: }
1792: return CUP$SpecParser$result;
1793:
1794: /*. . . . . . . . . . . . . . . . . . . .*/
1795: case 5: // import_list ::= empty
1796: {
1797: Object RESULT = null;
1798:
1799: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1800: 3/*import_list*/,
1801: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1802: .elementAt(CUP$SpecParser$top - 0)).left,
1803: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1804: .elementAt(CUP$SpecParser$top - 0)).right,
1805: RESULT);
1806: }
1807: return CUP$SpecParser$result;
1808:
1809: /*. . . . . . . . . . . . . . . . . . . .*/
1810: case 4: // import_list ::= import_list import_spec
1811: {
1812: Object RESULT = null;
1813:
1814: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1815: 3/*import_list*/,
1816: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1817: .elementAt(CUP$SpecParser$top - 1)).left,
1818: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1819: .elementAt(CUP$SpecParser$top - 0)).right,
1820: RESULT);
1821: }
1822: return CUP$SpecParser$result;
1823:
1824: /*. . . . . . . . . . . . . . . . . . . .*/
1825: case 3: // package_spec ::= empty
1826: {
1827: Object RESULT = null;
1828:
1829: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1830: 2/*package_spec*/,
1831: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1832: .elementAt(CUP$SpecParser$top - 0)).left,
1833: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1834: .elementAt(CUP$SpecParser$top - 0)).right,
1835: RESULT);
1836: }
1837: return CUP$SpecParser$result;
1838:
1839: /*. . . . . . . . . . . . . . . . . . . .*/
1840: case 2: // package_spec ::= PACKAGE multipart_id SEMI
1841: {
1842: Object RESULT = null;
1843: int idleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1844: .elementAt(CUP$SpecParser$top - 1)).left;
1845: int idright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1846: .elementAt(CUP$SpecParser$top - 1)).right;
1847: String id = (String) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1848: .elementAt(CUP$SpecParser$top - 1)).value;
1849:
1850: packageName = id;
1851:
1852: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1853: 2/*package_spec*/,
1854: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1855: .elementAt(CUP$SpecParser$top - 2)).left,
1856: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1857: .elementAt(CUP$SpecParser$top - 0)).right,
1858: RESULT);
1859: }
1860: return CUP$SpecParser$result;
1861:
1862: /*. . . . . . . . . . . . . . . . . . . .*/
1863: case 1: // $START ::= spec EOF
1864: {
1865: Object RESULT = null;
1866: int start_valleft = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1867: .elementAt(CUP$SpecParser$top - 1)).left;
1868: int start_valright = ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1869: .elementAt(CUP$SpecParser$top - 1)).right;
1870: ParserSpec start_val = (ParserSpec) ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1871: .elementAt(CUP$SpecParser$top - 1)).value;
1872: RESULT = start_val;
1873: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1874: 0/*$START*/,
1875: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1876: .elementAt(CUP$SpecParser$top - 1)).left,
1877: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1878: .elementAt(CUP$SpecParser$top - 0)).right,
1879: RESULT);
1880: }
1881: /* ACCEPT */
1882: CUP$SpecParser$parser.done_parsing();
1883: return CUP$SpecParser$result;
1884:
1885: /*. . . . . . . . . . . . . . . . . . . .*/
1886: case 0: // spec ::= package_spec import_list code_parts symbol_list precedence_list start_spec production_list
1887: {
1888: ParserSpec RESULT = null;
1889:
1890: RESULT = new ParserSpec(packageName, importsList,
1891: actionCode, parserCode, initCode, scanCode,
1892: new CFG(v, t, s, p));
1893:
1894: CUP$SpecParser$result = new java_cup.runtime.Symbol(
1895: 1/*spec*/,
1896: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1897: .elementAt(CUP$SpecParser$top - 6)).left,
1898: ((java_cup.runtime.Symbol) CUP$SpecParser$stack
1899: .elementAt(CUP$SpecParser$top - 0)).right,
1900: RESULT);
1901: }
1902: return CUP$SpecParser$result;
1903:
1904: /* . . . . . .*/
1905: default:
1906: throw new Exception(
1907: "Invalid action number found in internal parse table");
1908:
1909: }
1910: }
1911: }
|