|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.scanner.base.TokenStreamBaseImpl
org.extex.scanner.base.TokenStreamImpl
public class TokenStreamImpl
This class contains an implementation of a token stream which is fed from a Reader.
| Field Summary | |
|---|---|
protected static int |
CARET_LIMIT
The constant CARET_LIMIT contains the threshold for the ^ notation. |
protected static org.extex.scanner.base.TokenStreamImpl.State |
MID_LINE
The constant MID_LINE contains the state for the processing in the middle of a line. |
protected static org.extex.scanner.base.TokenStreamImpl.State |
NEW_LINE
The constant NEW_LINE contains the state for the processing at the beginning of a new line. |
protected static org.extex.scanner.base.TokenStreamImpl.State |
SKIP_BLANKS
The constant SKIP_BLANKS contains the state for the processing when spaces are ignored. |
| Constructor Summary | |
|---|---|
TokenStreamImpl(Configuration config,
TokenStreamOptions options,
java.io.Reader reader,
java.lang.Boolean isFile,
java.lang.String theSource)
Creates a new object. |
|
| Method Summary | |
|---|---|
protected boolean |
atEndofLine()
Checks whether the pointer is at the end of line. |
protected void |
endLine()
End the current line. |
protected UnicodeChar |
getChar(Tokenizer tokenizer)
Return the next character to process. |
Locator |
getLocator()
Getter for the locator. |
protected Token |
getNext(TokenFactory factory,
Tokenizer tokenizer)
Get the next token when the stack is empty. |
protected UnicodeChar |
getRawChar()
Get the next character from the input line. |
protected int |
hex2int(int c)
Analyze a character and return its hex value. |
boolean |
isEof()
Check to see if a further token can be acquired from the token stream. |
boolean |
isEol()
Check to see if the token stream is currently at the end of line. |
protected boolean |
refill()
Get the next line from the input reader to be processed. |
java.lang.String |
toString()
Returns a string representation of the object. |
| Methods inherited from class org.extex.scanner.base.TokenStreamBaseImpl |
|---|
closeFileStream, get, isFileStream, put, skipSpaces |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.extex.scanner.api.TokenStream |
|---|
closeFileStream, get, isFileStream, put |
| Field Detail |
|---|
protected static final int CARET_LIMIT
protected static final org.extex.scanner.base.TokenStreamImpl.State MID_LINE
protected static final org.extex.scanner.base.TokenStreamImpl.State NEW_LINE
protected static final org.extex.scanner.base.TokenStreamImpl.State SKIP_BLANKS
| Constructor Detail |
|---|
public TokenStreamImpl(Configuration config,
TokenStreamOptions options,
java.io.Reader reader,
java.lang.Boolean isFile,
java.lang.String theSource)
throws java.io.IOException
config - the configuration object for this instance; This
configuration is ignored in this implementation.options - ignored herereader - the readerisFile - indicator for file streamstheSource - the description of the input source
java.io.IOException - in case of an IO error| Method Detail |
|---|
protected boolean atEndofLine()
true iff the next reading operation would try to
refill the line bufferprotected void endLine()
protected UnicodeChar getChar(Tokenizer tokenizer)
throws ScannerException
This operation might involve that an additional bunch of characters is
read in (with refill()).
tokenizer - the classifier for characters
null if no more character is
available
ScannerException - in the rare case that an IO Exception has
occurred.public Locator getLocator()
getLocator in interface TokenStreamgetLocator in class TokenStreamBaseImplTokenStream.getLocator()
protected Token getNext(TokenFactory factory,
Tokenizer tokenizer)
throws ScannerException
getNext in class TokenStreamBaseImplfactory - the factory for new tokenstokenizer - the classifies for characters
null
ScannerException - in case of an errorTokenStreamBaseImpl.getNext(
org.extex.scanner.type.token.TokenFactory,
org.extex.scanner.api.Tokenizer)protected UnicodeChar getRawChar()
null if none is
available.protected int hex2int(int c)
c - the character code to analyze
public boolean isEof()
throws ScannerException
isEof in interface TokenStreamisEof in class TokenStreamBaseImpltrue if the stream is at its end
ScannerException - in case that an error has been encountered.
Especially if an IO exceptions occurs it is delivered as chained
exception in a ScannerException.TokenStream.isEof()public boolean isEol()
isEol in interface TokenStreamisEol in class TokenStreamBaseImpltrue if the stream is at end of lineTokenStream.isEol()
protected boolean refill()
throws ScannerException
true iff the next line could be acquired.
ScannerException - in case of some kind of IO errorpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||