# File lib/ruby_parser/bm_sexp_processor.rb, line 63
  def process(exp)
    return nil if exp.nil?

    result = nil

    type = exp.first
    raise "Type should be a Symbol, not: #{exp.first.inspect} in #{exp.inspect}" unless Symbol === type

    in_context type do
      # now do a pass with the real processor (or generic)
      meth = @processors[type]
      if meth then
        result = self.send(meth, exp)
      else
        result = self.process_default(exp)
      end
    end
    
    raise SexpTypeError, "Result must be a #{@expected}, was #{result.class}:#{result.inspect}" unless @expected === result
    
    result
  end