[plt-scheme] Lexer regular expressions

From: Jon Rafkind (workmin at ccs.neu.edu)
Date: Wed Jul 9 08:43:20 EDT 2008

Will Donnelly wrote:
> I am trying to implement a simple lexer/parser for C header files, to
> automatically generate the boring bits of a FFI for me.  I am mainly
> doing this because I am lazy and don't want to have to type everything
> by hand, but also because I think knowing how to do lexing and parsing
> stuff could be useful in the future.
>
>   
Just FYI, I had a similar problem generating an FFI interface to X11. 
There is a very nice C parser written in Ocaml called Cil. Attached is 
my parser using the Cil library. Its tailored to X11 in some ways but 
maybe you can get the gist of it. If you are interested in using it and 
don't know how to setup Cil I can explain how it goes.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ffi.ml
URL: <http://lists.racket-lang.org/users/archive/attachments/20080709/7319c0bd/attachment.ksh>

Posted on the users mailing list.