[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compil error in parsetiger.hh
From: |
Akim Demaille |
Subject: |
Re: compil error in parsetiger.hh |
Date: |
24 Oct 2002 12:01:43 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
| j'ai essayé avec 2.95.4, 3.0, et 3.2 et j'ai la même chose (sur la
| derniere version de tiger)
|
| make[4]: Entering directory
`/home/lrde/stud/chojin/lrde-chojin/tiger/tiger-current/src/parse'
| if g++-3.2 -DHAVE_CONFIG_H -I. -I. -I../.. -I ./.. -I .. -g -O2 -MT
parsetiger.o -MD -MP -MF ".deps/parsetiger.Tpo" \
| -c -o parsetiger.o `test -f 'parsetiger.cc' || echo './'`parsetiger.cc; \
| then mv ".deps/parsetiger.Tpo" ".deps/parsetiger.Po"; \
| else rm -f ".deps/parsetiger.Tpo"; exit 1; \
| fi
| In file included from parsetiger.cc:21:
| parsetiger.hh:237: ISO C++ forbids declaration of `yysigned_char' with no type
| parsetiger.hh:237: parse error before `;' token
| parsetiger.hh:251: ISO C++ forbids declaration of `RhsNumberType' with no type
| parsetiger.hh:251: cannot declare member
`yy::Traits<yy::Parser>::RhsNumberType
| ' within `yy::Parser'
| parsetiger.hh:251: parse error before `;' token
| parsetiger.hh:295: ISO C++ forbids declaration of `yysigned_char' with no type
| parsetiger.hh:295: parse error before `[' token
| parsetiger.hh:309: ISO C++ forbids declaration of `RhsNumberType' with no type
| parsetiger.hh:309: parse error before `[' token
| parsetiger.cc: In member function `virtual int yy::Parser::parse()':
| parsetiger.cc:160: `rhs_' undeclared (first use this function)
| parsetiger.cc:160: (Each undeclared identifier is reported only once for each
| function it appears in.)
| parsetiger.cc:584: `pgoto_' undeclared (first use this function)
| parsetiger.cc: At global scope:
| parsetiger.cc:786: syntax error before `::' token
| parsetiger.cc:988: parse error before `::' token
| make[4]: *** [parsetiger.o] Error 1
| make[4]: Leaving directory
`/home/lrde/stud/chojin/lrde-chojin/tiger/tiger-current/src/parse'
Thanks for the report. I'm applying the two following patches. First
Bison: Paul, since glr.c is not KnR (and I don't think it plans to
be), there seems to be no point in keeping the yysigned_char stuff.
Index: ChangeLog
from Akim Demaille <address@hidden>
* data/yacc.c (m4_int_type): New.
* data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
char' as only yacc.c wants K&R portability.
* data/glr.c (yysigned_char): Remove.
* data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
Reported by Quoc Peyrot.
Index: THANKS
===================================================================
RCS file: /cvsroot/bison/bison/THANKS,v
retrieving revision 1.51
diff -u -u -r1.51 THANKS
--- THANKS 23 Oct 2002 16:30:50 -0000 1.51
+++ THANKS 24 Oct 2002 09:59:04 -0000
@@ -48,6 +48,7 @@
Per Allansson address@hidden
Peter Hámorský address@hidden
Piotr Gackiewicz address@hidden
+Quoc Peyrot address@hidden
R Blake address@hidden
Raja R Harinath address@hidden
Richard Stallman address@hidden
Index: data/c.m4
===================================================================
RCS file: /cvsroot/bison/bison/data/c.m4,v
retrieving revision 1.12
diff -u -u -r1.12 c.m4
--- data/c.m4 20 Oct 2002 12:51:10 -0000 1.12
+++ data/c.m4 24 Oct 2002 09:59:04 -0000
@@ -65,7 +65,7 @@
# MIN to MAX (included).
m4_define([b4_int_type],
[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
- b4_ints_in($@, [-128], [127]), [1], [yysigned_char],
+ b4_ints_in($@, [-128], [127]), [1], [signed char],
b4_ints_in($@, [0], [65535]), [1], [unsigned short],
b4_ints_in($@, [-32768], [32767]), [1], [short],
@@ -73,6 +73,7 @@
m4_eval([0 <= $1]), [1], [unsigned int],
[int])])
+
# b4_int_type_for(NAME)
# ---------------------
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.23
diff -u -u -r1.23 glr.c
--- data/glr.c 23 Oct 2002 06:30:49 -0000 1.23
+++ data/glr.c 24 Oct 2002 09:59:04 -0000
@@ -207,12 +207,6 @@
# define yyfalse 0
#endif
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short yysigned_char;
-#endif
-
/*-----------------.
| GCC extensions. |
`-----------------*/
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.10
diff -u -u -r1.10 lalr1.cc
--- data/lalr1.cc 20 Oct 2002 11:20:15 -0000 1.10
+++ data/lalr1.cc 24 Oct 2002 09:59:04 -0000
@@ -775,7 +775,7 @@
const int yy::b4_parser_class_name::initdepth_ = b4_stack_depth_init;
const unsigned yy::b4_parser_class_name::user_token_number_max_ =
b4_user_token_number_max;
-const yy::b4_parser_class_name::TokenNumberType yy::b4_name::undef_token_ =
b4_undef_token_number;
+const yy::b4_parser_class_name::TokenNumberType
yy::b4_parser_class_name::undef_token_ = b4_undef_token_number;
b4_epilogue
dnl
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.25
diff -u -u -r1.25 yacc.c
--- data/yacc.c 20 Oct 2002 12:51:10 -0000 1.25
+++ data/yacc.c 24 Oct 2002 09:59:04 -0000
@@ -47,6 +47,28 @@
b4_parse_param)])
+
+## ------------ ##
+## Data Types. ##
+## ------------ ##
+
+# b4_int_type(MIN, MAX)
+# ---------------------
+# Return the smallest int type able to handle numbers ranging from
+# MIN to MAX (included). We overwrite the version from c.m4 which relies
+# on `signed char' which is not portable to old K&R compilers.
+m4_define([b4_int_type],
+[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
+ b4_ints_in($@, [-128], [127]), [1], [yysigned_char],
+
+ b4_ints_in($@, [0], [65535]), [1], [unsigned short],
+ b4_ints_in($@, [-32768], [32767]), [1], [short],
+
+ m4_eval([0 <= $1]), [1], [unsigned int],
+
+ [int])])
+
+
## ----------------- ##
## Semantic Values. ##
## ----------------- ##
and then this patch for the Tiger Compiler.
Index: ChangeLog
from Akim Demaille <address@hidden>
* src/parse/parsetiger.yy (ltype): Rename as `location_type'.
Reported by Quoc.
Index: THANKS
--- THANKS Wed, 13 Mar 2002 08:59:36 +0100 akim (tiger/g/26_THANKS 1.2 644)
+++ THANKS Thu, 24 Oct 2002 11:58:20 +0200 akim (tiger/g/26_THANKS 1.2 644)
@@ -1,2 +1,3 @@
+Darks Bob address@hidden
Fabien Stepho
-Darks Bob <address@hidden>
+Quoc Peyrot address@hidden
Index: src/parse/parsetiger.yy
--- src/parse/parsetiger.yy Fri, 04 Oct 2002 12:11:15 +0200 akim
(tiger/8_parsetiger 1.39.1.1.2.3.1.27 644)
+++ src/parse/parsetiger.yy Thu, 24 Oct 2002 11:57:25 +0200 akim
(tiger/8_parsetiger 1.39.1.1.2.3.1.27 644)
@@ -56,7 +56,7 @@
# include "parse/parse.hh"
%}
-%define "ltype" "::Location"
+%define "location_type" "::Location"
%token <str> STRING "string"
%token <symbol> ID "identifier"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: compil error in parsetiger.hh,
Akim Demaille <=