Slide 42
Slide 42 text
S-expressions
s(:class, :User, nil, s(:scope, s(:block, s(:call,
nil, :attr_accessor, s(:arglist, s(:lit, :name))), s
(:defn, :initialize, s(:args, :name), s(:scope, s
(:block, s(:lasgn, :name, s(:lvar, :name))))), s
(:defn, :say, s(:args), s(:scope, s(:block, s
(:call, nil, :puts, s(:arglist, s(:str,
"hello")))))))))
So ruby_parser gem provides necessary functionality. It converts ruby code into sexp format
which could be analized.