[Nice-commit] Nice/src/bossa/syntax Symbol.java,NONE,1.1 arguments.nice,NONE,1.1 Node.java,1.66,1.67
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2005-01-13 16:47:52
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4275/F:/nice/src/bossa/syntax Modified Files: Node.java VarScope.java analyse.nice assign.nice call.nice enum.nice formalParameters.nice globalvar.nice overloadedsymbol.nice symbol.nice tools.nice Added Files: Symbol.java arguments.nice Removed Files: Arguments.java VarSymbol.java Log Message: Converted VarSymbol and Arguments. Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** analyse.nice 12 Jan 2005 18:50:37 -0000 1.124 --- analyse.nice 13 Jan 2005 16:47:33 -0000 1.125 *************** *** 534,538 **** { CallExp res = new CallExp(function: createOverloadedSymbolExp(symbols, notNull(e.ident)), ! arguments: Arguments.singleArgument(Node.thisExp)); res.setLocation(e.location()); return res; --- 534,538 ---- { CallExp res = new CallExp(function: createOverloadedSymbolExp(symbols, notNull(e.ident)), ! arguments: new Arguments(arguments: [new Argument(value: notNull(Node.thisExp))])); res.setLocation(e.location()); return res; *************** *** 543,547 **** // Make an implicit call to fetch the static field's value. CallExp res = new CallExp(function: createOverloadedSymbolExp(symbols, notNull(e.ident)), ! arguments: Arguments.noArguments()); res.setLocation(e.location()); return res; --- 543,547 ---- // Make an implicit call to fetch the static field's value. CallExp res = new CallExp(function: createOverloadedSymbolExp(symbols, notNull(e.ident)), ! arguments: new Arguments(arguments: [])); res.setLocation(e.location()); return res; --- NEW FILE: Symbol.java --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2004 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package bossa.syntax; /** A variable (local, field of a class, parameter of a method or function). temporarily abstract superclass of VarSymbol */ public abstract class Symbol extends Node { public Symbol(LocatedString name) { super(Node.upper); this.name = name; addSymbol(this); } LocatedString name; // commenting this triggers a bug abstract mlsub.typing.Polytype getType(); } --- NEW FILE: arguments.nice --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2004 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package bossa.syntax; import java.util.*; import bossa.util.*; /** Arguments of a function call. */ public class Arguments { Argument[] arguments; /** Hold real parameter, after default parameters and parameter reordering has been done. */ Expression[?] computedExpressions = null; java.util.Map<VarSymbol, Expression[]> applicationExpressions = new java.util.HashMap(); // Map actual arguments to formal arguments. Indexes are 1-based. java.util.Map<VarSymbol, int[]> usedArguments = new java.util.HashMap(); java.util.Map<VarSymbol,mlsub.typing.Polytype> types = new java.util.HashMap(); public void addReceiver(Expression value) { if (arguments[0] != null) Internal.error("No room for \"receiver\""); arguments[0] = new Argument(value: value); } void add(Expression arg, ?LocatedString name) { Argument[] newArgs = cast(new Argument[arguments.length + 1]); System.arraycopy(arguments, 0, newArgs, 0, arguments.length); newArgs[arguments.length] = new Argument(value: arg, name: name); arguments = newArgs; } int size() { if (computedExpressions != null) return notNull(computedExpressions).length; else return arguments.length; } Argument get(int num) { return arguments[num]; } Expression getExp(int num) { if (computedExpressions != null) return notNull(computedExpressions)[num]; else return arguments[num].value; } void setExp(int num, Expression value) { arguments[num].value = value; } void noOverloading() { for (int i = arguments.length; --i>=0; ) arguments[i].value = arguments[i].value.noOverloading(); } void computeTypes() { for (int i = arguments.length; --i>=0; ) arguments[i].value.getType(); } Expression[] inOrder() { if (arguments.length == 0) return Expression.noExpressions; Expression[] res = cast(new Expression[arguments.length]); for (int i = arguments.length; --i>=0; ) res[i] = arguments[i].value; return res; } ?gnu.bytecode.ClassType staticClass() { let res = this.getExp(0).staticClass(); if (res != null) // the first argument was fake, remove it { Argument[] newArgs = cast(new Argument[arguments.length - 1]); System.arraycopy(arguments, 1, newArgs, 0, newArgs.length); arguments = newArgs; } return res; } Expression[?] getExpressions(VarSymbol s) = applicationExpressions.get(s); int[?] getUsedArguments(VarSymbol s) = usedArguments.get(s); /** return true if there are arity non-tagged arguments. */ boolean plainApplication(int arity, VarSymbol symbol) { if (arguments.length != arity) return false; for (int i = 0; i<arguments.length; i++) if (arguments[i].name != null) return false; applicationExpressions.put(symbol, this.inOrder()); return true; } toString() = "(" + Util.map("", ", ", "", arguments) + ")"; public String toStringInfix() { StringBuffer res = new StringBuffer("("); for (int i = 1; i<arguments.length; i++) res.append(arguments[i].toString() + (i + 1 < arguments.length ? ", " : "")); return res.append(")").toString(); } public String printTypes() { StringBuffer res = new StringBuffer("("); for (int i = 0; i<arguments.length; i++) res.append((arguments[i].name == null ? "" : notNull(arguments[i].name) + ":") + arguments[i].value.getType() + (i + 1 < arguments.length ? ", " : "")); return res.append(")").toString(); } } public Arguments createArguments(List<Argument> args) { return new Arguments(arguments: args.toArray()); } public class Argument { private Expression value; ?LocatedString name = null; toString() = (name == null ? "" : notNull(name) + ":" ) + value; } Index: enum.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/enum.nice,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** enum.nice 12 Jan 2005 18:50:37 -0000 1.12 --- enum.nice 13 Jan 2005 16:47:34 -0000 1.13 *************** *** 131,135 **** { res = new gnu.expr.Declaration(name.toString(), nice.tools.code.Types.javaType(type)); ! this.setDeclaration(res); definition.module.addGlobalVar(res, true); } --- 131,135 ---- { res = new gnu.expr.Declaration(name.toString(), nice.tools.code.Types.javaType(type)); ! this.setDeclaration(notNull(res)); definition.module.addGlobalVar(res, true); } *************** *** 175,187 **** Monotype type = new TypeIdent(name: enumName); type.nullness = /*absent*/3; ! List<Arguments.Argument> args = new ArrayList(2 + fields.size()); ! args.add(new Arguments.Argument(createStringConstantExp(name.toString()), ! new LocatedString("name",name.location))); ! args.add(new Arguments.Argument(createIntConstantExp(ordinal, notNull(name.location())), ! new LocatedString("ordinal", name.location))); for (int i = 0; i < fields.size(); i++) ! args.add(new Arguments.Argument(argExps[i], fields[i].getName())); return new EnumSymbol(name, syntacticType: type, definition: def, value: ! createNewExp(new TypeIdent(name: enumName), new Arguments(args))); } --- 175,187 ---- Monotype type = new TypeIdent(name: enumName); type.nullness = /*absent*/3; ! List<Argument> args = new ArrayList(2 + fields.size()); ! args.add(new Argument(value: createStringConstantExp(name.toString()), ! name: new LocatedString("name",name.location))); ! args.add(new Argument(value: createIntConstantExp(ordinal, notNull(name.location())), ! name: new LocatedString("ordinal", name.location))); for (int i = 0; i < fields.size(); i++) ! args.add(new Argument(value: argExps[i], name: fields[i].getName())); return new EnumSymbol(name, syntacticType: type, definition: def, value: ! createNewExp(new TypeIdent(name: enumName), new Arguments(arguments: args.toArray()))); } Index: overloadedsymbol.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/overloadedsymbol.nice,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** overloadedsymbol.nice 3 Jan 2005 01:24:28 -0000 1.11 --- overloadedsymbol.nice 13 Jan 2005 16:47:34 -0000 1.12 *************** *** 125,129 **** mlsub.typing.Polytype[] argsType = ! this.computeArgsType(arguments.getExpressions(s), s.getClonedType(), arguments.getUsedArguments(s)); --- 125,129 ---- mlsub.typing.Polytype[] argsType = ! this.computeArgsType(notNull(arguments.getExpressions(s)), s.getClonedType(), arguments.getUsedArguments(s)); *************** *** 322,327 **** try { let res = new CallExp(function: createOverloadedSymbolExp(fieldAccesses, ident, true), ! //Arguments.noArguments()); ! arguments: new Arguments([new Arguments.Argument(Node.thisExp)])); res.setLocation(ident.location()); --- 322,326 ---- try { let res = new CallExp(function: createOverloadedSymbolExp(fieldAccesses, ident, true), ! arguments: new Arguments(arguments: [new Argument(value: notNull(Node.thisExp))])); res.setLocation(ident.location()); *************** *** 624,629 **** for (int i = 0; i < syms.length; i++) for (int j = i+1; j < syms.length; j++) ! if (overlappingJavaMethods(cast(syms[i].getMethodDeclaration()), ! cast(syms[j].getMethodDeclaration()))) { // We can remove either, since they lead to the same implementation --- 623,628 ---- for (int i = 0; i < syms.length; i++) for (int j = i+1; j < syms.length; j++) ! if (overlappingJavaMethods(syms[i].getMethodDeclaration(), ! syms[j].getMethodDeclaration())) { // We can remove either, since they lead to the same implementation *************** *** 636,641 **** } ! private boolean overlappingJavaMethods(MethodDeclaration m1, ! MethodDeclaration m2) { if (! (m1 instanceof JavaMethod) || --- 635,640 ---- } ! private boolean overlappingJavaMethods(?MethodDeclaration m1, ! ?MethodDeclaration m2) { if (! (m1 instanceof JavaMethod) || *************** *** 656,661 **** { for (noMatch : noMatches) ! if (noMatch.isFunSymbol()) ! argnames.retainAll(args.noMatchByName(cast(noMatch.getFormalParameters()))); if (!argnames.isEmpty()) --- 655,660 ---- { for (noMatch : noMatches) ! if (noMatch instanceof FunSymbol) ! argnames.retainAll(args.noMatchByName(noMatch.getFormalParameters())); if (!argnames.isEmpty()) Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** tools.nice 12 Jan 2005 22:06:54 -0000 1.96 --- tools.nice 13 Jan 2005 16:47:34 -0000 1.97 *************** *** 203,216 **** ****************************************************************/ - LocatedString name(VarSymbol) = native VarSymbol.name; - Arguments.Argument[] arguments(Arguments) = native Arguments.arguments; - Arguments Argument(List<Arguments.Argument>) = native new Arguments(List); - Arguments Argument(Arguments.Argument[]) = native new Arguments(Arguments.Argument[]); mlsub.typing.Polytype getType(Expression) = native mlsub.typing.Polytype Expression.getType(); GlobalTypeScope getGlobalTypeScope() = native GlobalTypeScope Node.getGlobalTypeScope(); - ?gnu.bytecode.ClassType staticClass(Arguments) = native gnu.bytecode.ClassType Arguments.staticClass(); ?gnu.bytecode.ClassType staticClass(Expression) = native gnu.bytecode.ClassType Expression.staticClass(); - Map<VarSymbol,mlsub.typing.Polytype> types(Arguments) = native Arguments.types; <T> String map(String, String, String, T[]) = native String bossa.util.Util.map(String, String, String, Object[]); <T> String map(String, String, String, ?Collection<T>) = native String bossa.util.Util.map(String, String, String, Collection); --- 203,210 ---- *************** *** 219,223 **** ?Object getFieldAccessMethod(Expression) = native Object Expression.getFieldAccessMethod(); ?Object getField(Expression) = native Object Expression.getField(); - ?Object getFieldAccessMethod(VarSymbol) = native Object VarSymbol.getFieldAccessMethod(); ?mlsub.typing.Monotype Types_getTypeParameter(mlsub.typing.Polytype, int) = native mlsub.typing.Monotype nice.tools.typing.Types.getTypeParameter(mlsub.typing.Polytype, int); ?mlsub.typing.Monotype Types_getTypeParameter(mlsub.typing.Monotype, int) = native mlsub.typing.Monotype nice.tools.typing.Types.getTypeParameter(mlsub.typing.Monotype, int); --- 213,216 ---- *************** *** 225,229 **** ?mlsub.typing.TypeConstructor head(mlsub.typing.Monotype) = native mlsub.typing.TypeConstructor mlsub.typing.Monotype.head(); ?gnu.bytecode.ClassType getSuperclass(gnu.bytecode.ClassType) = native gnu.bytecode.ClassType gnu.bytecode.ClassType.getSuperclass(); - int[?] getUsedArguments(Arguments, VarSymbol) = native int[] Arguments.getUsedArguments(VarSymbol); ?mlsub.typing.Constraint getConstraint(mlsub.typing.Polytype) = native mlsub.typing.Constraint mlsub.typing.Polytype.getConstraint(); mlsub.typing.AtomicConstraint[?] AtomicConstraint_substitute(java.util.Map<mlsub.typing.TypeSymbol,mlsub.typing.TypeSymbol>, AtomicConstraint[?]) = native mlsub.typing.AtomicConstraint[] mlsub.typing.AtomicConstraint.substitute(java.util.Map, mlsub.typing.AtomicConstraint[]); --- 218,221 ---- *************** *** 233,237 **** ?gnu.bytecode.Attribute get(gnu.bytecode.AttrContainer, String) = native gnu.bytecode.Attribute gnu.bytecode.Attribute.get(gnu.bytecode.AttrContainer, String); void printInterface(Definition, java.io.PrintWriter) = native void Definition.printInterface(java.io.PrintWriter); - ?gnu.expr.Declaration getDeclaration(VarSymbol) = native gnu.expr.Declaration VarSymbol.getDeclaration(); void printInterface(ClassImplementation, java.io.PrintWriter) = native void ClassImplementation.printInterface(java.io.PrintWriter); ?gnu.bytecode.Type TypeImport_lookup(LocatedString) = native gnu.bytecode.Type nice.tools.code.TypeImport.lookup(LocatedString); --- 225,228 ---- *************** *** 245,250 **** List<VarSymbol> lookup(VarScope, LocatedString) = native List VarScope.lookup(LocatedString); Map<gnu.bytecode.Type,mlsub.typing.TypeConstructor> javaTypeConstructors(bossa.modules.Compilation ) = native bossa.modules.Compilation.javaTypeConstructors; ! Map<VarSymbol, int[]> usedArguments(Arguments) = native Arguments.usedArguments; ! Map<VarSymbol, Expression[]> applicationExpressions(Arguments) = native Arguments.applicationExpressions; // Retypings needed since java types are not strict. --- 236,240 ---- List<VarSymbol> lookup(VarScope, LocatedString) = native List VarScope.lookup(LocatedString); Map<gnu.bytecode.Type,mlsub.typing.TypeConstructor> javaTypeConstructors(bossa.modules.Compilation ) = native bossa.modules.Compilation.javaTypeConstructors; ! LocatedString name(Symbol) = native Symbol.name; // Retypings needed since java types are not strict. Index: Node.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Node.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Node.java 10 Jan 2005 23:58:04 -0000 1.66 --- Node.java 13 Jan 2005 16:47:33 -0000 1.67 *************** *** 91,95 **** } ! void addSymbol(VarSymbol s) { if (varSymbols == null) --- 91,95 ---- } ! void addSymbol(/*VarSymbol*/Symbol s) { if (varSymbols == null) Index: formalParameters.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/formalParameters.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** formalParameters.nice 12 Jan 2005 22:06:53 -0000 1.5 --- formalParameters.nice 13 Jan 2005 16:47:34 -0000 1.6 *************** *** 138,142 **** for (int i = 0; i< args.size(); i++) { ! Arguments.Argument a = args.get(i); if (a.name != null) if (this.fill(map, notNull(a.name).toString(), i)) --- 138,142 ---- for (int i = 0; i< args.size(); i++) { ! Argument a = args.get(i); if (a.name != null) if (this.fill(map, notNull(a.name).toString(), i)) *************** *** 147,151 **** for (int i = 0; i< args.size(); i++) { ! Arguments.Argument a = args.get(i); if (a.name == null) if (this.fill(map, i)) --- 147,151 ---- for (int i = 0; i< args.size(); i++) { ! Argument a = args.get(i); if (a.name == null) if (this.fill(map, i)) Index: symbol.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/symbol.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** symbol.nice 12 Jan 2005 22:06:54 -0000 1.8 --- symbol.nice 13 Jan 2005 16:47:34 -0000 1.9 *************** *** 13,16 **** --- 13,123 ---- package bossa.syntax; + import bossa.util.*; + + /** + A variable (local, field of a class, parameter of a method or function). + + */ + public abstract class VarSymbol extends Symbol implements Located + { + private ?gnu.expr.Declaration decl = null; + private boolean isThis = false; + + location() = notNull(name.location()); + + public LocatedString getName() = name; + + public boolean hasName(LocatedString i) = this.name.equals(i); + + boolean isAssignable() = true; + + boolean isFieldAccess() = this.getFieldAccessMethod() != null; + + ?FieldAccess getFieldAccessMethod() = null; + + public ?MethodDeclaration getMethodDeclaration() = null; + + boolean isIgnored() = false; + + void checkSpecialRequirements(Expression[?] arguments) + { + // Do nothing by default. + } + + public ?Definition getDefinition() = null; + + // uncommenting this triggers a bug + // mlsub.typing.Polytype getType(); + + /** + @return + 0 : doesn't match + 1 : wasn't even a function + 2 : matches + */ + int match(Arguments arguments) = 1; + + /** + * Specialized by MethodSymbol only. + */ + String defaultExplainWhyMatchFails(Arguments arguments) + { + return this.explainWhyMatchFails(arguments); + } + + /** This returns a generic explanation. + A more precise message should be returned if possible in subclasses. + */ + String explainWhyMatchFails(Arguments arguments) + { + return "Incorrect call to " + name; + } + + // explained in OverloadedSymbolExp + void makeClonedType(); + void releaseClonedType(); + mlsub.typing.Polytype getClonedType(); + + /** @return code that accesses this variable. */ + gnu.expr.Expression compile() + { + // Allow a sub-class to compute decl a la demande in getDeclaration(). + let decl = this.getDeclaration(); + + if (decl == null) + Internal.error(this + " has no bytecode declaration"); + + if (isThis) + return new gnu.expr.ThisExp(decl); + else + return new gnu.expr.ReferenceExp(name == null ? null : name.toString(), + decl); + } + + /** @return code that accesses this variable, when it is used + as the function of a call. */ + gnu.expr.Expression compileInCallPosition() + { + // Default implementation. + return this.compile(); + } + + ?gnu.expr.Declaration getDeclaration() = decl; + + public void setDeclaration(gnu.expr.Declaration declaration) + { + this.setDeclaration(declaration, false); + } + + public void setDeclaration(gnu.expr.Declaration declaration, boolean isThis) + { + this.decl = declaration; + this.isThis = isThis; + if (name != null) + notNull(name.location).write(notNull(this.decl)); + notNull(this.decl).setCanRead(true); + notNull(this.decl).setCanWrite(true); + } + } /** *************** *** 31,46 **** boolean used = false; - /* public MonoSymbol(LocatedString name, Monotype type) - { - super(name); - this.syntacticType=type; - } - - public MonoSymbol(LocatedString name, mlsub.typing.Monotype type) - { - super(name); - this.type = type; - } - */ getType() = new mlsub.typing.Polytype(type); --- 138,141 ---- *************** *** 186,192 **** int arity; ! isFunSymbol() = true; ! ! getFormalParameters() = cast(this.parameters); String describeParameters() --- 281,285 ---- int arity; ! ?FormalParameters getFormalParameters() = this.parameters; String describeParameters() Index: assign.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/assign.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** assign.nice 7 Dec 2004 17:33:57 -0000 1.5 --- assign.nice 13 Jan 2005 16:47:34 -0000 1.6 *************** *** 41,50 **** if (to instanceof CallExp && "get".equals(to.function.toString())) { ! List<Arguments.Argument> args = new ArrayList(to.arguments.arguments); ! args.add(new Arguments.Argument(value)); return createCallExp( createIdentExp(new LocatedString("set", to.function.location())), ! new Arguments(args)); } --- 41,50 ---- if (to instanceof CallExp && "get".equals(to.function.toString())) { ! List<Argument> args = new ArrayList(to.arguments.arguments); ! args.add(new Argument(value: value)); return createCallExp( createIdentExp(new LocatedString("set", to.function.location())), ! new Arguments(arguments: args.toArray())); } Index: call.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/call.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** call.nice 10 Jan 2005 23:58:04 -0000 1.8 --- call.nice 13 Jan 2005 16:47:34 -0000 1.9 *************** *** 224,228 **** { SymbolExp func = cast(function); ! Definition def = func.symbol.getDefinition(); if (def instanceof RetypedJavaMethod) --- 224,228 ---- { SymbolExp func = cast(function); ! let def = func.symbol.getDefinition(); if (def instanceof RetypedJavaMethod) *************** *** 241,245 **** Expression param1) { ! let res = new CallExp(function:function, arguments:new Arguments([new Arguments.Argument(param1)])); res.setLocation(function.location()); return res; --- 241,245 ---- Expression param1) { ! let res = new CallExp(function:function, arguments:new Arguments(arguments: [new Argument(value: param1)])); res.setLocation(function.location()); return res; *************** *** 249,253 **** Expression param1, Expression param2) { ! let res = new CallExp(function:function, arguments:new Arguments([new Arguments.Argument(param1), new Arguments.Argument(param2)])); res.setLocation(function.location()); return res; --- 249,253 ---- Expression param1, Expression param2) { ! let res = new CallExp(function:function, arguments:new Arguments(arguments: [new Argument(value: param1), new Argument(value: param2)])); res.setLocation(function.location()); return res; *************** *** 258,262 **** Expression param3) { ! let res = new CallExp(function:function, arguments:new Arguments([new Arguments.Argument(param1), new Arguments.Argument(param2), new Arguments.Argument(param3)])); res.setLocation(function.location()); return res; --- 258,262 ---- Expression param3) { ! let res = new CallExp(function:function, arguments:new Arguments(arguments: [new Argument(value: param1), new Argument(value: param2), new Argument(value: param3)])); res.setLocation(function.location()); return res; Index: VarScope.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/VarScope.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** VarScope.java 9 Dec 2003 15:21:05 -0000 1.19 --- VarScope.java 13 Jan 2005 16:47:33 -0000 1.20 *************** *** 37,41 **** } ! void addSymbol(VarSymbol s) { this.defs.put(s.name,s); --- 37,41 ---- } ! void addSymbol(/*VarSymbol*/Symbol s) { this.defs.put(s.name,s); *************** *** 52,57 **** while(i.hasNext()) { ! VarSymbol s = (VarSymbol)i.next(); addSymbol(s); } } --- 52,58 ---- while(i.hasNext()) { ! /*VarSymbol*/Symbol s = (/*VarSymbol*/Symbol)i.next(); addSymbol(s); + } } *************** *** 60,64 **** Adds a collection of VarSymbols */ ! void addSymbols(VarSymbol[] s) { if (s == null) return; --- 61,65 ---- Adds a collection of VarSymbols */ ! void addSymbols(/*VarSymbol*/Symbol[] s) { if (s == null) return; *************** *** 69,73 **** } ! void removeSymbol(VarSymbol sym) { defs.remove(sym.name, sym); --- 70,74 ---- } ! void removeSymbol(/*VarSymbol*/Symbol sym) { defs.remove(sym.name, sym); Index: globalvar.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/globalvar.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** globalvar.nice 11 Jan 2005 21:45:46 -0000 1.3 --- globalvar.nice 13 Jan 2005 16:47:34 -0000 1.4 *************** *** 72,76 **** res = new gnu.expr.Declaration (name.toString(), nice.tools.code.Types.javaType(type)); ! this.setDeclaration(res); if (! definition.inInterfaceFile()) --- 72,76 ---- res = new gnu.expr.Declaration (name.toString(), nice.tools.code.Types.javaType(type)); ! this.setDeclaration(notNull(res)); if (! definition.inInterfaceFile()) --- Arguments.java DELETED --- --- VarSymbol.java DELETED --- |