From: Jim Meyering Date: Fri, 1 Nov 1996 00:32:12 +0000 (+0000) Subject: Remap yacc globals to have gd_ prefix. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa854d422c281e72d6d5aacbd0be81489d543f6d;p=pspp Remap yacc globals to have gd_ prefix. Suggestion to do as in gdb/c-exp.y from Tom Tromey. --- diff --git a/lib/getdate.y b/lib/getdate.y index 4bcc4c8a17..6988604dd8 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -97,9 +97,52 @@ struct timeb extern struct tm *gmtime (); extern struct tm *localtime (); -#define yyparse getdate_yyparse -#define yylex getdate_yylex -#define yyerror getdate_yyerror +/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), + as well as gratuitiously global symbol names, so we can have multiple + yacc generated parsers in the same program. Note that these are only + the variables produced by yacc. If other parser generators (bison, + byacc, etc) produce additional global names that conflict at link time, + then those parser generators need to be fixed instead of adding those + names to this list. */ + +#define yymaxdepth gd_maxdepth +#define yyparse gd_parse +#define yylex gd_lex +#define yyerror gd_error +#define yylval gd_lval +#define yychar gd_char +#define yydebug gd_debug +#define yypact gd_pact +#define yyr1 gd_r1 +#define yyr2 gd_r2 +#define yydef gd_def +#define yychk gd_chk +#define yypgo gd_pgo +#define yyact gd_act +#define yyexca gd_exca +#define yyerrflag gd_errflag +#define yynerrs gd_nerrs +#define yyps gd_ps +#define yypv gd_pv +#define yys gd_s +#define yy_yys gd_yys +#define yystate gd_state +#define yytmp gd_tmp +#define yyv gd_v +#define yy_yyv gd_yyv +#define yyval gd_val +#define yylloc gd_lloc +#define yyreds gd_reds /* With YYDEBUG defined */ +#define yytoks gd_toks /* With YYDEBUG defined */ +#define yylhs gd_yylhs +#define yylen gd_yylen +#define yydefred gd_yydefred +#define yydgoto gd_yydgoto +#define yysindex gd_yysindex +#define yyrindex gd_yyrindex +#define yygindex gd_yygindex +#define yytable gd_yytable +#define yycheck gd_yycheck static int yylex (); static int yyerror ();