📄 parser.java
字号:
//----------------------------------------------------// The following code was generated by CUP v0.10j// Mon Jun 24 16:30:58 PDT 2002//----------------------------------------------------package residue.tables;import java_cup.runtime.*;import java.util.*;/** CUP v0.10j generated parser. * @version Mon Jun 24 16:30:58 PDT 2002 */public class parser extends java_cup.runtime.lr_parser { /** Default constructor. */ public parser() {super();} /** Constructor which sets the default scanner. */ public parser(java_cup.runtime.Scanner s) {super(s);} /** Production table. */ protected static final short _production_table[][] = unpackFromStrings(new String[] { "\000\014\000\002\002\004\000\002\003\010\000\002\011" + "\004\000\002\011\002\000\002\006\004\000\002\006\002" + "\000\002\004\014\000\002\007\004\000\002\007\002\000" + "\002\005\013\000\002\010\004\000\002\010\002" }); /** Access to production table. */ public short[][] production_table() {return _production_table;} /** Parse-action table. */ protected static final short[][] _action_table = unpackFromStrings(new String[] { "\000\040\000\004\007\004\001\002\000\006\004\ufffc\010" + "\ufffc\001\002\000\004\002\006\001\002\000\004\002\001" + "\001\002\000\006\004\012\010\011\001\002\000\006\004" + "\ufffd\010\ufffd\001\002\000\006\004\ufff9\011\ufff9\001\002" + "\000\004\004\013\001\002\000\004\005\014\001\002\000" + "\004\005\015\001\002\000\004\004\016\001\002\000\004" + "\004\017\001\002\000\004\004\020\001\002\000\004\005" + "\021\001\002\000\006\004\ufff6\006\ufff6\001\002\000\006" + "\004\024\006\023\001\002\000\006\004\ufffb\010\ufffb\001" + "\002\000\006\004\ufff7\006\ufff7\001\002\000\006\004\030" + "\011\027\001\002\000\006\004\ufffa\011\ufffa\001\002\000" + "\006\002\ufffe\005\ufffe\001\002\000\004\004\031\001\002" + "\000\004\005\032\001\002\000\004\005\033\001\002\000" + "\004\004\034\001\002\000\004\004\035\001\002\000\004" + "\005\036\001\002\000\006\004\ufff6\006\ufff6\001\002\000" + "\006\004\024\006\040\001\002\000\006\004\ufff8\011\ufff8" + "\001\002\000\006\002\000\005\042\001\002\000\006\002" + "\uffff\005\uffff\001\002" }); /** Access to parse-action table. */ public short[][] action_table() {return _action_table;} /** <code>reduce_goto</code> table. */ protected static final short[][] _reduce_table = unpackFromStrings(new String[] { "\000\040\000\004\003\004\001\001\000\004\006\006\001" + "\001\000\002\001\001\000\002\001\001\000\004\004\007" + "\001\001\000\002\001\001\000\004\007\024\001\001\000" + "\002\001\001\000\002\001\001\000\002\001\001\000\002" + "\001\001\000\002\001\001\000\002\001\001\000\002\001" + "\001\000\004\010\021\001\001\000\002\001\001\000\002" + "\001\001\000\002\001\001\000\004\005\025\001\001\000" + "\002\001\001\000\004\011\040\001\001\000\002\001\001" + "\000\002\001\001\000\002\001\001\000\002\001\001\000" + "\002\001\001\000\002\001\001\000\004\010\036\001\001" + "\000\002\001\001\000\002\001\001\000\002\001\001\000" + "\002\001\001" }); /** Access to <code>reduce_goto</code> table. */ public short[][] reduce_table() {return _reduce_table;} /** Instance of action encapsulation class. */ protected CUP$parser$actions action_obj; /** Action encapsulation object initializer. */ protected void init_actions() { action_obj = new CUP$parser$actions(this); } /** Invoke a user supplied parse action. */ public java_cup.runtime.Symbol do_action( int act_num, java_cup.runtime.lr_parser parser, java.util.Stack stack, int top) throws java.lang.Exception { /* call code in generated class */ return action_obj.CUP$parser$do_action(act_num, parser, stack, top); } /** Indicates start state. */ public int start_state() {return 0;} /** Indicates start production. */ public int start_production() {return 0;} /** <code>EOF</code> Symbol index. */ public int EOF_sym() {return 0;} /** <code>error</code> Symbol index. */ public int error_sym() {return 1;}}/** Cup generated class to encapsulate user supplied action code.*/class CUP$parser$actions { private final parser parser; /** Constructor */ CUP$parser$actions(parser parser) { this.parser = parser; } /** Method with the actual generated action code. */ public final java_cup.runtime.Symbol CUP$parser$do_action( int CUP$parser$act_num, java_cup.runtime.lr_parser CUP$parser$parser, java.util.Stack CUP$parser$stack, int CUP$parser$top) throws java.lang.Exception { /* Symbol object for return from actions */ java_cup.runtime.Symbol CUP$parser$result; /* select the action based on the action number */ switch (CUP$parser$act_num) { /*. . . . . . . . . . . . . . . . . . . .*/ case 11: // intlist ::= { Set RESULT = null; RESULT = new HashSet(); CUP$parser$result = new java_cup.runtime.Symbol(6/*intlist*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 10: // intlist ::= intlist NUMBER { Set RESULT = null; int illeft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left; int ilright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; Set il = (Set)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; int nleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int nright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; Integer n = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; il.add(n); RESULT = il; CUP$parser$result = new java_cup.runtime.Symbol(6/*intlist*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 9: // referencedline ::= NUMBER NUMBER STRING STRING NUMBER NUMBER STRING intlist SEMICOLON { TableEntry RESULT = null; int indexleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-8)).left; int indexright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-8)).right; Integer index = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-8)).value; int refleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-7)).left; int refright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-7)).right; Integer ref = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-7)).value; int classnameleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)).left; int classnameright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)).right; String classname = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-6)).value; int methodnameleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).left; int methodnameright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).right; String methodname = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-5)).value; int startleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left; int startright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).right; Integer start = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-4)).value; int endleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left; int endright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right; Integer end = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value; int sourcenameleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -