modified: src/main/java/chocopy/pa3/CodeGenImpl.java

master
bill 4 years ago
parent 14a5f54ceb
commit 42518d6547

@ -454,7 +454,7 @@ public class CodeGenImpl extends CodeGenBase
this.regHandle = regHandle; this.regHandle = regHandle;
} }
public void free(){ public void free(){
if(regHandle > 0){ if(regHandle >= 0){
freeRegister(regHandle); freeRegister(regHandle);
regHandle = -1; regHandle = -1;
} }
@ -869,18 +869,6 @@ public class CodeGenImpl extends CodeGenBase
backend.emitJAL(errorNI, "Operator not implemented"); backend.emitJAL(errorNI, "Operator not implemented");
return Register.A0; return Register.A0;
} }
private SymbolInfo getSymbolInfo(Identifier id){
SymbolTable curr_sym = sym;
SymbolInfo info = null;
String id_name = id.name;
while(curr_sym != null){
info = (SymbolInfo) curr_sym.get(id_name);
if(info != null)
return info;
curr_sym = curr_sym.getParent();
}
return info;
}
@Override @Override
public Register analyze(Identifier node) public Register analyze(Identifier node)
{ {

Loading…
Cancel
Save