mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-26 06:49:33 +00:00
-I and -D command line options (specify include paths/defines)
This commit is contained in:
parent
30abda2087
commit
8b723e5685
@ -28,6 +28,8 @@ int main(int argc, const char *argv[])
|
||||
("output,o", po::value<std::string>()->default_value("rez.output.rsrc"), "output file")
|
||||
("type,t", po::value<std::string>()->default_value("rsrc"), "output file finder type code")
|
||||
("creator,c", po::value<std::string>()->default_value("RSED"), "output file finder creator code")
|
||||
("define,D", po::value<std::vector<std::string>>(), "predefine preprocessor symbol")
|
||||
("include,I", po::value<std::vector<std::string>>(), "add include file path")
|
||||
("debug,d", "debug logging")
|
||||
;
|
||||
po::options_description hidden, alldesc;
|
||||
@ -71,6 +73,13 @@ int main(int argc, const char *argv[])
|
||||
for(std::string fn : options["input"].as<std::vector<std::string>>())
|
||||
{
|
||||
RezLexer lexer(fn);
|
||||
|
||||
for(std::string define : options["define"].as<std::vector<std::string>>())
|
||||
lexer.addDefine(define);
|
||||
for(std::string path : options["include"].as<std::vector<std::string>>())
|
||||
lexer.addIncludePath(path);
|
||||
|
||||
|
||||
RezParser parser(lexer, world);
|
||||
parser.parse();
|
||||
}
|
||||
|
@ -101,6 +101,18 @@ RezLexer::~RezLexer()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RezLexer::addDefine(std::string str)
|
||||
{
|
||||
pImpl->ctx.add_macro_definition(str);
|
||||
}
|
||||
|
||||
void RezLexer::addIncludePath(std::string path)
|
||||
{
|
||||
pImpl->ctx.add_include_path(path.c_str());
|
||||
}
|
||||
|
||||
bool RezLexer::atEnd()
|
||||
{
|
||||
return pImpl->iter == pImpl->ctx.end();
|
||||
|
@ -23,6 +23,9 @@ public:
|
||||
~RezLexer();
|
||||
|
||||
RezSymbol nextToken();
|
||||
|
||||
void addDefine(std::string str);
|
||||
void addIncludePath(std::string path);
|
||||
};
|
||||
|
||||
#endif // REZLEXER_H
|
||||
|
Loading…
Reference in New Issue
Block a user