|
| 1 | +# |
| 2 | +# DO NOT MODIFY!!!! |
| 3 | +# This file is automatically generated by Racc 1.8.0 |
| 4 | +# from Racc grammar file "many.y". |
| 5 | +# |
| 6 | + |
| 7 | +require 'racc/parser.rb' |
| 8 | + |
| 9 | +require 'strscan' |
| 10 | +class MyParser < Racc::Parser |
| 11 | + |
| 12 | +module_eval(<<'...end many.y/module_eval...', 'many.y', 8) |
| 13 | +def parse(str) |
| 14 | + @ss = StringScanner.new(str) |
| 15 | + do_parse |
| 16 | +end |
| 17 | +def next_token |
| 18 | + @ss.skip(/\\s+/) |
| 19 | + token = @ss.scan(/\\S+/) and [token, token] |
| 20 | +end |
| 21 | +...end many.y/module_eval... |
| 22 | +##### State transition tables begin ### |
| 23 | + |
| 24 | +racc_action_table = [ |
| 25 | + 2, 4, 2, 6 ] |
| 26 | + |
| 27 | +racc_action_check = [ |
| 28 | + 0, 1, 2, 4 ] |
| 29 | + |
| 30 | +racc_action_pointer = [ |
| 31 | + -2, 1, 0, nil, 3, nil, nil ] |
| 32 | + |
| 33 | +racc_action_default = [ |
| 34 | + -1, -4, -1, -3, -4, -2, 7 ] |
| 35 | + |
| 36 | +racc_goto_table = [ |
| 37 | + 3, 1, 5 ] |
| 38 | + |
| 39 | +racc_goto_check = [ |
| 40 | + 2, 1, 2 ] |
| 41 | + |
| 42 | +racc_goto_pointer = [ |
| 43 | + nil, 1, 0 ] |
| 44 | + |
| 45 | +racc_goto_default = [ |
| 46 | + nil, nil, nil ] |
| 47 | + |
| 48 | +racc_reduce_table = [ |
| 49 | + 0, 0, :racc_error, |
| 50 | + 0, 5, :_reduce_1, |
| 51 | + 2, 5, :_reduce_2, |
| 52 | + 1, 4, :_reduce_none ] |
| 53 | + |
| 54 | +racc_reduce_n = 4 |
| 55 | + |
| 56 | +racc_shift_n = 7 |
| 57 | + |
| 58 | +racc_token_table = { |
| 59 | + false => 0, |
| 60 | + :error => 1, |
| 61 | + "abc" => 2 } |
| 62 | + |
| 63 | +racc_nt_base = 3 |
| 64 | + |
| 65 | +racc_use_result_var = true |
| 66 | + |
| 67 | +Racc_arg = [ |
| 68 | + racc_action_table, |
| 69 | + racc_action_check, |
| 70 | + racc_action_default, |
| 71 | + racc_action_pointer, |
| 72 | + racc_goto_table, |
| 73 | + racc_goto_check, |
| 74 | + racc_goto_default, |
| 75 | + racc_goto_pointer, |
| 76 | + racc_nt_base, |
| 77 | + racc_reduce_table, |
| 78 | + racc_token_table, |
| 79 | + racc_shift_n, |
| 80 | + racc_reduce_n, |
| 81 | + racc_use_result_var ] |
| 82 | +Ractor.make_shareable(Racc_arg) if defined?(Ractor) |
| 83 | + |
| 84 | +Racc_token_to_s_table = [ |
| 85 | + "$end", |
| 86 | + "error", |
| 87 | + "\"abc\"", |
| 88 | + "$start", |
| 89 | + "stmt", |
| 90 | + "\"-many@abc\"" ] |
| 91 | +Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor) |
| 92 | + |
| 93 | +Racc_debug_parser = false |
| 94 | + |
| 95 | +##### State transition tables end ##### |
| 96 | + |
| 97 | +# reduce 0 omitted |
| 98 | + |
| 99 | +module_eval(<<'.,.,', 'many.y', 4) |
| 100 | + def _reduce_1(val, _values, result) |
| 101 | + result = val[1] ? val[1].unshift(val[0]) : val |
| 102 | + result |
| 103 | + end |
| 104 | +.,., |
| 105 | + |
| 106 | +module_eval(<<'.,.,', 'many.y', 4) |
| 107 | + def _reduce_2(val, _values, result) |
| 108 | + result = val[1] ? val[1].unshift(val[0]) : val |
| 109 | + result |
| 110 | + end |
| 111 | +.,., |
| 112 | + |
| 113 | +# reduce 3 omitted |
| 114 | + |
| 115 | +def _reduce_none(val, _values, result) |
| 116 | + val[0] |
| 117 | +end |
| 118 | + |
| 119 | +end # class MyParser |
0 commit comments