class Racc::GrammarFileParser

def add_rule_block(list)

def add_rule_block(list)
  target = list.shift
  case target
  when OrMark, OptionMark, ManyMark, Many1Mark, GroupStartMark, GroupEndMark, UserAction, Prec
    raise CompileError, "#{target.lineno}: unexpected symbol #{target.name}"
  end
  enum = list.each.with_index
  _, sym, idx = _add_rule_block(target, enum)
  if idx
    # sym is Racc::GroupEndMark
    raise "#{sym.lineno}: unexpected symbol ')' at pos=#{idx}"
  end
end