summaryrefslogtreecommitdiff
path: root/tool/ytab.sed
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-13 14:46:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-13 14:46:09 +0000
commit0f076affb670bf24ae837ae71544cfc7e6cb45d0 (patch)
treea0ea4e599e4a60ca0d6a788f28113f9f6a69e682 /tool/ytab.sed
parentada76728f6e672a8b7366bf1f444387945af993b (diff)
parse.y: lex_state trace by yydebug
* parse.y (trace_lex_state): trace lex_state changes if yydebug is set, and send the messages to rb_stdout. * parse.y (rb_parser_printf): store YYPRINTF messages per lines so that lex_state traces do not mix. * tool/ytab.sed: add parser argument to yy_stack_print too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ytab.sed')
-rwxr-xr-xtool/ytab.sed20
1 files changed, 18 insertions, 2 deletions
diff --git a/tool/ytab.sed b/tool/ytab.sed
index 46317db..d8fb700 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"/