projects
/
gnome.introspection-doc-generator
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JSDOC/BuildDocs.js
[gnome.introspection-doc-generator]
/
JSDOC
/
Parser.js
diff --git
a/JSDOC/Parser.js
b/JSDOC/Parser.js
index
917c7cc
..
ee146c2
100644
(file)
--- a/
JSDOC/Parser.js
+++ b/
JSDOC/Parser.js
@@
-1,21
+1,25
@@
//<script type="text/javascript">
//<script type="text/javascript">
-
-
+Walker2 = imports.Walker2.Walker2;
+Symbol = imports.Symbol.Symbol;
+SymbolSet = imports.SymbolSet.SymbolSet;
+DocComment = imports.DocComment.DocComment;
+Options = imports.Options.Options;
/**
/**
- @namespace
- @requires JSDOC.Walker
- @requires JSDOC.Symbol
- @requires JSDOC.DocComment
-*/
-
-
-
-JSDOC.Parser = {
-
conf: { loaded: false
},
+ * Parser is a static instance..
+ *
+ *
+ */
+
+
+Parser = {
+ conf: {
+ loaded: false
+ },
walker : false, // will be JSDOC.Walker()
symbols : false, //will be JSDOC.SymbolSet()
walker : false, // will be JSDOC.Walker()
symbols : false, //will be JSDOC.SymbolSet()
+
filesSymbols : { },
/**
filesSymbols : { },
/**
@@
-27,16
+31,16
@@
JSDOC.Parser = {
if (this.conf.loaded) {
return;
}
if (this.conf.loaded) {
return;
}
-
println
("init parser conf!?");
+
//print
("init parser conf!?");
this.conf = {
loaded : true,
this.conf = {
loaded : true,
-
ignoreCode: JSDOC.opt
.n,
+
//ignoreCode: Options
.n,
ignoreAnonymous: true, // factory: true
treatUnderscoredAsPrivate: true, // factory: true
explain: false // factory: false
};
ignoreAnonymous: true, // factory: true
treatUnderscoredAsPrivate: true, // factory: true
explain: false // factory: false
};
- this.symbols = new
JSDOC.
SymbolSet();
+ this.symbols = new
SymbolSet();
//this.walker = new JSDOC.Walker();
//JSDOC.Parser.filesSymbols = {};
},
//this.walker = new JSDOC.Walker();
//JSDOC.Parser.filesSymbols = {};
},
@@
-58,62
+62,68
@@
JSDOC.Parser = {
// not a nice way to set stuff...
// not a nice way to set stuff...
-
JSDOC.
Symbol.srcFile = (srcFile || "");
-
JSDOC.
DocComment.shared = ""; // shared comments don't cross file boundaries
+ Symbol.srcFile = (srcFile || "");
+ DocComment.shared = ""; // shared comments don't cross file boundaries
- this.filesSymbols[JSDOC.Symbol.srcFile] = new JSDOC.SymbolSet();
+ this.filesSymbols[Symbol.srcFile] = new SymbolSet();
+
+ //Options.LOG.inform("Parser - run walker");
+ this.walker = new Walker2(ts);
+ this.walker.buildSymbolTree();
+
+
- this.walker = new JSDOC.Walker2(ts);
- this.walker.buildSymbolTree()
//this.walker.walk(ts); // adds to our symbols
// throw "done sym tree";
//this.walker.walk(ts); // adds to our symbols
// throw "done sym tree";
-
+ //Options.LOG.inform("Parser - checking symbols");
// filter symbols by option
for (p in this.symbols._index) {
var symbol = this.symbols.getSymbol(p);
// filter symbols by option
for (p in this.symbols._index) {
var symbol = this.symbols.getSymbol(p);
+ //print(JSON.stringify(symbol, null,4));
+
if (!symbol) continue;
if (symbol.is("FILE") || symbol.is("GLOBAL")) {
continue;
}
if (!symbol) continue;
if (symbol.is("FILE") || symbol.is("GLOBAL")) {
continue;
}
-
else if (!JSDOC.opt
.a && !symbol.comment.isUserComment) {
- //print
ln
("Deleting Symbols (no a / user comment): " + symbol.alias);
+
//else if (!Options
.a && !symbol.comment.isUserComment) {
+ //print("Deleting Symbols (no a / user comment): " + symbol.alias);
//this.symbols.deleteSymbol(symbol.alias);
//this.symbols.deleteSymbol(symbol.alias);
- //this.filesSymbols[
JSDOC.
Symbol.srcFile].deleteSymbol(symbol.alias);
- }
+ //this.filesSymbols[Symbol.srcFile].deleteSymbol(symbol.alias);
+
//
}
if (/#$/.test(symbol.alias)) { // we don't document prototypes - this should not happen..
// rename the symbol ??
/*if (!this.symbols.getSymbol(symbol.alias.substring(0,symbol.alias.length-1))) {
// rename it..
if (/#$/.test(symbol.alias)) { // we don't document prototypes - this should not happen..
// rename the symbol ??
/*if (!this.symbols.getSymbol(symbol.alias.substring(0,symbol.alias.length-1))) {
// rename it..
- print
ln
("Renaming Symbol (got a #): " + symbol.alias);
+ print("Renaming Symbol (got a #): " + symbol.alias);
var n = '' + symbol.alias;
this.symbols.renameSymbol( n ,n.substring(0,n-1));
var n = '' + symbol.alias;
this.symbols.renameSymbol( n ,n.substring(0,n-1));
- this.filesSymbols[
JSDOC.
Symbol.srcFile].renameSymbol( n ,n.substring(0,n-1));
+ this.filesSymbols[Symbol.srcFile].renameSymbol( n ,n.substring(0,n-1));
continue;
}
*/
continue;
}
*/
- print
ln
("Deleting Symbols (got a #): " + symbol.alias);
+ print("Deleting Symbols (got a #): " + symbol.alias);
this.symbols.deleteSymbol(symbol.alias);
this.symbols.deleteSymbol(symbol.alias);
- this.filesSymbols[
JSDOC.
Symbol.srcFile].deleteSymbol(symbol.alias);
+ this.filesSymbols[Symbol.srcFile].deleteSymbol(symbol.alias);
}
}
}
}
- //print
ln(JSDOC.prettyDump(JSDOC.toQDump(this.filesSymbols[JSDOC.
Symbol.srcFile]._index,'{','}')));
- //print
ln
("AfterParse: " + this.symbols.keys().toSource().split(",").join(",\n "));
+ //print
(prettyDump(toQDump(this.filesSymbols[
Symbol.srcFile]._index,'{','}')));
+ //print("AfterParse: " + this.symbols.keys().toSource().split(",").join(",\n "));
return this.symbols.toArray();
},
addSymbol: function(symbol)
{
return this.symbols.toArray();
},
addSymbol: function(symbol)
{
-
println
("PARSER addSYMBOL : " + symbol.alias);
+
//print
("PARSER addSYMBOL : " + symbol.alias);
// if a symbol alias is documented more than once the last one with the user docs wins
if (this.symbols.hasSymbol(symbol.alias)) {
// if a symbol alias is documented more than once the last one with the user docs wins
if (this.symbols.hasSymbol(symbol.alias)) {
@@
-121,7
+131,7
@@
JSDOC.Parser = {
if (oldSymbol.comment.isUserComment && !oldSymbol.comment.hasTags) {
if (symbol.comment.isUserComment) { // old and new are both documented
if (oldSymbol.comment.isUserComment && !oldSymbol.comment.hasTags) {
if (symbol.comment.isUserComment) { // old and new are both documented
-
JSDOC.opt
.LOG.warn("The symbol '"+symbol.alias+"' is documented more than once.");
+
Options
.LOG.warn("The symbol '"+symbol.alias+"' is documented more than once.");
}
else { // old is documented but new isn't
return;
}
else { // old is documented but new isn't
return;
@@
-138,13
+148,13
@@
JSDOC.Parser = {
}
// -p flag is required to document private things
}
// -p flag is required to document private things
- if ((symbol.isInner || symbol.isPrivate) && !
JSDOC.opt
.p) return;
+ if ((symbol.isInner || symbol.isPrivate) && !
Options
.p) return;
// ignored things are not documented, this doesn't cascade
if (symbol.isIgnored) return;
// add it to the file's list... (for dumping later..)
// ignored things are not documented, this doesn't cascade
if (symbol.isIgnored) return;
// add it to the file's list... (for dumping later..)
- if (
JSDOC.
Symbol.srcFile) {
- this.filesSymbols[
JSDOC.
Symbol.srcFile].addSymbol(symbol);
+ if (Symbol.srcFile) {
+ this.filesSymbols[Symbol.srcFile].addSymbol(symbol);
}
this.symbols.addSymbol(symbol);
}
this.symbols.addSymbol(symbol);
@@
-152,7
+162,7
@@
JSDOC.Parser = {
addBuiltin: function(name) {
addBuiltin: function(name) {
- var builtin = new
JSDOC.Symbol(name, [], "CONSTRUCTOR", new JSDOC.
DocComment(""));
+ var builtin = new
Symbol(name, [], "CONSTRUCTOR", new
DocComment(""));
builtin.isNamespace = false;
builtin.srcFile = "";
builtin.isPrivate = false;
builtin.isNamespace = false;
builtin.srcFile = "";
builtin.isPrivate = false;