diff --git a/DynareBison.yy b/DynareBison.yy index be5e33a1a5f6681367351919730a21379aa6afb0..282dde822cfa3dfe1f7737911fc4c8f256144b44 100644 --- a/DynareBison.yy +++ b/DynareBison.yy @@ -21,6 +21,12 @@ %require "2.3" %defines +/* Prologue: + In Bison <= 2.3, it is inserted in both the .cc and .hh files. + In Bison >= 2.3a, it is inserted only in the .cc file. + Since Bison 2.4, the new %code directives provide a cleaner way of dealing + with the prologue. +*/ %{ using namespace std; @@ -1287,8 +1293,8 @@ o_method : METHOD EQUAL INT_NUMBER { driver.option_num("simulation_method",$3);} | METHOD EQUAL BICGSTAB { driver.option_num("simulation_method", "3"); }; o_markowitz : MARKOWITZ EQUAL number { driver.option_num("markowitz", $3); }; o_simul : SIMUL { driver.option_num("simul", "1"); }; -o_simul_seed : SIMUL_SEED EQUAL INT_NUMBER { driver.option_num("simul_seed", $3)} ; -o_qz_criterium : QZ_CRITERIUM EQUAL number { driver.option_num("qz_criterium", $3) }; +o_simul_seed : SIMUL_SEED EQUAL INT_NUMBER { driver.option_num("simul_seed", $3); } ; +o_qz_criterium : QZ_CRITERIUM EQUAL number { driver.option_num("qz_criterium", $3); }; o_datafile : DATAFILE EQUAL filename { driver.option_str("datafile", $3); }; o_nobs : NOBS EQUAL vec_int { driver.option_num("nobs", $3); } diff --git a/DynareFlex.ll b/DynareFlex.ll index 8aea075968d2e01d31691580d838287216cecd6b..df7c9bb0f107cb9ae5db5c8aa5906a36f94b30c1 100644 --- a/DynareFlex.ll +++ b/DynareFlex.ll @@ -21,7 +21,6 @@ using namespace std; #include "ParsingDriver.hh" -#include "DynareBison.hh" // Announce to Flex the prototype we want for lexing function #define YY_DECL \ diff --git a/include/ParsingDriver.hh b/include/ParsingDriver.hh index a1d7f86174663b24d524b87dedd116fe48b67362..dcf2c2ed4989d156bf45360d6f607d0a90640676 100644 --- a/include/ParsingDriver.hh +++ b/include/ParsingDriver.hh @@ -30,7 +30,11 @@ #include "ModFile.hh" #include "SymbolList.hh" + +class ParsingDriver; +#include "ExprNode.hh" #include "DynareBison.hh" + #include "ComputingTasks.hh" #include "Shocks.hh" #include "SigmaeInitialization.hh" diff --git a/macro/MacroBison.yy b/macro/MacroBison.yy index 5d1c24f0218dc6ab4edd2f8fabe9b13a1941ff20..3774e34cb3ecb6cbbb25b5016f8ca12557fec36c 100644 --- a/macro/MacroBison.yy +++ b/macro/MacroBison.yy @@ -21,6 +21,12 @@ %require "2.3" %defines +/* Prologue: + In Bison <= 2.3, it is inserted in both the .cc and .hh files. + In Bison >= 2.3a, it is inserted only in the .cc file. + Since Bison 2.4, the new %code directives provide a cleaner way of dealing + with the prologue. +*/ %{ using namespace std; diff --git a/macro/MacroDriver.hh b/macro/MacroDriver.hh index 6bc3bc0dc58acab496afe5cb9f335b946abdb147..1a6ce998770fc131d265735e36d5cfedaf9cdb3b 100644 --- a/macro/MacroDriver.hh +++ b/macro/MacroDriver.hh @@ -30,8 +30,8 @@ #include <map> #include <set> -#include "MacroBison.hh" #include "MacroValue.hh" +#include "MacroBison.hh" using namespace std; diff --git a/macro/MacroFlex.ll b/macro/MacroFlex.ll index 855d740e97c840907ae4a6f11ffb6bf4a53d82ed..1d1927cb123844f6c5d432c80af30a14d168c794 100644 --- a/macro/MacroFlex.ll +++ b/macro/MacroFlex.ll @@ -23,7 +23,6 @@ using namespace std; #include <fstream> #include "MacroDriver.hh" -#include "MacroBison.hh" // Announce to Flex the prototype we want for lexing function #define YY_DECL \