Parsing starting from any non-terminal

Clint Olsen <clint@0lsen.net>
27 Apr 2003 02:28:22 -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: Clint Olsen <clint@0lsen.net>
Newsgroups: comp.compilers
Date: 27 Apr 2003 02:28:22 -0400
Organization: AT&T Broadband
Keywords: parse, yacc, question
Posted-Date: 27 Apr 2003 02:28:18 EDT

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?


Thanks,


-Clint
[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]



Post a followup to this message

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