diff options
author | yui-knk <spiketeika@gmail.com> | 2024-03-22 08:17:51 +0900 |
---|---|---|
committer | Yuichiro Kaneko <spiketeika@gmail.com> | 2024-03-22 11:53:15 +0900 |
commit | c5045830b7ed3bf664633871ca21fcfe03a42aa7 (patch) | |
tree | c592834d65fe6c4e76459771d4ced00589540efe /tool/lrama/lib/lrama/output.rb | |
parent | b4d73e9f80aa5fe72c39f42a88727fed0abb261b (diff) |
Lrama v0.6.4
Diffstat (limited to 'tool/lrama/lib/lrama/output.rb')
-rw-r--r-- | tool/lrama/lib/lrama/output.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tool/lrama/lib/lrama/output.rb b/tool/lrama/lib/lrama/output.rb index 29bf1e69fb..642c8b4708 100644 --- a/tool/lrama/lib/lrama/output.rb +++ b/tool/lrama/lib/lrama/output.rb @@ -150,6 +150,25 @@ module Lrama str end + def symbol_actions_for_destructor + str = "" + + @grammar.symbols.each do |sym| + next unless sym.destructor + + str << <<-STR + case #{sym.enum_name}: /* #{sym.comment} */ +#line #{sym.destructor.lineno} "#{@grammar_file_path}" + {#{sym.destructor.translated_code(sym.tag)}} +#line [@oline@] [@ofile@] + break; + + STR + end + + str + end + # b4_user_initial_action def user_initial_action(comment = "") return "" unless @grammar.initial_action |