com.ugos.JIProlog.engine
Class JIPTermParser

java.lang.Object
  |
  +--com.ugos.JIProlog.engine.JIPTermParser

public class JIPTermParser
extends java.lang.Object

JIPTermParser parses a prolog stream and create an enumeration of prologprolog terms (atom, functor, list, etc.)

Version:
3.0
Author:
Ugo Chirico 200w
Home Page: http://www.ugosweb.com/jiprolog
See Also:
JIPEngine.getTermParser()

Method Summary
 java.util.Enumeration parseStream(java.io.InputStream ins, java.lang.String streamName)
          Returns an enumeration of terms contained in the specified input stream.
 JIPTerm parseTerm(java.lang.String strTerm)
          Parses the term passed in the parameter and returns a JIPTerm object that wraps the corresponding prolog term.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseStream

public final java.util.Enumeration parseStream(java.io.InputStream ins,
                                               java.lang.String streamName)
Returns an enumeration of terms contained in the specified input stream.

Parameters:
ins - the input stream to parse.
streamName - tha name of the stream (i.e. the name of the associated file)

parseTerm

public final JIPTerm parseTerm(java.lang.String strTerm)
                        throws JIPSyntaxErrorException
Parses the term passed in the parameter and returns a JIPTerm object that wraps the corresponding prolog term.
If the string passed in the parameter doesn't contains a valid prolog term it raises a JIPSyntaxErrorException.

Parameters:
strTerm - Term to be parsed. If the term doesn't end with a "dot" one is appended to it.
Returns:
a new JIPTerm object.
Throws:
JIPSyntaxErrorException