Class SentenceParser
java.lang.Object
org.projog.core.parser.SentenceParser
Parses Prolog syntax representing rules including operators.
Note: not thread safe.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic SentenceParsergetInstance(Reader reader, Operands operands) Returns a newSentenceParserthat will parse Prolog syntax read from the specifiedReaderusing the specifiedOperands.static SentenceParsergetInstance(String prologSyntax, Operands operands) Returns a newSentenceParserwill parse the specifiedStringusing the specifiedOperands.Returns collection ofVariableinstances created by thisSentenceParser.booleanhasNext()
-
Method Details
-
getInstance
Returns a newSentenceParserwill parse the specifiedStringusing the specifiedOperands.- Parameters:
prologSyntax- the prolog syntax to be parsedoperands- details of the operands to use during parsing- Returns:
- a new
SentenceParser
-
getInstance
Returns a newSentenceParserthat will parse Prolog syntax read from the specifiedReaderusing the specifiedOperands.- Parameters:
reader- the source of the prolog syntax to be parsedoperands- details of the operands to use during parsing- Returns:
- a new
SentenceParser
-
getParsedTermVariables
Returns collection ofVariableinstances created by thisSentenceParser.Returns all
Variables created by thisSentenceParsereither since it was created or since the last execution ofparseSentence().- Returns:
- collection of
Variableinstances created by thisSentenceParser
-
parseSentence
- Returns:
- a
Termcreated from Prolog syntax read from this object'sCharacterParserornullif the end of the underlying stream being parsed has been reached - Throws:
ParserException- if an error parsing the Prolog syntax occurs
-
hasNext
public boolean hasNext()
-