[Nice-commit] Nice/src/bossa/syntax primitive.nice,NONE,1.1 AtomicConstraint.java,1.13,1.14 Constant
Brought to you by:
bonniot
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4921/F:/nice/src/bossa/syntax Modified Files: AtomicConstraint.java ConstantExp.java Constructor.java CustomConstructor.java Monotype.java Pattern.java analyse.nice call.nice constant.nice enum.nice funexp.nice literalarray.nice methodbody.nice newarray.nice pattern.nice return.nice statementexp.nice tools.nice try.nice typecheck.nice typedef.nice Added Files: primitive.nice Removed Files: PrimitiveType.java Log Message: Moved the static part of PrimitiveType to nice.tools.typing and converted the rest. Index: Pattern.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** Pattern.java 25 Nov 2004 19:28:18 -0000 1.94 --- Pattern.java 1 Dec 2004 02:00:31 -0000 1.95 *************** *** 23,26 **** --- 23,27 ---- import mlsub.typing.TypingEx; import nice.tools.typing.Types; + import nice.tools.typing.PrimitiveType; //import gnu.expr.*; Index: CustomConstructor.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/CustomConstructor.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** CustomConstructor.java 21 Nov 2004 23:24:36 -0000 1.24 --- CustomConstructor.java 1 Dec 2004 02:00:31 -0000 1.25 *************** *** 23,26 **** --- 23,27 ---- import gnu.bytecode.MiscAttr; import nice.tools.code.Gen; + import nice.tools.typing.PrimitiveType; /** Index: literalarray.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/literalarray.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** literalarray.nice 21 Nov 2004 18:33:17 -0000 1.3 --- literalarray.nice 1 Dec 2004 02:00:32 -0000 1.4 *************** *** 36,40 **** // Object[]. if (! notNull(type).trySimplify()) ! type = this.array(PrimitiveType.objectPolytype()); } --- 36,40 ---- // Object[]. if (! notNull(type).trySimplify()) ! type = this.array(nice.tools.typing.PrimitiveType.objectPolytype()); } *************** *** 44,48 **** (elementType.getConstraint(), bossa.syntax.Monotype.sure(new mlsub.typing.MonotypeConstructor ! (PrimitiveType.arrayTC, [elementType.getMonotype()]))); res.setNotSimplified(); return res; --- 44,48 ---- (elementType.getConstraint(), bossa.syntax.Monotype.sure(new mlsub.typing.MonotypeConstructor ! (nice.tools.typing.PrimitiveType.arrayTC, [elementType.getMonotype()]))); res.setNotSimplified(); return res; *************** *** 102,108 **** // since the bytecode type of both List<List<T>> and List<T[]> is // simply List. ! if (tc != PrimitiveType.arrayTC && tc != null && tc.isRigid() && ! mlsub.typing.Typing.testRigidLeq(tc, PrimitiveType.collectionTC)) { wrapAsCollection = true; --- 102,108 ---- // since the bytecode type of both List<List<T>> and List<T[]> is // simply List. ! if (tc != nice.tools.typing.PrimitiveType.arrayTC && tc != null && tc.isRigid() && ! mlsub.typing.Typing.testRigidLeq(tc, nice.tools.typing.PrimitiveType.collectionTC)) { wrapAsCollection = true; Index: funexp.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/funexp.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** funexp.nice 28 Jul 2004 20:48:28 -0000 1.2 --- funexp.nice 1 Dec 2004 02:00:32 -0000 1.3 *************** *** 71,75 **** _inferredReturnType = mlsub.typing.Polytype.bottom(); else ! _inferredReturnType = PrimitiveType.voidPolytype; } else --- 71,75 ---- _inferredReturnType = mlsub.typing.Polytype.bottom(); else ! _inferredReturnType = nice.tools.typing.PrimitiveType.voidPolytype; } else Index: return.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/return.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** return.nice 13 Aug 2004 21:04:41 -0000 1.3 --- return.nice 1 Dec 2004 02:00:32 -0000 1.4 *************** *** 45,49 **** mlsub.typing.Polytype returnType() { ! return PrimitiveType.voidPolytype; } --- 45,49 ---- mlsub.typing.Polytype returnType() { ! return nice.tools.typing.PrimitiveType.voidPolytype; } Index: enum.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/enum.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** enum.nice 27 Nov 2004 16:52:52 -0000 1.5 --- enum.nice 1 Dec 2004 02:00:32 -0000 1.6 *************** *** 178,182 **** args.add(new Arguments.Argument(createStringConstantExp(name.toString()), new LocatedString("name",name.location))); ! args.add(new Arguments.Argument(new ConstantExp(PrimitiveType.intTC, ordinal, ordinal.toString(), name.location()), new LocatedString("ordinal", name.location))); --- 178,182 ---- args.add(new Arguments.Argument(createStringConstantExp(name.toString()), new LocatedString("name",name.location))); ! args.add(new Arguments.Argument(new ConstantExp(nice.tools.typing.PrimitiveType.intTC, ordinal, ordinal.toString(), name.location()), new LocatedString("ordinal", name.location))); Index: Constructor.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Constructor.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Constructor.java 21 Nov 2004 23:24:36 -0000 1.16 --- Constructor.java 1 Dec 2004 02:00:31 -0000 1.17 *************** *** 18,21 **** --- 18,22 ---- import mlsub.typing.Constraint; import mlsub.typing.Monotype; + import nice.tools.typing.PrimitiveType; /** Index: AtomicConstraint.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/AtomicConstraint.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AtomicConstraint.java 16 Jun 2004 14:56:14 -0000 1.13 --- AtomicConstraint.java 1 Dec 2004 02:00:30 -0000 1.14 *************** *** 15,18 **** --- 15,19 ---- import bossa.util.*; import java.util.*; + import nice.tools.typing.PrimitiveType; /** Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** typecheck.nice 13 Oct 2004 23:22:22 -0000 1.117 --- typecheck.nice 1 Dec 2004 02:00:32 -0000 1.118 *************** *** 520,524 **** Expression elseExp = e.elseExp; ! condition = condition.resolveOverloading(PrimitiveType.boolPolytype); checkBooleanCondition(condition); e.condition = condition; --- 520,524 ---- Expression elseExp = e.elseExp; ! condition = condition.resolveOverloading(nice.tools.typing.PrimitiveType.boolPolytype); checkBooleanCondition(condition); e.condition = condition; *************** *** 618,623 **** { try{ ! e.variable = e.variable.resolveOverloading(PrimitiveType.longPolytype); ! checkAssignment(PrimitiveType.longType, e.variable); } catch(TypingEx t){ --- 618,623 ---- { try{ ! e.variable = e.variable.resolveOverloading(nice.tools.typing.PrimitiveType.longPolytype); ! checkAssignment(nice.tools.typing.PrimitiveType.longType, e.variable); } catch(TypingEx t){ *************** *** 642,648 **** { Expression dim = knownDimensions[i] = ! knownDimensions[i].resolveOverloading(PrimitiveType.intPolytype); try{ ! checkAssignment(PrimitiveType.intType, dim); } catch(TypingEx ex){ --- 642,648 ---- { Expression dim = knownDimensions[i] = ! knownDimensions[i].resolveOverloading(nice.tools.typing.PrimitiveType.intPolytype); try{ ! checkAssignment(nice.tools.typing.PrimitiveType.intType, dim); } catch(TypingEx ex){ *************** *** 771,777 **** decl.value = value = value.noOverloading(); target.type = ensureMonomorphic(value.getType(), decl); ! if (target.type == PrimitiveType.byteType || ! target.type == PrimitiveType.shortType) ! target.type = PrimitiveType.intType; if (nice.tools.typing.Types.isVoid(target.type)) --- 771,777 ---- decl.value = value = value.noOverloading(); target.type = ensureMonomorphic(value.getType(), decl); ! if (target.type == nice.tools.typing.PrimitiveType.byteType || ! target.type == nice.tools.typing.PrimitiveType.shortType) ! target.type = nice.tools.typing.PrimitiveType.intType; if (nice.tools.typing.Types.isVoid(target.type)) *************** *** 838,842 **** if (whileExp != null) { ! l.whileExp = whileExp = whileExp.resolveOverloading(PrimitiveType.boolPolytype); checkBooleanCondition(whileExp); } --- 838,842 ---- if (whileExp != null) { ! l.whileExp = whileExp = whileExp.resolveOverloading(nice.tools.typing.PrimitiveType.boolPolytype); checkBooleanCondition(whileExp); } *************** *** 1005,1010 **** if (tc1 == tc2) return false; ! if (tc1 == PrimitiveType.maybeTC && ! (tc2 != PrimitiveType.maybeTC || tc2 != null)) return true; --- 1005,1010 ---- if (tc1 == tc2) return false; ! if (tc1 == nice.tools.typing.PrimitiveType.maybeTC && ! (tc2 != nice.tools.typing.PrimitiveType.maybeTC || tc2 != null)) return true; *************** *** 1026,1030 **** void checkBooleanCondition(Expression condition) { try { ! checkAssignment(PrimitiveType.boolType, condition); } catch(TypingEx t){ --- 1026,1030 ---- void checkBooleanCondition(Expression condition) { try { ! checkAssignment(nice.tools.typing.PrimitiveType.boolType, condition); } catch(TypingEx t){ *************** *** 1054,1063 **** { if (type.isMonomorphic()) ! Typing.leq(type.getMonotype(), PrimitiveType.sureTC); else try { Typing.enter(); notNull(type.getConstraint()).enter(); ! Typing.leq(type.getMonotype(), PrimitiveType.sureTC); Typing.implies(); } --- 1054,1063 ---- { if (type.isMonomorphic()) ! Typing.leq(type.getMonotype(), nice.tools.typing.PrimitiveType.sureTC); else try { Typing.enter(); notNull(type.getConstraint()).enter(); ! Typing.leq(type.getMonotype(), nice.tools.typing.PrimitiveType.sureTC); Typing.implies(); } Index: statementexp.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/statementexp.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** statementexp.nice 3 Sep 2004 18:07:27 -0000 1.3 --- statementexp.nice 1 Dec 2004 02:00:32 -0000 1.4 *************** *** 32,36 **** computeType() { ! type = PrimitiveType.voidPolytype; } --- 32,36 ---- computeType() { ! type = nice.tools.typing.PrimitiveType.voidPolytype; } Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** tools.nice 28 Nov 2004 01:00:47 -0000 1.66 --- tools.nice 1 Dec 2004 02:00:32 -0000 1.67 *************** *** 108,112 **** return null; ! if (tc == PrimitiveType.arrayTC) return (sym, notNull(arg2.representedType)); --- 108,112 ---- return null; ! if (tc == nice.tools.typing.PrimitiveType.arrayTC) return (sym, notNull(arg2.representedType)); *************** *** 248,257 **** // Retypings needed since java types are not strict. ! mlsub.typing.Polytype boolPolytype() = native PrimitiveType.boolPolytype; ! mlsub.typing.Polytype longPolytype() = native PrimitiveType.longPolytype; ! mlsub.typing.Polytype voidPolytype() = native PrimitiveType.voidPolytype; ! mlsub.typing.Monotype boolType() = native PrimitiveType.boolType; ! mlsub.typing.Monotype intType() = native PrimitiveType.intType; ! mlsub.typing.Monotype longType() = native PrimitiveType.longType; gnu.expr.QuoteExp trueExp() = native gnu.expr.QuoteExp.trueExp; gnu.expr.QuoteExp voidExp() = native gnu.expr.QuoteExp.voidExp; --- 248,257 ---- // Retypings needed since java types are not strict. ! mlsub.typing.Polytype boolPolytype() = native nice.tools.typing.PrimitiveType.boolPolytype; ! mlsub.typing.Polytype longPolytype() = native nice.tools.typing.PrimitiveType.longPolytype; ! mlsub.typing.Polytype voidPolytype() = native nice.tools.typing.PrimitiveType.voidPolytype; ! mlsub.typing.Monotype boolType() = native nice.tools.typing.PrimitiveType.boolType; ! mlsub.typing.Monotype intType() = native nice.tools.typing.PrimitiveType.intType; ! mlsub.typing.Monotype longType() = native nice.tools.typing.PrimitiveType.longType; gnu.expr.QuoteExp trueExp() = native gnu.expr.QuoteExp.trueExp; gnu.expr.QuoteExp voidExp() = native gnu.expr.QuoteExp.voidExp; Index: typedef.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typedef.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** typedef.nice 28 Nov 2004 01:00:47 -0000 1.2 --- typedef.nice 1 Dec 2004 02:00:32 -0000 1.3 *************** *** 125,129 **** tc = new mlsub.typing.TypeConstructor ("null", mlsub.typing.NullnessKind.instance, this.isConcrete(), true); ! PrimitiveType.registerPrimType(name, tc); } else --- 125,129 ---- tc = new mlsub.typing.TypeConstructor ("null", mlsub.typing.NullnessKind.instance, this.isConcrete(), true); ! nice.tools.typing.PrimitiveType.register(name, tc); } else *************** *** 131,139 **** tc = new mlsub.typing.TypeConstructor(name, variance, this.isConcrete(), true); if (name.equals("nice.lang.Throwable")) ! PrimitiveType.throwableTC = tc; else if (name.equals("nice.lang.Collection")) ! PrimitiveType.collectionTC = tc; else if (name.equals("nice.lang.Class")) ! PrimitiveType.classTC = tc; } --- 131,139 ---- tc = new mlsub.typing.TypeConstructor(name, variance, this.isConcrete(), true); if (name.equals("nice.lang.Throwable")) ! nice.tools.typing.PrimitiveType.throwableTC = tc; else if (name.equals("nice.lang.Collection")) ! nice.tools.typing.PrimitiveType.collectionTC = tc; else if (name.equals("nice.lang.Class")) ! nice.tools.typing.PrimitiveType.classTC = tc; } *************** *** 508,513 **** d.resolve(); ! if (d.getImplementation() instanceof PrimitiveType && ! !(this.getImplementation() instanceof PrimitiveType)) User.error(this, "A class can't extends a primitive"); } --- 508,513 ---- d.resolve(); ! if (d.getImplementation() instanceof PrimitiveTypeImplementation && ! !(this.getImplementation() instanceof PrimitiveTypeImplementation)) User.error(this, "A class can't extends a primitive"); } Index: methodbody.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/methodbody.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** methodbody.nice 27 Nov 2004 16:52:52 -0000 1.1 --- methodbody.nice 1 Dec 2004 02:00:32 -0000 1.2 *************** *** 452,457 **** for(int n = 0; n < notNull(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(notNull(parameters)[n].getMonotype()); --- 452,457 ---- for(int n = 0; n < notNull(parameters).length; n++) res[n] = formals[n].atNull() ? ! nice.tools.code.Types.javaType(nice.tools.typing.PrimitiveType.nullTC) : ! formals[n].tc == nice.tools.typing.PrimitiveType.arrayTC ? nice.tools.code.SpecialArray.unknownTypeArray() : nice.tools.code.Types.javaType(notNull(parameters)[n].getMonotype()); Index: Monotype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Monotype.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Monotype.java 30 Jul 2004 19:08:45 -0000 1.36 --- Monotype.java 1 Dec 2004 02:00:31 -0000 1.37 *************** *** 17,20 **** --- 17,21 ---- import mlsub.typing.MonotypeVar; + import nice.tools.typing.PrimitiveType; /** Index: try.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/try.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** try.nice 28 Jul 2004 14:40:33 -0000 1.1 --- try.nice 1 Dec 2004 02:00:32 -0000 1.2 *************** *** 83,87 **** { try { ! mlsub.typing.Typing.leq(t, PrimitiveType.throwableTC); } catch (mlsub.typing.TypingEx e) { --- 83,87 ---- { try { ! mlsub.typing.Typing.leq(t, nice.tools.typing.PrimitiveType.throwableTC); } catch (mlsub.typing.TypingEx e) { Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** analyse.nice 14 Oct 2004 09:37:27 -0000 1.114 --- analyse.nice 1 Dec 2004 02:00:31 -0000 1.115 *************** *** 642,646 **** let type = new mlsub.typing.MonotypeConstructor ! (PrimitiveType.arrayTC, [res.getMonotype()]); return new mlsub.typing.Polytype --- 642,646 ---- let type = new mlsub.typing.MonotypeConstructor ! (nice.tools.typing.PrimitiveType.arrayTC, [res.getMonotype()]); return new mlsub.typing.Polytype *************** *** 654,658 **** { if (name.equals("Object") || name.equals("java.lang.Object")) ! return PrimitiveType.objectPolytype(); if (info.typeVars[name] instanceof MonotypeVar) --- 654,658 ---- { if (name.equals("Object") || name.equals("java.lang.Object")) ! return nice.tools.typing.PrimitiveType.objectPolytype(); if (info.typeVars[name] instanceof MonotypeVar) --- NEW FILE: primitive.nice --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2004 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package bossa.syntax; import bossa.util.*; /** A primitive type. */ public class PrimitiveTypeImplementation extends ClassImplementation { resolveClass() {} printInterface(s) { s.print(" = native ;\n"); } } PrimitiveTypeImplementation createPrimitiveType(TypeDefinition definition) { ?gnu.bytecode.Type t = nice.tools.typing.PrimitiveType.register(definition.name.toString(), definition.getTC()); if (t == null) User.error(definition, definition.name + " is not a known primitive type"); definition.setJavaType(t); return new PrimitiveTypeImplementation(); } Index: pattern.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/pattern.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pattern.nice 21 Nov 2004 18:33:17 -0000 1.9 --- pattern.nice 1 Dec 2004 02:00:32 -0000 1.10 *************** *** 23,27 **** { if (ti.toString().equals("Object")) ! return new NotNullPattern(name, PrimitiveType.sureTC, name.location); return new TypePattern(name, ti, null, name.location(), exactlyAt: false); --- 23,27 ---- { if (ti.toString().equals("Object")) ! return new NotNullPattern(name, nice.tools.typing.PrimitiveType.sureTC, name.location); return new TypePattern(name, ti, null, name.location(), exactlyAt: false); *************** *** 37,41 **** if (sure && tc == null) ! return new NotNullPattern(name, PrimitiveType.sureTC, loc); if (tc == null) --- 37,41 ---- if (sure && tc == null) ! return new NotNullPattern(name, nice.tools.typing.PrimitiveType.sureTC, loc); if (tc == null) *************** *** 48,52 **** { if (ti.toString().equals("Object")) ! return new NotNullPattern(name, PrimitiveType.sureTC, ti.location); return new TypePattern(name, ti, additional, ti.location(), exactlyAt: exactly, runtimeTC: runtimeTC); --- 48,52 ---- { if (ti.toString().equals("Object")) ! return new NotNullPattern(name, nice.tools.typing.PrimitiveType.sureTC, ti.location); return new TypePattern(name, ti, additional, ti.location(), exactlyAt: exactly, runtimeTC: runtimeTC); *************** *** 67,74 **** additional, value.location(), atValue: value); ! if (value.tc == PrimitiveType.boolTC) return new BoolPattern(value.tc, additional, value.location(), atValue: value); ! if (value.tc == PrimitiveType.charTC) return new CharPattern(value.tc, additional, value.location(), atValue: value); --- 67,74 ---- additional, value.location(), atValue: value); ! if (value.tc == nice.tools.typing.PrimitiveType.boolTC) return new BoolPattern(value.tc, additional, value.location(), atValue: value); ! if (value.tc == nice.tools.typing.PrimitiveType.charTC) return new CharPattern(value.tc, additional, value.location(), atValue: value); *************** *** 125,129 **** // don't allow integer primitive types in @type and #type patterns ! if (!equal && Typing.testRigidLeq(tc, PrimitiveType.longTC)) User.error(this.location, "A pattern cannot have a primitive type that is different from the declaration."); --- 125,129 ---- // don't allow integer primitive types in @type and #type patterns ! if (!equal && Typing.testRigidLeq(tc, nice.tools.typing.PrimitiveType.longTC)) User.error(this.location, "A pattern cannot have a primitive type that is different from the declaration."); *************** *** 167,171 **** { if (domaintc != null) ! if ( Typing.testRigidLeq(domaintc, PrimitiveType.charTC)) return; --- 167,171 ---- { if (domaintc != null) ! if ( Typing.testRigidLeq(domaintc, nice.tools.typing.PrimitiveType.charTC)) return; *************** *** 180,191 **** if (domaintc != null) { ! if (Typing.testRigidLeq(domaintc, PrimitiveType.intTC)) { ! tc = PrimitiveType.intTC; return; } ! else if (Typing.testRigidLeq(domaintc, PrimitiveType.longTC)) { ! tc = PrimitiveType.longTC; return; } --- 180,191 ---- if (domaintc != null) { ! if (Typing.testRigidLeq(domaintc, nice.tools.typing.PrimitiveType.intTC)) { ! tc = nice.tools.typing.PrimitiveType.intTC; return; } ! else if (Typing.testRigidLeq(domaintc, nice.tools.typing.PrimitiveType.longTC)) { ! tc = nice.tools.typing.PrimitiveType.longTC; return; } *************** *** 253,258 **** matches(VariablePattern p, tag) = true; ! matches(NullPattern p, tag) = tag == PrimitiveType.nullTC; ! matches(NotNullPattern p, tag) = tag != PrimitiveType.nullTC; matches(TypePattern p, tag) { --- 253,258 ---- matches(VariablePattern p, tag) = true; ! matches(NullPattern p, tag) = tag == nice.tools.typing.PrimitiveType.nullTC; ! matches(NotNullPattern p, tag) = tag != nice.tools.typing.PrimitiveType.nullTC; matches(TypePattern p, tag) { *************** *** 266,271 **** } matches(ValuePattern p, tag) = false; ! matches(BoolPattern p, tag) = tag == PrimitiveType.boolTC; ! matches(IntComparePattern p, tag) = tag != null && mlsub.typing.Typing.testRigidLeq(tag, PrimitiveType.longTC); matches(EnumPattern p, tag) = (tag != null) && mlsub.typing.Typing.testRigidLeq(tag, p.tc); --- 266,271 ---- } matches(ValuePattern p, tag) = false; ! matches(BoolPattern p, tag) = tag == nice.tools.typing.PrimitiveType.boolTC; ! matches(IntComparePattern p, tag) = tag != null && mlsub.typing.Typing.testRigidLeq(tag, nice.tools.typing.PrimitiveType.longTC); matches(EnumPattern p, tag) = (tag != null) && mlsub.typing.Typing.testRigidLeq(tag, p.tc); *************** *** 488,492 **** { ConstantExp val = cast(symbol.getValue()); ! if (Typing.testRigidLeq(val.tc, PrimitiveType.longTC)) return createPattern(pattern.kind.prefix, pattern.name, val, null, pattern.location); } --- 488,492 ---- { ConstantExp val = cast(symbol.getValue()); ! if (Typing.testRigidLeq(val.tc, nice.tools.typing.PrimitiveType.longTC)) return createPattern(pattern.kind.prefix, pattern.name, val, null, pattern.location); } *************** *** 524,528 **** ConstantExp val = cast(symbol.getValue()); ! if (val.tc == PrimitiveType.floatTC) return pattern; --- 524,528 ---- ConstantExp val = cast(symbol.getValue()); ! if (val.tc == nice.tools.typing.PrimitiveType.floatTC) return pattern; *************** *** 598,602 **** { if (name[0] == '\'') ! return createPattern(new ConstantExp(PrimitiveType.charTC, new Character(name[1]), name, loc)); --- 598,602 ---- { if (name[0] == '\'') ! return createPattern(new ConstantExp(nice.tools.typing.PrimitiveType.charTC, new Character(name[1]), name, loc)); *************** *** 626,630 **** if (name.equals("NONNULL")) ! return new NotNullPattern(null, PrimitiveType.sureTC, loc); if (name.equals("NULL")) --- 626,630 ---- if (name.equals("NONNULL")) ! return new NotNullPattern(null, nice.tools.typing.PrimitiveType.sureTC, loc); if (name.equals("NULL")) Index: constant.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/constant.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** constant.nice 13 Oct 2004 23:22:22 -0000 1.2 --- constant.nice 1 Dec 2004 02:00:32 -0000 1.3 *************** *** 182,186 **** (type.getConstraint(), Monotype.sure(new mlsub.typing.MonotypeConstructor ! (PrimitiveType.classTC, [type.getMonotype()]))); } --- 182,186 ---- (type.getConstraint(), Monotype.sure(new mlsub.typing.MonotypeConstructor ! (nice.tools.typing.PrimitiveType.classTC, [type.getMonotype()]))); } --- PrimitiveType.java DELETED --- Index: call.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/call.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** call.nice 13 Oct 2004 23:22:22 -0000 1.4 --- call.nice 1 Dec 2004 02:00:32 -0000 1.5 *************** *** 350,354 **** try{ ! mlsub.typing.Typing.leq(m.head(), PrimitiveType.sureTC); } catch(TypingEx ex) { --- 350,354 ---- try{ ! mlsub.typing.Typing.leq(m.head(), nice.tools.typing.PrimitiveType.sureTC); } catch(TypingEx ex) { Index: newarray.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/newarray.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** newarray.nice 28 Jul 2004 14:40:33 -0000 1.1 --- newarray.nice 1 Dec 2004 02:00:32 -0000 1.2 *************** *** 49,53 **** { nullVars = fill(new TypeConstructor[unknownDimensions + 1], int i => ! new TypeConstructor("n" + i, notNull(PrimitiveType.maybeTC).variance, false, false)); } --- 49,53 ---- { nullVars = fill(new TypeConstructor[unknownDimensions + 1], int i => ! new TypeConstructor("n" + i, notNull(nice.tools.typing.PrimitiveType.maybeTC).variance, false, false)); } *************** *** 114,118 **** { monotype = new mlsub.typing.MonotypeConstructor ! (PrimitiveType.arrayTC, [monotype]); if (nullVars != null) monotype = mlsub.typing.MonotypeConstructor.apply(nullVars[i], monotype); --- 114,118 ---- { monotype = new mlsub.typing.MonotypeConstructor ! (nice.tools.typing.PrimitiveType.arrayTC, [monotype]); if (nullVars != null) monotype = mlsub.typing.MonotypeConstructor.apply(nullVars[i], monotype); *************** *** 125,129 **** for (int i = 0; i < knownDimensions.length; i++) monotype = bossa.syntax.Monotype.sure ! (mlsub.typing.MonotypeConstructor.apply(PrimitiveType.arrayTC, monotype)); // set the Expression type --- 125,129 ---- for (int i = 0; i < knownDimensions.length; i++) monotype = bossa.syntax.Monotype.sure ! (mlsub.typing.MonotypeConstructor.apply(nice.tools.typing.PrimitiveType.arrayTC, monotype)); // set the Expression type Index: ConstantExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ConstantExp.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** ConstantExp.java 2 Sep 2004 18:23:25 -0000 1.53 --- ConstantExp.java 1 Dec 2004 02:00:31 -0000 1.54 *************** *** 17,20 **** --- 17,21 ---- import mlsub.typing.Polytype; import gnu.expr.QuoteExp; + import nice.tools.typing.PrimitiveType; import bossa.util.*; |