List Info

Thread: Re: Lisp parser skeleton for bison proof of concept working




Re: Lisp parser skeleton for bison proof of concept working
country flaguser name
Australia
2008-01-05 13:36:59
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

On Sat, 2008-01-05 at 19:48 +0100, Hans Aberg wrote:
> You might post this to the Usenet newsgroup
comp.compilers, plus  
> some, to get more feedback.
> 
>    Hans Aberg
> 
> 
> On 5 Jan 2008, at 11:17, Tim Josling wrote:
> 
> > Hi,
> >
> > I think I mentioned on one of the bison lists a
while ago I was  
> > thinking
> > of using bison as a parser generator for a lisp
program, which is part
> > of a COBOL front-end for GCC.
> >
> > The proof of concept is now working. It is a bit
rough around the  
> > edges
> > bit I think it's at a point where it's worth
discussing the design and
> > options.
> >
> > Contents
> > 1. Have a look!
> > 2. Challenges.
> > 3. Options.
> > 4. Conclusion.
> >



_______________________________________________
help-bisongnu.org http
://lists.gnu.org/mailman/listinfo/help-bison

Re: Lisp parser skeleton for bison proof of concept working - update.
country flaguser name
Australia
2008-01-06 16:54:12
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/cobolforgc
c/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-bisongnu.org http
://lists.gnu.org/mailman/listinfo/help-bison

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )