Re: Parsing starting from any non-terminal

Peter Flass <peter_flass@yahoo.com>
15 May 2003 12:19:59 -0400

          From comp.compilers

Related articles
Parsing starting from any non-terminal clint@0lsen.net (Clint Olsen) (2003-04-27)
Re: Parsing starting from any non-terminal matt@peakfive.com (Matt) (2003-05-06)
Re: Parsing starting from any non-terminal peter_flass@yahoo.com (Peter Flass) (2003-05-15)
| List of all articles for this month |

From: Peter Flass <peter_flass@yahoo.com>
Newsgroups: comp.compilers
Date: 15 May 2003 12:19:59 -0400
Organization: Road Runner
References: 03-04-099 03-05-018
Keywords: parse, yacc
Posted-Date: 15 May 2003 12:19:59 EDT

Matt wrote:
>
> 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.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.