[antlr-interest] stuck on templates
warnero at gmail.com
Mon Aug 27 10:48:05 PDT 2007
I've been reading through the book and the CMinus example included in
the v3 zip example set and I must be missing something because I can't
get anything to work at all.
Here is what I gathered from the book and from the site and
(hopefully) you can tell me where my mistake is.
First a rule like this:
: 'package' name=QID
can be translated to something like this:
: 'package' name=QID -> package_name(name=name.text)
Where package_name() is declared in my stg file like this:
package_name ::= "package <name>;"
Is this right? If so, why do I keep getting an error in ANTLRWorks
saying "Undefined reference 'package_name'".
I also tried to do something similar to the CMinus example here:
$program::globals = new ArrayList();
$program::functions = new ArrayList();
But when I did that ANTLRWorks first complains about "program" being
defined already (in the @init section) and it then complains about not
finding ArrayList (even though I added it in the @header section.
Thanks for any help, just trying to wrap my head around this stuff.
Warner Onstine - Programmer/Author
New book on Tapestry 4!
Tapestry 101 available at
warner at warneronstine.com
More information about the antlr-interest