nice-commit Mailing List for The Nice Programming Language (Page 56)
Brought to you by:
bonniot
You can subscribe to this list here.
2003 |
Jan
|
Feb
(60) |
Mar
(125) |
Apr
(183) |
May
(140) |
Jun
(227) |
Jul
(141) |
Aug
(181) |
Sep
(75) |
Oct
(89) |
Nov
(187) |
Dec
(162) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(69) |
Feb
(197) |
Mar
(98) |
Apr
(26) |
May
(10) |
Jun
(85) |
Jul
(88) |
Aug
(79) |
Sep
(80) |
Oct
(81) |
Nov
(53) |
Dec
(109) |
2005 |
Jan
(68) |
Feb
(77) |
Mar
(232) |
Apr
(79) |
May
(37) |
Jun
(37) |
Jul
(3) |
Aug
(18) |
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(10) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(9) |
2007 |
Jan
(2) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
(17) |
Dec
(6) |
2008 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <bo...@us...> - 2004-02-20 13:23:02
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10375/src/gnu/expr Modified Files: InitializeProc.java Log Message: Report verification errors in constructor implementations more nicely. Index: InitializeProc.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/InitializeProc.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** InitializeProc.java 22 Dec 2003 01:30:59 -0000 1.4 --- InitializeProc.java 20 Feb 2004 13:11:49 -0000 1.5 *************** *** 95,99 **** code.emitPushInt(0); ! code.emitInvokeSpecial(constructor); } --- 95,105 ---- code.emitPushInt(0); ! try { ! code.emitInvokeSpecial(constructor); ! } ! catch (VerificationError e) { ! throw bossa.util.User.error(bossa.util.Location.make(exp), ! e.getMessage()); ! } } |
From: <bo...@us...> - 2004-02-20 13:21:47
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10112/src/bossa/parser Modified Files: Parser.jj Loader.java Log Message: Report a specific error message when type parameters are specified in a constructor call. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.239 retrieving revision 1.240 diff -C2 -d -r1.239 -r1.240 *** Parser.jj 19 Feb 2004 08:15:34 -0000 1.239 --- Parser.jj 20 Feb 2004 13:10:30 -0000 1.240 *************** *** 53,56 **** --- 53,63 ---- return new IdentExp(new LocatedString(name, loc)); } + + private void parseException(String message) throws ParseException + { + ParseException ex = new ParseException(message); + ex.currentToken = getToken(0); + throw ex; + } } PARSER_END(Parser) *************** *** 1675,1678 **** --- 1682,1688 ---- ( LOOKAHEAD(2) "[]" { furtherDimensions++; } )* { return new NewArrayExp(classe, args, furtherDimensions); } + | + "<" + { parseException("Type parameters are not needed in constructor calls"); } ) } Index: Loader.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Loader.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Loader.java 18 Jan 2004 01:14:30 -0000 1.25 --- Loader.java 20 Feb 2004 13:10:30 -0000 1.26 *************** *** 40,49 **** } catch(ParseException e){ ! if(e.currentToken!=null) ! User.error(Location.make(e.currentToken.next), ! removeLocation(e.getMessage())); ! else ! User.error(e.getMessage()); ! return null; } } --- 40,44 ---- } catch(ParseException e){ ! throw reportError(e); } } *************** *** 63,71 **** } catch(ParseException e){ ! if(e.currentToken!=null) ! User.error(Location.make(e.currentToken.next), ! removeLocation(e.getMessage())); ! else ! User.error(e.getMessage()); } catch(TokenMgrError e) { --- 58,62 ---- } catch(ParseException e){ ! throw reportError(e); } catch(TokenMgrError e) { *************** *** 81,84 **** --- 72,98 ---- } + private static Error reportError(ParseException e) + { + if(e.currentToken!=null) + { + Token token = e.currentToken; + + /* For errors generated by JavaCC, currentToken is the last + successfull token, so we want to point to the next one. + For errors handled by us for specific reporting, currentToken + is the offending token (which was parsed), and there is no next. + */ + if (token.next != null) + token = token.next; + + User.error(Location.make(token), removeLocation(e.getMessage())); + } + else + User.error(e.getMessage()); + + // We never get here anyway. + return null; + } + private static Chronometer chrono = Chronometer.make("Parsing"); |
From: <bo...@us...> - 2004-02-20 10:42:19
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14694/web Modified Files: install.xml Log Message: Fixed location of the emacs mode. Index: install.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/install.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** install.xml 24 Jan 2004 21:50:23 -0000 1.11 --- install.xml 20 Feb 2004 10:31:10 -0000 1.12 *************** *** 183,187 **** ;; then remove the leading ; in the next line ! ;(setq load-path (cons "~/share/emacs/site-lisp" load-path)) (setq auto-mode-alist (cons '("\\.nice$" . nice-mode) auto-mode-alist)) --- 183,187 ---- ;; then remove the leading ; in the next line ! ;(setq load-path (cons "~/share/emacs/site-lisp/nice" load-path)) (setq auto-mode-alist (cons '("\\.nice$" . nice-mode) auto-mode-alist)) |
From: <bo...@us...> - 2004-02-20 10:38:48
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13923/web Modified Files: compilation.xml Log Message: Added note about the behaviour of 'java -jar' and fixed typo. Index: compilation.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/compilation.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** compilation.xml 24 Jan 2004 21:19:53 -0000 1.5 --- compilation.xml 20 Feb 2004 10:27:41 -0000 1.6 *************** *** 19,23 **** </para> ! <programlisting>mkdir -p ~/nice/my/package</programlisting> <para> --- 19,23 ---- </para> ! <programlisting>mkdir -p ~/nice/my/program</programlisting> <para> *************** *** 69,72 **** --- 69,81 ---- <para> + If you need to put additional jars on the classpath to run your + program, you cannot use the <literal>java -jar</literal> command, + because it ignores the classpath. You then need to use + <literal>java -classpath lib1.jar:lib2.jar:program.jar + my.program.dispatch</literal> (use <literal>;</literal> instead of + <literal>:</literal> on Windows systems). + </para> + + <para> All imported packages are found automatically, and recompiled if necessary. Nice enjoys separate compilation. |
From: <bo...@us...> - 2004-02-20 10:37:26
|
Update of /cvsroot/nice/Nice/src/nice/tools/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13676/src/nice/tools/ant Modified Files: NiceDoc.java Log Message: Report messages using the Ant framework. Index: NiceDoc.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/ant/NiceDoc.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NiceDoc.java 20 Feb 2004 02:51:58 -0000 1.2 --- NiceDoc.java 20 Feb 2004 10:26:17 -0000 1.3 *************** *** 153,159 **** project.getBaseDir().getAbsolutePath()); ! nice.tools.compiler.console.ConsoleOutput console = ! nice.tools.compiler.console.fun.consoleOutput(); ! Compilation compilation = bossa.modules.fun.createCompilation(console); if (sourcepath != null) compilation.sourcePath = sourcepath; --- 153,158 ---- project.getBaseDir().getAbsolutePath()); ! NicecListener listener = new NicecListener(this); ! Compilation compilation = bossa.modules.fun.createCompilation(listener); if (sourcepath != null) compilation.sourcePath = sourcepath; *************** *** 162,166 **** nice.tools.doc.fun.generate(compilation, pack, destination); ! int retval = console.statusCode; switch (retval) { --- 161,165 ---- nice.tools.doc.fun.generate(compilation, pack, destination); ! int retval = listener.statusCode; switch (retval) { |
From: <bo...@us...> - 2004-02-20 03:02:52
|
Update of /cvsroot/nice/Nice/src/nice/tools/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1598/src/nice/tools/ant Modified Files: Nicec.java NiceDoc.java Added Files: NicecListener.nice Log Message: Make the nicec ant task report messages through the ant framework. --- NEW FILE: NicecListener.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 nice.tools.ant; /** Listener for Nicec that reports to Ant. @author Daniel Bonniot (bo...@us...) */ import nice.tools.compiler; import org.apache.tools.ant.*; public final class NicecListener extends StatusCodeListener { org.apache.tools.ant.Task task; progress(packageName, phase) { if (packageName != null) task.log(packageName + ": " + phase); else task.log(phase); } progress(percent) { // This is not reported to the console. } warning(location, message) { super; if (location != null) task.log("\n" + location + ":\n" + message); else task.log("\n" + message); } error(location, message) { super; if (location != null) task.log("\n" + location + ":\n" + message, Project.MSG_ERR); else task.log("\n" + message, Project.MSG_ERR); } /** A bug has occured inside the compiler. */ bug(stackTrace, url) { super; task.log ("\nAn exception has occured in the compiler\n" + "Please fill-in a bug report at the following webpage:\n" + url + // "\n\nException: " + exn.toString() + "\n\nStack trace:\n" + stackTrace, Project.MSG_ERR); } } Index: Nicec.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/ant/Nicec.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Nicec.java 19 Feb 2004 15:49:31 -0000 1.20 --- Nicec.java 20 Feb 2004 02:51:58 -0000 1.21 *************** *** 289,295 **** project.getBaseDir().getAbsolutePath()); ! nice.tools.compiler.console.ConsoleOutput console = ! nice.tools.compiler.console.fun.consoleOutput(); ! Compilation compilation = bossa.modules.fun.createCompilation(console); if (sourcepath != null) compilation.sourcePath = sourcepath; --- 289,295 ---- project.getBaseDir().getAbsolutePath()); ! NicecListener listener = new NicecListener(this); ! Compilation compilation = bossa.modules.fun.createCompilation ! (listener); if (sourcepath != null) compilation.sourcePath = sourcepath; *************** *** 305,319 **** nice.tools.compiler.fun.compile (compilation, pack, output, native_compiler, editor); ! int retval = console.statusCode; switch (retval) { ! case nice.tools.compiler.console.fun.ERROR: throw new BuildException(ERROR_MSG, location); ! case nice.tools.compiler.console.fun.BUG: throw new BuildException(BUG_MSG, location); ! case nice.tools.compiler.console.fun.WARNING: log(WARNING_MSG, Project.MSG_WARN); break; ! case nice.tools.compiler.console.fun.OK: log(OK_MSG, Project.MSG_INFO); break; --- 305,319 ---- nice.tools.compiler.fun.compile (compilation, pack, output, native_compiler, editor); ! int retval = listener.statusCode; switch (retval) { ! case nice.tools.compiler.fun.ERROR: throw new BuildException(ERROR_MSG, location); ! case nice.tools.compiler.fun.BUG: throw new BuildException(BUG_MSG, location); ! case nice.tools.compiler.fun.WARNING: log(WARNING_MSG, Project.MSG_WARN); break; ! case nice.tools.compiler.fun.OK: log(OK_MSG, Project.MSG_INFO); break; Index: NiceDoc.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/ant/NiceDoc.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NiceDoc.java 14 Feb 2004 00:57:32 -0000 1.1 --- NiceDoc.java 20 Feb 2004 02:51:58 -0000 1.2 *************** *** 165,176 **** switch (retval) { ! case nice.tools.compiler.console.fun.ERROR: throw new BuildException(ERROR_MSG, location); ! case nice.tools.compiler.console.fun.BUG: throw new BuildException(BUG_MSG, location); ! case nice.tools.compiler.console.fun.WARNING: log(WARNING_MSG, Project.MSG_WARN); break; ! case nice.tools.compiler.console.fun.OK: log(OK_MSG, Project.MSG_INFO); break; --- 165,176 ---- switch (retval) { ! case nice.tools.compiler.fun.ERROR: throw new BuildException(ERROR_MSG, location); ! case nice.tools.compiler.fun.BUG: throw new BuildException(BUG_MSG, location); ! case nice.tools.compiler.fun.WARNING: log(WARNING_MSG, Project.MSG_WARN); break; ! case nice.tools.compiler.fun.OK: log(OK_MSG, Project.MSG_INFO); break; |
From: <bo...@us...> - 2004-02-20 03:02:50
|
Update of /cvsroot/nice/Nice/src/nice/tools/compiler/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1598/src/nice/tools/compiler/console Modified Files: listener.nice Log Message: Make the nicec ant task report messages through the ant framework. Index: listener.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/console/listener.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** listener.nice 14 Jun 2003 14:20:38 -0000 1.2 --- listener.nice 20 Feb 2004 02:51:57 -0000 1.3 *************** *** 21,39 **** public ConsoleOutput consoleOutput() = new ConsoleOutput(); ! let int OK = 0; // Normal exit (compilation sucessful, version message) ! let int BUG = 1; // Abnormal termination (bug in the compiler) ! let int ERROR = 2; // Error reported (file missing, type error, ...) ! let int WARNING = 3; // Warning reported ! ! public final class ConsoleOutput implements CompilationListener { - public int statusCode = OK; - - private void setStatusCode(int status) - { - if (worse(status, statusCode)) - statusCode = status; - } - progress(packageName, phase) { --- 21,26 ---- public ConsoleOutput consoleOutput() = new ConsoleOutput(); ! public final class ConsoleOutput extends StatusCodeListener { progress(packageName, phase) { *************** *** 51,55 **** warning(location, message) { ! this.setStatusCode(WARNING); if (location != null) System.out.println("\n" + location + ":\n" + message); --- 38,42 ---- warning(location, message) { ! super; if (location != null) System.out.println("\n" + location + ":\n" + message); *************** *** 60,64 **** error(location, message) { ! this.setStatusCode(ERROR); if (location != null) System.err.println("\n" + location + ":\n" + message); --- 47,51 ---- error(location, message) { ! super; if (location != null) System.err.println("\n" + location + ":\n" + message); *************** *** 70,74 **** bug(stackTrace, url) { ! this.setStatusCode(BUG); System.err.println ("\nAn exception has occured in the compiler\n" + --- 57,61 ---- bug(stackTrace, url) { ! super; System.err.println ("\nAn exception has occured in the compiler\n" + *************** *** 79,89 **** } } - - boolean worse(int status, int than) - { - if (than == OK) return true; - if (than == BUG) return false; - if (than == ERROR) return false; - if (than == WARNING) return status == BUG || status == ERROR; - return false; - } --- 66,67 ---- |
From: <bo...@us...> - 2004-02-20 03:02:50
|
Update of /cvsroot/nice/Nice/src/nice/tools/compiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1598/src/nice/tools/compiler Added Files: StatusCodeListener.nice Log Message: Make the nicec ant task report messages through the ant framework. --- NEW FILE: StatusCodeListener.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 nice.tools.compiler; /** A minimal compilation listener that only keeps track of the result of the compilation (success, failure, bug, warning). This can be subclassed to provide additional features, like reporting of the messages to a certain device. @author Daniel Bonniot (bo...@us...) */ let int OK = 0; // Normal exit (compilation sucessful, version message) let int BUG = 1; // Abnormal termination (bug in the compiler) let int ERROR = 2; // Error reported (file missing, type error, ...) let int WARNING = 3; // Warning reported abstract class StatusCodeListener implements bossa.modules.CompilationListener { public int statusCode = OK; private void setStatusCode(int status) { if (worse(status, statusCode)) statusCode = status; } warning(location, message) { this.setStatusCode(WARNING); } error(location, message) { this.setStatusCode(ERROR); } /** A bug has occured inside the compiler. */ bug(stackTrace, url) { this.setStatusCode(BUG); } } boolean worse(int status, int than) { if (than == OK) return true; if (than == BUG) return false; if (than == ERROR) return false; if (than == WARNING) return status == BUG || status == ERROR; return false; } |
From: <bo...@us...> - 2004-02-20 03:02:49
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1598/src/nice/tools/testsuite Modified Files: TestCase.java Log Message: Make the nicec ant task report messages through the ant framework. Index: TestCase.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestCase.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** TestCase.java 8 Dec 2003 18:37:11 -0000 1.27 --- TestCase.java 20 Feb 2004 02:51:57 -0000 1.28 *************** *** 295,305 **** int retval = compilePackage(packageName); switch (retval) { ! case nice.tools.compiler.console.fun.ERROR: showMessages = true; throw new TestSuiteException(ERROR_MSG); ! case nice.tools.compiler.console.fun.BUG: showMessages = true; throw new CompilerBugException(BUG_MSG); ! case nice.tools.compiler.console.fun.WARNING: showMessages = true; break; --- 295,305 ---- int retval = compilePackage(packageName); switch (retval) { ! case nice.tools.compiler.fun.ERROR: showMessages = true; throw new TestSuiteException(ERROR_MSG); ! case nice.tools.compiler.fun.BUG: showMessages = true; throw new CompilerBugException(BUG_MSG); ! case nice.tools.compiler.fun.WARNING: showMessages = true; break; |
From: <bo...@us...> - 2004-02-20 01:08:54
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12522/src/nice/tools/code Modified Files: Import.java Log Message: Minor: formatting. Index: Import.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Import.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Import.java 19 Feb 2004 08:15:34 -0000 1.3 --- Import.java 20 Feb 2004 00:58:05 -0000 1.4 *************** *** 91,96 **** } ! boolean strictImport = bossa.modules.Package.currentCompilation. ! strictJavaTypes; boolean nonNullArgs = strictPackages.contains --- 91,96 ---- } ! boolean strictImport = ! bossa.modules.Package.currentCompilation.strictJavaTypes; boolean nonNullArgs = strictPackages.contains |
From: <bo...@us...> - 2004-02-20 00:41:59
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes/constructors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7950/testsuite/compiler/classes/constructors Modified Files: native.testsuite Log Message: Fixed code generation bug for the version of the constructor omitting optional parameters in the presence of subclassing. Index: native.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/constructors/native.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** native.testsuite 15 Jan 2004 21:39:19 -0000 1.2 --- native.testsuite 20 Feb 2004 00:31:10 -0000 1.3 *************** *** 13,14 **** --- 13,25 ---- class MyEx extends Exception { int i = 0; } + /// PASS + /// package a + /// toplevel + abstract class StatusCodeListener + { + public String statusCode = "1"; + } + /// package b import a + assert new NicecListener().statusCode.equals("1"); + /// toplevel + class NicecListener extends StatusCodeListener {} |
From: <bo...@us...> - 2004-02-20 00:41:59
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7950/src/bossa/syntax Modified Files: CustomConstructor.java Log Message: Fixed code generation bug for the version of the constructor omitting optional parameters in the presence of subclassing. Index: CustomConstructor.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/CustomConstructor.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CustomConstructor.java 3 Feb 2004 12:10:01 -0000 1.12 --- CustomConstructor.java 20 Feb 2004 00:31:11 -0000 1.13 *************** *** 17,20 **** --- 17,21 ---- import mlsub.typing.*; import gnu.expr.*; + import gnu.bytecode.Type; import gnu.bytecode.ClassType; import gnu.bytecode.Method; *************** *** 284,288 **** { int dummyArgs = method.arg_types.length - arity; ! return new QuoteExp(new InitializeProc(method, false, dummyArgs)); } --- 285,290 ---- { int dummyArgs = method.arg_types.length - arity; ! Method calledMethod = omitDefaults ? getMethodUsingDefaults() : method; ! return new QuoteExp(new InitializeProc(calledMethod, false, dummyArgs)); } *************** *** 294,297 **** --- 296,323 ---- private Method method; + + /** + Return the Method for this constructor with the optional parameters + left out. + */ + private Method getMethodUsingDefaults() + { + Type[] fullArgTypes = method.arg_types; + List argTypes = new LinkedList(); + + for (int i = 0; i < parameters.size; i++) + { + if (parameters.hasDefaultValue(i)) + continue; + + argTypes.add(fullArgTypes[i]); + } + + Type[] argTypesArray = (Type[]) argTypes.toArray + (new Type[argTypes.size()]); + + return method.getDeclaringClass().getDeclaredMethod + ("<init>", argTypesArray); + } } } |
From: <bo...@us...> - 2004-02-19 16:00:04
|
Update of /cvsroot/nice/Nice/src/nice/tools/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20712/src/nice/tools/ant Modified Files: Nicec.java Log Message: Added settings for Emacs. Index: Nicec.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/ant/Nicec.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Nicec.java 7 Aug 2003 09:56:37 -0000 1.19 --- Nicec.java 19 Feb 2004 15:49:31 -0000 1.20 *************** *** 339,340 **** --- 339,347 ---- } + + + // Setting for Emacs + // Local variables: + // tab-width:2 + // indent-tabs-mode:t + // End: |
From: <bo...@us...> - 2004-02-19 14:57:49
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8701 Modified Files: NEWS Log Message: Custom constructors, expression-local variables (explicitely typed version), typos. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** NEWS 16 Feb 2004 23:09:15 -0000 1.21 --- NEWS 19 Feb 2004 14:47:19 -0000 1.22 *************** *** 1,15 **** nice (0.9.6) * Additional fields can be defined for enums and enums can implement ! interfaces, example: enum Coin(int value) implements Currency {penny(1), nickel(5), dime(10), quarter(25)} ! * Alternative syntax for calling methods that takes a closure with no ! arguments. For example 'loop(5) { doSomeThing(); }' is shorthand for ! 'loop(5, () => { doSomeThing(); });' * "using" statement, as in C#, defined in nice.lang using (!) the above syntax. ! * Stricter parsing of expression used as statement. ! * Improved performance of arrays used as lists. * New methods (in package nice.functional) for working with iterators and generators. --- 1,30 ---- nice (0.9.6) + * It is now possible to create custom constructors: + class Point { double x; double y; } + + new Point(double angle, double distance) + { + this(x: distance * cos(angle), y: distance * sin(angle)); + } + It is then possible to create a Point with either + new Point(x: ..., y: ...) or new Point(angle: ..., distance: ...). * Additional fields can be defined for enums and enums can implement ! interfaces, for instance: enum Coin(int value) implements Currency {penny(1), nickel(5), dime(10), quarter(25)} ! * Alternative syntax for calling methods that takes an anonymous function ! with no arguments. For example 'loop(5) { doSomeThing(); }' is a ! shorthand for 'loop(5, () => { doSomeThing(); });' * "using" statement, as in C#, defined in nice.lang using (!) the above syntax. ! * Expression-local variables: variables that are declared as the argument ! of a method call, and that are visible to the other arguments. ! A typical usage is, still using the above syntax: ! using(PrintStream s = ...) { ! s.println("..."); ! } ! * Stricter parsing of expressions used as statements. ! * Improved performance for arrays used as lists. * New methods (in package nice.functional) for working with iterators and generators. |
From: <bo...@us...> - 2004-02-19 12:41:05
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14119/src/gnu/bytecode Modified Files: CodeAttr.java Log Message: Give a more precise message about methods that are not accessible. Index: CodeAttr.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/CodeAttr.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CodeAttr.java 2 Feb 2004 09:37:57 -0000 1.22 --- CodeAttr.java 19 Feb 2004 12:30:40 -0000 1.23 *************** *** 1107,1111 **** if (! Access.legal(getMethod().getDeclaringClass(), method, receiverType)) throw new VerificationError ! ("Method " + method.getName() + " is not accessible"); put1(opcode); // invokevirtual, invokespecial, or invokestatic --- 1107,1111 ---- if (! Access.legal(getMethod().getDeclaringClass(), method, receiverType)) throw new VerificationError ! ("Method " + method.toString() + " is not accessible"); put1(opcode); // invokevirtual, invokespecial, or invokestatic |
From: <bo...@us...> - 2004-02-19 11:40:25
|
Update of /cvsroot/nice/Nice/regtest/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2646/regtest/java Modified Files: main.nice Added Files: access.nice Log Message: Postpone the distinction between protected and default until we have implemented visibility in Nice. --- NEW FILE: access.nice --- package regtest.java; void testAccess() { // TODO: This should call the access(Object) method, access(String) // is not visible. //new regtest.java.J.J().access(""); } Index: main.nice =================================================================== RCS file: /cvsroot/nice/Nice/regtest/java/main.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.nice 19 Feb 2004 09:33:51 -0000 1.2 --- main.nice 19 Feb 2004 11:30:03 -0000 1.3 *************** *** 12,14 **** --- 12,16 ---- { jMethod(new SubJ(), new regtest.java.J.Other()); + + testAccess(); } |
From: <bo...@us...> - 2004-02-19 11:40:24
|
Update of /cvsroot/nice/Nice/regtest/java/J In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2646/regtest/java/J Modified Files: J.java Log Message: Postpone the distinction between protected and default until we have implemented visibility in Nice. Index: J.java =================================================================== RCS file: /cvsroot/nice/Nice/regtest/java/J/J.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** J.java 10 Dec 2003 22:34:25 -0000 1.3 --- J.java 19 Feb 2004 11:30:03 -0000 1.4 *************** *** 2,5 **** --- 2,15 ---- public class J { + public J() {} + + // A constructor with default visibility. + // We'll make sure that we can subclass this class in a different package + // in Nice, in which case this constructor must be igored. + J(Object dummy) {} + + public void access(Object o) {} + void access(String o) { throw new Error("Not accessible"); } + Object obj; |
From: <bo...@us...> - 2004-02-19 11:40:24
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2646/src/gnu/bytecode Modified Files: Access.java Log Message: Postpone the distinction between protected and default until we have implemented visibility in Nice. Index: Access.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/Access.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Access.java 19 Feb 2004 09:36:30 -0000 1.5 --- Access.java 19 Feb 2004 11:30:02 -0000 1.6 *************** *** 71,75 **** // PROTECTED ! return (mod & PROTECTED) != 0 && c.isSubclass(target) && receiver.isSubtype(c); } --- 71,78 ---- // PROTECTED ! /* TODO: For now, we consider all default access as also protected. Being ! more precise needs an implementation of the visibility system in Nice. ! */ ! return //(mod & PROTECTED) != 0 && c.isSubclass(target) && receiver.isSubtype(c); } |
From: <bo...@us...> - 2004-02-19 09:46:49
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15060/src/gnu/bytecode Modified Files: Access.java Log Message: Distinguish between default and protected. Index: Access.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/Access.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Access.java 25 Aug 2003 22:30:00 -0000 1.4 --- Access.java 19 Feb 2004 09:36:30 -0000 1.5 *************** *** 66,72 **** return true; // PROTECTED ! return c.getPackageName().equals(target.getPackageName()) ! || (c.isSubclass(target) && receiver.isSubtype(c)); } } --- 66,76 ---- return true; + // DEFAULT (PACKAGE) OR PROTECTED + if (c.getPackageName().equals(target.getPackageName())) + return true; + // PROTECTED ! return (mod & PROTECTED) != 0 && ! c.isSubclass(target) && receiver.isSubtype(c); } } |
From: <bo...@us...> - 2004-02-19 09:44:11
|
Update of /cvsroot/nice/Nice/regtest/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14397/regtest/java Modified Files: main.nice Log Message: Make otherMethod public since it is used outside the package. It used to work only because the compiler did not detect it (fixed by the previous change to gnu.bytecode.ClassType.getPackageName) and the JVM neither because that part of the code was not executed. Index: main.nice =================================================================== RCS file: /cvsroot/nice/Nice/regtest/java/main.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.nice 17 Oct 2003 15:25:50 -0000 1.1 --- main.nice 19 Feb 2004 09:33:51 -0000 1.2 *************** *** 11,13 **** --- 11,14 ---- void main(String[] args) { + jMethod(new SubJ(), new regtest.java.J.Other()); } |
From: <bo...@us...> - 2004-02-19 09:44:09
|
Update of /cvsroot/nice/Nice/regtest/java/J In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14397/regtest/java/J Modified Files: Other.java Log Message: Make otherMethod public since it is used outside the package. It used to work only because the compiler did not detect it (fixed by the previous change to gnu.bytecode.ClassType.getPackageName) and the JVM neither because that part of the code was not executed. Index: Other.java =================================================================== RCS file: /cvsroot/nice/Nice/regtest/java/J/Other.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Other.java 28 Nov 2003 14:01:30 -0000 1.1 --- Other.java 19 Feb 2004 09:33:49 -0000 1.2 *************** *** 2,5 **** public class Other { ! void otherMethod() {} } --- 2,5 ---- public class Other { ! public void otherMethod() {} } |
From: <bo...@us...> - 2004-02-19 08:25:51
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32389/src/bossa/parser Modified Files: Parser.jj Log Message: Allow imported java packages to be specified to have non-null argument types by default. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.238 retrieving revision 1.239 diff -C2 -d -r1.238 -r1.239 *** Parser.jj 18 Feb 2004 15:31:10 -0000 1.238 --- Parser.jj 19 Feb 2004 08:15:34 -0000 1.239 *************** *** 1838,1841 **** --- 1838,1844 ---- "import" name=doted_string() ( ".*" { opens.add(name.toString()); } + [ "(" "!" ")" + { nice.tools.code.Import.addStrictPackage(name.toString()); } + ] | { imports.add(name); } ) *************** *** 1850,1854 **** [ "package" doted_string() ";" ] ( ! "import" doted_string() [ ".*" ] ";" )* --- 1853,1857 ---- [ "package" doted_string() ";" ] ( ! "import" doted_string() [ ".*" [ "(" "!" ")" ] ] ";" )* |
From: <bo...@us...> - 2004-02-19 08:25:51
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32389/src/nice/tools/code Modified Files: Types.java Import.java Log Message: Allow imported java packages to be specified to have non-null argument types by default. Index: Types.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Types.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Types.java 11 Feb 2004 12:46:39 -0000 1.55 --- Types.java 19 Feb 2004 08:15:33 -0000 1.56 *************** *** 771,774 **** --- 771,775 ---- tcToGBType = new HashMap(); TypeImport.stringToReflectClass = new HashMap(); + Import.reset(); } } Index: Import.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Import.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Import.java 23 Jan 2003 22:44:57 -0000 1.2 --- Import.java 19 Feb 2004 08:15:34 -0000 1.3 *************** *** 93,97 **** boolean strictImport = bossa.modules.Package.currentCompilation. strictJavaTypes; ! if (strictImport) { for (int i = 0; i < paramTypes.length; i++) --- 93,101 ---- boolean strictImport = bossa.modules.Package.currentCompilation. strictJavaTypes; ! ! boolean nonNullArgs = strictPackages.contains ! (m.getDeclaringClass().getPackageName()); ! ! if (strictImport || nonNullArgs) { for (int i = 0; i < paramTypes.length; i++) *************** *** 174,176 **** --- 178,193 ---- return res; } + + /**************************************************************** + * Retyping policies + ****************************************************************/ + + private static java.util.HashSet strictPackages = new java.util.HashSet(); + + static void reset() { strictPackages.clear(); } + + public static void addStrictPackage(String name) + { + strictPackages.add(name); + } } |
From: <bo...@us...> - 2004-02-19 08:23:09
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31831/src/gnu/bytecode Modified Files: ClassType.java Log Message: Correctly return the package name of a class, not just the root name! Index: ClassType.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/ClassType.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ClassType.java 26 Nov 2003 16:25:54 -0000 1.20 --- ClassType.java 19 Feb 2004 08:12:37 -0000 1.21 *************** *** 122,126 **** { String name = getName(); ! int index = name.indexOf('.'); return index < 0 ? name : name.substring(0, index); } --- 122,126 ---- { String name = getName(); ! int index = name.lastIndexOf('.'); return index < 0 ? name : name.substring(0, index); } |
From: <bo...@us...> - 2004-02-18 17:54:59
|
Update of /cvsroot/nice/Nice/src/nice/tools/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31209/src/nice/tools/ant Modified Files: TestListener.nice Log Message: Make sure that the console listener does not get ignored. Index: TestListener.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/ant/TestListener.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestListener.nice 18 Feb 2004 16:47:34 -0000 1.1 --- TestListener.nice 18 Feb 2004 17:45:10 -0000 1.2 *************** *** 13,17 **** package nice.tools.ant; ! import nice.tools.unit; import org.apache.tools.ant.*; --- 13,17 ---- package nice.tools.ant; ! import nice.tools.unit.console; import org.apache.tools.ant.*; |