Return-Path: Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 72045 invoked from network); 28 Nov 2000 20:41:46 -0000 Received: from unknown (HELO slim.silverstream.com) (216.142.115.9) by locus.apache.org with SMTP; 28 Nov 2000 20:41:46 -0000 Received: by slim.silverstream.com with Internet Mail Service (5.5.2650.21) id ; Tue, 28 Nov 2000 15:41:36 -0500 Received: from QUIBBLE ([10.129.100.124]) by shady.silverstream.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id XX9NAKL2; Tue, 28 Nov 2000 15:40:03 -0500 From: "Grossbart, Zack" To: ant-user@jakarta.apache.org Subject: RE: Antlr task... Date: Tue, 28 Nov 2000 15:41:02 -0500 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0003_01C05951.9CE8A810" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 In-Reply-To: <3A240D77.534D2ED@digitalsesame.com> X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0003_01C05951.9CE8A810 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This is my task, and it calls AntlrGrammarC which is my wrapper to antlr.Tool. The big change that I made to antlr, is that it now understands how to find the parent lexers for grammar inheritance. The mechanism is a little hacky, but it gets the job done. I hope this helps. Good luck Zack > -----Original Message----- > From: david@tpifirewall.topware.com.tw > [mailto:david@tpifirewall.topware.com.tw]On Behalf Of David Li > Sent: Tuesday, November 28, 2000 2:55 PM > To: ant-user@jakarta.apache.org; zack@silverstream.com > Subject: Re: Antlr task... > > > Zack, > > That would be great. Could you send me yours? I just start working on > mine yesterday and haven't gotten too much time for it yet. It would be > great if you could send me yours. Thanks. > > David > > > "Grossbart, Zack" wrote: > > > > David, > > > > I have also written an Antlr task. My task is based on > some extensions to > > the Antlr grammar compiler that have written to deal with the problem of > > finding parent grammars. Does your task deal with Antlr grammars and > > inheritance of grammars? If not, do you want to try to combine our two > > tasks and submit them? > > > > Zack > > > > > -----Original Message----- > > > From: david@tpifirewall.topware.com.tw > > > [mailto:david@tpifirewall.topware.com.tw]On Behalf Of David Li > > > Sent: Tuesday, November 28, 2000 1:54 PM > > > To: ant-user@jakarta.apache.org > > > Subject: Antlr task... > > > > > > > > > I just finished an taskdef for Antlr (www.antlr.org). I am > interested if > > > anyone's interested in testing it out. > > > > > > Also, I'd like to submit this for inclusion in Ant. How should I go > > > about doing this? > > > > > > Thanks. > > > > > > David Li > > > DigitalSesame ------=_NextPart_000_0003_01C05951.9CE8A810 Content-Type: java/*; name="Grammar.java" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Grammar.java" package build.tools; import org.apache.tools.ant.*; import org.apache.tools.ant.taskdefs.*; import org.apache.tools.ant.types.*; import com.sssw.tools.build.*; import antlr.AntlrGrammarC; import java.util.*; import java.io.*; public class Grammar extends org.apache.tools.ant.Task { protected int verbosity =3D Project.MSG_INFO; protected boolean filtering =3D false; protected String m_destDir =3D null; protected String m_ss_root =3D null; protected String m_srcdir =3D null; =20 protected Vector filesets =3D new Vector(); /** * Adds a set of files (nested fileset attribute). */ public void addFileset(FileSet set) { filesets.addElement(set); } public void setSsroot(String ss_root) { m_ss_root =3D ss_root; } public void setSrcdir(String srcdir) { m_srcdir =3D srcdir; =20 } public void setDestdir(String destdir) { m_destDir =3D destdir; =20 } /** * java antlr.AntlrGrammarC -o . foo.g=20 * or * java antlr.AntlrGrammarC -o . -glib foo.ig foo.ig * copy FooTokenTyps.txt /dev/classes =20 */ public void execute() throws BuildException { for (int i=3D0; i