Re: best grammar for handling optional symbols?

Chris F Clark <cfc@shell01.TheWorld.com>
Tue, 19 Aug 2008 17:07:54 -0400

          From comp.compilers

Related articles
best grammar for handling optional symbols? jmichae3@yahoo.com (2008-08-15)
Re: best grammar for handling optional symbols? max@gustavus.edu (Max Hailperin) (2008-08-16)
Re: best grammar for handling optional symbols? jaluber@gmail.com (Johannes) (2008-08-17)
Re: best grammar for handling optional symbols? jmichae3@yahoo.com (2008-08-18)
Re: best grammar for handling optional symbols? cfc@shell01.TheWorld.com (Chris F Clark) (2008-08-19)
RE: best grammar for handling optional symbols? quinn_jackson2004@yahoo.ca (Quinn Tyler Jackson) (2008-08-19)
| List of all articles for this month |

From: Chris F Clark <cfc@shell01.TheWorld.com>
Newsgroups: comp.compilers
Date: Tue, 19 Aug 2008 17:07:54 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 08-08-021 08-08-022
Keywords: parse
Posted-Date: 19 Aug 2008 22:20:06 EDT

On minor point is response to what Max Hailperin <max@gustavus.edu>
writes:


> But nothing like that is possible if the order is variable. In that
> case, even if you are writing for humans, your best bet is to escape
> from the BNF or EBNF into some more general means of communication --
> which for a human, might well be a natural-language explanation.


That's not completely true. I distinctly recall reading a paper where
the author introduced an EBNF notation for generating permuations,
which is exactly what this problem calls for. Now, permutations don't
have trivial tranformations into BNF, in the sense that to describe
permutations in BNF one must list each of the alternatives and that
grows quite rapidly as the number of symbols to be permuted increases.
However, it is quite feasible to generate code that recognizes
permutations, and thus adding an operator that does such to one's EBNF
is reasonable to my mind. Others may object that EBNF should be
restricted to allowing only things expressible as regular expressions
on the right-hand-side. However, as I remember the notation, it was
restricted to combining fixed lists of symbols, so it technically was
a regular expression, just not a traditional one.


I did a Google search looking for permutation grammars but didn't find
anything on the first page, although the link to Royal Holloway seemed
promising, as Adrian Johnstone and Elizabeth Scott could easily be
interested in such an extension.


Note, if someone find this paper, it would be nice to see the
reference posted here. I wouldn't mind reading that paper again.


Hope this helps,
-Chris


******************************************************************************
Chris Clark Internet: christopher.f.clark@compiler-resources.com
Compiler Resources, Inc. or: compres@world.std.com
23 Bailey Rd Web Site: http://world.std.com/~compres
Berlin, MA 01503 voice: (508) 435-5016
USA fax: (978) 838-0263 (24 hours)


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.