* @param fqClassName The full qualified class name.
* @throws CouldNotWriteJavaFile If the java file could not be written for any reason
* @throws GrammarIsInvalid The grammar in the reader was logically invalid for any reason.
*/
public static void createCompiler(File dir,Reader r,String fqClassName) throws CouldNotWriteJavaFile, GrammarIsInvalid {
Pgen parsedg;
try {
parsedg = PGENParser.parsePGEN(r);
} catch (SyntaxError e1) {
throw new GrammarIsInvalid(e1) ;
}
Grammar theGrammar ;
try {
theGrammar = parsedg.getGrammar() ;
} catch (InvalidStartRule e) {
throw new GrammarIsInvalid(e) ;
} catch (StrandedSymbol e) {
throw new GrammarIsInvalid(e) ;
}