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