|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjdrew.oo.util.POSLParser
A Class to parse input in the POSL format.
Title: OO jDREW
Description: Reasoning Engine for the Semantic Web - Supporting OO RuleML 0.88
Copyright: Copyright (c) 2005
| Constructor Summary | |
POSLParser()
Used to construct a new POSLParser object - which is used for parsing knowledge bases in POSL syntax. |
|
| Method Summary | |
void |
clear()
Used to remove all clauses from the internal buffer of the parser, allowing the parser to be easily reused. |
java.util.Iterator |
iterator()
Used to get an interator of the clauses that have been parsed by the POSLParser, this Iterator can be passed to the loadClauses(Iterator) method of a ForwardReasoner and
BackwardReasoner to load the parsed clauses. |
void |
parseDCFile(java.lang.String fileName)
Used to parse a file containing clauses in POSL syntax. |
DefiniteClause |
parseDefiniteClause(java.lang.String clause)
Used to parse a single clause in POSL syntax contained in a String. |
void |
parseDefiniteClauses(java.lang.String input)
Used to parse multiple clauses in POSL syntax contained in a String. |
DefiniteClause |
parseQueryString(java.lang.String query)
Used to parse a query clause in POSL syntax. |
int |
size()
Used to find the number of clauses stored in the parser's internal buffer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public POSLParser()
| Method Detail |
public java.util.Iterator iterator()
loadClauses(Iterator) method of a ForwardReasoner and
BackwardReasoner to load the parsed clauses.
java.util.Iterator value - returns an Iterator of
the clauses that have been parsed by the POSLParser since creation or
the last time clear() was called.public void clear()
public void parseDCFile(java.lang.String fileName)
throws java.io.IOException,
ParseException
fileName - String A string containing the complete path of the file
to be parsed.
java.io.IOException - Throws an IOException if there is an error reading
the file.
ParseException - Throws a ParseException if there is an error in
the POSL syntax that causes parsing to fail.
public DefiniteClause parseDefiniteClause(java.lang.String clause)
throws java.io.IOException,
ParseException
clause - String A string containg the clause (in POSL syntax) to be
parsed. The string must contain only one clause.
java.io.IOException - An IOException is thrown if there is an error
reading
ParseException - Thrown if there is an error in the POSL syntax
that causes the parsing to fail.
public void parseDefiniteClauses(java.lang.String input)
throws java.io.IOException,
ParseException
input - String A string containg one or more clauses (in POSL
syntax) to be parsed. The DefiniteClause objects are added to the
parsers buffer, and can be retrieved using the iterator() method; they
can then be used by the reasoning engine.
java.io.IOException - An IOException is thrown if there is an error
reading the string - this should never happen.
ParseException - A ParseException is thrown if there is an error
in the POSL syntax that causes parsing to fail.
public DefiniteClause parseQueryString(java.lang.String query)
throws java.io.IOException,
ParseException
query - String A string containing the query clause to be parsed.
Currently the string must end in a . - although this is not required by
the POSL syntax.
java.io.IOException - An IOException is thrown if there is an error
reading the string - this should never happen.
ParseExceptionpublic int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||