summaryrefslogtreecommitdiff
path: root/tool/ytab.sed
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-25 12:26:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-25 12:26:11 +0000
commitd050e46b8ca92b26587f847b3950dd642d6ba666 (patch)
tree35c38660a424cc61cc3f7a494364ca07518317f0 /tool/ytab.sed
parent42643e482e1c58cd353d88d0c317d091df80cd3d (diff)
* common.mk (parse.c): depends on tool/ytab.sed.
* tool/ytab.sed: hack for bison 2.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ytab.sed')
-rwxr-xr-xtool/ytab.sed22
1 files changed, 21 insertions, 1 deletions
diff --git a/tool/ytab.sed b/tool/ytab.sed
index d75367a..92f8218 100755
--- a/tool/ytab.sed
+++ b/tool/ytab.sed
@@ -5,6 +5,26 @@ i\
a\
#endif
}
-s/^[ ]*\(yyerror[ ]*([ ]*parser,\)/parser_\1/
+/^yydestruct/,/#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"/