SqlParserPos getPos() throws ParseException { return new SqlParserPos( token.beginLine, token.beginColumn, token.endLine, token.endColumn); }
SqlParserPos getPos() throws ParseException { return new SqlParserPos( token.beginLine, token.beginColumn, token.endLine, token.endColumn); }
public List<SqlMoniker> getCompletionHints0(String sql, int cursor) { String simpleSql = simplifySql(sql, cursor); int idx = simpleSql.indexOf(hintToken); if (idx < 0) { return Collections.emptyList(); } SqlParserPos pos = new SqlParserPos(1, idx + 1); return getCompletionHints(simpleSql, pos); }
public List<SqlMoniker> getCompletionHints0(String sql, int cursor) { String simpleSql = simplifySql(sql, cursor); int idx = simpleSql.indexOf(hintToken); if (idx < 0) { return Collections.emptyList(); } SqlParserPos pos = new SqlParserPos(1, idx + 1); return getCompletionHints(simpleSql, pos); }
if (pex.currentToken != null) { final Token token = pex.currentToken.next; pos = new SqlParserPos( token.beginLine, token.beginColumn, int line = Integer.parseInt(matcher.group(1)); int column = Integer.parseInt(matcher.group(2)); pos = new SqlParserPos(line, column, line, column); pos = new SqlParserPos( ece.getPosLine(), ece.getPosColumn(),
if (pex.currentToken != null) { final Token token = pex.currentToken.next; pos = new SqlParserPos( token.beginLine, token.beginColumn, int line = Integer.parseInt(matcher.group(1)); int column = Integer.parseInt(matcher.group(2)); pos = new SqlParserPos(line, column, line, column); pos = new SqlParserPos( ece.getPosLine(), ece.getPosColumn(),
+ sql.substring(firstCaret + 1); int[] start = indexToLineCol(sql, firstCaret); SqlParserPos pos = new SqlParserPos(start[0], start[1]); return new StringAndPos(sqlSansCaret, firstCaret, pos); } else { new SqlParserPos(start[0], start[1], end[0], end[1]); return new StringAndPos(sqlSansCaret, firstCaret, pos);
+ sql.substring(firstCaret + 1); int [] start = indexToLineCol(sql, firstCaret); SqlParserPos pos = new SqlParserPos(start[0], start[1]); return new StringAndPos(sqlSansCaret, firstCaret, pos); } else { new SqlParserPos(start[0], start[1], end[0], end[1]); return new StringAndPos(sqlSansCaret, firstCaret, pos);
/** * Combines this parser position with another to create a position which * spans from the first point in the first to the last point in the other. */ public SqlParserPos plus(SqlParserPos pos) { return new SqlParserPos( getLineNum(), getColumnNum(), pos.getEndLineNum(), pos.getEndColumnNum()); }
/** * Combines this parser position with another to create a position which * spans from the first point in the first to the last point in the other. */ public SqlParserPos plus(SqlParserPos pos) { return new SqlParserPos( getLineNum(), getColumnNum(), pos.getEndLineNum(), pos.getEndColumnNum()); }
/** * Gets the fully qualified name for a {@link SqlIdentifier} at a given * position of a sql statement. * * @param sql A syntactically correct sql statement for which to retrieve a * fully qualified SQL identifier name * @param cursor to indicate the 0-based cursor position in the query that * represents a SQL identifier for which its fully qualified * name is to be returned. * @return a {@link SqlMoniker} that contains the fully qualified name of * the specified SQL identifier, returns null if none is found or the SQL * statement is invalid. */ public SqlMoniker getQualifiedName(String sql, int cursor) { SqlNode sqlNode; try { sqlNode = parseQuery(sql); validator.validate(sqlNode); } catch (Exception e) { return null; } SqlParserPos pos = new SqlParserPos(1, cursor + 1); try { return validator.lookupQualifiedName(sqlNode, pos); } catch (EigenbaseContextException e) { return null; } catch (java.lang.AssertionError e) { return null; } }
return null; SqlParserPos pos = new SqlParserPos(1, cursor + 1); try { return validator.lookupQualifiedName(sqlNode, pos);
return new SqlParserPos(line, column, endLine, endColumn);
public static final SqlParserPos ZERO = new SqlParserPos(0, 0); return new SqlParserPos(line, column, endLine, endColumn); return new SqlParserPos(line, column, endLine, endColumn);
final int line = lastPos.getEndLineNum(); final int col = lastPos.getEndColumnNum() + 1; SqlParserPos errPos = new SqlParserPos(line, col, line, col); throw SqlUtil.newContextException(errPos, RESOURCE.betweenWithoutAnd());
return new SqlParserPos(line, column, endLine, endColumn);
final int line = lastPos.getEndLineNum(); final int col = lastPos.getEndColumnNum() + 1; SqlParserPos errPos = new SqlParserPos(line, col, line, col); throw SqlUtil.newContextException( errPos,