|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.torque.engine.sql.SQLScanner
public class SQLScanner
A simple Scanner implementation that scans an sql file into usable tokens. Used by SQLToAppData.
| Field Summary | |
|---|---|
private static String |
ALFA
alphabetic characters |
private static 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 Reader |
in
the input reader |
private int |
line
line |
private static String |
NUMER
numbers |
private static String |
SPECIAL
special characters |
private String |
token
token |
private List |
tokens
list of tokens |
private static String |
WHITE
white spaces |
| Constructor Summary | |
|---|---|
SQLScanner()
Creates a new scanner with no Reader |
|
SQLScanner(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. |
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(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 String WHITE
private static final String ALFA
private static final String NUMER
private static final String ALFANUM
private static final 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 Reader in
private int chr
private String token
private List tokens
private int line
private int col
| Constructor Detail |
|---|
public SQLScanner()
public SQLScanner(Reader input)
input - the input reader| Method Detail |
|---|
public void setInput(Reader input)
input - the input reader
private void readChar()
throws IOException
IOException - If an I/O error occurs
private void scanIdentifier()
throws IOException
IOException - If an I/O error occurs
private void scanNegativeIdentifier()
throws IOException
IOException - If an I/O error occurs
public List scan()
throws IOException
IOException - If an I/O error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||