X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/c0828abf9d81ce665d5dc9b5a2b2062e267d4114..95361618dee181507d53f47de2dd50c667b84007:/data/c.m4 diff --git a/data/c.m4 b/data/c.m4 index 64f68fec..1f266a47 100644 --- a/data/c.m4 +++ b/data/c.m4 @@ -77,9 +77,6 @@ m4_define([b4_identification], /* Pull parsers. */ #define YYPULL ]b4_pull_flag])[ - -/* Using locations. */ -#define YYLSP_NEEDED ]b4_locations_flag[ ]]) @@ -537,8 +534,8 @@ b4_locations_if([, yylocationp])[]b4_user_args[); # b4_declare_yylstype # ------------------ -# Declaration that might either go into the header (if --defines) -# or open coded in the parser body. Declare YYSTYPE and YYLTYPE. +# Declarations that might either go into the header (if --defines) or +# in the parser body. Declare YYSTYPE/YYLTYPE, and yylval/yylloc. m4_define([b4_declare_yylstype], [[#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED ]m4_ifdef([b4_stype], @@ -566,4 +563,19 @@ typedef struct YYLTYPE # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif]]) + +b4_pure_if([], [[extern YYSTYPE ]b4_prefix[lval; +]b4_locations_if([[extern YYLTYPE ]b4_prefix[lloc;]])])[]dnl +]) + +# b4_declare_yydebug +# ------------------ +m4_define([b4_declare_yydebug], +[[/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG ]b4_debug_flag[ +#endif +#if YYDEBUG +extern int ]b4_prefix[debug; +#endif][]dnl ])