[introspection-doc-generator] More commits to sync working copy
- From: Alan Knowles <alank src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [introspection-doc-generator] More commits to sync working copy
- Date: Mon, 29 Mar 2010 14:27:00 +0000 (UTC)
commit 109b8349b9418a05e20e50ecede10bd80386b062
Author: Alan Knowles <alan akkbhome com>
Date: Mon Mar 29 22:26:03 2010 +0800
More commits to sync working copy
Sync with HEAD
JSDOC/Collapse.js | 385 ++++++++++++------------
JSDOC/GtkFile.js | 171 ++++++------
JSDOC/Introspect.js | 9 +-
JSDOC/Introspect/Base.js | 236 ++++++++--------
JSDOC/Introspect/Basic.js | 230 +++++++-------
JSDOC/Introspect/Callback.js | 56 ++--
JSDOC/Introspect/Class.js | 267 +++++++++---------
JSDOC/Introspect/Constant.js | 68 +++--
JSDOC/Introspect/Enum.js | 69 +++--
JSDOC/Introspect/Field.js | 31 +-
JSDOC/Introspect/Interface.js | 73 +++---
JSDOC/Introspect/Method.js | 239 ++++++++--------
JSDOC/Introspect/Property.js | 50 ++--
JSDOC/Introspect/Signal.js | 99 ++++---
JSDOC/Introspect/Struct.js | 91 +++---
JSDOC/Introspect/Union.js | 84 +++---
JSDOC/RooFile.js | 660 ++++++++++++++++++++--------------------
JSDOC/Template.js | 16 +-
JSDOC/Template/Link.js | 16 +-
JSDOC/TextStream.js | 6 +-
JSDOC/Token.js | 108 ++++----
JSDOC/TokenReader.js | 597 +++++++++++++++++++-------------------
JSDOC/TokenStream.js | 365 ++++++++++++-----------
23 files changed, 1976 insertions(+), 1950 deletions(-)
---
diff --git a/JSDOC/Collapse.js b/JSDOC/Collapse.js
index e3dae4d..e75d672 100644
--- a/JSDOC/Collapse.js
+++ b/JSDOC/Collapse.js
@@ -1,7 +1,8 @@
//<script type="text/javscript">
-JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
-console = imports['console.js'].console;
+imports['Object.js'].load(Object);
+
+JSDOC = imports['JSDOC.js'].JSDOC;
+console = imports['console.js'].console;
// make sure parent is loaded..
TokenStream = imports['JSDOC/TokenStream.js'].TokenStream;
@@ -29,215 +30,217 @@ TokenStream = imports['JSDOC/TokenStream.js'].TokenStream;
*
*
*/
-Collapse = function (ar)
-{
-
- Collapse.superclass.constructor.call(this, ar);
-
- this.spaces();
- var ar = this.collapse(this.tokens);
-
- this.tokens = ar;
-
- // console.dump(ar);
-
-}
-Roo.extend(Collapse, TokenStream, {
-
- spaces : function () {
- var ar = [];
- var pref = [];
+Collapse = Object.define(
+ function (ar)
+ {
+
+ Collapse.superclass.constructor.call(this, ar);
- var tok;
+ this.spaces();
+ var ar = this.collapse(this.tokens);
- for (var i = 0; i < this.tokens.length; i ++) {
- tok = this.tokens[i];
- if (tok.is("COMM") || tok.is("WHIT")) {
- pref.push(tok);
- continue;
- }
- tok.prefix = '';
- if (pref.length) {
- Roo.each(pref, function(e) {
- if (!e) {
- return;
- }
- tok.prefix += e.data;
- })
- }
-
- ar.push(tok);
- pref= [];
-
- }
this.tokens = ar;
- },
- collapse : function(ar) {
-
- var st = new TokenStream(ar);
- var ret = [];
+ // console.dump(ar);
- while (true) {
- var tok = st.look(1,true);
- if (!tok || !tok.is) {
- // Seed.print(TokenStream.toString(ret));
- return ret;
- }
- // console.log(tok.data);
- switch(tok.type) {
-
-
- case "KEYW":
- case "TOKN":
- case "NAME":
- case "STRN":
- case "NUMB":
- case "REGX":
- ret.push(st.next(1));
+ },
+ TokenStream,
+ {
+
+ spaces : function () {
+ var ar = [];
+ var pref = [];
+
+ var tok;
+
+ for (var i = 0; i < this.tokens.length; i ++) {
+ tok = this.tokens[i];
+ if (tok.is("COMM") || tok.is("WHIT")) {
+ pref.push(tok);
continue;
-
- case "PUNC":
- switch (tok.data) {
- case "[":
- case "{":
- case "(":
-
- var start = st.cursor;
- st.next(1);
- var add = st.balance(tok.name);
- if (!add) {
- console.dump(tok);
- console.dump(start + '...' + st.cursor);
- console.dump(st.tokens);
-
- }
- if (add) {
- add.shift();
- }
- //Seed.print(TokenStream.toString(aa));
-
-
- var toks = add ? this.collapse(add) : [];
- tok.items = false;
- tok.props = false;
-
- if (tok.data != '{') {
- // paramters or array elements..
- tok.items = this.toItems(toks, [',']);
- } else {
- // check for types.. it could be a list of statements.. or object
+ }
+ tok.prefix = '';
+ if (pref.length) {
+ Roo.each(pref, function(e) {
+ if (!e) {
+ return;
+ }
+ tok.prefix += e.data;
+ })
+ }
+
+ ar.push(tok);
+ pref= [];
+
+ }
+ this.tokens = ar;
+
+ },
+ collapse : function(ar) {
+
+ var st = new TokenStream(ar);
+ var ret = [];
+
+ while (true) {
+ var tok = st.look(1,true);
+ if (!tok || !tok.is) {
+ // Seed.print(TokenStream.toString(ret));
+ return ret;
+ }
+ // console.log(tok.data);
+ switch(tok.type) {
+
+
+ case "KEYW":
+ case "TOKN":
+ case "NAME":
+ case "STRN":
+ case "NUMB":
+ case "REGX":
+ ret.push(st.next(1));
+ continue;
+
+ case "PUNC":
+ switch (tok.data) {
+ case "[":
+ case "{":
+ case "(":
+
+ var start = st.cursor;
+ st.next(1);
+ var add = st.balance(tok.name);
+ if (!add) {
+ console.dump(tok);
+ console.dump(start + '...' + st.cursor);
+ console.dump(st.tokens);
+
+ }
+ if (add) {
+ add.shift();
+ }
+ //Seed.print(TokenStream.toString(aa));
- var ost = new TokenStream(toks);
- //console.dump(ost.look(2,true) );
- if (ost.look(2,true) && ost.look(2,true).data == ":") {
- tok.props = this.toProps(toks);
+
+ var toks = add ? this.collapse(add) : [];
+ tok.items = false;
+ tok.props = false;
+
+ if (tok.data != '{') {
+ // paramters or array elements..
+ tok.items = this.toItems(toks, [',']);
} else {
- // list of statemetns..
- tok.items = this.toItems(toks,[ ';', '{'] );;
+ // check for types.. it could be a list of statements.. or object
+
+ var ost = new TokenStream(toks);
+ //console.dump(ost.look(2,true) );
+ if (ost.look(2,true) && ost.look(2,true).data == ":") {
+ tok.props = this.toProps(toks);
+ } else {
+ // list of statemetns..
+ tok.items = this.toItems(toks,[ ';', '{'] );;
+ }
+
+
}
+
- }
-
-
-
-
-
-
-
- //Seed.print(" ADD : " + add.length + " ITEMS: " + tok.items.length);
-
- ret.push(tok);
-
- continue;
-
- default:
- ret.push(st.next(1));
- continue;
- }
- Seed.print("OOPS");
- continue;
- default :
- Seed.print("OOPS");
- continue;
+
+
+
+
+ //Seed.print(" ADD : " + add.length + " ITEMS: " + tok.items.length);
+
+ ret.push(tok);
+
+ continue;
+
+ default:
+ ret.push(st.next(1));
+ continue;
+ }
+ Seed.print("OOPS");
+ continue;
+ default :
+ Seed.print("OOPS");
+ continue;
+ }
}
- }
+
+
-
-
-
-
-
-
-
-
- },
- toItems : function(ar,sep)
- {
- var ret = [];
- var g = [];
-
- for (var i = 0; i < ar.length; i ++) {
- if (sep.indexOf(ar[i].data) < 0) {
+
+
+
+
+
+
+ },
+ toItems : function(ar,sep)
+ {
+ var ret = [];
+ var g = [];
+
+ for (var i = 0; i < ar.length; i ++) {
+ if (sep.indexOf(ar[i].data) < 0) {
+ g.push(ar[i]);
+ continue;
+ }
g.push(ar[i]);
- continue;
+ ret.push(g);
+ g = [];
+
+ }
+ // last..
+ if (g.length) {
+ ret.push(g);
}
- g.push(ar[i]);
- ret.push(g);
- g = [];
+ return ret;
- }
- // last..
- if (g.length) {
- ret.push(g);
- }
- return ret;
-
- },
- toProps : function(ar)
- {
-
- var ret = { }
-
- var g = { key : '', val: [] }
-
-
- var k = '';
- var state = 0;
- for (var i = 0; i < ar.length; i ++) {
-
- switch(state) {
- case 0:
- k = ar[i].data;
- g.key = ar[i];
- state = 1;
- continue;
- case 1:
- state =2; // should be ':'
- continue;
- case 2:
- g.val.push(ar[i]);
- if (ar[i].data != ',') {
- continue;
- }
- ret[k] = g;
- g = { key : '', val: [] }
- state = 0;
- continue;
+ },
+ toProps : function(ar)
+ {
+
+ var ret = { }
+ var g = { key : '', val: [] }
+
+
+ var k = '';
+ var state = 0;
+ for (var i = 0; i < ar.length; i ++) {
+
+ switch(state) {
+ case 0:
+ k = ar[i].data;
+ g.key = ar[i];
+ state = 1;
+ continue;
+ case 1:
+ state =2; // should be ':'
+ continue;
+ case 2:
+ g.val.push(ar[i]);
+ if (ar[i].data != ',') {
+ continue;
+ }
+ ret[k] = g;
+ g = { key : '', val: [] }
+ state = 0;
+ continue;
+
+ }
}
+ // last..
+ if (k.length) {
+ ret[k] = g;
+ }
+ return ret;
+
+
}
- // last..
- if (k.length) {
- ret[k] = g;
- }
- return ret;
-
-
- }
diff --git a/JSDOC/GtkFile.js b/JSDOC/GtkFile.js
index e020fc8..7ba0099 100644
--- a/JSDOC/GtkFile.js
+++ b/JSDOC/GtkFile.js
@@ -1,7 +1,8 @@
//<script type="text/javscript">
+imports['Object.js'].load(Object);
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+
console = imports['console.js'].console;
// make sure parent is loaded..
@@ -18,104 +19,106 @@ RooFile = imports['JSDOC/RooFile.js'].RooFile;
*
*/
-GtkFile = function (ar)
-{
- GtkFile.superclass.constructor.call(this, ar);
- // console.log("STARTING OUTPUT");
-
-
-}
-Roo.extend(GtkFile, RooFile, {
-
- cfg : { },
- giImports : [],
- imports : { },
- parse: function()
+GtkFile = Object.define(function (ar)
{
- // parse imports...
-
- this.parseImports();
- // function create() { return;
-
- var pos = this.lookFor( 'function');
-
-
- // standard create format.
-
- if (pos > -1 && this.tokens[pos+1].data == 'create') {
- var tree = this.tokens[pos+3].items[0][1].props;
- this.cfg= this.parseProps(tree);
- return;
- }
- GtkFile.superclass.parse.call(this);
-
-
-
+ GtkFile.superclass.constructor.call(this, ar);
+ // console.log("STARTING OUTPUT");
-
-
+
+ },
+ RooFile,
+ {
+ cfg : { },
+ giImports : [],
+ imports : { },
+ parse: function()
+ {
+ // parse imports...
- },
-
- parseImports : function()
- {
- // console.dump(this.tokens);
- this.giImports = [];
- while (true) {
- var pos = this.lookFor('=');
- if (pos < 0) {
- break;
- }
- this.cursor = pos;
- var k = this.look(-1, true);
- var v = this.look(1, true);
- // Seed.print(k.data + " => " + v.data);
-
- /// finish!!! - not an import ...
-
- if (!v.data.match(/^imports/)) {
- return; ///
+ this.parseImports();
+ // function create() { return;
- this.cursor++;
- continue;
+ var pos = this.lookFor( 'function');
+
+
+ // standard create format.
+
+ if (pos > -1 && this.tokens[pos+1].data == 'create') {
+ var tree = this.tokens[pos+3].items[0][1].props;
+ this.cfg= this.parseProps(tree);
+ return;
}
- if (v.data.match(/^imports\.gi/)) {
- // gi import..
- this.giImports.push(v.data.replace(/imports\.gi\./, ''));
+ GtkFile.superclass.parse.call(this);
+
+
+
+
+
+
+
+
+ },
+
+ parseImports : function()
+ {
+ // console.dump(this.tokens);
+ this.giImports = [];
+ while (true) {
+ var pos = this.lookFor('=');
+ if (pos < 0) {
+ break;
+ }
+ this.cursor = pos;
+ var k = this.look(-1, true);
+ var v = this.look(1, true);
+ // Seed.print(k.data + " => " + v.data);
+
+ /// finish!!! - not an import ...
+
+ if (!v.data.match(/^imports/)) {
+ return; ///
+
+ this.cursor++;
+ continue;
+ }
+ if (v.data.match(/^imports\.gi/)) {
+ // gi import..
+ this.giImports.push(v.data.replace(/imports\.gi\./, ''));
+
+ this.cursor++;
+ continue;
+ }
+
+ // two types of import left
+ // imports.xnew
+ if (v.data.match(/^imports\./)) {
+ this.imports[k.data] = v.data.replace(/imports\./, '') + '.js';
+ this.cursor++;
+ continue;
+ }
+ // imports[.....]
this.cursor++;
- continue;
- }
-
- // two types of import left
- // imports.xnew
- if (v.data.match(/^imports\./)) {
- this.imports[k.data] = v.data.replace(/imports\./, '') + '.js';
+ if (this.lookFor('[') > this.lookFor('=')) {
+ continue;
+ }
+ var bpos = this.lookFor('[');
+ // console.dump(this.tokens[bpos]);
+
+ this.imports[k.data] = this.tokens[bpos].items[0][0].toJS();
+
this.cursor++;
- continue;
- }
- // imports[.....]
- this.cursor++;
- if (this.lookFor('[') > this.lookFor('=')) {
- continue;
+
}
- var bpos = this.lookFor('[');
- // console.dump(this.tokens[bpos]);
-
- this.imports[k.data] = this.tokens[bpos].items[0][0].toJS();
-
- this.cursor++;
+ // console.dump(this.giImports);
+ // console.dump(this.imports);
+ //Seed.quit();
}
- // console.dump(this.giImports);
- // console.dump(this.imports);
- //Seed.quit();
- }
-
});
\ No newline at end of file
diff --git a/JSDOC/Introspect.js b/JSDOC/Introspect.js
index 28b0332..1e4a4ca 100644
--- a/JSDOC/Introspect.js
+++ b/JSDOC/Introspect.js
@@ -4,11 +4,12 @@ GI = imports.gi.GIRepository;
GLib = imports.gi.GLib;
xml = imports.libxml;
-//GObject = imports.gi.GObject;
+
+imports['Object.js'].load(Object);
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+
xnew = imports['xnew.js'].xnew;
@@ -20,7 +21,7 @@ xnew.load(Introspect,'JSDOC/Introspect');
-Roo.apply( Introspect, {
+Object.extend(Introspect, {
references : { },
@@ -268,7 +269,7 @@ Roo.apply( Introspect, {
return;
}
var doc = xml.parseFile(fn);
- console.log("xmldoc?" + doc);
+ //console.log("xmldoc?" + doc);
walk (doc.root, '');
//console.dump(ret);
this.comments[ns] = ret;
diff --git a/JSDOC/Introspect/Base.js b/JSDOC/Introspect/Base.js
index d64d3aa..39cfa76 100644
--- a/JSDOC/Introspect/Base.js
+++ b/JSDOC/Introspect/Base.js
@@ -5,11 +5,10 @@ GLib = imports.gi.GLib;
xml = imports.libxml;
//GObject = imports.gi.GObject;
+imports['Object.js'].load(Object);
+
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
-
-
Introspect = imports['JSDOC/Introspect.js'].Introspect;
Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
@@ -22,142 +21,143 @@ Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
-
-
-Base = function(ns, name) {
- // fake should not happen?
-
-
- if (typeof(name) == 'undefined') {
- var ar = ns.split('.');
- ns = ar[0];
- name = ar[1];
- }
- this.ns = ns;
- this.name = name;
- this.alias = ns + '.' + name;
- //console.log("CREATE(Base) " + this.alias);
- this._loaded = false;
-
-
- // reset all of these..
- this.signals = [];
- this.methods = [];
- this.constructors = [];
- this.functions= [];
-
- this.values = []; // for enum;g;
- this.constants = [];
-
- this.properties = [];
- this.implementInterfaces = []; // obect - which interface it implements.
- this.implementedBy = []; // interface - which object uses it.
- this.extendsClasses = []; // what it extends...
- this.childClasses = []; // what
- this.desc = Introspect.doc(this.alias );
-
-
-}
-Roo.extend(Base, Basic, {
- titleType: 'Unknown',
- name : '',
- ns : '',
-
- signals : [],
- methods : [],
- constructors : [],
- functions: [],
-
- values : [], // for enum
- constants : [],
-
- properties : [],
- implementInterfaces : [], // obect - which interface it implements.
- implementedBy : [], // interface - which object uses it.
- extendsClasses : [], // what it extends...
- childClasses : [], // what
-
-
-
-
- getBI : function() {
+
+Base = Object.define(
+ function(ns, name) {
+ // fake should not happen?
- var gi = GI.IRepository.get_default();
- return gi.find_by_name(this.ns, this.name);
- },
- // on, getwhat, simple list (name), variable to add to.
- genericBuildList : function( onwhat, type, keylist, saveto)
- {
- //console.log(this.alias +" - ADDING :" + type);
- //if (this[saveto].length) {
- // Seed.print( "EROROR = it's alreayd loaded why?");
- //throw "oops";
- // }
- var bb = this.getBI();
- var _this = this;
- //console.log("ADD " + type[0].toUpperCase() + type.substring(1));
- var cls = Introspect[type[0].toUpperCase() + type.substring(1)]; // ucfirst.
- if (!cls) {
- console.log("COULD NOT FIND Introspect: " + type[0].toUpperCase() + type.substring(1));
- }
-
- var plural = type + 's';
- plural = plural == 'propertys' ? 'properties' : plural;
+ if (typeof(name) == 'undefined') {
+ var ar = ns.split('.');
+ ns = ar[0];
+ name = ar[1];
+ }
+ this.ns = ns;
+ this.name = name;
+ this.alias = ns + '.' + name;
+ //console.log("CREATE(Base) " + this.alias);
+ this._loaded = false;
- for(var i =0; i < GI[onwhat + '_info_get_n_' + plural ](bb); i++) {
- var add= new cls(GI[onwhat + '_info_get_' + type ](bb,i), this, saveto, keylist);
- //console.log("CLS :" + this.alias + " EL: " + add.name);
- }
-
+ // reset all of these..
+ this.signals = [];
+ this.methods = [];
+ this.constructors = [];
+ this.functions= [];
+
+ this.values = []; // for enum;g;
+ this.constants = [];
+
+ this.properties = [];
+ this.implementInterfaces = []; // obect - which interface it implements.
+ this.implementedBy = []; // interface - which object uses it.
+ this.extendsClasses = []; // what it extends...
+ this.childClasses = []; // what
+ this.desc = Introspect.doc(this.alias );
- },
- // loop through and add stuff from extends..
- genericExtends : function( keylist, saveto)
+
+ },
+ Basic,
{
- // do not overlay gobject props or methods etc.
+ titleType: 'Unknown',
+ name : '',
+ ns : '',
+
+ signals : [],
+ methods : [],
+ constructors : [],
+ functions: [],
+
+ values : [], // for enum
+ constants : [],
- if (!this.extendsClasses.length) {
- return;
- }
- if (this.extendsClasses[0].alias == 'GObject.Object') {
- return;
- }
-
+ properties : [],
+ implementInterfaces : [], // obect - which interface it implements.
+ implementedBy : [], // interface - which object uses it.
+ extendsClasses : [], // what it extends...
+ childClasses : [], // what
- var _this = this;
- this.extendsClasses[0].load();
- Roo.each(this.extendsClasses[0][saveto], function(prop) {
- if (keylist.indexOf(prop.name) < 0) {
- _this[saveto].push(prop);
- keylist.push(prop.name);
- }
- },this);
- },
- // loop through and add stuff from implements..
- genericImplements : function( keylist, saveto) {
-
- var _this = this;
- Roo.each(this.implementInterfaces, function(iface) {
+
+ getBI : function() {
+
+ var gi = GI.IRepository.get_default();
+ return gi.find_by_name(this.ns, this.name);
+ },
+ // on, getwhat, simple list (name), variable to add to.
+ genericBuildList : function( onwhat, type, keylist, saveto)
+ {
- iface.load();
+ //console.log(this.alias +" - ADDING :" + type);
+ //if (this[saveto].length) {
+ // Seed.print( "EROROR = it's alreayd loaded why?");
+ //throw "oops";
+ // }
+ var bb = this.getBI();
+ var _this = this;
+ //console.log("ADD " + type[0].toUpperCase() + type.substring(1));
+ var cls = Introspect[type[0].toUpperCase() + type.substring(1)]; // ucfirst.
+ if (!cls) {
+ console.log("COULD NOT FIND Introspect: " + type[0].toUpperCase() + type.substring(1));
+ }
+
+ var plural = type + 's';
+ plural = plural == 'propertys' ? 'properties' : plural;
+
+
+ for(var i =0; i < GI[onwhat + '_info_get_n_' + plural ](bb); i++) {
+ var add= new cls(GI[onwhat + '_info_get_' + type ](bb,i), this, saveto, keylist);
+ //console.log("CLS :" + this.alias + " EL: " + add.name);
+ }
+
- Roo.each(iface[saveto], function(prop) {
+ },
+ // loop through and add stuff from extends..
+ genericExtends : function( keylist, saveto)
+ {
+ // do not overlay gobject props or methods etc.
+
+ if (!this.extendsClasses.length) {
+ return;
+ }
+ if (this.extendsClasses[0].alias == 'GObject.Object') {
+ return;
+ }
+
+
+ var _this = this;
+
+ this.extendsClasses[0].load();
+ this.extendsClasses[0][saveto].map(function(prop) {
if (keylist.indexOf(prop.name) < 0) {
_this[saveto].push(prop);
keylist.push(prop.name);
}
},this);
- }, this);
+ },
+ // loop through and add stuff from implements..
+ genericImplements : function( keylist, saveto) {
- },
+ var _this = this;
+ this.implementInterfaces.map(function(iface) {
+
+ iface.load();
+
+ iface[saveto].map( function(prop) {
+ if (keylist.indexOf(prop.name) < 0) {
+ _this[saveto].push(prop);
+ keylist.push(prop.name);
+ }
+ },this);
+
+ }, this);
+
+ },
+
-
});
diff --git a/JSDOC/Introspect/Basic.js b/JSDOC/Introspect/Basic.js
index 9a6a2fe..74b340d 100644
--- a/JSDOC/Introspect/Basic.js
+++ b/JSDOC/Introspect/Basic.js
@@ -4,12 +4,10 @@ GI = imports.gi.GIRepository;
GLib = imports.gi.GLib;
xml = imports.libxml;
//GObject = imports.gi.GObject;
+imports['Object.js'].load(Object);
-console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
-
-
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
Introspect = imports['JSDOC/Introspect.js'].Introspect;
@@ -19,132 +17,134 @@ Introspect = imports['JSDOC/Introspect.js'].Introspect;
*/
-Basic = function( ) {
- // never called?
-}
-Roo.apply(Basic.prototype, {
-
- typeToName : function (type_info) {
- var ty = GI.type_tag_to_string( GI.type_info_get_tag(type_info));
-
- if ((ty == 'void') && GI.type_info_is_pointer(type_info)) {
- return 'void*'; // it's a fake string?!?!!? - slightly naughty...
- }
- if (ty == 'array') {
- // array of what!?!?
- var param_type = GI.type_info_get_param_type (type_info, 0);
- var atype = GI.type_info_get_tag(param_type);
- if (atype == GI.ITypeTag.UINT8) {
- return 'utf8';
- }
-
-
- return ty;
- }
- if (ty != 'interface') {
- return ty;
- }
- var interface_info = GI.type_info_get_interface (type_info);
- var interface_type = GI.base_info_get_type (interface_info);
- if (interface_type == GI.IInfoType.CALLBACK) {
- // callback..
- var Callback = Introspect.Callback ;
- var ret= new Callback(interface_info, this, false, false);
- ret.alias = GI.base_info_get_namespace(interface_info) + '.' + GI.base_info_get_name(interface_info);
- return ret;
-
-
- }
-
- return GI.base_info_get_namespace(interface_info) + '.' + GI.base_info_get_name(interface_info);
-
+Basic = Object.define(
+ function( ) {
+ // never called?
},
-
- directions : [ "in", "out"," inout"],
-
- argsToArrays : function(m, returnArray)
+ Object,
{
- var outIntoReturn = false;
- if (returnArray && returnArray.length == 1 && returnArray[0].type == 'void') {
- outIntoReturn = true;
- }
+ typeToName : function (type_info) {
+ var ty = GI.type_tag_to_string( GI.type_info_get_tag(type_info));
+
+ if ((ty == 'void') && GI.type_info_is_pointer(type_info)) {
+ return 'void*'; // it's a fake string?!?!!? - slightly naughty...
+ }
+ if (ty == 'array') {
+ // array of what!?!?
+ var param_type = GI.type_info_get_param_type (type_info, 0);
+ var atype = GI.type_info_get_tag(param_type);
+ if (atype == GI.ITypeTag.UINT8) {
+ return 'utf8';
+ }
+
+
+ return ty;
+ }
+ if (ty != 'interface') {
+ return ty;
+ }
+ var interface_info = GI.type_info_get_interface (type_info);
+ var interface_type = GI.base_info_get_type (interface_info);
+ if (interface_type == GI.IInfoType.CALLBACK) {
+ // callback..
+ var Callback = Introspect.Callback ;
+ var ret= new Callback(interface_info, this, false, false);
+ ret.alias = GI.base_info_get_namespace(interface_info) + '.' + GI.base_info_get_name(interface_info);
+ return ret;
+
+
+ }
+
+ return GI.base_info_get_namespace(interface_info) + '.' + GI.base_info_get_name(interface_info);
+
+ },
- var outArg = {
- name : 'out_values',
- ns : '',
- type : 'Object',
- direction : 'out',
- be_null : true, // in theory..
- desc : "Return Object, use an empty Object, and the properties will get set as follows",
- properties : []
- };
+ directions : [ "in", "out"," inout"],
- var args = [];
- var firstOut = -1;
- for(var a_i =0; a_i < GI.callable_info_get_n_args(m); a_i++) {
- var arg = GI.callable_info_get_arg(m, a_i);
+ argsToArrays : function(m, returnArray)
+ {
- var direction = this.directions[GI.arg_info_get_direction(arg)];
+ var outIntoReturn = false;
+ if (returnArray && returnArray.length == 1 && returnArray[0].type == 'void') {
+ outIntoReturn = true;
+ }
- var add = {
- name : GI.base_info_get_name(arg),
- ns : GI.base_info_get_namespace(arg),
- type : this.typeToName(GI.arg_info_get_type(arg)),
- direction : direction,
- be_null : GI.arg_info_may_be_null(arg) || GI.arg_info_is_optional(arg),
- desc : GI.base_info_get_attribute(arg, 'doc') || ''
+ var outArg = {
+ name : 'out_values',
+ ns : '',
+ type : 'Object',
+ direction : 'out',
+ be_null : true, // in theory..
+ desc : "Return Object, use an empty Object, and the properties will get set as follows",
+ properties : []
};
-
- add.alias = add.ns + '.' + add.name;
-
- if (direction == 'out') {
- firstOut = firstOut > -1 ? firstOut : a_i;
- if (outIntoReturn) {
- returnArray.push(add);
- } else {
- outArg.properties.push(add);
+ var args = [];
+ var firstOut = -1;
+ for(var a_i =0; a_i < GI.callable_info_get_n_args(m); a_i++) {
+ var arg = GI.callable_info_get_arg(m, a_i);
+
+ var direction = this.directions[GI.arg_info_get_direction(arg)];
+
+ var add = {
+ name : GI.base_info_get_name(arg),
+ ns : GI.base_info_get_namespace(arg),
+ type : this.typeToName(GI.arg_info_get_type(arg)),
+ direction : direction,
+ be_null : GI.arg_info_may_be_null(arg) || GI.arg_info_is_optional(arg),
+ desc : GI.base_info_get_attribute(arg, 'doc') || ''
+ };
+
+
+ add.alias = add.ns + '.' + add.name;
+
+ if (direction == 'out') {
+ firstOut = firstOut > -1 ? firstOut : a_i;
+ if (outIntoReturn) {
+ returnArray.push(add);
+ } else {
+ outArg.properties.push(add);
+ }
}
+
+
+ args.push(add);
}
-
- args.push(add);
- }
-
- // drop all the 'out args from the end of args..
- if (returnArray) {
-
- while (true) {
- if (!args.length) {
+ // drop all the 'out args from the end of args..
+ if (returnArray) {
+
+ while (true) {
+ if (!args.length) {
+ break;
+ }
+ var l = args.pop(); // drop!
+ if (l.direction == 'out') {
+ // got an out arg..
+ continue;
+ }
+ args.push(l); // put it back in (it's not a out).
break;
+
}
- var l = args.pop(); // drop!
- if (l.direction == 'out') {
- // got an out arg..
- continue;
+ }
+ if (outArg.properties.length) {
+ // put the out arg in there...
+ if (firstOut >= args.length) {
+ args.push(outArg);
+ } else {
+ args[firstOut] = outArg;
}
- args.push(l); // put it back in (it's not a out).
- break;
-
}
- }
- if (outArg.properties.length) {
- // put the out arg in there...
- if (firstOut >= args.length) {
- args.push(outArg);
- } else {
- args[firstOut] = outArg;
+
+
+ // remove void return....
+
+ if (returnArray && returnArray.length > 1 && returnArray[0].type == 'void') {
+ returnArray.shift();
}
+
+ return args;
}
-
-
- // remove void return....
-
- if (returnArray && returnArray.length > 1 && returnArray[0].type == 'void') {
- returnArray.shift();
- }
-
- return args;
- }
});
diff --git a/JSDOC/Introspect/Callback.js b/JSDOC/Introspect/Callback.js
index 4146a09..143cf3a 100644
--- a/JSDOC/Introspect/Callback.js
+++ b/JSDOC/Introspect/Callback.js
@@ -4,42 +4,44 @@ GI = imports.gi.GIRepository;
GLib = imports.gi.GLib;
xml = imports.libxml;
//GObject = imports.gi.GObject;
+imports['Object.js'].load(Object);
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
-
Introspect = imports['JSDOC/Introspect.js'].Introspect;
Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
-Callback = function(sig, memberOf, saveto, keylist) {
+Callback = Object.define(
+ function(sig, memberOf, saveto, keylist) {
-
- var params = this.argsToArrays(sig);
- // add a reference to self...
- /*params.unshift({
- name : 'self',
- type : memberOf.alias,
- direction : 'in',
- be_null : false
+
+ var params = this.argsToArrays(sig);
+ // add a reference to self...
+ /*params.unshift({
+ name : 'self',
+ type : memberOf.alias,
+ direction : 'in',
+ be_null : false
+
+ });
+ */
+
+ Object.extend(this,{
+ name : GI.base_info_get_name(sig),
+ params : params,
+ //memberOf : memberOf.alias,
+ exceptions : [],
+ returns : [ { type : this.typeToName(GI.callable_info_get_return_type(sig)) } ]
- });
- */
-
- Roo.apply(this,{
- name : GI.base_info_get_name(sig),
- params : params,
- //memberOf : memberOf.alias,
- exceptions : [],
- returns : [ { type : this.typeToName(GI.callable_info_get_return_type(sig)) } ]
+ });
+ this.desc = Introspect.doc(memberOf.alias + '.' + this.name);
+ //memberOf[saveto].push(this);
+ //keylist.push(this.name);
- });
- this.desc = Introspect.doc(memberOf.alias + '.' + this.name);
- //memberOf[saveto].push(this);
- //keylist.push(this.name);
-
-}
-Roo.extend(Callback,Basic);
+ },
+ Basic,
+ {}
+);
diff --git a/JSDOC/Introspect/Class.js b/JSDOC/Introspect/Class.js
index 222ffdb..e134ba7 100644
--- a/JSDOC/Introspect/Class.js
+++ b/JSDOC/Introspect/Class.js
@@ -4,10 +4,11 @@ GI = imports.gi.GIRepository;
GLib = imports.gi.GLib;
xml = imports.libxml;
//GObject = imports.gi.GObject;
+imports['Object.js'].load(Object);
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
Base = imports['JSDOC/Introspect/Base.js'].Base;
@@ -22,155 +23,155 @@ Base = imports['JSDOC/Introspect/Base.js'].Base;
-Class = function(ns, name) {
- Base.call(this, ns, name);
- this.loadExtends();
- this.loadImplements();
- //console.log("CREATED(Class) " + this.alias);
-}
-
-
-Roo.extend(Class, Base, {
- titleType : 'Class',
-
- loadExtends : function()
- {
- var bi = this.getBI();
-
- var pi = GI.object_info_get_parent(bi);
- this.extendsClasses = [];
- if (!pi) {
- return;
- }
- this.parent = Introspect.factory(
- 'Class',
- GI.base_info_get_namespace(pi),
- GI.base_info_get_name(pi)
- );
-
- this.extendsClasses = [ this.parent ];
-
-
- Roo.each(this.parent.extendsClasses, function(p) {
- this.extendsClasses.push(p);
- },this);
-
-
-
+Class = Object.define(
+ function(ns, name) {
+ Base.call(this, ns, name);
+ this.loadExtends();
+ this.loadImplements();
+ //console.log("CREATED(Class) " + this.alias);
},
- loadImplements : function()
+ Base,
{
- var bb = this.getBI();
- this.implementInterfaces = [];
+ titleType : 'Class',
- var iflist = [];
- for(var i =0; i < GI.object_info_get_n_interfaces(bb); i++) {
-
- var prop = GI.object_info_get_interface(bb,i);
-
+ loadExtends : function()
+ {
+ var bi = this.getBI();
- var iface = Introspect.factory(
- 'Interface',
- GI.base_info_get_namespace(prop) , GI.base_info_get_name(prop)
+ var pi = GI.object_info_get_parent(bi);
+ this.extendsClasses = [];
+ if (!pi) {
+ return;
+ }
+ this.parent = Introspect.factory(
+ 'Class',
+ GI.base_info_get_namespace(pi),
+ GI.base_info_get_name(pi)
);
+ this.extendsClasses = [ this.parent ];
+
+
+ this.parent.extendsClasses.map(function(p) {
+ this.extendsClasses.push(p);
+ },this);
- if (iflist.indexOf(iface.alias) < 0) {
- //console.log("ADDING IFACE " + iface.alias);
- iflist.push(iface.alias);
- this.implementInterfaces.push(iface);
- }
- }
- // ask the first of the parents.. - which will have it loaded already
- if (this.extendsClasses.length) {
- //this.extendsClasses[0].loadImplements();
- Roo.each(this.extendsClasses[0].implementInterfaces, function(si) {
+ },
+ loadImplements : function()
+ {
+ var bb = this.getBI();
+ this.implementInterfaces = [];
+
+ var iflist = [];
+ for(var i =0; i < GI.object_info_get_n_interfaces(bb); i++) {
+
+ var prop = GI.object_info_get_interface(bb,i);
+
+
+ var iface = Introspect.factory(
+ 'Interface',
+ GI.base_info_get_namespace(prop) , GI.base_info_get_name(prop)
+ );
- if (iflist.indexOf(si.alias) < 0) {
- //console.log("From extends ("+ si.alias + ") IFACE " + si.alias);
- iflist.push(si.alias);
- this.implementInterfaces.push(si);
+
+ if (iflist.indexOf(iface.alias) < 0) {
+ //console.log("ADDING IFACE " + iface.alias);
+ iflist.push(iface.alias);
+ this.implementInterfaces.push(iface);
}
- },this);
-
- }
- //console.dump(iflist);
- if (this.alias == 'Atk.NoOpObject') {
- // throw "exut";
- }
- // console.dump(this.implementInterfaces);
- },
-
-
-
-
- load : function()
- {
- if (this._loaded) {
- return; // already loaded..
- }
-
- if (this.parent) { // load up parents first
- this.parent.load();
- }
- Roo.each(this.implementInterfaces, function(iface) {
- iface.load();
- });
+ }
+ // ask the first of the parents.. - which will have it loaded already
+ if (this.extendsClasses.length) {
+
+ //this.extendsClasses[0].loadImplements();
+
+ this.extendsClasses[0].implementInterfaces.map( function(si) {
+
+ if (iflist.indexOf(si.alias) < 0) {
+ //console.log("From extends ("+ si.alias + ") IFACE " + si.alias);
+ iflist.push(si.alias);
+ this.implementInterfaces.push(si);
+ }
+ },this);
+
+ }
+ //console.dump(iflist);
+ if (this.alias == 'Atk.NoOpObject') {
+ // throw "exut";
+ }
+ // console.dump(this.implementInterfaces);
+ },
- //console.log("load(Class) " + this.alias);
- // my props..
- var props = [];
- this.genericBuildList('object', 'property', props, 'properties');
- this.genericBuildList('object', 'field', props, 'properties');
-
- this.genericExtends( props, 'properties');
- this.genericImplements( props, 'properties');
-
- var signals = [];
- this.genericBuildList('object', 'signal', signals, 'signals');
- this.genericExtends( signals, 'signals');
- this.genericImplements( signals, 'signals');
- Introspect.references[this.alias] = Introspect.references[this.alias] || [];
- if (this.alias == 'GObject.Object') {
- this._loaded = true;
- return;
+ load : function()
+ {
+ if (this._loaded) {
+ return; // already loaded..
+ }
+
+ if (this.parent) { // load up parents first
+ this.parent.load();
+ }
+ this.implementInterfaces.map(function(iface) {
+ iface.load();
+ });
+
+
+ //console.log("load(Class) " + this.alias);
+ // my props..
+ var props = [];
+ this.genericBuildList('object', 'property', props, 'properties');
+ this.genericBuildList('object', 'field', props, 'properties');
+
+ this.genericExtends( props, 'properties');
+ this.genericImplements( props, 'properties');
+
+ var signals = [];
+ this.genericBuildList('object', 'signal', signals, 'signals');
+ this.genericExtends( signals, 'signals');
+ this.genericImplements( signals, 'signals');
+
+
+ Introspect.references[this.alias] = Introspect.references[this.alias] || [];
+ if (this.alias == 'GObject.Object') {
+ this._loaded = true;
+ return;
+ }
+
+
+ this.constructors.push({
+ name : '', // not really...
+ params: this.properties.length ? [ { type : 'Object', be_null : true, name : 'properties' } ] : [],
+ returns : [],
+ isConstructor : true,
+ isStatic : false,
+ memberOf : this.alias,
+ exceptions : [],
+ // in theory..
+ desc : ''
+ });
+
+
+ var methods = [];
+ this.genericBuildList('object', 'method', methods, 'methods');
+ // dont inherit functiosn or consturctors...
+
+ this.genericExtends( methods, 'methods');
+ this.genericImplements( methods, 'methods');
+
+
+
+ //console.log("loaded(Class) " + this.alias);
+
+ this._loaded = true;
}
-
-
- this.constructors.push({
- name : '', // not really...
- params: this.properties.length ? [ { type : 'Object', be_null : true, name : 'properties' } ] : [],
- returns : [],
- isConstructor : true,
- isStatic : false,
- memberOf : this.alias,
- exceptions : [],
- // in theory..
- desc : ''
- });
-
-
- var methods = [];
- this.genericBuildList('object', 'method', methods, 'methods');
- // dont inherit functiosn or consturctors...
-
- this.genericExtends( methods, 'methods');
- this.genericImplements( methods, 'methods');
+
+
- //console.log("loaded(Class) " + this.alias);
-
- this._loaded = true;
- }
-
-
-
-
-
});
diff --git a/JSDOC/Introspect/Constant.js b/JSDOC/Introspect/Constant.js
index 10502e0..f9558b2 100644
--- a/JSDOC/Introspect/Constant.js
+++ b/JSDOC/Introspect/Constant.js
@@ -3,11 +3,12 @@
GI = imports.gi.GIRepository;
GLib = imports.gi.GLib;
xml = imports.libxml;
-//GObject = imports.gi.GObject;
+
+imports['Object.js'].load(Object);
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
@@ -19,35 +20,36 @@ Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
*/
-Constant = function(prop, memberOf, saveto, keylist) {
-
- this.name = GI.base_info_get_name(prop);
- var tif = GI.constant_info_get_type(prop);
- var ty = GI.type_tag_to_string( GI.type_info_get_tag(tif));
- this.type = this.typeToName(GI.constant_info_get_type(prop));
-
- ///this.flags = GI.property_info_get_flags(prop),
-
-
- this.value= 'UNKNOWN';
-
-
- if (ty != 'interface') {
+Constant = Object.define(
+ function(prop, memberOf, saveto, keylist) {
+
+ this.name = GI.base_info_get_name(prop);
+ var tif = GI.constant_info_get_type(prop);
+ var ty = GI.type_tag_to_string( GI.type_info_get_tag(tif));
+ this.type = this.typeToName(GI.constant_info_get_type(prop));
+
+ ///this.flags = GI.property_info_get_flags(prop),
+
+
+ this.value= 'UNKNOWN';
+
+
+ if (ty != 'interface') {
+
+ var argm = new GI.Argument();
+ GI.constant_info_get_value ( prop ,argm);
+ if (ty != 'utf8') {
+ this.value = argm.v_long;
+ } else {
+ this.value = argm.v_string;
+ }
+ }
+
+ this.desc = Introspect.doc(memberOf.alias + '.' + this.name)
- var argm = new GI.Argument();
- GI.constant_info_get_value ( prop ,argm);
- if (ty != 'utf8') {
- this.value = argm.v_long;
- } else {
- this.value = argm.v_string;
- }
- }
-
- this.desc = Introspect.doc(memberOf.alias + '.' + this.name)
-
- memberOf[saveto].push(this);
- keylist.push(this.name);
-}
-
-
-Roo.extend(Constant,Basic);
+ memberOf[saveto].push(this);
+ keylist.push(this.name);
+ },
+ Basic,
+ { }
+);
diff --git a/JSDOC/Introspect/Enum.js b/JSDOC/Introspect/Enum.js
index e61ad08..dcdf1a6 100644
--- a/JSDOC/Introspect/Enum.js
+++ b/JSDOC/Introspect/Enum.js
@@ -3,11 +3,13 @@
GI = imports.gi.GIRepository;
GLib = imports.gi.GLib;
xml = imports.libxml;
-//GObject = imports.gi.GObject;
+
+
+imports['Object.js'].load(Object);
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
@@ -17,41 +19,42 @@ Base = imports['JSDOC/Introspect/Base.js'].Base;
-Enum = function(ns, name) {
- Base.call(this, ns, name);
-
-}
-Roo.extend(Enum, Base, {
- titleType: 'Enum',
- _loaded : false,
- load : function()
+Enum = Object.define(
+ function(ns, name) {
+ Base.call(this, ns, name);
+ },
+ Base,
{
- if (this._loaded) {
- return; // already loaded..
- }
-
- this.desc = Introspect.doc(this.alias);
- var bi = this.getBI();
+ titleType: 'Enum',
+ _loaded : false,
+ load : function()
+ {
+ if (this._loaded) {
+ return; // already loaded..
+ }
+
+ this.desc = Introspect.doc(this.alias);
+ var bi = this.getBI();
+
+ for(var i =0; i < GI.enum_info_get_n_values(bi); i++) {
+
+ var prop = GI.enum_info_get_value(bi,i);
+
+
+ this.values.push({
+ name : GI.base_info_get_name(prop).toUpperCase() ,
+ type : GI.type_tag_to_string(GI.enum_info_get_storage_type(bi)),
+ value: GI.value_info_get_value(prop) ,
+ memberOf : this.alias
+ });
+ }
+
+ this._loaded = true;
- for(var i =0; i < GI.enum_info_get_n_values(bi); i++) {
-
- var prop = GI.enum_info_get_value(bi,i);
-
- this.values.push({
- name : GI.base_info_get_name(prop).toUpperCase() ,
- type : GI.type_tag_to_string(GI.enum_info_get_storage_type(bi)),
- value: GI.value_info_get_value(prop) ,
- memberOf : this.alias
- });
+
+
}
-
- this._loaded = true;
-
-
-
-
- }
});
\ No newline at end of file
diff --git a/JSDOC/Introspect/Field.js b/JSDOC/Introspect/Field.js
index 5cdb607..ba22947 100644
--- a/JSDOC/Introspect/Field.js
+++ b/JSDOC/Introspect/Field.js
@@ -3,11 +3,11 @@
GI = imports.gi.GIRepository;
GLib = imports.gi.GLib;
xml = imports.libxml;
-//GObject = imports.gi.GObject;
+
+imports['Object.js'].load(Object);
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
Introspect = imports['JSDOC/Introspect.js'].Introspect;
@@ -18,16 +18,17 @@ Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
* Field
*/
-Field = function(prop, memberOf, saveto, keylist) {
-
- this.name = GI.base_info_get_name(prop) ,
- this.type = this.typeToName(GI.field_info_get_type(prop)),
- this.flags = GI.field_info_get_flags(prop),
- this.memberOf = memberOf.alias
- memberOf[saveto].push(this);
- keylist.push(this.name);
-
-}
-
-
-Roo.extend(Field,Basic);
+Field = Object.define(
+ function(prop, memberOf, saveto, keylist) {
+
+ this.name = GI.base_info_get_name(prop) ,
+ this.type = this.typeToName(GI.field_info_get_type(prop)),
+ this.flags = GI.field_info_get_flags(prop),
+ this.memberOf = memberOf.alias
+ memberOf[saveto].push(this);
+ keylist.push(this.name);
+
+ },
+ Basic,
+ {}
+);
diff --git a/JSDOC/Introspect/Interface.js b/JSDOC/Introspect/Interface.js
index faa1147..98727a9 100644
--- a/JSDOC/Introspect/Interface.js
+++ b/JSDOC/Introspect/Interface.js
@@ -1,13 +1,12 @@
//<script type="text/javascript">
//Gtk = imports.gi.Gtk;
-GI = imports.gi.GIRepository;
-GLib = imports.gi.GLib;
-xml = imports.libxml;
-//GObject = imports.gi.GObject;
+
+
+imports['Object.js'].load(Object);
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
Base = imports['JSDOC/Introspect/Base.js'].Base;
@@ -18,39 +17,41 @@ Base = imports['JSDOC/Introspect/Base.js'].Base;
* Interface
*/
-Interface = function(ns, name) {
- Base.call(this, ns, name);
-
-}
+Interface = Object.define(
+ function(ns, name) {
+ Base.call(this, ns, name);
+
+ },
-Roo.extend(Interface, Base, {
- titleType: 'Interface',
- _loaded : false,
- load : function()
+ Base,
{
- if (this._loaded) {
- return; // already loaded..
- }
- // my props..
- var props = [];
- this.genericBuildList('interface', 'property', props, 'properties');
-
-
- var signals = [];
- this.genericBuildList('interface', 'signal', signals, 'signals');
-
-
- var methods = [];
- this.genericBuildList('interface', 'method', methods, 'methods');
-
-
- Introspect.ifaceList[this.alias] = Introspect.ifaceList[this.alias] || [];
- this.implementedBy = Introspect.ifaceList[this.alias];
-
+ titleType: 'Interface',
+ _loaded : false,
+ load : function()
+ {
+ if (this._loaded) {
+ return; // already loaded..
+ }
+ // my props..
+ var props = [];
+ this.genericBuildList('interface', 'property', props, 'properties');
+
+
+ var signals = [];
+ this.genericBuildList('interface', 'signal', signals, 'signals');
-
- this._loaded = true;
- },
-
+
+ var methods = [];
+ this.genericBuildList('interface', 'method', methods, 'methods');
+
+
+ Introspect.ifaceList[this.alias] = Introspect.ifaceList[this.alias] || [];
+ this.implementedBy = Introspect.ifaceList[this.alias];
+
+
+
+ this._loaded = true;
+ },
+
});
diff --git a/JSDOC/Introspect/Method.js b/JSDOC/Introspect/Method.js
index 7014fef..5c51d6c 100644
--- a/JSDOC/Introspect/Method.js
+++ b/JSDOC/Introspect/Method.js
@@ -1,151 +1,150 @@
//<script type="text/javascript">
-//Gtk = imports.gi.Gtk;
+
GI = imports.gi.GIRepository;
-GLib = imports.gi.GLib;
-xml = imports.libxml;
-//GObject = imports.gi.GObject;
+
+
+imports['Object.js'].load(Object);
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
-
Introspect = imports['JSDOC/Introspect.js'].Introspect;
Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
/**
- * Methods, functiosn or consturctors
+ * Methods, functions or consturctors
*/
-Method = function(m, memberOf, saveto, keylist) {
- this.propertyType = 'Method';
-
- var flags = GI.function_info_get_flags (m);
- var n = GI.base_info_get_name(m);
- var n_original = n + '';
- // posibly add: sink,
- if (n.match(/_(ref|unref)$/) || n.match(/^(ref|unref|weakref|weakunref)$/)) {
- return false; // skip these!
- }
-
- if (n == 'new') {
- n = 'c_new';
- }
-
-
- var retval = [ {
- name : 0,
- type : this.typeToName(GI.callable_info_get_return_type(m)),
- desc : Introspect.doc(memberOf.alias + '.' + n_original + '.return-value')
- } ];
-
-
-
- var args = this.argsToArrays(m, retval);
-
-
- if ((n == 'c_new') && !args.length && memberOf.constructors.length) {
-
- memberOf.constructors[0].doc = Introspect.doc(memberOf.alias + '.' + n_original);
-
- return false; // skip.
- }
-
-
-
-
-
- //console.log(GI.base_info_get_name(m));
- // console.dump(GI.base_info_get_attribute(m, 'doc') );
-
- // this is a bit messy, as we probably loose the doc's on new..
-
-
- Roo.apply(this, {
- name : n,
- params: args,
- returns : retval,
- isConstructor : flags & GI.IFunctionInfoFlags.IS_CONSTRUCTOR,
- isStatic : !(flags & GI.IFunctionInfoFlags.IS_METHOD),
- memberOf : memberOf.alias,
- exceptions : [],
- desc : Introspect.doc(memberOf.alias + '.' + n_original)
- });
- // add descriptions to the arguments..
- Roo.each(this.params, function(p) {
-
-
- p.desc = Introspect.doc(memberOf.alias + '.' + n_original + '.' + p.name);
- //Seed.print(memberOf.alias + '.' + n_original + '.' + p.name + ':' + p.desc);
-
- });
-
-
- // collect references...
- var addedto = [ memberOf.alias ]; // do not add to self...
-
- for(var i =0; i < args.length;i++) {
- var ty = args[i].type;
- if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
- continue;
+Method = Object.define(
+ function(m, memberOf, saveto, keylist) {
+ this.propertyType = 'Method';
+
+ var flags = GI.function_info_get_flags (m);
+ var n = GI.base_info_get_name(m);
+ var n_original = n + '';
+ // posibly add: sink,
+ if (n.match(/_(ref|unref)$/) || n.match(/^(ref|unref|weakref|weakunref)$/)) {
+ return false; // skip these!
}
- if (addedto.indexOf(ty) > -1) {
- continue;
+
+ if (n == 'new') {
+ n = 'c_new';
}
+
+ var retval = [ {
+ name : 0,
+ type : this.typeToName(GI.callable_info_get_return_type(m)),
+ desc : Introspect.doc(memberOf.alias + '.' + n_original + '.return-value')
+ } ];
- Introspect.references[ty] = Introspect.references[ty] || [];
- Introspect.references[ty].push(this);
- addedto.push(ty);
- }
-
-
- // decide what to add to...
-
- if (this.isConstructor) {
- if (this.name.match(/^new_/)) {
- this.name = this.name.substring(4);
- }
+ var args = this.argsToArrays(m, retval);
- memberOf.constructors.push(this);
- return;
- }
- // return values = only applicable to non-constructors..
- for(var i =0; i < retval.length;i++) {
- var ty = retval[i].type;
- if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
- continue;
- }
- if (addedto.indexOf(ty) > -1) {
- continue;
+ if ((n == 'c_new') && !args.length && memberOf.constructors.length) {
+
+ memberOf.constructors[0].doc = Introspect.doc(memberOf.alias + '.' + n_original);
+
+ return false; // skip.
}
+
- Introspect.references[ty] = Introspect.references[ty] || [];
- Introspect.references[ty].push(this);
- addedto.push(ty);
- }
-
-
- if (this.isStatic) {
- memberOf.functions.push(this);
- return;
- }
+ //console.log(GI.base_info_get_name(m));
+ // console.dump(GI.base_info_get_attribute(m, 'doc') );
+
+ // this is a bit messy, as we probably loose the doc's on new..
+
+
+ Object.extend(this, {
+ name : n,
+ params: args,
+ returns : retval,
+ isConstructor : flags & GI.IFunctionInfoFlags.IS_CONSTRUCTOR,
+ isStatic : !(flags & GI.IFunctionInfoFlags.IS_METHOD),
+ memberOf : memberOf.alias,
+ exceptions : [],
+ desc : Introspect.doc(memberOf.alias + '.' + n_original)
+ });
+ // add descriptions to the arguments..
+ this.params.map(function(p) {
+
+
+ p.desc = Introspect.doc(memberOf.alias + '.' + n_original + '.' + p.name);
+ //Seed.print(memberOf.alias + '.' + n_original + '.' + p.name + ':' + p.desc);
+
+ });
+
+
+ // collect references...
+ var addedto = [ memberOf.alias ]; // do not add to self...
+
+ for(var i =0; i < args.length;i++) {
+ var ty = args[i].type;
+ if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
+ continue;
+ }
+ if (addedto.indexOf(ty) > -1) {
+ continue;
+ }
+
+
+
+ Introspect.references[ty] = Introspect.references[ty] || [];
+ Introspect.references[ty].push(this);
+ addedto.push(ty);
+ }
- memberOf.methods.push(this);
- keylist.push(this.name);
+ // decide what to add to...
+
+ if (this.isConstructor) {
+
+ if (this.name.match(/^new_/)) {
+ this.name = this.name.substring(4);
+ }
+
+
+ memberOf.constructors.push(this);
+ return;
+ }
+ // return values = only applicable to non-constructors..
+ for(var i =0; i < retval.length;i++) {
+ var ty = retval[i].type;
+ if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
+ continue;
+ }
+ if (addedto.indexOf(ty) > -1) {
+ continue;
+ }
+
+
+
+ Introspect.references[ty] = Introspect.references[ty] || [];
+ Introspect.references[ty].push(this);
+ addedto.push(ty);
+ }
-
-}
-
-
-Roo.extend(Method,Basic);
+ if (this.isStatic) {
+
+ memberOf.functions.push(this);
+ return;
+ }
+
+
+ memberOf.methods.push(this);
+ keylist.push(this.name);
+
+
+
+ },
+ Basic,
+ { }
+);
\ No newline at end of file
diff --git a/JSDOC/Introspect/Property.js b/JSDOC/Introspect/Property.js
index 96359ed..e6e92e3 100644
--- a/JSDOC/Introspect/Property.js
+++ b/JSDOC/Introspect/Property.js
@@ -1,13 +1,11 @@
//<script type="text/javascript">
//Gtk = imports.gi.Gtk;
GI = imports.gi.GIRepository;
-GLib = imports.gi.GLib;
-xml = imports.libxml;
-//GObject = imports.gi.GObject;
+
+imports['Object.js'].load(Object);
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
Introspect = imports['JSDOC/Introspect.js'].Introspect;
@@ -18,25 +16,25 @@ Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
* Property
*/
-Property = function(prop, memberOf, saveto, keylist) {
- this.propertyType = 'Property';
- var n_original = GI.base_info_get_name(prop);
- this.name = n_original.replace(/\-/g, '_') ,
- this.type = this.typeToName(GI.property_info_get_type(prop)),
- this.flags = GI.property_info_get_flags(prop),
- this.memberOf = memberOf.alias
- memberOf[saveto].push(this);
- keylist.push(this.name);
- this.desc = Introspect.doc(this.memberOf + '.' + n_original);
-
-
- if (typeof(this.type) == 'string' && this.type.indexOf('.') > -1) {
-
- Introspect.references[this.type] = Introspect.references[this.type] || [];
- Introspect.references[this.type].push(this);
- }
-
-}
-
-
-Roo.extend(Property,Basic);
+Property = Object.define(
+ function(prop, memberOf, saveto, keylist) {
+ this.propertyType = 'Property';
+ var n_original = GI.base_info_get_name(prop);
+ this.name = n_original.replace(/\-/g, '_') ,
+ this.type = this.typeToName(GI.property_info_get_type(prop)),
+ this.flags = GI.property_info_get_flags(prop),
+ this.memberOf = memberOf.alias
+ memberOf[saveto].push(this);
+ keylist.push(this.name);
+ this.desc = Introspect.doc(this.memberOf + '.' + n_original);
+
+
+ if (typeof(this.type) == 'string' && this.type.indexOf('.') > -1) {
+
+ Introspect.references[this.type] = Introspect.references[this.type] || [];
+ Introspect.references[this.type].push(this);
+ }
+
+ },
+ Basic
+);
diff --git a/JSDOC/Introspect/Signal.js b/JSDOC/Introspect/Signal.js
index a42f320..4d4b6b8 100644
--- a/JSDOC/Introspect/Signal.js
+++ b/JSDOC/Introspect/Signal.js
@@ -1,69 +1,72 @@
//<script type="text/javascript">
//Gtk = imports.gi.Gtk;
GI = imports.gi.GIRepository;
-GLib = imports.gi.GLib;
-xml = imports.libxml;
-//GObject = imports.gi.GObject;
+
+
+
+imports['Object.js'].load(Object);
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
-Signal = function(sig, memberOf, saveto, keylist) {
+Signal = Object.define(
+ function(sig, memberOf, saveto, keylist) {
- this.propertyType = 'Signal';
-
- var params = this.argsToArrays(sig);
- // add a reference to self...
- params.unshift({
- name : 'self',
- type : memberOf.alias,
- direction : 'in',
- be_null : false
+ this.propertyType = 'Signal';
+
+ var params = this.argsToArrays(sig);
+ // add a reference to self...
+ params.unshift({
+ name : 'self',
+ type : memberOf.alias,
+ direction : 'in',
+ be_null : false
+
+ });
+ var n_original = GI.base_info_get_name(sig);
+
+ Object.extend(this,{
+ name : n_original.replace(/-/g,'_'),
+ params : params,
+ memberOf : memberOf.alias,
+ exceptions : [],
+ returns : [ { type : this.typeToName(GI.callable_info_get_return_type(sig)) } ],
+ desc : Introspect.doc(memberOf.alias + '.' + n_original)
+ });
+ memberOf[saveto].push(this);
+ keylist.push(this.name);
+
+ var addedto = [ memberOf.alias ]; // do not add to self...
+
+ for(var i =1; i < params.length;i++) {
+ var ty = params[i].type;
+ if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
+ continue;
+ }
+ if (addedto.indexOf(ty) > -1) {
+ continue;
+ }
- });
- var n_original = GI.base_info_get_name(sig);
-
- Roo.apply(this,{
- name : n_original.replace(/-/g,'_'),
- params : params,
- memberOf : memberOf.alias,
- exceptions : [],
- returns : [ { type : this.typeToName(GI.callable_info_get_return_type(sig)) } ],
- desc : Introspect.doc(memberOf.alias + '.' + n_original)
- });
- memberOf[saveto].push(this);
- keylist.push(this.name);
-
- var addedto = [ memberOf.alias ]; // do not add to self...
-
- for(var i =1; i < params.length;i++) {
- var ty = params[i].type;
- if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
- continue;
- }
- if (addedto.indexOf(ty) > -1) {
- continue;
+
+
+ Introspect.references[ty] = Introspect.references[ty] || [];
+ Introspect.references[ty].push(this);
+ addedto.push(ty);
}
- Introspect.references[ty] = Introspect.references[ty] || [];
- Introspect.references[ty].push(this);
- addedto.push(ty);
- }
-
-
-
-
-
-}
-Roo.extend(Signal,Basic);
+
+
+ },
+ Basic
+);
diff --git a/JSDOC/Introspect/Struct.js b/JSDOC/Introspect/Struct.js
index 50be288..02a4362 100644
--- a/JSDOC/Introspect/Struct.js
+++ b/JSDOC/Introspect/Struct.js
@@ -1,13 +1,13 @@
//<script type="text/javascript">
-//Gtk = imports.gi.Gtk;
+
GI = imports.gi.GIRepository;
-GLib = imports.gi.GLib;
-xml = imports.libxml;
-//GObject = imports.gi.GObject;
+
+imports['Object.js'].load(Object);
+
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
@@ -16,48 +16,49 @@ Base = imports['JSDOC/Introspect/Base.js'].Base;
* Struct
*/
-Struct = function(ns, name) {
- Base.call(this, ns, name);
-
-}
-
-Roo.extend(Struct, Base,
-{
- titleType: 'Struct',
-
- _loaded : false,
- load : function()
+Struct = Object.define(
+ function(ns, name) {
+ Base.call(this, ns, name);
+
+ },
+
+ Base,
{
- if (this._loaded) {
- return; // already loaded..
- }
- // my props..
- var props = [];
- this.genericBuildList('struct', 'field', props, 'properties');
-
- var methods = [];
-
-
- if (GI.struct_info_get_size (this.getBI()) > 0 ) {
-
+ titleType: 'Struct',
+ _loaded : false,
+ load : function()
+ {
+ if (this._loaded) {
+ return; // already loaded..
+ }
+ // my props..
+ var props = [];
+ this.genericBuildList('struct', 'field', props, 'properties');
- this.constructors.push({
- name : '',
- params: [],
- returns : [],
- isConstructor : true,
- isStatic : false,
- memberOf : this.alias,
- exceptions : [],
- desc : ''
- });
- }
-
- this.genericBuildList('struct', 'method', methods, 'methods');
-
- this._loaded = true;
- },
-
+ var methods = [];
+
+
+ if (GI.struct_info_get_size (this.getBI()) > 0 ) {
+
+
+
+ this.constructors.push({
+ name : '',
+ params: [],
+ returns : [],
+ isConstructor : true,
+ isStatic : false,
+ memberOf : this.alias,
+ exceptions : [],
+ desc : ''
+ });
+ }
+
+ this.genericBuildList('struct', 'method', methods, 'methods');
+
+ this._loaded = true;
+ },
+
});
\ No newline at end of file
diff --git a/JSDOC/Introspect/Union.js b/JSDOC/Introspect/Union.js
index fd6f37a..c178f87 100644
--- a/JSDOC/Introspect/Union.js
+++ b/JSDOC/Introspect/Union.js
@@ -1,13 +1,13 @@
//<script type="text/javascript">
-//Gtk = imports.gi.Gtk;
+
GI = imports.gi.GIRepository;
-GLib = imports.gi.GLib;
-xml = imports.libxml;
-//GObject = imports.gi.GObject;
+
+imports['Object.js'].load(Object);
+
console = imports['console.js'].console;
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
Base = imports['JSDOC/Introspect/Base.js'].Base;
@@ -15,42 +15,44 @@ Base = imports['JSDOC/Introspect/Base.js'].Base;
/**
* Union
*/
-
-Union = function(ns, name) {
- Base.call(this, ns, name);
-
-}
-
-Roo.extend(Union, Base, {
- titleType: 'Union',
- _loaded : false,
- load : function()
+
+Union = Object.define(
+ function(ns, name) {
+ Base.call(this, ns, name);
+
+ },
+ Base,
{
- if (this._loaded) {
- return; // already loaded..
- }
- // my props..
- var props = [];
- this.genericBuildList('union', 'field', props, 'properties');
-
- if (GI.union_info_get_size (this.getBI()) > 0 ) {
+ titleType: 'Union',
+ _loaded : false,
+ load : function()
+ {
+ if (this._loaded) {
+ return; // already loaded..
+ }
+ // my props..
+ var props = [];
+ this.genericBuildList('union', 'field', props, 'properties');
- this.constructors.push({
- name : '',
- params: [],
- returns : [],
- isConstructor : true,
- isStatic : false,
- memberOf : this.alias,
- exceptions : [],
- desc : ''
- });
+ if (GI.union_info_get_size (this.getBI()) > 0 ) {
+
+ this.constructors.push({
+ name : '',
+ params: [],
+ returns : [],
+ isConstructor : true,
+ isStatic : false,
+ memberOf : this.alias,
+ exceptions : [],
+ desc : ''
+ });
+ }
+ var methods = [];
+ this.genericBuildList('union', 'method', methods, 'methods');
+
+ this._loaded = true;
}
- var methods = [];
- this.genericBuildList('union', 'method', methods, 'methods');
-
- this._loaded = true;
- },
-
-
-});
\ No newline at end of file
+
+
+});
+
\ No newline at end of file
diff --git a/JSDOC/RooFile.js b/JSDOC/RooFile.js
index 2a8e975..ce477c9 100644
--- a/JSDOC/RooFile.js
+++ b/JSDOC/RooFile.js
@@ -1,8 +1,8 @@
//<script type="text/javscript">
-JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
-console = imports['console.js'].console;
+imports['Object.js'].load(Object);
+JSDOC = imports['JSDOC.js'].JSDOC;
+console = imports['console.js'].console;
TokenStream = imports['JSDOC/TokenStream.js'].TokenStream;
/**
*
@@ -15,396 +15,396 @@ TokenStream = imports['JSDOC/TokenStream.js'].TokenStream;
*
*/
-RooFile = function (ar)
-{
- RooFile.superclass.constructor.call(this, ar);
- // console.log("STARTING OUTPUT");
-
-
-
-}
-
-Roo.extend(RooFile, TokenStream, {
-
- cfg : { },
+RooFile = Object.define(
+ function (ar)
+ {
+ RooFile.superclass.constructor.call(this, ar);
+ // console.log("STARTING OUTPUT");
+
+
- parse: function()
+ },
+ TokenStream,
{
- if (this.tokens[0].data == 'Pman.on') {
- // then it's a layout style..
-
- //Seed.quit();
-
+ cfg : { },
+
+ parse: function()
+ {
- //console.dump(this.tokens);
- // the list of statements inside of function..?
- var stmts = this.tokens[1].items[1][2].items;
- // look for register..
- var topp = false;
- Roo.each(stmts, function(s, i) {
- if (s[0].data == 'Pman.register') {
- topp = brace = s[1].items[0][0].props;
+ if (this.tokens[0].data == 'Pman.on') {
+ // then it's a layout style..
+
+ //Seed.quit();
+
+
+ //console.dump(this.tokens);
+ // the list of statements inside of function..?
+ var stmts = this.tokens[1].items[1][2].items;
+ // look for register..
+ var topp = false;
+ stmts.map( function(s, i) {
+ if (s[0].data == 'Pman.register') {
+ topp = brace = s[1].items[0][0].props;
+ }
+ });
+ if (!topp) {
+ console.dump(this.tokens);
+ throw "could not find top props...";
+
}
- });
- if (!topp) {
- console.dump(this.tokens);
- throw "could not find top props...";
+
+ this.cfg = this.parseProps(topp);
+ this.cfg.name = this.tokens[3].data;
+
+
+ // ( { add { this.panel ( {
+ var cfg = this.tokens[7].items[0][0].props.add.val[2].items[2][3].items[0][0].props;
+ this.cfg.items = [ this.parseProps(cfg) ];
+ // console.dump(this.cfg);
+
+ return;
+ }
+
+ if (this.tokens[2].props && typeof(this.tokens[2].props.create) != 'undefined') {
+ //console.dump(this.tokens);
+ this.cfg.name = this.tokens[0].data;
+
+
+
+ var cfg = this.tokens[2].props.create.val[2].items[1][3].items[0][0].props;
+ //console.dump(this.tokens);
+ this.cfg.items = [ this.parseProps(cfg) ];
}
+ // perfect for dialogs...
- this.cfg = this.parseProps(topp);
- this.cfg.name = this.tokens[3].data;
+ var pos = this.lookFor( 'function');
- // ( { add { this.panel ( {
- var cfg = this.tokens[7].items[0][0].props.add.val[2].items[2][3].items[0][0].props;
- this.cfg.items = [ this.parseProps(cfg) ];
- // console.dump(this.cfg);
+ // XXXXX = function(
+ var cfg = {};
- return;
- }
-
- if (this.tokens[2].props && typeof(this.tokens[2].props.create) != 'undefined') {
- //console.dump(this.tokens);
- this.cfg.name = this.tokens[0].data;
+ if (pos > -1 && (this.tokens[pos-1].data == '=') && (this.tokens[pos-2].type == 'NAME')) {
+
+ this.cfg = {
+ '*class' : this.tokens[pos-2].data,
+ '*extends' : '',
+ '//constructor' : this.tokens[pos-2].prefix,
+ '|constructor' : 'function ' + this.tokens[pos+1].toRaw() +
+ this.tokens[pos+2].toRaw(),
+
+ };
+ this.cursor = pos+2;
+
+ }
+ if (pos < 0) {
+ // no function - we have a static one...
+ pos = this.lookFor( '=');
+ if (pos > 1 &&
+ (this.tokens[pos-1].type == 'NAME') &&
+ (this.tokens[pos+1].data == '{')
+ ) {
+ this.cfg = {
+ '*class' : this.tokens[pos-1].data,
+ '//*class' : this.tokens[pos-1].prefix,
+
+
+ };
+ Object.extend(this.cfg, this.parseProps(this.tokens[pos+1].props));
+ return;
+
+ }
+
+
+
+ }
- var cfg = this.tokens[2].props.create.val[2].items[1][3].items[0][0].props;
+ // Roo.apply (l
+ var pos = this.lookFor( 'Roo.apply');
//console.dump(this.tokens);
- this.cfg.items = [ this.parseProps(cfg) ];
- }
- // perfect for dialogs...
-
-
- var pos = this.lookFor( 'function');
-
- // XXXXX = function(
- var cfg = {};
-
- if (pos > -1 && (this.tokens[pos-1].data == '=') && (this.tokens[pos-2].type == 'NAME')) {
- this.cfg = {
- '*class' : this.tokens[pos-2].data,
- '*extends' : '',
- '//constructor' : this.tokens[pos-2].prefix,
- '|constructor' : 'function ' + this.tokens[pos+1].toRaw() +
- this.tokens[pos+2].toRaw(),
+ if (
+ (pos > -1) &&
+ (this.tokens[pos+1].items[0][0].data == this.cfg['*class'] + '.prototype')
+ ) {
+ // XXXXXx.prototype = {
+
+
+
+ Object.extend(this.cfg, this.parseProps(this.tokens[pos+1].items[1][0].props));
+ return;
- };
- this.cursor = pos+2;
+ }
- }
-
- if (pos < 0) {
- // no function - we have a static one...
- pos = this.lookFor( '=');
- if (pos > 1 &&
- (this.tokens[pos-1].type == 'NAME') &&
- (this.tokens[pos+1].data == '{')
+
+ var pos = this.lookFor('new');
+
+ if (pos > -1 &&
+ (this.tokens[pos-2].type == 'NAME') &&
+ (this.tokens[pos-1].data == '=') &&
+ (this.tokens[pos+1].type == 'NAME') &&
+ (this.tokens[pos+2].data == '(')
) {
+
this.cfg = {
- '*class' : this.tokens[pos-1].data,
- '//*class' : this.tokens[pos-1].prefix,
-
-
+ '//*class' : this.tokens[pos-2].prefix,
+ '*class' : this.tokens[pos-2].data,
+ '*extends' : this.tokens[pos+1].data
};
- Roo.apply(this.cfg, this.parseProps(this.tokens[pos+1].props));
+
+ Object.extend(this.cfg, this.parseProps(this.tokens[pos+2].items[0][0].props));
+
return;
}
+ ///Builder.Provider.ProjectManager = new Roo.Observable({
+
- }
-
-
- // Roo.apply (l
- var pos = this.lookFor( 'Roo.apply');
- //console.dump(this.tokens);
-
-
- if (
- (pos > -1) &&
- (this.tokens[pos+1].items[0][0].data == this.cfg['*class'] + '.prototype')
- ) {
- // XXXXXx.prototype = {
-
-
+ var pos = this.lookFor( 'Roo.extend');
+ if (pos > -1) {
- Roo.apply(this.cfg, this.parseProps(this.tokens[pos+1].items[1][0].props));
- return;
-
- }
-
-
- var pos = this.lookFor('new');
-
- if (pos > -1 &&
- (this.tokens[pos-2].type == 'NAME') &&
- (this.tokens[pos-1].data == '=') &&
- (this.tokens[pos+1].type == 'NAME') &&
- (this.tokens[pos+2].data == '(')
- ) {
+ this.cfg['*extends'] = this.tokens[pos+1].items[1][0].data;
+ Object.extend(this.cfg, this.parseProps(this.tokens[pos+1].items[2][0].props));
+
+ // no more..
+ return;
+ }
- this.cfg = {
- '//*class' : this.tokens[pos-2].prefix,
- '*class' : this.tokens[pos-2].data,
- '*extends' : this.tokens[pos+1].data
- };
+
- Roo.apply(this.cfg, this.parseProps(this.tokens[pos+2].items[0][0].props));
+ var pos = this.lookFor( 'Roo.extend');
+ if (pos > -1) {
+
+ this.cfg['*extends'] = this.tokens[pos+1].items[1][0].data;
+ Object.extend(this.cfg, this.parseProps(this.tokens[pos+1].items[2][0].props));
+
+ // no more..
+ return;
+ }
- return;
- }
-
- ///Builder.Provider.ProjectManager = new Roo.Observable({
-
-
- var pos = this.lookFor( 'Roo.extend');
- if (pos > -1) {
+ //console.dump(cfg);
+ //Seed.quit();
- this.cfg['*extends'] = this.tokens[pos+1].items[1][0].data;
- Roo.apply(this.cfg, this.parseProps(this.tokens[pos+1].items[2][0].props));
- // no more..
- return;
- }
-
-
- var pos = this.lookFor( 'Roo.extend');
- if (pos > -1) {
+ // other type of layout
+ // console.dump(this.tokens);
- this.cfg['*extends'] = this.tokens[pos+1].items[1][0].data;
- Roo.apply(this.cfg, this.parseProps(this.tokens[pos+1].items[2][0].props));
+ // this type of file..
+ // xxxx.xxx = function
+ // -> into |constructor..
+ // -> extend + prototype
+
- // no more..
- return;
- }
-
-
-
- //console.dump(cfg);
- //Seed.quit();
-
-
-
- // other type of layout
- // console.dump(this.tokens);
-
- // this type of file..
- // xxxx.xxx = function
- // -> into |constructor..
- // -> extend + prototype
-
-
-
-
- },
-
- parseProps: function(o)
- {
- var ret = { };
- var fakeItems = [];
- for(var k in o) {
-
-
- if (o[k].key.data == '}') {
- // typo trailing comma in object def.
- continue;
- }
- var kv = k;
- if (o[k].key.type == 'STRN') {
- kv = o[k].key.toJS();
- }
- if (!o[k].val.length) {
- console.dump(o[k]);
- }
- //console.dump(o[k]);
- if (o[k].val[0].data == "function") {
- // add comments..
- // console.dump(o[k].key.prefix);
- var pr = typeof(o[k].key.prefix) == 'undefined' ? '' : o[k].key.prefix ;
- pr = this.clean_prefix( pr) ;
- if (pr.length) {
- ret['//' +kv ] = pr;
- }
- ret['|' +kv ] = this.clean_body( this.expand(o[k].val));
- continue;
- }
- if (o[k].val[0].data == "[") {
+ },
+
+ parseProps: function(o)
+ {
+ var ret = { };
+ var fakeItems = [];
+ for(var k in o) {
- if (o[k].val[0].items[0][0].data == '{') {
- // array of objects..
+
+ if (o[k].key.data == '}') {
+ // typo trailing comma in object def.
+ continue;
+ }
+
+ var kv = k;
+ if (o[k].key.type == 'STRN') {
+ kv = o[k].key.toJS();
+ }
+ if (!o[k].val.length) {
+ console.dump(o[k]);
+ }
+ //console.dump(o[k]);
+ if (o[k].val[0].data == "function") {
+ // add comments..
+ // console.dump(o[k].key.prefix);
+ var pr = typeof(o[k].key.prefix) == 'undefined' ? '' : o[k].key.prefix ;
+ pr = this.clean_prefix( pr) ;
+ if (pr.length) {
+ ret['//' +kv ] = pr;
+ }
- // this works for items..
+ ret['|' +kv ] = this.clean_body( this.expand(o[k].val));
+ continue;
+ }
+ if (o[k].val[0].data == "[") {
- // used elsewhere for buttons: -> in which case we have a fake xtype
+ if (o[k].val[0].items[0][0].data == '{') {
+ // array of objects..
+
+ // this works for items..
+
+ // used elsewhere for buttons: -> in which case we have a fake xtype
+
+
+
+ // if K is not ITEMS - we need to add '*prop' -> and add it to the items array..
+ var add = this.parseArray(o[k].val[0].items);
+ if (kv == 'items') {
+ ret[kv] = add;
+ continue;
+ }
+ var fake_array = {
+ xtype : 'Array.' + kv,
+ '*prop' : kv,
+ items : add
+ }
+ fakeItems.push(fake_array);
+ continue;
+ }
+ // raw array
+ ret['|' +kv ] = this.clean_body(this.expand(o[k].val)); // remove ','...
+ continue;
+ }
+ if (o[k].val[0].data == "(") {
+ ret['|' +kv ] = this.expand(o[k].val);
+ continue;
+ }
+ if (o[k].val[0].data == "{") {
- // if K is not ITEMS - we need to add '*prop' -> and add it to the items array..
- var add = this.parseArray(o[k].val[0].items);
- if (kv == 'items') {
- ret[kv] = add;
+ // things that can be property of object type:
+ // listeners, set,
+ var add = this.parseProps(o[k].val[0].props);
+ if (kv == 'set' || kv =='listeners') {
+ ret[kv ] = add;
continue;
}
- var fake_array = {
- xtype : 'Array.' + kv,
- '*prop' : kv,
- items : add
+ if ((typeof(add.xtype) != 'undefined') || ['sortInfo', 'center', 'east', 'west', 'north', 'south'].indexOf(kv) > -1) {
+ add['*prop'] = kv;
+ fakeItems.push(add);
+ continue;
}
- fakeItems.push(fake_array);
- continue;
- }
- // raw array
-
-
- ret['|' +kv ] = this.clean_body(this.expand(o[k].val)); // remove ','...
- continue;
- }
- if (o[k].val[0].data == "(") {
- ret['|' +kv ] = this.expand(o[k].val);
- continue;
- }
- if (o[k].val[0].data == "{") {
-
- // things that can be property of object type:
- // listeners, set,
- var add = this.parseProps(o[k].val[0].props);
- if (kv == 'set' || kv =='listeners') {
- ret[kv ] = add;
- continue;
- }
- if ((typeof(add.xtype) != 'undefined') || ['sortInfo', 'center', 'east', 'west', 'north', 'south'].indexOf(kv) > -1) {
- add['*prop'] = kv;
- fakeItems.push(add);
+
+
+ ret[ '|' + kv ] = this.expand(o[k].val);
+
+
+ // this hsould be added to 'items', with a *prop element..
continue;
}
+ //console.dump(o[k].val);
-
+ if (o[k].val[1].data == ',' || o[k].val[1].data == '}') {
+ // single item piece of data...
+ var t1= o[k].val[0];
+ switch(o[k].val[0].type) {
+ case 'STRN':
+ case 'NUMB':
+ case 'KEYW':
+ ret[ kv ] = t1.toJS();
+ continue;
+ case 'NAME':
+ ret[ '|' + kv ] = t1.data;
+ continue;
+
+ }
+ }
+
ret[ '|' + kv ] = this.expand(o[k].val);
-
- // this hsould be added to 'items', with a *prop element..
- continue;
}
- //console.dump(o[k].val);
-
- if (o[k].val[1].data == ',' || o[k].val[1].data == '}') {
- // single item piece of data...
- var t1= o[k].val[0];
- switch(o[k].val[0].type) {
- case 'STRN':
- case 'NUMB':
- case 'KEYW':
- ret[ kv ] = t1.toJS();
- continue;
- case 'NAME':
- ret[ '|' + kv ] = t1.data;
- continue;
-
- }
+ if (!ret.items && fakeItems.length) {
+ ret.items = [];
}
+ Object.extend(fakeItems, function(e) {
+ ret.items.push(e);
+ })
+ // merge fakeItems;
+ //console.dump(ret);
+
+ return ret;
+ },
+ parseArray: function(ar) {
+ // console.dump(ar);
+ // Seed.quit();
+ var ret = [];
+ ar.map(function (e) {
+ // has no props...
+ if (typeof(e[0].props) == 'undefined') {
+ return;
+ }
+
+
+ ret.push( this.parseProps(e[0].props));
+
+ },this);
+
+ return ret;
+
+ },
+
+
+ expand: function(ar)
+ {
+ var ret = '';
- ret[ '|' + kv ] = this.expand(o[k].val);
-
- }
- if (!ret.items && fakeItems.length) {
- ret.items = [];
- }
- Roo.each(fakeItems, function(e) {
- ret.items.push(e);
- })
- // merge fakeItems;
- //console.dump(ret);
-
- return ret;
- },
- parseArray: function(ar) {
- // console.dump(ar);
- // Seed.quit();
- var ret = [];
- Roo.each(ar, function (e) {
- // has no props...
- if (typeof(e[0].props) == 'undefined') {
- return;
+
+ for(var i =0 ; i < ar.length -1; i++) {
+ ret += ar[i].toRaw();
}
+
+
+ return ret;
- ret.push( this.parseProps(e[0].props));
-
- },this);
-
- return ret;
-
- },
-
-
- expand: function(ar)
- {
- var ret = '';
-
-
- for(var i =0 ; i < ar.length -1; i++) {
- ret += ar[i].toRaw();
- }
-
-
-
- return ret;
-
-
- },
- clean_body : function(str)
- {
- var lns = str.split("\n");
- var mindent = -1;
- Roo.each(lns, function(l, i) {
- if (!i || !l.length || l.match(/^\s+$/)) {
- return;
- }
- var spc = l.match(/\s+/);
- if (!spc || !spc[0].length) {
- return;
+ },
+ clean_body : function(str)
+ {
+ var lns = str.split("\n");
+ var mindent = -1;
+ lns.map( function(l, i) {
+ if (!i || !l.length || l.match(/^\s+$/)) {
+ return;
+ }
+
+ var spc = l.match(/\s+/);
+ if (!spc || !spc[0].length) {
+ return;
+ }
+ mindent = mindent < 0 ? spc[0].length : Math.min(spc[0].length, mindent);
+
+ });
+ //console.log(mindent + ":" + lns[0]);
+ var ar = [];
+ if (mindent < 0) {
+ return str;
}
- mindent = mindent < 0 ? spc[0].length : Math.min(spc[0].length, mindent);
-
- });
- //console.log(mindent + ":" + lns[0]);
- var ar = [];
- if (mindent < 0) {
- return str;
- }
- Roo.each(lns, function(l,i) {
- if (!i) {
- ar.push(l.replace(/^\s+/, ''));
- return;
+ lns.map( function(l,i) {
+ if (!i) {
+ ar.push(l.replace(/^\s+/, ''));
+ return;
+ }
+ ar.push(l.substring(mindent));
+ });
+ return ar.join("\n");
+ },
+ clean_prefix: function(str) {
+
+
+
+ if (!str.length) {
+ return '';
}
- ar.push(l.substring(mindent));
- });
- return ar.join("\n");
- },
- clean_prefix: function(str) {
-
-
-
- if (!str.length) {
- return '';
- }
- var ret = str.replace(/^\s+/gm, "\n").replace(/\n+/gm, "\n");
- return ret == "\n" ? '' : ret;
-
- }
-
-
+ var ret = str.replace(/^\s+/gm, "\n").replace(/\n+/gm, "\n");
+ return ret == "\n" ? '' : ret;
+
+ }
+
});
\ No newline at end of file
diff --git a/JSDOC/Template.js b/JSDOC/Template.js
index e6369b9..944d318 100644
--- a/JSDOC/Template.js
+++ b/JSDOC/Template.js
@@ -1,14 +1,18 @@
//<script type="text/javscript">
-JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
-console = imports['console.js'].console;
-xnew = imports['xnew.js'].xnew;
Gio = imports.gi.Gio;
GLib = imports.gi.GLib;
+imports['Object.js'].load(Object);
+
+
+JSDOC = imports['JSDOC.js'].JSDOC;
+console = imports['console.js'].console;
+xnew = imports['xnew.js'].xnew;
+Link = imports['JSDOC/Template/Link.js'].Link;
+
+
-Link = imports['JSDOC/Template/Link.js'].Link;
Template = function(templateFile) {
if (templateFile) {
@@ -26,7 +30,7 @@ Template = function(templateFile) {
xnew.load(Template , 'JSDOC/Template');
-Roo.apply(Template.prototype , {
+Object.extend(Template.prototype , {
parse : function() {
diff --git a/JSDOC/Template/Link.js b/JSDOC/Template/Link.js
index 24eb6fc..4d45a5e 100644
--- a/JSDOC/Template/Link.js
+++ b/JSDOC/Template/Link.js
@@ -1,8 +1,10 @@
//<script type="text/javascript">
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+
console = imports['console.js'].console;
+imports['Object.js'].load(Object);
+
Template = imports['JSDOC/Template.js'];
/** Handle the creation of HTML links to documented symbols.
@@ -33,7 +35,7 @@ Link = function() {
-Roo.apply(Link.prototype, {
+Object.extend(Link.prototype, {
alias : "",
src : "",
@@ -167,9 +169,9 @@ Roo.apply(Link.prototype, {
}
if (!this.extern) {
- this.extern = 'http://www.google.com/search?hl=en&' +
+ this.extern = 'http://www.google.com/search?hl=en&' +
'q=site%3A' + site + '+' + aa + extra +
- '&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq=';
+ '&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq=';
}
this.text = aa;
@@ -286,7 +288,7 @@ Roo.apply(Link.prototype, {
{
var target = '';
var txt = this.show_full ? alias : alias.split('.').pop();
- return "<a href=\"./"+alias+".shtml\""+target+" roo:cls=\""+alias+"\">"+txt+"</a>";
+ return "<a href=\"./"+alias+".html\""+target+">"+txt+"</a>";
/*
// look for '/' in alias..
@@ -350,7 +352,7 @@ Roo.apply(Link.prototype, {
JSDOC.PluginManager.run("onSymbolLink", link);
}
- return "<a href=\""+link.fullLinkPath+"\""+target+" roo:cls=\""+link.linkPath+"\">"+link.linkText+"</a>";
+ return "<a href=\""+link.fullLinkPath+"\""+target+">"+link.linkText+"</a>";
},
@@ -364,7 +366,7 @@ Roo.apply(Link.prototype, {
var outFilePath = Link.base + Link.srcDir + srcFile.replace(/.js$/, '') + Link.ext;
if (!this.text) this.text = FilePath.fileName(srcFilePath);
- return "<a href=\""+outFilePath+"\""+target+" roo:cls=\"src/"+lsrcFile+"\">"+this.text+"</a>";
+ return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
},
/** Create a link to a source file. */
diff --git a/JSDOC/TextStream.js b/JSDOC/TextStream.js
index 4c5452b..007a982 100644
--- a/JSDOC/TextStream.js
+++ b/JSDOC/TextStream.js
@@ -1,9 +1,9 @@
//<script type="text/javscript">
-JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
+imports['Object.js'].load(Object);
+JSDOC = imports['JSDOC.js'].JSDOC;
/**
@constructor
@@ -15,7 +15,7 @@ TextStream = function(text) {
this.cursor = 0;
}
-Roo.apply( TextStream.prototype, {
+Object.extend( TextStream.prototype, {
look : function(n) {
if (typeof n == "undefined") n = 0;
diff --git a/JSDOC/Token.js b/JSDOC/Token.js
index 98a9f2c..cad3547 100644
--- a/JSDOC/Token.js
+++ b/JSDOC/Token.js
@@ -1,72 +1,72 @@
//<Script type="text/javascript">
+
+imports['Object.js'].load(Object);
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
console = imports['console.js'].console;
/**
@constructor
*/
-Token = function(data, type, name) {
- this.data = data;
- this.type = type;
- this.name = name;
- this.prefix = '';
-}
-//JSDOC.Token.prototype.toString = function() {
-// return "<"+this.type+" name=\""+this.name+"\">"+this.data+"</"+this.type+">";
-//}
-Roo.apply( Token.prototype, {
-
- toRaw : function(lvl)
+Token = Object.define(
+ function(data, type, name) {
+ this.data = data;
+ this.type = type;
+ this.name = name;
+ this.prefix = '';
+ },
+ Object,
{
- lvl = lvl || 0;
- var ret = this.data ;
- if (this.items) {
- var ar = [];
- Roo.each(this.items, function(ai) {
-
- var str = '';
- Roo.each(ai, function(it) {
- str += it.toRaw(lvl + 1);
- })
- ar.push(str);
-
- })
- ret += ar.join('');
+ toRaw : function(lvl)
+ {
+ lvl = lvl || 0;
- }
- if (this.props) {
- for (var i in this.props) {
- ret += this.props[i].key.toRaw(lvl+1) + ' : ';
- Roo.each(this.props[i].val, function(e) {
- ret+=e.toRaw(lvl+1);
+ var ret = this.data ;
+ if (this.items) {
+ var ar = [];
+ Roo.each(this.items, function(ai) {
+
+ var str = '';
+ Roo.each(ai, function(it) {
+ str += it.toRaw(lvl + 1);
+ })
+ ar.push(str);
+
})
+ ret += ar.join('');
}
- }
-
-
-
- return this.prefix + ret;
+ if (this.props) {
+ for (var i in this.props) {
+ ret += this.props[i].key.toRaw(lvl+1) + ' : ';
+ Roo.each(this.props[i].val, function(e) {
+ ret+=e.toRaw(lvl+1);
+ })
+
+ }
+ }
+
+
+
+ return this.prefix + ret;
+
+ },
+
+ toJS : function() {
+
+ try {
+ var _tmp = '';
+ eval( "_tmp = " + this.data);
+ return _tmp;
+ } catch( e) {
+ return "ERROR unparsable" + this.data;
+ }
+ },
- },
+
- toJS : function() {
-
- try {
- var _tmp = '';
- eval( "_tmp = " + this.data);
- return _tmp;
- } catch( e) {
- return "ERROR unparsable" + this.data;
+ is : function(what) {
+ return this.name === what || this.type === what;
}
- },
-
-
-
- is : function(what) {
- return this.name === what || this.type === what;
- }
});
\ No newline at end of file
diff --git a/JSDOC/TokenReader.js b/JSDOC/TokenReader.js
index 2999a8d..6f5d959 100644
--- a/JSDOC/TokenReader.js
+++ b/JSDOC/TokenReader.js
@@ -1,353 +1,352 @@
//<script type="text/javascript">
-JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
-console = imports['console.js'].console;
-
+imports['Object.js'].load(Object);
+console = imports['console.js'].console;
-Token = imports['JSDOC/Token.js'].Token;
-Lang = imports['JSDOC/Token.js'].Lang;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Token = imports['JSDOC/Token.js'].Token;
+Lang = imports['JSDOC/Token.js'].Lang;
/**
@class Search a { link JSDOC.TextStream} for language tokens.
*/
-TokenReader = function(o) {
-
- this.keepDocs = true;
- this.keepWhite = false;
- this.keepComments = false;
- Roo.apply(this, o || {});
-
-}
-
-
-Roo.apply(TokenReader.prototype, {
+TokenReader = Object.define(
+ function(o) {
+
+ this.keepDocs = true;
+ this.keepWhite = false;
+ this.keepComments = false;
+ Roo.apply(this, o || {});
+ },
+ Object,
+ {
+
- /**
- @type {JSDOC.Token[]}
- */
+ /**
+ @type {JSDOC.Token[]}
+ */
- tokenize : function(/**JSDOC.TextStream*/stream) {
- var tokens = [];
- /** ignore*/ tokens.last = function() { return tokens[tokens.length-1]; }
- /** ignore*/ tokens.lastSym = function() {
- for (var i = tokens.length-1; i >= 0; i--) {
- if (!(tokens[i].is("WHIT") || tokens[i].is("COMM"))) return tokens[i];
+ tokenize : function(/**JSDOC.TextStream*/stream) {
+ var tokens = [];
+ /** ignore*/ tokens.last = function() { return tokens[tokens.length-1]; }
+ /** ignore*/ tokens.lastSym = function() {
+ for (var i = tokens.length-1; i >= 0; i--) {
+ if (!(tokens[i].is("WHIT") || tokens[i].is("COMM"))) return tokens[i];
+ }
}
- }
- while (!stream.look().eof) {
- if (this.read_mlcomment(stream, tokens)) continue;
- if (this.read_slcomment(stream, tokens)) continue;
- if (this.read_dbquote(stream, tokens)) continue;
- if (this.read_snquote(stream, tokens)) continue;
- if (this.read_regx(stream, tokens)) continue;
- if (this.read_numb(stream, tokens)) continue;
- if (this.read_punc(stream, tokens)) continue;
- if (this.read_newline(stream, tokens)) continue;
- if (this.read_space(stream, tokens)) continue;
- if (this.read_word(stream, tokens)) continue;
+ while (!stream.look().eof) {
+ if (this.read_mlcomment(stream, tokens)) continue;
+ if (this.read_slcomment(stream, tokens)) continue;
+ if (this.read_dbquote(stream, tokens)) continue;
+ if (this.read_snquote(stream, tokens)) continue;
+ if (this.read_regx(stream, tokens)) continue;
+ if (this.read_numb(stream, tokens)) continue;
+ if (this.read_punc(stream, tokens)) continue;
+ if (this.read_newline(stream, tokens)) continue;
+ if (this.read_space(stream, tokens)) continue;
+ if (this.read_word(stream, tokens)) continue;
+
+ // if execution reaches here then an error has happened
+ tokens.push(new Token(stream.next(), "TOKN", "UNKNOWN_TOKEN"));
+ }
- // if execution reaches here then an error has happened
- tokens.push(new Token(stream.next(), "TOKN", "UNKNOWN_TOKEN"));
- }
-
-
-
- return tokens;
- },
-
- /**
- @returns {Boolean} Was the token found?
- */
- read_word : function(/**JSDOC.TokenStream*/stream, tokens) {
- var found = "";
- while (!stream.look().eof && Lang.isWordChar(stream.look())) {
- found += stream.next();
- }
-
- if (found === "") {
- return false;
- }
- else {
- var name;
- if ((name = Lang.keyword(found))) tokens.push(new Token(found, "KEYW", name));
- else tokens.push(new Token(found, "NAME", "NAME"));
- return true;
- }
- },
-
- /**
- @returns {Boolean} Was the token found?
- */
- read_punc : function(/**JSDOC.TokenStream*/stream, tokens) {
- var found = "";
- var name;
- while (!stream.look().eof && Lang.punc(found+stream.look())) {
- found += stream.next();
- }
-
- if (found === "") {
- return false;
- }
- else {
- tokens.push(new Token(found, "PUNC", Lang.punc(found)));
- return true;
- }
- },
+
+
+ return tokens;
+ },
- /**
- @returns {Boolean} Was the token found?
- */
- read_space : function(/**JSDOC.TokenStream*/stream, tokens) {
- var found = "";
-
- while (!stream.look().eof && Lang.isSpace(stream.look())) {
- found += stream.next();
- }
-
- if (found === "") {
- return false;
- }
- else {
- if (this.collapseWhite) found = " ";
- if (this.keepWhite) tokens.push(new Token(found, "WHIT", "SPACE"));
- return true;
- }
- },
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_word : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found = "";
+ while (!stream.look().eof && Lang.isWordChar(stream.look())) {
+ found += stream.next();
+ }
+
+ if (found === "") {
+ return false;
+ }
+ else {
+ var name;
+ if ((name = Lang.keyword(found))) tokens.push(new Token(found, "KEYW", name));
+ else tokens.push(new Token(found, "NAME", "NAME"));
+ return true;
+ }
+ },
- /**
- @returns {Boolean} Was the token found?
- */
- read_newline : function(/**JSDOC.TokenStream*/stream, tokens) {
- var found = "";
-
- while (!stream.look().eof && Lang.isNewline(stream.look())) {
- found += stream.next();
- }
-
- if (found === "") {
- return false;
- }
- else {
- if (this.collapseWhite) found = "\n";
- if (this.keepWhite) tokens.push(new Token(found, "WHIT", "NEWLINE"));
- return true;
- }
- },
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_punc : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found = "";
+ var name;
+ while (!stream.look().eof && Lang.punc(found+stream.look())) {
+ found += stream.next();
+ }
+
+ if (found === "") {
+ return false;
+ }
+ else {
+ tokens.push(new Token(found, "PUNC", Lang.punc(found)));
+ return true;
+ }
+ },
- /**
- @returns {Boolean} Was the token found?
- */
- read_mlcomment : function(/**JSDOC.TokenStream*/stream, tokens) {
- if (stream.look() == "/" && stream.look(1) == "*") {
- var found = stream.next(2);
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_space : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found = "";
- while (!stream.look().eof && !(stream.look(-1) == "/" && stream.look(-2) == "*")) {
+ while (!stream.look().eof && Lang.isSpace(stream.look())) {
found += stream.next();
}
- // to start doclet we allow /** or /*** but not /**/ or /****
- if (/^\/\*\*([^\/]|\*[^*])/.test(found) && this.keepDocs) tokens.push(new Token(found, "COMM", "JSDOC"));
- else if (this.keepComments) tokens.push(new Token(found, "COMM", "MULTI_LINE_COMM"));
- return true;
- }
- return false;
- },
+ if (found === "") {
+ return false;
+ }
+ else {
+ if (this.collapseWhite) found = " ";
+ if (this.keepWhite) tokens.push(new Token(found, "WHIT", "SPACE"));
+ return true;
+ }
+ },
- /**
- @returns {Boolean} Was the token found?
- */
- read_slcomment : function(/**JSDOC.TokenStream*/stream, tokens) {
- var found;
- if (
- (stream.look() == "/" && stream.look(1) == "/" && (found=stream.next(2)))
- ||
- (stream.look() == "<" && stream.look(1) == "!" && stream.look(2) == "-" && stream.look(3) == "-" && (found=stream.next(4)))
- ) {
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_newline : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found = "";
- while (!stream.look().eof && !Lang.isNewline(stream.look())) {
+ while (!stream.look().eof && Lang.isNewline(stream.look())) {
found += stream.next();
}
- if (this.keepComments) {
- tokens.push(new Token(found, "COMM", "SINGLE_LINE_COMM"));
+ if (found === "") {
+ return false;
}
- return true;
- }
- return false;
- },
+ else {
+ if (this.collapseWhite) found = "\n";
+ if (this.keepWhite) tokens.push(new Token(found, "WHIT", "NEWLINE"));
+ return true;
+ }
+ },
- /**
- @returns {Boolean} Was the token found?
- */
- read_dbquote : function(/**JSDOC.TokenStream*/stream, tokens) {
- if (stream.look() == "\"") {
- // find terminator
- var string = stream.next();
-
- while (!stream.look().eof) {
- if (stream.look() == "\\") {
- if (Lang.isNewline(stream.look(1))) {
- do {
- stream.next();
- } while (!stream.look().eof && Lang.isNewline(stream.look()));
- string += "\\\n";
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_mlcomment : function(/**JSDOC.TokenStream*/stream, tokens) {
+ if (stream.look() == "/" && stream.look(1) == "*") {
+ var found = stream.next(2);
+
+ while (!stream.look().eof && !(stream.look(-1) == "/" && stream.look(-2) == "*")) {
+ found += stream.next();
+ }
+
+ // to start doclet we allow /** or /*** but not /**/ or /****
+ if (/^\/\*\*([^\/]|\*[^*])/.test(found) && this.keepDocs) tokens.push(new Token(found, "COMM", "JSDOC"));
+ else if (this.keepComments) tokens.push(new Token(found, "COMM", "MULTI_LINE_COMM"));
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_slcomment : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found;
+ if (
+ (stream.look() == "/" && stream.look(1) == "/" && (found=stream.next(2)))
+ ||
+ (stream.look() == "<" && stream.look(1) == "!" && stream.look(2) == "-" && stream.look(3) == "-" && (found=stream.next(4)))
+ ) {
+
+ while (!stream.look().eof && !Lang.isNewline(stream.look())) {
+ found += stream.next();
+ }
+
+ if (this.keepComments) {
+ tokens.push(new Token(found, "COMM", "SINGLE_LINE_COMM"));
+ }
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_dbquote : function(/**JSDOC.TokenStream*/stream, tokens) {
+ if (stream.look() == "\"") {
+ // find terminator
+ var string = stream.next();
+
+ while (!stream.look().eof) {
+ if (stream.look() == "\\") {
+ if (Lang.isNewline(stream.look(1))) {
+ do {
+ stream.next();
+ } while (!stream.look().eof && Lang.isNewline(stream.look()));
+ string += "\\\n";
+ }
+ else {
+ string += stream.next(2);
+ }
+ }
+ else if (stream.look() == "\"") {
+ string += stream.next();
+ tokens.push(new Token(string, "STRN", "DOUBLE_QUOTE"));
+ return true;
}
else {
- string += stream.next(2);
+ string += stream.next();
}
}
- else if (stream.look() == "\"") {
- string += stream.next();
- tokens.push(new Token(string, "STRN", "DOUBLE_QUOTE"));
- return true;
- }
- else {
- string += stream.next();
+ }
+ return false; // error! unterminated string
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_snquote : function(/**JSDOC.TokenStream*/stream, tokens) {
+ if (stream.look() == "'") {
+ // find terminator
+ var string = stream.next();
+
+ while (!stream.look().eof) {
+ if (stream.look() == "\\") { // escape sequence
+ string += stream.next(2);
+ }
+ else if (stream.look() == "'") {
+ string += stream.next();
+ tokens.push(new Token(string, "STRN", "SINGLE_QUOTE"));
+ return true;
+ }
+ else {
+ string += stream.next();
+ }
}
}
- }
- return false; // error! unterminated string
- },
+ return false; // error! unterminated string
+ },
- /**
- @returns {Boolean} Was the token found?
- */
- read_snquote : function(/**JSDOC.TokenStream*/stream, tokens) {
- if (stream.look() == "'") {
- // find terminator
- var string = stream.next();
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_numb : function(/**JSDOC.TokenStream*/stream, tokens) {
+ if (stream.look() === "0" && stream.look(1) == "x") {
+ return this.read_hex(stream, tokens);
+ }
+
+ var found = "";
+
+ while (!stream.look().eof && Lang.isNumber(found+stream.look())){
+ found += stream.next();
+ }
+
+ if (found === "") {
+ return false;
+ }
+ else {
+ if (/^0[0-7]/.test(found)) tokens.push(new Token(found, "NUMB", "OCTAL"));
+ else tokens.push(new Token(found, "NUMB", "DECIMAL"));
+ return true;
+ }
+ },
+ /*t:
+ requires("../lib/JSDOC/TextStream.js");
+ requires("../lib/JSDOC/Token.js");
+ requires("../lib/JSDOC/Lang.js");
+
+ plan(3, "testing read_numb");
+
+ //// setup
+ var src = "function foo(num){while (num+8.0 >= 0x20 && num < 0777){}}";
+ var tr = new TokenReader();
+ var tokens = tr.tokenize(new TextStream(src));
+
+ var hexToken, octToken, decToken;
+ for (var i = 0; i < tokens.length; i++) {
+ if (tokens[i].name == "HEX_DEC") hexToken = tokens[i];
+ if (tokens[i].name == "OCTAL") octToken = tokens[i];
+ if (tokens[i].name == "DECIMAL") decToken = tokens[i];
+ }
+ ////
+
+ is(decToken.data, "8.0", "decimal number is found in source.");
+ is(hexToken.data, "0x20", "hexdec number is found in source (issue #99).");
+ is(octToken.data, "0777", "octal number is found in source.");
+ */
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_hex : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found = stream.next(2);
while (!stream.look().eof) {
- if (stream.look() == "\\") { // escape sequence
- string += stream.next(2);
- }
- else if (stream.look() == "'") {
- string += stream.next();
- tokens.push(new Token(string, "STRN", "SINGLE_QUOTE"));
+ if (Lang.isHexDec(found) && !Lang.isHexDec(found+stream.look())) { // done
+ tokens.push(new Token(found, "NUMB", "HEX_DEC"));
return true;
}
else {
- string += stream.next();
+ found += stream.next();
}
}
- }
- return false; // error! unterminated string
- },
-
- /**
- @returns {Boolean} Was the token found?
- */
- read_numb : function(/**JSDOC.TokenStream*/stream, tokens) {
- if (stream.look() === "0" && stream.look(1) == "x") {
- return this.read_hex(stream, tokens);
- }
-
- var found = "";
-
- while (!stream.look().eof && Lang.isNumber(found+stream.look())){
- found += stream.next();
- }
-
- if (found === "") {
return false;
- }
- else {
- if (/^0[0-7]/.test(found)) tokens.push(new Token(found, "NUMB", "OCTAL"));
- else tokens.push(new Token(found, "NUMB", "DECIMAL"));
- return true;
- }
- },
- /*t:
- requires("../lib/JSDOC/TextStream.js");
- requires("../lib/JSDOC/Token.js");
- requires("../lib/JSDOC/Lang.js");
-
- plan(3, "testing read_numb");
-
- //// setup
- var src = "function foo(num){while (num+8.0 >= 0x20 && num < 0777){}}";
- var tr = new TokenReader();
- var tokens = tr.tokenize(new TextStream(src));
-
- var hexToken, octToken, decToken;
- for (var i = 0; i < tokens.length; i++) {
- if (tokens[i].name == "HEX_DEC") hexToken = tokens[i];
- if (tokens[i].name == "OCTAL") octToken = tokens[i];
- if (tokens[i].name == "DECIMAL") decToken = tokens[i];
- }
- ////
-
- is(decToken.data, "8.0", "decimal number is found in source.");
- is(hexToken.data, "0x20", "hexdec number is found in source (issue #99).");
- is(octToken.data, "0777", "octal number is found in source.");
- */
-
- /**
- @returns {Boolean} Was the token found?
- */
- read_hex : function(/**JSDOC.TokenStream*/stream, tokens) {
- var found = stream.next(2);
-
- while (!stream.look().eof) {
- if (Lang.isHexDec(found) && !Lang.isHexDec(found+stream.look())) { // done
- tokens.push(new Token(found, "NUMB", "HEX_DEC"));
- return true;
- }
- else {
- found += stream.next();
- }
- }
- return false;
- },
+ },
- /**
- @returns {Boolean} Was the token found?
- */
- read_regx : function(/**JSDOC.TokenStream*/stream, tokens) {
- var last;
- if (
- stream.look() == "/"
- &&
- (
-
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_regx : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var last;
+ if (
+ stream.look() == "/"
+ &&
(
- !(last = tokens.lastSym()) // there is no last, the regex is the first symbol
- ||
+
(
- !last.is("NUMB")
- && !last.is("NAME")
- && !last.is("RIGHT_PAREN")
- && !last.is("RIGHT_BRACKET")
+ !(last = tokens.lastSym()) // there is no last, the regex is the first symbol
+ ||
+ (
+ !last.is("NUMB")
+ && !last.is("NAME")
+ && !last.is("RIGHT_PAREN")
+ && !last.is("RIGHT_BRACKET")
+ )
)
)
- )
- ) {
- var regex = stream.next();
-
- while (!stream.look().eof) {
- if (stream.look() == "\\") { // escape sequence
- regex += stream.next(2);
- }
- else if (stream.look() == "/") {
- regex += stream.next();
-
- while (/[gmi]/.test(stream.look())) {
+ ) {
+ var regex = stream.next();
+
+ while (!stream.look().eof) {
+ if (stream.look() == "\\") { // escape sequence
+ regex += stream.next(2);
+ }
+ else if (stream.look() == "/") {
+ regex += stream.next();
+
+ while (/[gmi]/.test(stream.look())) {
+ regex += stream.next();
+ }
+
+ tokens.push(new Token(regex, "REGX", "REGX"));
+ return true;
+ }
+ else {
regex += stream.next();
}
-
- tokens.push(new Token(regex, "REGX", "REGX"));
- return true;
- }
- else {
- regex += stream.next();
}
+ // error: unterminated regex
}
- // error: unterminated regex
+ return false;
}
- return false;
- }
});
\ No newline at end of file
diff --git a/JSDOC/TokenStream.js b/JSDOC/TokenStream.js
index 3e9e348..cc3f6af 100644
--- a/JSDOC/TokenStream.js
+++ b/JSDOC/TokenStream.js
@@ -1,49 +1,100 @@
//<script type="text/javscript">
+
+imports['Object.js'].load(Object);
+
JSDOC = imports['JSDOC.js'].JSDOC;
-Roo = imports['Roo.js'].Roo;
console = imports['console.js'].console;
-
-Token = imports['JSDOC/Token.js'].Token;
-Lang = imports['JSDOC/Lang.js'].Lang;
+Token = imports['JSDOC/Token.js'].Token;
+Lang = imports['JSDOC/Lang.js'].Lang;
/**
@constructor
*/
-TokenStream = function(tokens) {
-
-
- this.tokens = (tokens || []);
- // Seed.print(this.tokens.length);
- this.rewind();
-}
-
-
-Roo.apply( TokenStream.prototype , {
-
- rewind : function() {
- this.cursor = -1;
+TokenStream = Object.define(
+ function(tokens) {
+
+
+ this.tokens = (tokens || []);
+ // Seed.print(this.tokens.length);
+ this.rewind();
},
+ Object,
+ {
+
+ rewind : function() {
+ this.cursor = -1;
+ },
+
+ /**
+ @type JSDOC.Token
+ */
+ look : function(/**Number*/n, /**Boolean*/considerWhitespace) {
+ if (typeof n == "undefined") n = 0;
+
+ if (considerWhitespace == true) {
+ if (this.cursor+n < 0 || this.cursor+n > this.tokens.length) return {};
+ return this.tokens[this.cursor+n];
+ }
+ else {
+ var count = 0;
+ var i = this.cursor;
+
+ while (true) {
+ if (i < 0) return new Token("", "VOID", "START_OF_STREAM");
+ else if (i > this.tokens.length) return new Token("", "VOID", "END_OF_STREAM");
+
+ if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT"))) {
+ if (n < 0) i--; else i++;
+ continue;
+ }
+
+ if (count == Math.abs(n)) {
+ return this.tokens[i];
+ }
+ count++;
+ (n < 0)? i-- : i++;
+ }
- /**
- @type JSDOC.Token
- */
- look : function(/**Number*/n, /**Boolean*/considerWhitespace) {
- if (typeof n == "undefined") n = 0;
+ return new Token("", "VOID", "STREAM_ERROR"); // because null isn't an object and caller always expects an object
+ }
+ },
- if (considerWhitespace == true) {
- if (this.cursor+n < 0 || this.cursor+n > this.tokens.length) return {};
- return this.tokens[this.cursor+n];
- }
- else {
+ lookFor : function (data)
+ {
+ // non tree version..
+ var i = this.cursor < 0 ? 0 : this.cursor ;
+
+ while (true) {
+ if (i >= this.tokens.length) return -1;
+ if (this.tokens[i].data == data) {
+ return i;
+ }
+ i++;
+
+ }
+ // should not get here!
+ return -1;
+
+ },
+
+
+ /**
+ * look ahead (or back) x number of tokens (which are not comment or whitespace)
+ * ?? used any more?
+ */
+ lookTok : function(/**Number*/n) {
+ if (typeof n == "undefined") n = 1;
+
+
var count = 0;
var i = this.cursor;
while (true) {
- if (i < 0) return new Token("", "VOID", "START_OF_STREAM");
- else if (i > this.tokens.length) return new Token("", "VOID", "END_OF_STREAM");
+ if (i < 0) return false;
+ else if (i > this.tokens.length) return false;
- if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT"))) {
+ if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT") || this.tokens[i].is("COMM"))) {
if (n < 0) i--; else i++;
continue;
}
@@ -55,172 +106,122 @@ Roo.apply( TokenStream.prototype , {
(n < 0)? i-- : i++;
}
- return new Token("", "VOID", "STREAM_ERROR"); // because null isn't an object and caller always expects an object
- }
- },
-
- lookFor : function (data)
- {
- // non tree version..
- var i = this.cursor < 0 ? 0 : this.cursor ;
-
- while (true) {
- if (i >= this.tokens.length) return -1;
- if (this.tokens[i].data == data) {
- return i;
- }
- i++;
+ return false; // because null isn't an object and caller always expects an object;
- }
- // should not get here!
- return -1;
-
- },
-
-
- /**
- * look ahead (or back) x number of tokens (which are not comment or whitespace)
- * ?? used any more?
- */
- lookTok : function(/**Number*/n) {
- if (typeof n == "undefined") n = 1;
-
-
- var count = 0;
- var i = this.cursor;
-
- while (true) {
- if (i < 0) return false;
- else if (i > this.tokens.length) return false;
-
- if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT") || this.tokens[i].is("COMM"))) {
- if (n < 0) i--; else i++;
- continue;
- }
-
- if (count == Math.abs(n)) {
- return this.tokens[i];
+ },
+
+ /**
+ @type JSDOC.Token|JSDOC.Token[]| null!
+ */
+ next : function(/**Number*/howMany) {
+ if (typeof howMany == "undefined") howMany = 1;
+ if (howMany < 1) return null;
+ var got = [];
+
+ for (var i = 1; i <= howMany; i++) {
+ if (this.cursor+i >= this.tokens.length) {
+ return null;
+ }
+ got.push(this.tokens[this.cursor+i]);
}
- count++;
- (n < 0)? i-- : i++;
- }
+ this.cursor += howMany;
- return false; // because null isn't an object and caller always expects an object;
-
- },
-
- /**
- @type JSDOC.Token|JSDOC.Token[]| null!
- */
- next : function(/**Number*/howMany) {
- if (typeof howMany == "undefined") howMany = 1;
- if (howMany < 1) return null;
- var got = [];
-
- for (var i = 1; i <= howMany; i++) {
- if (this.cursor+i >= this.tokens.length) {
- return null;
+ if (howMany == 1) {
+ return got[0];
}
- got.push(this.tokens[this.cursor+i]);
- }
- this.cursor += howMany;
+ else return got;
+ },
+ // what about comments after 'function'...
+ // is this used ???
- if (howMany == 1) {
- return got[0];
- }
- else return got;
- },
- // what about comments after 'function'...
- // is this used ???
-
- nextNonSpace : function ()
- {
-
- while (true) {
- tok = this.next(1);
- if (!tok) {
- return false;
- }
- if (tok.is('WHIT') || tok.is('COMM')) {
- continue;
- }
- return tok;
- }
- },
- /**
- @type JSDOC.Token[]
- */
- balance : function(/**String*/start, /**String*/stop) {
- if (!stop) stop = Lang.matching(start);
-
- var depth = 0;
- var got = [];
- var started = false;
- //Seed.print("STOP:" + stop);
- while ((token = this.look())) {
- if (token.is(start)) {
- depth++;
- started = true;
- }
+ nextNonSpace : function ()
+ {
- if (started) {
- got.push(token);
+ while (true) {
+ tok = this.next(1);
+ if (!tok) {
+ return false;
+ }
+ if (tok.is('WHIT') || tok.is('COMM')) {
+ continue;
+ }
+ return tok;
}
+ },
+ /**
+ @type JSDOC.Token[]
+ */
+ balance : function(/**String*/start, /**String*/stop) {
+ if (!stop) stop = Lang.matching(start);
- if (token.is(stop)) {
- depth--;
- if (depth == 0) return got;
+ var depth = 0;
+ var got = [];
+ var started = false;
+ //Seed.print("STOP:" + stop);
+ while ((token = this.look())) {
+ if (token.is(start)) {
+ depth++;
+ started = true;
+ }
+
+ if (started) {
+ got.push(token);
+ }
+
+ if (token.is(stop)) {
+ depth--;
+ if (depth == 0) return got;
+ }
+ if (!this.next()) break;
}
- if (!this.next()) break;
- }
- },
+ },
- getMatchingToken : function(/**String*/start, /**String*/stop) {
- var depth = 0;
- var cursor = this.cursor;
-
- if (!start) {
- start = Lang.matching(stop);
- depth = 1;
- }
- if (!stop) stop = Lang.matching(start);
-
- while ((token = this.tokens[cursor])) {
- if (token.is(start)) {
- depth++;
+ getMatchingToken : function(/**String*/start, /**String*/stop) {
+ var depth = 0;
+ var cursor = this.cursor;
+
+ if (!start) {
+ start = Lang.matching(stop);
+ depth = 1;
}
+ if (!stop) stop = Lang.matching(start);
- if (token.is(stop) && cursor) {
- depth--;
- if (depth == 0) return this.tokens[cursor];
+ while ((token = this.tokens[cursor])) {
+ if (token.is(start)) {
+ depth++;
+ }
+
+ if (token.is(stop) && cursor) {
+ depth--;
+ if (depth == 0) return this.tokens[cursor];
+ }
+ cursor++;
}
- cursor++;
- }
- },
-
- insertAhead : function(/**JSDOC.Token*/token) {
- this.tokens.splice(this.cursor+1, 0, token);
- },
-
- remaining : function() {
- var ret = [];
- while (true) {
- var tok = this.look(1,true);
- if (!tok || !tok.is || tok.is('VOID')) {
- return ret;
+ },
+
+ insertAhead : function(/**JSDOC.Token*/token) {
+ this.tokens.splice(this.cursor+1, 0, token);
+ },
+
+ remaining : function() {
+ var ret = [];
+ while (true) {
+ var tok = this.look(1,true);
+ if (!tok || !tok.is || tok.is('VOID')) {
+ return ret;
+ }
+ ret.push(this.next(1));
}
- ret.push(this.next(1));
+ },
+
+
+ arrayToString : function(ar) {
+ console.log(typeof(ar));
+ var ret = [];
+ Roo.each(ar, function(e) {
+ ret.push(e.data);
+ })
+ return ret.join('');
}
- },
-
-
- arrayToString : function(ar) {
- console.log(typeof(ar));
- var ret = [];
- Roo.each(ar, function(e) {
- ret.push(e.data);
- })
- return ret.join('');
- }
});
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]