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

Edson Tirelli tirelli at post.com
Sun Jan 27 05:14:23 PST 2008


    Randall,

    Thanks for the tips. I found a BNF grammar in a book I have. We will try
to implement the parser using that grammar as a basis.
    For maintainability purposes (you know how open source projects are), we
prefer to use a parser generator instead of manually building a parser, but
I guess you are right... it could be done manually.

    Thanks,
       Edson

2008/1/24, Randall R Schulz <rschulz at sonic.net>:
>
> 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
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080127/775d5b67/attachment-0001.html 


More information about the antlr-interest mailing list