📄 checker.java
字号:
"\001\000\002\001\001\000\012\003\073\004\022\006\017" + "\007\014\001\001\000\002\001\001\000\012\003\024\004" + "\022\006\025\007\014\001\001\000\002\001\001\000\002" + "\001\001\000\002\001\001\000\002\001\001\000\002\001" + "\001\000\006\006\065\007\014\001\001\000\006\006\064" + "\007\014\001\001\000\006\006\063\007\014\001\001\000" + "\006\006\062\007\014\001\001\000\006\006\061\007\014" + "\001\001\000\006\006\060\007\014\001\001\000\006\006" + "\057\007\014\001\001\000\006\006\054\007\014\001\001" + "\000\006\006\051\007\014\001\001\000\006\006\050\007" + "\014\001\001\000\002\001\001\000\006\006\047\007\014" + "\001\001\000\006\006\044\007\014\001\001\000\002\001" + "\001\000\002\001\001\000\006\006\046\007\014\001\001" + "\000\002\001\001\000\002\001\001\000\002\001\001\000" + "\002\001\001\000\006\006\053\007\014\001\001\000\002" + "\001\001\000\002\001\001\000\006\006\056\007\014\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\002\001\001\000\002\001\001\000\012" + "\003\072\004\022\006\017\007\014\001\001\000\012\003" + "\071\004\022\006\017\007\014\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\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\005\107" + "\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\002\001\001\000\004\005\120\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\002\001\001" }); /** Access to <code>reduce_goto</code> table. */ public short[][] reduce_table() {return _reduce_table;} /** Instance of action encapsulation class. */ protected CUP$Checker$actions action_obj; /** Action encapsulation object initializer. */ protected void init_actions() { action_obj = new CUP$Checker$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$Checker$do_action(act_num, parser, stack, top); } /** Indicates start state. */ public int start_state() {return 0;} /** Indicates start production. */ public int start_production() {return 1;} /** <code>EOF</code> Symbol index. */ public int EOF_sym() {return 0;} /** <code>error</code> Symbol index. */ public int error_sym() {return 1;} /* Change the method report_error so it will display the line and column of where the error occurred in the input as well as the reason for the error which is passed into the method in the String 'message'. */ public void report_error(String message, Object info) { /* Create a StringBuffer called 'm' with the string 'Error' in it. */ StringBuffer m = new StringBuffer("Error"); /* Check if the information passed to the method is the same type as the type Symbol. */ if (info instanceof Symbol) { /* Declare a Symbol object 's' with the information in the object info that is being typecasted as a Symbol object. */ Symbol s = ((Symbol) info); /* Check if the line number in the input is greater or equal to zero. */ if (s.left >= 0) { /* Add to the end of the StringBuffer error message the line number of the error in the input. */ m.append(" in line "+(s.left+1)); /* Check if the column number in the input is greater or equal to zero. */ if (s.right >= 0) /* Add to the end of the StringBuffer error message the column number of the error in the input. */ m.append(", column "+(s.right+1)); } } /* Add to the end of the StringBuffer error message created in this method the message that was passed into this method. */ m.append(" : "+message); /* Print the contents of the StringBuffer 'm', which contains an error message, out on a line. */ //System.err.println(m); throw new Error(m.toString()); } /* Change the method report_fatal_error so when it reports a fatal error it will display the line and column number of where the fatal error occurred in the input as well as the reason for the fatal error which is passed into the method in the object 'message' and then exit.*/ public void report_fatal_error(String message, Object info) { report_error(message, info); //System.exit(1); }}/** Cup generated class to encapsulate user supplied action code.*/class CUP$Checker$actions { private final Checker parser; /** Constructor */ CUP$Checker$actions(Checker parser) { this.parser = parser; } /** Method with the actual generated action code. */ public final java_cup.runtime.Symbol CUP$Checker$do_action( int CUP$Checker$act_num, java_cup.runtime.lr_parser CUP$Checker$parser, java.util.Stack CUP$Checker$stack, int CUP$Checker$top) throws java.lang.Exception { /* Symbol object for return from actions */ java_cup.runtime.Symbol CUP$Checker$result; /* select the action based on the action number */ switch (CUP$Checker$act_num) { /*. . . . . . . . . . . . . . . . . . . .*/ case 42: // lit_expr ::= BOOLEAN { Object RESULT = null; int boolleft = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left; int boolright = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right; Boolean bool = (Boolean)((java_cup.runtime.Symbol) CUP$Checker$stack.elementAt(CUP$Checker$top-0)).value; RESULT = bool; CUP$Checker$result = new java_cup.runtime.Symbol(5/*lit_expr*/, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right, RESULT); } return CUP$Checker$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 41: // lit_expr ::= STRING { Object RESULT = null; int stleft = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left; int stright = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right; String st = (String)((java_cup.runtime.Symbol) CUP$Checker$stack.elementAt(CUP$Checker$top-0)).value; RESULT = st.substring(1, st.length() - 1); CUP$Checker$result = new java_cup.runtime.Symbol(5/*lit_expr*/, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right, RESULT); } return CUP$Checker$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 40: // lit_expr ::= SHORT { Object RESULT = null; int numleft = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left; int numright = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right; Short num = (Short)((java_cup.runtime.Symbol) CUP$Checker$stack.elementAt(CUP$Checker$top-0)).value; RESULT = num; CUP$Checker$result = new java_cup.runtime.Symbol(5/*lit_expr*/, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right, RESULT); } return CUP$Checker$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 39: // lit_expr ::= INT { Object RESULT = null; int numleft = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left; int numright = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right; Integer num = (Integer)((java_cup.runtime.Symbol) CUP$Checker$stack.elementAt(CUP$Checker$top-0)).value; RESULT = num; CUP$Checker$result = new java_cup.runtime.Symbol(5/*lit_expr*/, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right, RESULT); } return CUP$Checker$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 38: // lit_expr ::= MIN_LONG { Object RESULT = null; int numleft = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left; int numright = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right; Long num = (Long)((java_cup.runtime.Symbol) CUP$Checker$stack.elementAt(CUP$Checker$top-0)).value; RESULT = num; CUP$Checker$result = new java_cup.runtime.Symbol(5/*lit_expr*/, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right, RESULT); } return CUP$Checker$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 37: // lit_expr ::= LONG { Object RESULT = null; int numleft = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left; int numright = ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right; Long num = (Long)((java_cup.runtime.Symbol) CUP$Checker$stack.elementAt(CUP$Checker$top-0)).value; RESULT = num; CUP$Checker$result = new java_cup.runtime.Symbol(5/*lit_expr*/, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).left, ((java_cup.runtime.Symbol)CUP$Checker$stack.elementAt(CUP$Checker$top-0)).right, RESULT); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -