jfun.parsec

Interface Catch<T>

public interface Catch<T> extends Serializable

To catch a pseudo-exception 'thrown' from a Parser. A pseudo-exception is not a real java exception. It only affects the execution of a parser and can only be caught by Parsers.tryParser method.

Author: Ben Yu 2004-11-12

Method Summary
Parser<T>catchException(Object v, Object e)
in case of a pseudo-exception e happens, user can specify what Parser to use.

Method Detail

catchException

public Parser<T> catchException(Object v, Object e)
in case of a pseudo-exception e happens, user can specify what Parser to use.

Parameters: v the return value of the exceptional parser. e the exception thrown.

Returns: the new Parser object.