Commit Graph

3 Commits

Author SHA1 Message Date
Minero Aoki 705818d1dc * net/loveruby/cflat/compiler/TypeChecker.java: check member validity for s.memb, s->memb, u.memb, u->memb.
* net/loveruby/cflat/type/Type.java: new method #isComplexType.
* net/loveruby/cflat/type/ComplexType.java: override it.
* net/loveruby/cflat/compiler/LocalReferenceResolver.java: should resolve variable initializer.
* net/loveruby/cflat/ast/DefinedVariable.java: new method #hasInitializer.
* test/test.sh: run tests.
* test/struct-semcheck5.cb: check if member is valid on s.memb.
* test/struct-semcheck6.cb: check if member is valid on sptr->memb.
* test/union-semcheck5.cb: check if member is valid on u.memb.
* test/union-semcheck6.cb: check if member is valid on uptr->memb.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3766 1b9489fe-b721-0410-924e-b54b9192deb8
2008-01-01 16:24:09 +00:00
Minero Aoki 5fc167d2e5 * net/loveruby/cflat/compiler/Compiler.java: invoke TypeChecker.
* net/loveruby/cflat/compiler/TypeChecker.java: check type (incomplete).
* net/loveruby/cflat/type/Type.java: new method #isCompatible, #isCastableTo.
* net/loveruby/cflat/type/IntegerType.java: override them.
* net/loveruby/cflat/type/UnsignedCharType.java: change textize result.
* net/loveruby/cflat/type/UnsignedLongType.java: ditto.
* net/loveruby/cflat/type/UnsignedIntType.java: ditto.
* net/loveruby/cflat/type/UnsignedShortType.java: ditto.
* net/loveruby/cflat/ast/AbstractAssignNode.java: new method #setRHS.
* net/loveruby/cflat/ast/AssignNode.java: is now an AbstractAssignNode.
* net/loveruby/cflat/ast/BinaryOpNode.java: new methods #setLeft, #setRight.
* net/loveruby/cflat/ast/FuncallNode.java (type): does not rely on #function (can get type of non-static function).
* net/loveruby/cflat/ast/CondExprNode.java: new methods #setThenBody, #setElseBody.
* net/loveruby/cflat/ast/TypeNode.java: new constructor by Type.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3762 1b9489fe-b721-0410-924e-b54b9192deb8
2008-01-01 12:56:25 +00:00
Minero Aoki dd209e191b import cbc from stdcompiler repository (rev185)
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3753 1b9489fe-b721-0410-924e-b54b9192deb8
2007-12-24 08:19:51 +00:00