* Get the number of days in the current month, adjusted for leap year.
* @return {Number} The number of days in the month
*/
- getDaysInMonth : function() {
+ getDaysInMonth : function()
+ {
Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
return Date.daysInMonth[this.getMonth()];
},
* Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').
* @return {String} 'st, 'nd', 'rd' or 'th'
*/
- getSuffix : function() {
+ getSuffix : function()
+ {
switch (this.getDate()) {
case 1:
case 21:
</code></pre>
* @return {Date} The new Date instance
*/
- clone : function() {
+ clone : function()
+ {
return new Date(this.getTime());
},
@param {Boolean} clone true to create a clone of this date, clear the time and return it
@return {Date} this or the clone
*/
- clearTime : function(clone){
+ clearTime : function(clone)
+ {
if(clone){
return this.clone().clearTime();
}
* @param {Number} value The amount to add to the current date
* @return {Date} The new Date instance
*/
- add : function(interval, value){
- var d = this.clone();
- if (!interval || value === 0) return d;
- switch(interval.toLowerCase()){
- case Date.MILLI:
- d.setMilliseconds(this.getMilliseconds() + value);
- break;
- case Date.SECOND:
- d.setSeconds(this.getSeconds() + value);
- break;
- case Date.MINUTE:
- d.setMinutes(this.getMinutes() + value);
- break;
- case Date.HOUR:
- d.setHours(this.getHours() + value);
- break;
- case Date.DAY:
- d.setDate(this.getDate() + value);
- break;
- case Date.MONTH:
- var day = this.getDate();
- if(day > 28){
- day = Math.min(day, this.getFirstDateOfMonth().add('mo', value).getLastDateOfMonth().getDate());
- }
- d.setDate(day);
- d.setMonth(this.getMonth() + value);
- break;
- case Date.YEAR:
- d.setFullYear(this.getFullYear() + value);
- break;
- }
- return d;
+ add : function(interval, value)
+ {
+ var d = this.clone();
+ if (!interval || value === 0) return d;
+ switch(interval.toLowerCase()){
+ case Date.MILLI:
+ d.setMilliseconds(this.getMilliseconds() + value);
+ break;
+
+ case Date.SECOND:
+ d.setSeconds(this.getSeconds() + value);
+ break;
+
+ case Date.MINUTE:
+ d.setMinutes(this.getMinutes() + value);
+ break;
+
+ case Date.HOUR:
+ d.setHours(this.getHours() + value);
+ break;
+
+ case Date.DAY:
+ d.setDate(this.getDate() + value);
+ break;
+
+ case Date.MONTH:
+ var day = this.getDate();
+ if(day > 28){
+ day = Math.min(day, this.getFirstDateOfMonth().add('mo', value).getLastDateOfMonth().getDate());
+ }
+ d.setDate(day);
+ d.setMonth(this.getMonth() + value);
+ break;
+
+ case Date.YEAR:
+ d.setFullYear(this.getFullYear() + value);
+ break;
+
+ }
+ return d;
}
});
\ No newline at end of file
-//<script type="text/javascript">
+
+Gio = imports.gi.Gio;
+
+XObject = imports.XObject.XObject;
+File = imports.File.File;
+
+
+
+Template = imports.JsTemplate.Template.Template;
+Link = imports.JsTemplate.Link.Link; // ?? fixme!??
+
+
+
/**
- *
* This is the main container for the JSDOC application.
*
- *usage::
+ * <PRE>
+usage::
BuildDocs = imports.JSDOC.BuildDocs.BuildDocs
or command line:
new ArgsParser(argv, imports.BuildDocs.BuildDocs )
+ * </PRE>
+ *
*
+ * What it does..
+ * - tokenizes, collapse, then runs each file through ScopeNamer.
+ * - this is cached (so reparsing is not always needed)
+ * This in turn builds 'symbolSet' - which
+ * - after all symbols are read - symbolSet.relate(); is called.
+ *
+
+
+
* @scope JSDOC
- */
-
-
-Gio = imports.gi.Gio;
-
-XObject = imports.XObject.XObject;
-File = imports.File.File;
-
-
-
-Template = imports.JsTemplate.Template.Template;
-Link = imports.JsTemplate.Link.Link; // ?? fixme!??
-
-
-
-/**
- *
* @class BuildDocs
*
* Main class used to build documentation
});
*/
-
+ imports.ScopeNamer.ScopeNamer.builder = this;
this.build();
*/
ignoreNamespace : false,
-
-
-
-
+ /**
+ * @cfg {Boolean} treatUnderscoredAsPrivate automatically flag underscore prefixed properties as private.
+ */
+ treatUnderscoredAsPrivate : true,
+
/**
* Full list of source files.
* @private
imports.ScopeNamer.ScopeNamer.symbols.relate();
- //print(JSON.stringify(
- // XObject.keys(imports.ScopeNamer.ScopeNamer.symbols._index),
- //null, 4));
+ print(JSON.stringify(
+ XObject.keys(imports.ScopeNamer.ScopeNamer.symbols._index),
+ null, 4));
//print(JSON.stringify(imports.ScopeNamer.ScopeNamer.symbols._index, null,4));
//symbol.ignoreNamespace = this.ignoreNamespace;
-
- var ns = File.dirname(symbol.srcFile).replace(/\//g,'.');
- if (symbol.alias.substring(0, ns.length) == ns) {
- ns = '';
- }
- ns += ns.length ? '.' : '';
+ var ns = '';
+ //var ns = File.dirname(symbol.srcFile).replace(/\//g,'.');
+ //if (symbol.alias.substring(0, ns.length) == ns) {
+ // ns = '';
+ // }
+ //ns += ns.length ? '.' : '';
this.LOG.inform("classTemplate Process : " +
// make sure parent is loaded..
TokenStream = imports.TokenStream.TokenStream;
-
-/**
- *
- */
-
+
/**
* @scope JSDOC
* @class Collapse
toProps : function(ar)
{
- var ret = { }
+ var ret = { };
- var g = { key : '', val: [] }
+ var g = { key : '', val: [] };
var k = '';
// <script type="text/javascript">
/**
- * @scope JSDOC
- * @class CompressWhite
- *
+
* FIXME = need to class'ify this..
*
- *
- *
* pack a javascript file, and return a shorter version!
*
* a bit picky at present with ; and crlf reading...
- * @arg ts {TokenStream}
- @arg packer {Packer}
+ *
+ *
+ * @scope JSDOC.CompressWhite
+ * @function
+ * @arg {TokenStream} ts
+ * @arg {Packer} packer
*/
CompressWhite = function (ts, packer, keepWhite)
/**
* Create a new DocComment. This takes a raw documentation comment,
* and wraps it in useful accessors.
+ <PRE>
+Valid Comments are:
+
+Without arguments:
+ method
+ constant
+ constructor
+ static
+ singleton
+ inner
+ field
+ function
+ event
+ private
+ ignore
+ public
+
+With arguments:
+ author [name]
+ desc [description]
+ overview [description]
+ since [when]
+ version [name]
+ depricated [since]
+ example [followed by example..]
+ see [what]
+ class [description optional]
+ namespace [description optional]
+ param [{TYPE}] [name] [description]
+ name [name]
+ property [{type}] [name] description (i think)
+ cfg [{type}] [name] [description]
+ return [{type}] [description]
+ throws [{type}]
+ requires [what]
+ type [{type}] [description]
+ inherits [what]
+ augments [what]
+ default [value]
+ memberOf [what]
+
+
+ Notes:
+ a static class becomes a namespace..
+ for properties in the body of the class use type , rather than property,
+ property is normally used on the Class def header, rather than inline.
+
+ ignore - will stop the parser if it's in the global scope.
+
+ *
+ *
* @class Represents a documentation comment object.
* @scope JSDOC
*/
/**
* DocTag - represents a single A=b tag.
+ *
+ *
* @class DocTag
* @scope JSDOC
+ *
*/
//<Script type="text/javascript">
/**
- * @class Identifier
* holds details about identifiers and their replacement values
* used by the packer..
- * @scope JSDOC
+ *
+ * @class Identifier
+ * @scope JSDOC
+ * @param {String} name Name of the Identifier
+ * @param {JSDOC.Scope} scope The scope that the identifer is in.
*/
//<script type="text/javscript">
/**
-* @scope JSDOC
+* Language related methods (eg. what's a token...)
+*
+* @scope JSDOC
+* @class Lang
+* @static
*/
Lang = {
-//<script type="text/javascript">
-/**
- * Options management...
- * @scope JSDOC
- */
+
XObject = imports.XObject.XObject;
File = imports.File.File;
/**
* @class Options
* @static
+ * Options management...
+ * @scope JSDOC
+ * @ignore
+ *
+ * Deprecated at present..
*/
Options = {
/**
* @scope JSDOC.PrettyPrint
- * @function
+ * @static
* escape HTML, very basically
*/
function escapeHTML(str) {
replace(/"/g,'"');
};
/**
- * @function
+ * @static
* make a pretty HTML file out of a JS file, using the tokenizer.
*/
function toPretty(str)
/**
* @class ScopeNamer
- * @extends Collapse
+ * @extends JSDOC.Collapse
* @scope JSDOC
* The point of this class is to iterate through the Collapsed tree
* and add the property 'scopedName' to the tokens.
Symbol.srcFile = this.filename;
this.createJSDOC = true;
this.global = '_global_';
+ this.locals = this.locals || [];
// console.dump(ar);
},
debugCall : function(str) {
- //if (this.filename.match(/Scope\.js/)) return print(str);
+ // if (this.filename.match(/Date\.js/)) return print(str);
return;
},
this.statements = this.collapse(this.tokens);
//print(JSON.stringify(this.s, null,4));
}
-
+ //if (this.filename.match(/Roo\.js/)) print(JSON.stringify(this.statements, null,4));
//this.globalScope(this.statements);
this.debugCall("build Symbols");
//print (this.statements);
walkStatements: function(scope, statements)
{
- this.debugCall("walkStatements :" + scope ) ;
+ this.debugCall("walkStatements :" + scope + '@' + statements[0][0].line) ;
var _this = this;
var res = false;
var isGlobal = scope == this.global;
+
+
statements.some(function(st ) {
// handle change of scope..
if (isGlobal &&
st[0].jsdoc &&
st[0].jsdoc.getTag('scope').length
) {
- //print(st[0].jsdoc.getTag('scope'));
+
+
scope = st[0].jsdoc.getTag('scope');
// might be an array..
if (typeof(scope) != 'String') {
scope = scope[0].desc;
}
+ print("SCOPE CHANGE TO:" + scope);
_this.global = scope;
}
var name;
var sn;
+ var token = false;
- var isGlobal = scope == this.global;
+ var isGlobal = scope == this.global;
while (null != (token = this.next())) {
+
+ // var xx =
+
+
+
//'function'
//walkFunction(scope, name , args, stmts )
//
name = isGlobal ? this.lookTok(1).data : '';
this.walkFunctionDef(scope, name, this.lookTok(2).args, this.lookTok(3).items, token);
+ this.next();
+ this.next();
+ this.next();
continue;
}
//a = function() { } << scope might be a $this$={a}
this.walkFunctionDef(scope, name, this.lookTok(1).args, this.lookTok(2).items, this.lookTok(-2));
+ this.next();
+ this.next();
continue;
}
jsdoc = jsdoc || this.lookTok(-2).jsdoc;
}
this.walkCall(scope, assign, token.data, this.lookTok(1).items, jsdoc);
+ this.next();
+
continue;
}
// using @type {string} for example.
// FIXME - they should be registered as a property...
if (jd && jd.jsdoc && jd.jsdoc.getTag('type').length) {
-
- name = false;
+ //name = false;
+ //continue;
+ // wipe out the children..
+ token.props = false;
}
-
-
-
+ /*
+ print(JSON.stringify({
+ name : name,
+ isGlobal : isGlobal,
+ isVar : isVar
+ }, null,4));
+ */
if (!isGlobal) {
// not global.
if (isVar) {
+ if (name && this.locals.indexOf(name) < 0) {
+ this.locals.push(name);
+ }
name = false;
+ continue;
}
+ if (this.locals.indexOf(name) > -1 ) {
+ continue;
+ }
+
+
if (name && !name.match(/^this\./)) {
name = false;
}
if (name && name.match(/^this\./) ) {
// see if scope ends in prototype..
- print("SCOPE:" + JSON.stringify(scope));
+ //print("q" + JSON.stringify(scope));
if (
(scope.split('.').pop() == 'prototype') &&
(name.split('.').length == 2)
continue;
}
- // this.xxxx = (with jsdoc...)
+ // 'assignment..'
+ // it's done on the third element to enable object assignment to work above..
+ // a = .....
+ if (this.lookTok(-1).data == '=' && this.lookTok(-2).is('NAME')) {
+
+
+
+ // could be var x = ..
+ var jd = this.lookTok(-2).jsdoc ? this.lookTok(-2) : this.lookTok(-3);
+
+ var isVar = this.lookTok(-3).name == 'VAR';
+
+ // only register names of objects if
+ var name = this.lookTok(-2).data;
+
+ // some a = {} can be hidden
+ // using @type {string} for example.
+ // FIXME - they should be registered as a property...
+ if (jd && jd.jsdoc && jd.jsdoc.getTag('type').length) {
+
+ //name = false;
+ //continue;
+ // wipe out the children..
+ token.props = false;
+ }
+ /*
+ print(JSON.stringify({
+ name : name,
+ isGlobal : isGlobal,
+ isVar : isVar
+ }, null,4));
+ */
+
+ // skip imports.
+ if (token.data.match(/imports\./)) {
+ name = false;
+ }
+
+
+ if (!isGlobal) {
+ // not global.
+ if (isVar) {
+ if (name && this.locals.indexOf(name) < 0) {
+ this.locals.push(name);
+ }
+ name = false;
+ continue;
+ }
+ if (this.locals.indexOf(name) > -1 ) {
+ continue;
+ }
+
+ if (name && !name.match(/^this\./)) {
+ name = false;
+ }
+
+
+ if (name && name.match(/^this\./) ) {
+ // see if scope ends in prototype..
+ //print("SCOPE:" + JSON.stringify(scope));
+ if (
+ (scope.split('.').pop() == 'prototype') &&
+ (name.split('.').length == 2)
+ ){
+ name = name.split('.').pop();
+ } else {
+ name = false;
+ }
+
+ }
+
+ } else {
+ // should not happen...
+ if (name && name.match(/^this\./)) {
+ name = false;
+ }
+ }
+
+
+ if (name) {
+ var symbol = new Symbol( scope +'.'+ name , false , "PROPERTY" , jd.jsdoc);
+ symbol._token = this.lookTok(-2);
+
+ this.addSymbol(symbol, jd.jsdoc);
+ continue;
+ }
+
+
+
+ }
+ // TODO:
+ // this.xxxx = (with jsdoc...)
+
+
- // standard flow....
+ // standard flow... - ignore opening {.
if (token.data == '{') {
sn = new ScopeNamer(this);
//print("GOT { - walkings statuements;}");
continue; // object..!?!?!? = ignore ???
print(JSON.stringify(token,null,4));
}
+
+
+ //print ("GOT { = running walk statemengs on children?} @" + this.cursor);
sn.walkStatements(scope, token.items);
continue;
}
+ if (this.filename.match(/Roo\.js/) && token.data == '(') {
+ //print(JSON.stringify(token,null,4));
+
+ }
+ // ( function() {
+ if ((token.data == '(') && (token.items[0][0].data == 'function')) {
+ sn = new ScopeNamer(this);
+ sn.walkStatements('_private_', token.items[0][2].items);
+ continue;
+
+ }
+
+
+
}
+
+ this.debugCall("walkStatement (END):" + this.global +'/' +scope + '@' + this.tokens[0].line );
+
},
walkFunctionDef : function (inscope, name, args, stmts, jsdocTok)
this.addSymbol(symbol, jsdocTok.jsdoc);
}
var sn = new ScopeNamer(this);
- sn.walkStatements(scope, stmts);
+ sn.walkStatements(scope, stmts);
+ this.debugCall("wallkFuncDef: (END)" + inscope + '#' + name + '@' + this.look(0).line );
},
// or... x = somecall(BASE, { ... object..})
case 'XObject.extend':
case 'Roo.apply':
+ case 'Roo.applyIf':
//print(JSON.stringify(items,null,4));
// SHOULD WE ADD SCOPE HERE???
+
+ var arg0 = items[0][0].data;
+
var topscope = scope.split('.').pop();
- scope = (topscope == items[0][0].data) ?
- items[0][0].data :
- scope + '.' + items[0][0].data;
+ scope = (topscope == arg0) ? arg0 : scope + '.' + arg0;
+
+ // see if arg0 is defined has a symbol..
+ if (this.haveSymbol(arg0)) {
+ scope = arg0;
+ }
+
+
// 2nd arg is a object def
if (items[1][0].data != '{') {
return;
//print(JSON.stringify(items,null,4));
sn.walkObject(scope , false, items[1][0].props, jsdocTok );
-
+ this.debugCall("walkCall(END): " + inscope +':' + assign + '@' + this.look(0).line + ' ' + callname );
+
return;
sn.walkObject(scope + '.prototype', false, items[2][0].props );
+ this.debugCall("walkCall(END): " + inscope +':' + assign + '@' + this.look(0).line + ' ' + callname );
+
return;
}
-
+ this.debugCall("walkCall(END): " + inscope +':' + assign + '@' + this.look(0).line + ' ' + callname );
+
},
if (!items) {
return;
}
- print(typeof(items));
+ // our other scenario is where something is flagged as private, we will not investigate further
+ // we do add it however..
+ if (jsdocTok && jsdocTok.jsdoc && jsdocTok.jsdoc.getTag('private').length) {
+ return;
+ }
+
+ //print(typeof(items));
this.debugCall("wallkObject : " + scope + '#' + name + '@' + items[Object.keys(items)[0]].key.line);
for( var k in items) {
var key = items[k].key;
//if (this.conf.treatUnderscoredAsPrivate && symbol.name.match(/[.#-]_[^.#-]+$/)) {
// symbol.isPrivate = true;
//}
-
+ if (ScopeNamer.builder.treatUnderscoredAsPrivate && symbol.name.match(/[.#-]_[^.#-]+$/)) {
+ symbol.isPrivate = true;
+ }
// -p flag is required to document private things
- if ((symbol.isInner || symbol.isPrivate) && !this.docPrivate) return;
+ //if ((symbol.isInner || symbol.isPrivate) && !this.docPrivate) return;
// ignored things are not documented, this doesn't cascade
if (symbol.isIgnored) return;
ScopeNamer.symbols.addSymbol(symbol);
},
+
+ haveSymbol: function(name)
+ {
+ return ScopeNamer.symbols.hasSymbol(name);
+
+ },
+
addBuiltin : function(name) {
var builtin = new Symbol(name, [], "CONSTRUCTOR", new imports.DocComment.DocComment(""));
Scope = imports.Scope.Scope;
TokenStream = imports.TokenStream.TokenStream;
/**
-* This code now uses the collapsed tree
-* Used by packer to determine scope
+* This is the code that determines scope variables for the minifier.
+* it uses a collapsed tree.
*
* @class ScopeParser
-* @scope JSDOC
-*
+* @scope JSDOC
*
*/
if (namespaces.length) {
// scope for this file...
this.classDesc = namespaces[0].desc+"\n"+this.desc; // desc can't apply to the constructor as there is none.
+ if (!this.classDesc) {
+ this.classDesc = this.desc;
+ }
this.isNamespace = true;
}
if (this.comment.getTag("singleton").length) {
this.isStatic = true;
if (this.isa == "CONSTRUCTOR") {
- this.isNamespace = true;
+ this.isNamespace = true;
}
}
inherit : function(symbol) {
if (!this.hasMember(symbol.name) && !symbol.isInner) {
- if (symbol.is("FUNCTION"))
+ if (symbol.is("FUNCTION")) {
this.methods.push(symbol);
- else if (symbol.is("OBJECT"))
+ } else if (symbol.is("OBJECT") || symbol.is("PROPERTY") ) {
this.properties.push(symbol);
+ }
}
},
},
addMember : function(symbol) {
- //println("ADDMEMBER: " + this.name + " ++ " + symbol.name);
+ //print("ADDMEMBER: " + this.name + " + " + symbol.name);
if (this.is("FUNCTION")) {
this.isa = "OBJECT";
}
this.addMethod(symbol);
return true;
}
- if (symbol.is("OBJECT")) {
+ if (symbol.is("OBJECT") || symbol.is("PROPERTY") ) {
this.addProperty(symbol);
return true;
}
+ //print("addSomething?: " + JSON.stringify(symbol, null,4)); Seed.exit();
+
return false;
},
},
addProperty : function(symbol) {
+ //print("addProperty: " + this.name + " + " + symbol.name);
var propertyAlias = symbol.alias;
var thisProperties = this.properties;
for (var i = 0, l = thisProperties.length; i < l; i++) {
-//<script type="text/javascript">
-
XObject = imports.XObject.XObject;
DocComment = imports.DocComment.DocComment;
-// circular references..
-///Options = imports.BuildDocs.Options;
-//Parser = imports.Parser.Parser;
-//Symbol = imports.Symbol.Symbol;
+
/**
+ * The point of this class is to store and manage all the symbols
+ *
* @scope JSDOC
* @class ScopeSet
- * The point of this class is to store and manage all the symbols
+ *
*
*/
this.resolveMemberOf();
this.resolveAugments();
},
-
- resolveBorrows : function() {
+ /**
+ * Resolve borrows -
+ * = it reads 'inherits' loops thorugh it.. not sure yet what it does..
+ *
+ */
+ resolveBorrows : function()
+ {
for (p in this._index) {
var symbol = this._index[p];
}
}
},
-
- resolveMemberOf : function() {
+ /**
+ * puts all the properties, cfg, ??events and methods into the owning class.
+ *
+ *
+ */
+ resolveMemberOf : function()
+ {
for (var p in this._index) {
var symbol = this.getSymbol(p);
if (parts) {
symbol.memberOf = parts[1];
symbol.name = parts[2];
- }
- // like bar is a memberOf foo
- else {
+
+ // like bar is a memberOf foo
+ } else {
var joiner = symbol.memberOf.charAt(symbol.memberOf.length-1);
if (!/[.#-]/.test(joiner)) symbol.memberOf += ".";
symbol.isInner = false;
break;
- case '-' :
+ case '-' : // WTF is this about???
symbol.isStatic = false;
symbol.isInner = true;
break;
symbol.memberOf = symbol.memberOf.substr(0, symbol.memberOf.length-1);
}
- //print("looking for memberOf: " + symbol.memberOf + " FOR " + symbol.alias);
+ //print("looking for memberOf: " + symbol.memberOf + " FOR " + symbol.alias);
// add to parent's methods or properties list
if (symbol.memberOf) {
+
var container = this.getSymbol(symbol.memberOf);
if (!container) {
if (SymbolSet.isBuiltin(symbol.memberOf)) {
container = imports.ScopeNamer.ScopeNamer.addBuiltin(symbol.memberOf);
}
else {
- // print("symbol NOT a BUILT IN - createing a container");
+ print("symbol NOT a BUILT IN - createing a container " + symbol.memberOf);
// Eg. Ext.y.z (missing y)
// we need to add in the missing symbol...
- container = new imports.Symbol.Symbol(symbol.memberOf, [], "OBJECT", new DocComment(""));
- //container.isNamespace = true;
+ container = new imports.Symbol.Symbol(symbol.memberOf, [], "OBJECT",
+ new DocComment("@namespace " + symbol.memberOf));
+ container.isNamespace = true;
this.addSymbol( container );
+ if (container.addMember(symbol)) {
+ //print("DELETE (added to container..): " + container.alias + ' => ' + symbol.alias);
+ this.deleteSymbol(symbol.alias);
+ }
// print(container.toSource());
//container = this.getSymbol(symbol.memberOf);
// fake container ... so dont ad symbols to it..
continue;
- container = false;
+ //container = false;
//LOG.warn("Can't document "+symbol.name +" as a member of undocumented symbol "+symbol.memberOf+".");
//LOG.warn("We only have the following symbols: \n" +
// this.keys.toSource());
this.deleteSymbol(symbol.alias);
}
}
+ continue;
}
+
+ // not a member of.. let's log them...
+ print("NOT able to resolve memberOf: " + symbol.alias);
+
+
}
},
+
+ /**
+ * sort out inhertied stuff...
+ * a) calls buildAugmentsList to find out what this class extends.
+ * b) adds to symbol.inheritsFrom.
+ * c) calls sybmol.inherit / symbol.addConfig to each of the child props..
+ */
resolveAugments : function() {
// does this sort out multiple extends???
for (var p in this._index) {
this.buildAugmentsList(symbol); /// build heirachy of inheritance...
if (symbol.alias == "_global_" || symbol.is("FILE")) continue;
+ //print(JSON.stringify(symbol.augments, null, 4));
+
var augments = symbol.augments;
for(var ii = 0, il = augments.length; ii < il; ii++) {
var contributer = this.getSymbol(augments[ii]);
// imports.BuildDocs.Options.LOG.warn("Can't resolve augments: Circular reference: "+symbol.alias+" inherits from "+contributer.alias+" more than once.");
//}
//else {
- var cmethods = contributer.methods;
- var cproperties = contributer.properties;
- var cfgs = contributer.cfgs;
- for (var ci = 0, cl = cmethods.length; ci < cl; ci++) {
- symbol.inherit(cmethods[ci]);
- }
- for (var ci = 0, cl = cproperties.length; ci < cl; ci++) {
- symbol.inherit(cproperties[ci]);
- }
- for (var ci in cfgs) {
- symbol.addConfig(cfgs[ci]);
- }
-
+
+ var cmethods = contributer.methods;
+ var cproperties = contributer.properties;
+ var cfgs = contributer.cfgs;
+ for (var ci = 0, cl = cmethods.length; ci < cl; ci++) {
+ symbol.inherit(cmethods[ci]);
+ }
+ for (var ci = 0, cl = cproperties.length; ci < cl; ci++) {
+ symbol.inherit(cproperties[ci]);
+ }
+ for (var ci in cfgs) {
+ symbol.addConfig(cfgs[ci]);
+ }
+
//}
}
})
SymbolSet.isBuiltin = function(name) {
- return (SymbolSet.isBuiltin.coreObjects.indexOf(name) > -1);
+ return (SymbolSet.isBuiltin_coreObjects.indexOf(name) > -1);
}
// private
-SymbolSet.isBuiltin.coreObjects = [
+SymbolSet.isBuiltin_coreObjects = [
// '_global_',
'Array', 'Boolean', 'Date', 'Function',
'Math', 'Number', 'Object', 'RegExp', 'String'
];
-
-SymbolSet.LOG = false; // reference to parser ??? might not be needed..
\ No newline at end of file
+/**
+ * reference to parser ??? might not be needed..
+ */
+SymbolSet.LOG = false;
\ No newline at end of file
console = imports.console.console;
/**
- * @class Token
- * @scope JSDOC
- * @prop data {String} raw value of token
- * @prop type {String} type of token
+ *
+ * Token of a JS file eg. a keyword, identifier, punctionaion etc..
+ *
+ * <PRE>
+ * Token Types:
* TOKN (unknown) - name is UNKNOWN_TOKEN
*
* KEYW (keyword) - name is upper case version of keyword
* STRN (string) - name is DOBULE_QUOTE, SINGLE_QUOTE
* NUMB (number) - name is OCTAL,DECIMAL,HEC_DEC
* REGX (reg.expression) - name is REGX
- * @prop name {String} see type details above
- * @prop identifier {Identifier} identifier class if relivant
- *
*
*
* old mappings:
* Script.TOKassign = data == '='
* Script.TOKsemicolon data == '';
*
+ * </PRE>
*
- *
+ * @scope JSDOC
+ * @class Token
+ * @param {String} data raw value of token
+ * @param {String} type type of token
+ * @param {String} name see type details above
+ * @param {JSDOC.Identifier} identifier identifier class if relivant
*/
Token = XObject.define(
},
Object,
{
+ /** @type {String} The raw text of the token */
+ data : false,
+ /** @type {String} The type of the token */
+ type : false,
+ /** @type {String} name of the token (eg. "MULTI_LINE_COMM" ) - see table above */
+ name : false,
+ /** @type {Number} line the token occurs on. */
+ line : false,
+ /** @type {String} white or comment prefix for rebuilding source*/
+ prefix : false,
+ /** @type {String} used by packer/ scopeparser to store what is actually output for this */
+ outData : false,// used by packer/scopeparser
+ /** @type {String} the identifier refered to (mangled by packer) */
+ identifier : false, // used by scope
+ /** @type {Number} numberic identifier for token */
+ id : false,
+ /** @type {String} the comments that come before the token? (TBC) */
+ comment : false,
+ /** @type {JSDOC.DocTag} assigned in JSDOC.Compiler that relates to this token. */
+ jsdoc : false,
+
toString: function()
{
return 'line:' + this.line + ', type:' + this.type +
//Seed.print('(@' + n);
var lt = this.lastSym(tokens, n);
- Seed.print(JSON.stringify(lt));
+ //Seed.print(JSON.stringify(lt));
if (lt.type != 'KEYW' || ['IF', 'WHILE'].indexOf(lt.name) < -1) {
if (!this.ignoreBadGrammer) {
throw {
<for each="dtag" in="cfgProperties">
- <tr class="config-row expandable config-row-alt{+$dtag_i % 2+}{+ ((dtag.memberOf == data.alias) ? " notInherited" : "") +}">
+ <tr class="config-row expandable config-row-alt{+$dtag_i % 2+}{+ ((dtag.memberOf == data.alias) ? " not-inherited" : "") +}">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
/* if ( !$.isNamespace || (($.memberOf != data.alias) && $.isStatic)) {
if ($.isStatic) ownProperties.push($);
} */
+ /* config should not be listed in properties */
+ if (typeof(data.cfgs[$.name]) != 'undefined') {
+ return false;
+ }
+
ownProperties.push($);
return true;
<for each="member" in="ownProperties">
-
-
+
+
<tr class="property-row config-row-alt{+$member_i % 2+}{!
if (member.memberOf == data.alias) {
- output += " notInherited";
- }
-
- !}">
+ output += " not-inherited";
+ }
+ if (member.isPrivate) {
+ output += " is-private";
+ }
+ !}">
<td class="micon">
<a class="exi" href="#expand"> </a>
</td>
if (!member.isInherited) {
- output += " notInherited";
+ output += " not-inherited";
}
-
+ if (member.isPrivate) {
+ output += " is-private";
+ }
!}">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<tr class="method-row expandable config-row-alt{+$member_i % 2+}{!
if (member.memberOf == data.alias) {
- output += " notInherited";
+ output += " not-inherited";
}
!}">
margin-left: 10px;
}
+.is-private {
+ opacity: 0.5;
+ filter:alpha(opacity=50); /* For IE8 and earlier */
+
+}
+
.expandable td.micon a {
background:transparent url(http://devel.akbkhome.com/extjs/resources/images/default/tree/elbow-plus-nl.gif) no-repeat scroll 0px 0px;
cursor:pointer}
.config-row-alt0 {
background-color : #f8f8f8;
}
-.notInherited td.micon,
-.notInherited td.msource
+.not-inherited td.micon,
+.not-inherited td.msource
{
background-color: #fcc;