Version 12 (modified by archibald, 8 years ago) (diff) |
---|
Table of Contents
Pages linking to NameSpaces:
ClassDefinition
CompileTimeTypeChecking
DataTypes
EnterTheIdeaBase
EnumDefinition
ExpressionSyntax
FiniteStateMachines
NotationExplaination
SignalDefinition
SingletonDefinition
TypeDefinition
WhatAboutIdentifiers
compoundStatementsLlambdas
ClassDefinition
CompileTimeTypeChecking
DataTypes
EnterTheIdeaBase
EnumDefinition
ExpressionSyntax
FiniteStateMachines
NotationExplaination
SignalDefinition
SingletonDefinition
TypeDefinition
WhatAboutIdentifiers
compoundStatementsLlambdas
Namespaces
We need to create name spaces.
Namespaces are
- commonly structured as 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
To store namespaces we need a structure similar to that detailed below ... explaination of the notation
DATA DEFINITION
NAMESPACE $project:tdx - $system:lang // however $project is implied and not really needed SINGLETON design namespace ourNameSpaces = NEW namespace("system") CLASS namespace(ubyte$ name) namespace{} subSpaces namespace(namespace) addNamespace(newNameSpace) = { subSpaces->add(newNameSpace) RETURN newNameSpace }
SYNTAX DEFINITION
namespaceClause := "NAMESPACE" newNameSpaceClause { "-" { existingNameSpaceClause }+ };
newNameSpaceClause := { "$" ident { ":" ident }* | ident { ":" ident }* };
existingNameSpaceClause := { "$" ident { ":" ident }* | ident { ":" ident }* };
Attachments
- existingNamespaceClause.png (28.1 KB) - added by archibald 8 years ago.
- namespaceClause.png (15.1 KB) - added by archibald 8 years ago.
- newNamespaceClause.png (27.0 KB) - added by archibald 8 years ago.
- namespace.png (27.4 KB) - added by archibald 8 years ago.