| Modifier and Type | Field and Description |
|---|---|
| protected int | currentCharIndex
Absolute character index. |
| protected int[] | data
A moving window buffer of the data being scanned. |
| protected Reader | |
| protected int | lastChar
This is the |
| protected int | lastCharBufferStart
When |
| protected int | |
| public String | name
The name or source of this char stream. |
| protected int | |
| protected int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | UnbufferedCharStream(int bufferSize)
Useful for subclasses that pull char from other than this.input. |
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public void | consume()
Implements org. |
| protected int | |
| protected final int | |
| public String | getSourceName()
Implements org. |
| public String | getText(Interval
an interval within the stream interval)Implements org. |
| public int | index()
Implements org. LA(1).
|
| public int | LA(int i)
Implements org. i from the current
position.
|
| public int | |
| protected int | |
| public void | release(int marker)
Implements org. |
| public void | seek(int
The absolute index to seek to. index)Implements org. |
| public int | size()
Implements org. |
| protected void |
| currentCharIndex | back to summary |
|---|---|
| protected int currentCharIndex Absolute character index. It's the index of the character about to be
read via | |
| data | back to summary |
|---|---|
| protected int[] data A moving window buffer of the data being scanned. While there's a marker,
we keep adding to buffer. Otherwise, | |
| input | back to summary |
|---|---|
| protected Reader input | |
| lastChar | back to summary |
|---|---|
| protected int lastChar This is the | |
| lastCharBufferStart | back to summary |
|---|---|
| protected int lastCharBufferStart When | |
| n | back to summary |
|---|---|
| protected int n The number of characters currently in This is not the buffer capacity, that's | |
| name | back to summary |
|---|---|
| public String name The name or source of this char stream. | |
| numMarkers | back to summary |
|---|---|
| protected int numMarkers Count up with | |
| p | back to summary |
|---|---|
| protected int p 0..n-1 index into The | |
| UnbufferedCharStream | back to summary |
|---|---|
| public UnbufferedCharStream() Useful for subclasses that pull char from other than this.input. | |
| UnbufferedCharStream | back to summary |
|---|---|
| public UnbufferedCharStream(int bufferSize) Useful for subclasses that pull char from other than this.input. | |
| UnbufferedCharStream | back to summary |
|---|---|
| public UnbufferedCharStream(InputStream input) | |
| UnbufferedCharStream | back to summary |
|---|---|
| public UnbufferedCharStream(Reader input) | |
| UnbufferedCharStream | back to summary |
|---|---|
| public UnbufferedCharStream(InputStream input, int bufferSize) | |
| UnbufferedCharStream | back to summary |
|---|---|
| public UnbufferedCharStream(InputStream input, int bufferSize, Charset charset) | |
| UnbufferedCharStream | back to summary |
|---|---|
| public UnbufferedCharStream(Reader input, int bufferSize) | |
| add | back to summary |
|---|---|
| protected void add(int c) | |
| consume | back to summary |
|---|---|
| public void consume() Implements org. Doc from org. Consumes the current symbol in the stream. This method has the following effects:
index() is
incremented by exactly 1, as that would preclude the ability to implement
filtering streams (e.g. CommonTokenStream which distinguishes
between "on-channel" and "off-channel" tokens).
| |
| fill | back to summary |
|---|---|
| protected int fill(int n) Add | |
| getBufferStartIndex | back to summary |
|---|---|
| protected final int getBufferStartIndex() | |
| getSourceName | back to summary |
|---|---|
| public String getSourceName() Implements org. Doc from org. Gets the name of the underlying symbol source. This method returns a
non-null, non-empty string. If such a name is not known, this method
returns
| |
| getText | back to summary |
|---|---|
| public String getText(Interval interval) Implements org. Doc from org. This method returns the text for a range of characters within this input
stream. This method is guaranteed to not throw an exception if the
specified | |
| index | back to summary |
|---|---|
| public int index() Implements org. Doc from org. Return the index into the stream of the input symbol referred to by
The behavior of this method is unspecified if no call to an
| |
| LA | back to summary |
|---|---|
| public int LA(int i) Implements org. Doc from org. Gets the value of the symbol at offset This method is guaranteed to succeed if any of the following are true:
If The return value is unspecified if
| |
| mark | back to summary |
|---|---|
| public int mark() Implements org. Return a marker that we can release later. The specific marker value used for this class allows for some level of
protection against misuse where
| |
| nextChar | back to summary |
|---|---|
| protected int nextChar() throws IOException Override to provide different source of characters than
| |
| release | back to summary |
|---|---|
| public void release(int marker) Implements org. Decrement number of markers, resetting buffer if we hit 0.
| |
| seek | back to summary |
|---|---|
| public void seek(int index) Implements org. Seek to absolute character index, which might not be in the current
sliding window. Move
| |
| size | back to summary |
|---|---|
| public int size() Implements org. Doc from org. Returns the total number of symbols in the stream, including a single EOF symbol.
| |
| sync | back to summary |
|---|---|
| protected void sync(int want) Make sure we have 'need' elements from current position | |