This file is indexed.

/usr/share/doc/rexical/examples/calc3.tab.rb is in rexical 1.0.5-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#
# DO NOT MODIFY!!!!
# This file is automatically generated by racc 1.4.4
# from racc grammer file "calc3.racc".
#

require 'racc/parser'


#
# generated by racc
#
require 'calc3.rex'


class Calculator3 < Racc::Parser

##### racc 1.4.4 generates ###

racc_reduce_table = [
 0, 0, :racc_error,
 1, 11, :_reduce_none,
 0, 11, :_reduce_2,
 3, 12, :_reduce_3,
 3, 12, :_reduce_4,
 3, 12, :_reduce_5,
 3, 12, :_reduce_6,
 3, 12, :_reduce_7,
 2, 12, :_reduce_8,
 1, 12, :_reduce_none ]

racc_reduce_n = 10

racc_shift_n = 19

racc_action_table = [
     7,     8,     9,    10,     6,    18,     3,     4,    11,     5,
     7,     8,     9,    10,     3,     4,    13,     5,     3,     4,
   nil,     5,     3,     4,   nil,     5,     3,     4,   nil,     5,
     3,     4,   nil,     5,     7,     8,     7,     8 ]

racc_action_check = [
    12,    12,    12,    12,     1,    12,    10,    10,     3,    10,
     2,     2,     2,     2,     0,     0,     6,     0,     4,     4,
   nil,     4,     9,     9,   nil,     9,     8,     8,   nil,     8,
     7,     7,   nil,     7,    17,    17,    16,    16 ]

racc_action_pointer = [
     8,     4,     7,    -1,    12,   nil,    16,    24,    20,    16,
     0,   nil,    -3,   nil,   nil,   nil,    33,    31,   nil ]

racc_action_default = [
    -2,   -10,    -1,   -10,   -10,    -9,   -10,   -10,   -10,   -10,
   -10,    -8,   -10,    19,    -5,    -6,    -3,    -4,    -7 ]

racc_goto_table = [
     2,     1,   nil,   nil,    12,   nil,   nil,    14,    15,    16,
    17 ]

racc_goto_check = [
     2,     1,   nil,   nil,     2,   nil,   nil,     2,     2,     2,
     2 ]

racc_goto_pointer = [
   nil,     1,     0 ]

racc_goto_default = [
   nil,   nil,   nil ]

racc_token_table = {
 false => 0,
 Object.new => 1,
 :UMINUS => 2,
 "*" => 3,
 "/" => 4,
 "+" => 5,
 "-" => 6,
 "(" => 7,
 ")" => 8,
 :NUMBER => 9 }

racc_use_result_var = false

racc_nt_base = 10

Racc_arg = [
 racc_action_table,
 racc_action_check,
 racc_action_default,
 racc_action_pointer,
 racc_goto_table,
 racc_goto_check,
 racc_goto_default,
 racc_goto_pointer,
 racc_nt_base,
 racc_reduce_table,
 racc_token_table,
 racc_shift_n,
 racc_reduce_n,
 racc_use_result_var ]

Racc_token_to_s_table = [
'$end',
'error',
'UMINUS',
'"*"',
'"/"',
'"+"',
'"-"',
'"("',
'")"',
'NUMBER',
'$start',
'target',
'exp']

Racc_debug_parser = false

##### racc system variables end #####

 # reduce 0 omitted

 # reduce 1 omitted

module_eval <<'.,.,', 'calc3.racc', 13
  def _reduce_2( val, _values)
 0
  end
.,.,

module_eval <<'.,.,', 'calc3.racc', 15
  def _reduce_3( val, _values)
 val[0] + val[2]
  end
.,.,

module_eval <<'.,.,', 'calc3.racc', 16
  def _reduce_4( val, _values)
 val[0] - val[2]
  end
.,.,

module_eval <<'.,.,', 'calc3.racc', 17
  def _reduce_5( val, _values)
 val[0] * val[2]
  end
.,.,

module_eval <<'.,.,', 'calc3.racc', 18
  def _reduce_6( val, _values)
 val[0] / val[2]
  end
.,.,

module_eval <<'.,.,', 'calc3.racc', 19
  def _reduce_7( val, _values)
 val[1]
  end
.,.,

module_eval <<'.,.,', 'calc3.racc', 20
  def _reduce_8( val, _values)
 -(val[1])
  end
.,.,

 # reduce 9 omitted

 def _reduce_none( val, _values)
  val[0]
 end

end   # class Calculator3


puts 'sample calc'
puts '"q" to quit.'
calc = Calculator3.new
while true
  print '>>> '; $stdout.flush
  str = $stdin.gets.strip
  break if /q/i === str
  begin
    p calc.scan_str(str)
  rescue ParseError
    puts 'parse error'
  end
end