|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.StreamTokenizer
openlist.reader.SExpressionReader
public class SExpressionReader
SExpressionReader provides a reader for OpenLists and atoms. In addition to tokenizing for atoms of specific types: Doubles, Longs, and Strings (which are interned as Symbols), an entire OpenList can be read by a single method call, assuming the input is in the form of an S expression. In an S expression, the elements of a OpenLists are shown in parentheses with a space between each element. (The elements can themselves be S expressions representing OpenLists.)
| Field Summary | |
|---|---|
private int |
buff
|
private static char |
FORM_FEED
|
private static char |
LEFT_PAREN
|
private long |
lval
|
private static char |
NEWLINE
|
private static char |
RETURN
|
private static char |
RIGHT_PAREN
|
private static char |
SPACE
|
private static char |
TAB
|
private static int |
TT_LONG
|
private boolean |
valid
|
| Fields inherited from class java.io.StreamTokenizer |
|---|
nval, sval, TT_EOF, TT_EOL, TT_NUMBER, TT_WORD, ttype |
| Constructor Summary | |
|---|---|
SExpressionReader(java.io.InputStream I)
Construct an SExpressionReader from an InputStream |
|
SExpressionReader(java.io.Reader R)
Construct an SExpressionReader from a Reader. |
|
| Method Summary | |
|---|---|
void |
exceptionHandler(java.lang.Exception e)
exceptionHandler can be over-ridden to handle IO exceptions |
private void |
get()
Get the next token from the input. |
(package private) OpenList<java.lang.Object> |
getRestSexp()
Get the rest of a started S expression from input stream. |
private void |
getSkippingWhiteSpace()
Skip any whitespace, then get the next token from the input. |
private boolean |
isWhiteSpace(int c)
Determine whether a character is white space |
java.lang.Object |
nextSexp()
Get next S expression from input stream. |
int |
nextToken()
Get token and return TT_LONG, TT_NUMBER, TT_WORD, or TT_EOF |
private void |
putBack(int c)
Put a character back into the input. |
| Methods inherited from class java.io.StreamTokenizer |
|---|
commentChar, eolIsSignificant, lineno, lowerCaseMode, ordinaryChar, ordinaryChars, parseNumbers, pushBack, quoteChar, resetSyntax, slashSlashComments, slashStarComments, toString, whitespaceChars, wordChars |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final int TT_LONG
private long lval
private int buff
private boolean valid
private static final char LEFT_PAREN
private static final char RIGHT_PAREN
private static final char SPACE
private static final char TAB
private static final char NEWLINE
private static final char RETURN
private static final char FORM_FEED
| Constructor Detail |
|---|
public SExpressionReader(java.io.InputStream I)
public SExpressionReader(java.io.Reader R)
| Method Detail |
|---|
public void exceptionHandler(java.lang.Exception e)
private boolean isWhiteSpace(int c)
private void get()
private void getSkippingWhiteSpace()
private void putBack(int c)
c - the character to be put backpublic int nextToken()
nextToken in class java.io.StreamTokenizerpublic java.lang.Object nextSexp()
OpenList<java.lang.Object> getRestSexp()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||