2007-11-13 07:41:41 -05:00
|
|
|
#!/bin/sed -f
|
|
|
|
/^int yydebug;/{
|
|
|
|
i\
|
|
|
|
#ifndef yydebug
|
|
|
|
a\
|
|
|
|
#endif
|
|
|
|
}
|
2012-07-25 00:12:44 -04:00
|
|
|
/^extern int yydebug;/{
|
|
|
|
i\
|
|
|
|
#ifndef yydebug
|
|
|
|
a\
|
|
|
|
#endif
|
|
|
|
}
|
2007-12-27 21:46:06 -05:00
|
|
|
/^yydestruct.*yymsg/,/#endif/{
|
2007-12-25 07:26:11 -05:00
|
|
|
/^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/
|
2007-11-13 07:41:41 -05:00
|
|
|
s!^ *extern char \*getenv();!/* & */!
|
|
|
|
s/^\(#.*\)".*\.tab\.c"/\1"parse.c"/
|
2009-03-11 12:08:24 -04:00
|
|
|
/^\(#.*\)".*\.y"/s:\\\\:/:g
|