org.eigenbase.sql.advise
Class SqlSimpleParser
java.lang.Object
org.eigenbase.sql.advise.SqlSimpleParser
public class SqlSimpleParser
- extends Object
A simple parser that takes an incomplete and turn it into a syntactically
correct statement. It is used in the SQL editor user-interface.
- Since:
- Oct 31, 2007
- Version:
- $Id: //open/dev/farrago/src/org/eigenbase/sql/advise/SqlSimpleParser.java#6 $
- Author:
- jhyde
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
hintToken
private final String hintToken
SqlSimpleParser
public SqlSimpleParser(String hintToken)
- Creates a SqlSimpleParser
- Parameters:
hintToken
- Hint token
simplifySql
public String simplifySql(String sql,
int cursor)
- Turns a partially completed or syntactically incorrect sql statement into
a simplified, valid one that can be passed into getCompletionHints().
- Parameters:
sql
- A partial or syntatically incorrect sql statementcursor
- to indicate column position in the query at which
completion hints need to be retrieved.
- Returns:
- a completed, valid (and possibly simplified SQL statement
simplifySql
public String simplifySql(String sql)
- Turns a partially completed or syntatically incorrect sql statement into
a simplified, valid one that can be validated
- Parameters:
sql
- A partial or syntatically incorrect sql statement
- Returns:
- a completed, valid (and possibly simplified) SQL statement
consumeQuery
private void consumeQuery(ListIterator<SqlSimpleParser.Token> iter,
List<SqlSimpleParser.Token> outList)
consumeSelect
private void consumeSelect(ListIterator<SqlSimpleParser.Token> iter,
List<SqlSimpleParser.Token> outList)