Class CParser
- java.lang.Object
-
- net.sf.tweety.commons.Parser<CActionDescription,Formula>
-
- net.sf.tweety.action.description.parser.CParser
-
public class CParser extends Parser<CActionDescription,Formula>
This class implements a parser for an Action Description in C. The BNF is given by: (starting symbol is DESC)
DESC ::== ":- signature" "\n" SIGNATURE "\n" ":- laws" "\n" LAWS
where SIGNATURE is parsed by CSignatureParser and LAWS is parsed by CLawParser.- Author:
- Sebastian Homann
-
-
Constructor Summary
Constructors Constructor Description CParser()
-
Method Summary
Modifier and Type Method Description ActionSignature
getSignature()
CActionDescription
parseBeliefBase(java.io.Reader reader)
Parses the given reader into a belief base of the given type.Formula
parseFormula(java.io.Reader reader)
Parses the given reader into a formula of the given type.Formula
parseFormula(java.lang.String formula)
Parses the given text into a formula of the given type.void
setSignature(ActionSignature signature)
-
Methods inherited from class net.sf.tweety.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormulaFromFile
-
-
-
-
Method Detail
-
parseBeliefBase
public CActionDescription 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<CActionDescription,Formula>
- 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 Formula 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<CActionDescription,Formula>
- Parameters:
reader
- a reader- Returns:
- a formula
- Throws:
java.io.IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
parseFormula
public Formula parseFormula(java.lang.String formula) throws ParserException, java.io.IOException
Description copied from class:Parser
Parses the given text into a formula of the given type.- Overrides:
parseFormula
in classParser<CActionDescription,Formula>
- Parameters:
formula
- a string- Returns:
- a formula
- Throws:
ParserException
- some parsing exceptions may be added here.java.io.IOException
- if some IO issue occurred.
-
setSignature
public void setSignature(ActionSignature signature)
-
getSignature
public ActionSignature getSignature()
-
-