Commit ccb1f9ce authored by houtanb's avatar houtanb
Browse files

swz keywords and structure introduced for future implementation of functionality

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3174 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 4419f4aa
......@@ -154,6 +154,9 @@ class ParsingDriver;
%token MHM_FILE OUTPUT_FILE_TAG DRAWS_NBR_BURN_IN_1 DRAWS_NBR_BURN_IN_2 DRAWS_NBR_MEAN_VAR_ESTIMATE
%token DRAWS_NBR_MODIFIED_HARMONIC_MEAN DIRICHLET_SCALE
%token SBVAR MS_SBVAR
%token SVAR_IDENTIFICATION EQUATION EXCLUSION LAG UPPER_CHOLESKY LOWER_CHOLESKY
%token MARKOV_SWITCHING CHAIN STATE DURATION NUMBER_OF_STATES
%token SVAR COEFFICIENTS VARIANCES CONSTANTS
%type <node_val> expression expression_or_empty
%type <node_val> equation hand_side model_var
......@@ -231,6 +234,9 @@ statement : parameters
| conditional_forecast
| conditional_forecast_paths
| plot_conditional_forecast
| svar_identification
| markov_switching
| svar
;
dsample : DSAMPLE INT_NUMBER ';'
......@@ -591,6 +597,67 @@ det_shock_elem : VAR symbol ';' PERIODS period_list ';' VALUES value_list ';'
{ driver.add_det_shock($2, false); }
;
svar_identification : SVAR_IDENTIFICATION ';' svar_identification_list END
{ ;}
;
svar_identification_list : svar_exclusion_list
{ ;}
| UPPER_CHOLESKY ';'
{ ;}
| LOWER_CHOLESKY ';'
{ ;}
;
svar_exclusion_list : svar_exclusion_list svar_exclusion_elem
| svar_exclusion_elem
;
svar_exclusion_elem : EXCLUSION LAG INT_NUMBER ';' svar_equation_list
{ ;}
;
svar_equation_list : svar_equation_list EQUATION INT_NUMBER COMMA svar_var_list ';'
{ ;}
| EQUATION INT_NUMBER COMMA svar_var_list ';'
{ ;}
;
svar_var_list : svar_var_list COMMA symbol
{ ;}
| symbol
{ ;}
;
markov_switching : MARKOV_SWITCHING '(' ms_options_list ')' ';'
{ ;}
;
ms_options_list : ms_options_list COMMA ms_options
| ms_options
;
ms_options : o_chain
| o_state
| o_duration
| o_number_of_states
;
svar : SVAR '(' svar_options_list ')' ';'
{ ;}
;
svar_options_list : svar_options_list COMMA svar_options
| svar_options
;
svar_options : o_coefficients
| o_variances
| o_constants
| o_equation
| o_chain
;
mshocks : MSHOCKS ';' mshock_list END { driver.end_mshocks(); };
mshock_list : mshock_list det_shock_elem
......@@ -1792,6 +1859,23 @@ o_draws_nbr_mean_var_estimate : DRAWS_NBR_MEAN_VAR_ESTIMATE EQUAL INT_NUMBER {dr
o_draws_nbr_modified_harmonic_mean : DRAWS_NBR_MODIFIED_HARMONIC_MEAN EQUAL INT_NUMBER {driver.option_num("ms.draws_nbr_modified_harmonic_mean",$3); };
o_dirichlet_scale : DIRICHLET_SCALE EQUAL INT_NUMBER {driver.option_num("ms.dirichlet_scale",$3); };
o_chain : CHAIN EQUAL INT_NUMBER { ;};
o_state : STATE EQUAL INT_NUMBER { ;};
o_duration : DURATION EQUAL number
{ ;}
| DURATION EQUAL INF_CONSTANT
{ ;}
;
o_number_of_states : NUMBER_OF_STATES EQUAL INT_NUMBER { ;};
o_coefficients : COEFFICIENTS { ;};
o_variances : VARIANCES { ;};
o_constants : CONSTANTS { ;};
o_equation : EQUATION EQUAL vec_int
{ ; }
| EQUATION EQUAL INT_NUMBER
{ ; }
;
range : symbol ':' symbol
{
$1->append(":");
......
......@@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
%{
using namespace std;
......@@ -140,6 +141,9 @@ int sigma_e = 0;
<INITIAL>ms_sbvar {BEGIN DYNARE_STATEMENT; return token::MS_SBVAR;}
<INITIAL>conditional_forecast {BEGIN DYNARE_STATEMENT; return token::CONDITIONAL_FORECAST;}
<INITIAL>plot_conditional_forecast {BEGIN DYNARE_STATEMENT; return token::PLOT_CONDITIONAL_FORECAST;}
<INITIAL>markov_switching {BEGIN DYNARE_STATEMENT; return token::MARKOV_SWITCHING;}
<INITIAL>svar {BEGIN DYNARE_STATEMENT; return token::SVAR;}
/* End of a Dynare statement */
<DYNARE_STATEMENT>; {
......@@ -166,7 +170,7 @@ int sigma_e = 0;
<INITIAL>calib_var {BEGIN DYNARE_BLOCK; return token::CALIB_VAR;}
<INITIAL>homotopy_setup {BEGIN DYNARE_BLOCK; return token::HOMOTOPY_SETUP;}
<INITIAL>conditional_forecast_paths {BEGIN DYNARE_BLOCK; return token::CONDITIONAL_FORECAST_PATHS;}
<INITIAL>svar_identification {BEGIN DYNARE_BLOCK; return token::SVAR_IDENTIFICATION;}
/* End of a Dynare block */
<DYNARE_BLOCK>end[ \t\n]*; {BEGIN INITIAL; return token::END;}
......@@ -390,6 +394,19 @@ int sigma_e = 0;
<DYNARE_STATEMENT>planner_discount {return token::PLANNER_DISCOUNT;}
<DYNARE_STATEMENT>labels {return token::LABELS;}
<DYNARE_STATEMENT,DYNARE_BLOCK>equation {return token::EQUATION;}
<DYNARE_BLOCK>exclusion {return token::EXCLUSION;}
<DYNARE_BLOCK>lag {return token::LAG;}
<DYNARE_BLOCK>upper_cholesky {return token::UPPER_CHOLESKY;}
<DYNARE_BLOCK>lower_cholesky {return token::LOWER_CHOLESKY;}
<DYNARE_STATEMENT>chain {return token::CHAIN;}
<DYNARE_STATEMENT>state {return token::STATE;}
<DYNARE_STATEMENT>number_of_states {return token::NUMBER_OF_STATES;}
<DYNARE_STATEMENT>duration {return token::DURATION;}
<DYNARE_STATEMENT>coefficients {return token::COEFFICIENTS;}
<DYNARE_STATEMENT>variances {return token::VARIANCES;}
<DYNARE_STATEMENT>constants {return token::CONSTANTS;}
<DYNARE_STATEMENT>[\.] {return Dynare::parser::token_type (yytext[0]);}
<DYNARE_STATEMENT>[\\] {return Dynare::parser::token_type (yytext[0]);}
<DYNARE_STATEMENT>[\'] {return Dynare::parser::token_type (yytext[0]);}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment