TT - Enumerates the scanner-specific token typespublic abstract class AbstractScanner<TT extends java.lang.Enum<TT>> extends java.lang.Object implements StringScanner<TT>
AbstractScanner.Tokens.StringScanner.produce()| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractScanner.Token<TT extends java.lang.Enum<TT>>
Representation of a scanned token.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.CharSequence |
cs
The string currently being scanned; typically one line from an input document.
|
protected int |
offset
The position within
cs of the next token to be scanned. |
protected int |
previousTokenOffset
The position within
cs of the previously scanned token. |
| Constructor and Description |
|---|
AbstractScanner() |
| Modifier and Type | Method and Description |
|---|---|
int |
getOffset() |
int |
getPreviousTokenOffset() |
AbstractScanner<TT> |
setInput(java.lang.CharSequence cs) |
java.lang.String |
toString()
Returns a human-readable text which describes the origin of the previously produced element, e.g. file name,
line number and column number
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitproduceprotected java.lang.CharSequence cs
protected int offset
cs of the next token to be scanned.protected int previousTokenOffset
cs of the previously scanned token.public AbstractScanner<TT> setInput(java.lang.CharSequence cs)
setInput in interface StringScanner<TT extends java.lang.Enum<TT>>cs - The CharSequence from which following calls to StringScanner.produce() will scan tokenspublic int getOffset()
getOffset in interface StringScanner<TT extends java.lang.Enum<TT>>StringScanner.setInput(CharSequence) where the previously
scanned token ends, or 0 after the call to StringScanner.setInput(CharSequence) and before the first
call to StringScanner.produce()public int getPreviousTokenOffset()
getPreviousTokenOffset in interface StringScanner<TT extends java.lang.Enum<TT>>StringScanner.setInput(CharSequence) where the previously
scanned token begins, or -1 after the call to StringScanner.setInput(CharSequence) and before the first
call to StringScanner.produce()public java.lang.String toString()
ProducerWhichThrowstoString in interface ProducerWhichThrows<AbstractScanner.Token<TT extends java.lang.Enum<TT>>,ScanException>toString in class java.lang.Object