Update GrammarSolver.java

I edited the constructor to work properly, am working on the other two auxiliary methods