From: clio
Subject: BNF for Common Lisp Grammar.
Date: 
Message-ID: <3BE890E4.4070107@auburn.edu>
Hi,

Is there any documents about BNF(EBNF) of the Common Lisp Grammar? Does 
somebody know where I can find them.

Thanks!

clio

From: Tim Bradshaw
Subject: Re: BNF for Common Lisp Grammar.
Date: 
Message-ID: <fbc0f5d1.0111070448.27a97764@posting.google.com>
clio <·······@auburn.edu> wrote in message news:<················@auburn.edu>...
> Hi,
> 
> Is there any documents about BNF(EBNF) of the Common Lisp Grammar? Does 
> somebody know where I can find them.
> 

I don't think such a thing can exist, or be useful if it does. CL is
both `lexically' and `grammatically' extensible, so a static BNF for
it is not really viable.

For instance, consider this:

(foo (((crun . 4))) (5 crun) (2 4) (otherwise 10))

Is this legal CL?  Well, it's not a function call, that's for sure,
but whether it is legal depends on whether FOO has some macro
definition which makes this syntax legal, and that depends on the
context.

You might want to restrict yourself to what READ accepts, and not
worry about whether it is actually legal CL or not.  But even here you
run into problems.  Is this legal CL?

<def :name foo
     :arguments (&body forms)
     :strip-grut :both
     :attributes ((bgcolor "white"))
     :result (expand-foo-body forms bgcolor)
 <def :name title-string
      :result "Title of my foo">>

It certainly isn't in a `cold' CL but it may well be with a suitable
readtable.

So I think that CL is just too flexible and user-programmable to be
described by something as rigid as a BNF grammar.

--tim
From: Kent M Pitman
Subject: Re: BNF for Common Lisp Grammar.
Date: 
Message-ID: <sfw8zdin9f1.fsf@world.std.com>
clio <·······@auburn.edu> writes:

> Is there any documents about BNF(EBNF) of the Common Lisp Grammar? Does 
> somebody know where I can find them.

CLHS 1.4.1 Notation Conventions
From: Erik Naggum
Subject: Re: BNF for Common Lisp Grammar.
Date: 
Message-ID: <3214130370447363@naggum.net>
* clio <·······@auburn.edu>
| Is there any documents about BNF(EBNF) of the Common Lisp Grammar?

  No.  There is no such thing.  Common Lisp has a programmable syntax.
  E.g., <foo bar> would be two symbols named "<FOO" and "BAR>" in the
  standard readtable, but a Common Lisp program could easily implement a
  reader macro that turned it into the equivalent of XML <foo>bar</foo> or
  whatever that has caused to be represented in memory.  If you want to
  read Common Lisp code or data, it takes you less time to write code in
  Common Lisp that reads it and spits it out in some dreadfully inferior
  syntax that you can hack in, say, Perl, than writing the reader in Perl.

///
-- 
  Norway is now run by a priest from the fundamentalist Christian People's
  Party, the fifth largest party representing one eighth of the electorate.
-- 
  Carrying a Swiss Army pocket knife in Oslo, Norway, is a criminal offense.