[antlr-interest] classHeaderSuffix in ANTLR v3?
Jeremy D. Frens
jdfrens at calvin.edu
Mon Mar 26 18:54:05 PDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Terence Parr wrote:
>
> On Mar 26, 2007, at 5:46 PM, Jeremy D. Frens wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> I'm translating a second ANTLR grammar from v2 to v3, this one a
>> transliteration. I'm looking for the equivalent for the
>> "classHeaderSuffix" option in v3. (It's used to specify an interface
>> for the lexer or parser.) I've searched the wiki and the beta book, but
>> I can't find anything to specify an *interface*.
>>
>
> Ack. Not defined in v3. Can you subclass and implement interface?
Actually, as it turns out, the ultimate reason my interface existed was
to guarantee a "nextToken()" method. So by returning a TokenSource
instead, I made my code happy.
Ultimately, though, I think I may want to be able to specify interfaces
in the future. I also think I want to be able to inject behaviors into
a class (without subclassing), but I need to think more about this.
(This thinking revolves around my new ANTLR Testing library for ANTLR
v3.) For now, I'd probably rate my classHeaderSuffix-request around a
"please, if you could" with the option to raise my pleading. *smile*
jdf
- --
* Jeremy D. Frens * Professor, Computer Science * jdfrens at calvin.edu *
``Oh yeah! Oh yeah! Oh yeah!'' -- ZZ Top, "Cheap Sunglasses"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGCHk9OcBu2deY79IRAoAYAJ4xMzTKGzlaI1jo1tvRYgZWOVI6mACgifbT
6t1CumZ6yo/WJdTg4l/WGPE=
=jbmv
-----END PGP SIGNATURE-----
More information about the antlr-interest
mailing list