From 9ecc288f72baebe7fd2aa53a2a02119ce3db7994 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Mon, 16 Oct 2023 10:37:20 -0400
Subject: [PATCH] =?UTF-8?q?Bison=20grammar:=20small=20simplification=20w.r?=
 =?UTF-8?q?.t.=20=E2=80=9Cmodel=E2=80=9D=20block=20options?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Those options do not internally behave as the usual command options (which have
a “o_*” rule), so it makes more sense to treat them differently.
---
 src/DynareBison.yy | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/DynareBison.yy b/src/DynareBison.yy
index dbe57f5d..7b4b5f68 100644
--- a/src/DynareBison.yy
+++ b/src/DynareBison.yy
@@ -942,14 +942,14 @@ resid : RESID ';'
 /* The tokens below must be accepted in both DYNARE_STATEMENT and DYNARE_BLOCK
    states in the lexer, because of model block and model_options statement */
 model_option : BLOCK { driver.block(); }
-             | o_cutoff
-             | o_mfs
+             | CUTOFF EQUAL non_negative_number { driver.cutoff($3); };
+             | MFS EQUAL INT_NUMBER { driver.mfs($3); };
              | BYTECODE { driver.bytecode(); }
              | USE_DLL { driver.use_dll(); }
              | NO_STATIC { driver.no_static();}
              | DIFFERENTIATE_FORWARD_VARS { driver.differentiate_forward_vars_all(); }
              | DIFFERENTIATE_FORWARD_VARS EQUAL '(' symbol_list ')' { driver.differentiate_forward_vars_some($4); }
-             | o_linear
+             | LINEAR { driver.linear(); };
              | PARALLEL_LOCAL_FILES EQUAL '(' parallel_local_filename_list ')'
              | BALANCED_GROWTH_TEST_TOL EQUAL non_negative_number { driver.balanced_growth_test_tol($3); }
              ;
@@ -3487,7 +3487,6 @@ o_simul_algo : SIMUL_ALGO EQUAL INT_NUMBER {
 o_stack_solve_algo : STACK_SOLVE_ALGO EQUAL INT_NUMBER { driver.option_num("stack_solve_algo", $3); };
 o_robust_lin_solve : ROBUST_LIN_SOLVE { driver.option_num("simul.robust_lin_solve", "true"); };
 o_endogenous_terminal_period : ENDOGENOUS_TERMINAL_PERIOD { driver.option_num("endogenous_terminal_period", "true"); };
-o_linear : LINEAR { driver.linear(); };
 o_order : ORDER EQUAL INT_NUMBER { driver.option_num("order", $3); };
 o_replic : REPLIC EQUAL INT_NUMBER { driver.option_num("replic", $3); };
 o_drop : DROP EQUAL INT_NUMBER { driver.option_num("drop", $3); };
@@ -3528,7 +3527,6 @@ o_steady_tolx : TOLX EQUAL non_negative_number { driver.option_num("solve_tolx",
 o_opt_algo : OPT_ALGO EQUAL INT_NUMBER { driver.option_num("osr.opt_algo", $3); }
            | OPT_ALGO EQUAL filename { driver.option_str("osr.opt_algo", $3); }
            ;
-o_cutoff : CUTOFF EQUAL non_negative_number { driver.cutoff($3); };
 o_markowitz : MARKOWITZ EQUAL non_negative_number { driver.option_num("markowitz", $3); };
 
 // Options of perfect_foresight_* commands that control steady state computation at terminal condition
@@ -3539,7 +3537,6 @@ o_pf_steady_tolx : STEADY_TOLX EQUAL non_negative_number { driver.option_num("si
 o_pf_steady_markowitz : STEADY_MARKOWITZ EQUAL non_negative_number { driver.option_num("simul.steady_markowitz", $3); };
 
 o_minimal_solving_periods : MINIMAL_SOLVING_PERIODS EQUAL non_negative_number { driver.option_num("minimal_solving_periods", $3); };
-o_mfs : MFS EQUAL INT_NUMBER { driver.mfs($3); };
 o_simul : SIMUL; // Do nothing, only here for backward compatibility
 o_simul_replic : SIMUL_REPLIC EQUAL INT_NUMBER { driver.option_num("simul_replic", $3); };
 o_simul_seed : SIMUL_SEED EQUAL INT_NUMBER { driver.error("'simul_seed' option is no longer supported; use 'set_dynare_seed' command instead"); } ;
-- 
GitLab