|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.torque.engine.sql.SQLScanner
A simple Scanner implementation that scans an sql file into usable tokens. Used by SQLToAppData.
Field Summary | |
private static java.lang.String |
ALFA
alphabetic characters |
private static java.lang.String |
ALFANUM
alphanumeric |
private int |
chr
character |
private int |
col
column |
private static char |
COMMENT_DASH
comment |
private static char |
COMMENT_POUND
comment |
private static char |
COMMENT_SLASH
comment |
private static char |
COMMENT_STAR
comment |
private java.io.Reader |
in
the input reader |
private int |
line
line |
private static java.lang.String |
NUMER
numbers |
private static java.lang.String |
SPECIAL
special characters |
private java.lang.String |
token
token |
private java.util.List |
tokens
list of tokens |
private static java.lang.String |
WHITE
white spaces |
Constructor Summary | |
SQLScanner()
Creates a new scanner with no Reader |
|
SQLScanner(java.io.Reader input)
Creates a new scanner with an Input Reader |
Method Summary | |
private void |
readChar()
Reads the next character and increments the line and column counters. |
java.util.List |
scan()
Scan the input Reader and returns a list of tokens. |
private void |
scanIdentifier()
Scans an identifier. |
private void |
scanNegativeIdentifier()
Scans an identifier which had started with the negative sign. |
void |
setInput(java.io.Reader input)
Set the Input |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String WHITE
private static final java.lang.String ALFA
private static final java.lang.String NUMER
private static final java.lang.String ALFANUM
private static final java.lang.String SPECIAL
private static final char COMMENT_POUND
private static final char COMMENT_SLASH
private static final char COMMENT_STAR
private static final char COMMENT_DASH
private java.io.Reader in
private int chr
private java.lang.String token
private java.util.List tokens
private int line
private int col
Constructor Detail |
public SQLScanner()
public SQLScanner(java.io.Reader input)
input
- the input readerMethod Detail |
public void setInput(java.io.Reader input)
input
- the input readerprivate void readChar() throws java.io.IOException
java.io.IOException
- If an I/O error occursprivate void scanIdentifier() throws java.io.IOException
java.io.IOException
- If an I/O error occursprivate void scanNegativeIdentifier() throws java.io.IOException
java.io.IOException
- If an I/O error occurspublic java.util.List scan() throws java.io.IOException
java.io.IOException
- If an I/O error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |