* net/loveruby/cflat/compiler/TypeChecker.java: check if argument type is valid.
* net/loveruby/cflat/compiler/TypeChecker.java: check if lhs is assignable.
* net/loveruby/cflat/compiler/TypeChecker.java: reduce cast.
* net/loveruby/cflat/ast/Function.java: define #address here.
* net/loveruby/cflat/ast/DefinedFunction.java: ditto.
* net/loveruby/cflat/ast/UndefinedFunction.java: ditto.
* net/loveruby/cflat/ast/BlockNode.java: fix type error by cast.
* test/test.sh: test funcptr2.
* test/funcptr2.cb: test a function pointer to local (defined) function.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3775 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/ast/DefinedFunction.java: #body is a BlockNode, not Node.
* net/loveruby/cflat/ast/BlockNode.java: new method #tailStmt.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3774 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/ast/Node.java: new generic method #isAssignable.
* net/loveruby/cflat/ast/VariableNode.java: is assignable.
* net/loveruby/cflat/ast/DereferenceNode.java: is assignable.
* net/loveruby/cflat/ast/ArefNode.java: is assignable.
* net/loveruby/cflat/ast/MemberNode.java: is assignable.
* net/loveruby/cflat/ast/PtrMemberNode.java: is assignable.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3772 1b9489fe-b721-0410-924e-b54b9192deb8
* net/loveruby/cflat/type/TypeTable.java (semanticCheck): check duplicated member.
* test/test.sh: invoke following test cases.
* test/struct-semcheck7.cb: test duplicated member on struct.
* test/union-semcheck7.cb: test duplicated member on union.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3769 1b9489fe-b721-0410-924e-b54b9192deb8
* 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
* net/loveruby/cflat/compiler/CodeGenerator.java: accepts TypeTable and ErrorHandler.
* net/loveruby/cflat/compiler/TypeResolver.java: ditto.
* net/loveruby/cflat/compiler/TypeChecker.java: ditto.
* net/loveruby/cflat/compiler/TypeChecker.java: set type of AddressNode.
* net/loveruby/cflat/compiler/TypeChecker.java: warn incompatible cast.
* net/loveruby/cflat/compiler/ErrorHandler.java: modify message (error -> warning).
* net/loveruby/cflat/parser/Parser.jj: rename variable: handler -> errorHandler.
* net/loveruby/cflat/ast/AST.java: do not contain TypeTable.
* net/loveruby/cflat/ast/ComplexTypeDefinition.java: new method #type.
* net/loveruby/cflat/ast/StructNode.java: ditto.
* net/loveruby/cflat/ast/UnionNode.java: ditto.
* net/loveruby/cflat/ast/AddressNode.java: receive Type from TypeChcker.
* net/loveruby/cflat/type/TypeTable.java: new method #pointerTo.
* net/loveruby/cflat/type/IntegerType.java (isCompatible): check if self is compatible with other side (be able to cast to other implicitly).
* net/loveruby/cflat/type/IntegerType.java (isCastableTo): allow explicit cast if type of type is same (integer/pointer).
* net/loveruby/cflat/type/PointerType.java: implement #equals.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3763 1b9489fe-b721-0410-924e-b54b9192deb8
* 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
* test/test.sh: test op association.
* test/assoc.cb: new test case.
* test/Makefile: build it.
git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3758 1b9489fe-b721-0410-924e-b54b9192deb8