Update GrammarSolver.java

Changed a javadoc comment to use the @throws tag.