nice-commit Mailing List for The Nice Programming Language (Page 35)
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: Francis B. <fb...@us...> - 2004-09-21 14:11:40
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31149/src/nice/tools/doc Modified Files: htmlwriter.nice Log Message: source file names are not sorted alphanumerically in output. Index: htmlwriter.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/htmlwriter.nice,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** htmlwriter.nice 21 Sep 2004 13:42:32 -0000 1.21 --- htmlwriter.nice 21 Sep 2004 14:11:27 -0000 1.22 *************** *** 238,242 **** //we use a map instead of a set of definitions because //we also want keep a list of which files contain which definitions. ! Map<File, List<Definition>> map = new HashMap(); for(Definition d : p.getDefinitions().definitions()) { --- 238,243 ---- //we use a map instead of a set of definitions because //we also want keep a list of which files contain which definitions. ! //the list is sorted by filename (treemap automatically sorts). ! Map<File, List<Definition>> map = new TreeMap(); for(Definition d : p.getDefinitions().definitions()) { |
From: Francis B. <fb...@us...> - 2004-09-21 13:42:41
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24953/src/nice/tools/doc Modified Files: htmlwriter.nice Log Message: Added doc to "void write(Package p)" Index: htmlwriter.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/htmlwriter.nice,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** htmlwriter.nice 18 Sep 2004 10:18:59 -0000 1.20 --- htmlwriter.nice 21 Sep 2004 13:42:32 -0000 1.21 *************** *** 201,205 **** /** ! * Generate a list of source files */ void write(bossa.modules.Package p) { --- 201,207 ---- /** ! * Generate a list of source files, with sub-lists of the classes, methods, ! * and global variables within them. ! *@param p the Package to be documented. */ void write(bossa.modules.Package p) { |
From: Daniel B. <bo...@us...> - 2004-09-20 11:07:58
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2064 Modified Files: Makefile Log Message: Properly clean all generated jars. Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/Makefile,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** Makefile 7 Aug 2004 14:57:33 -0000 1.152 --- Makefile 20 Sep 2004 11:07:48 -0000 1.153 *************** *** 127,131 **** clean: ! rm -f src/nice/tools/compiler/console.jar rm -rf classes classes-inline share/java src/bossa/parser/{Parse*.java,Token*.java,*CharStream.java} rm -f bin/{nicedoc,niceunit} --- 127,131 ---- clean: ! rm -f src/nice/tools/compiler/console.jar nicepublish.jar regtest/*.jar rm -rf classes classes-inline share/java src/bossa/parser/{Parse*.java,Token*.java,*CharStream.java} rm -f bin/{nicedoc,niceunit} |
From: Daniel B. <bo...@us...> - 2004-09-20 10:24:55
|
Update of /cvsroot/nice/Nice/regtest/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25363/regtest/java Modified Files: access.nice Log Message: Do not create custom constructors based on unaccessible parent constructors. Correct access checking for default (non-protected) visibility. Index: access.nice =================================================================== RCS file: /cvsroot/nice/Nice/regtest/java/access.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** access.nice 19 Feb 2004 11:30:03 -0000 1.1 --- access.nice 20 Sep 2004 10:24:42 -0000 1.2 *************** *** 3,6 **** --- 3,10 ---- void testAccess() { + // This should call the J(Object) constructor since J(String) + // is not visible. + let j = new SubJ(""); + // TODO: This should call the access(Object) method, access(String) // is not visible. |
From: Daniel B. <bo...@us...> - 2004-09-20 10:24:53
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25363/src/bossa/syntax Modified Files: NiceClass.java Log Message: Do not create custom constructors based on unaccessible parent constructors. Correct access checking for default (non-protected) visibility. Index: NiceClass.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceClass.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** NiceClass.java 19 Sep 2004 12:42:28 -0000 1.84 --- NiceClass.java 20 Sep 2004 10:24:41 -0000 1.85 *************** *** 674,678 **** on the type parameters. */ ! private static List getNativeConstructorParameters (TypeConstructor tc, List constraints) { --- 674,678 ---- on the type parameters. */ ! private List getNativeConstructorParameters (TypeConstructor tc, List constraints) { *************** *** 691,699 **** for (Iterator i = constructors.iterator(); i.hasNext();) { ! MethodDeclaration.Symbol m = (MethodDeclaration.Symbol) i.next(); List params = new ArrayList(10); ! params.add(m.getMethodDeclaration()); res.add(params); ! mlsub.typing.Monotype[] args = m.getMethodDeclaration().getArgTypes(); for (int j = 0; j < args.length; j++) params.add(new FormalParameters.Parameter(Monotype.create(args[j]))); --- 691,712 ---- for (Iterator i = constructors.iterator(); i.hasNext();) { ! MethodDeclaration m = ! ((MethodDeclaration.Symbol) i.next()).getMethodDeclaration(); ! ! // Only consider parent methods for which a call from this class ! // is legal. ! if (m instanceof JavaMethod) ! { ! gnu.bytecode.ClassType thisClass = classe.getClassType(); ! if (! gnu.bytecode.Access.legal(thisClass, ! ((JavaMethod) m).reflectMethod, ! thisClass)) ! continue; ! } ! List params = new ArrayList(10); ! params.add(m); res.add(params); ! mlsub.typing.Monotype[] args = m.getArgTypes(); for (int j = 0; j < args.length; j++) params.add(new FormalParameters.Parameter(Monotype.create(args[j]))); |
From: Daniel B. <bo...@us...> - 2004-09-20 10:24:53
|
Update of /cvsroot/nice/Nice/regtest/java/J In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25363/regtest/java/J Modified Files: J.java Log Message: Do not create custom constructors based on unaccessible parent constructors. Correct access checking for default (non-protected) visibility. Index: J.java =================================================================== RCS file: /cvsroot/nice/Nice/regtest/java/J/J.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** J.java 19 Feb 2004 11:30:03 -0000 1.4 --- J.java 20 Sep 2004 10:24:42 -0000 1.5 *************** *** 4,11 **** 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) {} --- 4,13 ---- public J() {} + public J(Object dummy) {} + // 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(String dummy) {} public void access(Object o) {} |
From: Daniel B. <bo...@us...> - 2004-09-20 10:24:52
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25363/src/gnu/bytecode Modified Files: Access.java Log Message: Do not create custom constructors based on unaccessible parent constructors. Correct access checking for default (non-protected) visibility. Index: Access.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/Access.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Access.java 19 Feb 2004 11:30:02 -0000 1.6 --- Access.java 20 Sep 2004 10:24:41 -0000 1.7 *************** *** 49,52 **** --- 49,54 ---- @return true if code in class c can access method m, with the first argument of the call being receiver. + + receiver is null if the call is static. */ public static boolean legal(ClassType c, Method m, Type receiver) *************** *** 63,67 **** // clone is the only method overriden for arrays, where it is public. // (JLS-2 10.7) ! if (m.getName().equals("clone") && receiver.isArray()) return true; --- 65,69 ---- // clone is the only method overriden for arrays, where it is public. // (JLS-2 10.7) ! if (receiver != null && receiver.isArray() && m.getName().equals("clone")) return true; *************** *** 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); } --- 73,77 ---- // PROTECTED ! return (mod & PROTECTED) != 0 && c.isSubclass(target) && receiver.isSubtype(c); } |
From: Daniel B. <bo...@us...> - 2004-09-19 12:42:38
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30520/src/bossa/syntax Modified Files: NiceClass.java Log Message: Minor: removed useless variable. Index: NiceClass.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceClass.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** NiceClass.java 30 Jul 2004 20:05:10 -0000 1.83 --- NiceClass.java 19 Sep 2004 12:42:28 -0000 1.84 *************** *** 689,694 **** List res = new ArrayList(constructors.size()); ! int n = 0; ! for (Iterator i = constructors.iterator(); i.hasNext(); n++) { MethodDeclaration.Symbol m = (MethodDeclaration.Symbol) i.next(); --- 689,693 ---- List res = new ArrayList(constructors.size()); ! for (Iterator i = constructors.iterator(); i.hasNext();) { MethodDeclaration.Symbol m = (MethodDeclaration.Symbol) i.next(); |
From: Francis B. <fb...@us...> - 2004-09-18 10:19:10
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21962/src/nice/tools/doc Modified Files: htmlwriter.nice Log Message: There is now a new index page for the packages (as opposed to the index of packages). Definitions (eg, Methods, Classes, ...) are grouped according to the files they are in. Index: htmlwriter.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/htmlwriter.nice,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** htmlwriter.nice 7 Sep 2004 12:33:18 -0000 1.19 --- htmlwriter.nice 18 Sep 2004 10:18:59 -0000 1.20 *************** *** 200,206 **** --- 200,210 ---- } + /** + * Generate a list of source files + */ void write(bossa.modules.Package p) { try { File dir = new File(outdir, p.getName().replace('.',java.io.File.separator)); + //if the directory doesn't exist try to create it if(!dir.exists() && !dir.mkdirs()) { System.err.println("Error creating directory structure"); *************** *** 208,229 **** BufferedWriter writer = new BufferedWriter (new FileWriter(new File(dir, "index.html"))); ! writer.write(getHeader("Package " + p.getName())); ! //we need to separate class, methods, and global variables ! ArrayList<ClassDefinition.Class> classes = new ArrayList(); ! ArrayList<MethodDeclaration> methods = new ArrayList(); ! ArrayList<GlobalVarDeclaration> globalVars = new ArrayList(); for(Definition d : p.getDefinitions().definitions()) { ! if(d instanceof ClassDefinition.Class) { ! classes.add(d); ! } ! else if(d instanceof MethodDeclaration) { ! methods.add(d); ! } ! else if(d instanceof DefaultMethodImplementation) { ! methods.add(d.getDeclaration()); ! } ! else if(d instanceof GlobalVarDeclaration) { ! globalVars.add(d); } else { --- 212,260 ---- BufferedWriter writer = new BufferedWriter (new FileWriter(new File(dir, "index.html"))); ! ! String javascript = "<script type=\"text/javascript\">\n" + ! " function toggle(elem) {\n" + ! " //transform the string element into an element\n" + ! " elem = document.getElementById(elem);\n" + ! " if(elem.style.display != \"none\")\n" + ! " elem.style.display = \"none\";\n" + ! " else\n" + ! " elem.style.display = \"\";\n" + ! " }\n" + ! "</script>"; ! //temporary measure while stylesheets are broken ! String css = "<style type=\"text/css\">\n" + ! "h3.listheading {\n" + ! " font-size: medium;\n" + ! " margin: 0px 0px 0px 0px;\n" + ! "}\n" + ! "</style>\n"; ! ! writer.write(getHeader("Package " + p.getName(), javascript + css)); ! //create a list of source files in the package ! //we use a map instead of a set of definitions because ! //we also want keep a list of which files contain which definitions. ! Map<File, List<Definition>> map = new HashMap(); ! for(Definition d : p.getDefinitions().definitions()) { ! //we only display information about these types ! if(d instanceof ClassDefinition.Class || ! d instanceof MethodDeclaration || ! d instanceof DefaultMethodImplementation || ! d instanceof GlobalVarDeclaration) { ! //check that there is a file associated with this definition ! bossa.util.Location loc = d.location(); ! if(loc instanceof bossa.util.Location.File) { ! File file = loc.getFile(); ! if(!map.containsKey(file)) ! map.put(file, new LinkedList()); ! //although map.get() returns something of type ?List we know ! //that it cannot be null because we checked that with the ! //previous if statement. ! //here, we get the List associated with file, assert that it is ! //not null, and then add d to the list. ! notNull(map.get(file)).add(d); ! } } else { *************** *** 232,235 **** --- 263,304 ---- } + //we can look at both keys and values by enumerating the entries of the + //map. thanks to Core Java 2 Volume II - Advanced Features by Cay S. + //Horstmann and Gary Cornell. due to a lack of publishing details I'll + //just provide the ISBN: 0-13-092738-4 + Set<Map.Entry<File, List<Definition>>> entries = map.entrySet(); + Iterator<Map.Entry<File, List<Definition>>> iterator = entries.iterator(); + while(iterator.hasNext()) { + Map.Entry<File, List<Definition>> entry = iterator.next(); + File file = entry.getKey(); + List<Definition> list = entry.getValue(); + writer.write(sourceCodeFiles(file, list)); + } + + writer.write(getFooter()); + writer.close(); + } catch(IOException ioe) { + ioe.printStackTrace(); + } + } + + /** + * Writes a list of all classes, methods, and global variables + */ + void writeIndex(bossa.modules.Package p) { + try { + File dir = new File(outdir, p.getName().replace('.',java.io.File.separator)); + if(!dir.exists() && !dir.mkdirs()) { + System.err.println("Error creating directory structure"); + } + BufferedWriter writer = new BufferedWriter + (new FileWriter(new File(dir, "package-index.html"))); + writer.write(getHeader("Package " + p.getName())); + + //we need to separate class, methods, and global variables + (ArrayList<ClassDefinition.Class> classes, + ArrayList<MethodDeclaration> methods, + ArrayList<GlobalVarDeclaration> globalVars) = separateDefinitions(p.getDefinitions().definitions()); + //Write classes if(classes.size() > 0) { *************** *** 366,372 **** /** Returns a string containing everything required up to and including the <body> tag * @param title a String to be displayed in the browser's title bar * @param depth the number of levels down we are (required for linking the stylesheet) */ ! String getHeader(String title, int depth) { //we could also include some kind of visible header as well --- 435,442 ---- /** Returns a string containing everything required up to and including the <body> tag * @param title a String to be displayed in the browser's title bar + * @param misc a String containing any miscellaneous items (such as JavaScript, CSS, ...) * @param depth the number of levels down we are (required for linking the stylesheet) */ ! String getHeader(String title, ?String misc, int depth) { //we could also include some kind of visible header as well *************** *** 386,389 **** --- 456,460 ---- "\t<title>" title "</title>\n" + "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" depthstr "main.css\" />\n" + + (misc != null ? "\t" misc "\n" : "") + "</head>\n" + "<body>\n"; *************** *** 394,397 **** --- 465,476 ---- } + String getHeader(String title, String misc) { + return getHeader(title, misc, 0); + } + + String getHeader(String title, int depth) { + return getHeader(title, null, depth); + } + /** Returns a string containing everything after and including the </body> tag */ *************** *** 440,441 **** --- 519,616 ---- return num.toUpperCase(); } + + /** + * Takes a List of definitions and sorts them into class definitions, + * method declarations, and global variable declarations. + */ + (ArrayList<ClassDefinition.Class>, + ArrayList<MethodDeclaration>, + ArrayList<GlobalVarDeclaration>) separateDefinitions(List<Definition> definitions) { + ArrayList<ClassDefinition.Class> classes = new ArrayList(); + ArrayList<MethodDeclaration> methods = new ArrayList(); + ArrayList<GlobalVarDeclaration> globalVars = new ArrayList(); + for(Definition d : definitions) { + if(d instanceof ClassDefinition.Class) { + classes.add(d); + } + else if(d instanceof MethodDeclaration) { + methods.add(d); + } + else if(d instanceof DefaultMethodImplementation) { + methods.add(d.getDeclaration()); + } + else if(d instanceof GlobalVarDeclaration) { + globalVars.add(d); + } + else { + //System.err.println("Ignoring " d "\n (type " d.getClass() ")"); + } + } + return (classes, methods, globalVars); + } + + /** + * Given a file and a list of Definitions, this method generates the appropriate + * html starting and ending with the <ul> tag. + */ + String sourceCodeFiles(File file, List<Definition> definitions) { + + StringBuffer buffer = new StringBuffer(); + //we need to separate class, methods, and global variables + (ArrayList<ClassDefinition.Class> classes, + ArrayList<MethodDeclaration> methods, + ArrayList<GlobalVarDeclaration> globalVars) = separateDefinitions(definitions); + + //write file heading + buffer.append("<ul>\n"); + buffer.append(" <li><a href=\"javascript:toggle('" file.getName() "');\">" file.getName() "</a>\n"); + buffer.append(" <span id=\"" file.getName() "\" style=\"display: none;\">\n"); + + //write classes + if(classes.size() > 0) { + buffer.append(" <h3 class=\"listheading\"><a href=\"javascript:toggle('" file.getName() "Classes');\">Classes</a></h3>\n"); + buffer.append(" <span id=\"" file.getName() "Classes\" style=\"display: none;\">\n"); + buffer.append(" <ul>\n"); + for(ClassDefinition.Class c : classes) { + String s = c.getName().toString(); + int index = s.lastIndexOf('.'); + if(index != s.length()-1) + s = s.substring(index+1); + buffer.append(" <li><a href='" escapeFilename(s) ".html'>" htmlEncode(s) "</a></li>\n"); + } + buffer.append(" </ul>\n"); + buffer.append(" </span>\n"); + } + + //Write methods + if(methods.size() > 0) { + buffer.append(" <h3 class=\"listheading\"><a href=\"javascript:toggle('" file.getName() "Methods');\">Methods</a></h3>\n"); + buffer.append(" <span id=\"" file.getName() "Methods\" style=\"display: none;\">\n"); + buffer.append(" <ul>\n"); + for(MethodDeclaration m : methods) { + buffer.append(" <li><a href='" escapeFilename(getMethodFilename(m)) ".html'>" htmlEncode(m.getName()) "</a>" + + ": " htmlEncode(m.getType().toString()) "</li>\n"); + } + buffer.append(" </ul>\n"); + buffer.append(" </span>\n"); + } + + //Write global vars + if(globalVars.size() > 0) { + buffer.append(" <h3 class=\"listheading\"><a href=\"javascript:toggle('" file.getName() "GlobalVars');\">Global Variables</a></h3>\n"); + buffer.append(" <span id=\"" file.getName() "GlobalVars\" style=\"display: none;\">\n"); + buffer.append(" <ul>\n"); + for(GlobalVarDeclaration gv : globalVars) { + buffer.append(" <li><a href='gv_" escapeFilename("" gv.getName()) ".html'>" htmlEncode(gv.getName()) "</a></li>\n"); + } + buffer.append(" </ul>\n"); + buffer.append(" </span>\n"); + } + + //finish file heading tags + buffer.append(" </span>\n"); + buffer.append(" </li>"); + buffer.append("</ul>"); + + return buffer.toString(); + } \ No newline at end of file |
From: Francis B. <fb...@us...> - 2004-09-18 10:16:44
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21737/src/nice/tools/doc Modified Files: css.nice Log Message: Added stylesheet entry h3.listheading that isn't actually used yet. It will be used for the index page for packages. Index: css.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/css.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** css.nice 2 Sep 2004 12:52:13 -0000 1.1 --- css.nice 18 Sep 2004 10:16:35 -0000 1.2 *************** *** 21,23 **** --- 21,30 ---- "body {\n" + " /*background-color: #003300;*/\n" + + "}\n" + + "/*this could be used in the index page for a package" + + " *for Classes, Methods, and GlobalVar headings\n" + + " *not used a present because style sheets are broken*/\n" + + "h3.listheading {\n" + + " font-size: medium;\n" + + " margin: 0px 0px 0px 0px;\n" + "}\n"; \ No newline at end of file |
From: Arjan B. <ar...@us...> - 2004-09-17 18:22:09
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22797/F:/nice/stdlib/nice/lang Modified Files: java.nice Log Message: Retyping for StringBuffer.append. Index: java.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/java.nice,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** java.nice 7 Sep 2004 16:48:58 -0000 1.59 --- java.nice 17 Sep 2004 18:22:00 -0000 1.60 *************** *** 54,57 **** --- 54,58 ---- StringBuffer append(StringBuffer, char[] str, int offset, int len) = native StringBuffer StringBuffer.append(char[], int, int); + StringBuffer append(StringBuffer, char) = native StringBuffer StringBuffer.append(char); char[] toCharArray(String) = native char[] String.toCharArray(); String substring(StringBuffer, int) = |
From: Daniel B. <bo...@us...> - 2004-09-17 16:51:19
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4909/debian Modified Files: rules Log Message: Disable jikes warnings. Index: rules =================================================================== RCS file: /cvsroot/nice/Nice/debian/rules,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** rules 30 Jun 2004 10:15:27 -0000 1.10 --- rules 17 Sep 2004 16:51:08 -0000 1.11 *************** *** 24,28 **** # Ask javac to produce optimized code, but no debugging info # so that the package is smaller. ! $(MAKE) complete JAVAC_FLAGS="-O" java="kaffe" javac="jikes-classpath" NICE_ANTJAR=/usr/share/java/ant-1.6.jar #/usr/bin/docbook-to-man debian/nice.sgml > nice.1 --- 24,28 ---- # Ask javac to produce optimized code, but no debugging info # so that the package is smaller. ! $(MAKE) complete JAVAC_FLAGS="-O" java="kaffe" javac="jikes-classpath -nowarn" NICE_ANTJAR=/usr/share/java/ant-1.6.jar #/usr/bin/docbook-to-man debian/nice.sgml > nice.1 |
From: Arjan B. <ar...@us...> - 2004-09-17 16:31:50
|
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1020/F:/nice/src/bossa/modules Modified Files: JarCompiledContent.java Log Message: Don't use 'enum' as identifier. Index: JarCompiledContent.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/JarCompiledContent.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JarCompiledContent.java 23 Jul 2004 21:55:51 -0000 1.7 --- JarCompiledContent.java 17 Sep 2004 16:31:36 -0000 1.8 *************** *** 112,119 **** String pkgPrefix = pkg.getName().replace('.', '/') + "/"; ! java.util.Enumeration enum = jar.entries(); ! while(enum.hasMoreElements()) { ! JarEntry e = (JarEntry) enum.nextElement(); String fullname = e.getName(); if (fullname.startsWith(pkgPrefix) --- 112,119 ---- String pkgPrefix = pkg.getName().replace('.', '/') + "/"; ! java.util.Enumeration en = jar.entries(); ! while(en.hasMoreElements()) { ! JarEntry e = (JarEntry) en.nextElement(); String fullname = e.getName(); if (fullname.startsWith(pkgPrefix) |
From: Francis B. <fb...@us...> - 2004-09-17 13:50:24
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31286/web Modified Files: manual.xml Log Message: Fixed title of example in class casting section. Index: manual.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/manual.xml,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** manual.xml 16 Sep 2004 14:44:42 -0000 1.42 --- manual.xml 17 Sep 2004 13:50:15 -0000 1.43 *************** *** 1963,1967 **** </para> <example> ! <title>Title</title> <programlisting lang="nice"> void foo(FileOutputStream arg) {...} --- 1963,1967 ---- </para> <example> ! <title>Proving the type of an object</title> <programlisting lang="nice"> void foo(FileOutputStream arg) {...} |
From: Daniel B. <bo...@us...> - 2004-09-17 13:39:28
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29621/stdlib/nice/lang Modified Files: prelude.nice Log Message: Make 'void' abstract so it's not used in coverage testing. Index: prelude.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/prelude.nice,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** prelude.nice 30 Jul 2004 19:08:43 -0000 1.38 --- prelude.nice 17 Sep 2004 13:39:19 -0000 1.39 *************** *** 55,59 **** ****************************************************************/ ! final class void = native; final class boolean implements BooleanAlgebra, Comparable = native; --- 55,59 ---- ****************************************************************/ ! final abstract class void = native; final class boolean implements BooleanAlgebra, Comparable = native; |
From: Daniel B. <bo...@us...> - 2004-09-17 10:58:07
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28510/src/bossa/parser Modified Files: Parser.jj Log Message: Allow 'final abstract' classes (at least syntactically). Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.264 retrieving revision 1.265 diff -C2 -d -r1.264 -r1.265 *** Parser.jj 16 Sep 2004 21:25:59 -0000 1.264 --- Parser.jj 17 Sep 2004 10:57:56 -0000 1.265 *************** *** 1043,1051 **** | { boolean isFinal=false, isAbstract=false; } ! [ "final" { isFinal=true; } ! | "abstract" { isAbstract=true; } ! ] "class" ! name=ident() [ parameters=classTypeParameters(cst, typeParametersVariances) ] --- 1043,1050 ---- | { boolean isFinal=false, isAbstract=false; } ! [ "final" { isFinal=true; } ] ! [ "abstract" { isAbstract=true; } ] "class" ! name=ident() [ parameters=classTypeParameters(cst, typeParametersVariances) ] |
From: Daniel B. <bo...@us...> - 2004-09-17 10:23:35
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22009/src/bossa/parser Removed Files: Java1.1.jj Log Message: Remove Java 1.1 grammar to avoid confusion, since it's not used in any way. --- Java1.1.jj DELETED --- |
From: Arjan B. <ar...@us...> - 2004-09-16 21:26:10
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4880/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Give semantic error on empty custom constructor. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.263 retrieving revision 1.264 diff -C2 -d -r1.263 -r1.264 *** Parser.jj 3 Sep 2004 18:07:24 -0000 1.263 --- Parser.jj 16 Sep 2004 21:25:59 -0000 1.264 *************** *** 1136,1140 **** | "{" ! ( stmt=BlockStatement(statements) { statements.add(stmt); } )+ "}" ) --- 1136,1140 ---- | "{" ! ( stmt=BlockStatement(statements) { statements.add(stmt); } )* "}" ) |
From: Arjan B. <ar...@us...> - 2004-09-16 21:26:10
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4880/F:/nice/src/bossa/syntax Modified Files: tools.nice Log Message: Give semantic error on empty custom constructor. Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** tools.nice 2 Sep 2004 19:12:09 -0000 1.50 --- tools.nice 16 Sep 2004 21:25:59 -0000 1.51 *************** *** 140,145 **** --- 140,153 ---- void resolveCCThis(Statement stmt, Located thisLoc, NiceClass classe) { + void missingThisError() + { + User.error(thisLoc, "The last statement must be a call to 'this' constructor"); + } + Block block = cast(stmt); + if (block.statements.length == 0) + missingThisError(); + Statement last = block.last; if (last instanceof Block) *************** *** 149,157 **** } - void missingThisError() - { - User.error(thisLoc, "The last statement must be a call to 'this' constructor"); - } - if (! (last instanceof ExpressionStmt)) missingThisError(); --- 157,160 ---- |
From: Daniel B. <bo...@us...> - 2004-09-16 14:44:52
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14641/web Modified Files: manual.xml Log Message: Cleanup. Index: manual.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/manual.xml,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** manual.xml 16 Sep 2004 14:24:23 -0000 1.41 --- manual.xml 16 Sep 2004 14:44:42 -0000 1.42 *************** *** 1,5 **** <?xml version="1.0" standalone="no"?> ! <!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.1.2//EN' ! 'http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd' [ <!ENTITY nice "Nice"> <!ENTITY java "Java"> --- 1,5 ---- <?xml version="1.0" standalone="no"?> ! <!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.1.2//EN' ! 'http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd' [ <!ENTITY nice "Nice"> <!ENTITY java "Java"> *************** *** 16,20 **** <author><firstname>Daniel</firstname><surname>Bonniot</surname></author> <author><firstname>Bryn</firstname><surname>Keller</surname></author> ! <author><firstname>Francis></firstname><surname>Barber</surname></author> <copyright><year>2003</year><holder>Daniel Bonniot</holder></copyright> </bookinfo> --- 16,20 ---- <author><firstname>Daniel</firstname><surname>Bonniot</surname></author> <author><firstname>Bryn</firstname><surname>Keller</surname></author> ! <author><firstname>Francis</firstname><surname>Barber</surname></author> <copyright><year>2003</year><holder>Daniel Bonniot</holder></copyright> </bookinfo> |
From: Francis B. <fb...@us...> - 2004-09-16 14:24:33
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10806/web Modified Files: manual.xml Log Message: Added myself to the authors paragraph. Index: manual.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/manual.xml,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** manual.xml 16 Sep 2004 14:21:27 -0000 1.40 --- manual.xml 16 Sep 2004 14:24:23 -0000 1.41 *************** *** 32,36 **** <para> ! The authors of this manual are Bryn Keller and Daniel Bonniot. </para> </preface> --- 32,37 ---- <para> ! The authors of this manual are Bryn Keller and Daniel Bonniot, with ! contributions from Francis Barber. </para> </preface> |
From: Francis B. <fb...@us...> - 2004-09-16 14:21:37
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10377/web Modified Files: manual.xml Log Message: Added a section explaining the absence of class casting in Nice. Index: manual.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/manual.xml,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** manual.xml 2 Sep 2004 16:48:58 -0000 1.39 --- manual.xml 16 Sep 2004 14:21:27 -0000 1.40 *************** *** 16,19 **** --- 16,20 ---- <author><firstname>Daniel</firstname><surname>Bonniot</surname></author> <author><firstname>Bryn</firstname><surname>Keller</surname></author> + <author><firstname>Francis></firstname><surname>Barber</surname></author> <copyright><year>2003</year><holder>Daniel Bonniot</holder></copyright> </bookinfo> *************** *** 1950,1953 **** --- 1951,1991 ---- </para> </section> + + <section id="classCasting"><title>Class Casting</title> + <para> + Class casting is not used in Nice. Similar to <link + linkend="optionTypes">Option types</link> and nullness, if the compiler + can prove that the type of an object is compatible with the target + context, it will allow that object to be used. This can be done using + the <literal>instanceof</literal> operator and an <literal>if</literal> + statement: + </para> + <example> + <title>Title</title> + <programlisting lang="nice"> + void foo(FileOutputStream arg) {...} + + void bar(OutputStream arg) { + if (arg instanceof FileOutputStream) { + //Here Nice knows arg is a FileOutputStream, so it can + // be passed to a method which takes a FileOutputStream. + foo(arg); + } + foo(arg); //Here arg may or may not be a FileOutputStream, + //so Nice gives a compilation error. + } + </programlisting> + </example> + <para> + As with <link linkend="optionTypes">Option types</link>, type inference + doesn't work on fields of objects or on method calls, only on local + variables. There's a good reason for this: the value of an instance + variable may have changed (updated by another thread, perhaps) between + the time the value was checked for its type and the time it is actually + used. Similarly, method calls can return objects of different sub-types + every time they are called. To avoid this problem, simply assign the + value to a local variable first. + </para> + </section> <section id = "typeParameters"><title>Type Parameters</title> *************** *** 2199,2201 **** sgml-validate-command: "xmllint -noout -valid" End: ! --> --- 2237,2239 ---- sgml-validate-command: "xmllint -noout -valid" End: ! --> \ No newline at end of file |
From: Daniel B. <bo...@us...> - 2004-09-16 11:28:03
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/variables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3468/testsuite/compiler/statements/variables Added Files: scoping.testsuite Log Message: Testcases for multiple definitions of local variables and method parameters. --- NEW FILE: scoping.testsuite --- /// FAIL int x = 0; if (x > 1) { int /*/// FAIL HERE */ x = 1; x++; } /// FAIL bug /// Toplevel void foo(int x) { int /*/// FAIL HERE */ x = 2; x++; } |
From: Daniel B. <bo...@us...> - 2004-09-15 20:42:40
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv708/debian Modified Files: control Log Message: Suggest gcj 3.4 Index: control =================================================================== RCS file: /cvsroot/nice/Nice/debian/control,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** control 13 Aug 2004 17:25:05 -0000 1.20 --- control 15 Sep 2004 20:42:22 -0000 1.21 *************** *** 9,13 **** Architecture: all Depends: kaffe | java-virtual-machine, kaffe | java1-runtime | java2-runtime ! Suggests: emacsen, ant Description: Extension of Java with parametric types, multi-methods, and more Nice is a new object-oriented programming language. --- 9,13 ---- Architecture: all Depends: kaffe | java-virtual-machine, kaffe | java1-runtime | java2-runtime ! Suggests: emacsen, ant, gcj-3.4 Description: Extension of Java with parametric types, multi-methods, and more Nice is a new object-oriented programming language. |
From: Daniel B. <bo...@us...> - 2004-09-15 19:20:34
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14902/stdlib/nice/lang Modified Files: slice.nice ForInIters.nice Log Message: Make sure that finite literal ranges have a static subtype of List. Index: ForInIters.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/ForInIters.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ForInIters.nice 15 Sep 2004 17:46:55 -0000 1.9 --- ForInIters.nice 15 Sep 2004 19:20:25 -0000 1.10 *************** *** 28,31 **** --- 28,34 ---- Iterator<int> forIterator(OpenRange<int> range) = range.openIterator(); + // Resolve the ambiguity for Ranges + override Iterator<int> forIterator(Range<int> range) = range.openIterator(); + //The implementations of additional Iterators /* Index: slice.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/slice.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** slice.nice 13 Aug 2004 06:24:39 -0000 1.1 --- slice.nice 15 Sep 2004 19:20:25 -0000 1.2 *************** *** 58,73 **** } ! public OpenRange<int> `..`(int begin, ?int end) requires end == null || end >= 0, ! begin >= 0 { let beginIndex = new Index(index: begin, relativeToEnd: false); ! let endIndex = end == null ? ! new Index(index: 0, relativeToEnd: true) ! :new Index(index: end, relativeToEnd: false); ! if (end == null) ! return new OpenRange(begin: beginIndex, end: endIndex); ! else ! return new Range(begin: beginIndex, end: endIndex); } --- 58,77 ---- } ! public OpenRange<int> `..`(int begin, ?int end) requires end == null || end >= 0, ! begin >= 0; ! ! `..`(int begin, null) { let beginIndex = new Index(index: begin, relativeToEnd: false); ! let endIndex = new Index(index: 0, relativeToEnd: true); ! return new OpenRange(begin: beginIndex, end: endIndex); ! } ! ! public override Range<int> `..`(int begin, int end) ! { ! let beginIndex = new Index(index: begin, relativeToEnd: false); ! let endIndex = new Index(index: end, relativeToEnd: false); ! return new Range(begin: beginIndex, end: endIndex); } |