[antlr-interest] "everything else" clause
Monty Zukowski
monty at codetransform.com
Wed Apr 28 10:20:37 PDT 2004
On Apr 27, 2004, at 12:57 AM, Ric Klaren wrote:
> On Mon, Apr 26, 2004 at 07:24:02PM +0200, Mike Lischke wrote:
>> Since the "everything else" part in the parser consists of all tokens
>> not
>> mentioned I had to import the lexer vocabulary. This is no big deal
>> as I
>> need it anyway for my main parser and now the files are parsed
>> correctly so
>> far. The next thing to todo is to make the TokenRewriteEngine work. It
>> looks like I have to rewrite the grammar a bit because I cannot
>> address a
>> single token in the else_part from, say, the ifdef rule, hence I
>> cannot
>> strip out the proper part.
>
> I recall Monty mentioning a little while ago that he did some nifty
> overriding on a few parser methods (probably some tricks around
> match(..)
> is my guess) and got it to behave like a tokenfilter/stream. If you go
> that
> way you can just chain the parsers and you won't have to use the
> TokenRewriteEngine which is not the most efficient for large input
> files
> (whole file gets stored in memory) I'm not sure if he posted specifics
> though.
That would be my parser filter article
http://www.codetransform.com/filterexample.html. There seems to be a
need for this all of a sudden. Please let me know if you can use my
approach and help me refine it. Please cc me directly with
questions/nags/refinements; since I no longer have the "day job" I'm
not monitoring antlr-interest so thoroughly any more. Now I get to
work on grammars all day--woohoo!
Monty Zukowski
ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit --
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list