sjm.parse.tokens
Class QuoteState

java.lang.Object
  |
  +--sjm.parse.tokens.TokenizerState
        |
        +--sjm.parse.tokens.QuoteState

public class QuoteState
extends TokenizerState

A quoteState returns a quoted string token from a reader. This state will collect characters until it sees a match to the character that the tokenizer used to switch to this state. For example, if a tokenizer uses a double- quote character to enter this state, then nextToken() will search for another double-quote until it finds one or finds the end of the reader.

Version:
1.0
Author:
Steven J. Metsker

Field Summary
protected  char[] charbuf
           
 
Constructor Summary
QuoteState()
           
 
Method Summary
protected  void checkBufLength(int i)
           
 Token nextToken(java.io.PushbackReader r, int cin, Tokenizer t)
          Return a quoted string token from a reader.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

charbuf

protected char[] charbuf
Constructor Detail

QuoteState

public QuoteState()
Method Detail

checkBufLength

protected void checkBufLength(int i)

nextToken

public Token nextToken(java.io.PushbackReader r,
                       int cin,
                       Tokenizer t)
                throws java.io.IOException
Return a quoted string token from a reader. This method will collect characters until it sees a match to the character that the tokenizer used to switch to this state.
Overrides:
nextToken in class TokenizerState
Returns:
a quoted string token from a reader