2009-09-09 15:15:02 +02:00
|
|
|
/*
|
2013-01-11 17:27:19 +01:00
|
|
|
* Copyright (C) 2003-2013 Dynare Team
|
2009-09-09 15:15:02 +02:00
|
|
|
*
|
|
|
|
* This file is part of Dynare.
|
|
|
|
*
|
|
|
|
* Dynare is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Dynare is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2009-11-30 01:38:26 +01:00
|
|
|
|
2009-09-09 15:15:02 +02:00
|
|
|
%{
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
#include <cstring>
|
|
|
|
#include "ParsingDriver.hh"
|
|
|
|
|
|
|
|
// Announce to Flex the prototype we want for lexing function
|
|
|
|
#define YY_DECL \
|
|
|
|
Dynare::parser::token_type \
|
|
|
|
DynareFlex::lex(Dynare::parser::semantic_type *yylval, \
|
|
|
|
Dynare::parser::location_type *yylloc, \
|
|
|
|
ParsingDriver &driver)
|
|
|
|
|
|
|
|
// Shortcut to access tokens defined by Bison
|
|
|
|
typedef Dynare::parser::token token;
|
|
|
|
|
|
|
|
/* By default yylex returns int, we use token_type.
|
|
|
|
Unfortunately yyterminate by default returns 0, which is
|
|
|
|
not of token_type. */
|
|
|
|
#define yyterminate() return Dynare::parser::token_type (0);
|
|
|
|
|
|
|
|
int comment_caller, line_caller;
|
|
|
|
/* Particular value : when sigma_e command is found
|
|
|
|
this flag is set to 1, when command finished it is set to 0
|
|
|
|
*/
|
|
|
|
int sigma_e = 0;
|
2010-06-18 12:39:29 +02:00
|
|
|
string eofbuff;
|
2009-09-09 15:15:02 +02:00
|
|
|
%}
|
|
|
|
|
|
|
|
%option c++
|
|
|
|
|
|
|
|
%option prefix="Dynare"
|
|
|
|
|
|
|
|
%option case-insensitive noyywrap nounput batch debug never-interactive
|
|
|
|
|
2010-08-30 14:37:48 +02:00
|
|
|
/* NB: if new start conditions are defined, add them in the line for <<EOF>> */
|
2009-09-09 15:15:02 +02:00
|
|
|
%x COMMENT
|
|
|
|
%x DYNARE_STATEMENT
|
|
|
|
%x DYNARE_BLOCK
|
2013-08-13 19:37:14 +02:00
|
|
|
%x VERBATIM_BLOCK
|
2009-09-09 15:15:02 +02:00
|
|
|
%x NATIVE
|
2010-06-18 12:39:29 +02:00
|
|
|
%x NATIVE_COMMENT
|
2013-10-22 17:57:44 +02:00
|
|
|
%x DATES_STATEMENT
|
2009-09-09 15:15:02 +02:00
|
|
|
%x LINE1
|
|
|
|
%x LINE2
|
|
|
|
%x LINE3
|
|
|
|
|
|
|
|
%{
|
|
|
|
// Increments location counter for every token read
|
2010-08-30 14:37:48 +02:00
|
|
|
#define YY_USER_ACTION location_increment(yylloc, yytext);
|
2009-09-09 15:15:02 +02:00
|
|
|
%}
|
2013-11-18 16:29:21 +01:00
|
|
|
|
|
|
|
DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2]))
|
|
|
|
|
2009-09-09 15:15:02 +02:00
|
|
|
%%
|
|
|
|
/* Code put at the beginning of yylex() */
|
|
|
|
%{
|
|
|
|
// Reset location before reading token
|
|
|
|
yylloc->step();
|
|
|
|
%}
|
|
|
|
|
|
|
|
/* Rules for matching $line directives */
|
|
|
|
<*>^@#line\ \" { line_caller = YYSTATE; BEGIN(LINE1); }
|
|
|
|
<LINE1>[^\"]* {
|
|
|
|
filename = string(yytext);
|
|
|
|
BEGIN(LINE2);
|
|
|
|
}
|
|
|
|
<LINE2>\" BEGIN(LINE3);
|
|
|
|
<LINE3>[0-9]+ {
|
|
|
|
yylloc->begin.line = yylloc->end.line = atoi(yytext) - 1;
|
|
|
|
BEGIN(line_caller);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* spaces, tabs and carriage returns are ignored */
|
2013-10-22 17:57:44 +02:00
|
|
|
<INITIAL,DYNARE_STATEMENT,DYNARE_BLOCK,COMMENT,DATES_STATEMENT,LINE1,LINE2,LINE3>[ \t\r\f]+ { yylloc->step(); }
|
|
|
|
<INITIAL,DYNARE_STATEMENT,DYNARE_BLOCK,COMMENT,DATES_STATEMENT,LINE1,LINE2,LINE3>[\n]+ { yylloc->step(); }
|
2009-09-09 15:15:02 +02:00
|
|
|
|
|
|
|
/* Comments */
|
2013-10-22 17:57:44 +02:00
|
|
|
<INITIAL,DYNARE_STATEMENT,DYNARE_BLOCK,DATES_STATEMENT>["%"].*
|
|
|
|
<INITIAL,DYNARE_STATEMENT,DYNARE_BLOCK,DATES_STATEMENT>["/"]["/"].*
|
|
|
|
<INITIAL,DYNARE_STATEMENT,DYNARE_BLOCK,DATES_STATEMENT>"/*" {comment_caller = YY_START; BEGIN COMMENT;}
|
2009-09-09 15:15:02 +02:00
|
|
|
|
|
|
|
<COMMENT>"*/" {BEGIN comment_caller;}
|
|
|
|
<COMMENT>.
|
|
|
|
|
|
|
|
/* Begin of a Dynare statement */
|
|
|
|
<INITIAL>var {BEGIN DYNARE_STATEMENT; return token::VAR;}
|
|
|
|
<INITIAL>varexo {BEGIN DYNARE_STATEMENT; return token::VAREXO;}
|
|
|
|
<INITIAL>varexo_det {BEGIN DYNARE_STATEMENT; return token::VAREXO_DET;}
|
2010-10-15 19:05:16 +02:00
|
|
|
<INITIAL>trend_var {BEGIN DYNARE_STATEMENT; return token::TREND_VAR;}
|
2013-03-26 16:46:18 +01:00
|
|
|
<INITIAL>log_trend_var {BEGIN DYNARE_STATEMENT; return token::LOG_TREND_VAR;}
|
2009-11-07 19:37:11 +01:00
|
|
|
<INITIAL>predetermined_variables {BEGIN DYNARE_STATEMENT; return token::PREDETERMINED_VARIABLES;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<INITIAL>parameters {BEGIN DYNARE_STATEMENT; return token::PARAMETERS;}
|
|
|
|
<INITIAL>periods {BEGIN DYNARE_STATEMENT; return token::PERIODS;}
|
|
|
|
<INITIAL>model_info {BEGIN DYNARE_STATEMENT; return token::MODEL_INFO;}
|
|
|
|
<INITIAL>estimation {BEGIN DYNARE_STATEMENT; return token::ESTIMATION;}
|
2011-11-29 17:14:26 +01:00
|
|
|
<INITIAL>set_time {BEGIN DYNARE_STATEMENT; return token::SET_TIME;}
|
2011-12-06 15:42:57 +01:00
|
|
|
<INITIAL>data {BEGIN DYNARE_STATEMENT; return token::DATA;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<INITIAL>varobs {BEGIN DYNARE_STATEMENT; return token::VAROBS;}
|
|
|
|
<INITIAL>unit_root_vars {BEGIN DYNARE_STATEMENT; return token::UNIT_ROOT_VARS;}
|
|
|
|
<INITIAL>rplot {BEGIN DYNARE_STATEMENT; return token::RPLOT;}
|
|
|
|
<INITIAL>osr_params {BEGIN DYNARE_STATEMENT; return token::OSR_PARAMS;}
|
|
|
|
<INITIAL>osr {BEGIN DYNARE_STATEMENT; return token::OSR;}
|
|
|
|
<INITIAL>dynatype {BEGIN DYNARE_STATEMENT; return token::DYNATYPE;}
|
|
|
|
<INITIAL>dynasave {BEGIN DYNARE_STATEMENT; return token::DYNASAVE;}
|
|
|
|
<INITIAL>model_comparison {BEGIN DYNARE_STATEMENT; return token::MODEL_COMPARISON;}
|
|
|
|
<INITIAL>change_type {BEGIN DYNARE_STATEMENT; return token::CHANGE_TYPE;}
|
|
|
|
<INITIAL>load_params_and_steady_state {BEGIN DYNARE_STATEMENT; return token::LOAD_PARAMS_AND_STEADY_STATE;}
|
|
|
|
<INITIAL>save_params_and_steady_state {BEGIN DYNARE_STATEMENT; return token::SAVE_PARAMS_AND_STEADY_STATE;}
|
|
|
|
<INITIAL>write_latex_dynamic_model {BEGIN DYNARE_STATEMENT; return token::WRITE_LATEX_DYNAMIC_MODEL;}
|
|
|
|
<INITIAL>write_latex_static_model {BEGIN DYNARE_STATEMENT; return token::WRITE_LATEX_STATIC_MODEL;}
|
|
|
|
|
|
|
|
<INITIAL>steady {BEGIN DYNARE_STATEMENT; return token::STEADY;}
|
|
|
|
<INITIAL>check {BEGIN DYNARE_STATEMENT; return token::CHECK;}
|
|
|
|
<INITIAL>simul {BEGIN DYNARE_STATEMENT; return token::SIMUL;}
|
|
|
|
<INITIAL>stoch_simul {BEGIN DYNARE_STATEMENT; return token::STOCH_SIMUL;}
|
|
|
|
<INITIAL>dsample {BEGIN DYNARE_STATEMENT; return token::DSAMPLE;}
|
|
|
|
<INITIAL>Sigma_e {BEGIN DYNARE_STATEMENT; sigma_e = 1; return token::SIGMA_E;}
|
|
|
|
<INITIAL>planner_objective {BEGIN DYNARE_STATEMENT; return token::PLANNER_OBJECTIVE;}
|
|
|
|
<INITIAL>ramsey_policy {BEGIN DYNARE_STATEMENT; return token::RAMSEY_POLICY;}
|
2011-03-13 21:19:55 +01:00
|
|
|
<INITIAL>discretionary_policy {BEGIN DYNARE_STATEMENT; return token::DISCRETIONARY_POLICY;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<INITIAL>identification {BEGIN DYNARE_STATEMENT; return token::IDENTIFICATION;}
|
|
|
|
|
|
|
|
<INITIAL>bvar_density {BEGIN DYNARE_STATEMENT; return token::BVAR_DENSITY; }
|
|
|
|
<INITIAL>bvar_forecast {BEGIN DYNARE_STATEMENT; return token::BVAR_FORECAST; }
|
|
|
|
<INITIAL>dynare_sensitivity {BEGIN DYNARE_STATEMENT; return token::DYNARE_SENSITIVITY;}
|
|
|
|
<INITIAL>initval_file {BEGIN DYNARE_STATEMENT; return token::INITVAL_FILE;}
|
|
|
|
<INITIAL>forecast {BEGIN DYNARE_STATEMENT; return token::FORECAST;}
|
|
|
|
<INITIAL>shock_decomposition {BEGIN DYNARE_STATEMENT; return token::SHOCK_DECOMPOSITION;}
|
|
|
|
<INITIAL>sbvar {BEGIN DYNARE_STATEMENT; return token::SBVAR;}
|
2011-05-11 19:02:39 +02:00
|
|
|
<INITIAL>ms_estimation {BEGIN DYNARE_STATEMENT; return token::MS_ESTIMATION;}
|
|
|
|
<INITIAL>ms_simulation {BEGIN DYNARE_STATEMENT; return token::MS_SIMULATION;}
|
|
|
|
<INITIAL>ms_compute_mdd {BEGIN DYNARE_STATEMENT; return token::MS_COMPUTE_MDD;}
|
|
|
|
<INITIAL>ms_compute_probabilities {BEGIN DYNARE_STATEMENT; return token::MS_COMPUTE_PROBABILITIES;}
|
|
|
|
<INITIAL>ms_forecast {BEGIN DYNARE_STATEMENT; return token::MS_FORECAST;}
|
|
|
|
<INITIAL>ms_irf {BEGIN DYNARE_STATEMENT; return token::MS_IRF;}
|
|
|
|
<INITIAL>ms_variance_decomposition {BEGIN DYNARE_STATEMENT; return token::MS_VARIANCE_DECOMPOSITION;}
|
2009-10-16 19:23:57 +02:00
|
|
|
<INITIAL>conditional_forecast {BEGIN DYNARE_STATEMENT; return token::CONDITIONAL_FORECAST;}
|
|
|
|
<INITIAL>plot_conditional_forecast {BEGIN DYNARE_STATEMENT; return token::PLOT_CONDITIONAL_FORECAST;}
|
2009-11-30 01:38:26 +01:00
|
|
|
|
|
|
|
<INITIAL>markov_switching {BEGIN DYNARE_STATEMENT; return token::MARKOV_SWITCHING;}
|
|
|
|
<INITIAL>svar {BEGIN DYNARE_STATEMENT; return token::SVAR;}
|
2010-02-22 17:33:38 +01:00
|
|
|
<INITIAL>external_function {BEGIN DYNARE_STATEMENT; return token::EXTERNAL_FUNCTION;}
|
2009-09-09 15:15:02 +02:00
|
|
|
/* End of a Dynare statement */
|
2012-05-30 16:28:00 +02:00
|
|
|
<INITIAL>calib_smoother { BEGIN DYNARE_STATEMENT; return token::CALIB_SMOOTHER; }
|
2012-11-16 12:34:49 +01:00
|
|
|
<INITIAL>model_diagnostics {BEGIN DYNARE_STATEMENT; return token::MODEL_DIAGNOSTICS;}
|
2013-06-07 17:16:12 +02:00
|
|
|
<INITIAL>extended_path {BEGIN DYNARE_STATEMENT; return token::EXTENDED_PATH;}
|
2009-09-09 15:15:02 +02:00
|
|
|
|
|
|
|
<DYNARE_STATEMENT>; {
|
|
|
|
if (!sigma_e)
|
|
|
|
BEGIN INITIAL;
|
|
|
|
return Dynare::parser::token_type (yytext[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Begin of a Dynare block */
|
|
|
|
<INITIAL>model {BEGIN DYNARE_BLOCK; return token::MODEL;}
|
2010-04-23 18:39:07 +02:00
|
|
|
<INITIAL>steady_state_model {BEGIN DYNARE_BLOCK; return token::STEADY_STATE_MODEL;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<INITIAL>initval {BEGIN DYNARE_BLOCK; return token::INITVAL;}
|
|
|
|
<INITIAL>endval {BEGIN DYNARE_BLOCK; return token::ENDVAL;}
|
|
|
|
<INITIAL>histval {BEGIN DYNARE_BLOCK; return token::HISTVAL;}
|
|
|
|
<INITIAL>shocks {BEGIN DYNARE_BLOCK; return token::SHOCKS;}
|
2009-09-25 14:48:09 +02:00
|
|
|
<INITIAL>mshocks {BEGIN DYNARE_BLOCK; return token::MSHOCKS;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<INITIAL>estimated_params {BEGIN DYNARE_BLOCK; return token::ESTIMATED_PARAMS;}
|
|
|
|
/* priors is an alias for estimated_params */
|
|
|
|
<INITIAL>priors {BEGIN DYNARE_BLOCK;return token::ESTIMATED_PARAMS;}
|
|
|
|
<INITIAL>estimated_params_init {BEGIN DYNARE_BLOCK; return token::ESTIMATED_PARAMS_INIT;}
|
|
|
|
<INITIAL>estimated_params_bounds {BEGIN DYNARE_BLOCK; return token::ESTIMATED_PARAMS_BOUNDS;}
|
|
|
|
<INITIAL>observation_trends {BEGIN DYNARE_BLOCK; return token::OBSERVATION_TRENDS;}
|
|
|
|
<INITIAL>optim_weights {BEGIN DYNARE_BLOCK; return token::OPTIM_WEIGHTS;}
|
|
|
|
<INITIAL>homotopy_setup {BEGIN DYNARE_BLOCK; return token::HOMOTOPY_SETUP;}
|
2009-10-16 19:23:57 +02:00
|
|
|
<INITIAL>conditional_forecast_paths {BEGIN DYNARE_BLOCK; return token::CONDITIONAL_FORECAST_PATHS;}
|
2009-11-30 01:38:26 +01:00
|
|
|
<INITIAL>svar_identification {BEGIN DYNARE_BLOCK; return token::SVAR_IDENTIFICATION;}
|
2010-08-30 14:16:07 +02:00
|
|
|
|
|
|
|
/* For the semicolon after an "end" keyword */
|
|
|
|
<INITIAL>; {return Dynare::parser::token_type (yytext[0]);}
|
|
|
|
|
2009-09-09 15:15:02 +02:00
|
|
|
/* End of a Dynare block */
|
2010-08-30 14:16:07 +02:00
|
|
|
<DYNARE_BLOCK>end {BEGIN INITIAL; return token::END;}
|
2009-09-09 15:15:02 +02:00
|
|
|
|
2011-12-14 13:58:21 +01:00
|
|
|
<DYNARE_STATEMENT>subsamples {return token::SUBSAMPLES;}
|
2011-12-14 17:19:14 +01:00
|
|
|
<DYNARE_STATEMENT>options {return token::OPTIONS;}
|
2013-11-04 15:42:59 +01:00
|
|
|
<DYNARE_STATEMENT>prior {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::PRIOR;
|
|
|
|
}
|
2011-12-11 15:35:26 +01:00
|
|
|
<INITIAL>std {BEGIN DYNARE_STATEMENT; return token::STD;}
|
|
|
|
<INITIAL>corr {BEGIN DYNARE_STATEMENT; return token::CORR;}
|
|
|
|
|
2009-09-09 15:15:02 +02:00
|
|
|
/* Inside of a Dynare statement */
|
2013-11-18 16:29:21 +01:00
|
|
|
<DYNARE_STATEMENT>{DATE} {
|
|
|
|
char *yycopy = strdup(yytext);
|
|
|
|
char *uput = yycopy + yyleng;
|
|
|
|
unput(')');
|
|
|
|
unput('\'');
|
|
|
|
while (uput > yycopy)
|
|
|
|
unput(*--uput);
|
|
|
|
unput('\'');
|
|
|
|
unput('(');
|
|
|
|
unput('s');
|
|
|
|
unput('e');
|
|
|
|
unput('t');
|
|
|
|
unput('a');
|
|
|
|
unput('d');
|
|
|
|
free( yycopy );
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>${DATE} { yylloc->step(); *yyout << yytext + 1; }
|
|
|
|
<DYNARE_STATEMENT>dates {dates_parens_nb=0; BEGIN DATES_STATEMENT; yylval->string_val = new string("dates");}
|
2011-12-06 15:42:57 +01:00
|
|
|
<DYNARE_STATEMENT>file {return token::FILE;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>datafile {return token::DATAFILE;}
|
|
|
|
<DYNARE_STATEMENT>nobs {return token::NOBS;}
|
2011-12-06 15:42:57 +01:00
|
|
|
<DYNARE_STATEMENT>last_obs {return token::LAST_OBS;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>first_obs {return token::FIRST_OBS;}
|
2011-12-11 15:35:26 +01:00
|
|
|
<DYNARE_STATEMENT>mean {return token::MEAN;}
|
|
|
|
<DYNARE_STATEMENT>stdev {return token::STDEV;}
|
2012-03-15 14:33:02 +01:00
|
|
|
<DYNARE_STATEMENT>truncate {return token::TRUNCATE;}
|
2011-12-11 15:35:26 +01:00
|
|
|
<DYNARE_STATEMENT>domain {return token::DOMAINN;}
|
|
|
|
<DYNARE_STATEMENT>variance {return token::VARIANCE;}
|
|
|
|
<DYNARE_STATEMENT>mode {return token::MODE;}
|
|
|
|
<DYNARE_STATEMENT>interval {return token::INTERVAL;}
|
|
|
|
<DYNARE_STATEMENT>shape {return token::SHAPE;}
|
|
|
|
<DYNARE_STATEMENT>shift {return token::SHIFT;}
|
2011-12-14 17:19:14 +01:00
|
|
|
<DYNARE_STATEMENT>bounds {return token::BOUNDS;}
|
|
|
|
<DYNARE_STATEMENT>init {return token::INIT;}
|
|
|
|
<DYNARE_STATEMENT>jscale {return token::JSCALE;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>prefilter {return token::PREFILTER;}
|
|
|
|
<DYNARE_STATEMENT>presample {return token::PRESAMPLE;}
|
|
|
|
<DYNARE_STATEMENT>lik_algo {return token::LIK_ALGO;}
|
|
|
|
<DYNARE_STATEMENT>lik_init {return token::LIK_INIT;}
|
2013-09-23 14:27:43 +02:00
|
|
|
<DYNARE_STATEMENT>taper_steps {return token::TAPER_STEPS;}
|
|
|
|
<DYNARE_STATEMENT>geweke_interval {return token::GEWEKE_INTERVAL;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>graph {return token::GRAPH;}
|
|
|
|
<DYNARE_STATEMENT>nograph {return token::NOGRAPH;}
|
2012-06-07 18:29:17 +02:00
|
|
|
<DYNARE_STATEMENT>nodisplay {return token::NODISPLAY;}
|
|
|
|
<DYNARE_STATEMENT>graph_format {return token::GRAPH_FORMAT;}
|
|
|
|
<DYNARE_STATEMENT>eps {yylval->string_val = new string(yytext); return token::EPS;}
|
|
|
|
<DYNARE_STATEMENT>pdf {yylval->string_val = new string(yytext); return token::PDF;}
|
|
|
|
<DYNARE_STATEMENT>fig {yylval->string_val = new string(yytext); return token::FIG;}
|
2012-10-17 16:28:36 +02:00
|
|
|
<DYNARE_STATEMENT>none {yylval->string_val = new string(yytext); return token::NONE;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>print {return token::PRINT;}
|
|
|
|
<DYNARE_STATEMENT>noprint {return token::NOPRINT;}
|
|
|
|
<DYNARE_STATEMENT>conf_sig {return token::CONF_SIG;}
|
|
|
|
<DYNARE_STATEMENT>mh_replic {return token::MH_REPLIC;}
|
|
|
|
<DYNARE_STATEMENT>mh_drop {return token::MH_DROP;}
|
|
|
|
<DYNARE_STATEMENT>mh_jscale {return token::MH_JSCALE;}
|
|
|
|
<DYNARE_STATEMENT>mh_init_scale {return token::MH_INIT_SCALE;}
|
|
|
|
<DYNARE_STATEMENT>mode_file {return token::MODE_FILE;}
|
|
|
|
<DYNARE_STATEMENT>mode_compute {return token::MODE_COMPUTE;}
|
|
|
|
<DYNARE_STATEMENT>mode_check {return token::MODE_CHECK;}
|
2013-05-24 12:13:32 +02:00
|
|
|
<DYNARE_STATEMENT>mode_check_neighbourhood_size {return token::MODE_CHECK_NEIGHBOURHOOD_SIZE;}
|
|
|
|
<DYNARE_STATEMENT>mode_check_symmetric_plots {return token::MODE_CHECK_SYMMETRIC_PLOTS;}
|
2013-06-20 17:19:44 +02:00
|
|
|
<DYNARE_STATEMENT>mode_check_number_of_points {return token::MODE_CHECK_NUMBER_OF_POINTS;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>prior_trunc {return token::PRIOR_TRUNC;}
|
|
|
|
<DYNARE_STATEMENT>mh_mode {return token::MH_MODE;}
|
|
|
|
<DYNARE_STATEMENT>mh_nblocks {return token::MH_NBLOCKS;}
|
|
|
|
<DYNARE_STATEMENT>load_mh_file {return token::LOAD_MH_FILE;}
|
|
|
|
<DYNARE_STATEMENT>loglinear {return token::LOGLINEAR;}
|
2014-01-31 11:27:36 +01:00
|
|
|
<DYNARE_STATEMENT>logdata {return token::LOGDATA;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>nodiagnostic {return token::NODIAGNOSTIC;}
|
|
|
|
<DYNARE_STATEMENT>kalman_algo {return token::KALMAN_ALGO;}
|
|
|
|
<DYNARE_STATEMENT>kalman_tol {return token::KALMAN_TOL;}
|
|
|
|
<DYNARE_STATEMENT>forecast {return token::FORECAST;}
|
|
|
|
<DYNARE_STATEMENT>smoother {return token::SMOOTHER;}
|
|
|
|
<DYNARE_STATEMENT>bayesian_irf {return token::BAYESIAN_IRF;}
|
2010-06-11 21:19:30 +02:00
|
|
|
<DYNARE_STATEMENT>dsge_var {return token::DSGE_VAR;}
|
|
|
|
<DYNARE_STATEMENT>dsge_varlag {return token::DSGE_VARLAG;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>moments_varendo {return token::MOMENTS_VARENDO;}
|
2013-12-18 16:39:41 +01:00
|
|
|
<DYNARE_STATEMENT>posterior_max_subsample_draws {return token::POSTERIOR_MAX_SUBSAMPLE_DRAWS;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>filtered_vars {return token::FILTERED_VARS;}
|
|
|
|
<DYNARE_STATEMENT>filter_step_ahead {return token::FILTER_STEP_AHEAD;}
|
|
|
|
<DYNARE_STATEMENT>relative_irf {return token::RELATIVE_IRF;}
|
|
|
|
<DYNARE_STATEMENT>tex {return token::TEX;}
|
|
|
|
<DYNARE_STATEMENT>nomoments {return token::NOMOMENTS;}
|
2012-03-26 16:46:44 +02:00
|
|
|
<DYNARE_STATEMENT>std {return token::STD;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>corr {return token::CORR;}
|
|
|
|
<DYNARE_STATEMENT>nocorr {return token::NOCORR;}
|
|
|
|
<DYNARE_STATEMENT>optim {return token::OPTIM;}
|
|
|
|
<DYNARE_STATEMENT>periods {return token::PERIODS;}
|
2013-12-27 18:35:53 +01:00
|
|
|
<DYNARE_STATEMENT>endogenous_terminal_period {return token::ENDOGENOUS_TERMINAL_PERIOD;}
|
2011-12-14 20:50:14 +01:00
|
|
|
<DYNARE_STATEMENT>sub_draws {return token::SUB_DRAWS;}
|
2009-10-18 17:18:16 +02:00
|
|
|
<DYNARE_STATEMENT>minimal_solving_periods {return token::MINIMAL_SOLVING_PERIODS;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>markowitz {return token::MARKOWITZ;}
|
|
|
|
<DYNARE_STATEMENT>marginal_density {return token::MARGINAL_DENSITY;}
|
|
|
|
<DYNARE_STATEMENT>laplace {return token::LAPLACE;}
|
|
|
|
<DYNARE_STATEMENT>modifiedharmonicmean {return token::MODIFIEDHARMONICMEAN;}
|
|
|
|
<DYNARE_STATEMENT>constant {return token::CONSTANT;}
|
|
|
|
<DYNARE_STATEMENT>noconstant {return token::NOCONSTANT;}
|
|
|
|
<DYNARE_STATEMENT>covar {return token::COVAR;}
|
|
|
|
<DYNARE_STATEMENT>filename {return token::FILENAME;}
|
|
|
|
<DYNARE_STATEMENT>diffuse_filter {return token::DIFFUSE_FILTER;}
|
|
|
|
<DYNARE_STATEMENT>plot_priors {return token::PLOT_PRIORS;}
|
2009-10-20 17:44:56 +02:00
|
|
|
<DYNARE_STATEMENT>aim_solver {return token::AIM_SOLVER;}
|
2009-10-20 18:55:31 +02:00
|
|
|
<DYNARE_STATEMENT>partial_information {return token::PARTIAL_INFORMATION;}
|
2009-10-29 18:16:10 +01:00
|
|
|
<DYNARE_STATEMENT>conditional_variance_decomposition {return token::CONDITIONAL_VARIANCE_DECOMPOSITION;}
|
2010-02-22 17:33:38 +01:00
|
|
|
<DYNARE_STATEMENT>name {return token::EXT_FUNC_NAME;}
|
|
|
|
<DYNARE_STATEMENT>nargs {return token::EXT_FUNC_NARGS;}
|
|
|
|
<DYNARE_STATEMENT>first_deriv_provided {return token::FIRST_DERIV_PROVIDED;}
|
|
|
|
<DYNARE_STATEMENT>second_deriv_provided {return token::SECOND_DERIV_PROVIDED;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>freq {return token::FREQ;}
|
2011-09-15 20:22:58 +02:00
|
|
|
<DYNARE_STATEMENT>monthly {return token::MONTHLY; }
|
|
|
|
<DYNARE_STATEMENT>quarterly {return token::QUARTERLY; }
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>initial_year {return token::INITIAL_YEAR;}
|
|
|
|
<DYNARE_STATEMENT>initial_subperiod {return token::INITIAL_SUBPERIOD;}
|
|
|
|
<DYNARE_STATEMENT>final_year {return token::FINAL_YEAR;}
|
|
|
|
<DYNARE_STATEMENT>final_subperiod {return token::FINAL_SUBPERIOD;}
|
|
|
|
<DYNARE_STATEMENT>vlist {return token::VLIST;}
|
|
|
|
<DYNARE_STATEMENT>vlistlog {return token::VLISTLOG;}
|
|
|
|
<DYNARE_STATEMENT>vlistper {return token::VLISTPER;}
|
|
|
|
<DYNARE_STATEMENT>restriction_fname {return token::RESTRICTION_FNAME;}
|
|
|
|
<DYNARE_STATEMENT>nlags {return token::NLAGS;}
|
2011-12-19 17:32:02 +01:00
|
|
|
<DYNARE_STATEMENT>restrictions {return token::RESTRICTIONS;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>cross_restrictions {return token::CROSS_RESTRICTIONS;}
|
|
|
|
<DYNARE_STATEMENT>contemp_reduced_form {return token::CONTEMP_REDUCED_FORM;}
|
|
|
|
<DYNARE_STATEMENT>real_pseudo_forecast {return token::REAL_PSEUDO_FORECAST;}
|
2011-09-13 20:30:31 +02:00
|
|
|
<DYNARE_STATEMENT>no_bayesian_prior {return token::NO_BAYESIAN_PRIOR;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>dummy_obs {return token::DUMMY_OBS;}
|
|
|
|
<DYNARE_STATEMENT>nstates {return token::NSTATES;}
|
|
|
|
<DYNARE_STATEMENT>indxscalesstates {return token::INDXSCALESSTATES;}
|
2012-03-06 12:03:23 +01:00
|
|
|
<DYNARE_STATEMENT>fixed_point {return token::FIXED_POINT;}
|
2012-04-20 19:23:00 +02:00
|
|
|
<DYNARE_STATEMENT>doubling {return token::DOUBLING;}
|
|
|
|
<DYNARE_STATEMENT>square_root_solver {return token::SQUARE_ROOT_SOLVER;}
|
2012-07-01 15:15:52 +02:00
|
|
|
<DYNARE_STATEMENT>cycle_reduction {return token::CYCLE_REDUCTION;}
|
2012-07-11 18:25:04 +02:00
|
|
|
<DYNARE_STATEMENT>logarithmic_reduction {return token::LOGARITHMIC_REDUCTION;}
|
2013-05-27 17:07:15 +02:00
|
|
|
<DYNARE_STATEMENT>use_univariate_filters_if_singularity_is_detected {return token::USE_UNIVARIATE_FILTERS_IF_SINGULARITY_IS_DETECTED;}
|
2013-06-07 18:17:02 +02:00
|
|
|
<DYNARE_STATEMENT>hybrid {return token::HYBRID;}
|
2012-03-06 12:03:23 +01:00
|
|
|
<DYNARE_STATEMENT>default {return token::DEFAULT;}
|
2009-09-28 21:29:13 +02:00
|
|
|
<DYNARE_STATEMENT>alpha {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::ALPHA;
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>beta {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::BETA;
|
|
|
|
}
|
2011-12-11 15:35:26 +01:00
|
|
|
<DYNARE_STATEMENT>gamma {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::GAMMA;
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>inv_gamma {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::INV_GAMMA;
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>inv_gamma1 {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::INV_GAMMA1;
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>inv_gamma2 {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::INV_GAMMA2;
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>normal {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::NORMAL;
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>uniform {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::UNIFORM;
|
|
|
|
}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>gsig2_lmdm {return token::GSIG2_LMDM;}
|
2011-09-15 23:03:53 +02:00
|
|
|
<DYNARE_STATEMENT>specification {return token::SPECIFICATION;}
|
|
|
|
<DYNARE_STATEMENT>sims_zha {return token::SIMS_ZHA;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>q_diag {return token::Q_DIAG;}
|
|
|
|
<DYNARE_STATEMENT>flat_prior {return token::FLAT_PRIOR;}
|
|
|
|
<DYNARE_STATEMENT>ncsk {return token::NCSK;}
|
|
|
|
<DYNARE_STATEMENT>nstd {return token::NSTD;}
|
2009-09-28 21:29:13 +02:00
|
|
|
<DYNARE_STATEMENT>ninv {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::NINV;
|
|
|
|
}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>indxparr {return token::INDXPARR;}
|
|
|
|
<DYNARE_STATEMENT>indxovr {return token::INDXOVR;}
|
2009-09-28 21:29:13 +02:00
|
|
|
<DYNARE_STATEMENT>aband {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::ABAND;
|
|
|
|
}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>indxap {return token::INDXAP;}
|
|
|
|
<DYNARE_STATEMENT>apband {return token::APBAND;}
|
|
|
|
<DYNARE_STATEMENT>indximf {return token::INDXIMF;}
|
|
|
|
<DYNARE_STATEMENT>imfband {return token::IMFBAND;}
|
|
|
|
<DYNARE_STATEMENT>indxfore {return token::INDXFORE;}
|
|
|
|
<DYNARE_STATEMENT>foreband {return token::FOREBAND;}
|
|
|
|
<DYNARE_STATEMENT>indxgforehat {return token::INDXGFOREHAT;}
|
|
|
|
<DYNARE_STATEMENT>indxgimfhat {return token::INDXGIMFHAT;}
|
|
|
|
<DYNARE_STATEMENT>indxestima {return token::INDXESTIMA;}
|
|
|
|
<DYNARE_STATEMENT>indxgdls {return token::INDXGDLS;}
|
|
|
|
<DYNARE_STATEMENT>eq_ms {return token::EQ_MS;}
|
2009-09-28 21:29:13 +02:00
|
|
|
<DYNARE_STATEMENT>cms {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::CMS;
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>ncms {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::NCMS;
|
|
|
|
}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>eq_cms {return token::EQ_CMS;}
|
|
|
|
<DYNARE_STATEMENT>tlindx {return token::TLINDX;}
|
|
|
|
<DYNARE_STATEMENT>tlnumber {return token::TLNUMBER;}
|
2009-09-28 21:29:13 +02:00
|
|
|
<DYNARE_STATEMENT>cnum {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::CNUM;
|
|
|
|
}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>banact {return token::BANACT;}
|
2013-11-06 10:36:58 +01:00
|
|
|
<DYNARE_BLOCK>use_calibration {return token::USE_CALIBRATION;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>output_file_tag {return token::OUTPUT_FILE_TAG;}
|
2011-07-29 14:55:07 +02:00
|
|
|
<DYNARE_STATEMENT>file_tag {return token::FILE_TAG;};
|
2011-09-14 00:23:56 +02:00
|
|
|
<DYNARE_STATEMENT>no_create_init {return token::NO_CREATE_INIT;};
|
2011-05-20 14:29:23 +02:00
|
|
|
<DYNARE_STATEMENT>simulation_file_tag {return token::SIMULATION_FILE_TAG;};
|
|
|
|
<DYNARE_STATEMENT>horizon {return token::HORIZON;}
|
2011-10-10 18:33:16 +02:00
|
|
|
<DYNARE_STATEMENT>parameter_uncertainty {return token::PARAMETER_UNCERTAINTY;}
|
2011-08-22 16:30:40 +02:00
|
|
|
<DYNARE_STATEMENT>no_error_bands {return token::NO_ERROR_BANDS;}
|
2011-05-11 19:02:39 +02:00
|
|
|
<DYNARE_STATEMENT>error_band_percentiles {return token::ERROR_BAND_PERCENTILES;}
|
|
|
|
<DYNARE_STATEMENT>shock_draws {return token::SHOCK_DRAWS;}
|
2011-05-20 14:29:23 +02:00
|
|
|
<DYNARE_STATEMENT>shocks_per_parameter {return token::SHOCKS_PER_PARAMETER;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>thinning_factor {return token::THINNING_FACTOR;}
|
2011-05-11 19:02:39 +02:00
|
|
|
<DYNARE_STATEMENT>free_parameters {return token::FREE_PARAMETERS;}
|
|
|
|
<DYNARE_STATEMENT>median {return token::MEDIAN;}
|
2011-10-10 18:33:16 +02:00
|
|
|
<DYNARE_STATEMENT>regime {return token::REGIME;}
|
|
|
|
<DYNARE_STATEMENT>regimes {return token::REGIMES;}
|
2011-05-11 19:02:39 +02:00
|
|
|
<DYNARE_STATEMENT>data_obs_nbr {return token::DATA_OBS_NBR;}
|
|
|
|
<DYNARE_STATEMENT>filtered_probabilities {return token::FILTERED_PROBABILITIES;}
|
|
|
|
<DYNARE_STATEMENT>real_time_smoothed {return token::REAL_TIME_SMOOTHED;}
|
|
|
|
<DYNARE_STATEMENT>proposal_type {return token::PROPOSAL_TYPE;}
|
2011-09-15 22:27:21 +02:00
|
|
|
<DYNARE_STATEMENT>proposal_lower_bound {return token::PROPOSAL_LOWER_BOUND;}
|
|
|
|
<DYNARE_STATEMENT>proposal_upper_bound {return token::PROPOSAL_UPPER_BOUND;}
|
2011-09-15 22:38:05 +02:00
|
|
|
<DYNARE_STATEMENT>proposal_draws {return token::PROPOSAL_DRAWS;}
|
|
|
|
<DYNARE_STATEMENT>use_mean_center {return token::USE_MEAN_CENTER;}
|
2011-05-11 19:02:39 +02:00
|
|
|
<DYNARE_STATEMENT>adaptive_mh_draws {return token::ADAPTIVE_MH_DRAWS;}
|
|
|
|
<DYNARE_STATEMENT>coefficients_prior_hyperparameters {return token::COEFFICIENTS_PRIOR_HYPERPARAMETERS;}
|
|
|
|
<DYNARE_STATEMENT>convergence_starting_value {return token::CONVERGENCE_STARTING_VALUE;}
|
|
|
|
<DYNARE_STATEMENT>convergence_ending_value {return token::CONVERGENCE_ENDING_VALUE;}
|
|
|
|
<DYNARE_STATEMENT>convergence_increment_value {return token::CONVERGENCE_INCREMENT_VALUE;}
|
|
|
|
<DYNARE_STATEMENT>max_iterations_starting_value {return token::MAX_ITERATIONS_STARTING_VALUE;}
|
|
|
|
<DYNARE_STATEMENT>max_iterations_increment_value {return token::MAX_ITERATIONS_INCREMENT_VALUE;}
|
|
|
|
<DYNARE_STATEMENT>max_block_iterations {return token::MAX_BLOCK_ITERATIONS;}
|
|
|
|
<DYNARE_STATEMENT>max_repeated_optimization_runs {return token::MAX_REPEATED_OPTIMIZATION_RUNS;}
|
2011-09-16 15:49:29 +02:00
|
|
|
<DYNARE_STATEMENT>maxit {return token::MAXIT;}
|
2011-05-11 19:02:39 +02:00
|
|
|
<DYNARE_STATEMENT>function_convergence_criterion {return token::FUNCTION_CONVERGENCE_CRITERION;}
|
|
|
|
<DYNARE_STATEMENT>parameter_convergence_criterion {return token::PARAMETER_CONVERGENCE_CRITERION;}
|
|
|
|
<DYNARE_STATEMENT>number_of_large_perturbations {return token::NUMBER_OF_LARGE_PERTURBATIONS;}
|
|
|
|
<DYNARE_STATEMENT>number_of_small_perturbations {return token::NUMBER_OF_SMALL_PERTURBATIONS;}
|
|
|
|
<DYNARE_STATEMENT>number_of_posterior_draws_after_perturbation {return token::NUMBER_OF_POSTERIOR_DRAWS_AFTER_PERTURBATION;}
|
|
|
|
<DYNARE_STATEMENT>max_number_of_stages {return token::MAX_NUMBER_OF_STAGES;}
|
|
|
|
<DYNARE_STATEMENT>random_function_convergence_criterion {return token::RANDOM_FUNCTION_CONVERGENCE_CRITERION;}
|
|
|
|
<DYNARE_STATEMENT>random_parameter_convergence_criterion {return token::RANDOM_PARAMETER_CONVERGENCE_CRITERION;}
|
2013-06-26 12:15:43 +02:00
|
|
|
<DYNARE_STATEMENT>tolf {return token::TOLF;}
|
2009-12-10 15:59:32 +01:00
|
|
|
<DYNARE_STATEMENT>instruments {return token::INSTRUMENTS;}
|
2013-11-05 17:16:32 +01:00
|
|
|
<DYNARE_STATEMENT>hessian {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::HESSIAN;
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>prior_variance {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::PRIOR_VARIANCE;
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>identity_matrix {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::IDENTITY_MATRIX;
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT>mcmc_jumping_covariance {return token::MCMC_JUMPING_COVARIANCE;}
|
2009-09-09 15:15:02 +02:00
|
|
|
|
|
|
|
/* These four (var, varexo, varexo_det, parameters) are for change_type */
|
|
|
|
<DYNARE_STATEMENT>var { return token::VAR; }
|
|
|
|
<DYNARE_STATEMENT>varexo { return token::VAREXO; }
|
|
|
|
<DYNARE_STATEMENT>varexo_det { return token::VAREXO_DET; }
|
|
|
|
<DYNARE_STATEMENT>parameters { return token::PARAMETERS; }
|
2009-11-07 19:37:11 +01:00
|
|
|
<DYNARE_STATEMENT>predetermined_variables { return token::PREDETERMINED_VARIABLES; }
|
2009-09-09 15:15:02 +02:00
|
|
|
|
|
|
|
<DYNARE_STATEMENT>bvar_prior_tau { return token::BVAR_PRIOR_TAU; }
|
|
|
|
<DYNARE_STATEMENT>bvar_prior_decay { return token::BVAR_PRIOR_DECAY; }
|
|
|
|
<DYNARE_STATEMENT>bvar_prior_lambda { return token::BVAR_PRIOR_LAMBDA; }
|
|
|
|
<DYNARE_STATEMENT>bvar_prior_mu { return token::BVAR_PRIOR_MU; }
|
|
|
|
<DYNARE_STATEMENT>bvar_prior_omega { return token::BVAR_PRIOR_OMEGA; }
|
|
|
|
<DYNARE_STATEMENT>bvar_prior_flat { return token::BVAR_PRIOR_FLAT; }
|
|
|
|
<DYNARE_STATEMENT>bvar_prior_train { return token::BVAR_PRIOR_TRAIN; }
|
|
|
|
<DYNARE_STATEMENT>bvar_replic { return token::BVAR_REPLIC; }
|
|
|
|
|
|
|
|
<DYNARE_STATEMENT>homotopy_mode {return token::HOMOTOPY_MODE; }
|
|
|
|
<DYNARE_STATEMENT>homotopy_steps {return token::HOMOTOPY_STEPS; }
|
2012-05-17 17:05:50 +02:00
|
|
|
<DYNARE_STATEMENT>homotopy_force_continue {return token::HOMOTOPY_FORCE_CONTINUE;}
|
2011-10-13 17:14:41 +02:00
|
|
|
<DYNARE_STATEMENT>nocheck {return token::NOCHECK; }
|
2009-09-09 15:15:02 +02:00
|
|
|
|
2009-10-16 19:23:57 +02:00
|
|
|
<DYNARE_STATEMENT>controlled_varexo {return token::CONTROLLED_VAREXO; }
|
|
|
|
<DYNARE_STATEMENT>parameter_set {return token::PARAMETER_SET; }
|
|
|
|
<DYNARE_STATEMENT>prior_mode {return token::PRIOR_MODE; }
|
|
|
|
<DYNARE_STATEMENT>prior_mean {return token::PRIOR_MEAN; }
|
|
|
|
<DYNARE_STATEMENT>posterior_mode {return token::POSTERIOR_MODE; }
|
|
|
|
<DYNARE_STATEMENT>posterior_mean {return token::POSTERIOR_MEAN; }
|
|
|
|
<DYNARE_STATEMENT>posterior_median {return token::POSTERIOR_MEDIAN; }
|
2009-11-30 20:54:45 +01:00
|
|
|
<DYNARE_STATEMENT>k_order_solver {return token::K_ORDER_SOLVER; }
|
2010-03-22 21:57:46 +01:00
|
|
|
<DYNARE_STATEMENT>filter_covariance {return token::FILTER_COVARIANCE; }
|
|
|
|
<DYNARE_STATEMENT>filter_decomposition {return token::FILTER_DECOMPOSITION; }
|
2010-04-02 11:51:21 +02:00
|
|
|
<DYNARE_STATEMENT>selected_variables_only {return token::SELECTED_VARIABLES_ONLY; }
|
2010-10-15 19:05:16 +02:00
|
|
|
<DYNARE_STATEMENT>pruning {return token::PRUNING; }
|
2013-10-23 17:03:52 +02:00
|
|
|
<DYNARE_STATEMENT>save_draws {return token::SAVE_DRAWS; }
|
2010-10-15 19:05:16 +02:00
|
|
|
<DYNARE_STATEMENT>deflator {return token::DEFLATOR;}
|
2013-03-26 16:46:18 +01:00
|
|
|
<DYNARE_STATEMENT>log_deflator {return token::LOG_DEFLATOR;}
|
2010-10-15 19:05:16 +02:00
|
|
|
<DYNARE_STATEMENT>growth_factor {return token::GROWTH_FACTOR;}
|
2013-03-26 17:10:37 +01:00
|
|
|
<DYNARE_STATEMENT>log_growth_factor {return token::LOG_GROWTH_FACTOR;}
|
2011-01-18 19:31:59 +01:00
|
|
|
<DYNARE_STATEMENT>cova_compute {return token::COVA_COMPUTE;}
|
2012-04-21 10:40:24 +02:00
|
|
|
<DYNARE_STATEMENT>discretionary_tol {return token::DISCRETIONARY_TOL;}
|
2012-06-06 11:34:32 +02:00
|
|
|
<DYNARE_STATEMENT>analytic_derivation {return token::ANALYTIC_DERIVATION;}
|
2012-06-08 17:36:32 +02:00
|
|
|
<DYNARE_STATEMENT>solver_periods {return token::SOLVER_PERIODS;}
|
2013-03-18 11:12:49 +01:00
|
|
|
<DYNARE_STATEMENT>endogenous_prior {return token::ENDOGENOUS_PRIOR;}
|
2013-11-15 09:46:18 +01:00
|
|
|
<DYNARE_STATEMENT>long_name {return token::LONG_NAME;}
|
|
|
|
|
2009-10-16 19:23:57 +02:00
|
|
|
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>[\$][^$]*[\$] {
|
|
|
|
strtok(yytext+1, "$");
|
|
|
|
yylval->string_val = new string(yytext + 1);
|
|
|
|
return token::TEX_NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Inside a Dynare block */
|
|
|
|
<DYNARE_BLOCK>var {return token::VAR;}
|
|
|
|
<DYNARE_BLOCK>stderr {return token::STDERR;}
|
|
|
|
<DYNARE_BLOCK>values {return token::VALUES;}
|
|
|
|
<DYNARE_BLOCK>corr {return token::CORR;}
|
|
|
|
<DYNARE_BLOCK>periods {return token::PERIODS;}
|
|
|
|
<DYNARE_BLOCK>cutoff {return token::CUTOFF;}
|
|
|
|
<DYNARE_BLOCK>mfs {return token::MFS;}
|
|
|
|
<DYNARE_BLOCK>gamma_pdf {return token::GAMMA_PDF;}
|
|
|
|
<DYNARE_BLOCK>beta_pdf {return token::BETA_PDF;}
|
|
|
|
<DYNARE_BLOCK>normal_pdf {return token::NORMAL_PDF;}
|
|
|
|
<DYNARE_BLOCK>inv_gamma_pdf {return token::INV_GAMMA_PDF;}
|
|
|
|
<DYNARE_BLOCK>inv_gamma1_pdf {return token::INV_GAMMA1_PDF;}
|
|
|
|
<DYNARE_BLOCK>inv_gamma2_pdf {return token::INV_GAMMA2_PDF;}
|
|
|
|
<DYNARE_BLOCK>uniform_pdf {return token::UNIFORM_PDF;}
|
2010-06-11 21:19:30 +02:00
|
|
|
<DYNARE_BLOCK>dsge_prior_weight {return token::DSGE_PRIOR_WEIGHT;}
|
2009-09-09 15:15:02 +02:00
|
|
|
|
|
|
|
<DYNARE_BLOCK>; {return Dynare::parser::token_type (yytext[0]);}
|
|
|
|
<DYNARE_BLOCK># {return Dynare::parser::token_type (yytext[0]);}
|
|
|
|
|
|
|
|
<DYNARE_BLOCK>autocorr {return token::AUTOCORR;}
|
2011-10-10 11:45:55 +02:00
|
|
|
<DYNARE_BLOCK>restriction {return token::RESTRICTION;}
|
2009-09-09 15:15:02 +02:00
|
|
|
|
|
|
|
/* Inside Dynare statement */
|
|
|
|
<DYNARE_STATEMENT>solve_algo {return token::SOLVE_ALGO;}
|
|
|
|
<DYNARE_STATEMENT>dr_algo {return token::DR_ALGO;}
|
|
|
|
<DYNARE_STATEMENT>simul_algo {return token::SIMUL_ALGO;}
|
|
|
|
<DYNARE_STATEMENT>stack_solve_algo {return token::STACK_SOLVE_ALGO;}
|
|
|
|
<DYNARE_STATEMENT>drop {return token::DROP;}
|
|
|
|
<DYNARE_STATEMENT>order {return token::ORDER;}
|
2012-03-06 12:03:23 +01:00
|
|
|
<DYNARE_STATEMENT>sylvester {return token::SYLVESTER;}
|
|
|
|
<DYNARE_STATEMENT>lyapunov {return token::LYAPUNOV;}
|
2012-07-02 10:11:32 +02:00
|
|
|
<DYNARE_STATEMENT>dr {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::DR;
|
|
|
|
}
|
2012-04-20 19:23:00 +02:00
|
|
|
<DYNARE_STATEMENT>sylvester_fixed_point_tol {return token::SYLVESTER_FIXED_POINT_TOL;}
|
|
|
|
<DYNARE_STATEMENT>lyapunov_fixed_point_tol {return token::LYAPUNOV_FIXED_POINT_TOL;}
|
|
|
|
<DYNARE_STATEMENT>lyapunov_doubling_tol {return token::LYAPUNOV_DOUBLING_TOL;}
|
2012-07-01 15:15:52 +02:00
|
|
|
<DYNARE_STATEMENT>dr_cycle_reduction_tol {return token::DR_CYCLE_REDUCTION_TOL;}
|
2012-07-11 18:25:04 +02:00
|
|
|
<DYNARE_STATEMENT>dr_logarithmic_reduction_tol {return token::DR_LOGARITHMIC_REDUCTION_TOL;}
|
|
|
|
<DYNARE_STATEMENT>dr_logarithmic_reduction_maxiter {return token::DR_LOGARITHMIC_REDUCTION_MAXITER;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>replic {return token::REPLIC;}
|
|
|
|
<DYNARE_STATEMENT>ar {return token::AR;}
|
|
|
|
<DYNARE_STATEMENT>nofunctions {return token::NOFUNCTIONS;}
|
|
|
|
<DYNARE_STATEMENT>irf {return token::IRF;}
|
2011-03-31 16:33:47 +02:00
|
|
|
<DYNARE_STATEMENT>irf_shocks {return token::IRF_SHOCKS;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>hp_filter {return token::HP_FILTER;}
|
|
|
|
<DYNARE_STATEMENT>hp_ngrid {return token::HP_NGRID;}
|
|
|
|
<DYNARE_STATEMENT>simul_seed {return token::SIMUL_SEED;}
|
|
|
|
<DYNARE_STATEMENT>qz_criterium {return token::QZ_CRITERIUM;}
|
2013-06-12 11:46:56 +02:00
|
|
|
<DYNARE_STATEMENT>qz_zero_threshold {return token::QZ_ZERO_THRESHOLD;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>simul {return token::SIMUL;}
|
2012-06-11 11:50:49 +02:00
|
|
|
<DYNARE_STATEMENT>simul_replic {return token::SIMUL_REPLIC;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT>xls_sheet {return token::XLS_SHEET;}
|
|
|
|
<DYNARE_STATEMENT>xls_range {return token::XLS_RANGE;}
|
|
|
|
<DYNARE_STATEMENT>mh_recover {return token::MH_RECOVER;}
|
|
|
|
<DYNARE_STATEMENT>planner_discount {return token::PLANNER_DISCOUNT;}
|
2011-07-30 20:19:15 +02:00
|
|
|
<DYNARE_STATEMENT>calibration {return token::CALIBRATION;}
|
2013-11-13 14:34:46 +01:00
|
|
|
<DYNARE_STATEMENT>irf_plot_threshold {return token::IRF_PLOT_THRESHOLD;}
|
2009-09-09 15:15:02 +02:00
|
|
|
|
2009-12-09 01:38:53 +01:00
|
|
|
<DYNARE_BLOCK>equation {return token::EQUATION;}
|
2009-11-30 01:38:26 +01:00
|
|
|
<DYNARE_BLOCK>exclusion {return token::EXCLUSION;}
|
|
|
|
<DYNARE_BLOCK>lag {return token::LAG;}
|
2011-10-10 11:45:55 +02:00
|
|
|
<DYNARE_BLOCK>coeff {return token::COEFF;}
|
2011-05-11 19:02:39 +02:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>upper_cholesky {return token::UPPER_CHOLESKY;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>lower_cholesky {return token::LOWER_CHOLESKY;}
|
2009-11-30 01:38:26 +01:00
|
|
|
<DYNARE_STATEMENT>chain {return token::CHAIN;}
|
2011-12-16 11:18:24 +01:00
|
|
|
<DYNARE_STATEMENT>number_of_regimes {return token::NUMBER_OF_REGIMES;}
|
2009-11-30 01:38:26 +01:00
|
|
|
<DYNARE_STATEMENT>duration {return token::DURATION;}
|
|
|
|
<DYNARE_STATEMENT>coefficients {return token::COEFFICIENTS;}
|
|
|
|
<DYNARE_STATEMENT>variances {return token::VARIANCES;}
|
2009-12-09 01:38:53 +01:00
|
|
|
<DYNARE_STATEMENT>equations {return token::EQUATIONS;}
|
2009-11-30 01:38:26 +01:00
|
|
|
|
2009-09-09 15:15:02 +02:00
|
|
|
<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]);}
|
|
|
|
|
|
|
|
<DYNARE_BLOCK>use_dll {return token::USE_DLL;}
|
|
|
|
<DYNARE_BLOCK>block {return token::BLOCK;}
|
|
|
|
<DYNARE_BLOCK>bytecode {return token::BYTECODE;}
|
2012-10-31 15:23:02 +01:00
|
|
|
<DYNARE_BLOCK>all_values_required {return token::ALL_VALUES_REQUIRED;}
|
2010-01-08 12:06:25 +01:00
|
|
|
<DYNARE_BLOCK>no_static {return token::NO_STATIC;}
|
2013-04-25 18:09:31 +02:00
|
|
|
<DYNARE_BLOCK>differentiate_forward_vars {return token::DIFFERENTIATE_FORWARD_VARS;}
|
2013-05-31 14:47:28 +02:00
|
|
|
<DYNARE_BLOCK>parallel_local_files {return token::PARALLEL_LOCAL_FILES;}
|
2009-09-09 15:15:02 +02:00
|
|
|
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>linear {return token::LINEAR;}
|
|
|
|
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[,] {return token::COMMA;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[:] {return Dynare::parser::token_type (yytext[0]);}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[\(\)] {return Dynare::parser::token_type (yytext[0]);}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[\[] {return Dynare::parser::token_type (yytext[0]);}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[\]] {
|
|
|
|
if (sigma_e)
|
|
|
|
sigma_e = 0;
|
|
|
|
return Dynare::parser::token_type (yytext[0]);
|
|
|
|
}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[+] {return token::PLUS;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[-] {return token::MINUS;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[*] {return token::TIMES;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[/] {return token::DIVIDE;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[=] {return token::EQUAL;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[<] {return token::LESS;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[>] {return token::GREATER;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>">=" {return token::GREATER_EQUAL;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>"<=" {return token::LESS_EQUAL;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>"==" {return token::EQUAL_EQUAL;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>"!=" {return token::EXCLAMATION_EQUAL;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[\^] {return token::POWER;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>exp {return token::EXP;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>log {return token::LOG;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>log10 {return token::LOG10;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>ln {return token::LN;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>sin {return token::SIN;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>cos {return token::COS;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>tan {return token::TAN;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>asin {return token::ASIN;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>acos {return token::ACOS;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>atan {return token::ATAN;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>sinh {return token::SINH;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>cosh {return token::COSH;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>tanh {return token::TANH;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>asinh {return token::ASINH;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>acosh {return token::ACOSH;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>atanh {return token::ATANH;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>sqrt {return token::SQRT;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>max {return token::MAX;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>min {return token::MIN;}
|
2011-08-12 13:20:53 +02:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>abs {return token::ABS;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>sign {return token::SIGN;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>normcdf {return token::NORMCDF;}
|
2010-03-11 09:43:16 +01:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>normpdf {return token::NORMPDF;}
|
2010-03-11 11:57:34 +01:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>erf {return token::ERF;}
|
2009-09-10 22:09:16 +02:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>steady_state {return token::STEADY_STATE;}
|
2009-10-29 18:16:10 +01:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>expectation {return token::EXPECTATION;}
|
2010-01-18 23:08:44 +01:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>varobs {return token::VAROBS;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>full {return token::FULL;}
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>nan {return token::NAN_CONSTANT;}
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>inf {return token::INF_CONSTANT;}
|
2011-07-29 18:11:50 +02:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>constants {return token::CONSTANTS;}
|
2009-09-09 15:15:02 +02:00
|
|
|
|
|
|
|
/* options for GSA module by Marco Ratto */
|
|
|
|
<DYNARE_STATEMENT>identification {return token::IDENTIFICATION;}
|
|
|
|
<DYNARE_STATEMENT>morris {return token::MORRIS;}
|
|
|
|
<DYNARE_STATEMENT>stab {return token::STAB;}
|
|
|
|
<DYNARE_STATEMENT>redform {return token::REDFORM;}
|
|
|
|
<DYNARE_STATEMENT>pprior {return token::PPRIOR;}
|
|
|
|
<DYNARE_STATEMENT>prior_range {return token::PRIOR_RANGE;}
|
|
|
|
<DYNARE_STATEMENT>ppost {return token::PPOST;}
|
|
|
|
<DYNARE_STATEMENT>ilptau {return token::ILPTAU;}
|
|
|
|
<DYNARE_STATEMENT>morris_nliv {return token::MORRIS_NLIV;}
|
|
|
|
<DYNARE_STATEMENT>morris_ntra {return token::MORRIS_NTRA;}
|
|
|
|
<DYNARE_STATEMENT>Nsam {return token::NSAM;}
|
|
|
|
<DYNARE_STATEMENT>load_redform {return token::LOAD_REDFORM;}
|
|
|
|
<DYNARE_STATEMENT>load_rmse {return token::LOAD_RMSE;}
|
|
|
|
<DYNARE_STATEMENT>load_stab {return token::LOAD_STAB;}
|
|
|
|
<DYNARE_STATEMENT>alpha2_stab {return token::ALPHA2_STAB;}
|
|
|
|
<DYNARE_STATEMENT>ksstat {return token::KSSTAT;}
|
|
|
|
<DYNARE_STATEMENT>logtrans_redform {return token::LOGTRANS_REDFORM;}
|
|
|
|
<DYNARE_STATEMENT>threshold_redform {return token::THRESHOLD_REDFORM;}
|
|
|
|
<DYNARE_STATEMENT>ksstat_redform {return token::KSSTAT_REDFORM;}
|
|
|
|
<DYNARE_STATEMENT>alpha2_redform {return token::ALPHA2_REDFORM;}
|
|
|
|
<DYNARE_STATEMENT>namendo {return token::NAMENDO;}
|
|
|
|
<DYNARE_STATEMENT>namlagendo {return token::NAMLAGENDO;}
|
|
|
|
<DYNARE_STATEMENT>namexo {return token::NAMEXO;}
|
|
|
|
<DYNARE_STATEMENT>rmse {return token::RMSE;}
|
|
|
|
<DYNARE_STATEMENT>lik_only {return token::LIK_ONLY;}
|
|
|
|
<DYNARE_STATEMENT>var_rmse {return token::VAR_RMSE;}
|
|
|
|
<DYNARE_STATEMENT>pfilt_rmse {return token::PFILT_RMSE;}
|
|
|
|
<DYNARE_STATEMENT>istart_rmse {return token::ISTART_RMSE;}
|
|
|
|
<DYNARE_STATEMENT>alpha_rmse {return token::ALPHA_RMSE;}
|
|
|
|
<DYNARE_STATEMENT>alpha2_rmse {return token::ALPHA2_RMSE;}
|
2009-10-14 18:16:43 +02:00
|
|
|
<DYNARE_STATEMENT>load_ident_files {return token::LOAD_IDENT_FILES;}
|
|
|
|
<DYNARE_STATEMENT>useautocorr {return token::USEAUTOCORR;}
|
2011-05-23 11:20:24 +02:00
|
|
|
<DYNARE_STATEMENT>neighborhood_width {return token::NEIGHBORHOOD_WIDTH;}
|
2011-07-08 11:12:13 +02:00
|
|
|
<DYNARE_STATEMENT>pvalue_ks {return token::PVALUE_KS;}
|
|
|
|
<DYNARE_STATEMENT>pvalue_corr {return token::PVALUE_CORR;}
|
2009-09-09 15:15:02 +02:00
|
|
|
/* end of GSA options */
|
|
|
|
|
2009-10-14 18:16:43 +02:00
|
|
|
/* For identification() statement */
|
|
|
|
<DYNARE_STATEMENT>prior_mc {return token::PRIOR_MC;}
|
2011-04-20 12:13:30 +02:00
|
|
|
<DYNARE_STATEMENT>advanced {return token::ADVANCED;}
|
|
|
|
<DYNARE_STATEMENT>max_dim_cova_group {return token::MAX_DIM_COVA_GROUP;}
|
2011-04-29 11:51:18 +02:00
|
|
|
<DYNARE_STATEMENT>gsa_sample_file {return token::GSA_SAMPLE_FILE;}
|
2009-10-14 18:16:43 +02:00
|
|
|
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[A-Za-z_][A-Za-z0-9_]* {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>((([0-9]*\.[0-9]+)|([0-9]+\.))([edED][-+]?[0-9]+)?)|([0-9]+[edED][-+]?[0-9]+) {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::FLOAT_NUMBER;
|
|
|
|
}
|
|
|
|
|
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>[0-9]+ {
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::INT_NUMBER;
|
|
|
|
}
|
|
|
|
|
2013-10-22 17:57:44 +02:00
|
|
|
<DATES_STATEMENT>\( { yylval->string_val->append(yytext); dates_parens_nb++; }
|
|
|
|
<DATES_STATEMENT>\) {
|
|
|
|
yylval->string_val->append(yytext);
|
|
|
|
if (--dates_parens_nb == 0)
|
|
|
|
{
|
|
|
|
BEGIN DYNARE_STATEMENT;
|
|
|
|
return token::DATES;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<DATES_STATEMENT>. { yylval->string_val->append(yytext); }
|
2011-11-29 17:14:26 +01:00
|
|
|
|
2009-09-09 15:15:02 +02:00
|
|
|
<DYNARE_STATEMENT,DYNARE_BLOCK>\'[^\']+\' {
|
|
|
|
yylval->string_val = new string(yytext + 1);
|
|
|
|
yylval->string_val->resize(yylval->string_val->length() - 1);
|
|
|
|
return token::QUOTED_STRING;
|
|
|
|
}
|
|
|
|
|
2013-08-13 19:37:14 +02:00
|
|
|
|
|
|
|
/* Verbatim Block */
|
|
|
|
<INITIAL>verbatim[[:space:]]*; {
|
|
|
|
BEGIN VERBATIM_BLOCK;
|
|
|
|
yylval->string_val = new string();
|
|
|
|
}
|
|
|
|
<VERBATIM_BLOCK>end[[:space:]]*; {
|
|
|
|
BEGIN INITIAL;
|
|
|
|
yylval->string_val = new string();
|
|
|
|
}
|
|
|
|
<VERBATIM_BLOCK>\n {
|
|
|
|
if (strlen(yytext) > 1)
|
|
|
|
driver.add_native_remove_charset(yytext, "\n");
|
|
|
|
}
|
|
|
|
<VERBATIM_BLOCK>. { yymore(); }
|
|
|
|
<VERBATIM_BLOCK><<EOF>> {
|
|
|
|
driver.add_native(eofbuff);
|
|
|
|
yyterminate();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-09-09 15:15:02 +02:00
|
|
|
/* An instruction starting with a recognized symbol (which is not a modfile local
|
2010-02-22 17:33:38 +01:00
|
|
|
or an external function) is passed as NAME, otherwise it is a native statement
|
2009-09-09 15:15:02 +02:00
|
|
|
until the end of the line.
|
|
|
|
We exclude modfile local vars because the user may want to modify their value
|
|
|
|
using a Matlab assignment statement.
|
2010-02-22 17:33:38 +01:00
|
|
|
We also exclude external functions because the user may have used a Matlab matrix
|
|
|
|
element in initval (in which case Dynare recognizes the matrix name as an external
|
2009-09-09 15:15:02 +02:00
|
|
|
function symbol), and may want to modify the matrix later with Matlab statements.
|
|
|
|
*/
|
|
|
|
<INITIAL>[A-Za-z_][A-Za-z0-9_]* {
|
2010-02-22 17:33:38 +01:00
|
|
|
if (driver.symbol_exists_and_is_not_modfile_local_or_external_function(yytext))
|
2009-09-09 15:15:02 +02:00
|
|
|
{
|
|
|
|
BEGIN DYNARE_STATEMENT;
|
|
|
|
yylval->string_val = new string(yytext);
|
|
|
|
return token::NAME;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Enter a native block */
|
|
|
|
BEGIN NATIVE;
|
|
|
|
yyless(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Enter a native block */
|
|
|
|
<INITIAL>. { BEGIN NATIVE; yyless(0); }
|
|
|
|
|
|
|
|
/* Add the native statement */
|
2010-06-17 12:47:38 +02:00
|
|
|
<NATIVE>{
|
2011-02-21 11:20:18 +01:00
|
|
|
[^/%*\n\.\'\"]* |
|
2011-02-21 16:31:51 +01:00
|
|
|
\' |
|
2011-02-21 11:20:18 +01:00
|
|
|
\'[^\'\n]*\' |
|
|
|
|
\"[^\"\n]*\" |
|
2010-06-18 12:39:29 +02:00
|
|
|
\.{1,2} |
|
|
|
|
"*" |
|
|
|
|
"/" { yymore(); eofbuff = string(yytext); }
|
|
|
|
\.{3,}[[:space:]]*\n { driver.add_native_remove_charset(yytext, "\n"); }
|
|
|
|
\n {
|
|
|
|
if (strlen(yytext) > 1)
|
|
|
|
driver.add_native_remove_charset(yytext, "\n");
|
|
|
|
BEGIN INITIAL;
|
|
|
|
}
|
|
|
|
<<EOF>> {
|
|
|
|
driver.add_native(eofbuff);
|
|
|
|
yyterminate();
|
|
|
|
}
|
|
|
|
\.{3,}[[:space:]]*"%".*\n |
|
|
|
|
"%"[^\n]* { driver.add_native_remove_charset(yytext, "%"); }
|
|
|
|
\.{3,}[[:space:]]*"//".*\n |
|
|
|
|
"//"[^\n]* { driver.add_native_remove_charset(yytext, "//"); }
|
|
|
|
\.{3,}[[:space:]]*"/*" {
|
|
|
|
driver.add_native_remove_charset(yytext, "/*");
|
|
|
|
BEGIN NATIVE_COMMENT;
|
|
|
|
}
|
|
|
|
"/*" {
|
|
|
|
driver.add_native_remove_charset(yytext, "/*");
|
|
|
|
comment_caller = NATIVE;
|
|
|
|
BEGIN COMMENT;
|
|
|
|
}
|
2010-06-17 12:47:38 +02:00
|
|
|
}
|
2009-09-09 15:15:02 +02:00
|
|
|
|
2010-06-18 12:39:29 +02:00
|
|
|
<NATIVE_COMMENT>"*/"[[:space:]]*\n { BEGIN NATIVE; }
|
|
|
|
<NATIVE_COMMENT>.
|
|
|
|
|
2013-10-22 17:57:44 +02:00
|
|
|
<INITIAL,DYNARE_STATEMENT,DYNARE_BLOCK,COMMENT,DATES_STATEMENT,LINE1,LINE2,LINE3,NATIVE_COMMENT><<EOF>> { yyterminate(); }
|
2009-09-09 15:15:02 +02:00
|
|
|
|
|
|
|
<*>. { driver.error(*yylloc, "character unrecognized by lexer"); }
|
|
|
|
%%
|
|
|
|
|
|
|
|
DynareFlex::DynareFlex(istream* in, ostream* out)
|
|
|
|
: DynareFlexLexer(in, out)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-08-30 14:37:48 +02:00
|
|
|
void
|
|
|
|
DynareFlex::location_increment(Dynare::parser::location_type *yylloc, const char *yytext)
|
|
|
|
{
|
|
|
|
while (*yytext != 0)
|
|
|
|
if (*yytext++ == '\n')
|
|
|
|
yylloc->lines(1);
|
|
|
|
else
|
|
|
|
yylloc->columns(1);
|
|
|
|
}
|
|
|
|
|
2009-09-09 15:15:02 +02:00
|
|
|
/* This implementation of DynareFlexLexer::yylex() is required to fill the
|
|
|
|
* vtable of the class DynareFlexLexer. We define the scanner's main yylex
|
|
|
|
* function via YY_DECL to reside in the DynareFlex class instead. */
|
|
|
|
|
|
|
|
#ifdef yylex
|
|
|
|
# undef yylex
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int
|
|
|
|
DynareFlexLexer::yylex()
|
|
|
|
{
|
|
|
|
cerr << "DynareFlexLexer::yylex() has been called, that should never happen!" << endl;
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
}
|