|
Parsing Engine | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanbikel.lisp.WordTokenizer
danbikel.lisp.SexpTokenizer
public class SexpTokenizer
A class for tokenizing simple S-expressions, where there are only strings
delimited by whitespace or parentheses (as implemented by WordTokenizer). Comments are lines where the first non-whitespace
character is a semicolon (the character ';').
| Field Summary |
|---|
| Fields inherited from class danbikel.lisp.WordTokenizer |
|---|
javadocHack, sval, ttype |
| Constructor Summary | |
|---|---|
SexpTokenizer(File file,
String encoding,
int bufSize)
Convenience constructor, creating a SexpTokenizer around a
BufferedReader around a FileInputStream. |
|
SexpTokenizer(File file,
String encoding,
int bufSize,
boolean comments)
Convenience constructor, creating a SexpTokenizer around a
BufferedReader around a FileInputStream. |
|
SexpTokenizer(InputStream stream,
String encoding,
int bufSize)
Convenience constructor, creating a SexpTokenizer around a
BufferedReader around a InputStreamReader. |
|
SexpTokenizer(InputStream stream,
String encoding,
int bufSize,
boolean comments)
Convenience constructor, creating a SexpTokenizer around a
BufferedReader around a InputStreamReader. |
|
SexpTokenizer(Reader inStream)
Constructs a SexpTokenizer with the specified stream
and the default comment-recognition option, which is true. |
|
SexpTokenizer(Reader inStream,
boolean comments)
Constructs a SexpTokenizer with the specified stream
and comment-recognition option. |
|
SexpTokenizer(Reader inStream,
boolean comments,
char[] ordinary)
Constructs a SexpTokenizer with the specified stream,
comment-recognition option and set of ordinary characters, which are
actually those characters to be treated as metacharacters (i.e., not
part of tokens, but delimiters of tokens). |
|
SexpTokenizer(String filename,
String encoding,
int bufSize)
Convenience constructor, creating a SexpTokenizer around a
BufferedReader around a FileInputStream. |
|
SexpTokenizer(String filename,
String encoding,
int bufSize,
boolean comments)
Convenience constructor, creating a SexpTokenizer around a
BufferedReader around a FileInputStream. |
|
SexpTokenizer(URL url,
String encoding,
int bufSize)
Convenience constructor, creating a SexpTokenizer around a
BufferedReader around an InputStreamReader
around the stream created by calling url.openStream(). |
|
SexpTokenizer(URL url,
String encoding,
int bufSize,
boolean comments)
Convenience constructor, creating a SexpTokenizer around a
BufferedReader around a InputStreamReader
around the stream created by calling url.openStream(). |
|
| Method Summary |
|---|
| Methods inherited from class danbikel.lisp.WordTokenizer |
|---|
close, commentChar, lineno, nextToken, numCharsRead, ordinaryChar, ordinaryChars, pushBack |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SexpTokenizer(Reader inStream,
boolean comments)
SexpTokenizer with the specified stream
and comment-recognition option.
inStream - the input stream for this tokenizercomments - indicates whether to recognizes comment linesWordTokenizer.commentChar(int)
public SexpTokenizer(Reader inStream,
boolean comments,
char[] ordinary)
SexpTokenizer with the specified stream,
comment-recognition option and set of ordinary characters, which are
actually those characters to be treated as metacharacters (i.e., not
part of tokens, but delimiters of tokens).
inStream - the input stream for this tokenizercomments - indicates whether to recognizes comment linesordinary - an array of all characters to be treated as metacharactersWordTokenizer.ordinaryChar(char),
WordTokenizer.commentChar(int)public SexpTokenizer(Reader inStream)
SexpTokenizer with the specified stream
and the default comment-recognition option, which is true.
inStream - the input stream for this tokenizer
public SexpTokenizer(String filename,
String encoding,
int bufSize)
throws UnsupportedEncodingException,
FileNotFoundException,
IOException
SexpTokenizer around a
BufferedReader around a FileInputStream.
The tokenizer will recognize comment lines.
filename - the name of the file containing S-expressionsencoding - the encoding of the file to be tokenizedbufSize - the size of the buffer of the BufferedReader
that will be created
UnsupportedEncodingException - if the specified encoding is not
supported
FileNotFoundException - if the specified file does not exist
IOException
public SexpTokenizer(String filename,
String encoding,
int bufSize,
boolean comments)
throws UnsupportedEncodingException,
FileNotFoundException,
IOException
SexpTokenizer around a
BufferedReader around a FileInputStream.
filename - the name of the file containing S-expressionsencoding - the encoding of the file to be tokenizedbufSize - the size of the buffer of the BufferedReader
that will be createdcomments - whether this tokenizer will recognize comments
UnsupportedEncodingException - if the specified encoding is not
supported
FileNotFoundException - if the specified file does not exist
IOException
public SexpTokenizer(File file,
String encoding,
int bufSize)
throws UnsupportedEncodingException,
FileNotFoundException,
IOException
SexpTokenizer around a
BufferedReader around a FileInputStream.
The tokenizer will recognize comment lines.
file - the file containing S-expressionsencoding - the encoding of the file to be tokenizedbufSize - the size of the buffer of the BufferedReader
that will be created
UnsupportedEncodingException - if the specified encoding is not
supported
FileNotFoundException - if the specified file does not exist
IOException
public SexpTokenizer(File file,
String encoding,
int bufSize,
boolean comments)
throws UnsupportedEncodingException,
FileNotFoundException,
IOException
SexpTokenizer around a
BufferedReader around a FileInputStream.
file - the file containing S-expressionsencoding - the encoding of the file to be tokenizedbufSize - the size of the buffer of the BufferedReader
that will be createdcomments - whether this tokenizer will recognize comments
UnsupportedEncodingException - if the specified encoding is not
supported
FileNotFoundException - if the specified file does not exist
IOException
public SexpTokenizer(InputStream stream,
String encoding,
int bufSize)
throws UnsupportedEncodingException
SexpTokenizer around a
BufferedReader around a InputStreamReader.
The tokenizer will recognize comment lines.
stream - the stream of bytes, encoded with encoding,
containing S-expressionsencoding - the encoding of the file to be tokenizedbufSize - the size of the buffer of the BufferedReader
that will be created
UnsupportedEncodingException - if the specified encoding is not
supported
public SexpTokenizer(InputStream stream,
String encoding,
int bufSize,
boolean comments)
throws UnsupportedEncodingException
SexpTokenizer around a
BufferedReader around a InputStreamReader.
stream - the stream of bytes, encoded with encoding,
containing S-expressionsencoding - the encoding of the file to be tokenizedbufSize - the size of the buffer of the BufferedReader
that will be createdcomments - whether this tokenizer will recognize comments
UnsupportedEncodingException - if the specified encoding is not
supported
public SexpTokenizer(URL url,
String encoding,
int bufSize)
throws UnsupportedEncodingException,
IOException
SexpTokenizer around a
BufferedReader around an InputStreamReader
around the stream created by calling url.openStream().
The tokenizer will recognize comment lines.
url - the url from which to get the stream containing S-expressionsencoding - the encoding of the file to be tokenizedbufSize - the size of the buffer of the BufferedReader
UnsupportedEncodingException - if the specified encoding is not
supported
IOException - if the underlying call to URL.openStream()
or the construction of any of the readers throws an
IOException
public SexpTokenizer(URL url,
String encoding,
int bufSize,
boolean comments)
throws UnsupportedEncodingException,
IOException
SexpTokenizer around a
BufferedReader around a InputStreamReader
around the stream created by calling url.openStream().
url - the url from which to get the stream containing S-expressionsencoding - the encoding of the file to be tokenizedbufSize - the size of the buffer of the BufferedReadercomments - whether this tokenizer will recognize comments
UnsupportedEncodingException - if the specified encoding is not
supported
IOException - if the underlying call to URL.openStream()
or the construction of any of the readers throws an
IOException
|
Parsing Engine | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||