}
public void run() {
window.getConsoleTab().setMode(Console.MODE_VERBOSE);
delegate.checkGrammarDidBegin(this);
GrammarResult result;
try {
result = window.getGrammarEngine().analyze();
} catch (Exception e) {
window.getConsoleTab().println(e);
// Result cannot be null, so report the exception
result = new GrammarResult(e);
}
if(!cancelled) {
delegate.checkGrammarDidEnd(this, result);
}
}