[Nice-commit] Nice/src/bossa/link Alternative.java,1.57,1.58 Compilation.java,1.19,1.20 DispatchTest
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2004-12-19 22:37:58
|
Update of /cvsroot/nice/Nice/src/bossa/link In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6256/F:/nice/src/bossa/link Modified Files: Alternative.java Compilation.java DispatchTest.java ImportedAlternative.java JavaAlternative.java Log Message: Converted the Java* classes. (by Luc Perrin) Index: Alternative.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/Alternative.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Alternative.java 18 Dec 2004 23:43:14 -0000 1.57 --- Alternative.java 19 Dec 2004 22:37:17 -0000 1.58 *************** *** 18,22 **** import bossa.syntax.MethodDeclaration; - import bossa.syntax.JavaMethod; import bossa.syntax.Pattern; import bossa.syntax.LocatedString; --- 18,21 ---- *************** *** 242,247 **** String fullName = to.getFullName(); ! if (from instanceof JavaMethod) ! new JavaAlternative((JavaMethod) from).add(fullName); List list = (List) alternatives.get(from.getFullName()); --- 241,246 ---- String fullName = to.getFullName(); ! if (from.isJavaMethod()) ! new JavaAlternative(from).add(fullName); List list = (List) alternatives.get(from.getFullName()); Index: JavaAlternative.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/JavaAlternative.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JavaAlternative.java 12 Oct 2004 23:35:49 -0000 1.1 --- JavaAlternative.java 19 Dec 2004 22:37:17 -0000 1.2 *************** *** 13,17 **** package bossa.link; - import bossa.syntax.JavaMethod; import bossa.syntax.Pattern; import nice.tools.typing.Types; --- 13,16 ---- *************** *** 25,29 **** class JavaAlternative extends Alternative { ! JavaAlternative(JavaMethod method) { super(method.getName().toString(), patterns(method)); --- 24,28 ---- class JavaAlternative extends Alternative { ! JavaAlternative(bossa.syntax.MethodDeclaration method) { super(method.getName().toString(), patterns(method)); *************** *** 32,36 **** } ! JavaMethod method; static Pattern[] patterns(bossa.syntax.MethodDeclaration method) --- 31,35 ---- } ! bossa.syntax.MethodDeclaration method; static Pattern[] patterns(bossa.syntax.MethodDeclaration method) Index: Compilation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/Compilation.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Compilation.java 19 Dec 2004 19:58:27 -0000 1.19 --- Compilation.java 19 Dec 2004 22:37:17 -0000 1.20 *************** *** 132,136 **** ****************************************************************/ ! static void compile(JavaMethod m, Stack sortedAlternatives, bossa.modules.Package module) --- 132,136 ---- ****************************************************************/ ! static void compile(MethodDeclaration /* JavaMethod */ m, Stack sortedAlternatives, bossa.modules.Package module) *************** *** 176,180 **** } ! private static NiceClass declaringClass(JavaMethod m, Alternative alt) { mlsub.typing.TypeConstructor firstArgument = alt.getPatterns()[0].getTC(); --- 176,180 ---- } ! private static NiceClass declaringClass(MethodDeclaration /* JavaMethod */ m, Alternative alt) { mlsub.typing.TypeConstructor firstArgument = alt.getPatterns()[0].getTC(); *************** *** 202,206 **** boolean voidReturn, Expression[] params, ! ClassType c, JavaMethod m) { if (!sortedAlternatives.hasNext()) --- 202,206 ---- boolean voidReturn, Expression[] params, ! ClassType c, MethodDeclaration /* JavaMethod */ m) { if (!sortedAlternatives.hasNext()) Index: DispatchTest.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/DispatchTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DispatchTest.java 19 Dec 2004 19:58:27 -0000 1.2 --- DispatchTest.java 19 Dec 2004 22:37:17 -0000 1.3 *************** *** 44,55 **** private DispatchTest() { } ! public static void register(UserOperator/*NiceMethod*/ m) ! { ! methods.add(m); ! } ! ! public static void register(JavaMethod m) { ! javaMethods.add(m); } --- 44,53 ---- private DispatchTest() { } ! public static void register(MethodDeclaration m) { ! if( m.isJavaMethod() ) ! javaMethods.add(m); ! else ! methods.add(m); } *************** *** 76,80 **** for (Iterator i = javaMethods.iterator(); i.hasNext();) ! test((JavaMethod) i.next(), module); } finally { --- 74,78 ---- for (Iterator i = javaMethods.iterator(); i.hasNext();) ! test((MethodDeclaration/*JavaMethod*/) i.next(), module); } finally { *************** *** 97,101 **** } ! private static void test(JavaMethod m, bossa.modules.Package module) { Stack sortedAlternatives = Alternative.sortedAlternatives(m); --- 95,99 ---- } ! private static void test(MethodDeclaration/*JavaMethod*/ m, bossa.modules.Package module) { Stack sortedAlternatives = Alternative.sortedAlternatives(m); *************** *** 121,127 **** } ! private static boolean trivialTestJava(JavaMethod m, Stack alternatives) { ! gnu.bytecode.Method reflectMethod = m.reflectMethod; // Static methods and constructors cannot be overriden, so there is --- 119,125 ---- } ! private static boolean trivialTestJava(MethodDeclaration m, Stack alternatives) { ! gnu.bytecode.Method reflectMethod = m.getReflectMethod(); // Static methods and constructors cannot be overriden, so there is *************** *** 317,321 **** { gnu.bytecode.Method superImplementation = bossa.syntax.dispatch.getImplementationAbove ! ((JavaMethod) method, firstArg); if (superImplementation != null && superImplementation.isAbstract() == false) --- 315,319 ---- { gnu.bytecode.Method superImplementation = bossa.syntax.dispatch.getImplementationAbove ! (method, firstArg); if (superImplementation != null && superImplementation.isAbstract() == false) Index: ImportedAlternative.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/ImportedAlternative.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ImportedAlternative.java 1 Dec 2004 02:00:30 -0000 1.11 --- ImportedAlternative.java 19 Dec 2004 22:37:17 -0000 1.12 *************** *** 16,20 **** import bossa.syntax.LocatedString; import bossa.syntax.MethodDeclaration; - import bossa.syntax.JavaMethod; import bossa.syntax.VarSymbol; import nice.tools.code.*; --- 16,19 ---- *************** *** 98,107 **** private static void registerJavaMethod(String fullName) { ! if (! fullName.startsWith(JavaMethod.fullNamePrefix)) return; int end = fullName.lastIndexOf(':'); LocatedString methodName = new LocatedString ! (fullName.substring(JavaMethod.fullNamePrefix.length(), end), bossa.util.Location.nowhere()); --- 97,106 ---- private static void registerJavaMethod(String fullName) { ! if (! fullName.startsWith("JAVA:")) return; int end = fullName.lastIndexOf(':'); LocatedString methodName = new LocatedString ! (fullName.substring("JAVA:".length(), end), bossa.util.Location.nowhere()); *************** *** 115,119 **** if (md.getFullName().equals(fullName)) { ! ((JavaMethod) md).registerForDispatch(); return; } --- 114,118 ---- if (md.getFullName().equals(fullName)) { ! md.registerForDispatch(); return; } |