Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
preprocessor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sébastien Villemot
preprocessor
Commits
ac4749ed
Verified
Commit
ac4749ed
authored
Feb 6, 2020
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
add undocumented `gui` option to preprocessor
parent
14be6bad
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/DynareMain.cc
+4
-1
4 additions, 1 deletion
src/DynareMain.cc
src/ModFile.cc
+6
-2
6 additions, 2 deletions
src/ModFile.cc
src/ModFile.hh
+1
-1
1 addition, 1 deletion
src/ModFile.hh
with
11 additions
and
4 deletions
src/DynareMain.cc
+
4
−
1
View file @
ac4749ed
...
@@ -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
;
...
...
...
...
This diff is collapsed.
Click to expand it.
src/ModFile.cc
+
6
−
2
View file @
ac4749ed
...
@@ -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
{
{
...
...
...
...
This diff is collapsed.
Click to expand it.
src/ModFile.hh
+
1
−
1
View file @
ac4749ed
...
@@ -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
;
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment