engine
Class NameSpace

java.lang.Object
  |
  +--engine.NameSpace
Direct Known Subclasses:
Module, ModuleArray

class NameSpace
extends java.lang.Object

A symbol container. Its main task is name resolving: the algoithm is : 1. if a non-FQN (fully qualified name) is given, then it is resolved within the innermost module, by going up in the task/function/named block hierarcy. 2. if the name has the form ., then it is esolved as a downward reference: 2.a. look in the curent module for a module instance named ; if found, must be resolved within that instance 2.b. look in the parent module of the current module for a module instance called ; if found, then must be resolved within it 2.c. repeat step 2.b, mobing up in the hierarcy 3. try resolve the name starting with the 'top' modules Note: because rule 2 and 3 can give birth to some confusions ( what if there are two modules with the same name, one at the top level and the other in the current's module branch, and a two-name identifier is given in the hope that it will refer to the top one ?) the use of a special name, "@top" is allowed in order to force the resolving process to start from the root of the hierarcy. Please note that "@top" is not a reserved name, but if used as a module name, any two-name identifier will refer to the root, not the user's "@top" module.


Field Summary
(package private)  NameSpaceDescription desc
           
(package private)  boolean downwardAllowed
          Set it to false to prevent name resolver to pass non-fqn's to the parent if no match is found inside this namespace (so the name resolving of a non-fqn won't pass the module border).
(package private)  NameSpace parent
          The enclosing NameSpace of this NameSpace.
(package private)  java.util.Hashtable scopeData
           
 
Constructor Summary
(package private) NameSpace(NameSpace parent, NameSpaceDescription desc)
           
 
Method Summary
 java.lang.Object resolveName(FQN fqn)
           
 java.lang.Object resolveNameExact(FQN fqn)
          Search for an exactly match inside this scope.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

parent

NameSpace parent
The enclosing NameSpace of this NameSpace.

scopeData

java.util.Hashtable scopeData

downwardAllowed

boolean downwardAllowed
Set it to false to prevent name resolver to pass non-fqn's to the parent if no match is found inside this namespace (so the name resolving of a non-fqn won't pass the module border).

desc

NameSpaceDescription desc
Constructor Detail

NameSpace

NameSpace(NameSpace parent,
          NameSpaceDescription desc)
Method Detail

resolveName

public java.lang.Object resolveName(FQN fqn)

resolveNameExact

public java.lang.Object resolveNameExact(FQN fqn)
Search for an exactly match inside this scope. Used by resolveName after the first part of an fqn has been sucessfully found.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object