opptable.java
来自「中山大学编译原理课程的一个实验」· Java 代码 · 共 46 行
JAVA
46 行
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package parser;/** * * @author Beeven */public class OPPTable { public final static int[][] table= new int[][] { // num,bool,+-,*/,-,^,fucn,(,,,),Relation,!,&,|,?,:,$ {-1,-1, 1, 1, 1, 1, 1,-1, 1, 1, 1,-5, 1, 1, 1, 1, 1}, {-1,-1,-5,-5,-5,-5,-1,-1,-5, 1,-5,-1, 1, 1, 1, 1, 1}, { 0,-5, 1, 0, 0, 0, 0, 0, 1, 1, 1,-5,-5,-5,-5, 1, 1}, { 0,-5, 1, 1, 0, 0, 0, 0, 1, 1, 1,-5,-5,-5,-5, 1, 1}, { 0,-5, 1, 1, 0, 1, 0, 0, 1, 1, 1,-5,-5,-5,-5, 1, 1}, {0, -5, 1, 1, 0, 0, 0, 0, 1, 1, 1,-5,-5,-5,-5, 1, 1}, {-3,-3,-3,-3,-3,-3,-3, 0,-3, 1,-3,-3,-3,-3,-3, 1,-3}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2}, { 0,-5, 0, 0, 0, 0, 0, 0, 0, 0,-5,-5,-5,-5, 0, 0,-2}, {-1,-1, 1, 1, 1, 1,-1,-1, 1, 1, 1,-1, 1, 1, 1, 1, 1}, { 0,-5, 0, 0, 0, 0, 0, 0,-5, 1, 1, 1, 1, 1, 1, 1, 1}, { 0, 0,-5,-5,-5,-5,-5, 0,-5, 1, 0, 0, 1, 1, 1, 1, 1}, { 0, 0,-5,-5,-5,-5,-5, 0,-5, 1, 0, 0, 1, 1, 1, 1, 1}, { 0, 0,-5,-5,-5,-5,-5, 0,-5, 1, 0, 0, 0, 1, 1, 1, 1}, { 0,-7, 0, 0, 0, 0, 0, 0,-7,-6, 0,-7,-7,-7, 0, 0,-7}, { 0,-7, 0, 0, 0, 0, 0, 0, 1, 1, 0,-7,-7,-7, 1, 1, 1}, { 0, 0, 0, 0, 0, 0, 0, 0,-3,-3, 0, 0, 0, 0, 0,-7, 2} }; /* 0 for shift * 1 for reduce * 2 for accept * -1 for MissingOperatorError * -2 for MissingRightParenthesisException * -3 for MissingLeftParenthesisException * -4 for FunctionCallException * -5 for TypeMismatchedException * -6 for MissingOperandError * -7 for TrinaryOperationError */}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?