Re: Verrazano/CFFI R.I.P.?




"Kenny Tilton" <NOktiltonSPAM@xxxxxxxxxx> wrote
>
> Just started working on a C to Lisp translator, using Antlr.
[...]
> Or know a better way than Antlr? gcc_xml does not do function bodies.

Do it in Lisp. Juliusz Chroboczek has written cl-yacc and a C parser in Lisp just for
that:

Juliusz Chroboczek wrote:
>Well, I wrote CL-Yacc exactly for that reason -- I needed to parse C.
>I've ripped out the lexer, parser and pretty-printer from my current
>development sources and put them on
>
> http://www.pps.jussieu.fr/~jch/software/files/cpc-parser-20050411.tar.gz

That link does not work anymore but you can ask Juliusz Chroboczek for a recent version.
(IIRC I have a copy somewhere)

>You are welcome to use this code in any way you see fit. I would
>appreciate it, however, if you could make sure to credit me as the
>original author in the documentation of any software that uses these
>sources.
>
>And Steven H. is right -- parsing C is a pain.
>
>This is most definitely work in progress; while a variant of this code
>has successfully parsed a few thousands lines of C, it is known to be
>incomplete and buggy. Of course, I'm interested in any fixes you may
>want to send me.

Marc


.



Relevant Pages

  • Re: Writing a Pascal translator
    ... >You might want to use ANTLR. ... >There is a common lisp version. ... >It comes with an example of translating JAVA to Commom Lisp. ... to a version written in or targeting Lisp on the ANTLR web site. ...
    (comp.lang.lisp)
  • Re: Verrazano/CFFI R.I.P.?
    ... Petter Gustad wrote: ... >> Or know a better way than Antlr? ... But I guess you will not find a ready Zebu C grammar ... Lanning finally re-wrote that part of our system in lisp. ...
    (comp.lang.lisp)
  • Re: member :test equal
    ... Juliusz Chroboczek writes: ... > DS> In some earlier Lisp versions, the function you are asking about ... I'm finding myself writing the above ... Christophe ...
    (comp.lang.lisp)