jfun.parsec

Class ConstTokenizer

public final class ConstTokenizer extends Object implements Tokenizer, Serializable

This tokenizer will always return the same token regardless of the input range.

Author: Ben Yu 2004-11-15

Method Summary
static Tokenizerinstance(Object t)
Creates the Tokenizer instance.
ObjecttoToken(CharSequence cs, int from, int len)

Method Detail

instance

public static Tokenizer instance(Object t)
Creates the Tokenizer instance.

Parameters: t the token to be returned by the tokenizer.

Returns: the tokenizer instance.

toToken

public Object toToken(CharSequence cs, int from, int len)