Re: Consuming the input (was: none)

I confess to two worries in this connection:

(1) I don’t think I know how to define “maximal consumption”.

(2) In the case of infinite streams, I am not sure that I would want maximal consumption to be the default behavior, because it seems likely in the general case to require unbounded lookahead.

If “maximal consumption” means finding the longest prefix, if any, of the input that is accepted as a sentence, then it seems not to capture the desire that given the grammar 

  string: “a”*.

and the input “aaab”, we probably want the ixml parser to return an error document, not a parse for substring($input, 1, 3).

Michael

> On 13,Apr2021, at 10:14 AM, Tomos Hillman <yamahito@gmail.com> wrote:
> 
> How about "The default behaviour of the implementation must be to maximally consume the available input" to allow parsers/users to go off reservation at their own risk?
> 
> T
> 
> _________________
> Tomos Hillman
> eXpertML Ltd
> +44 7793 242058
> On 13 Apr 2021, 17:08 +0100, Steven Pemberton <steven.pemberton@cwi.nl>, wrote:
>> So how about we say something like "The implementation must maximally
>> consume the available input". Then the implementation can decides what the
>> "available input" is, whether it's streaming or a static document.
>> Steven
>> 
>> On Monday 12 April 2021 11:25:47 (+02:00), Steven Pemberton wrote:
>> 
>>> The new draft spec asks the question:
>>> Should there be a requirement that the input is completely consumed?
>>> 
>>> I think the answer is yes.
>>> 
>>> Otherwise, if a grammar was:
>>> 
>>> string: "a"*.
>>> 
>>> and the input was
>>> 
>>> aaa
>>> 
>>> it would be permissible to produce as result:
>>> 
>>> <string/>
>>> 
>>> Steven
>>> 
>>> 
>>> 
>>> 
>> 

********************************************
C. M. Sperberg-McQueen
Black Mesa Technologies LLC
cmsmcq@blackmesatech.com
http://www.blackmesatech.com
********************************************

Received on Tuesday, 13 April 2021 16:29:20 UTC