|
new, simpler formal specification
Taylor Campbell
(22 Mar 2005 22:56 UTC)
|
|
Re: new, simpler formal specification
Paul Schlie
(23 Mar 2005 01:49 UTC)
|
|
Re: new, simpler formal specification
Taylor Campbell
(23 Mar 2005 03:02 UTC)
|
|
Re: new, simpler formal specification
Taylor Campbell
(23 Mar 2005 05:59 UTC)
|
|
Re: new, simpler formal specification
Paul Schlie
(23 Mar 2005 17:00 UTC)
|
|
Re: new, simpler formal specification
Taylor Campbell
(23 Mar 2005 21:26 UTC)
|
|
Re: new, simpler formal specification
Paul Schlie
(23 Mar 2005 21:22 UTC)
|
|
Re: new, simpler formal specification
Taylor Campbell
(23 Mar 2005 22:48 UTC)
|
|
Re: new, simpler formal specification
Paul Schlie
(24 Mar 2005 01:06 UTC)
|
|
Re: new, simpler formal specification
Taylor Campbell
(24 Mar 2005 02:35 UTC)
|
|
Re: new, simpler formal specification
Paul Schlie
(24 Mar 2005 05:37 UTC)
|
|
Re: new, simpler formal specification Paul Schlie (24 Mar 2005 15:57 UTC)
|
> From: Paul Schlie <xxxxxx@comcast.net>
>> Taylor Campbell <xxxxxx@bloodandcoffee.net> wrote:
>> This is the crux of your argument, and it is wrong. A <datum> is built
>> by a stream of tokens. Any token may be preceded by intertoken space,
>> which is ignored. Since you have specified that <datum-comment> is
>> considered a comment, which in turn is considered intertoken space, a
>> <datum>, which begins with a token, may always be preceded by that
>> token's intertoken space, which may be a <datum-comment>. Therefore:
>>
>> --- intertoken space --- (datum comment with B (from '#; A B'))
>> / datum \
>> / vvvvvvvvvvvvvvv
>> #; #; A B C <-- datum (token C, preceded by
>> ^^^^\ intertoken space '#; #; A B')
>> | \ datum (token A)
>> \ intertoken space (datum comment with A)
>
> - Sorry, in a nutshell, I don't believe a left recursive grammar is
> consistent with scheme's existing exclusively right recursive grammar;
> and candidly still surprised anyone would, but what you advocate is:
>
> <datum-comment> -> #; <datum-comment*-datum>
> <datum-comment*-datum> -> <datum-comment>* <datum> ; left recursive
>
> "#; #; A B C" => "{datum-comment {datum-comment A} B} C" => "C"
>
> -vs-
>
> <datum-comment> -> #; <datum-or-datum-comment>
> <datum-or-datum-comment> -> <datum> | <datum-comment> ; right recursive
>
> "#; #; A B C" => "{datum-comment {datum-comment A}} B C" => "B C"
>
> (as "' ' A B C" => "(quote (quote A)) B C", not "(quote (quote A) B) C")
- After more thought, agreeing the grammar: <datum-comment> -> #; <datum>
is unfortunately naturally left recursive as it's an <intertoken-space>.
I still believe it's inconsistent with scheme's grammar which is otherwise
fully right recursive. However this inconsistency can be avoided by
forcing it's definition to be right recursive:
<datum-comment> -> <datum-comment-token>+ <datum>
<datum-comment-token> -> #;
Thereby forcing the treatment of all sequential #; as being effectively
redundant; thereby eliminating it's otherwise undesirable left recursive
behavior. (Which otherwise results in sequential datum-comment-token's
affecting statements beyond those immediately following them, which is
more likely to be error prone, than intentionally desirable or useful.)
Thereby: "#; #; A B C" => {<datum-comment> #; #; A} B C" => "B C"
(might this please be considered)