Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site pucc-h Path: utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!pur-ee!pucc-j!pucc-h!ags From: ags@pucc-h (Dave Seaman) Newsgroups: net.lang.lisp Subject: Re: A BNF for Lisp Message-ID: <2427@pucc-h> Date: Wed, 13-Nov-85 09:41:27 EST Article-I.D.: pucc-h.2427 Posted: Wed Nov 13 09:41:27 1985 Date-Received: Thu, 14-Nov-85 07:22:53 EST References: <60@aquila.UUCP> Reply-To: ags@pucc-h.UUCP (Dave Seaman) Organization: Purdue University Computing Center Lines: 30 In article <60@aquila.UUCP> chris@aquila.UUCP (chris) writes: >A moment of reflection yields the following BNF syntax for >Lisp. > >Define a lisp program as a Sexpression, where Sexpression is >given as: > > Sexpression -> ATOM > | ( ) > | ( Sexpression . Sexpression ) > | ( Sexpression-List ) > > Sexpression-List -> Sexpression > | Sexpression-List Sexpression > >An ATOM in turn is a sequence of characters excluding >whitespace and the characters "()." Actually the production "Sexpression -> ( Sexpression . Sexpression )" should be omitted and the definition of Sexpression-List should be amended to Sexpression-List -> Sexpression | Sexpression-List Sexpression | Sexpression-List . Sexpression This allows S-expressions such as ( A B . C ), which could not be obtained otherwise. It also allows ( A . B . C ), which is perfectly legal on input, even though it would never be produced by "print". -- Dave Seaman ..!pur-ee!pucc-h!ags