diff --git a/src/mod_converter/mod_converter.cpp b/src/mod_converter/mod_converter.cpp index 0a137b8..2569f64 100644 --- a/src/mod_converter/mod_converter.cpp +++ b/src/mod_converter/mod_converter.cpp @@ -64,6 +64,7 @@ try { args::ArgumentParser parser("mmo extractor"); args::HelpFlag help(parser, "help", "Display this help menu", { 'h', "help" }); + args::Flag af(parser, "a", "All formats", { 'a' }); args::Flag mr(parser, "mr", "AIM Racing MOD file", { "mr" }); args::Positional file_path(parser, "file or directory", "MOD_ file or directory with MOD_ files"); parser.Prog(argv[0]); @@ -72,6 +73,8 @@ try if (mr) gameType = GameType::AimR; + if (af) + all_formats = true; p = file_path.Get(); if (fs::is_regular_file(p)) diff --git a/src/script2txt/grammar.yy b/src/script2txt/grammar.yy index 1dafa2f..079c86d 100644 --- a/src/script2txt/grammar.yy +++ b/src/script2txt/grammar.yy @@ -1,4 +1,22 @@ %{ +/* + * AIM tm_converter + * Copyright (C) 2015 lzwdgc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include @@ -28,16 +46,16 @@ %define api.token.constructor // C++ style of handling variants %define parse.assert // check C++ variant types -%code requires // forward decl of C++ driver (our parser) in HPP +%code requires // forward decl of C++ driver (our parser) in HPP { -#include - -class ParserDriver; -} - -// param to yy::parser() constructor -// the parsing context -%param { ParserDriver &driver } +#include + +class ParserDriver; +} + +// param to yy::parser() constructor +// the parsing context +%param { ParserDriver &driver } //////////////////////////////////////// @@ -310,7 +328,7 @@ integer: INTEGER %% -void yy::parser::error(const location_type& l, const std::string& m) -{ - driver.error(l, m); -} +void yy::parser::error(const location_type& l, const std::string& m) +{ + driver.error(l, m); +} diff --git a/src/script2txt/lexer.ll b/src/script2txt/lexer.ll index 0fe6fc5..44a0be4 100644 --- a/src/script2txt/lexer.ll +++ b/src/script2txt/lexer.ll @@ -1,4 +1,22 @@ %{ +/* + * AIM tm_converter + * Copyright (C) 2015 lzwdgc + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #pragma warning(disable: 4005) #include @@ -34,11 +52,11 @@ STRING [[:alpha:]_-][[:alnum:]_-]* %x user_string -%% - -%{ - // Code run each time yylex is called. - loc.step(); +%% + +%{ + // Code run each time yylex is called. + loc.step(); %} #.*/\n ; // ignore comments @@ -49,7 +67,7 @@ STRING [[:alpha:]_-][[:alnum:]_-]* loc.lines(yyleng); loc.step(); } - + ";" return MAKE(SEMICOLON); ":" return MAKE(COLON); "(" return MAKE(L_BRACKET);