|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.sqltools.sql.parser.SQLParser
public abstract class SQLParser
Abstract SQL parser. Vendor developers should extend this parser to support their own dialect in content assist and syntax validation features. TODO: move scope to ParsingResult, which should keep track of scopes like Partitions
ParserParameters
,
ParsingResult
Field Summary | |
---|---|
static java.lang.String |
SPECIAL_TOKEN
All concrete parsers should include this special invalid token to enable the content assist feature |
Constructor Summary | |
---|---|
SQLParser()
|
Method Summary | |
---|---|
int |
getEndIndex(Token t)
Gets the end index of a Token for a String input |
int[] |
getRange(Token t)
Gets the start and end index of a Token for a String input |
int |
getStartIndex(Token t)
Gets the start index of a Token for a String input |
abstract java.lang.String[] |
getStatementStartTokens()
Returns the token strings that can be used to begin a SQL statement. |
abstract java.lang.String[] |
getStatementTerminators()
Returns the statement terminator array. |
boolean |
isComplete()
Returns whether the parser has captured the complete grammar for the database. |
ParsingResult |
parse(java.lang.String text)
Parses the given sql text using the default parameter. |
ParsingResult |
parse(java.lang.String text,
ParserParameters parameters)
Parses a sql text and try to construct the AST by ignoring all the parsing exceptions and moving to the start token of the next possible statement; |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SPECIAL_TOKEN
Constructor Detail |
---|
public SQLParser()
Method Detail |
---|
public ParsingResult parse(java.lang.String text)
ParseException
in the ParsingResult
.
text
- sql text to be parsed
ParsingResult
containing root AST node and ParseException
s.public ParsingResult parse(java.lang.String text, ParserParameters parameters)
text
- sql text to be parsedparameters
- parameter used by parser
ParsingResult
containing root AST node and ParseException
s.public abstract java.lang.String[] getStatementTerminators()
public abstract java.lang.String[] getStatementStartTokens()
public boolean isComplete()
public int getStartIndex(Token t)
public int getEndIndex(Token t)
public int[] getRange(Token t)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |