From df88308629c0668e026e15d29f3012a9f38895d0 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sun, 19 Jan 2003 18:59:18 +0000 Subject: [PATCH] fix for bison greater than 1.35 --- dtool/src/cppparser/cppBisonDefs.h | 9 +++++++-- dtool/src/cppparser/cppToken.cxx | 2 -- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dtool/src/cppparser/cppBisonDefs.h b/dtool/src/cppparser/cppBisonDefs.h index 23facb30c1..7db7bebfad 100644 --- a/dtool/src/cppparser/cppBisonDefs.h +++ b/dtool/src/cppparser/cppBisonDefs.h @@ -97,14 +97,19 @@ public: // lexer. struct cppyyltype { - int timestamp; int first_line; int first_column; int last_line; int last_column; - char *text; CPPFile file; }; #define YYLTYPE cppyyltype +// Beginning around bison 1.35 or so, we need to define this macro as +// well, to tell bison how to collect multiple locations together. +#define YYLLOC_DEFAULT(Current, Rhs, N) \ + Current = Rhs[1]; \ + Current.last_line = Rhs[N].last_line; \ + Current.last_column = Rhs[N].last_column; + #endif diff --git a/dtool/src/cppparser/cppToken.cxx b/dtool/src/cppparser/cppToken.cxx index 44577fb1ef..db255b2cec 100644 --- a/dtool/src/cppparser/cppToken.cxx +++ b/dtool/src/cppparser/cppToken.cxx @@ -35,12 +35,10 @@ CPPToken(int token, int line_number, int col_number, _token(token), _lval(lval) { _lval.str = str; - _lloc.timestamp = 0; _lloc.first_line = line_number; _lloc.first_column = col_number; _lloc.last_line = line_number; _lloc.last_column = col_number; - _lloc.text = NULL; _lloc.file = file; }