ytab.sed: for bison 2

* tool/ytab.sed: substitute `fprintf`s used directory in
  yy_reduce_print by bison 2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-12-14 06:36:50 +00:00
parent 4f09696496
commit fcb4ab8d1c
2 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,12 @@
#define YYCALLOC(nelem, size) rb_parser_calloc(parser, (nelem), (size))
#define YYFREE(ptr) rb_parser_free(parser, (ptr))
#define YYFPRINTF rb_parser_printf
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
rb_parser_printf(parser, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
#endif
#undef malloc
#undef realloc
#undef calloc

View File

@ -47,6 +47,9 @@ a\
}
x
}
/^yy_reduce_print/,/^}/{
s/fprintf *(stderr,/YYFPRINTF (parser,/g
}
s/\( YYFPRINTF *(\)yyoutput,/\1parser,/
s/\( YYFPRINTF *(\)stderr,/\1parser,/
s/\( YYDPRINTF *((\)stderr,/\1parser,/