Re: references to yacc(1) grammar tools sought

Josef Grosch <grosch@gmdka.uucp>
Thu, 7 Feb 91 12:09:09 -0100

          From comp.compilers

Related articles
references to yacc(1) grammar tools sought dws@cs.wisc.edu (1991-01-31)
Re: references to yacc(1) grammar tools sought grosch@gmdka.uucp (Josef Grosch) (1991-02-07)
| List of all articles for this month |
Newsgroups: comp.compilers
From: Josef Grosch <grosch@gmdka.uucp>
Keywords: yacc, debug, question
Organization: GMD-Forschungsstelle Karlsruhe, Germany
Date: Thu, 7 Feb 91 12:09:09 -0100

DaviD W. Sanderson (dws@cs.wisc.edu) writes:


> I am looking for references to tools for manipulating or debugging
> yacc grammars.
> For instance, one such tool might illustrate ambiguities in a grammar
> by exhibiting sequences of grammar symbols that can be parsed more than
> one way (and hopefully showing at least two derivation trees).


The following article describes a solution to this problem:


%A Frank DeRemer
%A Thomas Pennello
%T Efficient Computation of LALR(1) Look-Ahead Sets
%J TOPLAS
%V 4
%N 4
%P 615-649
%D OCT 1982


In case of ambiguities in the grammar, derivation trees can be printed
that illustrate the conflict. We have implemented this algorithm in our
parser generator Lalr. Using a preprocessor, yacc input can be directly
processed by this tool. Our experiences are very satisfying. Looking at the
derivation trees printed for conflicts you can more or less locate the
problem immediately. The time for debugging grammars is reduced significantly.


Josef Grosch (grosch@gmdka)
--


Post a followup to this message

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