def warn_for_unused_rules(compiled_grammar)
      compiled_grammar.rules.each_with_index do |rule, index|
        next if index == 0 || rule.references > 0

        compiled_grammar.add_warning(
          "Unused rule #{rule.name.inspect}",
          rule.source_line
        )
      end
    end
def warn_for_unused_rules(compiled_grammar)
      compiled_grammar.rules.each_with_index do |rule, index|
        next if index == 0 || rule.references > 0

        compiled_grammar.add_warning(
          "Unused rule #{rule.name.inspect}",
          rule.source_line
        )
      end
    end
Adds warnings for any unused rules. The first defined rule is skipped
 since it's the root rule.

 @param [LL::CompiledGrammar] compiled_grammar