|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.me.parabola.mkgmap.scan.TokenScanner
public class TokenScanner
Read a file in terms of word and symbol tokens.
Constructor Summary | |
---|---|
TokenScanner(java.lang.String filename,
java.io.Reader reader)
|
Method Summary | |
---|---|
boolean |
checkToken(java.lang.String val)
|
java.lang.String |
getFileName()
|
int |
getLinenumber()
|
boolean |
isEndOfFile()
|
int |
nextInt()
Convenience routine to get an integer. |
Token |
nextToken()
Get the next token tht is not a space or newline. |
java.lang.String |
nextValue()
Get the value of the next token and consume the token. |
java.lang.String |
nextWord()
As nextWordWithInfo() but just the string is returned. |
WordInfo |
nextWordWithInfo()
Read a string that can be quoted. |
Token |
peekToken()
Peek and return the first token. |
java.lang.String |
readLine()
Read the tokens up until the end of the line and combine then into one string. |
java.lang.String |
readUntil(TokType type,
java.lang.String value)
|
void |
setExtraWordChars(java.lang.String extraWordChars)
|
void |
skipLine()
Skip everything up to a new line token. |
void |
skipSpace()
Skip any white space. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TokenScanner(java.lang.String filename, java.io.Reader reader)
Method Detail |
---|
public Token peekToken()
public Token nextToken()
public java.lang.String nextValue()
public boolean isEndOfFile()
public void skipSpace()
public void skipLine()
public java.lang.String readLine()
public java.lang.String readUntil(TokType type, java.lang.String value)
public int nextInt() throws java.lang.NumberFormatException
java.lang.NumberFormatException
- When the next symbol isn't
a valid integer.public java.lang.String nextWord()
nextWordWithInfo()
but just the string is returned.
public WordInfo nextWordWithInfo()
public boolean checkToken(java.lang.String val)
public int getLinenumber()
public java.lang.String getFileName()
public void setExtraWordChars(java.lang.String extraWordChars)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |