@Override public void visitErrorNode(ErrorNode node) { this.schemaChanges.clear(); String error = node.getParent().toStringTree(new mysqlParser(null)); LOGGER.error(error); throw new MaxwellSQLSyntaxError(node.getText()); }
if (arg0.getText().equals("new")) { CompilationUnitContext cuc = (CompilationUnitContext) arg0.getParent(); List<ParseTree> children = cuc.children; AutocompleteCandidate c = new AutocompleteCandidate(JavaCompletionTypes.INITIAL, arg0.getText()); addQuery(c, cursor); AutocompleteCandidate c2 = new AutocompleteCandidate(JavaCompletionTypes.TOPLEVEL, arg0.getText()); addQuery(c2, cursor); completeClassFromPath(cuc, arg0.getText()); return; } else if (arg0.getParent() instanceof BlockStatementContext) { if (!arg0.getSymbol().getText().equals(".")) { AutocompleteCandidate c = new AutocompleteCandidate(JavaCompletionTypes.BLOCKLEVEL, arg0.getText()); addQuery(c, cursor); c = new AutocompleteCandidate(JavaCompletionTypes.TYPE, arg0.getText()); addQuery(c, cursor); c = new AutocompleteCandidate(JavaCompletionTypes.CUSTOM_TYPE, arg0.getText()); addQuery(c, cursor); c = new AutocompleteCandidate(JavaCompletionTypes.NAME, arg0.getText()); addQuery(c, cursor); } else { arg0.getParent().getParent() != null && arg0.getParent().getParent() instanceof CompilationUnitContext) { AutocompleteCandidate c = new AutocompleteCandidate(JavaCompletionTypes.TOPLEVEL, arg0.getText()); addQuery(c, cursor); } else if (arg0.getParent() instanceof MemberDeclarationContext && arg0.getParent().getParent().getParent() instanceof ClassBodyContext &&
@Override public Expression visitErrorNode(ErrorNode node) { throw new SyntaxErrorException("Parsing failed: " + node.getText()); }
@Override public void visitErrorNode(final ErrorNode n){ tab(); System.err.print("E "); System.err.println(n.getText()); }
@Override public void visitErrorNode(ErrorNode node) { LOGGER.error(indent(node.getText())); }
@Override public Expression visitErrorNode(ErrorNode node) { throw new SyntaxErrorException("Parsing failed: " + node.getText()); }
@Override public void visitErrorNode(ErrorNode node) { log.error(indent(node.getText())); }
@Override public void visitErrorNode(ErrorNode node) { LOG.error(indent(node.getText())); }
@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 CypherAstBase visitErrorNode(ErrorNode node) { throw new VertexiumException(String.format( "Could not parse: invalid value \"%s\" (line: %d, pos: %d)", node.getText(), node.getSymbol().getLine(), node.getSymbol().getCharPositionInLine() )); } }
@Override public CypherAstBase visitErrorNode(ErrorNode node) { throw new VertexiumException(String.format( "Could not parse: invalid value \"%s\" (line: %d, pos: %d)", node.getText(), node.getSymbol().getLine(), node.getSymbol().getCharPositionInLine() )); } }
/** * Constructor. * * @param node the error node. */ private CQLSyntaxError(ErrorNode node) { this.text = node.getText(); int offset = 0; ParseTree n = node; while (n != null) { offset += n.getSourceInterval().a; n = n.getParent(); } this.interval = new Interval(offset + node.getSourceInterval().a, offset + node.getSourceInterval().b); } }
/** * Constructor. * * @param node the error node. */ private CQLSyntaxError(ErrorNode node) { this.text = node.getText(); int offset = 0; ParseTree n = node; while (n != null) { offset += n.getSourceInterval().a; n = n.getParent(); } this.interval = new Interval(offset + node.getSourceInterval().a, offset + node.getSourceInterval().b); } }
@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 + "'"); } }