Examples of ParseCancellationException


Examples of org.antlr.v4.runtime.misc.ParseCancellationException

    public void recover(Parser recognizer, RecognitionException e) {
    for (ParserRuleContext context = recognizer.getContext(); context != null; context = context.getParent()) {
      context.exception = e;
    }

        throw new ParseCancellationException(e);
    }
View Full Code Here

Examples of org.antlr.v4.runtime.misc.ParseCancellationException

    InputMismatchException e = new InputMismatchException(recognizer);
    for (ParserRuleContext context = recognizer.getContext(); context != null; context = context.getParent()) {
      context.exception = e;
    }

        throw new ParseCancellationException(e);
    }
View Full Code Here

Examples of org.antlr.v4.runtime.misc.ParseCancellationException

        return new BailErrorStrategy() { /* bail out at the first parse error */
            private void bail(Parser recognizer, Exception exc) {
                List<String> stack = recognizer.getRuleInvocationStack();
                Collections.reverse(stack);
                // TODO use recognizer.getRuleContext().toInfoString(recognizer); as the diagnostic ?
                throw new ParseCancellationException((exc.getMessage() != null ? exc.getMessage() + "; " : "") + (exc.getCause().getMessage() != null ? exc.getCause().getMessage() + "; " : "") + "in " + stack, exc.getCause());
            }

            @Override public void recover(Parser recognizer, RecognitionException e) {
                try {
                    super.recover(recognizer, e);    // TODO remove this call?
View Full Code Here

Examples of org.antlr.v4.runtime.misc.ParseCancellationException

                }

                sb.append(additionalHint);
                underlineError(sb, recognizer, offendingToken);

                throw new ParseCancellationException(
                        sb.toString(),
                        exc.getCause()
                    );
            }
View Full Code Here

Examples of org.antlr.v4.runtime.misc.ParseCancellationException

  public void exitFunction(final FunctionContext ctx) {
    final Token start = ctx.getStart();
    final String[] split = start.getText().split("\\(");
    final String functionName = split[0];
    if (!FunctionFactory.containsFunction(functionName)) {
      throw new ParseCancellationException(String.format("%s is not a valid function", functionName));
    }
  }
View Full Code Here

Examples of org.antlr.v4.runtime.misc.ParseCancellationException

            final int lineNumber = mOffset + aLine;
            final Token token = (Token) aOffendingSymbol;

            if (JAVADOC_MISSED_HTML_CLOSE.equals(aMsg)) {
                log(lineNumber, JAVADOC_MISSED_HTML_CLOSE, token.getText());
                throw new ParseCancellationException();
            }
            else if (JAVADOC_WRONG_SINGLETON_TAG.equals(aMsg)) {
                log(lineNumber, JAVADOC_WRONG_SINGLETON_TAG, token.getText());
                throw new ParseCancellationException();
            }
            else {
                final RuleContext ruleContext = aEx.getCtx();
                if (ruleContext != null) {
                    final int ruleIndex = aEx.getCtx().getRuleIndex();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.