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.
 
Constructor Summary
WhitespaceState()
           
WhitespaceState(boolean shouldIgnore)
           
 
Method Summary
protected  void checkBuffer(int size)
          Increase buffer size if necessary.
 Token nextToken(java.io.PushbackReader reader, int first, Tokenizer tokenizer)
          Scans next white spaces from reader.
 void setShouldIgnore(boolean value)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shouldIgnore

protected boolean shouldIgnore
Whether or not to ignore white spaces.

buffer

char[] buffer
The character buffer.
Constructor Detail

WhitespaceState

public WhitespaceState()

WhitespaceState

public WhitespaceState(boolean shouldIgnore)
Method Detail

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 from
first - the character starting the token
tokenizer - 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)