Package net.sf.tweety.logics.cl.parser
Class ClParser
- java.lang.Object
-
- net.sf.tweety.commons.Parser<ClBeliefSet,Conditional>
-
- net.sf.tweety.logics.cl.parser.ClParser
-
public class ClParser extends Parser<ClBeliefSet,Conditional>
This class implements a parser for conditional logic. The BNF for a conditional knowledge base is given by (starting symbol is KB)
KB ::== CONDITIONAL ( "\n" CONDITIONAL )*
CONDITIONAL ::== "(" FORMULA ")" | "(" FORMULA "|" FORMULA ")"
FORMULA is a propositional formula (@see net.sf.tweety.kr.l.parser.PlParser).- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description ClParser()
-
Method Summary
Modifier and Type Method Description ClBeliefSet
parseBeliefBase(java.io.Reader reader)
Parses the given reader into a belief base of the given type.Conditional
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 ClBeliefSet parseBeliefBase(java.io.Reader reader) throws java.io.IOException, ParserException
Description copied from class:Parser
Parses the given reader into a belief base of the given type.- Specified by:
parseBeliefBase
in classParser<ClBeliefSet,Conditional>
- Parameters:
reader
- a reader- Returns:
- a belief base
- Throws:
java.io.IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
parseFormula
public Conditional parseFormula(java.io.Reader reader) throws java.io.IOException, ParserException
Description copied from class:Parser
Parses the given reader into a formula of the given type.- Specified by:
parseFormula
in classParser<ClBeliefSet,Conditional>
- Parameters:
reader
- a reader- Returns:
- a formula
- Throws:
java.io.IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
-