Skip to content
Snippets Groups Projects
Verified Commit ac4749ed authored by Houtan Bastani's avatar Houtan Bastani
Browse files

add undocumented `gui` option to preprocessor

parent 14be6bad
Branches
No related tags found
No related merge requests found
...@@ -145,6 +145,7 @@ main(int argc, char **argv) ...@@ -145,6 +145,7 @@ main(int argc, char **argv)
bool minimal_workspace = false; bool minimal_workspace = false;
bool compute_xrefs = false; bool compute_xrefs = false;
bool transform_unary_ops = false; bool transform_unary_ops = false;
bool gui = false;
string exclude_eqs, include_eqs; string exclude_eqs, include_eqs;
vector<pair<string, string>> defines; vector<pair<string, string>> defines;
vector<filesystem::path> paths; vector<filesystem::path> paths;
...@@ -390,6 +391,8 @@ main(int argc, char **argv) ...@@ -390,6 +391,8 @@ main(int argc, char **argv)
} }
else if (s == "onlymodel") else if (s == "onlymodel")
onlymodel = true; onlymodel = true;
else if (s == "gui")
gui = true;
else else
{ {
cerr << "Unknown option: " << s << endl; cerr << "Unknown option: " << s << endl;
...@@ -471,7 +474,7 @@ main(int argc, char **argv) ...@@ -471,7 +474,7 @@ main(int argc, char **argv)
else else
mod_file->writeOutputFiles(basename, clear_all, clear_global, no_log, no_warn, console, nograph, mod_file->writeOutputFiles(basename, clear_all, clear_global, no_log, no_warn, console, nograph,
nointeractive, config_file, check_model_changes, minimal_workspace, compute_xrefs, nointeractive, config_file, check_model_changes, minimal_workspace, compute_xrefs,
mexext, matlabroot, dynareroot, onlymodel); mexext, matlabroot, dynareroot, onlymodel, gui);
cout << "Preprocessing completed." << endl; cout << "Preprocessing completed." << endl;
return EXIT_SUCCESS; return EXIT_SUCCESS;
... ...
......
...@@ -839,7 +839,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo ...@@ -839,7 +839,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
bool check_model_changes, bool minimal_workspace, bool compute_xrefs, bool check_model_changes, bool minimal_workspace, bool compute_xrefs,
const string &mexext, const string &mexext,
const filesystem::path &matlabroot, const filesystem::path &matlabroot,
const filesystem::path &dynareroot, bool onlymodel) const const filesystem::path &dynareroot, bool onlymodel, bool gui) const
{ {
bool hasModelChanged = !dynamic_model.isChecksumMatching(basename, block) || !check_model_changes; bool hasModelChanged = !dynamic_model.isChecksumMatching(basename, block) || !check_model_changes;
if (hasModelChanged) if (hasModelChanged)
...@@ -1024,7 +1024,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo ...@@ -1024,7 +1024,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
static_model.writeOutput(mOutputFile, block); static_model.writeOutput(mOutputFile, block);
} }
if (onlymodel) if (onlymodel || gui)
for (const auto &statement : statements) for (const auto &statement : statements)
{ {
/* Special treatment for initval block: insert initial values for the /* Special treatment for initval block: insert initial values for the
...@@ -1054,6 +1054,10 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo ...@@ -1054,6 +1054,10 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
if (auto sgs = dynamic_cast<ShockGroupsStatement *>(statement.get()); sgs) if (auto sgs = dynamic_cast<ShockGroupsStatement *>(statement.get()); sgs)
sgs->writeOutput(mOutputFile, basename, minimal_workspace); sgs->writeOutput(mOutputFile, basename, minimal_workspace);
if (gui)
if (auto it = dynamic_cast<NativeStatement *>(statement.get()); it)
it->writeOutput(mOutputFile, basename, minimal_workspace);
} }
else else
{ {
... ...
......
...@@ -168,7 +168,7 @@ public: ...@@ -168,7 +168,7 @@ public:
bool console, bool nograph, bool nointeractive, const ConfigFile &config_file, bool console, bool nograph, bool nointeractive, const ConfigFile &config_file,
bool check_model_changes, bool minimal_workspace, bool compute_xrefs, bool check_model_changes, bool minimal_workspace, bool compute_xrefs,
const string &mexext, const filesystem::path &matlabroot, const string &mexext, const filesystem::path &matlabroot,
const filesystem::path &dynareroot, bool onlymodel) const; const filesystem::path &dynareroot, bool onlymodel, bool gui) const;
void writeExternalFiles(const string &basename, LanguageOutputType language) const; void writeExternalFiles(const string &basename, LanguageOutputType language) const;
void writeExternalFilesJulia(const string &basename) const; void writeExternalFilesJulia(const string &basename) const;
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment