📄 identifier.java
字号:
/**
*This class is used for identifiers.
**/
package CatDecaf.IR;
import CatDecaf.Utilities.*;
import parser.*;
import CatDecaf.Utilities.Debugger.*;
import java6035.tools.ASM.*;
public class Identifier implements Visitable{
public String identifier_;
public int type;
public boolean glbVarFlag;
public int offset;
public SPARCRegister reg;
public boolean paramFlag;
/*
public Identifier(String id){
identifier_ = id;
type = sym.NO_TYPE;
}
*/
public Identifier(String id, int typ){
identifier_ = id;
type = typ;
offset = -1;
glbVarFlag = false;
reg = null;
paramFlag = false;
}
/*
public Identifier(String id, int typ, int offsetValue){
identifier_ = id;
type = typ;
offset = offsetValue;
glbVarFlag = false;
reg = null;
paramFlag = false;
}
*/
/*
public Identifier(String id, int typ, int offsetValue, boolean gv){
identifier_ = id;
type = typ;
offset = offsetValue;
glbVarFlag = gv;
reg = null;
paramFlag = false;
}
*/
public Identifier(String id, int typ, int offsetValue, boolean gv, boolean param){
identifier_ = id;
type = typ;
offset = offsetValue;
glbVarFlag = gv;
reg = null;
paramFlag = param;
}
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 + -