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
-
-
Field Summary
Fields Modifier and Type Field Description protected ActionSignaturesignature
-
Constructor Summary
Constructors Constructor Description CParser()
-
Method Summary
Modifier and Type Method Description ActionSignaturegetSignature()CActionDescriptionparseBeliefBase(java.io.Reader reader)Parses the given reader into a belief base of the given type.FormulaparseFormula(java.io.Reader reader)Parses the given reader into a formula of the given type.FormulaparseFormula(java.lang.String formula)Parses the given text into a formula of the given type.voidsetSignature(ActionSignature signature)-
Methods inherited from class net.sf.tweety.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormulaFromFile
-
-
-
-
Field Detail
-
signature
protected ActionSignature signature
-
-
Method Detail
-
parseBeliefBase
public CActionDescription parseBeliefBase(java.io.Reader reader) throws java.io.IOException, ParserException
Description copied from class:ParserParses the given reader into a belief base of the given type.- Specified by:
parseBeliefBasein 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:ParserParses the given reader into a formula of the given type.- Specified by:
parseFormulain 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:ParserParses the given text into a formula of the given type.- Overrides:
parseFormulain 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()
-
-