Re: ABNF, and miscellany

Frank Ellermann <[email protected]>
Newsgroups gmane.ietf.rfc822
Organization <URL:http://purl.net/xyzzy>
Message-ID <[email protected]>
Bill Fenner wrote:

 3*5[foo].
> Each [foo] may be empty or may be a foo.  So, you can get
| any number between 0 and 5 by having some empty [foo]s and
> some non-empty [foo]s.

Apparently _this_ is "repetition before optional/grouping" (?)
Often "A op (B)" means "determine B' := (B), then (A op B')"

> If I wanted 0, 3, 4 or 5 foos I think I'd say [3*5foo].

Yes.  Maybe Dave could add Bruce's example, it's fascinating.

Or maybe you could add it as warning to your parser, like old
C compilers "do you mean equality ?".  As an option, I recall
too many "of course I mean equality" curses, and some "oops".

And another warning could catch all "strongly advised to use
grouping" like LWSP.  E.g. in REXX "say 44 / 2 2" says "22 2",
and gawk "print 44 / 2 2" prints "222".  

I'd need "say 44 / (2 || 2)" or "print 44 / (2 2)" to get "2".

                             Bye, Frank
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.