Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!ima!johnl From: johnl@ima.UUCP Newsgroups: mod.compilers Subject: YACC for dynamic grammars Message-ID: <462@ima.UUCP> Date: Tue, 27-Jan-87 10:32:05 EST Article-I.D.: ima.462 Posted: Tue Jan 27 10:32:05 1987 Date-Received: Fri, 30-Jan-87 06:07:38 EST Sender: johnl@ima.UUCP Lines: 27 Approved: compilers@ima.UUCP 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. Dale -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.EDU Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | cca}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request