On Sat, 2007-07-28 at 14:36 +0200, Emmanuel Onzon wrote:
> Quoting skaller <[EMAIL PROTECTED]>:
> > For the same reason, dssl's probably need 'private'
> > nonterminals.
>
> This is quite desirable since one may want to open two independent
> syntax extensions at the same time that both use a same non
> terminal unintentionally (i.e. that happen to have the same name in both
> grammars) for different purposes. In this case, internally, there should
> be one distinct non terminal for each grammar.
> I think that by default the non terminals should be private.
In Felix libraries, symbols are public by default, but
they can be declared private. OTOH when building a shared
binary library, symbols are invisible by default, unless
exported .. :)
> And there should be a way to:
> 1) allow a given non terminal to be extended when one define
> the grammar extension (declare the non terminal as public).
So others are 'final' in the sense of inheritance and Java.
The problem is it's hard to know in advance which *public*
symbols are non-extensible (private ones clearly can't be
extended).
> 2) specify that a non terminal is intended to extend the non
> terminal of the same name of a given grammar (that has to be
> previously opened).
There are more issues. At present, all nonterminals, even
private ones, are global (private ones just have magic names).
There's an obvious analogy of a dssl package
with classes/modules etc: allow qualified names too.
And with functions: named parameters.
So one might think something like:
syntax derived : base1, base2 -> nt1, nt2 {
...
}
meaning derived uses nonterminals from base1, base2, and
exports new or extended nonterminals nt1, nt2.
This makes the coupling even more explicit .. but it could
also be a PITA to write.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language