Package net.sf.tweety.logics.pl.parser
Class PlParser
- java.lang.Object
-
- net.sf.tweety.commons.Parser<PlBeliefSet,PlFormula>
-
- net.sf.tweety.logics.pl.parser.PlParser
-
- Direct Known Subclasses:
QbfParser
public class PlParser extends Parser<PlBeliefSet,PlFormula>
This class implements a parser for propositional logic. The BNF for a propositional belief set is given by (starting symbol is FORMULASET)
FORMULASET ::== FORMULA ( "\n" FORMULA )*
FORMULA ::== PROPOSITION | "(" FORMULA ")" | FORMULA ">>" FORMULA | FORMULA "||" FORMULA | FORMULA "=>" FORMULA | FORMULA "<=>" FORMULA | FORMULA "^^" FORMULA | "!" FORMULA | "+" | "-"
PROPOSITION is a sequence of characters excluding |,&,!,(,),=,<,> and whitespace characters.- Author:
- Matthias Thimm, Bastian Wolf
-
-
Constructor Summary
Constructors Constructor Description PlParser()
-
Method Summary
Modifier and Type Method Description PlBeliefSet
parseBeliefBase(java.io.Reader reader)
Parses the given reader into a belief base of the given type.PlFormula
parseFormula(java.io.Reader reader)
Parses the given reader into a formula of the given type.-
Methods inherited from class net.sf.tweety.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormula, parseFormulaFromFile
-
-
-
-
Method Detail
-
parseBeliefBase
public PlBeliefSet parseBeliefBase(java.io.Reader reader) throws ParserException
Description copied from class:Parser
Parses the given reader into a belief base of the given type.- Specified by:
parseBeliefBase
in classParser<PlBeliefSet,PlFormula>
- Parameters:
reader
- a reader- Returns:
- a belief base
- Throws:
ParserException
- some parsing exceptions may be added here.
-
parseFormula
public PlFormula parseFormula(java.io.Reader reader) throws ParserException
Description copied from class:Parser
Parses the given reader into a formula of the given type.- Specified by:
parseFormula
in classParser<PlBeliefSet,PlFormula>
- Parameters:
reader
- a reader- Returns:
- a formula
- Throws:
ParserException
- some parsing exceptions may be added here.
-
-