nice-commit Mailing List for The Nice Programming Language (Page 10)
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: Arjan B. <ar...@us...> - 2005-03-31 21:10:35
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19986/F:/nice/src/mlsub/typing Modified Files: MonotypeLeqEx.java Log Message: Lazy generation of error message. Index: MonotypeLeqEx.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/MonotypeLeqEx.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MonotypeLeqEx.java 25 Sep 2001 14:14:52 -0000 1.2 --- MonotypeLeqEx.java 31 Mar 2005 21:10:09 -0000 1.3 *************** *** 21,31 **** mlsub.typing.lowlevel.Unsatisfiable origin) { ! super(m1 + " <: " + m2 + " because of " + origin); this.m1 = m1; this.m2 = m2; } public Monotype m1, m2; public Monotype getM1() { return m1; } --- 21,38 ---- mlsub.typing.lowlevel.Unsatisfiable origin) { ! super(""); ! this.origin = origin; this.m1 = m1; this.m2 = m2; } + mlsub.typing.lowlevel.Unsatisfiable origin; public Monotype m1, m2; + public String getMessage() + { + return m1 + " <: " + m2 + " because of " + origin; + } + public Monotype getM1() { return m1; } |
From: Daniel B. <bo...@us...> - 2005-03-31 21:08:41
|
Update of /cvsroot/nice/Nice/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18014/bin Modified Files: nicec.bat nicec Log Message: Bump up initial heap size to 32M. Index: nicec.bat =================================================================== RCS file: /cvsroot/nice/Nice/bin/nicec.bat,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** nicec.bat 16 Jan 2005 01:03:35 -0000 1.19 --- nicec.bat 31 Mar 2005 21:07:56 -0000 1.20 *************** *** 15,19 **** :gotNice ! java -Xms8M -classpath "%NICEPATH%\nice.jar;%CLASSPATH%" nice.tools.compiler.console.dispatch --runtime="%NICEPATH%\nice.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9 :end --- 15,19 ---- :gotNice ! java -Xms32M -classpath "%NICEPATH%\nice.jar;%CLASSPATH%" nice.tools.compiler.console.dispatch --runtime="%NICEPATH%\nice.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9 :end Index: nicec =================================================================== RCS file: /cvsroot/nice/Nice/bin/nicec,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** nicec 30 Jul 2004 15:38:45 -0000 1.41 --- nicec 31 Mar 2005 21:07:58 -0000 1.42 *************** *** 35,39 **** ## Parsing special command line arguments ! java=${JAVA-java -Xms8M} scriptName="$0" progname=`basename $scriptName` --- 35,39 ---- ## Parsing special command line arguments ! java=${JAVA-java -Xms32M} scriptName="$0" progname=`basename $scriptName` |
From: Daniel B. <bo...@us...> - 2005-03-31 19:22:11
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20254 Modified Files: Makefile Log Message: Use relative paths in nicec and most javac calls. Just looks better ;-) Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/Makefile,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** Makefile 7 Mar 2005 12:15:25 -0000 1.162 --- Makefile 31 Mar 2005 19:21:43 -0000 1.163 *************** *** 21,26 **** fi } ! SHELL = /bin/sh ! TOP=${PWD} java = java --- 21,26 ---- fi } ! SHELL := /bin/sh ! PWD := $(shell pwd) java = java *************** *** 30,41 **** JAVAC_FLAGS = -O -g ! JAVAC_GENERIC= ${javac} -classpath "${TOP}/classes:${TOP}/classes.old" -sourcepath "${TOP}/src:${TOP}/stdlib" $(JAVAC_FLAGS) ! JAVAC= ${JAVAC_GENERIC} -d "${TOP}/classes" JAVADOC=javadoc ! NICEC_ARGS= --exclude-runtime ! NICEC=CLASSPATH="${TOP}/classes" JAVA="${java} -Dnice.inlined=classes-inline" ./bin/nicec.bootstrap ${NICEC_ARGS} -d "${TOP}/classes.old" --sourcepath="${TOP}/stdlib.old:${TOP}/stdlib:${TOP}/src.old:${TOP}/src" --classpath="${TOP}/classes" ! NICEC1=JAVA="${java}" ${TOP}/bin/nicec ${NICEC_ARGS} -d "${TOP}/classes" --sourcepath="${TOP}/stdlib:${TOP}/src" --- 30,42 ---- JAVAC_FLAGS = -O -g ! JAVAC_GENERIC= ${javac} -classpath "${PWD}/classes:${PWD}/classes.old" -sourcepath "${PWD}/src:${PWD}/stdlib" ${JAVAC_FLAGS} ! JAVAC= ${JAVAC_GENERIC} -d "${PWD}/classes" JAVADOC=javadoc ! NICEC_ARGS= --exclude-runtime ! NICEC=CLASSPATH=classes JAVA="${java} -Dnice.inlined=classes-inline" bin/nicec.bootstrap ${NICEC_ARGS} -d classes.old --sourcepath=stdlib.old:stdlib:src.old:src --classpath=classes ! NICEC1=JAVA="${java}" bin/nicec ${NICEC_ARGS} -d classes --sourcepath=stdlib:src + MANIFEST = src/nice/tools/compiler/Manifest *************** *** 73,77 **** mkdir -p share/java cp src/nice/tools/compiler/console.jar share/java/nice.jar ! $(jar) umf src/nice/tools/compiler/Manifest share/java/nice.jar -C classes nice -C classes mlsub -C classes bossa -C classes gnu -C classes.old bossa -C classes.old mlsub -C classes.old nice if [ -r classes/lang/package.nicei ]; then cd classes; $(jar) uf ../share/java/nice.jar nice/*/package.nicei; fi --- 74,78 ---- mkdir -p share/java cp src/nice/tools/compiler/console.jar share/java/nice.jar ! $(jar) umf $(MANIFEST) share/java/nice.jar -C classes nice -C classes mlsub -C classes bossa -C classes gnu -C classes.old bossa -C classes.old mlsub -C classes.old nice if [ -r classes/lang/package.nicei ]; then cd classes; $(jar) uf ../share/java/nice.jar nice/*/package.nicei; fi *************** *** 79,83 **** mkdir -p share/java cp src/nice/tools/compiler/console.jar share/java/nice.jar ! $(jar) umf src/nice/tools/compiler/Manifest share/java/nice.jar -C classes nice -C classes mlsub -C classes bossa -C classes gnu if [ -r classes/lang/package.nicei ]; then cd classes; $(jar) uf ../share/java/nice.jar nice/*/package.nicei; fi --- 80,84 ---- mkdir -p share/java cp src/nice/tools/compiler/console.jar share/java/nice.jar ! $(jar) umf $(MANIFEST) share/java/nice.jar -C classes nice -C classes mlsub -C classes bossa -C classes gnu if [ -r classes/lang/package.nicei ]; then cd classes; $(jar) uf ../share/java/nice.jar nice/*/package.nicei; fi *************** *** 96,100 **** setDate: ! cd src; ${JAVAC} nice/tools/compiler/JavaVersion.java ${java} -classpath classes nice.tools.compiler.JavaVersion > src/nice/tools/compiler/javaVersion @echo "We are using compiler `cat src/nice/tools/compiler/javaVersion` (at least our java version let us assume that)" --- 97,101 ---- setDate: ! ${JAVAC} src/nice/tools/compiler/JavaVersion.java ${java} -classpath classes nice.tools.compiler.JavaVersion > src/nice/tools/compiler/javaVersion @echo "We are using compiler `cat src/nice/tools/compiler/javaVersion` (at least our java version let us assume that)" *************** *** 120,129 **** gcj: cp src/nice/tools/compiler/console.jar $(GCJTEMP) ! $(jar) umf src/mainClass $(GCJTEMP) -C classes nice/doc -C classes nice/getopt -C classes nice/lang -C classes nice/tools/ast -C classes nice/tools/code -C classes nice/tools/compiler -C classes nice/tools/util -C classes mlsub -C classes bossa -C classes gnu ! $(GCJ) --main=nice.tools.compiler.fun -o bin/nicec.bin $(GCJTEMP) gcj-testsuite: cp src/nice/tools/compiler/console.jar $(GCJTEMP) ! $(jar) umf src/mainClass $(GCJTEMP) -C classes nice/doc -C classes nice/getopt -C classes nice/lang -C classes nice/tools/ast -C classes nice/tools/code -C classes nice/tools/compiler -C classes nice/tools/util -C classes nice/tools/testsuite -C classes mlsub -C classes bossa -C classes gnu $(GCJ) -g --main=nice.tools.testsuite.TestNice -o bin/testsuite.bin $(GCJTEMP) --- 121,130 ---- gcj: cp src/nice/tools/compiler/console.jar $(GCJTEMP) ! $(jar) umf $(MANIFEST) $(GCJTEMP) -C classes nice/doc -C classes nice/getopt -C classes nice/lang -C classes nice/tools/ast -C classes nice/tools/code -C classes nice/tools/compiler -C classes nice/tools/util -C classes nice/tools/typing -C classes mlsub -C classes bossa -C classes gnu ! $(GCJ) --main=nice.tools.compiler.console.fun -o bin/nicec.bin $(GCJTEMP) gcj-testsuite: cp src/nice/tools/compiler/console.jar $(GCJTEMP) ! $(jar) umf src/mainClass $(GCJTEMP) -C classes nice/doc -C classes nice/getopt -C classes nice/lang -C classes nice/tools/ast -C classes nice/tools/code -C classes nice/tools/compiler -C classes nice/tools/util -C classes nice/tools/testsuite -C classes nice/tools/typing -C classes mlsub -C classes bossa -C classes gnu $(GCJ) -g --main=nice.tools.testsuite.TestNice -o bin/testsuite.bin $(GCJTEMP) *************** *** 133,137 **** rm -f bin/{nicedoc,niceunit} [ -r src/bossa/syntax/dispatch.java ] && mv src/bossa/syntax/dispatch.java src/bossa/syntax/dispatch.java.bootstrap || true ! find "${TOP}" \( -name "*.class" -o -name "*.nicei" -o -name "*~" \) -exec rm {} \; --- 134,138 ---- rm -f bin/{nicedoc,niceunit} [ -r src/bossa/syntax/dispatch.java ] && mv src/bossa/syntax/dispatch.java src/bossa/syntax/dispatch.java.bootstrap || true ! find . \( -name "*.class" -o -name "*.nicei" -o -name "*~" \) -exec rm {} \; *************** *** 187,191 **** src/bossa/parser/Parser.java: src/bossa/parser/Parser.jj ! cd src/bossa/parser; CLASSPATH=`TOP=${TOP} ${TOP}/external/javacc` \ ${java} javacc Parser.jj --- 188,192 ---- src/bossa/parser/Parser.java: src/bossa/parser/Parser.jj ! cd src/bossa/parser; CLASSPATH=`TOP=${PWD} ${PWD}/external/javacc` \ ${java} javacc Parser.jj *************** *** 220,223 **** --- 221,227 ---- echo "Compilation of the testsuite engine failed." + visibility: + $(NICEC1) -a visibility.jar nice.tools.visibility + #**************************************************************** *************** *** 228,232 **** # has no -[X]depend dep: ! cd src; ${JAVAC} bossa/modules/Package.java parser: src/bossa/parser/Parser.java --- 232,236 ---- # has no -[X]depend dep: ! ${JAVAC} src/bossa/modules/Package.java parser: src/bossa/parser/Parser.java *************** *** 241,245 **** recompileSTDLIB: ! ${JAVAC} "${TOP}"/stdlib/nice/lang/*.java # Compile individual files with: F=file.java make compile --- 245,249 ---- recompileSTDLIB: ! ${JAVAC} stdlib/nice/lang/*.java # Compile individual files with: F=file.java make compile *************** *** 261,266 **** mkdir -p doc cd src; ${JAVADOC} -windowtitle "Nice" -doctitle "The Nice compiler source" \ ! -overview "${TOP}"/src/overview.html \ ! -d "${TOP}"/doc -private -author -version \ nice.tools.code \ mlsub.typing mlsub.typing.lowlevel mlsub.compilation \ --- 265,270 ---- mkdir -p doc cd src; ${JAVADOC} -windowtitle "Nice" -doctitle "The Nice compiler source" \ ! -overview src/overview.html \ ! -d doc -private -author -version \ nice.tools.code \ mlsub.typing mlsub.typing.lowlevel mlsub.compilation \ |
From: Arjan B. <ar...@us...> - 2005-03-31 09:26:48
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7374/F:/nice/src/mlsub/typing/lowlevel Modified Files: DomainVector.java K0.java Log Message: Replaced Vector with ArrayList. Index: K0.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/K0.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** K0.java 30 Mar 2005 23:08:16 -0000 1.28 --- K0.java 31 Mar 2005 09:26:39 -0000 1.29 *************** *** 1,5 **** package mlsub.typing.lowlevel; ! import java.util.Vector; /** --- 1,5 ---- package mlsub.typing.lowlevel; ! import java.util.ArrayList; /** *************** *** 77,81 **** this.posTagged = new BitVector(); this.negTagged = new BitVector(); ! this.interfaces = new Vector(); if (debugK0) { System.err.println("created K0 #" + ID); --- 77,81 ---- this.posTagged = new BitVector(); this.negTagged = new BitVector(); ! this.interfaces = new ArrayList(); if (debugK0) { System.err.println("created K0 #" + ID); *************** *** 388,392 **** Ct.setSize(n); if (domains != null) { ! domains.setSize(n - m); } garbage.truncate(n); --- 388,392 ---- Ct.setSize(n); if (domains != null) { ! domains.truncate(n - m); } garbage.truncate(n); *************** *** 469,473 **** // a vector of all the Interfaces in this constraint ! private Vector interfaces; /** * Returns the number of interfaces. Interfaces are garanteed to be --- 469,473 ---- // a vector of all the Interfaces in this constraint ! private ArrayList interfaces; /** * Returns the number of interfaces. Interfaces are garanteed to be *************** *** 480,484 **** // assume 0 <= iid < nInterfaces() Interface getInterface(int iid) { ! return (Interface)interfaces.elementAt(iid); } --- 480,484 ---- // assume 0 <= iid < nInterfaces() Interface getInterface(int iid) { ! return (Interface)interfaces.get(iid); } *************** *** 497,501 **** int iid = nInterfaces(); Interface iface = new Interface(this, iid); ! interfaces.addElement(iface); if (debugK0) { System.err.println("newInterface in #" + ID + " -> " + iid); --- 497,501 ---- int iid = nInterfaces(); Interface iface = new Interface(this, iid); ! interfaces.add(iface); if (debugK0) { System.err.println("newInterface in #" + ID + " -> " + iid); Index: DomainVector.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/DomainVector.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DomainVector.java 30 Mar 2005 23:08:16 -0000 1.6 --- DomainVector.java 31 Mar 2005 09:26:39 -0000 1.7 *************** *** 11,15 **** * @author Alexandre Frey **/ ! final class DomainVector extends java.util.Vector { int offset; // offset int width; // size of domains --- 11,15 ---- * @author Alexandre Frey **/ ! final class DomainVector extends java.util.ArrayList { int offset; // offset int width; // size of domains *************** *** 21,28 **** public DomainVector(int offset, int width, int n) { super(n); - setSize(n); //if (width > 0) { for (int i = 0; i < n; i++) { ! setElementAt(new Domain(width), i); } //} --- 21,27 ---- public DomainVector(int offset, int width, int n) { super(n); //if (width > 0) { for (int i = 0; i < n; i++) { ! add(new Domain(width)); } //} *************** *** 31,35 **** } public Domain getDomain(int x) { ! return (Domain)elementAt(x - offset); } --- 30,39 ---- } public Domain getDomain(int x) { ! return (Domain)get(x - offset); ! } ! ! void truncate(int x) ! { ! removeRange(x, size()); } *************** *** 42,46 **** public void clear(int x) { ! setElementAt(null, x - offset); } public void reduce(int x, boolean unit, BitVector domain) --- 46,50 ---- public void clear(int x) { ! set(x - offset, null); } public void reduce(int x, boolean unit, BitVector domain) *************** *** 72,77 **** public void exclude(int value) throws LowlevelUnsatisfiable { ! for (int i = 0; i < elementCount; i++) { ! Domain d = (Domain)elementData[i]; if (d != null) { d.exclude(value); --- 76,81 ---- public void exclude(int value) throws LowlevelUnsatisfiable { ! for (int i = 0; i < size(); i++) { ! Domain d = (Domain)get(i); if (d != null) { d.exclude(value); *************** *** 82,91 **** S.assume(S.a&& isValidSoft(src)); S.assume(S.a&& isGarbage(dest)); ! setElementAt(getDomain(src), dest - offset); clear(src); } public void extend() { // if (width > 0) { ! addElement(new Domain(width)); //} else { //addElement(null); --- 86,95 ---- S.assume(S.a&& isValidSoft(src)); S.assume(S.a&& isGarbage(dest)); ! set(dest - offset, getDomain(src)); clear(src); } public void extend() { // if (width > 0) { ! add(new Domain(width)); //} else { //addElement(null); *************** *** 95,102 **** public Object clone() { DomainVector result = (DomainVector)super.clone(); ! for (int i = 0; i < elementCount; i++) { ! Domain d = ((Domain)elementData[i]); if (d != null) { ! result.elementData[i] = new Domain(d); } } --- 99,106 ---- public Object clone() { DomainVector result = (DomainVector)super.clone(); ! for (int i = 0; i < size(); i++) { ! Domain d = ((Domain)get(i)); if (d != null) { ! result.set(i, new Domain(d)); } } *************** *** 132,136 **** // and intersect the domain of all element j above x with ideal ! for (int j = offset; j < offset + elementCount; j++) { Domain dj = getDomain(j); if (dj != null && C.get(x, j)) { --- 136,140 ---- // and intersect the domain of all element j above x with ideal ! for (int j = offset; j < offset + size(); j++) { Domain dj = getDomain(j); if (dj != null && C.get(x, j)) { *************** *** 172,177 **** void initGfpCardinals() { ! for (int i = 0; i < elementCount; i++) { ! Domain d = (Domain)elementData[i]; if (d != null) { d.initGfpCardinals(); --- 176,181 ---- void initGfpCardinals() { ! for (int i = 0; i < size(); i++) { ! Domain d = (Domain)get(i); if (d != null) { d.initGfpCardinals(); *************** *** 197,203 **** int leastCard = Integer.MAX_VALUE; int least = Integer.MIN_VALUE; ! for (int i = 0; i < elementCount; i++) { if (set == null || set.get(i + offset)) { ! Domain d = (Domain)elementAt(i); if (d != null){ int card = d.cardinal(); --- 201,207 ---- int leastCard = Integer.MAX_VALUE; int least = Integer.MIN_VALUE; ! for (int i = 0; i < size(); i++) { if (set == null || set.get(i + offset)) { ! Domain d = (Domain)get(i); if (d != null){ int card = d.cardinal(); *************** *** 217,227 **** Separator sep = new Separator(", "); StringBuffer sb = new StringBuffer(); ! for (int i = 0; i < elementCount; i++) { ! if (elementData[i] != null) { sb.append(sep) .append("D(") .append(i + offset) .append(") = ") ! .append(elementData[i]); } } --- 221,231 ---- Separator sep = new Separator(", "); StringBuffer sb = new StringBuffer(); ! for (int i = 0; i < size(); i++) { ! if (get(i) != null) { sb.append(sep) .append("D(") .append(i + offset) .append(") = ") ! .append(get(i)); } } |
From: Daniel B. <bo...@us...> - 2005-03-31 07:29:35
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10724 Modified Files: run Log Message: Display kaffe version Index: run =================================================================== RCS file: /cvsroot/nice/tester/run,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** run 22 Mar 2005 23:38:20 -0000 1.15 --- run 31 Mar 2005 07:29:26 -0000 1.16 *************** *** 122,125 **** --- 122,128 ---- "$GCJ" --version | head -1 >> $machine.id fi + if [ "$KAFFE_HOME" ]; then + echo kaffe CVS `"$KAFFE_HOME"/bin/kaffe -fullversion 2>&1|tail -1|cut -c 22-31` >> $machine.id + fi # Send the results to the Test Central |
From: Arjan B. <ar...@us...> - 2005-03-30 23:08:29
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23840/F:/nice/src/mlsub/typing/lowlevel Modified Files: BitMatrix.java BitVector.java Domain.java DomainVector.java K0.java Satisfier.java Log Message: Copy-constructor for BitVector. Index: Domain.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Domain.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Domain.java 29 Mar 2005 22:51:57 -0000 1.6 --- Domain.java 30 Mar 2005 23:08:16 -0000 1.7 *************** *** 32,35 **** --- 32,45 ---- } + /** + * Creates a copy of a Domain. + **/ + public Domain(Domain old) { + super(old); + this.containsUnit = old.containsUnit; + this.cardUp = old.cardUp; + this.cardDown = old.cardDown; + } + // size of this domain (possibly including unit) int cardinal() { *************** *** 224,239 **** } - public Domain cloneDomain() { - Domain result = new Domain(0); - this.copyTo(result); - return result; - } - - private void copyTo(Domain result) { - super.copyTo(result); - - result.containsUnit = containsUnit; - result.cardUp = cardUp; - result.cardDown = cardDown; - } } --- 234,236 ---- Index: DomainVector.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/DomainVector.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DomainVector.java 29 Mar 2005 22:51:57 -0000 1.5 --- DomainVector.java 30 Mar 2005 23:08:16 -0000 1.6 *************** *** 98,102 **** Domain d = ((Domain)elementData[i]); if (d != null) { ! result.elementData[i] = d.cloneDomain(); } } --- 98,102 ---- Domain d = ((Domain)elementData[i]); if (d != null) { ! result.elementData[i] = new Domain(d); } } Index: Satisfier.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Satisfier.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Satisfier.java 29 Mar 2005 22:51:57 -0000 1.3 --- Satisfier.java 30 Mar 2005 23:08:17 -0000 1.4 *************** *** 45,49 **** } } ! Domain dx = domains.getDomain(x).cloneDomain(); for (int a = dx.getLowestSetBit(); a >= 0; --- 45,49 ---- } } ! Domain dx = new Domain(domains.getDomain(x)); for (int a = dx.getLowestSetBit(); a >= 0; *************** *** 89,93 **** throw LowlevelUnsatisfiable.instance; } ! Domain dx = domains.getDomain(x).cloneDomain(); // iterate through the elements of dx for (int a = dx.getLowestSetBit(); --- 89,93 ---- throw LowlevelUnsatisfiable.instance; } ! Domain dx = new Domain(domains.getDomain(x)); // iterate through the elements of dx for (int a = dx.getLowestSetBit(); Index: BitVector.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/BitVector.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** BitVector.java 30 Mar 2005 18:02:41 -0000 1.12 --- BitVector.java 30 Mar 2005 23:08:11 -0000 1.13 *************** *** 83,86 **** --- 83,105 ---- /** + * Creates a copy of a BitVector. + */ + public BitVector(BitVector old) { + if (old.bits1 == null) + { + this.bits0 = old.bits0; + this.bits1 = null; + } + else + { + this.bits0 = 0L; + // optim: shrink to nonZeroLength()? + int n = old.bits1.length; + this.bits1 = new long[n]; + System.arraycopy(old.bits1, 0, this.bits1, 0, n); + } + } + + /** * Ensures that the BitVector can hold at least an nth bit. * This cannot leave the bits array at length 0. *************** *** 522,548 **** } - - - /** - * Clones the BitVector. - */ - public BitVector cloneVector() { - BitVector result = new BitVector(); - this.copyTo(result); - return result; - } - - public void copyTo(BitVector result) { - if (bits1 == null) - result.bits0 = bits0; - else - { - // optim: shrink to nonZeroLength()? - int n = length(); - result.bits1 = new long[n]; - System.arraycopy(bits1, 0, result.bits1, 0, n); - } - } - /** * Converts the BitVector to a String. --- 541,544 ---- *************** *** 794,800 **** **/ public boolean isEmpty() { ! int n = length(); for (int i = 0; i < n; i++) { ! if (getW(i) != 0L) { return false; } --- 790,799 ---- **/ public boolean isEmpty() { ! if (bits1 == null) ! return bits0 == 0L; ! ! int n = bits1.length; for (int i = 0; i < n; i++) { ! if (bits1[i] != 0L) { return false; } Index: K0.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/K0.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** K0.java 30 Mar 2005 21:24:02 -0000 1.27 --- K0.java 30 Mar 2005 23:08:16 -0000 1.28 *************** *** 1272,1276 **** for (int iid = 0; iid < nInterfaces(); iid++) { BitVector I_impls = getInterface(iid).implementors; ! rigidImplementors[iid] = I_impls.cloneVector(); for (int x = I_impls.getLowestSetBit(); x != BitVector.UNDEFINED_INDEX; --- 1272,1276 ---- for (int iid = 0; iid < nInterfaces(); iid++) { BitVector I_impls = getInterface(iid).implementors; ! rigidImplementors[iid] = new BitVector(I_impls); for (int x = I_impls.getLowestSetBit(); x != BitVector.UNDEFINED_INDEX; *************** *** 1358,1362 **** this.savedC = new BitMatrix(K0.this.C); ! this.savedGarbage = K0.this.garbage.cloneVector(); this.savedDomains = (DomainVector)K0.this.domains.clone(); /* --- 1358,1362 ---- this.savedC = new BitMatrix(K0.this.C); ! this.savedGarbage = new BitVector(K0.this.garbage); this.savedDomains = (DomainVector)K0.this.domains.clone(); /* Index: BitMatrix.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/BitMatrix.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** BitMatrix.java 30 Mar 2005 21:23:58 -0000 1.10 --- BitMatrix.java 30 Mar 2005 23:07:58 -0000 1.11 *************** *** 44,48 **** BitVector row = oldRows[i]; if (row != null && !row.isEmpty()) ! newRows[i] = row.cloneVector(); } --- 44,48 ---- BitVector row = oldRows[i]; if (row != null && !row.isEmpty()) ! newRows[i] = new BitVector(row); } *************** *** 304,308 **** cyclicmask.set(index[tempsp]); } while (index[tempsp--] != nextbitpos); ! current = current.cloneVector(); current.andNot(cyclicmask); bitpos[stackpos] = 0; --- 304,308 ---- cyclicmask.set(index[tempsp]); } while (index[tempsp--] != nextbitpos); ! current = new BitVector(current); current.andNot(cyclicmask); bitpos[stackpos] = 0; |
From: Arjan B. <ar...@us...> - 2005-03-30 21:24:50
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24920/F:/nice/src/mlsub/typing/lowlevel Modified Files: BitMatrix.java K0.java Log Message: Use copy-constructor instead of clone for BitMatrix. Index: K0.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/K0.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** K0.java 29 Mar 2005 22:51:57 -0000 1.26 --- K0.java 30 Mar 2005 21:24:02 -0000 1.27 *************** *** 550,556 **** // put in R and Rt, the constraint saturated under // x < y and y < z => x < z ! R = (BitMatrix)C.clone(); R.closure(); ! Rt = (BitMatrix)Ct.clone(); Rt.closure(); m0 = m = n; --- 550,556 ---- // put in R and Rt, the constraint saturated under // x < y and y < z => x < z ! R = new BitMatrix(C); R.closure(); ! Rt = new BitMatrix(Ct); Rt.closure(); m0 = m = n; *************** *** 1079,1083 **** throws Unsatisfiable { ! BitMatrix T=(BitMatrix)C.clone(); T.closure(); condense(T); --- 1079,1083 ---- throws Unsatisfiable { ! BitMatrix T = new BitMatrix(C); T.closure(); condense(T); *************** *** 1109,1113 **** } } ! BitMatrix Tt = (BitMatrix)Ct.clone(); Tt.closure(); --- 1109,1113 ---- } } ! BitMatrix Tt = new BitMatrix(Ct); Tt.closure(); *************** *** 1157,1161 **** private void prepareConstraint() throws Unsatisfiable { collapseMinimal(); ! BitMatrix leq = (BitMatrix)C.clone(); leq.closure(); computeArrows(leq); --- 1157,1161 ---- private void prepareConstraint() throws Unsatisfiable { collapseMinimal(); ! BitMatrix leq = new BitMatrix(C); leq.closure(); computeArrows(leq); *************** *** 1301,1307 **** public void rigidify() { S.assume(S.a&& hasBeenInitialized); ! R = (BitMatrix)C.clone(); R.closure(); ! Rt = (BitMatrix)Ct.clone(); Rt.closure(); m = n; --- 1301,1307 ---- public void rigidify() { S.assume(S.a&& hasBeenInitialized); ! R = new BitMatrix(C); R.closure(); ! Rt = new BitMatrix(Ct); Rt.closure(); m = n; *************** *** 1356,1360 **** // others can't be modified anyway. if (K0.this.m != K0.this.n) ! this.savedC = (BitMatrix) K0.this.C.clone(); this.savedGarbage = K0.this.garbage.cloneVector(); --- 1356,1360 ---- // others can't be modified anyway. if (K0.this.m != K0.this.n) ! this.savedC = new BitMatrix(K0.this.C); this.savedGarbage = K0.this.garbage.cloneVector(); *************** *** 1654,1660 **** this.simplified = simplified; this.initN = simplified.getLowestSetBit(); ! R = (BitMatrix)C.clone(); R.closure(); ! Rt = (BitMatrix)Ct.clone(); Rt.closure(); --- 1654,1660 ---- this.simplified = simplified; this.initN = simplified.getLowestSetBit(); ! R = new BitMatrix(C); R.closure(); ! Rt = new BitMatrix(Ct); Rt.closure(); Index: BitMatrix.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/BitMatrix.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** BitMatrix.java 29 Mar 2005 22:51:58 -0000 1.9 --- BitMatrix.java 30 Mar 2005 21:23:58 -0000 1.10 *************** *** 10,14 **** @author Daniel Bonniot (Optimization for sparse and reflexives matrices) **/ ! final public class BitMatrix implements Cloneable { /** * a vector of BitVectors. rows.get(i) is the ith line of --- 10,14 ---- @author Daniel Bonniot (Optimization for sparse and reflexives matrices) **/ ! final public class BitMatrix { /** * a vector of BitVectors. rows.get(i) is the ith line of *************** *** 35,38 **** --- 35,56 ---- /** + * Creates a copy of a matrix + **/ + public BitMatrix(BitMatrix old) { + BitVector[] oldRows = old.rows; + BitVector[] newRows = new BitVector[oldRows.length]; + for (int i = old.size-1; i >= 0; i--) + { + BitVector row = oldRows[i]; + if (row != null && !row.isEmpty()) + newRows[i] = row.cloneVector(); + } + + this.rows = newRows; + this.size = old.size; + this.reflexive = old.reflexive; + } + + /** * Returns the number of rows and columns of this matrix **/ *************** *** 191,196 **** public void closure() { if (S.debug) { ! BitMatrix testcopy = (BitMatrix)this.clone(); ! BitMatrix original = (BitMatrix)this.clone(); this.closure2(); testcopy.closure1(); --- 209,214 ---- public void closure() { if (S.debug) { ! BitMatrix testcopy = new BitMatrix(this); ! BitMatrix original = new BitMatrix(this); this.closure2(); testcopy.closure1(); *************** *** 322,350 **** } - public Object clone() { - try { - BitMatrix m = (BitMatrix)super.clone(); - BitVector[] v = (BitVector[])rows.clone(); - - for (int i = 0; i < size; i++) { - BitVector row = v[i]; - if (row != null) { - if (!row.isEmpty()) - v[i] = row.cloneVector(); - else - v[i] = null; - } - } - m.rows = v; - m.size = size; - m.reflexive = reflexive; - return m; - } catch (CloneNotSupportedException e) { - throw new InternalError - ("Should never happen, since BitMatrix implements Cloneable"); - } - } - - public String toString() { StringBuffer sb = new StringBuffer("{"); --- 340,343 ---- |
From: Daniel B. <bo...@us...> - 2005-03-30 21:03:17
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10990 Modified Files: gcj.test Log Message: Only run gcj once, with JDK 1.4 Index: gcj.test =================================================================== RCS file: /cvsroot/nice/tester/gcj.test,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gcj.test 22 Mar 2005 23:38:04 -0000 1.2 --- gcj.test 30 Mar 2005 21:02:41 -0000 1.3 *************** *** 2,5 **** --- 2,6 ---- [ "$GCJ" ] || exit 8 + expr "$JDK_VERSION" '>=' 1.4 >/dev/null || exit 8 cd Nice |
From: Arjan B. <ar...@us...> - 2005-03-30 18:03:02
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9144/F:/nice/src/mlsub/typing/lowlevel Modified Files: BitVector.java Log Message: Optimized constructor of BitVector. Index: BitVector.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/BitVector.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** BitVector.java 29 Mar 2005 22:51:57 -0000 1.11 --- BitVector.java 30 Mar 2005 18:02:41 -0000 1.12 *************** *** 50,54 **** */ public BitVector() { ! this(1 << BITS_PER_UNIT); } --- 50,55 ---- */ public BitVector() { ! bits0 = 0L; ! bits1 = null; } |
From: Daniel B. <bo...@us...> - 2005-03-30 12:43:22
|
Update of /cvsroot/nice/Nice/testsuite/compiler/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24574/testsuite/compiler/native Modified Files: fields.testsuite Log Message: Do not load non-public fields from java* packages. Index: fields.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/native/fields.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fields.testsuite 23 Dec 2004 19:12:31 -0000 1.5 --- fields.testsuite 30 Mar 2005 12:42:33 -0000 1.6 *************** *** 31,35 **** let v = ""./*/// FAIL HERE*/ value; ! /// FAIL bug // Access to protected field ! let f = javax.swing.JComboBox b => b.actionCommand; --- 31,35 ---- let v = ""./*/// FAIL HERE*/ value; ! /// FAIL // Access to protected field ! let f = javax.swing.JComboBox b => b./*/// FAIL HERE */ actionCommand; |
From: Daniel B. <bo...@us...> - 2005-03-30 12:42:43
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24574/src/bossa/syntax Modified Files: javaMethod.nice Log Message: Do not load non-public fields from java* packages. Index: javaMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/javaMethod.nice,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** javaMethod.nice 25 Mar 2005 16:40:00 -0000 1.11 --- javaMethod.nice 30 Mar 2005 12:42:34 -0000 1.12 *************** *** 212,217 **** for (?gnu.bytecode.Field f = classType.getFields(); f != null; f = f.getNext()) ! if (retyped.get(f) == null) ! addJavaSymbol(f, makeJavaFieldAccess(f)); for (?gnu.bytecode.Method m = classType.getMethods(); m != null; m = m.getNext()) --- 212,224 ---- for (?gnu.bytecode.Field f = classType.getFields(); f != null; f = f.getNext()) ! { ! // Ignore non-public fields in a "java*" package ! if ((f.getModifiers() & gnu.bytecode.Access.PUBLIC) == 0 && ! classType.getName().startsWith("java")) ! continue; ! ! if (retyped.get(f) == null) ! addJavaSymbol(f, makeJavaFieldAccess(f)); ! } for (?gnu.bytecode.Method m = classType.getMethods(); m != null; m = m.getNext()) |
From: Daniel B. <bo...@us...> - 2005-03-30 11:43:21
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24070/src/bossa/syntax Modified Files: methodDeclaration.nice formalParameters.nice Log Message: Use fully qualified type names for parameters in compiled package interfaces to avoid wasting time searching the qualified name when loading the package. Index: methodDeclaration.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/methodDeclaration.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** methodDeclaration.nice 28 Mar 2005 11:35:15 -0000 1.7 --- methodDeclaration.nice 30 Mar 2005 11:43:02 -0000 1.8 *************** *** 195,199 **** if(this.getType() == null) return "method " + this.getName(); ! return (syntacticConstraint != null ? notNull(syntacticConstraint) --- 195,201 ---- if(this.getType() == null) return "method " + this.getName(); ! ! let domain = notNull(this.getType()).domain(); ! return (syntacticConstraint != null ? notNull(syntacticConstraint) *************** *** 205,209 **** // parameters can be null if type was set lowlevel (native code, ...) + (parameters != null ? ! notNull(parameters).toString() : Util.map("",", ","", notNull(this.getType()).domain())) + ")" ; --- 207,211 ---- // parameters can be null if type was set lowlevel (native code, ...) + (parameters != null ? ! notNull(parameters).toString(domain) : Util.map("",", ","", domain)) + ")" ; Index: formalParameters.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/formalParameters.nice,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** formalParameters.nice 25 Mar 2005 16:40:00 -0000 1.10 --- formalParameters.nice 30 Mar 2005 11:43:02 -0000 1.11 *************** *** 185,188 **** --- 185,194 ---- toString() = Util.map("", ", ", "", parameters); + String toString(mlsub.typing.Monotype[] types) + { + int i = 0; + return parameters.map(Parameter p => p.toString(types[i++])).join(","); + } + public List<Parameter> asList() = new ArrayList(parameters); *************** *** 293,296 **** --- 299,304 ---- toString() = type.toString(); + String toString(mlsub.typing.Monotype type) = type.toString(); + ?LocatedString getName() = null; *************** *** 361,365 **** match(id) = name.toString().equals(id); ! toString() = type + " " + name; } --- 369,374 ---- match(id) = name.toString().equals(id); ! toString() = super + " " + name; ! toString(type) = super + " " + name; } *************** *** 424,428 **** { defaultValue = defaultValue.noOverloading(); ! return type + " " + name + " = " + defaultValue; } } --- 433,443 ---- { defaultValue = defaultValue.noOverloading(); ! return super + " = " + defaultValue; ! } ! ! toString(type) ! { ! defaultValue = defaultValue.noOverloading(); ! return super + " = " + defaultValue; } } |
From: Daniel B. <bo...@us...> - 2005-03-30 08:02:41
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29001/stdlib/nice/lang Modified Files: prelude.nice Log Message: Removed the obsolete nice.lang.Type Index: prelude.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/prelude.nice,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** prelude.nice 7 Mar 2005 11:34:55 -0000 1.42 --- prelude.nice 30 Mar 2005 08:01:55 -0000 1.43 *************** *** 82,86 **** class Throwable = native java.lang.Throwable; - class Type = native; /* --- 82,85 ---- |
From: Daniel B. <bo...@us...> - 2005-03-30 08:02:19
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29001/src/bossa/syntax Modified Files: retypedMethod.nice Log Message: Removed the obsolete nice.lang.Type Index: retypedMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/retypedMethod.nice,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** retypedMethod.nice 13 Mar 2005 11:38:17 -0000 1.10 --- retypedMethod.nice 30 Mar 2005 08:02:08 -0000 1.11 *************** *** 69,73 **** className + " was not found"); ! javaArgType = cast(new Type[javaTypes.size()-1]); return; } --- 69,73 ---- className + " was not found"); ! javaArgType = cast(new gnu.bytecode.Type[javaTypes.size()-1]); return; } |
From: Daniel B. <bo...@us...> - 2005-03-30 08:02:19
|
Update of /cvsroot/nice/Nice/src/nice/tools/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29001/src/nice/tools/typing Modified Files: PrimitiveType.java Log Message: Removed the obsolete nice.lang.Type Index: PrimitiveType.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/typing/PrimitiveType.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PrimitiveType.java 14 Jan 2005 18:53:53 -0000 1.4 --- PrimitiveType.java 30 Mar 2005 08:01:57 -0000 1.5 *************** *** 135,144 **** } - if (name.equals("nice.lang.Type")) - { - // to differ with the null result, which signals error - return gnu.bytecode.Type.pointer_type; - } - return null; } --- 135,138 ---- *************** *** 166,168 **** public static TypeConstructor collectionTC; public static TypeConstructor throwableTC; ! } \ No newline at end of file --- 160,162 ---- public static TypeConstructor collectionTC; public static TypeConstructor throwableTC; ! } |
From: Daniel B. <bo...@us...> - 2005-03-29 22:52:07
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11424/src/mlsub/typing/lowlevel Modified Files: Satisfier.java K0.java DomainVector.java Domain.java BitVector.java BitMatrix.java Log Message: Optim: do not use Object.clone to clone BitVectors. Index: Domain.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Domain.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Domain.java 29 Mar 2005 15:33:02 -0000 1.5 --- Domain.java 29 Mar 2005 22:51:57 -0000 1.6 *************** *** 223,225 **** --- 223,239 ---- return result; } + + public Domain cloneDomain() { + Domain result = new Domain(0); + this.copyTo(result); + return result; + } + + private void copyTo(Domain result) { + super.copyTo(result); + + result.containsUnit = containsUnit; + result.cardUp = cardUp; + result.cardDown = cardDown; + } } Index: DomainVector.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/DomainVector.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DomainVector.java 29 Mar 2005 15:33:02 -0000 1.4 --- DomainVector.java 29 Mar 2005 22:51:57 -0000 1.5 *************** *** 98,102 **** Domain d = ((Domain)elementData[i]); if (d != null) { ! result.elementData[i] = (Domain)d.clone(); } } --- 98,102 ---- Domain d = ((Domain)elementData[i]); if (d != null) { ! result.elementData[i] = d.cloneDomain(); } } Index: Satisfier.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Satisfier.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Satisfier.java 29 Mar 2005 15:33:03 -0000 1.2 --- Satisfier.java 29 Mar 2005 22:51:57 -0000 1.3 *************** *** 45,49 **** } } ! Domain dx = (Domain)domains.getDomain(x).clone(); for (int a = dx.getLowestSetBit(); a >= 0; --- 45,49 ---- } } ! Domain dx = domains.getDomain(x).cloneDomain(); for (int a = dx.getLowestSetBit(); a >= 0; *************** *** 89,93 **** throw LowlevelUnsatisfiable.instance; } ! Domain dx = (Domain)domains.getDomain(x).clone(); // iterate through the elements of dx for (int a = dx.getLowestSetBit(); --- 89,93 ---- throw LowlevelUnsatisfiable.instance; } ! Domain dx = domains.getDomain(x).cloneDomain(); // iterate through the elements of dx for (int a = dx.getLowestSetBit(); Index: BitVector.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/BitVector.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** BitVector.java 17 Apr 2004 17:12:11 -0000 1.10 --- BitVector.java 29 Mar 2005 22:51:57 -0000 1.11 *************** *** 15,19 **** allocating the array) **/ ! public class BitVector implements Cloneable, java.io.Serializable { private final static int BITS_PER_UNIT = 6; private final static int MASK = (1<<BITS_PER_UNIT)-1; --- 15,19 ---- allocating the array) **/ ! public class BitVector implements java.io.Serializable { private final static int BITS_PER_UNIT = 6; private final static int MASK = (1<<BITS_PER_UNIT)-1; *************** *** 526,537 **** * Clones the BitVector. */ ! final public Object clone() { ! BitVector result = null; ! try { ! result = (BitVector) super.clone(); ! } catch (CloneNotSupportedException e) { ! throw new InternalError("this shouldn't happen, since we are Cloneable"); ! } if (bits1 == null) result.bits0 = bits0; --- 526,536 ---- * Clones the BitVector. */ ! public BitVector cloneVector() { ! BitVector result = new BitVector(); ! this.copyTo(result); ! return result; ! } + public void copyTo(BitVector result) { if (bits1 == null) result.bits0 = bits0; *************** *** 543,547 **** System.arraycopy(bits1, 0, result.bits1, 0, n); } - return result; } --- 542,545 ---- Index: K0.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/K0.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** K0.java 29 Mar 2005 15:33:02 -0000 1.25 --- K0.java 29 Mar 2005 22:51:57 -0000 1.26 *************** *** 1272,1276 **** for (int iid = 0; iid < nInterfaces(); iid++) { BitVector I_impls = getInterface(iid).implementors; ! rigidImplementors[iid] = (BitVector)I_impls.clone(); for (int x = I_impls.getLowestSetBit(); x != BitVector.UNDEFINED_INDEX; --- 1272,1276 ---- for (int iid = 0; iid < nInterfaces(); iid++) { BitVector I_impls = getInterface(iid).implementors; ! rigidImplementors[iid] = I_impls.cloneVector(); for (int x = I_impls.getLowestSetBit(); x != BitVector.UNDEFINED_INDEX; *************** *** 1358,1362 **** this.savedC = (BitMatrix) K0.this.C.clone(); ! this.savedGarbage = (BitVector)K0.this.garbage.clone(); this.savedDomains = (DomainVector)K0.this.domains.clone(); /* --- 1358,1362 ---- this.savedC = (BitMatrix) K0.this.C.clone(); ! this.savedGarbage = K0.this.garbage.cloneVector(); this.savedDomains = (DomainVector)K0.this.domains.clone(); /* Index: BitMatrix.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/BitMatrix.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BitMatrix.java 6 Apr 2003 19:00:17 -0000 1.8 --- BitMatrix.java 29 Mar 2005 22:51:58 -0000 1.9 *************** *** 286,290 **** cyclicmask.set(index[tempsp]); } while (index[tempsp--] != nextbitpos); ! current = (BitVector)current.clone(); current.andNot(cyclicmask); bitpos[stackpos] = 0; --- 286,290 ---- cyclicmask.set(index[tempsp]); } while (index[tempsp--] != nextbitpos); ! current = current.cloneVector(); current.andNot(cyclicmask); bitpos[stackpos] = 0; *************** *** 331,335 **** if (row != null) { if (!row.isEmpty()) ! v[i] = (BitVector) row.clone(); else v[i] = null; --- 331,335 ---- if (row != null) { if (!row.isEmpty()) ! v[i] = row.cloneVector(); else v[i] = null; |
From: Daniel B. <bo...@us...> - 2005-03-29 16:18:51
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8586/src/bossa/syntax Modified Files: niceMethod.nice Log Message: Optim: avoid computing the method full name twice Index: niceMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceMethod.nice,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** niceMethod.nice 28 Mar 2005 11:35:15 -0000 1.26 --- niceMethod.nice 29 Mar 2005 16:18:39 -0000 1.27 *************** *** 370,373 **** --- 370,375 ---- } + let fullName = def.getFullName(); + /* If this package is not recompiled, *************** *** 380,385 **** */ ?gnu.bytecode.Method meth = module.pkg.lookupDispatchClassMethod ! (receiver == null ? null : receiver.getClassType(), ! name, "id", def.getFullName()); if (meth != null) // Reuse existing dispatch method header { --- 382,387 ---- */ ?gnu.bytecode.Method meth = module.pkg.lookupDispatchClassMethod ! (receiver == null ? null : receiver.getClassType(), name, "id", fullName); ! if (meth != null) // Reuse existing dispatch method header { *************** *** 410,414 **** // add unique information to disambiguate which method this represents res.addBytecodeAttribute ! (new gnu.bytecode.MiscAttr("id", def.getFullName().getBytes())); if (receiver != null) --- 412,416 ---- // add unique information to disambiguate which method this represents res.addBytecodeAttribute ! (new gnu.bytecode.MiscAttr("id", fullName.getBytes())); if (receiver != null) |
From: Daniel B. <bo...@us...> - 2005-03-29 15:33:23
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18383/src/mlsub/typing/lowlevel Modified Files: Domain.java DomainVector.java K0.java LowlevelUnsatisfiable.java Satisfier.java Log Message: Optim: use shared exception instances instead of dynamically created ones for stateless exceptions, since fillInStackTrace is expensive Index: DomainVector.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/DomainVector.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DomainVector.java 23 May 2003 13:05:30 -0000 1.3 --- DomainVector.java 29 Mar 2005 15:33:02 -0000 1.4 *************** *** 121,125 **** // XXX: already tested ?? if (dx.isEmpty()) { ! throw new LowlevelUnsatisfiable(); } if (dx.needPropagation(direction)) { --- 121,125 ---- // XXX: already tested ?? if (dx.isEmpty()) { ! throw LowlevelUnsatisfiable.instance; } if (dx.needPropagation(direction)) { Index: K0.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/K0.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** K0.java 16 Feb 2005 22:34:49 -0000 1.24 --- K0.java 29 Mar 2005 15:33:02 -0000 1.25 *************** *** 826,830 **** if (x == -1) { if (!unit) { ! throw new LowlevelUnsatisfiable(); } } else if (x < m) { --- 826,830 ---- if (x == -1) { if (!unit) { ! throw LowlevelUnsatisfiable.instance; } } else if (x < m) { *************** *** 832,836 **** // is condensed on the rigid variables) if (!set.get(x)) { ! throw new LowlevelUnsatisfiable(); } } else { --- 832,836 ---- // is condensed on the rigid variables) if (!set.get(x)) { ! throw LowlevelUnsatisfiable.instance; } } else { *************** *** 1106,1110 **** if (T.includedIn(m, R) != null) { // T is NOT included in R on [0, m[ x [0, m[ ! throw new LowlevelUnsatisfiable();// will be refined if necessary } } --- 1106,1110 ---- if (T.includedIn(m, R) != null) { // T is NOT included in R on [0, m[ x [0, m[ ! throw LowlevelUnsatisfiable.instance; // will be refined if necessary } } Index: LowlevelUnsatisfiable.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/LowlevelUnsatisfiable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LowlevelUnsatisfiable.java 14 Jun 2000 13:32:53 -0000 1.1 --- LowlevelUnsatisfiable.java 29 Mar 2005 15:33:03 -0000 1.2 *************** *** 17,20 **** --- 17,22 ---- } + static LowlevelUnsatisfiable instance = new LowlevelUnsatisfiable(); + static boolean refinedReports = true; public static void setRefinedReports(boolean flag) { Index: Satisfier.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Satisfier.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Satisfier.java 14 Jun 2000 13:32:55 -0000 1.1 --- Satisfier.java 29 Mar 2005 15:33:03 -0000 1.2 *************** *** 18,22 **** --- 18,24 ---- private static boolean satisfiable = false; + private static class Satisfiable extends Exception {} + private static Satisfiable sat = new Satisfiable(); private static void enumerate(int[] strategy, DomainVector domains, *************** *** 40,44 **** // backtrack ! throw new Satisfiable(); } } --- 42,46 ---- // backtrack ! throw sat; } } *************** *** 66,70 **** } } ! throw new LowlevelUnsatisfiable(); } --- 68,72 ---- } } ! throw LowlevelUnsatisfiable.instance; } *************** *** 82,89 **** satisfiable = true; if (handler == null) { ! throw new Satisfiable(); } handler.handle(domains); ! throw new LowlevelUnsatisfiable(); } Domain dx = (Domain)domains.getDomain(x).clone(); --- 84,91 ---- satisfiable = true; if (handler == null) { ! throw sat; } handler.handle(domains); ! throw LowlevelUnsatisfiable.instance; } Domain dx = (Domain)domains.getDomain(x).clone(); *************** *** 98,102 **** // XXX: reachable ? ! throw new Satisfiable(); } catch (LowlevelUnsatisfiable _) { --- 100,104 ---- // XXX: reachable ? ! throw sat; } catch (LowlevelUnsatisfiable _) { *************** *** 104,108 **** } } ! throw new LowlevelUnsatisfiable(); } --- 106,110 ---- } } ! throw LowlevelUnsatisfiable.instance; } Index: Domain.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Domain.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Domain.java 6 Sep 2003 11:31:10 -0000 1.4 --- Domain.java 29 Mar 2005 15:33:02 -0000 1.5 *************** *** 81,85 **** this.containsUnit &= unit; if (this.isEmpty()) { ! throw new LowlevelUnsatisfiable(); } } --- 81,85 ---- this.containsUnit &= unit; if (this.isEmpty()) { ! throw LowlevelUnsatisfiable.instance; } } *************** *** 92,96 **** this.andNot(set); if (this.isEmpty()) { ! throw new LowlevelUnsatisfiable(); } } --- 92,96 ---- this.andNot(set); if (this.isEmpty()) { ! throw LowlevelUnsatisfiable.instance; } } *************** *** 103,107 **** this.containsUnit = false; if (this.isEmpty()) { ! throw new LowlevelUnsatisfiable(); } } --- 103,107 ---- this.containsUnit = false; if (this.isEmpty()) { ! throw LowlevelUnsatisfiable.instance; } } *************** *** 118,122 **** } if (this.isEmpty()) { ! throw new LowlevelUnsatisfiable(); } } --- 118,122 ---- } if (this.isEmpty()) { ! throw LowlevelUnsatisfiable.instance; } } *************** *** 147,151 **** return -1; } else { ! throw new LowlevelUnsatisfiable(); } } --- 147,151 ---- return -1; } else { ! throw LowlevelUnsatisfiable.instance; } } *************** *** 170,174 **** public void instantiate(int value) throws LowlevelUnsatisfiable { if (!containsValue(value)) { ! throw new LowlevelUnsatisfiable(); } clearAll(); --- 170,174 ---- public void instantiate(int value) throws LowlevelUnsatisfiable { if (!containsValue(value)) { ! throw LowlevelUnsatisfiable.instance; } clearAll(); |
From: Artem Gr K. <ar...@us...> - 2005-03-29 10:28:12
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11074/stdlib/nice/lang Modified Files: java.nice Log Message: maybe-null retypings for Throwable.getCause and ClassLoader.getResourceAsStream Index: java.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/java.nice,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** java.nice 17 Sep 2004 18:22:00 -0000 1.60 --- java.nice 29 Mar 2005 10:28:02 -0000 1.61 *************** *** 74,77 **** --- 74,83 ---- native int java.lang.Comparable.compareTo(Object); + // result maybe null + + ?Throwable getCause(Throwable) = native Throwable Throwable.getCause(); + ?java.io.InputStream getResourceAsStream(ClassLoader, String name) = + native java.io.InputStream ClassLoader.getResourceAsStream(String); + // PACKAGE: java.text |
From: Daniel B. <bo...@us...> - 2005-03-28 14:20:31
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20940/src/bossa/parser Modified Files: Parser.jj Log Message: Optimization. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.323 retrieving revision 1.324 diff -C2 -d -r1.323 -r1.324 *** Parser.jj 28 Mar 2005 11:35:15 -0000 1.323 --- Parser.jj 28 Mar 2005 14:20:23 -0000 1.324 *************** *** 834,838 **** { res.nullness = /*absent*/3; } | ! LOOKAHEAD(monotypeConstructor()) res=monotypeConstructor() { res.nullness = /*absent*/3; } --- 834,838 ---- { res.nullness = /*absent*/3; } | ! LOOKAHEAD( typeConstructorIdent() "<" ) res=monotypeConstructor() { res.nullness = /*absent*/3; } *************** *** 906,926 **** } ! Parameter formalParameter(List statements): { Monotype t; LocatedString id = null; Expression val = null; ! } ! { ! ( ! LOOKAHEAD(monotype()) ! t=monotype() [ id=ident() [ "=" val=Expression() ]] ! { return t.createParameter(id ,val); } ! | ! { Token first,last; List parts = new LinkedList(); Expression part; List types = new LinkedList(); ! LocatedString ident; } first="(" part = ParameterTuplePart(statements, types) { parts.add(part); } --- 906,922 ---- } ! Parameter tupleParameter(List statements): { Monotype t; LocatedString id = null; Expression val = null; ! ! Token first,last; List parts = new LinkedList(); Expression part; List types = new LinkedList(); ! LocatedString ident; ! } ! { first="(" part = ParameterTuplePart(statements, types) { parts.add(part); } *************** *** 940,943 **** --- 936,953 ---- return t.createParameter(ident ,val); } + } + + Parameter formalParameter(List statements): + {} + { + ( + LOOKAHEAD( "(" monotype() ident() ) + { Parameter res; } + res=tupleParameter(statements) + { return res; } + | + { Monotype t; LocatedString id = null; Expression val = null; } + t=monotype() [ id=ident() [ "=" val=Expression() ]] + { return t.createParameter(id ,val); } ) } |
From: Daniel B. <bo...@us...> - 2005-03-28 11:35:24
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1516/src/bossa/parser Modified Files: Parser.jj Log Message: Enforce private visibility for methods (no restriction yet). Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.322 retrieving revision 1.323 diff -C2 -d -r1.322 -r1.323 *** Parser.jj 22 Mar 2005 10:55:06 -0000 1.322 --- Parser.jj 28 Mar 2005 11:35:15 -0000 1.323 *************** *** 869,872 **** --- 869,883 ---- /***********************************************************************/ + /* Visibility */ + /***********************************************************************/ + + Visibility visibility(): + { boolean pub = false, priv = false; } + { + [ "public" { pub = true; } | "private" { priv = true; } ] + { return dispatch.visibility(pub, priv); } + } + + /***********************************************************************/ /* Classes */ /***********************************************************************/ *************** *** 945,949 **** } ! Definition internalMethodOrFunction(MethodContainer c, boolean isOverride): { LocatedString name; --- 956,961 ---- } ! Definition internalMethodOrFunction ! (MethodContainer c, boolean isOverride, Visibility vis): { LocatedString name; *************** *** 963,969 **** ( ";" | body = code() {statements.add(body);} ) ! { return c.createMemberMethod(name, cst, returnType, parameters, ! body != null ? bossa.syntax.dispatch.createBlock(statements) : null, ! contract, isOverride); } } --- 975,983 ---- ( ";" | body = code() {statements.add(body);} ) ! { return c.createMemberMethod ! (name, cst, returnType, parameters, ! body != null ? bossa.syntax.dispatch.createBlock(statements) : null, ! contract, isOverride, vis); ! } } *************** *** 1106,1110 **** getField(impl, storeDocString) | { Definition m; Token t = getToken(1); boolean isOverride = false; } ! [ "public" | "private" ] [ "override" { isOverride = true; } ] ( --- 1120,1125 ---- getField(impl, storeDocString) | { Definition m; Token t = getToken(1); boolean isOverride = false; } ! { Visibility vis; } ! vis = visibility() [ "override" { isOverride = true; } ] ( *************** *** 1113,1117 **** { definitions.add(m); } | ! m = internalMethodOrFunction(res, isOverride) { methods.add(m); } ) --- 1128,1132 ---- { definitions.add(m); } | ! m = internalMethodOrFunction(res, isOverride, vis) { methods.add(m); } ) *************** *** 1175,1181 **** extensions); } ( ! { Definition m; } ! [ "public" | "private" ] ! m = internalMethodOrFunction(res, false) { definitions.add(m); } )* --- 1190,1196 ---- extensions); } ( ! { Definition m; Visibility vis; } ! vis = visibility() ! m = internalMethodOrFunction(res, false, vis) { definitions.add(m); } )* *************** *** 1423,1427 **** } ! Definition methodDeclaration(Constraint cst, boolean isOverride): { LocatedString name; --- 1438,1442 ---- } ! Definition methodDeclaration(Constraint cst, boolean isOverride, Visibility vis): { LocatedString name; *************** *** 1459,1463 **** (name, cst, returnType, parameters, bossa.syntax.dispatch.createBlock(statements), ! contract, isOverride); } | --- 1474,1478 ---- (name, cst, returnType, parameters, bossa.syntax.dispatch.createBlock(statements), ! contract, isOverride, vis); } | *************** *** 1465,1469 **** ";" { res = bossa.syntax.dispatch.createNiceMethod ! (name, cst, returnType, parameters, contract, isOverride); } ) ) --- 1480,1484 ---- ";" { res = bossa.syntax.dispatch.createNiceMethod ! (name, cst, returnType, parameters, contract, isOverride, vis); } ) ) *************** *** 1585,1589 **** Definition definition(List definitions, boolean storeDocString): ! { Definition res; boolean pub = false, priv = false; } { ( --- 1600,1604 ---- Definition definition(List definitions, boolean storeDocString): ! { Definition res; Visibility vis; } { ( *************** *** 1594,1604 **** res=methodBodyDefinition(null) | ! [ "public" { pub = true; } | "private" { priv = true; } ] ! { Visibility vis = dispatch.visibility(pub, priv); } ( res=globalVariable(vis) | res=enumDefinition(definitions) | "override" { Constraint cst; } cst = constraint() ! res=methodDeclaration(cst, true) | cst = constraint() ( --- 1609,1618 ---- res=methodBodyDefinition(null) | ! vis = visibility() ( res=globalVariable(vis) | res=enumDefinition(definitions) | "override" { Constraint cst; } cst = constraint() ! res=methodDeclaration(cst, true, vis) | cst = constraint() ( *************** *** 1607,1611 **** res=interfaceDefinition(cst, definitions) | res=typeDefinition(cst, definitions, storeDocString) ! | res=methodDeclaration(cst, false) ) ) --- 1621,1625 ---- res=interfaceDefinition(cst, definitions) | res=typeDefinition(cst, definitions, storeDocString) ! | res=methodDeclaration(cst, false, vis) ) ) |
From: Daniel B. <bo...@us...> - 2005-03-28 11:35:24
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1516/src/bossa/syntax Modified Files: visibility.nice niceclass.nice niceMethod.nice methodDeclaration.nice globalvar.nice defaultMethod.nice Log Message: Enforce private visibility for methods (no restriction yet). Index: methodDeclaration.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/methodDeclaration.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** methodDeclaration.nice 13 Mar 2005 11:38:18 -0000 1.6 --- methodDeclaration.nice 28 Mar 2005 11:35:15 -0000 1.7 *************** *** 37,45 **** ?gnu.expr.Expression code = null; ! void setSymbol(MethodSymbol symbol) { this.symbol = symbol; symbol.propagate = Node.none; this.addChild(symbol); } --- 37,48 ---- ?gnu.expr.Expression code = null; ! Visibility visibility = general; ! ! void setSymbol(MethodSymbol symbol, Visibility vis = general) { this.symbol = symbol; symbol.propagate = Node.none; this.addChild(symbol); + this.visibility = loosen(0, vis); } *************** *** 52,56 **** void addToScope() { ! module.scope.addSymbol(symbol); } --- 55,59 ---- void addToScope() { ! module.scope.addSymbol(symbol, visibility); } Index: niceMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceMethod.nice,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** niceMethod.nice 25 Mar 2005 16:40:00 -0000 1.25 --- niceMethod.nice 28 Mar 2005 11:35:15 -0000 1.26 *************** *** 219,222 **** --- 219,223 ---- printInterface(s) { + s.print(keyword(0, visibility)); if (specializedMethods != null) s.print("override "); *************** *** 229,233 **** Constraint constraint, Monotype returnType, FormalParameters parameters, ! Contract contract, boolean isOverride) { let res = new NiceMethod(name, Node.down, --- 230,234 ---- Constraint constraint, Monotype returnType, FormalParameters parameters, ! Contract contract, boolean isOverride, Visibility vis) { let res = new NiceMethod(name, Node.down, *************** *** 241,245 **** res.addChild(parameters); ! res.setSymbol(new MethodSymbol(res, name, constraint, returnType)); return res; } --- 242,246 ---- res.addChild(parameters); ! res.setSymbol(new MethodSymbol(res, name, constraint, returnType), vis); return res; } *************** *** 264,268 **** ?Statement body, Contract contract, ! boolean isOverride) { // it is a class method, there is an implicit "this" argument --- 265,269 ---- ?Statement body, Contract contract, ! boolean isOverride, Visibility vis) { // it is a class method, there is an implicit "this" argument *************** *** 338,345 **** if (body == null) return createNiceMethod(name, constraint, returnType, params, contract, ! isOverride); else return createMethodWithDefault ! (name, constraint, returnType, params, body, contract, isOverride); } --- 339,346 ---- if (body == null) return createNiceMethod(name, constraint, returnType, params, contract, ! isOverride, vis); else return createMethodWithDefault ! (name, constraint, returnType, params, body, contract, isOverride, vis); } Index: defaultMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/defaultMethod.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** defaultMethod.nice 6 Mar 2005 01:34:26 -0000 1.9 --- defaultMethod.nice 28 Mar 2005 11:35:15 -0000 1.10 *************** *** 50,61 **** FormalParameters parameters, ?Statement body, ! Contract contract, boolean isOverride) { if (body == null) return createNiceMethod(name, constraint, returnType, parameters, ! contract, isOverride); return createDefaultMethodImplementation(name, constraint, returnType, ! parameters, contract, isOverride, body); } --- 50,61 ---- FormalParameters parameters, ?Statement body, ! Contract contract, boolean isOverride, Visibility vis) { if (body == null) return createNiceMethod(name, constraint, returnType, parameters, ! contract, isOverride, vis); return createDefaultMethodImplementation(name, constraint, returnType, ! parameters, contract, isOverride, body, vis); } *************** *** 120,124 **** FormalParameters parameters, Contract contract, boolean isOverride, ! Statement body) { let res = new DefaultMethodImplementation(name, Node.down, body: body, --- 120,125 ---- FormalParameters parameters, Contract contract, boolean isOverride, ! Statement body, ! Visibility vis) { let res = new DefaultMethodImplementation(name, Node.down, body: body, *************** *** 131,135 **** notNull(res.declaration).addChild(parameters); notNull(res.declaration).setSymbol ! (new MethodSymbol(notNull(res.declaration), name, constraint, returnType)); res.addChild(res.declaration); --- 132,137 ---- notNull(res.declaration).addChild(parameters); notNull(res.declaration).setSymbol ! (new MethodSymbol(notNull(res.declaration), name, constraint, returnType), ! vis); res.addChild(res.declaration); Index: visibility.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/visibility.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** visibility.nice 12 Mar 2005 02:41:47 -0000 1.1 --- visibility.nice 28 Mar 2005 11:35:15 -0000 1.2 *************** *** 23,24 **** --- 23,33 ---- Visibility visibility(boolean pub, boolean priv) = pub ? general : priv ? intimate: familial; + + Visibility loosen(int dummy, Visibility vis) = + vis == familial ? general : vis; + + String keyword(int dummy, Visibility); + keyword(dummy, intimate) = "private "; + keyword(dummy, familial) = ""; + keyword(dummy, general) = "public "; + Index: globalvar.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/globalvar.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** globalvar.nice 25 Mar 2005 16:40:00 -0000 1.9 --- globalvar.nice 28 Mar 2005 11:35:15 -0000 1.10 *************** *** 48,59 **** } - String modifier(Visibility); - modifier(intimate) = "private "; - modifier(familial) = ""; - modifier(general) = "public "; - printInterface(s) { ! s.print(this.modifier(visibility) + (constant? "let ": "var ") +left +" = " +value.toString() +";\n"); } --- 48,59 ---- } printInterface(s) { ! s.print(keyword(0, visibility)); ! s.print(constant ? "let " : "var "); ! s.print(left); ! s.print(" = "); ! s.print(value); ! s.print(";\n"); } Index: niceclass.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceclass.nice,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** niceclass.nice 25 Mar 2005 16:40:00 -0000 1.28 --- niceclass.nice 28 Mar 2005 11:35:15 -0000 1.29 *************** *** 157,161 **** } ! private ?gnu.expr.Declaration getOverridenField (OverridenField field, boolean checkValue) { --- 157,161 ---- } ! ?gnu.expr.Declaration getOverridenField (OverridenField field, boolean checkValue) { *************** *** 341,345 **** private boolean entered = false; ! private void enterTypingContext() { if (entered || definition.classConstraint == null) --- 341,345 ---- private boolean entered = false; ! void enterTypingContext() { if (entered || definition.classConstraint == null) |
From: Daniel B. <bo...@us...> - 2005-03-28 11:35:23
|
Update of /cvsroot/nice/Nice/src/nice/tools/compiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1516/src/nice/tools/compiler Modified Files: interface.nice Log Message: Enforce private visibility for methods (no restriction yet). Index: interface.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/interface.nice,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** interface.nice 11 Mar 2005 17:35:50 -0000 1.10 --- interface.nice 28 Mar 2005 11:35:15 -0000 1.11 *************** *** 75,81 **** /** * Determines the location of the nice runtime. ! * */ ! private ?String getNiceRuntime() { String resource = "/nice/tools/compiler/fun.class"; --- 75,81 ---- /** * Determines the location of the nice runtime. ! * */ ! ?String getNiceRuntime() { String resource = "/nice/tools/compiler/fun.class"; *************** *** 83,87 **** // Attempt to locate the file using the class loader. ?java.net.URL classUrl = dispatch.class.getResource(resource); ! if (classUrl == null) return null; --- 83,87 ---- // Attempt to locate the file using the class loader. ?java.net.URL classUrl = dispatch.class.getResource(resource); ! if (classUrl == null) return null; |
From: Daniel B. <bo...@us...> - 2005-03-28 11:35:23
|
Update of /cvsroot/nice/Nice/stdlib/nice/functional In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1516/stdlib/nice/functional Modified Files: generator.nice Log Message: Enforce private visibility for methods (no restriction yet). Index: generator.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/functional/generator.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** generator.nice 19 Apr 2004 11:10:14 -0000 1.3 --- generator.nice 28 Mar 2005 11:35:14 -0000 1.4 *************** *** 555,559 **** * Is the number even? */ ! private boolean _even(int num) = num % 2 == 0; /** --- 555,559 ---- * Is the number even? */ ! boolean _even(int num) = num % 2 == 0; /** |
From: Daniel B. <bo...@us...> - 2005-03-28 11:35:22
|
Update of /cvsroot/nice/Nice/testsuite/compiler/visibility/expressions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1516/testsuite/compiler/visibility/expressions Modified Files: private.testsuite Log Message: Enforce private visibility for methods (no restriction yet). Index: private.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/visibility/expressions/private.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** private.testsuite 12 Mar 2005 02:41:41 -0000 1.1 --- private.testsuite 28 Mar 2005 11:35:14 -0000 1.2 *************** *** 18,19 **** --- 18,66 ---- /// package b import a String s = /*///FAIL HERE*/ hidden; + + + /// FAIL + /// package a + /// Toplevel + private String hidden() = "secret"; + + /// package b import a + let s = /*///FAIL HERE*/ hidden(); + + /// FAIL + /// package a dontcompile + /// Toplevel + private String hidden() = "secret"; + + /// package b import a + let s = /*///FAIL HERE*/ hidden(); + + /// FAIL + /// package a + /// Toplevel + private String hidden(); + hidden() = "secret"; + + /// package b import a + let s = /*///FAIL HERE*/ hidden(); + + /// FAIL + /// package a dontcompile + /// Toplevel + private String hidden(); + hidden() = "secret"; + + /// package b import a + let s = /*///FAIL HERE*/ hidden(); + + + /// FAIL + /// package a + /// Toplevel + public class A {} + private String hidden(A a) = "fixed"; + + /// package b import a + /// Toplevel + class B extends A {} + /*/// FAIL HERE*/ hidden(B b) = "changed"; |