Bison 2.5 compatibility patch and make target.
This commit is contained in:
parent
b312a2fb01
commit
30113be459
9
Makefile
9
Makefile
|
@ -19,6 +19,8 @@
|
|||
|
||||
default: compile cleanautogen
|
||||
|
||||
bison2: patch2 default unpatch2
|
||||
|
||||
compile:
|
||||
bison Monicelli.ypp
|
||||
flex Monicelli.lpp
|
||||
|
@ -26,6 +28,13 @@ compile:
|
|||
-Wall -Wno-deprecated-register -std=c++11 -DYYDEBUG=0 -O2 \
|
||||
Parser.cpp lex.yy.cc Nodes.cpp main.cpp -o mcc
|
||||
|
||||
patch2:
|
||||
# Bison 2 compatibility patch
|
||||
patch -r - -p 1 -N < bison2.patch || true
|
||||
|
||||
unpatch2:
|
||||
patch -p 1 -R < bison2.patch
|
||||
|
||||
graph:
|
||||
bison --graph Monicelli.y
|
||||
|
||||
|
|
10
README.md
10
README.md
|
@ -17,7 +17,15 @@ executable is a matter of:
|
|||
|
||||
make
|
||||
|
||||
there are some other targets, which are of interest only for developers.
|
||||
A patch is provided for compatibility with Bison 2.5. If you can't really
|
||||
upgrade to Bison 3.0, and I strongly recommend that, you can always compile
|
||||
with:
|
||||
|
||||
make bison2
|
||||
|
||||
However, note that this is not supported and might be removed in a future release.
|
||||
|
||||
There are some other targets, which are of interest only for developers.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
|
28
bison2.patch
Normal file
28
bison2.patch
Normal file
|
@ -0,0 +1,28 @@
|
|||
diff --git a/Monicelli.ypp b/Monicelli.ypp
|
||||
index 028506d..9817f1e 100644
|
||||
--- a/Monicelli.ypp
|
||||
+++ b/Monicelli.ypp
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
|
||||
%skeleton "lalr1.cc"
|
||||
-%require "3.0"
|
||||
+%require "2.5"
|
||||
%language "c++"
|
||||
|
||||
%defines
|
||||
@@ -31,9 +31,11 @@
|
||||
%locations
|
||||
%token-table
|
||||
|
||||
-%define parse.error verbose
|
||||
-%define api.namespace {monicelli}
|
||||
-%define parser_class_name {Parser}
|
||||
+%{
|
||||
+#define YYERROR_VERBOSE
|
||||
+%}
|
||||
+%define namespace monicelli
|
||||
+%define parser_class_name Parser
|
||||
|
||||
%lex-param {Scanner &scanner}
|
||||
%parse-param {Scanner &scanner}
|
Reference in New Issue
Block a user