[Nice-commit] Nice/src/nice/tools/code Gen.java,1.24,1.25 TypeImport.java,1.10,1.11 Types.java,1.65,
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2005-01-14 18:54:04
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12024/F:/nice/src/nice/tools/code Modified Files: Gen.java TypeImport.java Types.java Log Message: Removed some dead code. Index: Gen.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Gen.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Gen.java 13 Jan 2005 16:47:32 -0000 1.24 --- Gen.java 14 Jan 2005 18:53:53 -0000 1.25 *************** *** 152,167 **** /** - @return an expression that references the lambda expression. - */ - public static ReferenceExp referenceTo(LambdaExp lambda) - { - Declaration decl = new Declaration(lambda.getName()); - decl.noteValue(lambda); - decl.setFlag(Declaration.IS_CONSTANT|Declaration.STATIC_SPECIFIED); - decl.setProcedureDecl(true); - return new ReferenceExp(decl); - } - - /** @return the lambda expression referenced. */ --- 152,155 ---- Index: TypeImport.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/TypeImport.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TypeImport.java 20 Dec 2004 20:25:52 -0000 1.10 --- TypeImport.java 14 Jan 2005 18:53:53 -0000 1.11 *************** *** 31,43 **** public class TypeImport { - public static void setRuntime(String file) - { - runtime = file; - } - - private static String runtime; - - public static String getRuntime() { return runtime; } - public static Type lookup(bossa.syntax.LocatedString className) { --- 31,34 ---- *************** *** 114,135 **** ****************************************************************/ - /** Search className in opened packages too */ - static java.lang.Class lookupJavaClass(String className) - { - Class res = lookupQualifiedJavaClass(className); - - if (res != null) - return res; - - String[] pkgs = bossa.syntax.Node.getGlobalTypeScopeModule().listImplicitPackages(); - for (int i = 0; i < pkgs.length; i++) - { - res = lookupQualifiedJavaClass(pkgs[i] + "." + className); - if(res != null) - return res; - } - return null; - } - static HashMap stringToReflectClass = new HashMap(); --- 105,108 ---- Index: Types.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Types.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Types.java 12 Jan 2005 18:50:34 -0000 1.65 --- Types.java 14 Jan 2005 18:53:53 -0000 1.66 *************** *** 127,152 **** } - public static void setBytecodeType(Polytype t) - { - Constraint cst = t.getConstraint(); - if (Constraint.hasBinders(cst)) - { - Typing.enter(); - try{ - Constraint.enter(cst); - setBytecodeType(t.getMonotype()); - } - catch(TypingEx e) {} - finally{ - try{ - Typing.leave(); - } - catch(TypingEx e) {} - } - } - else - setBytecodeType(t.getMonotype()); - } - /**************************************************************** * Mapping monotypes to java types --- 127,130 ---- *************** *** 542,579 **** return null; } - - /**************************************************************** - * Default values - ****************************************************************/ - - public static Expression defaultValue(Monotype m) - { - if (!(m instanceof MonotypeConstructor)) - return QuoteExp.nullExp; - - TypeConstructor tc = nice.tools.typing.Types.rawType(m).head(); - - if (tc == null) - return QuoteExp.nullExp; - - if(tc == PrimitiveType.intTC || - tc == PrimitiveType.byteTC || - tc == PrimitiveType.shortTC || - tc == PrimitiveType.longTC) - return zeroInt; - if(tc == PrimitiveType.floatTC || - tc == PrimitiveType.doubleTC) - return zeroFloat; - if(tc == PrimitiveType.boolTC) - return QuoteExp.falseExp; - if(tc == PrimitiveType.charTC) - return zeroChar; - - return QuoteExp.nullExp; - } - - private static Expression zeroInt = new QuoteExp(new Integer(0)); - private static Expression zeroFloat = new QuoteExp(new Float(0.0)); - private static Expression zeroChar = new QuoteExp(new Character((char) 0)); /**************************************************************** --- 520,523 ---- |