-// Parser("test-data/test.l2s", source).Parse();
-// Parser("test-data/ikaris.l2s", source).Parse();
-// Parser("test-data/items.l2s", source).Parse();
-// Parser("test-data/spells.l2s", source).Parse();
-// Parser("test-data/constants.l2s", source).Parse();
+ switch (args.DetectRunLevel()) {
+ case Arguments::WRITE:
+ {
+ int length(std::strlen(args.OutfilePath()));
+ switch (args.OutfilePath()[length - 1]) {
+ case 'h': {
+ std::ofstream outstream(args.OutfilePath());
+ source.WriteHeader(outstream);
+ break;
+ }
+ default: {
+ throw std::runtime_error(string("don't know how to write file ") + args.OutfilePath());
+ }
+ }
+ return 0;
+ }
+ case Arguments::DUMP: {
+ std::cout << source << std::endl;
+ return 0;
+ }
+ case Arguments::PLAY:
+ break;
+ }