Related articles |
---|
LR(1) grammars needed world.std.com!daimi.aau.dk!mring (Michael Ringgaard) (1990-10-26) |
Newsgroups: | comp.compilers |
From: | Michael Ringgaard <world.std.com!daimi.aau.dk!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>
main()
{
int ch, lev = 0;
while ((ch = getchar()) != EOF) {
if (ch == '{')
lev++;
else if (ch == '}')
lev--;
else if (lev == 0)
putchar(ch);
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: mring@daimi.aau.dk
Aarhus University |
8000 Aarhus, DENMARK |
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.