[Nice-commit] Nice/src/bossa/syntax Symbol.java,1.1,1.2 ai.nice,1.4,1.5 alternative.nice,1.7,1.8 ana
Brought to you by:
bonniot
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29296/F:/nice/src/bossa/syntax Modified Files: Symbol.java ai.nice alternative.nice analyse.nice codegen.nice compilation.nice constant.nice customConstructor.nice dispatchTest.nice enum.nice globalvar.nice increment.nice javaMethod.nice locals.nice monotype.nice niceclass.nice nicefield.nice pattern.nice primitive.nice rewrite.nice super.nice symbol.nice symbolexp.nice tools.nice typeConstructors.nice typecheck.nice typedef.nice Log Message: Conversion cleanup part 2. Index: nicefield.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/nicefield.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** nicefield.nice 14 Jan 2005 11:12:11 -0000 1.5 --- nicefield.nice 14 Jan 2005 22:47:11 -0000 1.6 *************** *** 95,99 **** { let decl = declaringClass.classe.addField ! (sym.name.toString(), nice.tools.code.Types.javaType(sym.type)); method.fieldDecl = decl; decl.setFlag(isFinal_, gnu.expr.Declaration.IS_CONSTANT); --- 95,99 ---- { let decl = declaringClass.classe.addField ! (sym.getName().toString(), nice.tools.code.Types.javaType(sym.type)); method.fieldDecl = decl; decl.setFlag(isFinal_, gnu.expr.Declaration.IS_CONSTANT); Index: compilation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/compilation.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** compilation.nice 14 Jan 2005 11:12:10 -0000 1.5 --- compilation.nice 14 Jan 2005 22:47:11 -0000 1.6 *************** *** 142,146 **** { ?mlsub.typing.TypeConstructor firstArgument = alt.getPatterns()[0].getTC(); ! let def = firstArgument==null ? null : getTypeDefinition(firstArgument); if (def != null && def.getImplementation() instanceof NiceClass) --- 142,146 ---- { ?mlsub.typing.TypeConstructor firstArgument = alt.getPatterns()[0].getTC(); ! let def = getTypeDefinition(firstArgument); if (def != null && def.getImplementation() instanceof NiceClass) Index: niceclass.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceclass.nice,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** niceclass.nice 14 Jan 2005 16:41:27 -0000 1.20 --- niceclass.nice 14 Jan 2005 22:47:11 -0000 1.21 *************** *** 407,411 **** for (msym : constructors) { ! let MethodDeclaration m = notNull(msym.getMethodDeclaration()); // Only consider parent methods for which a call from this class --- 407,411 ---- for (msym : constructors) { ! let m = msym.getMethodDeclaration(); // Only consider parent methods for which a call from this class *************** *** 454,458 **** for (msym : constructors) { ! let MethodDeclaration decl = notNull(msym.getMethodDeclaration()); res.add((decl, notNull(decl.formalParameters()).getParameters(scope))); } --- 454,458 ---- for (msym : constructors) { ! let decl = msym.getMethodDeclaration(); res.add((decl, notNull(decl.formalParameters()).getParameters(scope))); } *************** *** 728,732 **** let allAtoms = new mlsub.typing.AtomicConstraint[n + typeParameters.length * 2]; if (n > 0) ! System.arraycopy(atoms, 0, allAtoms, 2 * typeParameters.length, n); for(int i = 0; i < typeParameters.length; i++) --- 728,732 ---- let allAtoms = new mlsub.typing.AtomicConstraint[n + typeParameters.length * 2]; if (n > 0) ! System.arraycopy(notNull(atoms), 0, allAtoms, 2 * typeParameters.length, n); for(int i = 0; i < typeParameters.length; i++) Index: customConstructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/customConstructor.nice,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** customConstructor.nice 14 Jan 2005 16:41:27 -0000 1.18 --- customConstructor.nice 14 Jan 2005 22:47:11 -0000 1.19 *************** *** 185,186 **** --- 185,228 ---- return res; } + + void resolveCCThis(Statement stmt, Located thisLoc, NiceClass classe) + { + void missingThisError() + { + User.error(thisLoc, "The last statement must be a call to 'this' constructor"); + } + + Block block = cast(stmt); + + if (block.statements.length == 0) + missingThisError(); + + Statement last = block.last; + if (last instanceof Block) + { + resolveCCThis(last, thisLoc, classe); + return; + } + + if (! (last instanceof ExpressionStmt)) + missingThisError(); + + ExpressionStmt expstmt = cast(last); + + if (! (expstmt.exp instanceof CallExp)) + missingThisError(); + + CallExp call = cast(expstmt.exp); + + if (! (call.function instanceof IdentExp)) + missingThisError(); + + IdentExp ident = cast(call.function); + + if (! ident.toString().equals("this")) + missingThisError(); + + call.function = createOverloadedSymbolExp(new ArrayList(cast(classe).getConstructorCallSymbols()), + thisName); + call.function.setLocation(ident.location()); + } Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** typecheck.nice 11 Jan 2005 21:45:46 -0000 1.121 --- typecheck.nice 14 Jan 2005 22:47:11 -0000 1.122 *************** *** 712,718 **** catch(TypingEx t){ reportNullAssignmentError(decl, t, value: value, ! target.name.toString(), notNull(target.getMonotype())); ! throw assignmentError(target, target.name.toString(), String.valueOf(target.getMonotype), value); --- 712,718 ---- catch(TypingEx t){ reportNullAssignmentError(decl, t, value: value, ! target.getName.toString(), notNull(target.getMonotype())); ! throw assignmentError(target, target.getName().toString(), String.valueOf(target.getMonotype), value); *************** *** 788,794 **** catch(TypingEx t){ reportNullAssignmentError(decl, t, value: value, ! target.name.toString(), notNull(target.getMonotype())); ! throw assignmentError(target, target.name.toString(), String.valueOf(target.getMonotype), value); --- 788,794 ---- catch(TypingEx t){ reportNullAssignmentError(decl, t, value: value, ! target.getName().toString(), notNull(target.getMonotype())); ! throw assignmentError(target, target.getName().toString(), String.valueOf(target.getMonotype), value); Index: super.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/super.nice,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** super.nice 14 Jan 2005 11:12:11 -0000 1.10 --- super.nice 14 Jan 2005 22:47:11 -0000 1.11 *************** *** 88,92 **** private void getSuper(JavaMethod decl) { ! gnu.bytecode.Type firstArg = nice.tools.code.Types.get(notNull(currentMethod).firstArgument()); if (! (firstArg instanceof gnu.bytecode.ClassType)) --- 88,92 ---- private void getSuper(JavaMethod decl) { ! let firstArg = nice.tools.code.Types.get(notNull(currentMethod).firstArgument()); if (! (firstArg instanceof gnu.bytecode.ClassType)) Index: locals.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/locals.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** locals.nice 14 Jan 2005 16:41:27 -0000 1.8 --- locals.nice 14 Jan 2005 22:47:11 -0000 1.9 *************** *** 28,32 **** } ! location() = this.getSymbol().name.location(); gnu.expr.Expression compile(gnu.expr.LetExp letExp) --- 28,32 ---- } ! location() = notNull(this.getSymbol().name).location(); gnu.expr.Expression compile(gnu.expr.LetExp letExp) *************** *** 93,97 **** LocalVariableSymbol left; ! getName() = left.name.toString(); getSymbol() = left; getBytecodeType() = nice.tools.code.Types.javaType(left.type); --- 93,97 ---- LocalVariableSymbol left; ! getName() = notNull(left.name).toString(); getSymbol() = left; getBytecodeType() = nice.tools.code.Types.javaType(left.type); *************** *** 152,156 **** MonoSymbol left; ! getName() = left.name.toString(); getSymbol() = left; getBytecodeType() = nice.tools.code.Types.javaType(left.type); --- 152,156 ---- MonoSymbol left; ! getName() = notNull(left.name).toString(); getSymbol() = left; getBytecodeType() = nice.tools.code.Types.javaType(left.type); *************** *** 185,189 **** FormalParameters parameters; ! getName() = left.name.toString(); getSymbol() = left; getBytecodeType() = nice.tools.code.Types.javaType(left.type); --- 185,189 ---- FormalParameters parameters; ! getName() = notNull(left.name).toString(); getSymbol() = left; getBytecodeType() = nice.tools.code.Types.javaType(left.type); Index: monotype.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/monotype.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** monotype.nice 13 Jan 2005 23:56:06 -0000 1.9 --- monotype.nice 14 Jan 2005 22:47:11 -0000 1.10 *************** *** 206,210 **** Monotype res = createMonotypeConstructor (notNull(tc), ! new TypeParameters(content: notNull(parameters.content).mapToArray(Monotype t => t.substitute(map))), loc); res.nullness = this.nullness; --- 206,210 ---- Monotype res = createMonotypeConstructor (notNull(tc), ! new TypeParameters(content: parameters.content.mapToArray(Monotype t => t.substitute(map))), loc); res.nullness = this.nullness; *************** *** 212,216 **** } ! containsAlike() = notNull(parameters.content).any(Monotype t => t.containsAlike()); public ?TypeIdent getTC() = tc; --- 212,216 ---- } ! containsAlike() = parameters.content.any(Monotype t => t.containsAlike()); public ?TypeIdent getTC() = tc; Index: symbolexp.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/symbolexp.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** symbolexp.nice 3 Jan 2005 01:24:28 -0000 1.3 --- symbolexp.nice 14 Jan 2005 22:47:11 -0000 1.4 *************** *** 80,87 **** public LocatedString getName() { ! return symbol.name; } ! toString() = symbol.name.toQuotedString(); } --- 80,87 ---- public LocatedString getName() { ! return symbol.getName(); } ! toString() = symbol.getName().toQuotedString(); } Index: alternative.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/alternative.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** alternative.nice 14 Jan 2005 16:41:27 -0000 1.7 --- alternative.nice 14 Jan 2005 22:47:11 -0000 1.8 *************** *** 38,42 **** * Tests the matching of tags against a method alternative. */ ! public boolean matches(TypeConstructor[] tags) { for(int i = 0; i < patterns.length; i++) --- 38,42 ---- * Tests the matching of tags against a method alternative. */ ! public boolean matches(?TypeConstructor[] tags) { for(int i = 0; i < patterns.length; i++) *************** *** 47,51 **** } ! public boolean matchesTypePart(TypeConstructor[] tags, boolean[] isValue) { for(int i = 0; i < patterns.length; i++) --- 47,51 ---- } ! public boolean matchesTypePart(?TypeConstructor[] tags, boolean[] isValue) { for(int i = 0; i < patterns.length; i++) Index: Symbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Symbol.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Symbol.java 13 Jan 2005 16:47:33 -0000 1.1 --- Symbol.java 14 Jan 2005 22:47:11 -0000 1.2 *************** *** 27,31 **** } ! LocatedString name; // commenting this triggers a bug --- 27,31 ---- } ! final LocatedString name; // commenting this triggers a bug Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** analyse.nice 14 Jan 2005 16:41:27 -0000 1.126 --- analyse.nice 14 Jan 2005 22:47:11 -0000 1.127 *************** *** 198,202 **** this.checkNotDefined(symbol); ! this.vars[symbol.name.toString()] = symbol; } --- 198,202 ---- this.checkNotDefined(symbol); ! this.vars[notNull(symbol.name).toString()] = symbol; } *************** *** 216,220 **** this.checkNotDefined(symbol); ! this.vars[symbol.name.toString()] = symbol; symbol.depth = this.depth; } --- 216,220 ---- this.checkNotDefined(symbol); ! this.vars[notNull(symbol.name).toString()] = symbol; symbol.depth = this.depth; } *************** *** 228,232 **** void checkNotDefined(VarSymbol symbol) { ! ?VarSymbol old = this.vars[symbol.name.toString()]; if (old != null) throw error(symbol, "Symbol " + symbol.name + " is already defined.\n" + --- 228,232 ---- void checkNotDefined(VarSymbol symbol) { ! ?VarSymbol old = this.vars[notNull(symbol.name).toString()]; if (old != null) throw error(symbol, "Symbol " + symbol.name + " is already defined.\n" + *************** *** 276,280 **** analyseAssigned(TupleExp e, info) { ! Expression[] es = notNull(e.expressions); for (int i = 0; i < es.length; i++) es[i] = es[i].analyseAssigned(info); --- 276,280 ---- analyseAssigned(TupleExp e, info) { ! Expression[] es = e.expressions; for (int i = 0; i < es.length; i++) es[i] = es[i].analyseAssigned(info); *************** *** 329,333 **** if (e.infix) ! markAsCallFirstArg(notNull(args.getExp(0))); List<ExpLocalVariable> expLocals = new ArrayList(); --- 329,333 ---- if (e.infix) ! markAsCallFirstArg(args.getExp(0)); List<ExpLocalVariable> expLocals = new ArrayList(); *************** *** 366,370 **** if (nextComponent == null) ! throw unknownIdent(notNull(pkg.locatedName())); return createTypeConstantExp(pkg, nextComponent); --- 366,370 ---- if (nextComponent == null) ! throw unknownIdent(pkg.locatedName()); return createTypeConstantExp(pkg, nextComponent); *************** *** 390,395 **** ?LocatedString funName = identString(e.function); if (funName == null) ! throw notNull(bossa.util.Internal.error ! (e.function, "This is not a valid class member")); int arity = args.size(); --- 390,394 ---- ?LocatedString funName = identString(e.function); if (funName == null) ! throw Internal.error(e.function, "This is not a valid class member"); int arity = args.size(); *************** *** 481,485 **** if (!e.isInfix()) // infix symbols can only come from the global scope { ! ?VarSymbol sym = info.lookup(notNull(e.ident).toString()); if (sym != null) --- 480,484 ---- if (!e.isInfix()) // infix symbols can only come from the global scope { ! ?VarSymbol sym = info.lookup(e.ident.toString()); if (sym != null) *************** *** 502,506 **** if (e.alwaysOverloadedSymbol) ! return createOverloadedSymbolExp(sym, notNull(e.ident)); else return createSymbolExp(sym, e.location()); --- 501,505 ---- if (e.alwaysOverloadedSymbol) ! return createOverloadedSymbolExp(sym, e.ident); else return createSymbolExp(sym, e.location()); *************** *** 512,516 **** symbols = cast(notNull(Node.getGlobalScope()).lookup(e.ident)); else ! symbols = info.globalLookup(notNull(e.ident)); if (symbols != null && symbols.size() > 0) --- 511,515 ---- symbols = cast(notNull(Node.getGlobalScope()).lookup(e.ident)); else ! symbols = info.globalLookup(e.ident); if (symbols != null && symbols.size() > 0) *************** *** 533,537 **** if (sym.isNonStaticFieldAccess() && Node.thisExp != null) { ! CallExp res = new CallExp(function: createOverloadedSymbolExp(symbols, notNull(e.ident)), arguments: new Arguments(arguments: [new Argument(value: notNull(Node.thisExp))])); res.setLocation(e.location()); --- 532,536 ---- if (sym.isNonStaticFieldAccess() && Node.thisExp != null) { ! CallExp res = new CallExp(function: createOverloadedSymbolExp(symbols, e.ident), arguments: new Arguments(arguments: [new Argument(value: notNull(Node.thisExp))])); res.setLocation(e.location()); *************** *** 542,546 **** { // 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()); --- 541,545 ---- { // Make an implicit call to fetch the static field's value. ! CallExp res = new CallExp(function: createOverloadedSymbolExp(symbols, e.ident), arguments: new Arguments(arguments: [])); res.setLocation(e.location()); *************** *** 551,561 **** } else ! return createOverloadedSymbolExp(symbols, notNull(e.ident)); } if (e.enableClassExp) ! return createTypeConstantExp(null, notNull(e.ident)); ! throw unknownIdent(notNull(e.ident)); } --- 550,560 ---- } else ! return createOverloadedSymbolExp(symbols, e.ident); } if (e.enableClassExp) ! return createTypeConstantExp(null, e.ident); ! throw unknownIdent(e.ident); } *************** *** 728,732 **** { info.begin(); ! notNull(b.locals).foreach(LocalDeclaration l => analyse(l, info)); analyse(b.statements, info); info.end(); --- 727,731 ---- { info.begin(); ! b.locals.foreach(LocalDeclaration l => analyse(l, info)); analyse(b.statements, info); info.end(); Index: primitive.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/primitive.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** primitive.nice 1 Dec 2004 02:00:32 -0000 1.1 --- primitive.nice 14 Jan 2005 22:47:11 -0000 1.2 *************** *** 33,37 **** ?gnu.bytecode.Type t = nice.tools.typing.PrimitiveType.register(definition.name.toString(), definition.getTC()); if (t == null) ! User.error(definition, definition.name + " is not a known primitive type"); definition.setJavaType(t); return new PrimitiveTypeImplementation(); --- 33,38 ---- ?gnu.bytecode.Type t = nice.tools.typing.PrimitiveType.register(definition.name.toString(), definition.getTC()); if (t == null) ! throw User.error(definition, definition.name + " is not a known primitive type"); ! definition.setJavaType(t); return new PrimitiveTypeImplementation(); Index: pattern.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/pattern.nice,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pattern.nice 14 Jan 2005 16:41:27 -0000 1.16 --- pattern.nice 14 Jan 2005 22:47:11 -0000 1.17 *************** *** 76,83 **** // Class constraints ! if (tc == null) ! return; ! ! let def = getTypeDefinition(notNull(tc)); if (def == null) return; --- 76,80 ---- // Class constraints ! let def = getTypeDefinition(tc); if (def == null) return; *************** *** 479,483 **** let EnumSymbol esym = cast(atValue.value); for (sym : esym.getDefinition().symbols) ! values.add(createSymbolConstantExp(notNull(tc), sym, sym.name.toString(), this.location)); } --- 476,480 ---- let EnumSymbol esym = cast(atValue.value); for (sym : esym.getDefinition().symbols) ! values.add(createSymbolConstantExp(notNull(tc), sym, sym.getName().toString(), this.location)); } Index: codegen.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/codegen.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** codegen.nice 13 Jan 2005 14:06:15 -0000 1.1 --- codegen.nice 14 Jan 2005 22:47:11 -0000 1.2 *************** *** 66,70 **** (gnu.expr.LambdaExp lexp, ?String bytecodeName, ! gnu.bytecode.Type[] argTypes, gnu.bytecode.Type retType, MonoSymbol[?] args, --- 66,70 ---- (gnu.expr.LambdaExp lexp, ?String bytecodeName, ! gnu.bytecode.Type[?] argTypes, gnu.bytecode.Type retType, MonoSymbol[?] args, *************** *** 89,95 **** { boolean isThis = member && n == 0; ! String parameterName = notNull(args)[n].getName() == null ? "anonymous_" + n ! : notNull(notNull(args)[n].getName()).toString(); gnu.expr.Declaration d; --- 89,95 ---- { boolean isThis = member && n == 0; ! String parameterName = notNull(args)[n].name == null ? "anonymous_" + n ! : notNull(notNull(args)[n].name).toString(); gnu.expr.Declaration d; Index: dispatchTest.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/dispatchTest.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dispatchTest.nice 14 Jan 2005 11:12:10 -0000 1.6 --- dispatchTest.nice 14 Jan 2005 22:47:11 -0000 1.7 *************** *** 15,19 **** import bossa.util.*; ! List<mlsub.typing.TypeConstructor[]> enumerate(?mlsub.typing.Constraint, mlsub.typing.lowlevel.Element[], boolean[]) = native List mlsub.typing.Enumeration.enumerate(mlsub.typing.Constraint, mlsub.typing.lowlevel.Element[], boolean[]); /** --- 15,19 ---- import bossa.util.*; ! List<?mlsub.typing.TypeConstructor[]> enumerate(?mlsub.typing.Constraint, mlsub.typing.lowlevel.Element[], boolean[]) = native List mlsub.typing.Enumeration.enumerate(mlsub.typing.Constraint, mlsub.typing.lowlevel.Element[], boolean[]); /** *************** *** 201,205 **** throw Internal.error(method + " is not in a proper state."); ! List<mlsub.typing.TypeConstructor[]> multitags = enumerateTags(type, used); boolean[] isValue = new boolean[method.getArity()]; --- 201,205 ---- throw Internal.error(method + " is not in a proper state."); ! List<?mlsub.typing.TypeConstructor[]> multitags = enumerateTags(type, used); boolean[] isValue = new boolean[method.getArity()]; *************** *** 236,240 **** } ! private ?gnu.bytecode.ClassType classTypeOfNiceClass(mlsub.typing.TypeConstructor tc) { let def = getTypeDefinition(tc); --- 236,240 ---- } ! private ?gnu.bytecode.ClassType classTypeOfNiceClass(?mlsub.typing.TypeConstructor tc) { let def = getTypeDefinition(tc); *************** *** 257,261 **** */ private boolean testTypes(MethodDeclaration method, ! mlsub.typing.TypeConstructor[] tags, Stack<Alternative> sortedAlternatives, ?gnu.bytecode.ClassType firstArg, --- 257,261 ---- */ private boolean testTypes(MethodDeclaration method, ! ?mlsub.typing.TypeConstructor[] tags, Stack<Alternative> sortedAlternatives, ?gnu.bytecode.ClassType firstArg, *************** *** 311,315 **** private boolean testValues (MethodDeclaration method, ! mlsub.typing.TypeConstructor[] tags, List<?ConstantExp[]> valueCombis, boolean[] isValue, --- 311,315 ---- private boolean testValues (MethodDeclaration method, ! ?mlsub.typing.TypeConstructor[] tags, List<?ConstantExp[]> valueCombis, boolean[] isValue, *************** *** 353,357 **** } ! private String tagsToString(mlsub.typing.TypeConstructor[] tags) { let res = new StringBuffer(); --- 353,357 ---- } ! private String tagsToString(?mlsub.typing.TypeConstructor[] tags) { let res = new StringBuffer(); *************** *** 366,370 **** } ! private String tagsToString(mlsub.typing.TypeConstructor[] tags, ?ConstantExp[] values, boolean[] isValue) { let res = new StringBuffer(); --- 366,370 ---- } ! private String tagsToString(?mlsub.typing.TypeConstructor[] tags, ?ConstantExp[] values, boolean[] isValue) { let res = new StringBuffer(); *************** *** 390,394 **** PrimtiveType.nullTC if it can be matched by @null **/ ! private List<mlsub.typing.TypeConstructor[]> enumerateTags(mlsub.typing.Polytype type, boolean[] used) { mlsub.typing.Monotype[] domains = type.domain(); --- 390,394 ---- PrimtiveType.nullTC if it can be matched by @null **/ ! private List<?mlsub.typing.TypeConstructor[]> enumerateTags(mlsub.typing.Polytype type, boolean[] used) { mlsub.typing.Monotype[] domains = type.domain(); *************** *** 430,434 **** throw new Error(); ! List<mlsub.typing.TypeConstructor[]> res = mlsub.typing.Enumeration.enumerate(cst, types, used); return mergeNullCases(res, domains.length); } --- 430,434 ---- throw new Error(); ! List<?mlsub.typing.TypeConstructor[]> res = mlsub.typing.Enumeration.enumerate(cst, types, used); return mergeNullCases(res, domains.length); } *************** *** 441,451 **** alternatively a nullness marker TC and a normal TC */ ! private List<mlsub.typing.TypeConstructor[]> mergeNullCases(List<mlsub.typing.TypeConstructor[]> tuples, int length) { ! LinkedList<mlsub.typing.TypeConstructor[]> res = new LinkedList(); ! Set<mlsub.typing.TypeConstructor[]> tupleSet = new TreeSet(tagComp); for (tuple : tuples) { ! mlsub.typing.TypeConstructor[] tags = flattenTags(tuple, length); //add only non duplicate tags if (tupleSet.add(tags)) --- 441,451 ---- alternatively a nullness marker TC and a normal TC */ ! private List<?mlsub.typing.TypeConstructor[]> mergeNullCases(List<?mlsub.typing.TypeConstructor[]> tuples, int length) { ! LinkedList<?mlsub.typing.TypeConstructor[]> res = new LinkedList(); ! Set<?mlsub.typing.TypeConstructor[]> tupleSet = new TreeSet(tagComp); for (tuple : tuples) { ! ?mlsub.typing.TypeConstructor[] tags = flattenTags(tuple, length); //add only non duplicate tags if (tupleSet.add(tags)) *************** *** 455,459 **** } ! private let Comparator<mlsub.typing.TypeConstructor[]> tagComp = new TagComparator(); private class TagComparator<-T> implements Comparator<T> --- 455,459 ---- } ! private let Comparator<?mlsub.typing.TypeConstructor[]> tagComp = new TagComparator(); private class TagComparator<-T> implements Comparator<T> *************** *** 461,466 **** compare(o1, o2) { ! mlsub.typing.TypeConstructor[] tc1 = cast(o1); ! mlsub.typing.TypeConstructor[] tc2 = cast(o2); for(int i = 0; i<tc1.length; i++) --- 461,466 ---- compare(o1, o2) { ! ?mlsub.typing.TypeConstructor[] tc1 = cast(o1); ! ?mlsub.typing.TypeConstructor[] tc2 = cast(o2); for(int i = 0; i<tc1.length; i++) *************** *** 473,478 **** if (tc2[i] == null) return 1; ! int a = tc1[i].getId(); ! int b = tc2[i].getId(); if (a<b) return -1; --- 473,478 ---- if (tc2[i] == null) return 1; ! int a = notNull(tc1[i]).getId(); ! int b = notNull(tc2[i]).getId(); if (a<b) return -1; *************** *** 497,503 **** alternatively a nullness marker TC and a normal TC */ ! private mlsub.typing.TypeConstructor[] flattenTags(mlsub.typing.TypeConstructor[] tags, int length) { ! mlsub.typing.TypeConstructor[] res = cast(new mlsub.typing.TypeConstructor[length]); for (int i = length; --i >= 0 ;) if (tags[2 * i] == nice.tools.typing.PrimitiveType.nullTC) --- 497,503 ---- alternatively a nullness marker TC and a normal TC */ ! private ?mlsub.typing.TypeConstructor[] flattenTags(?mlsub.typing.TypeConstructor[] tags, int length) { ! ?mlsub.typing.TypeConstructor[] res = new mlsub.typing.TypeConstructor[length]; for (int i = length; --i >= 0 ;) if (tags[2 * i] == nice.tools.typing.PrimitiveType.nullTC) Index: ai.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ai.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ai.nice 5 Jan 2005 02:02:43 -0000 1.4 --- ai.nice 14 Jan 2005 22:47:11 -0000 1.5 *************** *** 117,121 **** interfaceITF = ident.resolveToItf(notNull(typeScope)); ! let def = getTypeDefinition(notNull(classTC)); boolean isNiceClass = def != null && --- 117,121 ---- interfaceITF = ident.resolveToItf(notNull(typeScope)); ! let def = getTypeDefinition(classTC); boolean isNiceClass = def != null && *************** *** 127,131 **** if (def != null) ! def.addInterfaceImplementation(interfaceITF); this.createContext(); --- 127,131 ---- if (def != null) ! def.addInterfaceImplementation(notNull(interfaceITF)); this.createContext(); Index: rewrite.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/rewrite.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rewrite.nice 3 Sep 2004 18:07:27 -0000 1.7 --- rewrite.nice 14 Jan 2005 22:47:11 -0000 1.8 *************** *** 50,54 **** { ifExp.elseExp = new StatementExp ! (statement: rewrite(makeBlock(notNull(ifExp.elseExp), statements.slice(from: i+1)))); return statements.slice(to: i); --- 50,54 ---- { ifExp.elseExp = new StatementExp ! (statement: rewrite(makeBlock(ifExp.elseExp, statements.slice(from: i+1)))); return statements.slice(to: i); *************** *** 57,61 **** { ifExp.thenExp = new StatementExp ! (statement: rewrite(makeBlock(notNull(ifExp.thenExp), statements.slice(from: i+1)))); return statements.slice(to: i); --- 57,61 ---- { ifExp.thenExp = new StatementExp ! (statement: rewrite(makeBlock(ifExp.thenExp, statements.slice(from: i+1)))); return statements.slice(to: i); Index: typedef.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typedef.nice,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** typedef.nice 14 Jan 2005 11:12:11 -0000 1.14 --- typedef.nice 14 Jan 2005 22:47:11 -0000 1.15 *************** *** 330,337 **** mlsub.typing.Monotype[?] resolveParams(MonotypeConstructor parent, TypeScope typeScope) { ! if (parent.parameters == null) ! return null; ! ! return resolveMonotypes(typeScope, cast(notNull(parent.parameters).content)); } --- 330,334 ---- mlsub.typing.Monotype[?] resolveParams(MonotypeConstructor parent, TypeScope typeScope) { ! return resolveMonotypes(typeScope, parent.parameters.content); } *************** *** 380,384 **** let parentMap = new int[params.length]; this.parentTypeParameterMap = parentMap; ! let parentParams = notNull( this.parentParams ); List<mlsub.typing.TypeSymbol> binders = new ArrayList(); --- 377,381 ---- let parentMap = new int[params.length]; this.parentTypeParameterMap = parentMap; ! let parentParams = notNull(this.parentParams); List<mlsub.typing.TypeSymbol> binders = new ArrayList(); *************** *** 429,445 **** getInterfaces() = interfaces.toArray(); ! void addInterfaceImplementation(?Interface itf) { ! if (itf != null) ! interfaces.add(itf); } getJavaInterfaces() = javaInterfaces; ! void setJavaType(?gnu.bytecode.Type javaType) { - if (javaType == null) - return; - this.javaType = javaType; nice.tools.code.Types.set(tc, javaType); --- 426,438 ---- getInterfaces() = interfaces.toArray(); ! void addInterfaceImplementation(Interface itf) { ! interfaces.add(itf); } getJavaInterfaces() = javaInterfaces; ! void setJavaType(gnu.bytecode.Type javaType) { this.javaType = javaType; nice.tools.code.Types.set(tc, javaType); *************** *** 463,467 **** class ClassDefinition extends TypeDefinition { ! // Super class ?MonotypeConstructor superClassIdent = null; ?mlsub.typing.TypeConstructor superClass = null; --- 456,460 ---- class ClassDefinition extends TypeDefinition { ! // Super class ?MonotypeConstructor superClassIdent = null; ?mlsub.typing.TypeConstructor superClass = null; *************** *** 471,477 **** getSuperClassDefinition() { ! if (superClass == null) ! return null; ! let s = getTypeDefinition(notNull(superClass)); if (s instanceof ClassDefinition) return s; --- 464,468 ---- getSuperClassDefinition() { ! let s = getTypeDefinition(superClass); if (s instanceof ClassDefinition) return s; *************** *** 705,713 **** } ! ?TypeDefinition getTypeDefinition(mlsub.typing.TypeConstructor tc) = ! tcToTypeDef.get(tc); ?TypeDefinition getTypeDefinition(mlsub.typing.Interface itf) = ! tcToTypeDef.get( itf.associatedTC() ); //used in mlsub.typing.Enumeration --- 696,709 ---- } ! ?TypeDefinition getTypeDefinition(?mlsub.typing.TypeConstructor tc) ! { ! if (tc == null) ! return null; ! ! return tcToTypeDef.get(tc); ! } ?TypeDefinition getTypeDefinition(mlsub.typing.Interface itf) = ! getTypeDefinition(itf.associatedTC()); //used in mlsub.typing.Enumeration *************** *** 733,737 **** ?mlsub.typing.Monotype getTypeWithTC(TypeConstructor tc) { ! ?TypeDefinition def = cast(getTypeDefinition(tc)); if (def == null) --- 729,733 ---- ?mlsub.typing.Monotype getTypeWithTC(TypeConstructor tc) { ! ?TypeDefinition def = getTypeDefinition(tc); if (def == null) *************** *** 762,766 **** ?mlsub.typing.Monotype getTypeWithTC(TypeConstructor tc, mlsub.typing.Monotype[?] sourceParams ) { ! ?TypeDefinition def = cast(getTypeDefinition(tc)); if (def == null) --- 758,762 ---- ?mlsub.typing.Monotype getTypeWithTC(TypeConstructor tc, mlsub.typing.Monotype[?] sourceParams ) { ! ?TypeDefinition def = getTypeDefinition(tc); if (def == null) *************** *** 845,857 **** return -1; - if (notNull(parent.parameters).content == null) - return -1; - // Assume non-variance ! return notNull(notNull(parent.parameters).content).length; } // Constructors - ClassDefinition makeClass(LocatedString name, boolean isFinal, boolean isAbstract, --- 841,849 ---- return -1; // Assume non-variance ! return notNull(parent.parameters).content.length; } // Constructors ClassDefinition makeClass(LocatedString name, boolean isFinal, boolean isAbstract, Index: constant.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/constant.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** constant.nice 14 Jan 2005 16:41:27 -0000 1.8 --- constant.nice 14 Jan 2005 22:47:11 -0000 1.9 *************** *** 113,136 **** if (Byte.MIN_VALUE <= value <= Byte.MAX_VALUE && !isLong) { ! type = notNull(nice.tools.typing.PrimitiveType.bytePolytype); ! tc = notNull(nice.tools.typing.PrimitiveType.byteTC); object = new Byte(byte(value)); } else if (Short.MIN_VALUE <= value <= Short.MAX_VALUE && !isLong) { ! type = notNull(nice.tools.typing.PrimitiveType.shortPolytype); ! tc = notNull(nice.tools.typing.PrimitiveType.shortTC); object = new Short(short(value)); } else if (Integer.MIN_VALUE <= value <= Integer.MAX_VALUE && !isLong) { ! type = notNull(nice.tools.typing.PrimitiveType.intPolytype); ! tc = notNull(nice.tools.typing.PrimitiveType.intTC); object = value; } else { ! type = notNull(nice.tools.typing.PrimitiveType.longPolytype); ! tc = notNull(nice.tools.typing.PrimitiveType.longTC); object = value; } --- 113,136 ---- if (Byte.MIN_VALUE <= value <= Byte.MAX_VALUE && !isLong) { ! type = nice.tools.typing.PrimitiveType.bytePolytype; ! tc = nice.tools.typing.PrimitiveType.byteTC; object = new Byte(byte(value)); } else if (Short.MIN_VALUE <= value <= Short.MAX_VALUE && !isLong) { ! type = nice.tools.typing.PrimitiveType.shortPolytype; ! tc = nice.tools.typing.PrimitiveType.shortTC; object = new Short(short(value)); } else if (Integer.MIN_VALUE <= value <= Integer.MAX_VALUE && !isLong) { ! type = nice.tools.typing.PrimitiveType.intPolytype; ! tc = nice.tools.typing.PrimitiveType.intTC; object = value; } else { ! type = nice.tools.typing.PrimitiveType.longPolytype; ! tc = nice.tools.typing.PrimitiveType.longTC; object = value; } *************** *** 253,257 **** } ! compile() = notNull(gnu.expr.QuoteExp.nullExp); toString() = "null"; --- 253,257 ---- } ! compile() = gnu.expr.QuoteExp.nullExp; toString() = "null"; *************** *** 280,284 **** let res = new BooleanConstantExp(tc: nice.tools.typing.PrimitiveType.boolTC, value: value, representation: value ? "true" : "false", ! compiledValue: notNull(value ? gnu.expr.QuoteExp.trueExp : gnu.expr.QuoteExp.falseExp)); res.type = nice.tools.typing.PrimitiveType.boolPolytype; res.setLocation(location); --- 280,284 ---- let res = new BooleanConstantExp(tc: nice.tools.typing.PrimitiveType.boolTC, value: value, representation: value ? "true" : "false", ! compiledValue: value ? gnu.expr.QuoteExp.trueExp : gnu.expr.QuoteExp.falseExp); res.type = nice.tools.typing.PrimitiveType.boolPolytype; res.setLocation(location); *************** *** 307,311 **** User.error(value, "Invalid character constant: " + value); ! return createCharConstant(s[0], notNull(value.location())); } --- 307,311 ---- User.error(value, "Invalid character constant: " + value); ! return createCharConstant(s[0], value.location()); } Index: javaMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/javaMethod.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** javaMethod.nice 14 Jan 2005 16:41:27 -0000 1.6 --- javaMethod.nice 14 Jan 2005 22:47:11 -0000 1.7 *************** *** 117,121 **** ?List<gnu.bytecode.Method> methods = knownMethods.get(m.getName()); if (methods == null) ! knownMethods.put( m.getName(), methods = new ArrayList() ); assert methods != null; --- 117,121 ---- ?List<gnu.bytecode.Method> methods = knownMethods.get(m.getName()); if (methods == null) ! knownMethods.put(m.getName(), methods = new ArrayList()); assert methods != null; Index: typeConstructors.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typeConstructors.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** typeConstructors.nice 20 Dec 2004 16:05:19 -0000 1.1 --- typeConstructors.nice 14 Jan 2005 22:47:11 -0000 1.2 *************** *** 19,23 **** */ ! var HashMap<mlsub.typing.TypeConstructor,?LinkedList<VarSymbol>> constructorsMap = new HashMap(); public void resetConstructorsMap() { constructorsMap = new HashMap(); } --- 19,23 ---- */ ! var HashMap<mlsub.typing.TypeConstructor,?LinkedList<MethodSymbol>> constructorsMap = new HashMap(); public void resetConstructorsMap() { constructorsMap = new HashMap(); } *************** *** 29,33 **** this class. */ ! ?LinkedList<VarSymbol> getConstructors(mlsub.typing.TypeConstructor tc) { return constructorsMap.get(tc); --- 29,33 ---- this class. */ ! ?LinkedList<MethodSymbol> getConstructors(mlsub.typing.TypeConstructor tc) { return constructorsMap.get(tc); *************** *** 36,40 **** void addConstructor(mlsub.typing.TypeConstructor tc, MethodDeclaration m) { ! ?LinkedList<VarSymbol> l = constructorsMap.get(tc); if (l==null) { --- 36,40 ---- void addConstructor(mlsub.typing.TypeConstructor tc, MethodDeclaration m) { ! ?LinkedList<MethodSymbol> l = constructorsMap.get(tc); if (l==null) { *************** *** 47,51 **** void removeConstructor(TypeConstructor tc, MethodDeclaration m) { ! ?LinkedList<VarSymbol> l = constructorsMap.get(tc); if (l == null) return; --- 47,51 ---- void removeConstructor(TypeConstructor tc, MethodDeclaration m) { ! ?LinkedList<MethodSymbol> l = constructorsMap.get(tc); if (l == null) return; Index: symbol.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/symbol.nice,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** symbol.nice 14 Jan 2005 16:41:27 -0000 1.10 --- symbol.nice 14 Jan 2005 22:47:11 -0000 1.11 *************** *** 24,32 **** private boolean isThis = false; ! location() = name.location(); ! public LocatedString getName() = name; ! public boolean hasName(LocatedString i) = this.name.equals(i); boolean isAssignable() = true; --- 24,32 ---- private boolean isThis = false; ! location() = notNull(name).location(); ! public LocatedString getName() = notNull(name); ! public boolean hasName(LocatedString i) = notNull(name).equals(i); boolean isAssignable() = true; *************** *** 91,95 **** return new gnu.expr.ThisExp(decl); else ! return new gnu.expr.ReferenceExp(name == null ? null : name.toString(), decl); } --- 91,95 ---- return new gnu.expr.ThisExp(decl); else ! return new gnu.expr.ReferenceExp(name == null ? null : notNull(name).toString(), decl); } *************** *** 115,119 **** this.isThis = isThis; if (name != null) ! name.location().write(declaration); declaration.setCanRead(true); declaration.setCanWrite(true); --- 115,119 ---- this.isThis = isThis; if (name != null) ! notNull(name).location().write(declaration); declaration.setCanRead(true); declaration.setCanWrite(true); *************** *** 179,190 **** int arity = k.domainArity; if (notNull(arguments).size() != arity) ! return name + Util.has(arity, "parameter", notNull(arguments).size()); else // If the number of arguments is correct, it must be that // some arguments are named. ! return name + " does not have named parameters"; } else ! return name + " is not a function"; } --- 179,190 ---- int arity = k.domainArity; if (notNull(arguments).size() != arity) ! return notNull(name) + Util.has(arity, "parameter", notNull(arguments).size()); else // If the number of arguments is correct, it must be that // some arguments are named. ! return notNull(name) + " does not have named parameters"; } else ! return notNull(name) + " is not a function"; } *************** *** 324,330 **** { if (arguments.size() == 0) ! return name + " is not defined"; ! return name + " is a field of class " + this.describeParameters(); } --- 324,330 ---- { if (arguments.size() == 0) ! return notNull(name) + " is not defined"; ! return notNull(name) + " is a field of class " + this.describeParameters(); } *************** *** 384,388 **** getDefinition() = this.declaration; ! getMethodDeclaration() = this.declaration; compile() = this.declaration.getCode(); --- 384,388 ---- getDefinition() = this.declaration; ! public override MethodDeclaration getMethodDeclaration() = this.declaration; compile() = this.declaration.getCode(); Index: enum.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/enum.nice,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** enum.nice 14 Jan 2005 16:41:27 -0000 1.14 --- enum.nice 14 Jan 2005 22:47:11 -0000 1.15 *************** *** 130,134 **** if (res == null) { ! res = new gnu.expr.Declaration(name.toString(), nice.tools.code.Types.javaType(type)); this.setDeclaration(notNull(res)); definition.module.addGlobalVar(res, true); --- 130,134 ---- if (res == null) { ! res = new gnu.expr.Declaration(notNull(name).toString(), nice.tools.code.Types.javaType(type)); this.setDeclaration(notNull(res)); definition.module.addGlobalVar(res, true); Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** tools.nice 14 Jan 2005 16:41:27 -0000 1.99 --- tools.nice 14 Jan 2005 22:47:11 -0000 1.100 *************** *** 133,178 **** } - void resolveCCThis(Statement stmt, Located thisLoc, NiceClass classe) - { - void missingThisError() - { - User.error(thisLoc, "The last statement must be a call to 'this' constructor"); - } - - Block block = cast(stmt); - - if (block.statements.length == 0) - missingThisError(); - - Statement last = block.last; - if (last instanceof Block) - { - resolveCCThis(last, thisLoc, classe); - return; - } - - if (! (last instanceof ExpressionStmt)) - missingThisError(); - - ExpressionStmt expstmt = cast(last); - - if (! (expstmt.exp instanceof CallExp)) - missingThisError(); - - CallExp call = cast(expstmt.exp); - - if (! (call.function instanceof IdentExp)) - missingThisError(); - - IdentExp ident = cast(call.function); - - if (! ident.toString().equals("this")) - missingThisError(); - - call.function = createOverloadedSymbolExp(new ArrayList(cast(classe).getConstructorCallSymbols()), - thisName); - call.function.setLocation(ident.location()); - } - /** A mapping from type names to type symbols. --- 133,136 ---- *************** *** 234,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; ! LocatedString name(Symbol) = native Symbol.name; gnu.bytecode.ClassType Type_pointer_type() = native gnu.bytecode.Type.pointer_type; - gnu.expr.QuoteExp QuoteExp_undefined_exp() = native gnu.expr.QuoteExp.undefined_exp; // Retypings needed since java types are not strict. mlsub.typing.Polytype boolPolytype() = native nice.tools.typing.PrimitiveType.boolPolytype; mlsub.typing.Polytype longPolytype() = native nice.tools.typing.PrimitiveType.longPolytype; mlsub.typing.Polytype voidPolytype() = native nice.tools.typing.PrimitiveType.voidPolytype; mlsub.typing.Monotype boolType() = native nice.tools.typing.PrimitiveType.boolType; mlsub.typing.Monotype intType() = native nice.tools.typing.PrimitiveType.intType; mlsub.typing.Monotype longType() = native nice.tools.typing.PrimitiveType.longType; gnu.expr.QuoteExp trueExp() = native gnu.expr.QuoteExp.trueExp; gnu.expr.QuoteExp voidExp() = native gnu.expr.QuoteExp.voidExp; // Local Variables: --- 192,221 ---- 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; ! ?TypeConstructor associatedTC(mlsub.typing.Interface) = native TypeConstructor mlsub.typing.Interface.associatedTC(); ! mlsub.typing.AtomicConstraint[?] atoms(mlsub.typing.Constraint) = native mlsub.typing.AtomicConstraint[] mlsub.typing.Constraint.atoms(); ! ?gnu.bytecode.Type Types_get(mlsub.typing.TypeConstructor) = native gnu.bytecode.Type nice.tools.code.Types.get(mlsub.typing.TypeConstructor); gnu.bytecode.ClassType Type_pointer_type() = native gnu.bytecode.Type.pointer_type; // Retypings needed since java types are not strict. mlsub.typing.Polytype boolPolytype() = native nice.tools.typing.PrimitiveType.boolPolytype; mlsub.typing.Polytype longPolytype() = native nice.tools.typing.PrimitiveType.longPolytype; + mlsub.typing.Polytype intPolytype() = native nice.tools.typing.PrimitiveType.intPolytype; + mlsub.typing.Polytype shortPolytype() = native nice.tools.typing.PrimitiveType.shortPolytype; + mlsub.typing.Polytype bytePolytype() = native nice.tools.typing.PrimitiveType.bytePolytype; mlsub.typing.Polytype voidPolytype() = native nice.tools.typing.PrimitiveType.voidPolytype; mlsub.typing.Monotype boolType() = native nice.tools.typing.PrimitiveType.boolType; mlsub.typing.Monotype intType() = native nice.tools.typing.PrimitiveType.intType; mlsub.typing.Monotype longType() = native nice.tools.typing.PrimitiveType.longType; + gnu.bytecode.ClassType Type_pointer_type() = native gnu.bytecode.Type.pointer_type; + mlsub.typing.TypeConstructor longTC() = native nice.tools.typing.PrimitiveType.longTC; + mlsub.typing.TypeConstructor intTC() = native nice.tools.typing.PrimitiveType.intTC; + mlsub.typing.TypeConstructor shortTC() = native nice.tools.typing.PrimitiveType.shortTC; + mlsub.typing.TypeConstructor byteTC() = native nice.tools.typing.PrimitiveType.byteTC; + gnu.expr.QuoteExp nullExp() = native gnu.expr.QuoteExp.nullExp; + gnu.expr.QuoteExp falseExp() = native gnu.expr.QuoteExp.falseExp; gnu.expr.QuoteExp trueExp() = native gnu.expr.QuoteExp.trueExp; gnu.expr.QuoteExp voidExp() = native gnu.expr.QuoteExp.voidExp; + gnu.expr.QuoteExp QuoteExp_undefined_exp() = native gnu.expr.QuoteExp.undefined_exp; // Local Variables: Index: globalvar.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/globalvar.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** globalvar.nice 13 Jan 2005 16:47:34 -0000 1.4 --- globalvar.nice 14 Jan 2005 22:47:11 -0000 1.5 *************** *** 71,75 **** { res = new gnu.expr.Declaration ! (name.toString(), nice.tools.code.Types.javaType(type)); this.setDeclaration(notNull(res)); --- 71,75 ---- { res = new gnu.expr.Declaration ! (notNull(name).toString(), nice.tools.code.Types.javaType(type)); this.setDeclaration(notNull(res)); Index: increment.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/increment.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** increment.nice 14 Jan 2005 16:41:27 -0000 1.5 --- increment.nice 14 Jan 2005 22:47:11 -0000 1.6 *************** *** 33,37 **** { variable = variable.noOverloading(); ! if(!variable.isAssignable()) User.error(this, variable + " cannot be incremented"); --- 33,37 ---- { variable = variable.noOverloading(); ! if (!variable.isAssignable()) User.error(this, variable + " cannot be incremented"); *************** *** 39,43 **** if (decl != null) return new gnu.expr.IncrementExp ! (decl, (short) (increment ? 1 : -1), !returnOld); // variable is not a local variable, so it must be a field --- 39,43 ---- if (decl != null) return new gnu.expr.IncrementExp ! (decl, short(increment ? 1 : -1), !returnOld); // variable is not a local variable, so it must be a field |