preprocessor: allow symbol.subsample=symbol.subsample
parent
c1e4155001
commit
eb20a995f2
|
@ -218,6 +218,7 @@ statement : parameters
|
||||||
| data
|
| data
|
||||||
| prior
|
| prior
|
||||||
| subsamples
|
| subsamples
|
||||||
|
| subsamples_eq
|
||||||
| varobs
|
| varobs
|
||||||
| observation_trends
|
| observation_trends
|
||||||
| unit_root_vars
|
| unit_root_vars
|
||||||
|
@ -1202,6 +1203,10 @@ subsamples : symbol '.' SUBSAMPLES '(' subsamples_name_list ')' ';'
|
||||||
{ driver.set_subsamples($1); }
|
{ driver.set_subsamples($1); }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
subsamples_eq : symbol '.' SUBSAMPLES EQUAL symbol '.' SUBSAMPLES ';'
|
||||||
|
{ driver.copy_subsamples($1, $5); }
|
||||||
|
;
|
||||||
|
|
||||||
subsamples_name_list : subsamples_name_list COMMA o_subsample_name
|
subsamples_name_list : subsamples_name_list COMMA o_subsample_name
|
||||||
| o_subsample_name
|
| o_subsample_name
|
||||||
;
|
;
|
||||||
|
|
|
@ -1234,6 +1234,21 @@ ParsingDriver::estimation_data()
|
||||||
options_list.clear();
|
options_list.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ParsingDriver::copy_subsamples(string *to_parameter, string *from_parameter)
|
||||||
|
{
|
||||||
|
check_symbol_is_parameter(to_parameter);
|
||||||
|
check_symbol_is_parameter(from_parameter);
|
||||||
|
if (subsample_declarations.find(*to_parameter) != subsample_declarations.end())
|
||||||
|
error("Parameter " + *to_parameter + " has more than one subsample statement." +
|
||||||
|
"You may only have one subsample statement per parameter.");
|
||||||
|
if (subsample_declarations.find(*from_parameter) == subsample_declarations.end())
|
||||||
|
error("Parameter " + *from_parameter + " does not have an associated subsample statement.");
|
||||||
|
subsample_declarations[*to_parameter] = subsample_declarations[*from_parameter];
|
||||||
|
delete to_parameter;
|
||||||
|
delete from_parameter;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ParsingDriver::set_subsamples(string *name)
|
ParsingDriver::set_subsamples(string *name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,6 +256,8 @@ public:
|
||||||
void set_subsample_name_equal_to_date_range(string *name, string *date1, string *date2);
|
void set_subsample_name_equal_to_date_range(string *name, string *date1, string *date2);
|
||||||
//! Adds a subsample range to the list of options for the prior statement
|
//! Adds a subsample range to the list of options for the prior statement
|
||||||
void add_subsample_range(string *parameter, string *subsample_name);
|
void add_subsample_range(string *parameter, string *subsample_name);
|
||||||
|
//! Copies the set of subsamples from_parameter to_parameter
|
||||||
|
void copy_subsamples(string *to_parameter, string *from_parameter);
|
||||||
//! Declares declare_optimal_policy_discount_factor as a parameter and initializes it to exprnode
|
//! Declares declare_optimal_policy_discount_factor as a parameter and initializes it to exprnode
|
||||||
void declare_optimal_policy_discount_factor_parameter(expr_t exprnode);
|
void declare_optimal_policy_discount_factor_parameter(expr_t exprnode);
|
||||||
//! Adds a predetermined_variable
|
//! Adds a predetermined_variable
|
||||||
|
|
Loading…
Reference in New Issue