Fix build with Bison 3.7 and newer (#2505)

This commit is contained in:
Rupert Swarbrick 2020-08-18 17:12:52 +01:00 committed by GitHub
parent b67f1f0e94
commit aa39d020d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -53,6 +53,7 @@ Pieter Kapsenberg
Piotr Binkowski Piotr Binkowski
Qingyao Sun Qingyao Sun
Richard Myers Richard Myers
Rupert Swarbrick
Sean Cross Sean Cross
Sebastien Van Cauwenberghe Sebastien Van Cauwenberghe
Sergi Granell Sergi Granell

View File

@ -301,6 +301,15 @@ class AstSenTree;
// Bison 3.0 and newer // Bison 3.0 and newer
BISONPRE_VERSION(3.0,%define parse.error verbose) BISONPRE_VERSION(3.0,%define parse.error verbose)
// We run bison with the -d argument. This tells it to generate a
// header file with token names. Old versions of bison pasted the
// contents of that file into the generated source as well; newer
// versions just include it.
//
// Since we run bison through ../bisonpre, it doesn't know the correct
// header file name, so we need to tell it.
BISONPRE_VERSION(3.7,%define api.header.include {"V3ParseBison.h"})
// When writing Bison patterns we use yTOKEN instead of "token", // When writing Bison patterns we use yTOKEN instead of "token",
// so Bison will error out on unknown "token"s. // so Bison will error out on unknown "token"s.