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>
|
||||
|
||||
* convert all source codes to Java 5 using generics and foreach
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.type.*;
|
||||
import net.loveruby.cflat.asm.*;
|
||||
|
||||
public class ArefNode extends ExprNode {
|
||||
protected ExprNode expr, index;
|
||||
|
@ -41,7 +40,6 @@ public class ArefNode extends ExprNode {
|
|||
|
||||
// element size of this (multi-dimension) array
|
||||
public long elementSize() {
|
||||
//return baseExpr().type().baseType().allocSize();
|
||||
return type().allocSize();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.*;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class BreakNode extends StmtNode {
|
||||
public BreakNode(Location loc) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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.*;
|
||||
|
||||
public class CaseNode extends StmtNode {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
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 {
|
||||
protected TypeNode typeNode;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.*;
|
||||
import net.loveruby.cflat.type.*;
|
||||
import net.loveruby.cflat.asm.LabelPool;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class CondExprNode extends ExprNode {
|
||||
protected ExprNode cond, thenExpr, elseExpr;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
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 {
|
||||
protected long id;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.asm.*;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class ContinueNode extends StmtNode {
|
||||
public ContinueNode(Location loc) {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.compiler.ErrorHandler;
|
||||
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 java.util.*;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.type.*;
|
||||
import net.loveruby.cflat.asm.*;
|
||||
import net.loveruby.cflat.asm.Label;
|
||||
|
||||
public class DefinedVariable extends Variable {
|
||||
protected long sequence;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.type.*;
|
||||
import net.loveruby.cflat.asm.*;
|
||||
|
||||
public class DereferenceNode extends UnaryOpNode {
|
||||
public DereferenceNode(ExprNode n) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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 {
|
||||
protected ExprNode cond;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
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 {
|
||||
protected String name;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
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.*;
|
||||
|
||||
abstract public class ExprNode extends Node {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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 {
|
||||
protected ExprNode init, cond, incr;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
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.*;
|
||||
|
||||
abstract public class Function extends Entity {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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 {
|
||||
protected ExprNode cond;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
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 {
|
||||
protected long value;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
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 {
|
||||
protected Location location;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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 {
|
||||
protected LabelPool pool;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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 {
|
||||
protected LabelPool pool;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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
|
||||
implements BreakableStmt, ContinueableStmt {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.type.*;
|
||||
import net.loveruby.cflat.asm.*;
|
||||
import net.loveruby.cflat.exception.*;
|
||||
|
||||
public class PtrMemberNode extends ExprNode {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
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 {
|
||||
protected String value;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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.*;
|
||||
|
||||
public class SwitchNode extends StmtNode implements BreakableStmt {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.type.*;
|
||||
import net.loveruby.cflat.asm.*;
|
||||
import java.util.*;
|
||||
|
||||
public class UndefinedFunction extends Function {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
import net.loveruby.cflat.type.*;
|
||||
import net.loveruby.cflat.asm.*;
|
||||
|
||||
public class UndefinedVariable extends Variable {
|
||||
public UndefinedVariable(TypeNode t, String name) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
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 {
|
||||
protected MemoryReference memref;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.loveruby.cflat.ast;
|
||||
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 {
|
||||
protected Location location;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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 {
|
||||
protected ExprNode cond;
|
||||
|
|
Loading…
Reference in New Issue