[Nice-commit] Nice/src/bossa/syntax typecheck.nice,1.96,1.97 tools.nice,1.31,1.32 analyse.nice,1.100
Brought to you by:
bonniot
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27227/src/bossa/syntax Modified Files: typecheck.nice tools.nice analyse.nice UserOperator.java TupleExp.java PolySymbol.java Pattern.java OverloadedSymbolExp.java NiceClass.java NewArrayExp.java Monotype.java MonoSymbol.java MethodImplementation.java MethodDeclaration.java MethodContainer.java MethodBodyDefinition.java LiteralArrayExp.java FunSymbol.java FunExp.java DefaultMethodImplementation.java Contract.java CallExp.java Block.java Log Message: Separated high-level type operations (in nice.tools.typing.Types) from the ones related to code generation (in nice.tools.code.Types). Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** typecheck.nice 2 Feb 2004 23:21:44 -0000 1.96 --- typecheck.nice 25 Feb 2004 11:23:28 -0000 1.97 *************** *** 671,675 **** target.type = checkMonomorphic(value.getType(), decl); ! if (nice.tools.code.Types.isVoid(target.type)) throw error(decl, "A variable cannot have a void type"); } --- 671,675 ---- target.type = checkMonomorphic(value.getType(), decl); ! if (nice.tools.typing.Types.isVoid(target.type)) throw error(decl, "A variable cannot have a void type"); } *************** *** 739,743 **** target.type = notNull(PrimitiveType.intType); ! if (nice.tools.code.Types.isVoid(target.type)) throw error(decl, "A variable cannot have a void type"); --- 739,743 ---- target.type = notNull(PrimitiveType.intType); ! if (nice.tools.typing.Types.isVoid(target.type)) throw error(decl, "A variable cannot have a void type"); *************** *** 771,775 **** notNull(decl.left).type = checkMonomorphic(type, decl); ! if (nice.tools.code.Types.isVoid(notNull(decl.left).type)) throw error(decl, "A variable cannot have a void type"); --- 771,775 ---- notNull(decl.left).type = checkMonomorphic(type, decl); ! if (nice.tools.typing.Types.isVoid(notNull(decl.left).type)) throw error(decl, "A variable cannot have a void type"); *************** *** 859,863 **** else { ! if (! r.fake && nice.tools.code.Types.isVoid(expectedType)) throw bossa.util.User.error(r, "Cannot return a value here"); --- 859,863 ---- else { ! if (! r.fake && nice.tools.typing.Types.isVoid(expectedType)) throw bossa.util.User.error(r, "Cannot return a value here"); *************** *** 871,875 **** try{ ! if ( !(r.fake && expectedType != null && nice.tools.code.Types.isVoid(expectedType))) function.checkReturnedType(r.returnType()); } --- 871,875 ---- try{ ! if (! (r.fake && expectedType != null && nice.tools.typing.Types.isVoid(expectedType))) function.checkReturnedType(r.returnType()); } *************** *** 895,899 **** s.object = notNull(s.object).noOverloading(); mlsub.typing.Polytype type = notNull(s.object).getType(); ! if (isPrimitive(type)) throw bossa.util.User.error(s.object, "Synchronization cannot be done on primitive values"); --- 895,899 ---- s.object = notNull(s.object).noOverloading(); mlsub.typing.Polytype type = notNull(s.object).getType(); ! if (nice.tools.typing.Types.isPrimitive(type)) throw bossa.util.User.error(s.object, "Synchronization cannot be done on primitive values"); *************** *** 986,992 **** } - boolean isPrimitive(mlsub.typing.Polytype type) = - nice.tools.code.Types.javaType(type) instanceof gnu.bytecode.PrimType; - void checkNotNull(mlsub.typing.Polytype type) { --- 986,989 ---- Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tools.nice 18 Feb 2004 11:50:54 -0000 1.31 --- tools.nice 25 Feb 2004 11:23:28 -0000 1.32 *************** *** 61,68 **** mlsub.typing.Monotype makeSure(mlsub.typing.Monotype m) = ! notNull(bossa.syntax.Monotype.sure(nice.tools.code.Types.rawType(m))); mlsub.typing.Monotype makeUnsure(mlsub.typing.Monotype m) = ! notNull(bossa.syntax.Monotype.maybe(nice.tools.code.Types.rawType(m))); mlsub.typing.Monotype checkMonomorphic(mlsub.typing.Polytype type, --- 61,68 ---- mlsub.typing.Monotype makeSure(mlsub.typing.Monotype m) = ! notNull(bossa.syntax.Monotype.sure(nice.tools.typing.Types.rawType(m))); mlsub.typing.Monotype makeUnsure(mlsub.typing.Monotype m) = ! notNull(bossa.syntax.Monotype.maybe(nice.tools.typing.Types.rawType(m))); mlsub.typing.Monotype checkMonomorphic(mlsub.typing.Polytype type, *************** *** 122,126 **** else { ! let originalType = nice.tools.code.Types.rawType(sym.getMonotype()); if (originalType instanceof mlsub.typing.MonotypeConstructor) parameters = originalType.getTP(); --- 122,126 ---- else { ! let originalType = nice.tools.typing.Types.rawType(sym.getMonotype()); if (originalType instanceof mlsub.typing.MonotypeConstructor) parameters = originalType.getTP(); Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** analyse.nice 12 Feb 2004 23:54:22 -0000 1.100 --- analyse.nice 25 Feb 2004 11:23:28 -0000 1.101 *************** *** 194,198 **** { symbol.type = notNull(type.resolve(this.typeMap)); ! if (nice.tools.code.Types.isVoid(symbol.type)) throw error(symbol, "A variable cannot have a void type"); } --- 194,198 ---- { symbol.type = notNull(type.resolve(this.typeMap)); ! if (nice.tools.typing.Types.isVoid(symbol.type)) throw error(symbol, "A variable cannot have a void type"); } Index: UserOperator.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/UserOperator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** UserOperator.java 2 Feb 2004 19:02:28 -0000 1.8 --- UserOperator.java 25 Feb 2004 11:23:28 -0000 1.9 *************** *** 60,64 **** mlsub.typing.Monotype[] paramTypes = getArgTypes(); for (int i = 0; i < symbols.length; i++) { ! if (Types.isVoid(paramTypes[i])) throw bossa.util.User.error(symbols[i].syntacticType, "A parameter cannot have a void type"); --- 60,64 ---- mlsub.typing.Monotype[] paramTypes = getArgTypes(); for (int i = 0; i < symbols.length; i++) { ! if (nice.tools.typing.Types.isVoid(paramTypes[i])) throw bossa.util.User.error(symbols[i].syntacticType, "A parameter cannot have a void type"); Index: TupleExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/TupleExp.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** TupleExp.java 11 Feb 2004 12:46:39 -0000 1.22 --- TupleExp.java 25 Feb 2004 11:23:28 -0000 1.23 *************** *** 77,81 **** void adjustToExpectedType(Monotype expectedType) { ! Monotype m = Types.equivalent(expectedType); // Get the expected component types --- 77,81 ---- void adjustToExpectedType(Monotype expectedType) { ! Monotype m = nice.tools.typing.Types.equivalent(expectedType); // Get the expected component types Index: PolySymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/PolySymbol.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PolySymbol.java 30 Aug 2003 10:57:32 -0000 1.17 --- PolySymbol.java 25 Feb 2004 11:23:28 -0000 1.18 *************** *** 14,18 **** import mlsub.typing.Polytype; ! import nice.tools.code.Types; import bossa.util.*; --- 14,18 ---- import mlsub.typing.Polytype; ! import nice.tools.typing.Types; import bossa.util.*; Index: Pattern.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** Pattern.java 22 Feb 2004 14:48:59 -0000 1.79 --- Pattern.java 25 Feb 2004 11:23:28 -0000 1.80 *************** *** 21,27 **** import mlsub.typing.Typing; import mlsub.typing.TypingEx; import gnu.expr.*; ! import nice.tools.code.*; /** --- 21,28 ---- import mlsub.typing.Typing; import mlsub.typing.TypingEx; + import nice.tools.typing.Types; import gnu.expr.*; ! import nice.tools.code.Gen; /** *************** *** 808,812 **** return Gen.referenceEqualsExp(atValue.compile(), parameter); ! gnu.bytecode.Type ct = Types.javaType(tc); if (exactlyAt) return Gen.isOfClass(parameter, ct); --- 809,813 ---- return Gen.referenceEqualsExp(atValue.compile(), parameter); ! gnu.bytecode.Type ct = nice.tools.code.Types.javaType(tc); if (exactlyAt) return Gen.isOfClass(parameter, ct); Index: OverloadedSymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/OverloadedSymbolExp.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** OverloadedSymbolExp.java 3 Feb 2004 10:20:48 -0000 1.66 --- OverloadedSymbolExp.java 25 Feb 2004 11:23:28 -0000 1.67 *************** *** 24,28 **** import mlsub.typing.Monotype; ! import nice.tools.code.Types; /** --- 24,28 ---- import mlsub.typing.Monotype; ! import nice.tools.typing.Types; /** *************** *** 201,205 **** VarSymbol res = (VarSymbol) symbols.get(0); // store the formal argument types for later use together with the type ! callExp.argTypes = nice.tools.code.Types.domain(res.getClonedType()); res.releaseClonedType(); --- 201,205 ---- VarSymbol res = (VarSymbol) symbols.get(0); // store the formal argument types for later use together with the type ! callExp.argTypes = nice.tools.typing.Types.parameters(res.getClonedType()); res.releaseClonedType(); *************** *** 261,265 **** return res; ! if (Types.domain(expectedType) != null) { // in case of function objects symbols find the most precise match List nonMin = removeNonMinimal(symbols); --- 261,265 ---- return res; ! if (Types.parameters(expectedType) != null) { // in case of function objects symbols find the most precise match List nonMin = removeNonMinimal(symbols); *************** *** 383,387 **** for(int s1 = 0; s1<len; s1++) { ! Domain d1 = domain(syms[s1].getType()); for(int s2 = 0; s2<len; s2++) --- 383,387 ---- for(int s1 = 0; s1<len; s1++) { ! Domain d1 = Types.domain(syms[s1].getType()); for(int s2 = 0; s2<len; s2++) *************** *** 398,402 **** if (s1 != s2 && !remove[s2]) { ! Domain d2 = domain(syms[s2].getType()); try{ --- 398,402 ---- if (s1 != s2 && !remove[s2]) { ! Domain d2 = Types.domain(syms[s2].getType()); try{ *************** *** 499,503 **** { // remove nullness marker ! Monotype[] m = Types.domain(t.getMonotype()); Monotype[] dom; --- 499,503 ---- { // remove nullness marker ! Monotype[] m = Types.parameters(t.getMonotype()); Monotype[] dom; *************** *** 523,534 **** } - private static Domain domain(Polytype t) - { - // remove nullness marker - Monotype[] m = Types.domain(t.getMonotype()); - - return new Domain(t.getConstraint(), new TupleType(m)); - } - void computeType() { --- 523,526 ---- Index: NiceClass.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceClass.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** NiceClass.java 22 Dec 2003 01:30:59 -0000 1.77 --- NiceClass.java 25 Feb 2004 11:23:29 -0000 1.78 *************** *** 159,163 **** sym.type = sym.syntacticType.resolve(typeScope); ! if (Types.isVoid(sym.type)) User.error(sym, "A field cannot have void type"); --- 159,163 ---- sym.type = sym.syntacticType.resolve(typeScope); ! if (nice.tools.typing.Types.isVoid(sym.type)) User.error(sym, "A field cannot have void type"); Index: NewArrayExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NewArrayExp.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NewArrayExp.java 11 Dec 2003 23:41:57 -0000 1.18 --- NewArrayExp.java 25 Feb 2004 11:23:29 -0000 1.19 *************** *** 18,22 **** import gnu.bytecode.*; ! import nice.tools.code.Types; import mlsub.typing.Monotype; --- 18,22 ---- import gnu.bytecode.*; ! import nice.tools.typing.Types; import mlsub.typing.Monotype; *************** *** 177,181 **** public gnu.expr.Expression compile() { ! Type t = Types.javaType(type); return new gnu.expr.ApplyExp --- 177,181 ---- public gnu.expr.Expression compile() { ! Type t = nice.tools.code.Types.javaType(type); return new gnu.expr.ApplyExp Index: Monotype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Monotype.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Monotype.java 28 May 2003 12:57:26 -0000 1.33 --- Monotype.java 25 Feb 2004 11:23:29 -0000 1.34 *************** *** 114,118 **** if (raw instanceof MonotypeVar) { ! nice.tools.code.Types.makeMarkedType((MonotypeVar) raw); return raw; } --- 114,118 ---- if (raw instanceof MonotypeVar) { ! nice.tools.typing.Types.makeMarkedType((MonotypeVar) raw); return raw; } Index: MonoSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MonoSymbol.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** MonoSymbol.java 30 Nov 2003 13:09:21 -0000 1.28 --- MonoSymbol.java 25 Feb 2004 11:23:29 -0000 1.29 *************** *** 15,19 **** import mlsub.typing.Polytype; import mlsub.typing.FunTypeKind; ! import nice.tools.code.Types; import bossa.util.*; --- 15,19 ---- import mlsub.typing.Polytype; import mlsub.typing.FunTypeKind; ! import nice.tools.typing.Types; import bossa.util.*; Index: MethodImplementation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodImplementation.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MethodImplementation.java 24 Nov 2003 23:56:25 -0000 1.3 --- MethodImplementation.java 25 Feb 2004 11:23:29 -0000 1.4 *************** *** 20,24 **** */ ! import nice.tools.code.Types; import nice.tools.code.Gen; import mlsub.typing.Typing; --- 20,24 ---- */ ! import nice.tools.typing.Types; import nice.tools.code.Gen; import mlsub.typing.Typing; Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** MethodDeclaration.java 22 Dec 2003 01:30:59 -0000 1.53 --- MethodDeclaration.java 25 Feb 2004 11:23:29 -0000 1.54 *************** *** 21,25 **** import mlsub.typing.Constraint; ! import nice.tools.code.Types; import gnu.bytecode.*; --- 21,25 ---- import mlsub.typing.Constraint; ! import nice.tools.typing.Types; import gnu.bytecode.*; *************** *** 427,436 **** public gnu.bytecode.Type javaReturnType() { ! return Types.javaType(getReturnType()); } public gnu.bytecode.Type[] javaArgTypes() { ! return Types.javaType(getType().domain()); } --- 427,436 ---- public gnu.bytecode.Type javaReturnType() { ! return nice.tools.code.Types.javaType(getReturnType()); } public gnu.bytecode.Type[] javaArgTypes() { ! return nice.tools.code.Types.javaType(getType().domain()); } Index: MethodContainer.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodContainer.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MethodContainer.java 27 Jan 2004 15:03:26 -0000 1.14 --- MethodContainer.java 25 Feb 2004 11:23:29 -0000 1.15 *************** *** 112,116 **** // The type parameters have nullness markers. for (int i = 0; i < typeParameters.length; i++) ! nice.tools.code.Types.makeMarkedType(typeParameters[i]); } --- 112,116 ---- // The type parameters have nullness markers. for (int i = 0; i < typeParameters.length; i++) ! nice.tools.typing.Types.makeMarkedType(typeParameters[i]); } Index: MethodBodyDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** MethodBodyDefinition.java 15 Dec 2003 14:04:13 -0000 1.147 --- MethodBodyDefinition.java 25 Feb 2004 11:23:29 -0000 1.148 *************** *** 21,25 **** import bossa.util.Debug; import bossa.util.Location; ! import nice.tools.code.Types; import nice.tools.code.Gen; --- 21,25 ---- import bossa.util.Debug; import bossa.util.Location; ! import nice.tools.typing.Types; import nice.tools.code.Gen; *************** *** 91,95 **** // it was equivalent to the declaration type and has been erased, // so we return the information in the declaration. ! return nice.tools.code.Types.equivalent(declaration.getArgTypes()[0]). head(); } --- 91,95 ---- // it was equivalent to the declaration type and has been erased, // so we return the information in the declaration. ! return Types.equivalent(declaration.getArgTypes()[0]). head(); } *************** *** 452,456 **** try { ! Types.setBytecodeType(monotypes); Typing.implies(); --- 452,456 ---- try { ! nice.tools.code.Types.setBytecodeType(monotypes); Typing.implies(); *************** *** 503,510 **** for(int n = 0; n < parameters.length; n++) res[n] = formals[n].atNull() ? ! Types.javaType(PrimitiveType.nullTC) : formals[n].tc == bossa.syntax.PrimitiveType.arrayTC ? nice.tools.code.SpecialArray.unknownTypeArray() : ! Types.javaType(parameters[n].getMonotype()); return res; --- 503,510 ---- for(int n = 0; n < parameters.length; n++) res[n] = formals[n].atNull() ? ! nice.tools.code.Types.javaType(PrimitiveType.nullTC) : formals[n].tc == bossa.syntax.PrimitiveType.arrayTC ? nice.tools.code.SpecialArray.unknownTypeArray() : ! nice.tools.code.Types.javaType(parameters[n].getMonotype()); return res; Index: LiteralArrayExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/LiteralArrayExp.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** LiteralArrayExp.java 11 Feb 2004 16:06:05 -0000 1.18 --- LiteralArrayExp.java 25 Feb 2004 11:23:29 -0000 1.19 *************** *** 22,26 **** import mlsub.typing.Polytype; import mlsub.typing.TypeConstructor; ! import nice.tools.code.Types; /** --- 22,26 ---- import mlsub.typing.Polytype; import mlsub.typing.TypeConstructor; ! import nice.tools.typing.Types; /** *************** *** 115,119 **** { gnu.expr.Expression[] args = Expression.compile(elements); ! ArrayType t = nice.tools.code.SpecialTypes.array(Types.lowestUpperBound(args)); return new gnu.expr.ApplyExp --- 115,120 ---- { gnu.expr.Expression[] args = Expression.compile(elements); ! ArrayType t = nice.tools.code.SpecialTypes.array ! (nice.tools.code.Types.lowestUpperBound(args)); return new gnu.expr.ApplyExp Index: FunSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/FunSymbol.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FunSymbol.java 17 Jul 2003 11:01:03 -0000 1.9 --- FunSymbol.java 25 Feb 2004 11:23:29 -0000 1.10 *************** *** 14,18 **** import java.util.*; ! import nice.tools.code.Types; class FunSymbol extends PolySymbol --- 14,18 ---- import java.util.*; ! import nice.tools.typing.Types; class FunSymbol extends PolySymbol Index: FunExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/FunExp.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** FunExp.java 25 Nov 2003 10:41:10 -0000 1.44 --- FunExp.java 25 Feb 2004 11:23:29 -0000 1.45 *************** *** 91,95 **** else if (! alwaysReturns && ! ! nice.tools.code.Types.isVoid(inferredReturnType)) throw User.error(this, "Missing return statement"); --- 91,95 ---- else if (! alwaysReturns && ! ! nice.tools.typing.Types.isVoid(inferredReturnType)) throw User.error(this, "Missing return statement"); Index: DefaultMethodImplementation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/DefaultMethodImplementation.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DefaultMethodImplementation.java 28 Nov 2003 15:17:35 -0000 1.4 --- DefaultMethodImplementation.java 25 Feb 2004 11:23:29 -0000 1.5 *************** *** 55,59 **** final mlsub.typing.TypeConstructor firstArgument() { ! return nice.tools.code.Types.equivalent(declaration.getArgTypes()[0]).head(); } --- 55,59 ---- final mlsub.typing.TypeConstructor firstArgument() { ! return nice.tools.typing.Types.equivalent(declaration.getArgTypes()[0]).head(); } Index: Contract.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Contract.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Contract.java 21 Dec 2003 15:07:48 -0000 1.7 --- Contract.java 25 Feb 2004 11:23:29 -0000 1.8 *************** *** 78,82 **** } ! if (! nice.tools.code.Types.isVoid(resultType)) result = new MonoSymbol(new LocatedString("result", location), resultType) { --- 78,82 ---- } ! if (! nice.tools.typing.Types.isVoid(resultType)) result = new MonoSymbol(new LocatedString("result", location), resultType) { Index: CallExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/CallExp.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** CallExp.java 11 Feb 2004 12:46:39 -0000 1.90 --- CallExp.java 25 Feb 2004 11:23:29 -0000 1.91 *************** *** 17,21 **** import bossa.util.*; import bossa.util.Debug; ! import nice.tools.code.*; import mlsub.typing.*; --- 17,21 ---- import bossa.util.*; import bossa.util.Debug; ! import nice.tools.typing.Types; import mlsub.typing.*; *************** *** 26,29 **** --- 26,31 ---- import mlsub.typing.Constraint; + import nice.tools.code.EnsureTypeProc; + /** A function call. *************** *** 255,259 **** // Important for litteral arrays and tuples. Expression.adjustToExpectedType(arguments.computedExpressions, ! Types.domain(function.getType())); } --- 257,261 ---- // Important for litteral arrays and tuples. Expression.adjustToExpectedType(arguments.computedExpressions, ! Types.parameters(function.getType())); } *************** *** 358,362 **** } ! return EnsureTypeProc.ensure(res, Types.javaType(type)); } --- 360,364 ---- } ! return EnsureTypeProc.ensure(res, nice.tools.code.Types.javaType(type)); } *************** *** 374,378 **** for (int i = 0; i < params.length; i++) params[i] = EnsureTypeProc.ensure ! (params[i], Types.javaType(domain[i])); return params; --- 376,380 ---- for (int i = 0; i < params.length; i++) params[i] = EnsureTypeProc.ensure ! (params[i], nice.tools.code.Types.javaType(domain[i])); return params; Index: Block.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Block.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Block.java 8 Oct 2003 21:51:43 -0000 1.65 --- Block.java 25 Feb 2004 11:23:29 -0000 1.66 *************** *** 13,17 **** package bossa.syntax; ! import nice.tools.code.Types; import bossa.util.*; --- 13,17 ---- package bossa.syntax; ! import nice.tools.typing.Types; import bossa.util.*; *************** *** 162,166 **** String getName() { return left.name.toString(); } VarSymbol getSymbol() { return left; } ! gnu.bytecode.Type getBytecodeType() { return Types.javaType(left.type); } gnu.expr.Expression initValue() --- 162,167 ---- String getName() { return left.name.toString(); } VarSymbol getSymbol() { return left; } ! gnu.bytecode.Type getBytecodeType() ! { return nice.tools.code.Types.javaType(left.type); } gnu.expr.Expression initValue() *************** *** 224,228 **** String getName() { return left.name.toString(); } VarSymbol getSymbol() { return left; } ! gnu.bytecode.Type getBytecodeType() { return Types.javaType(left.type); } MonoSymbol left; --- 225,230 ---- String getName() { return left.name.toString(); } VarSymbol getSymbol() { return left; } ! gnu.bytecode.Type getBytecodeType() ! { return nice.tools.code.Types.javaType(left.type); } MonoSymbol left; *************** *** 269,273 **** String getName() { return left.name.toString(); } VarSymbol getSymbol() { return left; } ! gnu.bytecode.Type getBytecodeType() { return Types.javaType(left.type); } mlsub.typing.Polytype inferredReturnType() --- 271,276 ---- String getName() { return left.name.toString(); } VarSymbol getSymbol() { return left; } ! gnu.bytecode.Type getBytecodeType() ! { return nice.tools.code.Types.javaType(left.type); } mlsub.typing.Polytype inferredReturnType() *************** *** 278,282 **** mlsub.typing.Monotype declaredReturnType() { ! return Types.codomain(left.getType()); } --- 281,285 ---- mlsub.typing.Monotype declaredReturnType() { ! return Types.result(left.getType()); } |