mirror of https://github.com/aamine/cbc
38 lines
834 B
Java
38 lines
834 B
Java
package net.loveruby.cflat.ast;
|
|
import net.loveruby.cflat.asm.Label;
|
|
|
|
public class IfNode extends StmtNode {
|
|
protected ExprNode cond;
|
|
protected StmtNode thenBody;
|
|
protected StmtNode elseBody;
|
|
|
|
public IfNode(Location loc, ExprNode c, StmtNode t, StmtNode e) {
|
|
super(loc);
|
|
this.cond = c;
|
|
this.thenBody = t;
|
|
this.elseBody = e;
|
|
}
|
|
|
|
public ExprNode cond() {
|
|
return cond;
|
|
}
|
|
|
|
public StmtNode thenBody() {
|
|
return thenBody;
|
|
}
|
|
|
|
public StmtNode elseBody() {
|
|
return elseBody;
|
|
}
|
|
|
|
protected void _dump(Dumper d) {
|
|
d.printMember("cond", cond);
|
|
d.printMember("thenBody", thenBody);
|
|
d.printMember("elseBody", elseBody);
|
|
}
|
|
|
|
public <S,E> S accept(ASTVisitor<S,E> visitor) {
|
|
return visitor.visit(this);
|
|
}
|
|
}
|