CompilationUnitContext cuc = (CompilationUnitContext) arg0.getParent(); List<ParseTree> children = cuc.children; int tokenIndex = arg0.getSymbol().getTokenIndex(); if (tokenIndex - 2 >= 0 && tokenIndex + 1 <= children.size()) { ParseTree variablePT = children.get(tokenIndex - 2); if (arg0.getSymbol().getStartIndex() < cursor && arg0.getSymbol().getStopIndex() + 1 >= cursor) { return; } else if (arg0.getParent() instanceof BlockStatementContext) { if (!arg0.getSymbol().getText().equals(".")) { AutocompleteCandidate c = new AutocompleteCandidate(JavaCompletionTypes.BLOCKLEVEL, arg0.getText()); addQuery(c, cursor);
@Override public void visitErrorNode(ErrorNode node) { if (_firstErrorLine == 0) { _firstErrorLine = node.getSymbol().getLine(); } _numErrorNodes++; } }
@Override public void visitErrorNode(ErrorNode errorNode) { Token token = errorNode.getSymbol(); int line = token.getLine(); String lineText = errorNode.getText().replace("\n", "").replace("\r", "").trim(); _configuration.setUnrecognized(true); if (token instanceof UnrecognizedLineToken) { UnrecognizedLineToken unrecToken = (UnrecognizedLineToken) token; _w.getParseWarnings() .add( new ParseWarning( line, lineText, unrecToken.getParserContext(), "This syntax is unrecognized")); } else { String msg = String.format("Unrecognized Line: %d: %s", line, lineText); _w.redFlag(msg + " SUBSEQUENT LINES MAY NOT BE PROCESSED CORRECTLY"); } } }
@Override public void visitErrorNode(ErrorNode errorNode) { Token token = errorNode.getSymbol(); String lineText = errorNode.getText().replace("\n", "").replace("\r", "").trim(); int line = getLine(token); _configuration.setUnrecognized(true); if (token instanceof UnrecognizedLineToken) { UnrecognizedLineToken unrecToken = (UnrecognizedLineToken) token; _w.getParseWarnings() .add( new ParseWarning( line, lineText, unrecToken.getParserContext(), "This syntax is unrecognized")); } else { String msg = String.format("Unrecognized Line: %d: %s", line, lineText); _w.redFlag(msg + " SUBSEQUENT LINES MAY NOT BE PROCESSED CORRECTLY"); } } }
@Override public void visitErrorNode(ErrorNode errorNode) { Token token = errorNode.getSymbol(); String lineText = errorNode.getText().replace("\n", "").replace("\r", "").trim(); int line = getLine(token); _configuration.setUnrecognized(true); if (token instanceof UnrecognizedLineToken) { UnrecognizedLineToken unrecToken = (UnrecognizedLineToken) token; _w.getParseWarnings() .add( new ParseWarning( line, lineText, unrecToken.getParserContext(), "This syntax is unrecognized")); } else { String msg = String.format("Unrecognized Line: %d: %s", line, lineText); _w.redFlag(msg + " SUBSEQUENT LINES MAY NOT BE PROCESSED CORRECTLY"); } } }
@Override public void visitErrorNode(ErrorNode ctx) { String nodeText = BatfishCombinedParser.escape(ctx.getText()); // _sb.append("\n"); _ptSentences.getSentences().add(""); for (int i = 0; i < _indent; i++) { _ptSentences.appendToLastSentence(" "); } int tokenType = ctx.getSymbol().getType(); String tokenName; if (tokenType == Lexer.EOF) { tokenName = "EOF"; _ptSentences.appendToLastSentence(tokenName + ":" + nodeText); } else if (tokenType == BatfishLexer.UNRECOGNIZED_LINE_TOKEN) { _ptSentences.appendToLastSentence("<UnrecognizedLine>:'" + nodeText + "'"); } else { tokenName = _vocabulary.getSymbolicName(tokenType); _ptSentences.appendToLastSentence("<ErrorNode>:" + tokenName + ":'" + nodeText + "'"); } }
ProgressIndicatorProvider.checkCanceled(); Token badToken = node.getSymbol(); boolean isConjuredToken = badToken.getTokenIndex()<0; int nodeStartIndex = badToken.getStartIndex();