#!/usr/bin/env node

DOMParser = require('xmldom').DOMParser;
Mustache = require('mustache');

var fs = require('fs');
var sd = require('../lib/sd');

var argv = process.argv;
if (argv.length < 3) {
	console.log('usage: ./emit_sim.js XMILE_FILE')
	process.exit(1);
}

fs.readFile(argv[2], function(err, data) {
	var xml = (new DOMParser()).parseFromString(data.toString(), 'application/xml');
	var ctx = new sd.Project(xml);
	var mdl = ctx.model();

	console.log(JSON.stringify(ctx.files[0], null, '    '));

	//var sim = mdl.sim(true);
});

@@ -442,18 +442,47 @@
 odel();%0A
-%0A
 %09
+var sim = mdl.sim(true);%0A%0A%09// 
 console.
@@ -533,37 +533,8 @@
 '));
-%0A%0A%09//var sim = mdl.sim(true);
 %0A%7D);

fix emit_sim