private HashMap<String,HashSet<String>> BuildGraph(){
        HashMap<String,HashSet<String>> g = new HashMap<String,HashSet<String>>();
        for(String str : m_nonterminals){
            g.put(str,new HashSet<String>());
        }
        for(Rule cur_rule : m_rules){
            if(m_nonterminals.contains(cur_rule.GetRightPart().get(0))){
                g.get(cur_rule.GetLeftPart()).add(cur_rule.GetRightPart().get(0));
            }
        }
        return g;
    }