public void startInitialPhase() {
        int indexOfSet = 0;
        Set<Production> firstSet = new HashSet<Production>();
        Vector<String> res = new Vector<String>();
        State state = new State();

        res.add(grammar.getStartingSymbol());
        Production production = new Production("Y", res, 0,0);
        firstSet.add(production);

        firstSet = closure(firstSet);
        state.setSetProductions(firstSet);
        state.setNumberOfState(indexOfSet++);
        makeActionForState(state);
        states.add(state);

        Vertex vertex = new Vertex(state.getNumberOfState());
        LRTable.addVertex(vertex);

        Queue<State> stateQueue = new LinkedList<State>();
        stateQueue.add(state);

        while (!stateQueue.isEmpty()) {
            State currentState = stateQueue.poll();
            for (String symbol: grammar.getAllSymbols()) {
                State newState = goTo(currentState,symbol);
                makeActionForState(newState);
                if (newState != null && !newState.getSetProductions().isEmpty() && !states.contains(newState)) {
                    stateQueue.add(newState);
                    newState.setNumberOfState(indexOfSet++);
                    states.add(newState);
                    this.addStateToTable(newState,currentState,symbol);

                } else {
                    if (newState!=null && !newState.getSetProductions().isEmpty()) {
                        State newState2 = this.getStateAtIndex(newState);
                        this.addStateToTableOldVertex(newState2, currentState, symbol);
                    }
                }
            }
        }
    }