"[S [NP John] [VP [V hits] [NP Mary]]]" のような文字列を
["S", ["NP", "John"], ["VP", ["V", "hits"], ["NP", "Mary"]]]
のような配列に変換したいのですが、エレガントな方法はあるでしょうか?

def parse(text)
 return eval(text.split(
  /([ \[\]])/s
 ).delete_if { |x|
  /^ *$/ =~ x
 }.collect { |x|
  (x == '[' or x == ']') ? x : "'#{x}'"
 }.join(',').gsub(/\[,/, '[').gsub(/,\]/, ']'))
end

とりあえず、こんな感じでやってみたんですが、なんかきもいような気がするので・・・