org.jsesoft.jpp
Class WhitespaceState
java.lang.Object
|
+--org.jsesoft.jpp.State
|
+--org.jsesoft.jpp.WhitespaceState
- public class WhitespaceState
- extends State
Scans white spaces from the reader.
- Version:
- 1.0
- Author:
- JSESoft
Field Summary |
(package private) char[] |
buffer
The character buffer. |
protected boolean |
shouldIgnore
Whether or not to ignore white spaces. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
shouldIgnore
protected boolean shouldIgnore
- Whether or not to ignore white spaces.
buffer
char[] buffer
- The character buffer.
WhitespaceState
public WhitespaceState()
WhitespaceState
public WhitespaceState(boolean shouldIgnore)
nextToken
public Token nextToken(java.io.PushbackReader reader,
int first,
Tokenizer tokenizer)
throws java.io.IOException
- Scans next white spaces from reader.
- Overrides:
nextToken
in class State
- Parameters:
reader
- the reader to read characters fromfirst
- the character starting the tokentokenizer
- the tokenizer in duty- Returns:
- the next token
- Throws:
java.io.IOException
- on any problem reading
checkBuffer
protected void checkBuffer(int size)
- Increase buffer size if necessary.
- Parameters:
size
- the required size
setShouldIgnore
public void setShouldIgnore(boolean value)