JSDOC/Symbol.js
[gnome.introspection-doc-generator] / JSDOC / Symbol.js
1 //<script type="text/javascript">
2
3 XObject         = imports.XObject.XObject;
4
5 SymbolSet       = imports.SymbolSet.SymbolSet;
6 //Parser          = imports.Parser.Parser;
7 DocComment      = imports.DocComment.DocComment;
8 DocTag          = imports.DocTag.DocTag;
9 /**
10         Create a new Symbol.
11         @class Represents a symbol in the source code.
12  */
13 Symbol = XObject.define(
14     function() {
15         this.init();
16         if (arguments.length) this.populate.apply(this, arguments);
17         
18     },
19     Object,
20     {
21         
22         
23         name : "",
24         defaultValue : "",
25         params : [],
26         $args : [], // original arguments used when constructing.
27         addOn : "",
28         alias : "",
29         augments : [],
30         author : "",
31         classDesc : "",
32         comment : { isUserComment: false },
33         deprecated : "",
34         desc : "",
35         events : [],
36         example : "",
37         exceptions : [],
38         inherits : [],
39         inheritsFrom : [],
40         isa : "OBJECT", // OBJECT//FUNCTION
41         isEvent : false,
42         isConstant : false,
43         isIgnored : false,
44         isInner : false,
45         isNamespace : false,
46         isPrivate : false,
47         isStatic : false,
48         memberOf : "",
49         methods : [],
50         _name : "",
51         _params : [],
52         properties : [],
53         requires : [],
54         returns : [],
55         see : [],
56         since : "",
57         srcFile : {},
58         type : "",
59         version : "",
60         childClasses : [],
61         cfgs : {},
62         
63         
64             
65         
66         toObject : function()
67         {
68             
69             function array2object(a , m)
70             {
71                 m = m || false;
72                 var r = [];
73                 a.forEach(function(e) {
74                     r.push(m ? e : e.toObject());
75                 }
76             }
77             var ret = { };
78             for (var i in this) {
79                 switch (typeof(this[i])) {
80                     case 'function':
81                         continue;
82                     case 'object':
83                     
84                         print("object? :" + i);
85                         Seed.quit();
86                     case 'string':
87                     case 'number':
88                         ret[i] = this[i]; continue;
89                     default:
90                         print("unknown type:" + typeof(this[i]));
91                         Seed.quit();
92                    }
93             }
94             
95             
96         },
97         
98         init : function() 
99         {
100             this.name = "";
101             this.defaultValue = "";
102             this.params = [];
103             this.$args = [];
104             this.addOn = "";
105             this.alias = "";
106             this.augments = [];
107             this.author = "";
108             this.classDesc = "";
109             this.comment = { isUserComment: false };
110             //this.defaultValue = null;
111             this.deprecated = "";
112             this.desc = "";
113             this.events = [];
114             this.example = "";
115             this.exceptions = [];
116             this.inherits = [];
117             this.inheritsFrom = [];
118             this.isa = "OBJECT"; // OBJECT//FUNCTION
119             this.isEvent = false;
120             this.isConstant = false;
121             this.isIgnored = false;
122             this.isInner = false;
123             this.isNamespace = false;
124             this.isPrivate = false;
125             this.isStatic = false;
126             this.memberOf = "";
127             this.methods = [];
128             this._name = "";
129             this._params = [];
130             this.properties = [];
131             this.requires = [];
132             this.returns = [];
133             this.see = [];
134             this.since = "";
135             this.srcFile = {};
136             this.type = "";
137             this.version = "";
138             this.childClasses = [];
139             this.cfgs = {};
140                
141         },
142
143         serialize : function() {
144             var keys = [];
145             for (var p in this) {
146                 keys.push (p);
147             }
148             keys = keys.sort();
149             
150             var out = "";
151             for (var i in keys) {
152                 if (typeof this[keys[i]] == "function") continue;
153                 out += "     " +keys[i]+" => "+
154                     (   
155                         (typeof(this[keys[i]]) != "object") ?  
156                             this[keys[i]] :
157                             "[" +typeof(this[keys[i]])+"]"
158                     ) + 
159                     ",\n";
160             }
161             return "\n{\n" + out + "}\n";
162         },
163
164         clone : function() {
165             var clone = new Symbol();
166             clone.populate.apply(clone, this.$args); // repopulate using the original arguments
167             clone.srcFile = this.srcFile; // not the current srcFile, the one when the original was made
168             return clone;
169         },
170
171
172
173
174         //__defineSetter__("name",
175         setName  : function(n) { 
176                 n = n.replace(/^_global_[.#-]/, ""); 
177                 n = n.replace(/\.prototype\.?/g, '#'); 
178                  n = n.replace(/#$/g, ''); 
179                 this._name = n;
180                 this.name = n; // real!
181             },
182         //);
183         //__defineGetter__("name",
184         getName : function() { return this._name; },
185         //);
186         //__defineSetter__("params", 
187         setParams  :function(v) {
188                 for (var i = 0, l = v.length; i < l; i++) {
189                     if (v[i].constructor != DocTag) { // may be a generic object parsed from signature, like {type:..., name:...}
190                         var ty = v[i].hasOwnProperty('type') ? v[i].type : '';
191                         this._params[i] = new DocTag(
192                             "param"+((ty)?" {"+ty+"}":"")+" "+v[i].name);
193                     }
194                     else {
195                         this._params[i] = v[i];
196                     }
197                 }
198                 this.params = this._params;
199             },
200         //);
201
202
203         //__defineGetter__("params",
204         getParams : function() { return this._params; },
205         //);
206
207         populate : function(
208                 /** String */ name,
209                 /** Object[] */ params,
210                 /** String */ isa,
211                 /** DocComment */ comment
212         ) {
213             this.$args = arguments;
214             //println("Symbol created: " + isa + ":" + name);
215             this.setName(name);
216             this.alias = this.getName();
217             this.setParams(params);
218             this.isa = (isa == "VIRTUAL")? "OBJECT":isa;
219             this.comment = comment || new DocComment("");
220             this.srcFile = Symbol.srcFile;
221             
222            
223             
224             if (this.is("FILE") && !this.alias) this.alias = this.srcFile;
225
226             this.setTags();
227             
228             //if (typeof PluginManager != "undefined") {
229             //    PluginManager.run("onSymbol", this);
230             //}
231         },
232
233         setTags : function() {
234             // @author
235             var authors = this.comment.getTag("author");
236             if (authors.length) {
237                 this.author = authors.map(function($){return $.desc;}).join(", ");
238             }
239             
240             /*~t
241                 assert("testing Symbol");
242                 
243                 requires("../lib/JSDOC/DocComment.js");
244                 requires("../frame/String.js");
245                 requires("../lib/JSDOC/DocTag.js");
246
247                 var sym = new Symbol("foo", [], "OBJECT", new DocComment("/**@author Joe Smith*"+"/"));
248                 assertEqual(sym.author, "Joe Smith", "@author tag, author is found.");
249             */
250             // @desc
251             var mth = this.comment.getTag("method");
252             if (mth.length) {
253                 this.isa = "FUNCTION";
254             }
255             // @desc
256             var descs = this.comment.getTag("desc");
257             if (descs.length) {
258                 this.desc = descs.map(function($){return $.desc;}).join("\n"); // multiple descriptions are concatenated into one
259             }
260             
261             /*~t
262                 var sym = new Symbol("foo", [], "OBJECT", new DocComment("/**@desc This is a description.*"+"/"));
263                 assertEqual(sym.desc, "This is a description.", "@desc tag, description is found.");
264             */
265             
266             // @overview
267             if (this.is("FILE")) {
268                 if (!this.alias) this.alias = this.srcFile;
269                 
270                 var overviews = this.comment.getTag("overview");
271                 if (overviews.length) {
272                     this.desc = [this.desc].concat(overviews.map(function($){return $.desc;})).join("\n");
273                 }
274             }
275             
276             /*~t
277                 var sym = new Symbol("foo", [], "FILE", new DocComment("/**@overview This is an overview.*"+"/"));
278                 assertEqual(sym.desc, "\nThis is an overview.", "@overview tag, description is found.");
279             */
280             
281             // @since
282             var sinces = this.comment.getTag("since");
283             if (sinces.length) {
284                 this.since = sinces.map(function($){return $.desc;}).join(", ");
285             }
286             
287             /*~t
288                 var sym = new Symbol("foo", [], "FILE", new DocComment("/**@since 1.01*"+"/"));
289                 assertEqual(sym.since, "1.01", "@since tag, description is found.");
290             */
291             
292             // @constant
293             if (this.comment.getTag("constant").length) {
294                 this.isConstant = true;
295                 this.isa = 'OBJECT';
296             }
297             
298             /*~t
299                 var sym = new Symbol("foo", [], "FILE", new DocComment("/**@constant*"+"/"));
300                 assertEqual(sym.isConstant, true, "@constant tag, isConstant set.");
301             */
302             
303             // @version
304             var versions = this.comment.getTag("version");
305             if (versions.length) {
306                 this.version = versions.map(function($){return $.desc;}).join(", ");
307             }
308             
309             /*~t
310                 var sym = new Symbol("foo", [], "FILE", new DocComment("/**@version 2.0x*"+"/"));
311                 assertEqual(sym.version, "2.0x", "@version tag, version is found.");
312             */
313             
314             // @deprecated
315             var deprecateds = this.comment.getTag("deprecated");
316             if (deprecateds.length) {
317                 this.deprecated = deprecateds.map(function($){return $.desc;}).join("\n");
318             }
319             
320             /*~t
321                 var sym = new Symbol("foo", [], "FILE", new DocComment("/**@deprecated Use other method.*"+"/"));
322                 assertEqual(sym.deprecated, "Use other method.", "@deprecated tag, desc is found.");
323             */
324             
325             // @example
326             var examples = this.comment.getTag("example");
327             if (examples.length) {
328                 this.example = examples[0];
329             }
330             
331             /*~t
332                 var sym = new Symbol("foo", [], "FILE", new DocComment("/**@example This\n  is an example.*"+"/"));
333                 assertEqual(sym.example, "This\n  is an example.", "@deprecated tag, desc is found.");
334             */
335             
336             // @see
337             var sees = this.comment.getTag("see");
338             if (sees.length) {
339                 var thisSee = this.see;
340                 sees.map(function($){thisSee.push($.desc);});
341             }
342             
343             /*~t
344                 var sym = new Symbol("foo", [], "FILE", new DocComment("/**@see The other thing.*"+"/"));
345                 assertEqual(sym.see, "The other thing.", "@see tag, desc is found.");
346             */
347             
348             // @class
349             var classes = this.comment.getTag("class");
350             if (classes.length) {
351                 this.isa = "CONSTRUCTOR";
352                 this.classDesc = classes[0].desc; // desc can't apply to the constructor as there is none.
353                 if (!this.classDesc) {
354                     this.classDesc = this.desc;
355                    }
356                 
357                 
358             }
359             
360             /*~t
361                 var sym = new Symbol("foo", [], "OBJECT", new DocComment("/**@class This describes the class.*"+"/"));
362                 assertEqual(sym.isa, "CONSTRUCTOR", "@class tag, makes symbol a constructor.");
363                 assertEqual(sym.classDesc, "This describes the class.", "@class tag, class description is found.");
364             */
365             
366             // @namespace
367             var namespaces = this.comment.getTag("namespace");
368             if (namespaces.length) {
369                 this.classDesc = namespaces[0].desc+"\n"+this.desc; // desc can't apply to the constructor as there is none.
370                 this.isNamespace = true;
371             }
372             
373             /*~t
374                 var sym = new Symbol("foo", [], "OBJECT", new DocComment("/**@namespace This describes the namespace.*"+"/"));
375                 assertEqual(sym.classDesc, "This describes the namespace.\n", "@namespace tag, class description is found.");
376             */
377             
378             // @param
379             var params = this.comment.getTag("param");
380             if (params.length) {
381                 // user-defined params overwrite those with same name defined by the parser
382                 var thisParams = this.getParams();
383
384                 if (thisParams.length == 0) { // none exist yet, so just bung all these user-defined params straight in
385                     this.setParams(params);
386                 }
387                 else { // need to overlay these user-defined params on to existing parser-defined params
388                     for (var i = 0, l = params.length; i < l; i++) {
389                         if (thisParams[i]) {
390                             if (params[i].type) thisParams[i].type = params[i].type;
391                             thisParams[i].name = params[i].name;
392                             thisParams[i].desc = params[i].desc;
393                             thisParams[i].isOptional = params[i].isOptional;
394                             thisParams[i].defaultValue = params[i].defaultValue;
395                         }
396                         else thisParams[i] = params[i];
397                     }
398                 }
399             }
400             
401             /*~t
402                 var sym = new Symbol("foo", [{type: "array", name: "pages"}], "FUNCTION", new DocComment("/**Description.*"+"/"));
403                 assertEqual(sym.params.length, 1, "parser defined param is found.");
404                 
405                 sym = new Symbol("foo", [], "FUNCTION", new DocComment("/**Description.\n@param {array} pages*"+"/"));
406                 assertEqual(sym.params.length, 1, "user defined param is found.");
407                 assertEqual(sym.params[0].type, "array", "user defined param type is found.");
408                 assertEqual(sym.params[0].name, "pages", "user defined param name is found.");
409                 
410                 sym = new Symbol("foo", [{type: "array", name: "pages"}], "FUNCTION", new DocComment("/**Description.\n@param {string} uid*"+"/"));
411                 assertEqual(sym.params.length, 1, "user defined param overwrites parser defined param.");
412                 assertEqual(sym.params[0].type, "string", "user defined param type overwrites parser defined param type.");
413                 assertEqual(sym.params[0].name, "uid", "user defined param name overwrites parser defined param name.");
414             
415                 sym = new Symbol("foo", [{type: "array", name: "pages"}, {type: "number", name: "count"}], "FUNCTION", new DocComment("/**Description.\n@param {string} uid*"+"/"));
416                 assertEqual(sym.params.length, 2, "user defined params  overlay parser defined params.");
417                 assertEqual(sym.params[1].type, "number", "user defined param type overlays parser defined param type.");
418                 assertEqual(sym.params[1].name, "count", "user defined param name overlays parser defined param name.");
419
420                 sym = new Symbol("foo", [], "FUNCTION", new DocComment("/**Description.\n@param {array} pages The pages description.*"+"/"));
421                 assertEqual(sym.params.length, 1, "user defined param with description is found.");
422                 assertEqual(sym.params[0].desc, "The pages description.", "user defined param description is found.");
423             */
424             
425             // @constructor
426             if (this.comment.getTag("constructor").length) {
427                 this.isa = "CONSTRUCTOR";
428             }
429             
430             /*~t
431                 var sym = new Symbol("foo", [], "OBJECT", new DocComment("/**@constructor*"+"/"));
432                 assertEqual(sym.isa, "CONSTRUCTOR", "@constructor tag, makes symbol a constructor.");
433             */
434             
435             // @static
436             if (this.comment.getTag("static").length) {
437                 this.isStatic = true;
438                 if (this.isa == "CONSTRUCTOR") {
439                     this.isNamespace = true;
440                 }
441             }
442             
443                 // @static
444             if (this.comment.getTag("singleton").length) {
445                 this.isStatic = true;
446                 //if (this.isa == "CONSTRUCTOR") {
447                 //      this.isNamespace = true;
448                 //}
449             }
450             
451             
452             
453             /*~t
454                 var sym = new Symbol("foo", [], "OBJECT", new DocComment("/**@static\n@constructor*"+"/"));
455                 assertEqual(sym.isStatic, true, "@static tag, makes isStatic true.");
456                 assertEqual(sym.isNamespace, true, "@static and @constructor tag, makes isNamespace true.");
457             */
458             
459             // @inner
460             if (this.comment.getTag("inner").length) {
461                 this.isInner = true;
462                 this.isStatic = false;
463             }
464             
465             /*~t
466                 var sym = new Symbol("foo", [], "OBJECT", new DocComment("/**@inner*"+"/"));
467                 assertEqual(sym.isStatic, false, "@inner tag, makes isStatic false.");
468                 assertEqual(sym.isInner, true, "@inner makes isInner true.");
469             */
470             
471             // @field
472             if (this.comment.getTag("field").length) {
473                 this.isa = "OBJECT";
474             }
475             
476             /*~t
477                 var sym = new Symbol("foo", [], "FUNCTION", new DocComment("/**@field*"+"/"));
478                 assertEqual(sym.isa, "OBJECT", "@field tag, makes symbol an object.");
479             */
480             
481             // @function
482             if (this.comment.getTag("function").length) {
483                 this.isa = "FUNCTION";
484             }
485             
486             // @param
487             if (this.comment.getTag("param").length && this.isa == "OBJECT" ) {
488                 // change a property to a function..
489                 this.isa = "FUNCTION";
490             }
491             
492             
493             /*~t
494                 var sym = new Symbol("foo", [], "OBJECT", new DocComment("/**@function*"+"/"));
495                 assertEqual(sym.isa, "FUNCTION", "@function tag, makes symbol a function.");
496             */
497             
498             // @event
499             var events = this.comment.getTag("event");
500             if (events.length) {
501                 this.isa = "FUNCTION";
502                 this.isEvent = true;
503             }
504             
505             /*~t
506                 var sym = new Symbol("foo", [], "OBJECT", new DocComment("/**@event*"+"/"));
507                 assertEqual(sym.isa, "FUNCTION", "@event tag, makes symbol a function.");
508                 assertEqual(sym.isEvent, true, "@event makes isEvent true.");
509             */
510             
511             // @name
512             var names = this.comment.getTag("name");
513             if (names.length) {
514                 this.setName(names[0].desc);
515             }
516             
517             /*~t
518                 // todo
519             */
520             
521             // @property
522             var properties = this.comment.getTag("property");
523             if (properties.length) {
524                 thisProperties = this.properties;
525                 for (var i = 0; i < properties.length; i++) {
526                     var property = new Symbol(this.alias+"#"+properties[i].name, [], "OBJECT", new DocComment("/**"+properties[i].desc+"\n@name "+properties[i].name+"\n@memberOf "+this.alias+"#*/"));
527                     // TODO: shouldn't the following happen in the addProperty method of Symbol?
528                     property.name = properties[i].name;
529                     property.memberOf = this.alias;
530                     if (properties[i].type) property.type = properties[i].type;
531                     if (properties[i].defaultValue) property.defaultValue = properties[i].defaultValue;
532                     this.addProperty(property);
533                     imports.Parser.Parser.addSymbol(property);
534                 }
535             }
536             
537             // config..
538             var conf = this.comment.getTag("cfg");
539             if (conf.length) {
540                 for (var i = 0; i < conf.length; i++) {
541                     this.addConfig(conf[i]);
542                 }
543             }
544             
545             /*~t
546                 // todo
547             */
548
549             // @return
550             var returns = this.comment.getTag("return");
551             if (returns.length) { // there can be many return tags in a single doclet
552                 this.returns = returns;
553                 this.type = returns.map(function($){return $.type}).join(", ");
554             }
555             
556             /*~t
557                 // todo
558             */
559             
560             // @exception
561             this.exceptions = this.comment.getTag("throws");
562             
563             /*~t
564                 // todo
565             */
566             
567             // @requires
568             var requires = this.comment.getTag("requires");
569             if (requires.length) {
570                 this.requires = requires.map(function($){return $.desc});
571             }
572             
573             /*~t
574                 // todo
575             */
576             
577             // @type
578             var types = this.comment.getTag("type");
579             if (types.length) {
580                 this.type = types[0].desc; //multiple type tags are ignored
581             }
582             
583             /*~t
584                 // todo
585             */
586             
587             // @private
588             if (this.comment.getTag("private").length || this.isInner) {
589                 this.isPrivate = true;
590             }
591             
592             // @ignore
593             if (this.comment.getTag("ignore").length) {
594                 this.isIgnored = true;
595             }
596             
597             /*~t
598                 // todo
599             */
600             
601             // @inherits ... as ...
602             var inherits = this.comment.getTag("inherits");
603             if (inherits.length) {
604                 for (var i = 0; i < inherits.length; i++) {
605                     if (/^\s*([a-z$0-9_.#-]+)(?:\s+as\s+([a-z$0-9_.#]+))?/i.test(inherits[i].desc)) {
606                         var inAlias = RegExp.$1;
607                         var inAs = RegExp.$2 || inAlias;
608
609                         if (inAlias) inAlias = inAlias.replace(/\.prototype\.?/g, "#");
610                         
611                         if (inAs) {
612                             inAs = inAs.replace(/\.prototype\.?/g, "#");
613                             inAs = inAs.replace(/^this\.?/, "#");
614                         }
615
616                         if (inAs.indexOf(inAlias) != 0) { //not a full namepath
617                             var joiner = ".";
618                             if (this.alias.charAt(this.alias.length-1) == "#" || inAs.charAt(0) == "#") {
619                                 joiner = "";
620                             }
621                             inAs = this.alias + joiner + inAs;
622                         }
623                     }
624                     this.inherits.push({alias: inAlias, as: inAs});
625                 }
626             }
627             
628             /*~t
629                 // todo
630             */
631
632             // @augments
633             this.augments = this.comment.getTag("augments");
634             
635             //@extends - Ext
636             if (this.comment.getTag("extends")) {   
637                 this.augments = this.comment.getTag("extends");
638             }
639             
640             
641             // @default
642             var defaults = this.comment.getTag("default");
643             if (defaults.length) {
644                 if (this.is("OBJECT")) {
645                     this.defaultValue = defaults[0].desc;
646                 }
647             }
648             
649             /*~t
650                 // todo
651             */
652             
653             // @memberOf
654             var memberOfs = this.comment.getTag("memberOf");
655             if (memberOfs.length) {
656                 this.memberOf = memberOfs[0].desc;
657                 this.memberOf = this.memberOf.replace(/\.prototype\.?/g, "#");
658             }
659
660             /*~t
661                 // todo
662             */
663             
664             // @public
665             if (this.comment.getTag("public").length) {
666                 this.isPrivate = false;
667             }
668             
669             /*~t
670                 // todo
671             */
672         },
673
674         is : function(what) {
675             return this.isa === what;
676         },
677
678         isBuiltin : function() {
679             return SymbolSet.isBuiltin(this.alias);
680         },
681
682         setType : function(/**String*/comment, /**Boolean*/overwrite) {
683             if (!overwrite && this.type) return;
684             var typeComment = DocComment.unwrapComment(comment);
685             this.type = typeComment;
686         },
687
688         inherit : function(symbol) {
689             if (!this.hasMember(symbol.name) && !symbol.isInner) {
690                 if (symbol.is("FUNCTION"))
691                     this.methods.push(symbol);
692                 else if (symbol.is("OBJECT"))
693                     this.properties.push(symbol);
694             }
695         },
696
697         hasMember : function(name) {
698             return (this.hasMethod(name) || this.hasProperty(name));
699         },
700
701         addMember : function(symbol) {
702             //println("ADDMEMBER: " + this.name +  " ++ " + symbol.name);
703             
704             if (symbol.comment.getTag("cfg").length == 1) { 
705                 symbol.comment.getTag("cfg")[0].memberOf = this.alias;
706                 this.addConfig(symbol.comment.getTag("cfg")[0]);
707                 return;
708             }
709             
710             if (symbol.is("FUNCTION")) { this.addMethod(symbol); }
711             else if (symbol.is("OBJECT")) { this.addProperty(symbol); }
712         },
713
714         hasMethod : function(name) {
715             var thisMethods = this.methods;
716             for (var i = 0, l = thisMethods.length; i < l; i++) {
717                 if (thisMethods[i].name == name) return true;
718                 if (thisMethods[i].alias == name) return true;
719             }
720             return false;
721         },
722
723         addMethod : function(symbol) {
724             var methodAlias = symbol.alias;
725             var thisMethods = this.methods;
726             for (var i = 0, l = thisMethods.length; i < l; i++) {
727                 if (thisMethods[i].alias == methodAlias) {
728                     thisMethods[i] = symbol; // overwriting previous method
729                     return;
730                 }
731             }
732             thisMethods.push(symbol); // new method with this alias
733         },
734
735         hasProperty : function(name) {
736             var thisProperties = this.properties;
737             for (var i = 0, l = thisProperties.length; i < l; i++) {
738                 if (thisProperties[i].name == name) return true;
739                 if (thisProperties[i].alias == name) return true;
740             }
741             return false;
742         },
743
744         addProperty : function(symbol) {
745             var propertyAlias = symbol.alias;
746             var thisProperties = this.properties;
747             for (var i = 0, l = thisProperties.length; i < l; i++) {
748                 if (thisProperties[i].alias == propertyAlias) {
749                     thisProperties[i] = symbol; // overwriting previous property
750                     return;
751                 }
752             }
753
754             thisProperties.push(symbol); // new property with this alias
755         },
756         
757         addDocTag : function(docTag)
758         {
759             this.comment.tags.push(docTag);
760             if (docTag.title == 'cfg') {
761                 this.addConfig(docTag);
762             }
763             
764         },
765         
766         addConfig : function(docTag)
767         {
768             if (typeof(docTag['memberOf']) == 'undefined') {
769                 // remove prototype data...
770                 //var a = this.alias.split('#')[0];
771                 //docTag.memberOf = a;
772                 docTag.memberOf = this.alias;
773             }
774             if (typeof(this.cfgs[docTag.name]) == 'undefined') {
775                 this.cfgs[docTag.name] = docTag;
776             }
777             
778         },
779         configToArray: function()
780         {
781             var r = [];
782             for(var ci in this.cfgs) {
783                 // dont show hidden!!
784                 if (this.cfgs[ci].desc.match(/@hide/)) {
785                     continue;
786                 }
787                 r.push(this.cfgs[ci]); 
788                
789             }
790             return r;
791         }
792 });
793
794
795
796
797
798 Symbol.srcFile = ""; //running reference to the current file being parsed
799
800
801 Symbol.fromDump = function(t)
802 {
803     var ns = new Symbol();
804     for (var i in t) {
805         if (typeof(ns[i]) == "undefined") {
806             println("ERR:no default for Symbol:"+ i);
807         }
808         ns[i] = t[i];
809     }
810     return ns;
811 }