X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=rconv.js;h=f40a58905440905fe06efa3479634fa10231b98e;hp=f3445010082c9a160fe4bce3cf84e8722ce5954f;hb=HEAD;hpb=8564d1e8dfc397749e07b1d65a976062fdb971fc diff --git a/rconv.js b/rconv.js index f344501..f40a589 100644 --- a/rconv.js +++ b/rconv.js @@ -2,22 +2,62 @@ * * This is a test file to convert appbuilder style application code * into javascript structures. - * + * + * + * Needs to test a while directory convert to-><-from and compare.. * * */ var RooFile = imports.JSDOC.RooFile.RooFile; +var TokenReader = imports.JSDOC.TokenReader.TokenReader; +var TextStream = imports.JSDOC.TextStream.TextStream; + +var File = imports.File.File; + + + + + +var args = Array.prototype.slice.call(Seed.argv); + +args.shift(); +args.shift(); +//print(JSON.stringify(args, null,4)); +//Seed.quit(); + var tr = new TokenReader( { keepDocs :true, keepWhite : true, keepComments : true, - sepIdents : true, - collapseWhite : false, - filename : fn + sepIdents : false, + collapseWhite : true, + filename : args[0], + ignoreBadGrammer: true }); +var str = File.read(args[0]) var toks = tr.tokenize(new TextStream(str)); + + +var rf = new RooFile(toks); +//print(JSON.stringify(rf.tokens, null,4));Seed.quit(); + + + + +rf.parse(); + +print("------------ in ------------------"); +print(str); +print("------------ out ------------------"); + +print(JSON.stringify(rf.cfg, null,4)); + +print("------------ was ------------------"); + +print(File.read(args[0].replace(/\.js$/,'.bjs'))); +