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

C syntax in Lisp



Discussions about the virtues of Lisp syntax arise perenially.  Although
I personally like prefix notation, I have to deal with customers who do
not, and who will not change their minds any time soon.  Therefore, I
have written a partial C syntax parser in Common Lisp.  Currently it
handles expressions only, not statements (e.g.: x=foo.baz[3+z] ==>
(setf x (aref (struct-ref foo 'baz) (+ 3 z)))  )  It should be easily
extensible to parse C control constructs, although how much of that
would be desireable is debatable.

In any case, I have two questions:

1.  Has anyone else done something similar that they are willing to
release?  I prefer not to reinvent wheels.

2.  Is anyone interested in a copy of my parser?  It is of limited
utility as it stands, but it might make a useful building block.

Erann Gat
gat@robotics.jpl.nasa.gov