2008-09-07 04:10:49 +08:00
|
|
|
package net.loveruby.cflat.ast;
|
|
|
|
import net.loveruby.cflat.type.*;
|
|
|
|
|
|
|
|
public class SizeofExprNode extends ExprNode {
|
|
|
|
protected ExprNode expr;
|
|
|
|
protected TypeNode type;
|
|
|
|
|
|
|
|
public SizeofExprNode(ExprNode expr, TypeRef type) {
|
|
|
|
this.expr = expr;
|
|
|
|
this.type = new TypeNode(type);
|
|
|
|
}
|
|
|
|
|
|
|
|
public ExprNode expr() {
|
|
|
|
return this.expr;
|
|
|
|
}
|
|
|
|
|
2009-04-04 22:47:11 +08:00
|
|
|
public void setExpr(ExprNode expr) {
|
|
|
|
this.expr = expr;
|
|
|
|
}
|
|
|
|
|
2008-09-07 04:10:49 +08:00
|
|
|
public Type type() {
|
|
|
|
return this.type.type();
|
|
|
|
}
|
|
|
|
|
|
|
|
public TypeNode typeNode() {
|
|
|
|
return this.type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Location location() {
|
|
|
|
return expr.location();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void _dump(Dumper d) {
|
|
|
|
d.printMember("expr", expr);
|
|
|
|
}
|
|
|
|
|
2009-04-12 14:31:12 +08:00
|
|
|
public <S,E> E accept(ASTVisitor<S,E> visitor) {
|
2009-04-04 22:47:11 +08:00
|
|
|
return visitor.visit(this);
|
2008-09-07 04:10:49 +08:00
|
|
|
}
|
|
|
|
}
|