[Nice-commit] Nice/src/bossa/syntax Module.java,1.22,1.23 compilation.nice,1.4,1.5 constructor.nice,
Brought to you by:
bonniot
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3346/F:/nice/src/bossa/syntax Modified Files: Module.java compilation.nice constructor.nice customConstructor.nice dispatch.java.bootstrap dispatchTest.nice importedconstructor.nice methodImplementation.nice niceMethod.nice niceclass.nice nicefield.nice super.nice tools.nice typedef.nice Removed Files: ClassImplementation.java NiceClass.java Log Message: Converted the last piece of NiceClass. Index: customConstructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/customConstructor.nice,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** customConstructor.nice 13 Jan 2005 14:06:15 -0000 1.16 --- customConstructor.nice 14 Jan 2005 11:12:10 -0000 1.17 *************** *** 23,27 **** Statement body; ! ?CNiceClass classe = null; private ?VarScope thisScope = null; private ?TypeScope thisTypeScope = null; --- 23,27 ---- Statement body; ! ?NiceClass classe = null; private ?VarScope thisScope = null; private ?TypeScope thisTypeScope = null; --- ClassImplementation.java DELETED --- Index: dispatchTest.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/dispatchTest.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dispatchTest.nice 4 Jan 2005 21:20:39 -0000 1.5 --- dispatchTest.nice 14 Jan 2005 11:12:10 -0000 1.6 *************** *** 243,247 **** return null; ! let CNiceClass nc = cast(def.getImplementation()); return nc.getClassExp().getClassType(); } --- 243,247 ---- return null; ! let NiceClass nc = cast(def.getImplementation()); return nc.getClassExp().getClassType(); } Index: nicefield.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/nicefield.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** nicefield.nice 3 Jan 2005 01:24:28 -0000 1.4 --- nicefield.nice 14 Jan 2005 11:12:11 -0000 1.5 *************** *** 21,25 **** abstract class NiceField { ! CNiceClass declaringClass; MonoSymbol sym; ?Expression value; --- 21,25 ---- abstract class NiceField { ! NiceClass declaringClass; MonoSymbol sym; ?Expression value; *************** *** 248,252 **** public final class ValueOverride { ! CNiceClass declaringClass; LocatedString name; Expression value; --- 248,252 ---- public final class ValueOverride { ! NiceClass declaringClass; LocatedString name; Expression value; *************** *** 288,292 **** to the corresponding symbol in the constructor of this class. */ ! private TypeScope translationScope(CNiceClass this, CNiceClass other) { let binders = other.definition.getBinders(); --- 288,292 ---- to the corresponding symbol in the constructor of this class. */ ! private TypeScope translationScope(NiceClass this, NiceClass other) { let binders = other.definition.getBinders(); Index: compilation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/compilation.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** compilation.nice 4 Jan 2005 21:20:39 -0000 1.4 --- compilation.nice 14 Jan 2005 11:12:10 -0000 1.5 *************** *** 108,112 **** Iterator<Alternative> i = sortedAlternatives.iterator(); Alternative a = i.next(); ! CNiceClass c = declaringClass(m, a); i.remove(); --- 108,112 ---- Iterator<Alternative> i = sortedAlternatives.iterator(); Alternative a = i.next(); ! NiceClass c = declaringClass(m, a); i.remove(); *************** *** 139,143 **** } ! private CNiceClass declaringClass(JavaMethod m, Alternative alt) { ?mlsub.typing.TypeConstructor firstArgument = alt.getPatterns()[0].getTC(); --- 139,143 ---- } ! private NiceClass declaringClass(JavaMethod m, Alternative alt) { ?mlsub.typing.TypeConstructor firstArgument = alt.getPatterns()[0].getTC(); --- NiceClass.java DELETED --- Index: niceclass.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceclass.nice,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** niceclass.nice 12 Jan 2005 22:06:53 -0000 1.18 --- niceclass.nice 14 Jan 2005 11:12:11 -0000 1.19 *************** *** 16,23 **** /** ! Concrete Nice Class definition. */ ! public class CNiceClass extends NiceClass { TypeDefinition definition; --- 16,36 ---- /** ! Abstract superclass for NiceClass, JavaClass and PrimitiveType ! */ ! public abstract class ClassImplementation ! { ! void resolveClass(); ! void resolveBody() {} ! void typecheck() {} ! void compile() {} ! void recompile() {} ! void printInterface(java.io.PrintWriter s); ! } ! ! /** ! A Nice Class definition. */ ! public class NiceClass extends ClassImplementation { TypeDefinition definition; *************** *** 57,61 **** } ! getName() = definition.getName(); TypeDefinition getDefinition() = definition; --- 70,74 ---- } ! LocatedString getName() = definition.getName(); TypeDefinition getDefinition() = definition; *************** *** 105,109 **** public boolean isInterface() = definition instanceof InterfaceDefinition; ! ?CNiceClass getParent() { let superTC = definition.getSuperClass(); --- 118,122 ---- public boolean isInterface() = definition instanceof InterfaceDefinition; ! ?NiceClass getParent() { let superTC = definition.getSuperClass(); *************** *** 363,367 **** } ! createClassExp() { gnu.expr.ClassExp res = new gnu.expr.ClassExp(); --- 376,380 ---- } ! gnu.expr.ClassExp createClassExp() { gnu.expr.ClassExp res = new gnu.expr.ClassExp(); *************** *** 464,468 **** let supTC = definition.getSuperClass(); ! let ?CNiceClass sup = (supTC == null) ? null : getNiceClass(supTC); List<(?MethodDeclaration, List<Parameter>)> res; if (sup == null) --- 477,481 ---- let supTC = definition.getSuperClass(); ! let ?NiceClass sup = (supTC == null) ? null : getNiceClass(supTC); List<(?MethodDeclaration, List<Parameter>)> res; if (sup == null) *************** *** 681,685 **** } ! importMethod(gnu.bytecode.Method method) { if (method.isConstructor()) --- 694,698 ---- } ! ?Definition importMethod(gnu.bytecode.Method method) { if (method.isConstructor()) *************** *** 734,741 **** compile() = notNull(declaringClass.thisExp); ! final CNiceClass declaringClass; } ! CNiceClass createNiceClass(TypeDefinition cdef) = new CNiceClass(definition: cdef); private TypeSymbol asTypeSymbol(mlsub.typing.Monotype type) --- 747,754 ---- compile() = notNull(declaringClass.thisExp); ! final NiceClass declaringClass; } ! NiceClass createNiceClass(TypeDefinition cdef) = new NiceClass(definition: cdef); private TypeSymbol asTypeSymbol(mlsub.typing.Monotype type) *************** *** 753,757 **** if (c != null && c.getImplementation() instanceof NiceClass) { ! CNiceClass nc = cast(c.getImplementation()); return nc.classe; } --- 766,770 ---- if (c != null && c.getImplementation() instanceof NiceClass) { ! NiceClass nc = cast(c.getImplementation()); return nc.classe; } *************** *** 760,764 **** } ! ?CNiceClass getNiceClass(TypeConstructor tc) { let res = getTypeDefinition(tc); --- 773,777 ---- } ! ?NiceClass getNiceClass(TypeConstructor tc) { let res = getTypeDefinition(tc); *************** *** 769,773 **** } ! public ?CNiceClass getNiceClass(mlsub.typing.Monotype type) { if (! nice.tools.typing.Types.isSure(type)) --- 782,786 ---- } ! public ?NiceClass getNiceClass(mlsub.typing.Monotype type) { if (! nice.tools.typing.Types.isSure(type)) *************** *** 775,777 **** return getNiceClass(nice.tools.typing.Types.constructor(type)); ! } \ No newline at end of file --- 788,808 ---- return getNiceClass(nice.tools.typing.Types.constructor(type)); ! } ! ! public LocatedString NiceClass_getName(Object nc) ! { ! NiceClass niceC = cast(nc); ! return niceC.getName(); ! } ! ! public gnu.expr.ClassExp NiceClass_createClassExp(Object nc) ! { ! NiceClass niceC = cast(nc); ! return niceC.createClassExp(); ! } ! ! public ?Definition NiceClass_importMethod(Object nc, gnu.bytecode.Method method) ! { ! NiceClass niceC = cast(nc); ! return niceC.importMethod(method); ! } Index: niceMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceMethod.nice,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** niceMethod.nice 13 Jan 2005 14:06:15 -0000 1.15 --- niceMethod.nice 14 Jan 2005 11:12:11 -0000 1.16 *************** *** 355,359 **** // Try to compile the dispatch method as a member method if possible. ! ?CNiceClass receiver; if (argTypes.length == 0) receiver = null; --- 355,359 ---- // Try to compile the dispatch method as a member method if possible. ! ?NiceClass receiver; if (argTypes.length == 0) receiver = null; Index: Module.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Module.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Module.java 31 Dec 2004 20:23:31 -0000 1.22 --- Module.java 14 Jan 2005 11:12:10 -0000 1.23 *************** *** 35,39 **** gnu.expr.ReferenceExp addMethod(gnu.expr.LambdaExp method, boolean packageMethod); ! gnu.expr.ClassExp getClassExp(NiceClass def); void addUserClass(gnu.expr.ClassExp classe); } --- 35,39 ---- gnu.expr.ReferenceExp addMethod(gnu.expr.LambdaExp method, boolean packageMethod); ! gnu.expr.ClassExp getClassExp(Object def); void addUserClass(gnu.expr.ClassExp classe); } Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** tools.nice 13 Jan 2005 16:47:34 -0000 1.97 --- tools.nice 14 Jan 2005 11:12:11 -0000 1.98 *************** *** 221,229 **** mlsub.typing.AtomicConstraint[?] AtomicConstraint_substitute(java.util.Map<mlsub.typing.TypeSymbol,mlsub.typing.TypeSymbol>, AtomicConstraint[?]) = native mlsub.typing.AtomicConstraint[] mlsub.typing.AtomicConstraint.substitute(java.util.Map, mlsub.typing.AtomicConstraint[]); Module module(Definition) = native Definition.module; - ?Definition importMethod(NiceClass, gnu.bytecode.Method) = native Definition NiceClass.importMethod(gnu.bytecode.Method); boolean equals(LocatedString, LocatedString) = native boolean LocatedString.equals(LocatedString); ?gnu.bytecode.Attribute get(gnu.bytecode.AttrContainer, String) = native gnu.bytecode.Attribute gnu.bytecode.Attribute.get(gnu.bytecode.AttrContainer, String); void printInterface(Definition, java.io.PrintWriter) = native void Definition.printInterface(java.io.PrintWriter); - void printInterface(ClassImplementation, java.io.PrintWriter) = native void ClassImplementation.printInterface(java.io.PrintWriter); ?gnu.bytecode.Type TypeImport_lookup(LocatedString) = native gnu.bytecode.Type nice.tools.code.TypeImport.lookup(LocatedString); List<Node> children(Node) = native Node.children; --- 221,227 ---- Index: typedef.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typedef.nice,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** typedef.nice 12 Jan 2005 22:06:54 -0000 1.13 --- typedef.nice 14 Jan 2005 11:12:11 -0000 1.14 *************** *** 354,358 **** { let impl = implementation; ! if (impl != null && impl instanceof CNiceClass) impl.precompile(); } --- 354,358 ---- { let impl = implementation; ! if (impl != null && impl instanceof NiceClass) impl.precompile(); } Index: methodImplementation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/methodImplementation.nice,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** methodImplementation.nice 13 Jan 2005 14:06:15 -0000 1.10 --- methodImplementation.nice 14 Jan 2005 11:12:11 -0000 1.11 *************** *** 198,202 **** return; ! CNiceClass c = cast(def.getImplementation()); gnu.expr.Expression[] params = cast(new gnu.expr.Expression[arity]); --- 198,202 ---- return; ! NiceClass c = cast(def.getImplementation()); gnu.expr.Expression[] params = cast(new gnu.expr.Expression[arity]); Index: super.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/super.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** super.nice 12 Jan 2005 18:50:38 -0000 1.9 --- super.nice 14 Jan 2005 11:12:11 -0000 1.10 *************** *** 169,173 **** // the base method), a call to super is emited. { ! let CNiceClass nc = cast(notNull(getTypeDefinition(notNull(currentMethod).firstArgument())).getImplementation()); code = nc.callSuperMethod(notNull(superMethod)); } --- 169,173 ---- // the base method), a call to super is emited. { ! let NiceClass nc = cast(notNull(getTypeDefinition(notNull(currentMethod).firstArgument())).getImplementation()); code = nc.callSuperMethod(notNull(superMethod)); } Index: importedconstructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/importedconstructor.nice,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** importedconstructor.nice 12 Jan 2005 22:06:53 -0000 1.12 --- importedconstructor.nice 14 Jan 2005 11:12:10 -0000 1.13 *************** *** 86,90 **** } ! public ?ImportedConstructor loadImportedConstructor(CNiceClass def, gnu.bytecode.Method method) { if (! method.isConstructor()) --- 86,90 ---- } ! public ?ImportedConstructor loadImportedConstructor(NiceClass def, gnu.bytecode.Method method) { if (! method.isConstructor()) Index: dispatch.java.bootstrap =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/dispatch.java.bootstrap,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** dispatch.java.bootstrap 12 Jan 2005 18:50:37 -0000 1.51 --- dispatch.java.bootstrap 14 Jan 2005 11:12:10 -0000 1.52 *************** *** 48,51 **** --- 48,60 ---- { return null; } + public static LocatedString NiceClass_getName(Object nc) + { return null; } + + public static gnu.expr.ClassExp NiceClass_createClassExp(Object nc) + { return null; } + + public static Definition NiceClass_importMethod(Object nc, gnu.bytecode.Method method) + { return null; } + public static void _printStackTraceWithSourceInfo(Throwable t) {} } Index: constructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/constructor.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** constructor.nice 13 Jan 2005 23:56:06 -0000 1.6 --- constructor.nice 14 Jan 2005 11:12:10 -0000 1.7 *************** *** 21,25 **** abstract class Constructor extends MethodDeclaration { ! CNiceClass classe; final boolean isDefault; --- 21,25 ---- abstract class Constructor extends MethodDeclaration { ! NiceClass classe; final boolean isDefault; |