uk.ac.bham.gloss
Class TokenTokenizer

java.lang.Object
  extended by uk.ac.bham.gloss.TokenTokenizer
All Implemented Interfaces:
Locator, Tokenizer

public class TokenTokenizer
extends java.lang.Object
implements Tokenizer

A TokenTokenizer object is a Tokenizer that returns a single token first and then reverts to a previous tokenizer. Copyright Richard Kaye 2007-8 for GLOSS, http://gloss.bham.ac.uk Usage permitted according to the GPL. No waranty.


Constructor Summary
TokenTokenizer(Token token, Tokenizer l)
           
 
Method Summary
 int col()
          column number, starting at 0; returns -1 if this data is not available.
 java.lang.String doc()
          Returns the document name or URL.
 Token getToken(java.lang.String accept)
           
 int line()
          line number, starting at 1; returns -1 if this data is not available.
 void ungetToken()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenTokenizer

public TokenTokenizer(Token token,
                      Tokenizer l)
Method Detail

getToken

public Token getToken(java.lang.String accept)
               throws GlossException
Specified by:
getToken in interface Tokenizer
Throws:
GlossException

ungetToken

public void ungetToken()
                throws GlossException
Specified by:
ungetToken in interface Tokenizer
Throws:
GlossException

line

public int line()
Description copied from interface: Locator
line number, starting at 1; returns -1 if this data is not available.

Specified by:
line in interface Locator

col

public int col()
Description copied from interface: Locator
column number, starting at 0; returns -1 if this data is not available.

Specified by:
col in interface Locator

doc

public java.lang.String doc()
Returns the document name or URL.

Specified by:
doc in interface Locator