On Sun, 2008-01-06 at 06:36 +1100, Tim Josling wrote: > Thanks. I'll probably post to the lisp group too. > > I'm going to do a POC today on the table generation option, to see how > that looks. > > Tim Josling
I have done a POC on the bison tables approach for using bison with lisp. See http://cobolforgcc.cvs.sourceforge.net/cobolforgcc/gcc/gcc/gcb/ In particular the files bison-parser-driver.lisp - parser driver. bison-parser-helpers.lisp - some helper macros for writing actions. bison-tablegen-skel-v2.3.m4 - V2.3 skeleton. bison-tablegen-skel-v2.3a.m4 - V2.3a skeleton. bison_fake_m4_tablegen.x - Fae m4 script to fix up the file names. calc-common1.lisp - part of calc application calc-common2.lisp - part of calc application calc-lisp-parser-tablegen.lispy - grammar definition Makefile The makefile implements the flow Bison grammar -> C program -> Lisp program. The C program incorporates The C program has access to the bison tables and generates the lisp code from that. It would be readily adapted to produce code for any desired language. The main work would be updating the parser driver to the new language. Currently the grammar and the C code to extract the bison tables are in the same file, but I will move the C code to a separate include file. I think this is the approach I will use, because it involves the least (zero!) impact on the internals of bison. Tim Josling _______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison