diff options
Diffstat (limited to 'jni/ruby/tool/ytab.sed')
-rwxr-xr-x | jni/ruby/tool/ytab.sed | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/jni/ruby/tool/ytab.sed b/jni/ruby/tool/ytab.sed new file mode 100755 index 0000000..46317db --- /dev/null +++ b/jni/ruby/tool/ytab.sed @@ -0,0 +1,37 @@ +#!/bin/sed -f +/^int yydebug;/{ +i\ +#ifndef yydebug +a\ +#endif +} +/^extern int yydebug;/{ +i\ +#ifndef yydebug +a\ +#endif +} +/^yydestruct.*yymsg/,/#endif/{ + /^yydestruct/{ + /parser/!{ + h + s/^/ruby_parser_&/ + s/)$/, parser)/ + /\*/s/parser)$/struct parser_params *&/ + } + } + /^#endif/{ + x + /^./{ + i\ + struct parser_params *parser; + a\ +#define yydestruct(m, t, v) ruby_parser_yydestruct(m, t, v, parser) + } + x + } +} +s/^\([ ]*\)\(yyerror[ ]*([ ]*parser,\)/\1parser_\2/ +s!^ *extern char \*getenv();!/* & */! +s/^\(#.*\)".*\.tab\.c"/\1"parse.c"/ +/^\(#.*\)".*\.y"/s:\\\\:/:g |