Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
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
Dynare
dynare
Commits
f143b541
Commit
f143b541
authored
Aug 28, 2015
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
preprocessor: read config file before macroprocessor run.
#1039
parent
2518f6c8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
preprocessor/DynareMain.cc
+17
-6
17 additions, 6 deletions
preprocessor/DynareMain.cc
preprocessor/DynareMain2.cc
+5
-9
5 additions, 9 deletions
preprocessor/DynareMain2.cc
with
22 additions
and
15 deletions
preprocessor/DynareMain.cc
+
17
−
6
View file @
f143b541
...
...
@@ -30,15 +30,17 @@
#include
<unistd.h>
#include
"ExtendedPreprocessorTypes.hh"
#include
"ConfigFile.hh"
/* Prototype for second part of main function
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
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
,
bool
check_model_changes
,
bool
minimal_workspace
,
FileOutputType
output_mode
,
LanguageOutputType
lang
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
,
ConfigFile
&
config_file
,
WarningConsolidation
&
warnings_arg
,
bool
nostrict
,
bool
check_model_changes
,
bool
minimal_workspace
,
FileOutputType
output_mode
,
LanguageOutputType
lang
#if defined(_WIN32) || defined(__CYGWIN32__)
,
bool
cygwin
,
bool
msvc
#endif
...
...
@@ -278,6 +280,14 @@ main(int argc, char **argv)
if
(
pos
!=
string
::
npos
)
basename
.
erase
(
pos
);
WarningConsolidation
warnings
(
no_warn
);
// Process config file
ConfigFile
config_file
(
parallel
,
parallel_test
,
parallel_slave_open_mode
,
cluster_name
);
config_file
.
getConfigFileInfo
(
parallel_config_file
);
config_file
.
checkPass
(
warnings
);
config_file
.
transformPass
();
// Do macro processing
MacroDriver
m
;
...
...
@@ -301,8 +311,9 @@ main(int argc, char **argv)
return
EXIT_SUCCESS
;
// Do the rest
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
,
check_model_changes
,
minimal_workspace
,
main2
(
macro_output
,
basename
,
debug
,
clear_all
,
clear_global
,
no_tmp_terms
,
no_log
,
no_warn
,
warn_uninit
,
console
,
nograph
,
nointeractive
,
parallel
,
config_file
,
warnings
,
nostrict
,
check_model_changes
,
minimal_workspace
,
output_mode
,
language
#if defined(_WIN32) || defined(__CYGWIN32__)
,
cygwin
,
msvc
...
...
This diff is collapsed.
Click to expand it.
preprocessor/DynareMain2.cc
+
5
−
9
View file @
f143b541
...
...
@@ -25,30 +25,26 @@
#include
"ExtendedPreprocessorTypes.hh"
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
,
bool
check_model_changes
,
bool
minimal_workspace
,
FileOutputType
output_mode
,
LanguageOutputType
language
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
,
ConfigFile
&
config_file
,
WarningConsolidation
&
warnings
,
bool
nostrict
,
bool
check_model_changes
,
bool
minimal_workspace
,
FileOutputType
output_mode
,
LanguageOutputType
language
#if defined(_WIN32) || defined(__CYGWIN32__)
,
bool
cygwin
,
bool
msvc
#endif
)
{
WarningConsolidation
warnings
(
no_warn
);
ParsingDriver
p
(
warnings
,
nostrict
);
// Do parsing and construct internal representation of mod file
ModFile
*
mod_file
=
p
.
parse
(
in
,
debug
);
ConfigFile
config_file
(
parallel
,
parallel_test
,
parallel_slave_open_mode
,
cluster_name
);
config_file
.
getConfigFileInfo
(
parallel_config_file
);
// Run checking pass
mod_file
->
checkPass
();
config_file
.
checkPass
(
warnings
);
// Perform transformations on the model (creation of auxiliary vars and equations)
mod_file
->
transformPass
(
nostrict
);
config_file
.
transformPass
();
// Evaluate parameters initialization, initval, endval and pounds
mod_file
->
evalAllExpressions
(
warn_uninit
);
...
...
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