⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 expshiftleft.java

📁 用Java实现的编译器。把源代码编译成SPARC汇编程序
💻 JAVA
字号:
/**
*This class is used for expressions using the left shift operation. 
*This class extends the Exp abstract class
**/
package CatDecaf.IR;
import CatDecaf.Utilities.*;
import parser.*;
import CatDecaf.Utilities.Debugger.*;
import java6035.tools.ASM.*;
public class ExpShiftLeft extends Exp{
    public Exp exp1_, exp2_;
    public int type;
    public SPARCRegister reg;
	public ExpShiftLeft(Exp e1, Exp e2){
		type = sym.INT;
		if (e1.noError() && e1.getType()!=sym.INT) 
			ErrorLog.log("Integer type expected on LHS of '<<'");
		if (e2.noError() && e2.getType()!=sym.INT) 
			ErrorLog.log("Integer type expected on RHS of '<<'");	  	
		exp1_ = e1;
		exp2_ = e2;
		reg = null;		
    }
	public int getType(){return type;}    
	public boolean noError(){return !(type==sym.ERROR_TYPE);}
	public SPARCRegister getReg(){
		return reg;
	}

	public void setReg(SPARCRegister r){
		reg=r;
		reg.status = 1;
	}
	public void releaseReg(){
		reg.status = 0;
		reg= null;
	}	
	
    public void accept(Visitor v){
		v.visit(this);
    }
}

⌨️ 快捷键说明

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