class Racc::Grammar

def _compute_expand(t, set, lock)

def _compute_expand(t, set, lock)
  if tmp = t.expand
    set.update tmp
    return set
  end
  tok = nil
  set.update_a t.heads
  t.heads.each do |ptr|
    tok = ptr.dereference
    if tok and tok.nonterminal?
      unless lock[tok.ident]
        lock[tok.ident] = true
        _compute_expand tok, set, lock
      end
    end
  end
  set
end