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

30 lines
667 B
Java

package net.loveruby.cflat.ast;
import net.loveruby.cflat.asm.*;
abstract public class LoopNode extends StmtNode
implements BreakableStmt, ContinueableStmt {
protected LabelPool pool;
protected Label begLabel, endLabel;
public LoopNode(Location loc, LabelPool lp) {
super(loc);
pool = lp;
}
public Label begLabel() {
if (begLabel == null) {
begLabel = pool.newLabel();
}
return begLabel;
}
public Label endLabel() {
if (endLabel == null) {
endLabel = pool.newLabel();
}
return endLabel;
}
abstract public Label continueLabel();
}