Re: Insertions

Norm Tovey-Walsh writes:

>> By the way, note that the following is now legal ixml:
>>
>>  values: value+++",".

> What does that mean?

For what it's worth, I take it to mean

    <repeat1>
      <nonterminal name="value"/>
      <sep>
        <insertion string=","/>
      </
    </



> ... I’m at a loss to interpret
>
>   values: value+++",".
>
> If the comma is an insertion, then what is the separator? If the comma
> isn’t an insertion, why is the extra “+” allowed?

If it's not an insertion, I am very confused.

If it is, then there is no separator, and the grammar of which this
fragment is part will work best for values with fixed length or values
which somehow can be parsed without delimiters.  If every value must
begin with a letter and end with a digit, then a1bc23def456 can be
uniquely parsed without delimiters, right?

For things like integers or decimal numbers, this grammar would make
sense perhaps in a stress test checking how well the processor deals
with finite, but fast-growing, ambiguity.  Given

  value = ['0'-'9']+.

and the input '12345', I'll get one parse with five values, one parse
with one value, four each with two or four values, and seven with three
values.  So seventeen overall.

(Hmm.  This is not Pascal's Triangle.  But I'm sure there is a
formula for how many ways there are to partition a sequence of length n
into k contiguous subsequences.  I just can't remember.)


Michael

-- 
C. M. Sperberg-McQueen
Black Mesa Technologies LLC
http://blackmesatech.com

Received on Tuesday, 24 May 2022 14:37:06 UTC