You can now write: syntax dssl { private fred := ...
and fred with be local to the dssl, and thus not extensible or otherwise usable outside it. It's a bit messy: the nonterminal is private if any one of its rules is marked private. The private annotation causes a map from the given name to a magic name to be added to a per-dssl privacy map. When any rule from that dssl is applied by an open syntax directive, the LHS nonterminal and all nonterminals in the RHS of the rule are remapped by the to their secret name (if they have one). Privacy is not currently detected by the document generator ;( I note the following construction: let x := y in z := x cannot be emulated by private x := y' z := x; in case x is used in TWO 'let' statements within the same dssl. However, this would almost work: syntax magic { private x :=y; z := x; } require syntax magic; if nested dssl's were allowed. Note this isn't quite the same as using a non-nested dssl, because the nested one can see private names of the enclosing dssl, whereas a non-nested one cannot -- otherwise this could be implemented by simply making a new dssl. The name 'magic' here means the dssl name is secret, so it cannot be 'required' by the user. However unlike modules, it isn't clear requiring or opening a nested name makes any sense. Perhaps the nested dssls contain various alternate refinements of a basic syntax, which is automatically opened if the refinement is. Another possible annotation is: virtual x := y; This means x can be extended, other nonterminals in a dssl can be used from outside, but not extended. However it isn't clear exactly which nonterminals would be nonvirtual! -- 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 Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language