home *** CD-ROM | disk | FTP | other *** search
- package espresso;
-
- class DoLoop extends JumpTarget {
- AST body;
- AST cond;
-
- void print(int var1) {
- System.out.print("do ");
- this.body.print();
- System.out.print(" while (");
- this.cond.print();
- System.out.print(")");
- }
-
- Item gen() {
- int var1 = Gen.curPc();
- this.body.genDrop();
- Gen.resolve(super.cont);
- Gen.statBegin(this.cond.pos);
- CondItem var2 = this.cond.gen().mkCond();
- Gen.resolve(var2.jumpTrue(), var1);
- Gen.resolve(var2.falseJumps);
- Gen.resolve(super.exit);
- return Item.voidItem;
- }
-
- AST simplify() {
- this.cond = this.cond.simplify();
- this.body = this.body.simplify();
- return this;
- }
-
- void markCaptured(Bits var1) {
- var1.orSet(super.contCapt);
- this.body.markCaptured(var1);
- this.cond.markCaptured(var1);
- super.contCapt.orSet(var1);
- var1.orSet(super.exitCapt);
- }
-
- Typ attr(Env var1, int var2, Typ var3) {
- Env var4 = new Env(var1, this);
- super.typ = this.body.attr(var4, 12, var3);
- this.cond.attr(var1, 12, Typ.booleanTyp);
- return super.typ;
- }
-
- DoLoop(int var1, AST var2, AST var3) {
- super(var1, 8);
- this.cond = var3;
- this.body = var2;
- super.contCapt = new Bits();
- super.exitCapt = new Bits();
- }
- }
-