1off = true
2ARGF.each do |line|
3  case line
4  when /RIPPER_PARAMS_DECL_BEGIN/
5    off = false
6  when /RIPPER_PARAMS_DECL_END/
7    exit
8  when /ripper/
9    next if off
10    var = line.scan(/\w+/).last or next
11    base = var.sub(/ripper_/, '')
12    puts %"\#define #{base}\t\t(parser->ripper_#{base})"
13  end
14end
15