* net/loveruby/cflat/compiler/IRGenerator.java: assignBeforeStmt is useless. Use assign instead.
* net/loveruby/cflat/compiler/IRGenerator.java: should be able to create tmp in variable initializers for also function toplevel block.
* net/loveruby/cflat/compiler/IRGenerator.java: move funcall before stmt.
* net/loveruby/cflat/compiler/CodeGenerator.java: do not display "(null)" location.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4184 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/asm/Type.java: types should not know signed or not.
* net/loveruby/cflat/ir/Op.java: have signed/unsigned information.
* net/loveruby/cflat/compiler/IRGenerator.java: use new op and type.
* net/loveruby/cflat/compiler/CodeGenerator.java: ditto.
* net/loveruby/cflat/compiler/TypeChecker.java (FuncallNode): should check optional argument types.
* net/loveruby/cflat/compiler/CodeGenerator.java: now use simple mov to load values from memory (and cast it later).
* net/loveruby/cflat/type/TypeTable.java: provide stack value type.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4182 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/compiler/IRGenerator.java: isStatement() did not work correctly; e.g. return ++argc failed to return value, because ++argc was wrongly judged as statemen (is really expr).
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4181 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/compiler/LocalResolver.java: create ToplevelScope, ConstantTable here (instead of creating them in AST).
* net/loveruby/cflat/ast/AST.java: do not create ToplevelScope, ConstantTable by myself.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4175 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/compiler/Compiler.java: new method dumpExpr to dump single expression.
* net/loveruby/cflat/compiler/CompilerMode.java: add enum value DumpExpr: define new option --dump-expr.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4173 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/parser/Parser.jj: sizeof TYPE requires one more lookahead because EXPR of "sizeof EXPR" may have parentheses, too. We can distinguish type and expr by 1 look ahead, because Head of type() == head of typeref() == head of typeref_base(). typeref_base has unique terminal on head.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4172 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/ast: move Entity and its subclasses under entity/.
* net/loveruby/cflat/ast: move Scope and its subclasses under entity/.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4162 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/asm/*.java: support it.
* net/loveruby/cflat/ir/*.java: support it.
* net/loveruby/cflat/compiler/IRGenerator.java: convert ast Type -> asm Type.
* net/loveruby/cflat/compiler/CodeGenerator.java: use asm Type.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4160 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/asm/Assembler.java: add _byte(long), etc.
* net/loveruby/cflat/ir/IR.java: do not export typeTable, provide natural type instead.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4159 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/type/FunctionType.java: FunctionType#toString should separate each argument types by ",".
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4157 1b9489fe-b721-0410-924e-b54b9192deb8
net/loveruby/cflat/compiler/Simplifier.java: set aref result type.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4147 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/compiler/Simplifier.java (MemberNode): should set type.
* net/loveruby/cflat/compiler/Simplifier.java (PtrMemberNode): should set type.
* net/loveruby/cflat/compiler/Simplifier.java (Deref, Addr): should compile child expr.
* net/loveruby/cflat/ast/BinaryOpNode.java (ctor): accept type.
* net/loveruby/cflat/ast/TypeNode.java (location): do not raise exception when no typeRef exist.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4144 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/compiler/Simplifier.java: set location of AssignStmtNode.
* net/loveruby/cflat/compiler/Simplifier.java: allocate tmp variable in scope.
* net/loveruby/cflat/compiler/Simplifier.java: opAssign/inc/dec handling was completely wrong (there still be some problems yet).
* net/loveruby/cflat/compiler/CodeGenerator.java (compileLHS): implemented for IR.
* net/loveruby/cflat/compiler/CodeGenerator.java (loadVarible): implemented for IR.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4142 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/ir: new package to hold IR tree nodes.
* net/loveruby/cflat/ir/IRTree.java: new class.
* net/loveruby/cflat/ir/Stmt.java: new class.
* net/loveruby/cflat/ir/StmtKind.java: new enum.
* net/loveruby/cflat/ir/Expr.java: new class.
* net/loveruby/cflat/ir/ExprKind.java: new enum.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4136 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/compiler/TypeChecker.java: TypeChecker has required ReturnNode.function, provide "current function" by myself.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4131 1b9489fe-b721-0410-924e-b54b9192deb8