KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > parsec > Catch


1 /*****************************************************************************
2  * Copyright (C) Zephyr Business Solutions Corp. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  *****************************************************************************/

8 /*
9  * Created on 2004-11-12
10  *
11  * Author Ben Yu
12  */

13 package jfun.parsec;
14
15 /**
16  * To catch a pseudo-exception 'thrown' from a Parser.
17  * A pseudo-exception is not a real java exception.
18  * It only affects the execution of a parser and can only be caught by Parsers.tryParser method.
19  * @author Ben Yu
20  *
21  * 2004-11-12
22  */

23 public interface Catch<T> extends java.io.Serializable JavaDoc{
24   /**
25    * in case of a pseudo-exception e happens, user can specify what Parser to use.
26    * @param v the return value of the exceptional parser.
27    * @param e the exception thrown.
28    * @return the new Parser object.
29    */

30   Parser<T> catchException(final Object JavaDoc v, final Object JavaDoc e);
31 }
32
Popular Tags