Re: Issue: Should we disallow nested grammars?

From
James Clark <>
Date
2001-04-30T01:49:14+00:00
ID
00dc01c0d117$615a1340$
Thread
Re: Issue: Should we disallow nested grammars?
From: "Murata Makoto" <>
To: <>
Sent: Sunday, April 29, 2001 9:58 PM
Subject: Issue: Should we disallow nested grammars?


> At present, nesting of grammars is freely allowed.  I propose
> to disallow such nesting in V1.0.

I strongly disagree with this. I believe it to be a very good feature of
TREX that it allows all forms of pattern to be composed with very few
restrictions.  A grammar is just another kind of pattern.

> First, I do not see any use cases.  The TREX tutorial says:
> "Of course, in a trivial case like this, there is no advantage in nesting
> the grammars: we could simply have have included table.trex within the
outer
> grammar element."
>
> It further says: "However, when the included grammar has many definitions,
> nesting it avoids the possibility of name conflicts between the including
> grammar and the included grammar."  In other words, we only have to
perform
> renaming upon inclusion.  This is very easy.

Yes, it is easy for computers.  But for humans, it means they have to create
a copy of a pattern and rename definitions.  This renamed copy has to be
kept in sync with the original whenever it changes.

> Second, I believe that modularization mechanisms requires further study.
> I think that it is dangerous to provide nested grammars without fully
> understanding modularization.

Wherein lies the danger?

James