* 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:
Minero Aoki 2008-10-24 14:03:31 +00:00
parent 98febdb080
commit 11e6f1ab64
30 changed files with 56 additions and 30 deletions

View File

@ -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

View File

@ -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();
} }

View File

@ -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) {

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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) {

View File

@ -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.*;

View File

@ -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;

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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 {

View File

@ -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;

View File

@ -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 {

View File

@ -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 {

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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;