X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/c6b1772473d0a26faa22464df98718d0d0ae2e2e..ea45ade792bb01f9e8f778fce6a5f5b424af69de:/data/glr.c diff --git a/data/glr.c b/data/glr.c index 9038c747..13c73814 100644 --- a/data/glr.c +++ b/data/glr.c @@ -188,13 +188,10 @@ m4_if(b4_skeleton, ["glr.c"], ## Output files. ## ## -------------- ## -# We do want M4 expansion after # for CPP macros. -m4_changecom() -m4_divert_push(0)dnl -@output(b4_parser_file_name@)@ +b4_output_begin([b4_parser_file_name]) b4_copyright([Skeleton implementation for Bison GLR parsers in C], - [2002-2012]) -[ + [2002-2012])[ + /* C GLR parser skeleton written by Paul Hilfinger. */ ]b4_identification @@ -289,7 +286,7 @@ b4_percent_code_get[]dnl # include # define YYJMP_BUF jmp_buf # define YYSETJMP(Env) setjmp (Env) -// Pacify clang. +/* Pacify clang. */ # define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0)) #endif @@ -305,13 +302,6 @@ b4_percent_code_get[]dnl # endif #endif -]b4_locations_if([#define YYOPTIONAL_LOC(Name) Name],[ -#ifdef __cplusplus -# define YYOPTIONAL_LOC(Name) /* empty */ -#else -# define YYOPTIONAL_LOC(Name) Name __attribute__ ((__unused__)) -#endif])[ - #ifndef YYASSERT # define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0))) #endif @@ -481,6 +471,12 @@ typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG; multiple parsers can coexist. */ int yydebug; +struct yyGLRStack; +static void yypstack (struct yyGLRStack* yystackp, size_t yyk) + __attribute__ ((__unused__)); +static void yypdumpstack (struct yyGLRStack* yystackp) + __attribute__ ((__unused__)); + #else /* !]b4_api_PREFIX[DEBUG */ # define YYDPRINTF(Args) @@ -2007,10 +2003,10 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) #if ! YYERROR_VERBOSE yyerror (]b4_lyyerror_args[YY_("syntax error")); #else + { yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); size_t yysize0 = yytnamerr (YY_NULL, yytokenName (yytoken)); size_t yysize = yysize0; - size_t yysize1; yybool yysize_overflow = yyfalse; char* yymsg = YY_NULL; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; @@ -2070,9 +2066,11 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) break; } yyarg[yycount++] = yytokenName (yyx); - yysize1 = yysize + yytnamerr (YY_NULL, yytokenName (yyx)); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; + { + size_t yysz = yysize + yytnamerr (YY_NULL, yytokenName (yyx)); + yysize_overflow |= yysz < yysize; + yysize = yysz; + } } } } @@ -2092,9 +2090,11 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) #undef YYCASE_ } - yysize1 = yysize + strlen (yyformat); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; + { + size_t yysz = yysize + strlen (yyformat); + yysize_overflow |= yysz < yysize; + yysize = yysz; + } if (!yysize_overflow) yymsg = (char *) YYMALLOC (yysize); @@ -2124,6 +2124,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) yyerror (]b4_lyyerror_args[YY_("syntax error")); yyMemoryExhausted (yystackp); } + } #endif /* YYERROR_VERBOSE */ yynerrs += 1; } @@ -2487,10 +2488,6 @@ b4_dollar_popdef])[]dnl /* DEBUGGING ONLY */ #if ]b4_api_PREFIX[DEBUG -static void yypstack (yyGLRStack* yystackp, size_t yyk) - __attribute__ ((__unused__)); -static void yypdumpstack (yyGLRStack* yystackp) __attribute__ ((__unused__)); - static void yy_yypstack (yyGLRState* yys) { @@ -2560,17 +2557,17 @@ yypdumpstack (yyGLRStack* yystackp) } #endif ]b4_epilogue[]dnl -dnl -dnl glr.cc produces its own header. -dnl +b4_output_end() + +# glr.cc produces its own header. m4_if(b4_skeleton, ["glr.c"], [b4_defines_if( -[@output(b4_spec_defines_file@)@ +[b4_output_begin([b4_spec_defines_file]) b4_copyright([Skeleton interface for Bison GLR parsers in C], [2002-2012])[ ]b4_cpp_guard_open([b4_spec_defines_file])[ ]b4_shared_declarations[ ]b4_cpp_guard_close([b4_spec_defines_file])[ -]])])dnl -m4_divert_pop(0) +]b4_output_end() +])])