- From: Gunther Rademacher <grd@gmx.net>
- Date: Thu, 30 Nov 2023 13:50:21 +0100
- To: Steven Pemberton <steven.pemberton@cwi.nl>
- Cc: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>, public-ixml@w3.org
> > Of these, GR's formulation is the most compact. > > but doesn't allow a...b > > Steven Thanks, my bad of course. On second thought, I think I'd rather formulate it without using repeat with separator. My new proposal is this one: name: namestart, ( '.'*, namefollower )*. It asks for a period to be followed by at least one namefollower, while allowing - any number of consecutive periods (first *), - any number of consecutive namefollowers (second *), - and any mixture therwof. It also is slightly more compact than Steven's propsal, name: namestart, namefollower*, ("."+, namefollower+)*. which of course does the job as well. Both them, on their own, are LL(1). However a wider context cannot be LL(1), when a name can be immediately followed by a period. At this point already this requires lookahead of at least 2 to complete the name, plus more, if that period again could be followed by name characters. But I was not in the original discussion, so I am not sure what problem we are actually trying to solve by disallowing the final period. Gunther > > Gunther Rademacher <grd@gmx.net> writes: > > > > > Sorry for jumping in, but it should be > > > > > > @name: namestart, (namefollower ** ('.'?)). > > > -namestart: ["_"; L]. > > > -namefollower: namestart; ["-·‿⁀"; Nd; Mn]. > > > > > > Of the variants proposed below, the first one still allows a period at the end > > > of a name, while the second one allows more than one namefollower only > > > if preceded by a period. > > > > > > Best regards > > > Gunther > > > > > > Gesendet: Dienstag, 28. November 2023 um 17:51 Uhr > > > Von: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com> > > > An: public-ixml@w3.org > > > Betreff: Proposal to change definition of 'name' (forbid final .) > > > It was observed on this morning's CG call that allowing names like > > > > > > foo. > > > > > > causes some difficulties for recursive-descent parsers (and any other > > > parser with limited lookahead, perhaps), which are out of all proportion > > > to the advantages, if any. > > > > > > This is to propose a simple fix: continue to allow . to occur in names, > > > but forbid it to appear at the end of a name. Since no one on the call > > > remembered ever seeing an XML name with a final full stop outside of a > > > test suite, this did not seem likely to be a painful restriction. > > > > > > Concretely, delete the current definitions: > > > > > > @name: namestart, namefollower*. > > > -namestart: ["_"; L]. > > > -namefollower: namestart; ["-.·‿⁀"; Nd; Mn]. > > > > > > and replace them with: > > > > > > @name: namestart, namefollower*, ('.', namefollower*)*. > > > -namestart: ["_"; L]. > > > -namefollower: namestart; ["-·‿⁀"; Nd; Mn]. > > > > > > or alternatively: > > > > > > @name: namestart, (namefollower ** '.'). > > > -namestart: ["_"; L]. > > > -namefollower: namestart; ["-·‿⁀"; Nd; Mn]. > > > > > > Comments and discussion welcome. (And it occurs to me that someone > > > should check to make sure that this does actually address the LL(1) > > > issue.) > > > > > > Michael > > > > >
Received on Thursday, 30 November 2023 12:50:41 UTC