[Nice-commit] Nice/src/bossa/syntax Arguments.java,1.28,1.29 constant.nice,1.4,1.5 ident.nice,1.1,1.
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2004-12-14 20:18:14
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28329/F:/nice/src/bossa/syntax Modified Files: Arguments.java constant.nice ident.nice Removed Files: PackageExp.java Log Message: Converted PackageExp. Index: constant.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/constant.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** constant.nice 8 Dec 2004 20:00:58 -0000 1.4 --- constant.nice 14 Dec 2004 20:18:05 -0000 1.5 *************** *** 282,286 **** return root; ! let res = new PackageExp(fullName); res.setLocation(name.location()); return res; --- 282,286 ---- return root; ! let res = createPackageExp(fullName); res.setLocation(name.location()); return res; Index: Arguments.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Arguments.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Arguments.java 21 Nov 2004 23:24:36 -0000 1.28 --- Arguments.java 14 Dec 2004 20:18:05 -0000 1.29 *************** *** 140,155 **** } - PackageExp packageExp() - { - // case where the parameters is a package, or a package prefix - if(arguments.length == 1) - { - Expression param0 = getExp(0); - if(param0 instanceof PackageExp) - return (PackageExp) param0; - } - return null; - } - gnu.bytecode.ClassType staticClass() { --- 140,143 ---- Index: ident.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ident.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ident.nice 7 Dec 2004 17:33:57 -0000 1.1 --- ident.nice 14 Dec 2004 20:18:05 -0000 1.2 *************** *** 62,63 **** --- 62,115 ---- return res; } + + /** + Temporary expression to represent a package or a package prefix. + + For instance, in java.lang.System.exit(0), + java and java.lang is represented by a package exp. + */ + class PackageExp extends Expression + { + StringBuffer name; + + LocatedString locatedName() + { + return new LocatedString(name.toString(), this.location()); + } + + toString() = "PackageExp " + name; + + private void error() + { + User.error(this, + name + " is neither a valid expression nor a valid package"); + } + + computeType() + { + this.error(); + } + + compile() + { + this.error(); + return cast(null); + } + } + + PackageExp createPackageExp(String name) + { + return new PackageExp(name: new StringBuffer(name)); + } + + ?PackageExp packageExp(Arguments args) + { + // case where the parameters is a package, or a package prefix + if (args.size() == 1) + { + Expression param0 = args.getExp(0); + if (param0 instanceof PackageExp) + return param0; + } + return null; + } --- PackageExp.java DELETED --- |