JSDOC/BuildDocs.js
[app.jsdoc] / JSDOC / BuildDocs.js
index e1e33df..90c820c 100644 (file)
@@ -15,7 +15,7 @@
     
     new ArgsParser(argv, imports.BuildDocs.BuildDocs )
  *
- * 
+ * @scope JSDOC
  */
        
         
@@ -34,14 +34,13 @@ Link        = imports.JsTemplate.Link.Link; // ?? fixme!??
 /**
  * 
  * @class  BuildDocs
- * @namespace JSDOC
  *
  * Main class used to build documentation
  */
 BuildDocs = XObject.define(
     function(opts) {
         XObject.extend(this, opts); // overlay cfg..
-        
+        //print(JSON.stringify(this, null,4));
         if (!this.LOG) {
             this.LOG = imports.JSDOC.Log.Log;
         }
@@ -82,7 +81,11 @@ BuildDocs = XObject.define(
          * @cfg {String} ext  comma-delimited list of extensions to handle..
          */
         ext: 'js' ,
-        
+         
+        /**
+         * @cfg {String} lang Language to parse (eg. js / php ...)
+         */
+        lang: 'js' ,
         
         /**
          * @cfg  {Array} src base source files/directories.
@@ -289,19 +292,20 @@ BuildDocs = XObject.define(
                 var txs = new imports.TextStream.TextStream(src);
                 
                 var tr = new imports.TokenReader.TokenReader({
+                        lang : _this.lang,
                         keepComments : true,
                         keepWhite : true ,
                         sepIdents: false,
                         filename : _this.srcFileRelName(srcFile)
                     });
+                //print(JSON.stringify(tr.tokenize(txs), null, 4));
                 
                 
-                var col = new imports.Collapse.Collapse(tr.tokenize(txs),
-                                            _this.srcFileRelName(srcFile));
-                // print(JSON.stringify(col, null,4));
-                imports.Symbol.Symbol.namespace = '';
-                new imports.ScopeNamer.ScopeNamer(col.tokens,
-                                            _this.srcFileRelName(srcFile));
+                var sn = new imports.ScopeNamer.ScopeNamer({
+                        tokens : tr.tokenize(txs),
+                        filename : _this.srcFileRelName(srcFile)
+                });
+                sn.buildSymbols();
                 return;
                 Seed.quit();
                 
@@ -442,7 +446,7 @@ BuildDocs = XObject.define(
                 
                 
                 
-                symbol.ignoreNamespace = this.ignoreNamespace;
+                //symbol.ignoreNamespace = this.ignoreNamespace;
                 
                 var ns = File.dirname(symbol.srcFile).replace(/\//g,'.');
                 if (symbol.alias.substring(0, ns.length) == ns) {
@@ -598,7 +602,7 @@ BuildDocs = XObject.define(
             // this stuff works...
          
             
-            var name = this.srcFileFlatName(sourceFile);
+            var name = this.srcFileFlatName(this.srcFileRelName(sourceFile)) ;
             
             this.LOG.inform("Write Source file : " + this.target+"/symbols/src/" + name + " FROM: "  + sourceFile);