mirror of https://github.com/aamine/cbc
40 lines
1002 B
Java
40 lines
1002 B
Java
package net.loveruby.cflat.ast;
|
|
import net.loveruby.cflat.type.*;
|
|
import net.loveruby.cflat.asm.*;
|
|
|
|
public class UndefinedVariable extends Variable {
|
|
public UndefinedVariable(TypeNode t, String name) {
|
|
super(false, t, name);
|
|
}
|
|
|
|
public boolean isDefined() { return false; }
|
|
public boolean isPrivate() { return false; }
|
|
public boolean isInitialized() { return false; }
|
|
|
|
public String symbol() {
|
|
return name();
|
|
}
|
|
|
|
public void setMemref(Address addr) {
|
|
throw new Error("UndefinedVariable#Memref");
|
|
}
|
|
|
|
public Address memref() {
|
|
return new DirectAddress(new Label(symbol()));
|
|
}
|
|
|
|
public AsmEntity address() {
|
|
return new ImmediateValue(new Label(symbol()));
|
|
}
|
|
|
|
protected void _dump(Dumper d) {
|
|
d.printMember("name", name);
|
|
d.printMember("isPrivate", isPrivate());
|
|
d.printMember("typeNode", typeNode);
|
|
}
|
|
|
|
public void accept(ASTVisitor visitor) {
|
|
visitor.visit(this);
|
|
}
|
|
}
|