def validate_rules(lexer)
      if lexer.state_re.empty?
        complain("No rules of the form rule(name, pattern) are defined")
      end

      lexer.state_info.each do |state_name, state_type|
        if !lexer.state_re.key?(state_name.to_sym)
          complain("No rules defined for state '#{state_name}'")
        end
      end
    end
def validate_rules(lexer)
      if lexer.state_re.empty?
        complain("No rules of the form rule(name, pattern) are defined")
      end

      lexer.state_info.each do |state_name, state_type|
        if !lexer.state_re.key?(state_name.to_sym)
          complain("No rules defined for state '#{state_name}'")
        end
      end
    end
Validate rules

 @api private