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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Normann Rion
preprocessor
Commits
0f24ec02
Commit
0f24ec02
authored
Dec 30, 2014
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
preprocessor: add new commandline option onlyclearglobals. closes #635
parent
8ddda0ef
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
DynareMain.cc
+10
-3
10 additions, 3 deletions
DynareMain.cc
DynareMain2.cc
+2
-2
2 additions, 2 deletions
DynareMain2.cc
ModFile.cc
+3
-1
3 additions, 1 deletion
ModFile.cc
ModFile.hh
+1
-1
1 addition, 1 deletion
ModFile.hh
with
16 additions
and
7 deletions
DynareMain.cc
+
10
−
3
View file @
0f24ec02
...
...
@@ -35,7 +35,8 @@
Splitting main() in two parts was necessary because ParsingDriver.h and MacroDriver.h can't be
included simultaneously (because of Bison limitations).
*/
void
main2
(
stringstream
&
in
,
string
&
basename
,
bool
debug
,
bool
clear_all
,
bool
no_tmp_terms
,
bool
no_log
,
bool
no_warn
,
bool
warn_uninit
,
bool
console
,
bool
nograph
,
bool
nointeractive
,
void
main2
(
stringstream
&
in
,
string
&
basename
,
bool
debug
,
bool
clear_all
,
bool
clear_global
,
bool
no_tmp_terms
,
bool
no_log
,
bool
no_warn
,
bool
warn_uninit
,
bool
console
,
bool
nograph
,
bool
nointeractive
,
bool
parallel
,
const
string
&
parallel_config_file
,
const
string
&
cluster_name
,
bool
parallel_slave_open_mode
,
bool
parallel_test
,
bool
nostrict
,
FileOutputType
output_mode
,
LanguageOutputType
lang
#if defined(_WIN32) || defined(__CYGWIN32__)
...
...
@@ -46,7 +47,7 @@ void main2(stringstream &in, string &basename, bool debug, bool clear_all, bool
void
usage
()
{
cerr
<<
"Dynare usage: dynare mod_file [debug] [noclearall] [savemacro[=macro_file]] [onlymacro] [nolinemacro] [notmpterms] [nolog] [warn_uninit]"
cerr
<<
"Dynare usage: dynare mod_file [debug] [noclearall]
[onlyclearglobals]
[savemacro[=macro_file]] [onlymacro] [nolinemacro] [notmpterms] [nolog] [warn_uninit]"
<<
" [console] [nograph] [nointeractive] [parallel[=cluster_name]] [conffile=parallel_config_path_and_filename] [parallel_slave_open_mode] [parallel_test] "
<<
" [-D<variable>[=<value>]] [nostrict] [output=dynamic|first|second|third] [language=C|C++]"
#if defined(_WIN32) || defined(__CYGWIN32__)
...
...
@@ -73,6 +74,7 @@ main(int argc, char **argv)
}
bool
clear_all
=
true
;
bool
clear_global
=
false
;
bool
save_macro
=
false
;
string
save_macro_file
;
bool
debug
=
false
;
...
...
@@ -106,6 +108,11 @@ main(int argc, char **argv)
debug
=
true
;
else
if
(
!
strcmp
(
argv
[
arg
],
"noclearall"
))
clear_all
=
false
;
else
if
(
!
strcmp
(
argv
[
arg
],
"onlyclearglobals"
))
{
clear_all
=
false
;
clear_global
=
true
;
}
else
if
(
!
strcmp
(
argv
[
arg
],
"onlymacro"
))
only_macro
=
true
;
else
if
(
strlen
(
argv
[
arg
])
>=
9
&&
!
strncmp
(
argv
[
arg
],
"savemacro"
,
9
))
...
...
@@ -277,7 +284,7 @@ main(int argc, char **argv)
return
EXIT_SUCCESS
;
// Do the rest
main2
(
macro_output
,
basename
,
debug
,
clear_all
,
no_tmp_terms
,
no_log
,
no_warn
,
warn_uninit
,
console
,
nograph
,
nointeractive
,
main2
(
macro_output
,
basename
,
debug
,
clear_all
,
clear_global
,
no_tmp_terms
,
no_log
,
no_warn
,
warn_uninit
,
console
,
nograph
,
nointeractive
,
parallel
,
parallel_config_file
,
cluster_name
,
parallel_slave_open_mode
,
parallel_test
,
nostrict
,
output_mode
,
language
#if defined(_WIN32) || defined(__CYGWIN32__)
,
cygwin
,
msvc
...
...
This diff is collapsed.
Click to expand it.
DynareMain2.cc
+
2
−
2
View file @
0f24ec02
...
...
@@ -25,7 +25,7 @@
#include
"ExtendedPreprocessorTypes.hh"
void
main2
(
stringstream
&
in
,
string
&
basename
,
bool
debug
,
bool
clear_all
,
bool
no_tmp_terms
,
bool
no_log
,
bool
no_warn
,
bool
warn_uninit
,
bool
console
,
bool
nograph
,
bool
nointeractive
,
main2
(
stringstream
&
in
,
string
&
basename
,
bool
debug
,
bool
clear_all
,
bool
clear_global
,
bool
no_tmp_terms
,
bool
no_log
,
bool
no_warn
,
bool
warn_uninit
,
bool
console
,
bool
nograph
,
bool
nointeractive
,
bool
parallel
,
const
string
&
parallel_config_file
,
const
string
&
cluster_name
,
bool
parallel_slave_open_mode
,
bool
parallel_test
,
bool
nostrict
,
FileOutputType
output_mode
,
LanguageOutputType
language
#if defined(_WIN32) || defined(__CYGWIN32__)
...
...
@@ -60,7 +60,7 @@ main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tm
if
(
output_mode
!=
none
)
mod_file
->
writeExternalFiles
(
basename
,
output_mode
,
language
);
else
mod_file
->
writeOutputFiles
(
basename
,
clear_all
,
no_log
,
no_warn
,
console
,
nograph
,
nointeractive
,
config_file
mod_file
->
writeOutputFiles
(
basename
,
clear_all
,
clear_global
,
no_log
,
no_warn
,
console
,
nograph
,
nointeractive
,
config_file
#if defined(_WIN32) || defined(__CYGWIN32__)
,
cygwin
,
msvc
#endif
...
...
This diff is collapsed.
Click to expand it.
ModFile.cc
+
3
−
1
View file @
0f24ec02
...
...
@@ -522,7 +522,7 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output)
}
void
ModFile
::
writeOutputFiles
(
const
string
&
basename
,
bool
clear_all
,
bool
no_log
,
bool
no_warn
,
bool
console
,
bool
nograph
,
bool
nointeractive
,
const
ConfigFile
&
config_file
ModFile
::
writeOutputFiles
(
const
string
&
basename
,
bool
clear_all
,
bool
clear_global
,
bool
no_log
,
bool
no_warn
,
bool
console
,
bool
nograph
,
bool
nointeractive
,
const
ConfigFile
&
config_file
#if defined(_WIN32) || defined(__CYGWIN32__)
,
bool
cygwin
,
bool
msvc
#endif
...
...
@@ -559,6 +559,8 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool no_log, b
if
(
clear_all
)
mOutputFile
<<
"clear all"
<<
endl
;
else
if
(
clear_global
)
mOutputFile
<<
"clear M_ options_ oo_ estim_params_ bayestopt_ dataset_;"
<<
endl
;
mOutputFile
<<
"tic;"
<<
endl
<<
"% Save empty dates and dseries objects in memory."
<<
endl
...
...
This diff is collapsed.
Click to expand it.
ModFile.hh
+
1
−
1
View file @
0f24ec02
...
...
@@ -136,7 +136,7 @@ public:
\param cygwin Should the MEX command of use_dll be adapted for Cygwin?
\param msvc Should the MEX command of use_dll be adapted for MSVC?
*/
void
writeOutputFiles
(
const
string
&
basename
,
bool
clear_all
,
bool
no_log
,
bool
no_warn
,
bool
console
,
bool
nograph
,
bool
nointeractive
,
const
ConfigFile
&
config_file
void
writeOutputFiles
(
const
string
&
basename
,
bool
clear_all
,
bool
clear_global
,
bool
no_log
,
bool
no_warn
,
bool
console
,
bool
nograph
,
bool
nointeractive
,
const
ConfigFile
&
config_file
#if defined(_WIN32) || defined(__CYGWIN32__)
,
bool
cygwin
,
bool
msvc
#endif
...
...
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