diff options
Diffstat (limited to 'tool/ytab.sed')
-rwxr-xr-x | tool/ytab.sed | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tool/ytab.sed b/tool/ytab.sed index 46317db284..d8fb70016c 100755 --- a/tool/ytab.sed +++ b/tool/ytab.sed @@ -14,7 +14,7 @@ a\ /^yydestruct.*yymsg/,/#endif/{ /^yydestruct/{ /parser/!{ - h + H s/^/ruby_parser_&/ s/)$/, parser)/ /\*/s/parser)$/struct parser_params *&/ @@ -22,7 +22,7 @@ a\ } /^#endif/{ x - /^./{ + /yydestruct/{ i\ struct parser_params *parser; a\ @@ -31,6 +31,22 @@ a\ x } } +/^yy_stack_print/{ + /parser/!{ + H + s/)$/, parser)/ + /\*/s/parser)$/struct parser_params *&/ + } +} +/yy_stack_print.*;/{ + x + /yy_stack_print/{ + x + s/\(yy_stack_print *\)(\(.*\));/\1(\2, parser);/ + x + } + x +} s/^\([ ]*\)\(yyerror[ ]*([ ]*parser,\)/\1parser_\2/ s!^ *extern char \*getenv();!/* & */! s/^\(#.*\)".*\.tab\.c"/\1"parse.c"/ |