Class CParser
- java.lang.Object
 - 
- org.tweetyproject.commons.Parser<CActionDescription,Formula>
 - 
- org.tweetyproject.action.description.parser.CParser
 
 
 
- 
public class CParser extends Parser<CActionDescription,Formula>
This class implements a parser for an Action Description in the Action Description Language C from [Gelfond, Michael and Lifschitz, Vladimir: Action Languages. ETAI: Electronic Transactions on AI, 1998.] 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 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 org.tweetyproject.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormulaFromFile, parseListOfBeliefBases, parseListOfBeliefBases, parseListOfBeliefBasesFromFile, parseListOfBeliefBasesFromFile 
 - 
 
 - 
 
- 
- 
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()
 
 - 
 
 -