+#include <config.h>
+
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
+#include <cstring>
#include "tree.hpp"
#include "globals.hpp"
#include "create_wrapper.hpp"
inputfile = argv[++i];
} else if(strcmp(argv[i], "--output-cpp") == 0) {
if(i+1 >= argc) {
- std::cerr << "Need to specifiy output cpp name.\n";
+ std::cerr << "Need to specify output cpp name.\n";
usage();
return 1;
}
usage();
return 1;
}
-
+
try {
input = new std::ifstream(inputfile.c_str());
if(!input->good()) {
std_namespace->types.push_back(new StringType());
unit->namespaces.push_back(std_namespace);
unit->types.push_back(new HSQUIRRELVMType());
-
+ unit->types.push_back(new SQIntegerType());
+
yyparse();
Namespace* ns = unit;
if(selected_namespace != "") {
ns = ns->findNamespace(selected_namespace);
- }
+ }
if(outputcpp != "") {
std::ofstream cppout(outputcpp.c_str());
if(!cppout.good()) {
- std::cerr << "Couldn't open file '"
+ std::cerr << "Couldn't open file '"
<< outputcpp << "' for writing.\n";
return 1;
}
std::ofstream hppout(outputhpp.c_str());
if(!hppout.good()) {
- std::cerr << "Couldn't open file '" << outputhpp
+ std::cerr << "Couldn't open file '" << outputhpp
<< "' for writing.\n";
return 1;
}
if(output_doc != "") {
std::ofstream dout(output_doc.c_str());
if(!dout.good()) {
- std::cerr << "Couldn't open file '"
- << dout << "' for writing.\n";
+ std::cerr << "Couldn't open file '"
+ << output_doc << "' for writing.\n";
return 1;
}
DocuCreator creator(dout);
creator.create_docu(ns);
}
} catch(std::exception& e) {
- std::cerr << e.what() << "\n";
+ std::cerr << "Exception: " << e.what() << "\n";
return 1;
}
return 0;
}
-