v4: corrected bug in ; after end at end of Dynare blocks

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@518 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2005-11-24 15:54:00 +00:00
parent 055d452835
commit dd557a7c8c
2 changed files with 13 additions and 12 deletions

View File

@ -257,12 +257,12 @@
| comma_expression COMMA expression {$$ = _parser->add_expression_token($1,$3,$2);} | comma_expression COMMA expression {$$ = _parser->add_expression_token($1,$3,$2);}
initval initval
: INITVAL ';' {_parser->begin_initval();} initval_list END ';' : INITVAL ';' {_parser->begin_initval();} initval_list END
{_parser->end_initval();} {_parser->end_initval();}
; ;
endval endval
: ENDVAL ';' {_parser->begin_endval();} initval_list END ';' : ENDVAL ';' {_parser->begin_endval();} initval_list END
{_parser->end_endval();} {_parser->end_endval();}
; ;
@ -277,7 +277,7 @@
; ;
histval histval
: HISTVAL ';' {_parser->begin_histval();} histval_list END ';' : HISTVAL ';' {_parser->begin_histval();} histval_list END
histval_list histval_list
: histval_list histval_elem : histval_list histval_elem
@ -290,11 +290,11 @@
; ;
model model
: MODEL ';' equation_list END ';' : MODEL ';' equation_list END
{_parser->check_model();} {_parser->check_model();}
| MODEL '(' LINEAR ')' ';' {_parser->option_num("linear","1");} equation_list END ';' | MODEL '(' LINEAR ')' ';' {_parser->option_num("linear","1");} equation_list END
{_parser->check_model();} {_parser->check_model();}
| MODEL '(' USE_DLL ')' ';' {_parser->use_dll();} equation_list END ';' | MODEL '(' USE_DLL ')' ';' {_parser->use_dll();} equation_list END
{_parser->check_model();} {_parser->check_model();}
; ;
@ -363,7 +363,7 @@
; ;
shocks shocks
: SHOCKS ';' {_parser->begin_shocks();} shock_list END ';' : SHOCKS ';' {_parser->begin_shocks();} shock_list END
; ;
shock_list shock_list
@ -567,7 +567,7 @@
; ;
estimated_params estimated_params
: ESTIMATED_PARAMS ';' {_parser->estimation_init();} estimated_list END ';' : ESTIMATED_PARAMS ';' {_parser->estimation_init();} estimated_list END
; ;
estimated_list estimated_list
@ -639,7 +639,7 @@
} }
; ;
estimated_params_init: ESTIMATED_PARAMS_INIT ';' estimated_init_list END ';' estimated_params_init: ESTIMATED_PARAMS_INIT ';' estimated_init_list END
; ;
estimated_init_list : estimated_init_list estimated_init_elem estimated_init_list : estimated_init_list estimated_init_elem
@ -666,7 +666,7 @@
} }
; ;
estimated_params_bounds: ESTIMATED_PARAMS_BOUNDS ';' estimated_bounds_list END ';' estimated_params_bounds: ESTIMATED_PARAMS_BOUNDS ';' estimated_bounds_list END
; ;
estimated_bounds_list : estimated_bounds_list estimated_bounds_elem estimated_bounds_list : estimated_bounds_list estimated_bounds_elem
@ -787,7 +787,7 @@
; ;
observation_trends observation_trends
: OBSERVATION_TRENDS ';' {_parser->set_trend_init();} trend_list END ';' : OBSERVATION_TRENDS ';' {_parser->set_trend_init();} trend_list END
; ;
trend_list trend_list

View File

@ -86,7 +86,7 @@ int sigma_e = 0;
<INITIAL>optim_weights {BEGIN DYNARE_BLOCK;return OPTIM_WEIGHTS;} <INITIAL>optim_weights {BEGIN DYNARE_BLOCK;return OPTIM_WEIGHTS;}
/* End of a Dynare block */ /* End of a Dynare block */
<DYNARE_BLOCK>end {BEGIN INITIAL;return END;} <DYNARE_BLOCK>end[ \t\n]*; {BEGIN INITIAL;return END;}
/* Inside of a Dynare statement */ /* Inside of a Dynare statement */
<DYNARE_STATEMENT>datafile {return DATAFILE;} <DYNARE_STATEMENT>datafile {return DATAFILE;}
@ -242,6 +242,7 @@ int sigma_e = 0;
_scanner->do_as_is(yytext); _scanner->do_as_is(yytext);
} }
} }
<INITIAL>. {BEGIN NATIVE; _scanner->do_as_is(yytext);}
/* NATIVE Block */ /* NATIVE Block */
<NATIVE>.* {BEGIN INITIAL;_scanner->do_as_is(yytext);_scanner->do_as_is("\n");} <NATIVE>.* {BEGIN INITIAL;_scanner->do_as_is(yytext);_scanner->do_as_is("\n");}