public static void readRegularGrammarFromFile(Set<String> nonTerminals,Set<String> terminals,List productions,StringBuilder startSymbol) {
        try {
            FileInputStream fstream = new FileInputStream("C:\\Users\\fgheorghe\\Dropbox\\Compilatoare\\src\\Files\\2.regularGrammar.txt");

            DataInputStream in;
            in = new DataInputStream(fstream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            String strLine;
            strLine = br.readLine();
            Integer n = 0;
            try {
                n = Integer.parseInt(strLine);
            } catch (Exception e) {
                System.out.println("Not a number!");
            }
            strLine = br.readLine();
            String temp[] = strLine.split(" ");
            for (int i = 0; i < n; i++) {

                nonTerminals.add(temp[i]);
            }
            strLine = br.readLine();
            Integer n2 = 0;
            try {
                n2 = Integer.parseInt(strLine);
            } catch (Exception e) {
                System.out.println("Not a number!");
            }
            strLine = br.readLine();
            String temp2[] = strLine.split(" ");
            for (int i = 0; i < n2; i++) {
                terminals.add(temp2[i]);
            }
            strLine = br.readLine();
            Integer n3 = 0;
            try {
                n3 = Integer.parseInt(strLine);
            } catch (Exception e) {
                System.out.println("Not a number!");
            }

            for (int i = 0; i < n3; i++) {
                strLine = br.readLine();
                String temp3[] = strLine.split(" ");
                Production production = new Production(temp3[0], temp3[1]);
                productions.add(production);
            }
            strLine = br.readLine();
            startSymbol.append(strLine);

            in.close();
        } catch (Exception e) {
            System.err.println("Error: " + e.getMessage());
        }
    }