All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jkp.KifParser

java.lang.Object
   |
   +----jkp.KifParser

public class KifParser
extends Object
This class is an interface to the the KIF parser (YYparse) generated. We use synchronized method to avoid more than one thread to call YYparse at the same time.

Copyright (c) 1996, Xiaocheng Luan. All rights reserved.

Author:
Xiaocheng Luan

Variable Index

 o _result

Constructor Index

 o KifParser()

Method Index

 o parse(InputStream)
Read one KIF sentence from the inStream and parse it.
 o parse(String)
This is the method you should call when you want to parse a kif string.
 o printResult()
For debug only, not supposed to be used by developers.

Variables

 o _result
 public static KifObj _result

Constructors

 o KifParser
 public KifParser()

Methods

 o parse
 public static synchronized KifObj parse(String text) throws ParseException
This is the method you should call when you want to parse a kif string. This method is safe when called simutaneously in more than one thread. But in actural fact, these calls are serialized.

Note: one sentence at a time.

Parameters:
text - the KIF language string to parse.
Returns:
the Kif object obtained in the parsing.
See Also:
parse
 o printResult
 public static void printResult()
For debug only, not supposed to be used by developers. Use this method with caution. when called, if another thread is calling "parse", the printed result by this method may not be predictable.

 o parse
 public static synchronized KifObj parse(InputStream inStream) throws ParseException
Read one KIF sentence from the inStream and parse it. This method is NOT multi-thread safe.

Parameters:
inStream - the input stream of KIF sentences.
Returns:
the Kif object obtained in the parsing.
See Also:
parse

All Packages  Class Hierarchy  This Package  Previous  Next  Index