[[TOC]][[BackLinksMenu]] = 1) Namespaces = == Namespaces : Context == We need to create name spaces.[[BR]][[BR]] Namespaces are * a labeled/named subset of identified/labeled content, * content can then be precisely identified with a compound identfier - the conjuction of the subset name and the content name. * commonly structured as nested hierarchies to allow reuse of names in different contexts. * typically employed for the purpose of grouping symbols and identifiers around a particular functionality and to avoid name collisions between multiple identifiers that share the same name. * hierarchical, ie sets of namespaces can be nested within another namespace == Namespaces : Examples == === In TDX === '''{{{ NAMESPACE $project }}}''' Puts anything following in the current project context '''{{{ NAMESPACE $project:subComponent }}}''' OR '''{{{ NAMESPACE subComponent }}}''' Puts everyting that follows into the project's subComponent namespace === In VDX === == Namespaces : Semantics == == Namespaces : Data Definition == To store namespaces we need a structure similar to that detailed below ... [wiki:NotationExplaination explaination of the notation] === In TDX === {{{ NAMESPACE $project:tdx - $system:lang // however $project is implied and not really needed SINGLETON design namespace ourNameSpaces = NEW namespace("system") SYNTAX textualDesignClause := ( designClause )+; designClause := namespaceClause ( designComponentClause )+; designComponentClause := ... ; CLASS namespace(ubyte$ name) namespace{} subSpaces namespace(namespace) addNamespace(newNameSpace) = { subSpaces->add(newNameSpace) RETURN newNameSpace } SYNTAX namespaceClause := "NAMESPACE" newNameSpaceClause ( "-" ( existingNameClause )+ ); newNameSpaceClause := ( "$" ident ( ":" ident )* | ident ( ":" ident )+ ); existingNameClause := ( "$" ident ( ":" ident )* | ident ( ":" ident )+ ); }}} === In VDX === [[Image(namespace.png,width=98%)]] == Namespaces : Syntax == === INFORMATION MODEL === === '''PROCEDURAL MODEL''' === [[Image(namespaceClause.png,width=98%)]] [[Image(newNamespaceClause.png,width=98%)]] [[Image(existingNamespaceClause.png,width=98%)]] == (2) [wiki:TypeDefinition Types] == == (3) [wiki:EnumDefinition Enums] == == (4) [wiki:SignalDefinition Signals] == == (5) [wiki:SingletonDefinition Singletons] == == (6) [wiki:ClassDefinition Classes] ==