public static boolean isRegularGrammar(List<Production> productions, Set<String> nonTerminals, Set<String> terminals) {
        for (int i = 0; i < productions.size(); i++) {
            Production p = productions.get(i);
            if (nonTerminals.contains(p.getNonTerminal())) {
                String temp[] = p.getResult().split("");
                if (temp.length == 2 && temp[1].equals("")) {

                } else if (temp.length == 2 && terminals.contains(temp[1])) {

                } else if (firstVerify(p.getResult(), nonTerminals, terminals) == true || secondVerify(p.getResult(), nonTerminals, terminals)) {

                } else {
                    return false;
                }

            } else {
                return false;
            }
        }
        return true;
    }