[antlr-interest] TokenStreamRewriteEngine: possible to use non-terminals instead of tokens?
parrt at cs.usfca.edu
Wed Feb 4 11:08:58 PST 2004
On Feb 4, 2004, at 11:01 AM, SainTiss wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> On Wednesday 04 February 2004 19:42, Terence Parr wrote:
>> You need context info to trickle into typeSpec so that it knows when
>> remove that token. you can pass a parameter around or set a context
>> instance variable (ick). Or, go the other way: just set an index in
>> typeSpec as to the index of the ID token. Then later if you ever want
>> to delete it, you know the index.
> I think I get the idea of what you're saying here... Setting an index
> typeSpec intuitively seems the most elegant way to go to me, but is
> documentation available on how to accomplish this? I mean, I guess it's
> needed to add an attribute to typeSpec's class definition, which is
> built-in to antlr?
There is no typeSpec. Remember that antlr generates a method for each
rule not a class, which is really icky...
just define an instance variable and set it with an action.
> - --
> Ark Linux - Linux for the Masses (http://arklinux.org)
> You don't have any cows. The bank will not lend you money to buy cows,
> because you don't have any cows to put up as collateral.
> Representative Democracy:
> You have two cows. Your neighbors pick someone to tell you who gets
> the milk.
> In a world without walls and fences, who needs windows and gates?
> Hans Schippers
> 2LIC INF
> UA 2003-2004
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> -----END PGP SIGNATURE-----
> Yahoo! Groups Links
> To visit your group on the web, go to:
> To unsubscribe from this group, send an email to:
> antlr-interest-unsubscribe at yahoogroups.com
> Your use of Yahoo! Groups is subject to:
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com pure link sharing
Yahoo! Groups Links
To visit your group on the web, go to:
To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
Your use of Yahoo! Groups is subject to:
More information about the antlr-interest