#include <iostream>
#include <sstream>
#include "File.h"
#include "Global.h"
#include "Exception.h"
#include "__jet.h"

int main(int argc, char **argv) {

   coreutils::File script(argv[1]);
   script.read();
   coreutils::ZString data = script.asZString();
   data.goeol();

   jet::Global global;
   
   try {	
      coreutils::MString out;   
      jet::__jet *jet = new jet::__jet(data, out, global); 
      delete jet;
      global.outputHeaders();
      std::cout << out;
   }
   catch(coreutils::Exception e) {
      std::cout << "Error caught: " << e.text << std::endl;
      global.dump();
   }
   
}
