jfun.parsec
Class Words

java.lang.Object
  extended by jfun.parsec.Words
All Implemented Interfaces:
java.io.Serializable

public final class Words
extends java.lang.Object
implements java.io.Serializable

This helper class provides convenient api's to build lexer and parsers for keywords and operators.

Author:
Ben Yu Dec 19, 2004
See Also:
Serialized Form

Method Summary
 Parser<Tok> getLexer()
          gets the lexer object.
 java.lang.Object getToken(java.lang.String name)
          gets the token object identified by the token text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getToken

public java.lang.Object getToken(java.lang.String name)
gets the token object identified by the token text. This text is the operator or the keyword.

Parameters:
name - the token text.
Returns:
the token object.
Throws:
java.lang.IllegalArgumentException - if the token object does not exist.

getLexer

public Parser<Tok> getLexer()
gets the lexer object.

Returns:
the lexer object.