| java.lang.Object workbench.sql.formatter.SQLLexer
SQLLexer | public class SQLLexer (Code) | | SQLLexer is a SQL language lexer. Created with JFlex. An example of how it is used:
SQLLexer shredder = new SQLLexer(System.in);
SQLToken t;
while ((t = shredder.getNextToken()) != null){
System.out.println(t);
}
See Also: SQLToken |
Field Summary | |
final public static int | COMMENT | final public static int | YYEOF | final public static int | YYINITIAL |
Method Summary | |
public SQLToken | getNextToken(boolean returnComments, boolean returnWhiteSpace) next Token method that allows you to control if whitespace and comments are
returned as tokens. | public SQLToken | getNextToken() Resumes scanning until the next regular expression is matched,
the end of input is encountered or an I/O-Error occurs. | public void | reset(java.io.Reader reader, int yyline, int yychar, int yycolumn) Closes the current input stream, and resets the scanner to read from a new input stream. | final public void | yybegin(int newState) | final public char | yycharat(int pos) Returns the character at position pos from the
matched text. | final public void | yyclose() Closes the input stream. | final public int | yylength() Returns the length of the matched text region. | public void | yypushback(int number) Pushes the specified amount of characters back into the input stream. | final public void | yyreset(java.io.Reader reader) Resets the scanner to read from a new input stream. | final public int | yystate() Returns the current lexical state. | final public String | yytext() Returns the text matched by the current regular expression. |
COMMENT | final public static int COMMENT(Code) | | |
YYEOF | final public static int YYEOF(Code) | | This character denotes the end of file
|
YYINITIAL | final public static int YYINITIAL(Code) | | lexical states
|
SQLLexer | public SQLLexer(java.io.Reader in)(Code) | | Creates a new scanner
There is also a java.io.InputStream version of this constructor.
Parameters: in - the java.io.Reader to read input from. |
SQLLexer | public SQLLexer(java.io.InputStream in)(Code) | | Creates a new scanner.
There is also java.io.Reader version of this constructor.
Parameters: in - the java.io.Inputstream to read input from. |
getNextToken | public SQLToken getNextToken(boolean returnComments, boolean returnWhiteSpace)(Code) | | next Token method that allows you to control if whitespace and comments are
returned as tokens.
|
getNextToken | public SQLToken getNextToken() throws java.io.IOException(Code) | | Resumes scanning until the next regular expression is matched,
the end of input is encountered or an I/O-Error occurs.
the next token exception: java.io.IOException - if any I/O-Error occurs |
reset | public void reset(java.io.Reader reader, int yyline, int yychar, int yycolumn) throws IOException(Code) | | Closes the current input stream, and resets the scanner to read from a new input stream.
All internal variables are reset, the old input stream cannot be reused
(content of the internal buffer is discarded and lost).
The lexical state is set to the initial state.
Subsequent tokens read from the lexer will start with the line, char, and column
values given here.
Parameters: reader - The new input. Parameters: yyline - The line number of the first token. Parameters: yychar - The position (relative to the start of the stream) of the first token. Parameters: yycolumn - The position (relative to the line) of the first token. throws: IOException - if an IOExecption occurs while switching readers. |
yybegin | final public void yybegin(int newState)(Code) | | Enters a new lexical state
Parameters: newState - the new lexical state |
yycharat | final public char yycharat(int pos)(Code) | | Returns the character at position pos from the
matched text.
It is equivalent to yytext().charAt(pos), but faster
Parameters: pos - the position of the character to fetch. A value from 0 to yylength()-1. the character at position pos |
yylength | final public int yylength()(Code) | | Returns the length of the matched text region.
|
yypushback | public void yypushback(int number)(Code) | | Pushes the specified amount of characters back into the input stream.
They will be read again by then next call of the scanning method
Parameters: number - the number of characters to be read again.This number must not be greater than yylength()! |
yyreset | final public void yyreset(java.io.Reader reader)(Code) | | Resets the scanner to read from a new input stream.
Does not close the old reader.
All internal variables are reset, the old input stream
cannot be reused (internal buffer is discarded and lost).
Lexical state is set to ZZ_INITIAL.
Parameters: reader - the new input stream |
yystate | final public int yystate()(Code) | | Returns the current lexical state.
|
yytext | final public String yytext()(Code) | | Returns the text matched by the current regular expression.
|
|
|