mirror of https://github.com/aamine/cbc
* net/loveruby/cflat/ast/*.java: minimize references to asm/*.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4071 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
parent
98febdb080
commit
11e6f1ab64
|
@ -1,3 +1,7 @@
|
||||||
|
Fri Oct 24 23:03:26 2008 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
* net/loveruby/cflat/ast/*.java: minimize references to asm/*.
|
||||||
|
|
||||||
Mon Sep 29 03:46:51 2008 Minero Aoki <aamine@loveruby.net>
|
Mon Sep 29 03:46:51 2008 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* convert all source codes to Java 5 using generics and foreach
|
* convert all source codes to Java 5 using generics and foreach
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
|
||||||
|
|
||||||
public class ArefNode extends ExprNode {
|
public class ArefNode extends ExprNode {
|
||||||
protected ExprNode expr, index;
|
protected ExprNode expr, index;
|
||||||
|
@ -41,7 +40,6 @@ public class ArefNode extends ExprNode {
|
||||||
|
|
||||||
// element size of this (multi-dimension) array
|
// element size of this (multi-dimension) array
|
||||||
public long elementSize() {
|
public long elementSize() {
|
||||||
//return baseExpr().type().baseType().allocSize();
|
|
||||||
return type().allocSize();
|
return type().allocSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
public class BreakNode extends StmtNode {
|
public class BreakNode extends StmtNode {
|
||||||
public BreakNode(Location loc) {
|
public BreakNode(Location loc) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class CaseNode extends StmtNode {
|
public class CaseNode extends StmtNode {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.ImmediateValue;
|
||||||
|
import net.loveruby.cflat.asm.MemoryReference;
|
||||||
|
import net.loveruby.cflat.asm.AsmOperand;
|
||||||
|
|
||||||
public class CastNode extends ExprNode {
|
public class CastNode extends ExprNode {
|
||||||
protected TypeNode typeNode;
|
protected TypeNode typeNode;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
public class CondExprNode extends ExprNode {
|
public class CondExprNode extends ExprNode {
|
||||||
protected ExprNode cond, thenExpr, elseExpr;
|
protected ExprNode cond, thenExpr, elseExpr;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
import net.loveruby.cflat.asm.ImmediateValue;
|
||||||
|
import net.loveruby.cflat.asm.MemoryReference;
|
||||||
|
|
||||||
public class ConstantEntry {
|
public class ConstantEntry {
|
||||||
protected long id;
|
protected long id;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
public class ContinueNode extends StmtNode {
|
public class ContinueNode extends StmtNode {
|
||||||
public ContinueNode(Location loc) {
|
public ContinueNode(Location loc) {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.compiler.ErrorHandler;
|
import net.loveruby.cflat.compiler.ErrorHandler;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
import net.loveruby.cflat.exception.*;
|
import net.loveruby.cflat.exception.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
public class DefinedVariable extends Variable {
|
public class DefinedVariable extends Variable {
|
||||||
protected long sequence;
|
protected long sequence;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
|
||||||
|
|
||||||
public class DereferenceNode extends UnaryOpNode {
|
public class DereferenceNode extends UnaryOpNode {
|
||||||
public DereferenceNode(ExprNode n) {
|
public DereferenceNode(ExprNode n) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
public class DoWhileNode extends LoopNode {
|
public class DoWhileNode extends LoopNode {
|
||||||
protected ExprNode cond;
|
protected ExprNode cond;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.AsmOperand;
|
||||||
|
import net.loveruby.cflat.asm.MemoryReference;
|
||||||
|
|
||||||
abstract public class Entity extends Node {
|
abstract public class Entity extends Node {
|
||||||
protected String name;
|
protected String name;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.Type;
|
import net.loveruby.cflat.type.Type;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.ImmediateValue;
|
||||||
|
import net.loveruby.cflat.asm.AsmOperand;
|
||||||
|
import net.loveruby.cflat.asm.MemoryReference;
|
||||||
import net.loveruby.cflat.exception.*;
|
import net.loveruby.cflat.exception.*;
|
||||||
|
|
||||||
abstract public class ExprNode extends Node {
|
abstract public class ExprNode extends Node {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
public class ForNode extends LoopNode {
|
public class ForNode extends LoopNode {
|
||||||
protected ExprNode init, cond, incr;
|
protected ExprNode init, cond, incr;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
import net.loveruby.cflat.asm.AsmOperand;
|
||||||
|
import net.loveruby.cflat.asm.MemoryReference;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
abstract public class Function extends Entity {
|
abstract public class Function extends Entity {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
public class IfNode extends StmtNode {
|
public class IfNode extends StmtNode {
|
||||||
protected ExprNode cond;
|
protected ExprNode cond;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.MemoryReference;
|
||||||
|
import net.loveruby.cflat.asm.ImmediateValue;
|
||||||
|
import net.loveruby.cflat.asm.IntegerLiteral;
|
||||||
|
|
||||||
public class IntegerLiteralNode extends LiteralNode {
|
public class IntegerLiteralNode extends LiteralNode {
|
||||||
protected long value;
|
protected long value;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.ImmediateValue;
|
||||||
|
import net.loveruby.cflat.asm.MemoryReference;
|
||||||
|
|
||||||
abstract public class LiteralNode extends ExprNode {
|
abstract public class LiteralNode extends ExprNode {
|
||||||
protected Location location;
|
protected Location location;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
public class LogicalAndNode extends BinaryOpNode {
|
public class LogicalAndNode extends BinaryOpNode {
|
||||||
protected LabelPool pool;
|
protected LabelPool pool;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
public class LogicalOrNode extends BinaryOpNode {
|
public class LogicalOrNode extends BinaryOpNode {
|
||||||
protected LabelPool pool;
|
protected LabelPool pool;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
abstract public class LoopNode extends StmtNode
|
abstract public class LoopNode extends StmtNode
|
||||||
implements BreakableStmt, ContinueableStmt {
|
implements BreakableStmt, ContinueableStmt {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
|
||||||
import net.loveruby.cflat.exception.*;
|
import net.loveruby.cflat.exception.*;
|
||||||
|
|
||||||
public class PtrMemberNode extends ExprNode {
|
public class PtrMemberNode extends ExprNode {
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
import net.loveruby.cflat.asm.AsmOperand;
|
||||||
|
import net.loveruby.cflat.asm.ImmediateValue;
|
||||||
|
import net.loveruby.cflat.asm.MemoryReference;
|
||||||
|
|
||||||
public class StringLiteralNode extends LiteralNode {
|
public class StringLiteralNode extends LiteralNode {
|
||||||
protected String value;
|
protected String value;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class SwitchNode extends StmtNode implements BreakableStmt {
|
public class SwitchNode extends StmtNode implements BreakableStmt {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class UndefinedFunction extends Function {
|
public class UndefinedFunction extends Function {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
|
||||||
|
|
||||||
public class UndefinedVariable extends Variable {
|
public class UndefinedVariable extends Variable {
|
||||||
public UndefinedVariable(TypeNode t, String name) {
|
public UndefinedVariable(TypeNode t, String name) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.*;
|
import net.loveruby.cflat.type.*;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.AsmOperand;
|
||||||
|
import net.loveruby.cflat.asm.MemoryReference;
|
||||||
|
|
||||||
abstract public class Variable extends Entity {
|
abstract public class Variable extends Entity {
|
||||||
protected MemoryReference memref;
|
protected MemoryReference memref;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.type.Type;
|
import net.loveruby.cflat.type.Type;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.AsmOperand;
|
||||||
|
import net.loveruby.cflat.asm.MemoryReference;
|
||||||
|
|
||||||
public class VariableNode extends ExprNode {
|
public class VariableNode extends ExprNode {
|
||||||
protected Location location;
|
protected Location location;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.loveruby.cflat.ast;
|
package net.loveruby.cflat.ast;
|
||||||
import net.loveruby.cflat.asm.*;
|
import net.loveruby.cflat.asm.LabelPool;
|
||||||
|
import net.loveruby.cflat.asm.Label;
|
||||||
|
|
||||||
public class WhileNode extends LoopNode {
|
public class WhileNode extends LoopNode {
|
||||||
protected ExprNode cond;
|
protected ExprNode cond;
|
||||||
|
|
Loading…
Reference in New Issue