class IRB::SLex::Node

def create_subnode(chrs, preproc = nil, postproc = nil)

def create_subnode(chrs, preproc = nil, postproc = nil)
  if chrs.empty?
    if @postproc
      D_DETAIL.pp node
      raise "node already exists"
    else
      D_DEBUG.puts "change abstract node to real node."
      @preproc = preproc
      @postproc = postproc
    end
    return self
  end
  ch = chrs.shift
  if node = @Tree[ch]
    if chrs.empty?
      if node.postproc
        DebugLogger.pp node
        DebugLogger.pp self
        DebugLogger.pp ch
        DebugLogger.pp chrs
        raise "node already exists"
      else
        D_WARN.puts "change abstract node to real node"
        node.preproc = preproc
        node.postproc = postproc
      end
    else
      node.create_subnode(chrs, preproc, postproc)
    end
  else
    if chrs.empty?
      node = Node.new(preproc, postproc)
    else
      node = Node.new
      node.create_subnode(chrs, preproc, postproc)
    end
    @Tree[ch] = node
  end
  node
end