From 35d22310100e851c6f975aa5dc5e0fded029b580 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 27 Feb 2009 14:29:08 +0000 Subject: [PATCH] trunk preprocessor: fix compatibility issues with Bison 2.4 git-svn-id: https://www.dynare.org/svn/dynare/trunk@2442 ac1d8469-bf42-47a9-8791-bf33cf982152 --- preprocessor/DynareBison.yy | 10 ++++++++-- preprocessor/DynareFlex.ll | 1 - preprocessor/include/ParsingDriver.hh | 4 ++++ preprocessor/macro/MacroBison.yy | 6 ++++++ preprocessor/macro/MacroDriver.hh | 2 +- preprocessor/macro/MacroFlex.ll | 1 - 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/preprocessor/DynareBison.yy b/preprocessor/DynareBison.yy index be5e33a1a..282dde822 100644 --- a/preprocessor/DynareBison.yy +++ b/preprocessor/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/preprocessor/DynareFlex.ll b/preprocessor/DynareFlex.ll index 8aea07596..df7c9bb0f 100644 --- a/preprocessor/DynareFlex.ll +++ b/preprocessor/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/preprocessor/include/ParsingDriver.hh b/preprocessor/include/ParsingDriver.hh index a1d7f8617..dcf2c2ed4 100644 --- a/preprocessor/include/ParsingDriver.hh +++ b/preprocessor/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/preprocessor/macro/MacroBison.yy b/preprocessor/macro/MacroBison.yy index 5d1c24f02..3774e34cb 100644 --- a/preprocessor/macro/MacroBison.yy +++ b/preprocessor/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/preprocessor/macro/MacroDriver.hh b/preprocessor/macro/MacroDriver.hh index 6bc3bc0dc..1a6ce9987 100644 --- a/preprocessor/macro/MacroDriver.hh +++ b/preprocessor/macro/MacroDriver.hh @@ -30,8 +30,8 @@ #include #include -#include "MacroBison.hh" #include "MacroValue.hh" +#include "MacroBison.hh" using namespace std; diff --git a/preprocessor/macro/MacroFlex.ll b/preprocessor/macro/MacroFlex.ll index 855d740e9..1d1927cb1 100644 --- a/preprocessor/macro/MacroFlex.ll +++ b/preprocessor/macro/MacroFlex.ll @@ -23,7 +23,6 @@ using namespace std; #include #include "MacroDriver.hh" -#include "MacroBison.hh" // Announce to Flex the prototype we want for lexing function #define YY_DECL \