jfun.parsec

Class Words

public final class Words extends Object implements Serializable

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

Author: Ben Yu Dec 19, 2004

Method Summary
Parser<Tok>getLexer()
gets the lexer object.
ObjectgetToken(String name)
gets the token object identified by the token text.

Method Detail

getLexer

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

Returns: the lexer object.

getToken

public Object getToken(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: IllegalArgumentException if the token object does not exist.