private char throwParsingException() { throw new ParserRuntimeException("Parser read more than 100K chars beyond EOI, " + "verify that your grammar does not consume EOI indefinitely!"); }
public boolean runMatcher() { try { if (matchHandler.match(this)) { if (parent != null) { parent.currentIndex = currentIndex; parent.currentChar = currentChar; } matcher = null; // "retire" this context return true; } matcher = null; // "retire" this context until is "activated" again by a getSubContext(...) on the parent return false; } catch (ParserRuntimeException e) { throw e; // don't wrap, just bubble up } catch (RecoveringParseRunner.TimeoutException e) { throw e; // don't wrap, just bubble up } catch (Throwable e) { throw new ParserRuntimeException(e, printParseError(new BasicParseError(inputBuffer, currentIndex, StringUtils.escape(String.format("Error while parsing %s '%s' at input position", matcher instanceof ActionMatcher ? "action" : "rule", getPath())))) + '\n' + e); } } }
@Override public boolean run(Context ctx) { String expression = match(); expression = expandEnvironmentVariables(expression); try { Filter f = ECQL.toFilter(expression); ctx.getValueStack().push(new Data(f)); return true; } catch (CQLException e) { throw new ParserRuntimeException( reportPosition(ctx) + ". " + e.getMessage(), e); } } });
@Override public boolean run(Context ctx) { String expression = match(); expression = expandEnvironmentVariables(expression); try { org.opengis.filter.expression.Expression e = ECQL.toExpression(expression); ctx.getValueStack().push(new Value.Expression(e)); return true; } catch (CQLException e) { throw new ParserRuntimeException( reportPosition(ctx) + ". " + e.getMessage(), e); } } });