code.java

来自「编译器中的词法分析」· Java 代码 · 共 37 行

JAVA
37
字号
package cmm.cmmcc;

/**
 * 目标代码类,继承操作符类型接口
 * @author Huang Xuanxing
 *
 */
public class Code implements IOperatorType {
	private int operator; // 操作符
	private String oprand1; // 操作数1
	private String oprand2; // 操作数2
	public int address; // 地址
	public int next; // 下条代码地址
	public static final int JUMPAHEAD = -1; // 需回填下条代码地址
	public static final int JUMPBACK = -2; // 需向前填下条代码地址
	
	public Code(int inOp) {
		operator = inOp;
		oprand1 = "";
		oprand2 = "";
	}
	
	public Code(int inOp, String inOp1, String inOp2) {
		operator = inOp;
		oprand1 = inOp1;
		oprand2 = inOp2;
	}
	
	/**
	 * 设置下条代码地址
	 *
	 */
	public void setNext() {
		//
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?