[antlr-interest] Anyone has a LISP ANTLR3 grammar and can con tribute it to Drools?

Randall R Schulz rschulz at sonic.net
Thu Jan 24 09:44:53 PST 2008


On Thursday 24 January 2008 06:40, Stuart Watt wrote:
> Yes, CL is definitely the way to go.
>
> However, with Lisp, the easy stuff is:
>
> expression =
>   '(' expression* ('.' expression)? ')'

Shouldn't that be:

  '(' expression+ ('.' expression)? ')'


Otherwise you'll accept invalid S-Expressions like this:

  ( . foo )


Also, I think you'll need lexeme and grammar productions to handle quote 
(the apostrophe reader macro, not the (quote ...) form) and back-quote, 
at a minimum.


I've written a pretty complete Common Lisp reader and printer library 
with lists (cons cells), vectors, the full complement of numeric 
representations, reader macros and a read-table. The input side is 
quite complete (up to the aspects that require an evaluator), while the 
printer is somewhat less so.

I wrote it all "by hand," with no parser generator support. This seems 
reasonable for Lisp in ways it would not be for most any other 
language.


> ...


Randall Schulz


More information about the antlr-interest mailing list