Re: "Hints for implementors" section

I think they are on balance an improvement, but I think I would
show the rewriting of f+sep as

    f+sep ⇒ f-plus-sep
    -f-plus-sep: f, (sep, f)*.

Michael


> On 2,Dec2021, at 2:57 AM, Steven Pemberton <steven.pemberton@cwi.nl> wrote:
> 
> In the current "Hints to implementors" section, it explains how to translate the repetition constructs into simple constructs:
> 
> Optional factor:
> 
> f? ⇒ f-option
> -f-option: f; .
> 
> Zero or more repetitions:
> 
> f* ⇒ f-star
> -f-star: f, f-star; .
> 
> One or more repetitions:
> 
> f+ ⇒ f-plus
> -f-plus: f, f-star.
> -f-star: f, f-star; .
> 
> One or more repetitions with separator:
> 
> f+sep ⇒ f-plus-sep
> -f-plus-sep: f, sep-part-option. 
> -sep-part-option: sep, f-plus-sep; .
> 
> Zero or more repetitions with separator:
> 
> f*sep ⇒ f-star-sep
> -f-star-sep: f-plus-sep; .
> -f-plus-sep: f, sep-part-option.
> -sep-part-option: sep, f-plus-sep; .
> 
> This could be done shorter in the following way. Do you consider it an improvement? (The first two are the same)
> 
> Optional factor:
> 
> f? ⇒ f-option
> -f-option: f; .
> 
> Zero or more repetitions:
> 
> f* ⇒ f-star
> -f-star: f, f-star; .
> 
> One or more repetitions:
> 
> f+ ⇒ f-plus
> -f-plus: f, f*.
> 
> One or more repetitions with separator:
> 
> f+sep ⇒ f-plus-sep
> -f-plus-sep: f, (sep, f-plus-sep)?.
> 
> Zero or more repetitions with separator:
> 
> f*sep ⇒ f-star-sep
> -f-star-sep: f+sep; .
> 
> Steven

Received on Thursday, 2 December 2021 19:09:37 UTC