def setup_parser(str, debug=false)
      set_string str, 0
      @memoizations = Hash.new { |h,k| h[k] = {} }
      @result = nil
      @failed_rule = nil
      @failing_rule_offset = -1

      setup_foreign_grammar
    end
def setup_parser(str, debug=false)
      set_string str, 0
      @memoizations = Hash.new { |h,k| h[k] = {} }
      @result = nil
      @failed_rule = nil
      @failing_rule_offset = -1

      setup_foreign_grammar
    end
Leave these markers in! They allow us to generate standalone
 code automatically!
 INITIALIZE START
 This is distinct from setup_parser so that a standalone parser
 can redefine #initialize and still have access to the proper
 parser setup code.
 INITIALIZE END
 STANDALONE START
 Prepares for parsing +str+.  If you define a custom initialize you must
 call this method before #parse