Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dynare
preprocessor
Commits
c2cec94a
Commit
c2cec94a
authored
Feb 28, 2014
by
Sébastien Villemot
Browse files
Verify types of the symbols in estimated_params{,_init,_bounds} statements.
Closes #624
parent
2ab9614f
Changes
1
Show whitespace changes
Inline
Side-by-side
ParsingDriver.cc
View file @
c2cec94a
...
@@ -1223,8 +1223,23 @@ ParsingDriver::add_estimated_params_element()
...
@@ -1223,8 +1223,23 @@ ParsingDriver::add_estimated_params_element()
if
(
estim_params
.
name
!=
"dsge_prior_weight"
)
if
(
estim_params
.
name
!=
"dsge_prior_weight"
)
{
{
check_symbol_existence
(
estim_params
.
name
);
check_symbol_existence
(
estim_params
.
name
);
if
(
estim_params
.
name2
.
size
()
>
0
)
SymbolType
type
=
mod_file
->
symbol_table
.
getType
(
estim_params
.
name
);
switch
(
estim_params
.
type
)
{
case
1
:
if
(
type
!=
eEndogenous
&&
type
!=
eExogenous
)
error
(
estim_params
.
name
+
" must be an endogenous or an exogenous variable"
);
break
;
case
2
:
check_symbol_is_parameter
(
&
estim_params
.
name
);
break
;
case
3
:
check_symbol_existence
(
estim_params
.
name2
);
check_symbol_existence
(
estim_params
.
name2
);
SymbolType
type2
=
mod_file
->
symbol_table
.
getType
(
estim_params
.
name2
);
if
((
type
!=
eEndogenous
&&
type
!=
eExogenous
)
||
type
!=
type2
)
error
(
estim_params
.
name
+
" and "
+
estim_params
.
name2
+
" must either be both endogenous variables or both exogenous"
);
break
;
}
}
}
estim_params_list
.
push_back
(
estim_params
);
estim_params_list
.
push_back
(
estim_params
);
estim_params
.
init
(
*
data_tree
);
estim_params
.
init
(
*
data_tree
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment