Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH/RFA] yyrule, yyname remap in .y files
@ 2002-09-02 11:23 Jason R Thorpe
  2002-09-02 17:53 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Jason R Thorpe @ 2002-09-02 11:23 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 838 bytes --]

Accoring to the ChangeLogs, there was some excitement about this back
in 1992.

In any case, the fact remains that some versions of yacc(1) export yyrule
and yyname when YYDEBUG is enabled.  YYDEBUG is enabled by default in the
.y files.

This is worked around on the i386-openbsd host by setting MH_CFLAGS
to -DYYDEBUG=0.

Now, I could do that for every single NetBSD host, but it seems a little
silly do have to work around this in multiple places for multiple hosts
when we could just remap these symbols and just be done with it.  This
patch does that.

OK to commit?

	* ada-exp.y (yyname, yyrule): Remap global variables that appear
	when YYDEBUG is set to 1.
	* c-exp.y: Likewise.
	* f-exp.y: Likewise.
	* jv-exp.y: Likewise.
	* m2-exp.y: Likewise.
	* p-exp.y: Likewise.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>

[-- Attachment #2: yfile-patch --]
[-- Type: text/plain, Size: 3724 bytes --]

Index: ada-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/ada-exp.y,v
retrieving revision 1.2
diff -c -r1.2 ada-exp.y
*** ada-exp.y	21 Jun 2002 14:32:10 -0000	1.2
--- ada-exp.y	2 Sep 2002 18:10:14 -0000
***************
*** 90,95 ****
--- 90,97 ----
  #define	yylloc	ada_lloc
  #define yyreds	ada_reds		/* With YYDEBUG defined */
  #define yytoks	ada_toks		/* With YYDEBUG defined */
+ #define yyname	ada_name		/* With YYDEBUG defined */
+ #define yyrule	ada_rule		/* With YYDEBUG defined */
  
  #ifndef YYDEBUG
  #define	YYDEBUG	1		/* Default to yydebug support */
Index: c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.11
diff -c -r1.11 c-exp.y
*** c-exp.y	21 Jun 2002 14:32:10 -0000	1.11
--- c-exp.y	2 Sep 2002 18:10:19 -0000
***************
*** 89,94 ****
--- 89,96 ----
  #define	yylloc	c_lloc
  #define yyreds	c_reds		/* With YYDEBUG defined */
  #define yytoks	c_toks		/* With YYDEBUG defined */
+ #define yyname	c_name		/* With YYDEBUG defined */
+ #define yyrule	c_rule		/* With YYDEBUG defined */
  #define yylhs	c_yylhs
  #define yylen	c_yylen
  #define yydefred c_yydefred
Index: f-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/f-exp.y,v
retrieving revision 1.7
diff -c -r1.7 f-exp.y
*** f-exp.y	21 Jun 2002 14:32:10 -0000	1.7
--- f-exp.y	2 Sep 2002 18:10:20 -0000
***************
*** 91,96 ****
--- 91,98 ----
  #define	yylloc	f_lloc
  #define yyreds	f_reds		/* With YYDEBUG defined */
  #define yytoks	f_toks		/* With YYDEBUG defined */
+ #define yyname	f_name		/* With YYDEBUG defined */
+ #define yyrule	f_rule		/* With YYDEBUG defined */
  #define yylhs	f_yylhs
  #define yylen	f_yylen
  #define yydefred f_yydefred
Index: jv-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/jv-exp.y,v
retrieving revision 1.8
diff -c -r1.8 jv-exp.y
*** jv-exp.y	25 Jul 2002 04:33:24 -0000	1.8
--- jv-exp.y	2 Sep 2002 18:10:21 -0000
***************
*** 85,90 ****
--- 85,92 ----
  #define	yylloc	java_lloc
  #define yyreds	java_reds		/* With YYDEBUG defined */
  #define yytoks	java_toks		/* With YYDEBUG defined */
+ #define yyname	java_name		/* With YYDEBUG defined */
+ #define yyrule	java_rule		/* With YYDEBUG defined */
  #define yylhs	java_yylhs
  #define yylen	java_yylen
  #define yydefred java_yydefred
Index: m2-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/m2-exp.y,v
retrieving revision 1.5
diff -c -r1.5 m2-exp.y
*** m2-exp.y	21 Jun 2002 14:32:10 -0000	1.5
--- m2-exp.y	2 Sep 2002 18:10:22 -0000
***************
*** 87,92 ****
--- 87,94 ----
  #define	yylloc	m2_lloc
  #define	yyreds	m2_reds		/* With YYDEBUG defined */
  #define	yytoks	m2_toks		/* With YYDEBUG defined */
+ #define yyname	m2_name		/* With YYDEBUG defined */
+ #define yyrule	m2_rule		/* With YYDEBUG defined */
  #define yylhs	m2_yylhs
  #define yylen	m2_yylen
  #define yydefred m2_yydefred
Index: p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.12
diff -c -r1.12 p-exp.y
*** p-exp.y	21 Jun 2002 14:32:10 -0000	1.12
--- p-exp.y	2 Sep 2002 18:10:23 -0000
***************
*** 93,98 ****
--- 93,100 ----
  #define	yylloc	pascal_lloc
  #define yyreds	pascal_reds		/* With YYDEBUG defined */
  #define yytoks	pascal_toks		/* With YYDEBUG defined */
+ #define yyname	pascal_name		/* With YYDEBUG defined */
+ #define yyrule	pascal_rule		/* With YYDEBUG defined */
  #define yylhs	pascal_yylhs
  #define yylen	pascal_yylen
  #define yydefred pascal_yydefred

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-03  0:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-02 11:23 [PATCH/RFA] yyrule, yyname remap in .y files Jason R Thorpe
2002-09-02 17:53 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox