class Racc::States

def core_to_state(core)

def core_to_state(core)
  #
  # convert CORE to a State object.
  # If matching state does not exist, create it and add to the table.
  #
  k = fingerprint(core)
  unless dest = @statecache[k]
    # not registered yet
    dest = State.new(@states.size, core)
    @states.push dest
    @statecache[k] = dest
    puts "core_to_state: create state   ID #{dest.ident}" if @d_state
  else
    if @d_state
      puts "core_to_state: dest is cached ID #{dest.ident}"
      puts "core_to_state: dest core #{dest.core.join(' ')}"
    end
  end
  dest
end