LR(1) grammars needed

Michael Ringgaard <!!mring>
Fri, 26 Oct 90 14:28:59 +0100

          From comp.compilers

Related articles
LR(1) grammars needed!!mring (Michael Ringgaard) (1990-10-26)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Michael Ringgaard <!!mring>
Keywords: yacc, question
Organization: Compilers Central
Date: Fri, 26 Oct 90 14:28:59 +0100

I am working on a project where we are writing a LR(1) parser generator. We
need some test grammars for real programming languages like C, Ada, Pascal,
ALGOL or any other interesting languages. We need the grammars to test the
efficiency of our parser generator.

We are interested in both LALR(1), LR(1) and non-LR(1) grammars. If you have
a grammar in yacc compatible format, or any other BNF like format, we would
very much appreciate if you would send us a copy of the grammar via e-mail.
We shall only use the grammars for testing and will not use the grammars for
any other purposes.

We don't need the code sections for the reduce actions. If you don't want to
send these code sections to us, you can use the C program below to filter out
the code sections from yacc grammars.

#include <stdio.h>

    int ch, lev = 0;

    while ((ch = getchar()) != EOF) {
        if (ch == '{')
        else if (ch == '}')
        else if (lev == 0)
        if (lev < 0) lev = 0;

NB: this program will not work if you have strings with '{' or '}'

Thanks in advance

Michael Ringgaard | Phone: + 45 86151546
Computer Science Department | Internet:
Aarhus University |
8000 Aarhus, DENMARK |

Post a followup to this message

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