[antlr-interest] adding actions to rules breaks stuff

Jim Idle jimi at temporal-wave.com
Mon Feb 11 15:11:10 PST 2008


Did you download the examples zip/tar and take a look at those, as well 
as the wiki pages?

Jim 

> -----Original Message-----
> From: Benjamin Shropshire [mailto:shro8822 at vandals.uidaho.edu]
> Sent: Monday, February 11, 2008 3:25 PM
> To: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] adding actions to rules breaks stuff
> 
> Mark Wright wrote:
> > Hello Benjamin,
> >
> > The ANTLR syntax:
> >
> > import [Object s]
> >
> > declares rule import as taking a parameter s.  So ANTLR is
> > pointing out that when you call it in document, it needs
> > to pass it the parameter, something like:
> >
> > document [Object o]
> >      : (i+=import[o])* c+=thing* EOF {o=new Doc($i,o);}
> >     ;
> Ah!! this looks like it works:
> 
> import returns [Object s]
> 
> 
> > I strongly recommend buying and reading the ANTLR book.
> >
> >
> I can't afford it and I don't known if it would be worth having the
> company buy it as I'm still in the "will this be useful stage". A bit
> of
> a catch-22: can't figure the program out without the book, can't
> justify
> buying the book without figuring the program out! That's why online
> docs
> are so important to me!




More information about the antlr-interest mailing list