cbc/net/loveruby/cflat/ast/AddressNode.java

26 lines
581 B
Java
Raw Normal View History

package net.loveruby.cflat.ast;
import net.loveruby.cflat.type.*;
public class AddressNode extends UnaryOpNode {
protected Type type;
public AddressNode(ExprNode n) {
super(n);
}
public Type type() {
if (type == null) throw new Error("type is null");
return type;
}
/** This method is called in TypeChecker. */
public void setType(Type type) {
if (this.type != null) throw new Error("type set twice");
this.type = type;
}
public void accept(ASTVisitor visitor) {
visitor.visit(this);
}
}