XObject = imports.XObject.XObject;
SymbolSet = imports.SymbolSet.SymbolSet;
-Parser = imports.Parser.Parser;
+//Parser = imports.Parser.Parser;
DocComment = imports.DocComment.DocComment;
-
+DocTag = imports.DocTag.DocTag;
/**
Create a new Symbol.
@class Represents a symbol in the source code.
Object,
{
+
+ name : "",
+ defaultValue : "",
+ params : [],
+ $args : [], // original arguments used when constructing.
+ addOn : "",
+ alias : "",
+ augments : [], // Doctag[]
+ author : "",
+ classDesc : "",
+ comment : {},
+ deprecated : "",
+ desc : "",
+ //events : false,
+ example : "",
+ exceptions : [], // Doctag[]
+ inherits : [], // Doctag[]
+ //inheritsFrom : [],
+ isa : "OBJECT", // OBJECT//FUNCTION
+ isEvent : false,
+ isConstant : false,
+ isIgnored : false,
+ isInner : false,
+ isNamespace : false,
+ isPrivate : false,
+ isStatic : false,
+ memberOf : "",
+ methods : [], // Symbol[]
+ _name : "",
+ _params : [], //Doctag[]
+ properties : [], //Doctag[]
+ requires : [], //Doctag[]
+ returns : [], //Doctag[]
+ see : [], //Doctag[]
+ since : "",
+ srcFile : {},
+ type : "",
+ version : "",
+ childClasses : [],
+ cfgs : {},
+
+
- /*
- toQDump : function(t)
+
+ toObject : function()
{
- return toQDump(t, 'Symbol.fromDump({', '})', {});//new Symbol());
+
+ function array2object(a)
+ {
+
+ var r = [];
+ a.forEach(function(e) {
+ r.push(e.toObject());
+ });
+ return r;
+ }
+
+ var ret = { };
+ for (var i in this) {
+ if (Symbol.hide.indexOf(i) > -1) {
+ continue;
+ }
+ switch (typeof(this[i])) {
+ case 'function':
+ continue;
+ case 'object':
+ switch(i) {
+ //arrays..
+ case 'params' :
+ case 'augments' :
+ case 'exceptions' :
+ case 'inherits' :
+ case 'methods' :
+ case '_params':
+ case 'properties':
+ case 'requires':
+ case 'returns':
+ case 'see':
+ ret[i] = array2object(this[i],true);
+ continue;
+
+ //objects..
+
+ case 'comment' :
+ print(JSON.stringify(this[i]));
+ ret[i] = this[i].toObject();
+ continue;
+ case 'inheritsFrom':
+ case 'childClasses':
+ continue;
+
+ default:
+ print("object? :" + i);
+ Seed.quit();
+ }
+
+
+ case 'string':
+ case 'number':
+ ret[i] = this[i]; continue;
+ default:
+ print("unknown type:" + typeof(this[i]));
+ Seed.quit();
+ }
+ }
+ return ret;
+
},
- */
+
init : function()
{
- this.name = "";
- this.defaultValue = "";
+ // only initialize arrays / objects..
this.params = [];
this.$args = [];
- this.addOn = "";
- this.alias = "";
- this.augments = [];
- this.author = "";
- this.classDesc = "";
- this.comment = { isUserComment: false };
- //this.defaultValue = null;
- this.deprecated = "";
- this.desc = "";
- this.events = [];
- this.example = "";
+
+ //this.events = [];
this.exceptions = [];
this.inherits = [];
- this.inheritsFrom = [];
+ //
this.isa = "OBJECT"; // OBJECT//FUNCTION
- this.isEvent = false;
- this.isConstant = false;
- this.isIgnored = false;
- this.isInner = false;
- this.isNamespace = false;
- this.isPrivate = false;
- this.isStatic = false;
- this.memberOf = "";
this.methods = [];
- this._name = "";
this._params = [];
this.properties = [];
this.requires = [];
this.returns = [];
this.see = [];
- this.since = "";
this.srcFile = {};
- this.type = "";
- this.version = "";
- this.childClasses = [];
+
+
this.cfgs = {};
+ // derived later?
+ this.inheritsFrom = [];
+ this.childClasses = [];
+
+ this.comment = new DocComment();
+ this.comment.isUserComment = false;
+
},
if (properties[i].type) property.type = properties[i].type;
if (properties[i].defaultValue) property.defaultValue = properties[i].defaultValue;
this.addProperty(property);
- Parser.addSymbol(property);
+ imports.Parser.Parser.addSymbol(property);
}
}
}
return r;
- }
+ }
});
-
-
-
+/**
+ * Elements that are not serialized
+ *
+ */
+Symbol.hide = [
+ '$args' // not needed AFAIK
+]
Symbol.srcFile = ""; //running reference to the current file being parsed