Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 96125 invoked from network); 30 Oct 2006 00:51:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2006 00:51:05 -0000 Received: (qmail 54603 invoked by uid 500); 30 Oct 2006 00:51:12 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 54377 invoked by uid 500); 30 Oct 2006 00:51:11 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 54368 invoked by uid 99); 30 Oct 2006 00:51:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Oct 2006 16:51:11 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [66.11.181.4] (HELO griffin.griffaction.ca) (66.11.181.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Oct 2006 16:50:57 -0800 Received: from [127.0.0.1] (helo=[127.0.0.1]) by griffin.griffaction.ca with esmtp (Exim 4.50 #1 (Debian)) id 1GeLMJ-0000od-9l for ; Sun, 29 Oct 2006 19:50:35 -0500 Message-ID: <45454B7F.2020601@sablevm.org> Date: Sun, 29 Oct 2006 19:46:55 -0500 From: Etienne Gagnon User-Agent: Debian Thunderbird 1.0.2 (X11/20060927) X-Accept-Language: en-us, en MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classlib] Preprocessor (was Re: [classlib][rmi] Code smell - Thread.sleep() in ActivationGroup method) References: <3b3f27c60610282200w2445a56ena39736e4a6c4fed5@mail.gmail.com> <906dd82e0610290109h52808a4fo79eb800c7a7bbb1@mail.gmail.com> <4544A6F7.3070807@pobox.com> <200610300132.36876.chris.gray@kiffer.be> <4545498D.6040905@pobox.com> In-Reply-To: <4545498D.6040905@pobox.com> X-Enigmail-Version: 0.91.0.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig1B94BE6EA6F542B31D065076" X-Virus-Checked: Checked by ClamAV on apache.org --------------enig1B94BE6EA6F542B31D065076 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit > Chris Gray wrote: >> For JavaME I think it's the only way we'd be able to maintain a single >> source tree. We need to be able to "#ifdef out" references to classes >> we don't have, methods we don't implement, etc.. >> >> That much being said, I don't have a recommendation for a tool to use. >> Java syntax is sufficiently C-like that cpp is probably do-able, but >> we'd probably stumble over a whole series of gotcha's, and cpp isn't >> exactly [deity]'s gift to preprocessing anyway. Maybe one of the >> aspect-oriented tools (with which I am not at all familiar) could be a >> better bet? You could always do "clean" source-to-source processing using SableCC...:-) Java is a nice language to parse, so you could do some clean parsing, instead of the dumb "unstructured text" replacement of preprocessors. Actually, if all you need if "ifdef'ing out" undesirable references, it could be done by "hiding" modification directives in structured comments, so that these comment remain "javac" invisible. This way you could make it such that: 1- Plain source compilation -> j2se . 2- Structured processed source compilation -> j2me . If you need it, there are 2 or 3 Java 1.5 grammars available for SableCC (different parsing approaches, not different syntax!). As I said, Java is a pleasure to parse when compared to C & C++. It's just an idea, of course... [I know that people can start religious wars about pre-processing; that's why I am suggesting a clean approach, so that j2se people don't have to pre-process]. Etienne -- Etienne M. Gagnon, Ph.D. http://www.info2.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ --------------enig1B94BE6EA6F542B31D065076 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFFRUuFjyrJi4rH84gRAngcAJ4icmADRP4S9tU5NXER294xMI2mZQCfZteZ 5+zQ/kEMLoLmQ+iTgPMi+O8= =2ItL -----END PGP SIGNATURE----- --------------enig1B94BE6EA6F542B31D065076--