X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=tools%2Fminiswig%2Fmain.cpp;h=46c5fa047a55a99fd7386400a2fdbc773108e621;hb=d2ed7a7f170e1a1ef9d1548e8b14292d175e0c33;hp=0140a8585c37d5ac274c99396d92c0e76663dd40;hpb=e2ccc082212e81a7bc2d299d6d5ecb7dee374de2;p=supertux.git diff --git a/tools/miniswig/main.cpp b/tools/miniswig/main.cpp index 0140a8585..46c5fa047 100644 --- a/tools/miniswig/main.cpp +++ b/tools/miniswig/main.cpp @@ -1,11 +1,13 @@ +#include + #include #include #include #include -#include "tree.h" -#include "globals.h" -#include "create_wrapper.h" -#include "create_docu.h" +#include "tree.hpp" +#include "globals.hpp" +#include "create_wrapper.hpp" +#include "create_docu.hpp" extern int yyparse(); extern int yylex(); @@ -83,7 +85,7 @@ int main(int argc, char** argv) usage(); return 1; } - + try { input = new std::ifstream(inputfile.c_str()); if(!input->good()) { @@ -97,24 +99,25 @@ int main(int argc, char** argv) 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; } @@ -126,18 +129,17 @@ int main(int argc, char** argv) 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; } -