[Nice-commit] Nice/src/bossa/syntax Expression.java,1.55,1.56 NullExp.java,1.9,1.10 Pattern.java,1.8
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2004-08-03 14:36:31
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30944/F:/nice/src/bossa/syntax Modified Files: Expression.java NullExp.java Pattern.java tools.nice typecheck.nice Log Message: Removed explicit use of NullExp. Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tools.nice 2 Aug 2004 19:10:58 -0000 1.40 --- tools.nice 3 Aug 2004 14:36:05 -0000 1.41 *************** *** 35,42 **** } - boolean isNullExp(Expression); - isNullExp(Expression e) = false; - isNullExp(NullExp e) = true; - ?MonoSymbol localVariable(Expression); localVariable(Expression e) = null; --- 35,38 ---- Index: Pattern.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** Pattern.java 3 Aug 2004 10:16:13 -0000 1.87 --- Pattern.java 3 Aug 2004 14:36:05 -0000 1.88 *************** *** 934,938 **** return atValue != null && !atBool() && !atNull() &&!atIntCompare(); } ! public boolean atNull() { return atValue instanceof NullExp; } /** This pattern only specifies that the vlaue is not null. This cannot be explicitely used in source programs, but it is useful --- 934,938 ---- return atValue != null && !atBool() && !atNull() &&!atIntCompare(); } ! public boolean atNull() { return (atValue != null) && atValue.isNull(); } /** This pattern only specifies that the vlaue is not null. This cannot be explicitely used in source programs, but it is useful Index: NullExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NullExp.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NullExp.java 2 Sep 2003 19:57:52 -0000 1.9 --- NullExp.java 3 Aug 2004 14:36:05 -0000 1.10 *************** *** 43,46 **** --- 43,51 ---- } + public boolean isNull() + { + return true; + } + void computeType() { Index: Expression.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Expression.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Expression.java 28 Jul 2004 14:40:33 -0000 1.55 --- Expression.java 3 Aug 2004 14:36:05 -0000 1.56 *************** *** 98,101 **** --- 98,106 ---- } + public boolean isNull() + { + return false; + } + /** * Resolves overloading, taking into account the parameters Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** typecheck.nice 30 Jul 2004 19:08:45 -0000 1.105 --- typecheck.nice 3 Aug 2004 14:36:05 -0000 1.106 *************** *** 295,301 **** int varPosition; ! if (isNullExp(notNull(test.arguments.getExp(0)))) varPosition = 1; ! else if (isNullExp(notNull(test.arguments.getExp(1)))) varPosition = 0; else // Give up. --- 295,301 ---- int varPosition; ! if (isNull(notNull(test.arguments.getExp(0)))) varPosition = 1; ! else if (isNull(notNull(test.arguments.getExp(1)))) varPosition = 0; else // Give up. |