}
protected boolean dealWithThrowableFromQueryParser(final Throwable e,
final EvaluationMode mode, final boolean queryOrRif) {
if (e instanceof TokenMgrError) {
final TokenMgrError tme = (TokenMgrError) e;
this.displayErrorMessage(tme.getMessage(), false, queryOrRif);
// create the pattern to match
// and create a matcher against the string
final Pattern pattern = Pattern
.compile("line (\\d+), column (\\d+)");
final Matcher matcher = pattern.matcher(tme.getMessage());
// try to find the pattern in the message...
if (matcher.find() == true) {
// get matches...
final int line = Integer.parseInt(matcher.group(1));
final int column = Integer.parseInt(matcher.group(2));
this.setErrorPosition(line, column, queryOrRif);
}
if (mode == EvaluationMode.DEMO) {
this.enableOrDisableButtons(queryOrRif);
}
return true;
} else if (e instanceof lupos.rif.generated.parser.TokenMgrError) {
final lupos.rif.generated.parser.TokenMgrError tme = (lupos.rif.generated.parser.TokenMgrError) e;
this.displayErrorMessage(tme.getMessage(), false, queryOrRif);
// create the pattern to match
// and create a matcher against the string
final Pattern pattern = Pattern
.compile("line (\\d+), column (\\d+)");
final Matcher matcher = pattern.matcher(tme.getMessage());
// try to find the pattern in the message...
if (matcher.find() == true) {
// get matches...
final int line = Integer.parseInt(matcher.group(1));