mirror of https://github.com/aamine/cbc
r4626@macbookpro: aamine | 2009-04-30 21:49:44 +0900
* net/loveruby/cflat/ast/*.java: remove unused reference to asm.Label. git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4165 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
parent
e66d1b59d9
commit
a5a58d9ef8
|
@ -1,3 +1,8 @@
|
|||
Sun Aug 31 23:59:36 2008 Minero Aoki <aamine@loveruby.net>
|
||||
|
||||
* net/loveruby/cflat/ast/*.java: remove unused reference to
|
||||
asm.Label.
|
||||
|
||||
Mon Apr 27 02:55:41 2009 Minero Aoki <aamine@loveruby.net>
|
||||
|
||||
* net/loveruby/cflat/entity: new package.
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class BreakNode extends StmtNode {
|
||||
public BreakNode(Location loc) {
|
||||
super(loc);
|
||||
}
|
||||
|
||||
public Location location() {
|
||||
return location;
|
||||
}
|
||||
|
||||
protected void _dump(Dumper d) {
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public interface BreakableStmt {
|
||||
public Label endLabel();
|
||||
}
|
|
@ -1,18 +1,14 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.type.*;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class CondExprNode extends ExprNode {
|
||||
protected ExprNode cond, thenExpr, elseExpr;
|
||||
protected Label elseLabel, endLabel;
|
||||
|
||||
public CondExprNode(ExprNode cond, ExprNode t, ExprNode e) {
|
||||
super();
|
||||
this.cond = cond;
|
||||
this.thenExpr = t;
|
||||
this.elseExpr = e;
|
||||
this.elseLabel = new Label();
|
||||
this.endLabel = new Label();
|
||||
}
|
||||
|
||||
public Type type() {
|
||||
|
@ -39,14 +35,6 @@ public class CondExprNode extends ExprNode {
|
|||
this.elseExpr = expr;
|
||||
}
|
||||
|
||||
public Label elseLabel() {
|
||||
return elseLabel;
|
||||
}
|
||||
|
||||
public Label endLabel() {
|
||||
return endLabel;
|
||||
}
|
||||
|
||||
public Location location() {
|
||||
return cond.location();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class ContinueNode extends StmtNode {
|
||||
public ContinueNode(Location loc) {
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public interface ContinueableStmt {
|
||||
public Label continueLabel();
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class DoWhileNode extends StmtNode {
|
||||
protected StmtNode body;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class ForNode extends StmtNode {
|
||||
protected StmtNode init;
|
||||
|
|
|
@ -1,28 +1,17 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class GotoNode extends StmtNode {
|
||||
protected String target;
|
||||
protected Label label;
|
||||
|
||||
public GotoNode(Location loc, String target) {
|
||||
super(loc);
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public GotoNode(Label target) {
|
||||
super(null);
|
||||
label = target;
|
||||
}
|
||||
|
||||
public String target() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public Label label() {
|
||||
return label;
|
||||
}
|
||||
|
||||
protected void _dump(Dumper d) {
|
||||
d.printMember("target", target);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class IfNode extends StmtNode {
|
||||
protected ExprNode cond;
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class LabelNode extends StmtNode {
|
||||
protected String name;
|
||||
protected StmtNode stmt;
|
||||
protected Label label;
|
||||
|
||||
public LabelNode(Location loc, String name, StmtNode stmt) {
|
||||
super(loc);
|
||||
|
@ -12,11 +10,6 @@ public class LabelNode extends StmtNode {
|
|||
this.stmt = stmt;
|
||||
}
|
||||
|
||||
public LabelNode(Label label) {
|
||||
super(null);
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
@ -25,11 +18,6 @@ public class LabelNode extends StmtNode {
|
|||
return stmt;
|
||||
}
|
||||
|
||||
public Label label() {
|
||||
if (label == null) throw new Error("label is null");
|
||||
return label;
|
||||
}
|
||||
|
||||
protected void _dump(Dumper d) {
|
||||
d.printMember("name", name);
|
||||
d.printMember("stmt", stmt);
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class LogicalAndNode extends BinaryOpNode {
|
||||
protected Label endLabel;
|
||||
|
||||
public LogicalAndNode(ExprNode left, ExprNode right) {
|
||||
super(left, "&&", right);
|
||||
this.endLabel = new Label();
|
||||
}
|
||||
|
||||
public <S,E> E accept(ASTVisitor<S,E> visitor) {
|
||||
return visitor.visit(this);
|
||||
}
|
||||
|
||||
public Label endLabel() {
|
||||
return endLabel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class LogicalOrNode extends BinaryOpNode {
|
||||
protected Label endLabel;
|
||||
|
||||
public LogicalOrNode(ExprNode left, ExprNode right) {
|
||||
super(left, "||", right);
|
||||
this.endLabel = new Label();
|
||||
}
|
||||
|
||||
public <S,E> E accept(ASTVisitor<S,E> visitor) {
|
||||
return visitor.visit(this);
|
||||
}
|
||||
|
||||
public Label endLabel() {
|
||||
return endLabel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,24 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
public class SwitchNode extends StmtNode implements BreakableStmt {
|
||||
public class SwitchNode extends StmtNode {
|
||||
protected ExprNode cond;
|
||||
protected List<CaseNode> cases;
|
||||
protected Label endLabel;
|
||||
|
||||
public SwitchNode(Location loc, ExprNode cond, List<CaseNode> cases) {
|
||||
super(loc);
|
||||
this.cond = cond;
|
||||
this.cases = cases;
|
||||
this.endLabel = new Label();
|
||||
}
|
||||
|
||||
public ExprNode cond() {
|
||||
return cond;
|
||||
}
|
||||
|
||||
public void setCond(ExprNode cond) {
|
||||
this.cond = cond;
|
||||
}
|
||||
|
||||
public List<CaseNode> cases() {
|
||||
return cases;
|
||||
}
|
||||
|
||||
public Label endLabel() {
|
||||
return endLabel;
|
||||
}
|
||||
|
||||
protected void _dump(Dumper d) {
|
||||
d.printMember("cond", cond);
|
||||
d.printNodeList("cases", cases);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class WhileNode extends StmtNode {
|
||||
protected StmtNode body;
|
||||
|
|
Loading…
Reference in New Issue