public Class<IGTD<IConstructor, IConstructor, ISourceLocation>> getParser(IRascalMonitor monitor, URI loc, String name, IMap definition) {
monitor.startJob("Generating parser:" + name, 100, 90);
try {
monitor.event("Importing and normalizing grammar:" + name, 30);
IConstructor grammar = getGrammar(monitor, name, definition);
debugOutput(grammar.toString(), System.getProperty("java.io.tmpdir") + "/grammar.trm");
String normName = name.replaceAll("::", "_");
monitor.event("Generating java source code for parser: " + name,30);
IString classString = (IString) evaluator.call(monitor, "generateObjectParser", vf.string(packageName), vf.string(normName), grammar);
debugOutput(classString.getValue(), System.getProperty("java.io.tmpdir") + "/parser.java");
monitor.event("Compiling generated java code: " + name, 30);