YACC for dynamic grammars

drw@eddie.mit.edu (Dale Worley)
Tue, 27 Jan 87 10:32:05 est

          From comp.compilers

Related articles
YACC for dynamic grammars harvard!seismo!unido!ecrcvax!micha (Micha Meier) (1987-01-26)
YACC for dynamic grammars drw@eddie.mit.edu (1987-01-27)
| List of all articles for this month |

Date: Tue, 27 Jan 87 10:32:05 est
From: drw@eddie.mit.edu (Dale Worley)

It looks hard. One problem is that the tables that Yacc produces are
the result of global analysis of the grammar--single entries in the
tables aren't direct reflections of single grammar rules. But
dynamically adding operators is easier than dynamic grammars in
general, since only a small and fairly well-defined set of parser
table entries deal with this particular situation. Unfortunately,
after Yacc is done constructing the "theoretical" tables, it
compresses them to take up much less room. Compression is likely to
make things considerably harder.

It sounds to me like a very interesting project. I would suggest that
you read the appropriate sections of Aho, Sethi, and Ullman's
"Compiler Design" (second edition of the Dragon Book) to find out as
much as you can about the theory, and then get a copy of the source
for the parser driver that Yacc uses (we've got a copy, I can send it
to you), so you can see how the tables are actually stored. This
should give you some ideas about what is involved in dynamically
modifying the parser.

Good luck! Please keep me posted.


Post a followup to this message

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