[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LR Parser for MCL

> From: jm@hp-vcd.vcd.hp.com (John Matthews)
> Does anyone know of a way I could get my hands on a general
> LR (or other) parser package? 

The GLisp package might do what you want, but I dont think it handles
all LR languages.

I've got two parsing related things for GNU Emacs Lisp that may be relevant.
Both work with bison as the parser generator.

One extracts the tables from the generated parser and interprets them
in Emacs Lisp.  This is pretty slow, but could probably be improved 
greatly in Common Lisp.  One advantage is you have more control of
the parsing process to play with modifications, e.g. error recovery.

The other lets the bison parser do the parsing, and each of the semantic
actions prints the rule name or number.  In GNU Emacs Lisp, I read the
list of rule numbers, with symbols and literals intermixed, and do the
corresponding semantic actions in lisp code.   This worked pretty well
and enabled me to build a pascal compiler for a class.

If you want the code, email me.
If you want to convert it to CL, I'd be willing to help.

Dan LaLiberte
(Join the League for Programming Freedom: league@prep.ai.mit.edu)