Next in thread → Next in month →

Re: Issue: Should we disallow nested grammars?

From
Murata Makoto <>
Date
2001-05-01T01:04:39+00:00
ID
Thread
Re: Issue: Should we disallow nested grammars?
Kohsuke KAWAGUCHI wrote:

> This BNF still has a loophole:

Yes, it does.

> I don't think schema is enough to completely prohibit them: 

I tried to further tighten the BNF and failed.  It does not seem 
to be possible to provide a just-enough BNF.

Kohsuke KAWAGUCHI wrote:

> By the way, rewritten BNF is an ambiguous grammar, isn't it.

No, it isn't.

Murata Makoto wrote:

> textPattern ::=
...
>  | <t:choice> textPattern textPattern </t:choice> 
> 
> nonTextPattern ::=
...
>  | <t:choice> nonTextPattern nonTextPattern </t:choice> 
>  | <t:choice> textPattern nonTextPattern </t:choice> 
>  | <t:choice> nonTextPattern  textPattern</t:choice> 

We only have to consider these productions, since other productions 
have non-overlapping terminals.  By easy induction, each sentence 
has one and only one derivation tree.

Cheers,

Makoto
Next in thread → Next in month →