A Context object used to keep state when parsing symbols. The context should not be used directly by user code.

Constructor

Defined context.js Source
function (){
   this.scopes = {};
   this.nameSpaces = {global:[]};
   this.aliases = {};
   this.activateScope("global");
       
}
            

activateScope Function Public


Defined context.js

Activates a scope for.

Arguments Returns Source
function (name){
   this.activeScope = name;
   return this.addScope(name);
       
}
    

addNamespace Function Public


Defined context.js

Adds a namespace the the context object.

Arguments Returns Source
function (name){
   if ("undefined" === typeof this.nameSpaces[name]) {
       this.nameSpaces[name] = {};
   }
   return this.nameSpaces[name];
       
}
    

addScope Function Public


Defined context.js

Adds a scope to the context

Arguments Returns Source
function (name){
   if ("undefined" === typeof this.scopes[name]) {
       this.scopes[name] = {};
   }
   return this.scopes[name];
       
}
    

getActiveScope Function Public


Defined context.js

Returns the active scope.

Returns Source
function (){
   return this.getScope(this.activeScope);
       
}
    

getActiveScopeName Function Public


Defined context.js

Returns the name of the active scope.

Returns Source
function (){
   return this.activeScope;
       
}
    

getNamespace Function Public


Defined context.js

Gets a namespace, creating it if it does not exist.

Arguments Returns Source
function (name){
   return this.addNamespace(name);
       
}
    

getScope Function Public


Defined context.js

Gets a scope creating it if it does not exist.

Arguments Returns Source
function (name){
   return this.addScope(name);
       
}
    

License

MIT LICENSE

Meta


Code: git clone git://github.com/pollenware/coddoc.git