|Parsing starting from any non-terminal email@example.com (Clint Olsen) (2003-04-27)|
|Re: Parsing starting from any non-terminal firstname.lastname@example.org (Matt) (2003-05-06)|
|Re: Parsing starting from any non-terminal email@example.com (Peter Flass) (2003-05-15)|
|From:||Peter Flass <firstname.lastname@example.org>|
|Date:||15 May 2003 12:19:59 -0400|
|Posted-Date:||15 May 2003 12:19:59 EDT|
> Clint Olsen wrote:
> > One of the irritating things about yacc and friends is the ability to parse
> > a subset of a language L. So, I've created a parser for the entire
> > language, but I have another section of code that just needs the expression
> > evaluation portion. I know this is possible in recursive descent, but what
> > about LR-style generated parsers?
> > [You can fake it.
> > start: WHOLE wholeprogram | EXPR expression ;
> > Then adjust your lexer to stuff a WHOLE or EXPR token at the beginning
> > to get the parser started. -John]
I think you made a wise choice. IMHO the less you mess with
machine-generated code, the better. If you made one change to your
grammar, would it invalidate all or most of your fake-outs? Sounds like
a maintenance nightmare.
Return to the
Search the comp.compilers archives again.