X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmain.cpp;h=ddd6b7adcda7cefc261bbb074316eccc1334d6ab;hb=b7fcb21d8f1a6edba4693c879a2930db6f2fa95e;hp=3dc37d83327f89d558784f150833ce1d8c7b9e34;hpb=70641f2eb3f9fce8c89dcbf345e202050609a142;p=l2e.git diff --git a/src/main.cpp b/src/main.cpp index 3dc37d8..ddd6b7a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,6 +25,8 @@ #include "graphics/Menu.h" #include "graphics/SimpleAnimation.h" #include "graphics/Sprite.h" +#include "loader/ParsedSource.h" +#include "loader/Parser.h" #include "sdl/InitImage.h" #include "sdl/InitScreen.h" #include "sdl/InitSDL.h" @@ -55,6 +57,8 @@ using graphics::Gauge; using graphics::Menu; using graphics::SimpleAnimation; using graphics::Sprite; +using loader::ParsedSource; +using loader::Parser; using sdl::InitImage; using sdl::InitScreen; using sdl::InitSDL; @@ -73,6 +77,14 @@ int main(int argc, char **argv) { // std::srand(std::time(0)); try { + ParsedSource source; + Parser parser("test-data/test.l2s", source); + parser.Parse(); + + cout << source; + + return 0; + InitSDL sdl; InitImage image(IMG_INIT_PNG); InitScreen screen(width, height); @@ -724,6 +736,9 @@ int main(int argc, char **argv) { app.Run(); return 0; + } catch (Parser::Error &e) { + cerr << "parsing exception in file " << e.File() << " on line " << e.Line() << ": " << e.what() << endl; + return 1; } catch (exception &e) { cerr << "exception in main(): " << e.what() << endl; return 1;