Class CParser
java.lang.Object
org.tweetyproject.commons.Parser<CActionDescription,Formula>
org.tweetyproject.action.description.parser.CParser
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.
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 -
Method Summary
Modifier and TypeMethodDescriptionparseBeliefBase
(Reader reader) Parses the given reader into a belief base of the given type.parseFormula
(Reader reader) Parses the given reader into a formula of the given type.parseFormula
(String formula) Parses the given text into a formula of the given type.void
setSignature
(ActionSignature signature) Methods inherited from class org.tweetyproject.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormulaFromFile, parseListOfBeliefBases, parseListOfBeliefBases, parseListOfBeliefBasesFromFile, parseListOfBeliefBasesFromFile
-
Constructor Details
-
CParser
public CParser()
-
-
Method Details
-
parseBeliefBase
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:
IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
parseFormula
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:
IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
parseFormula
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.IOException
- if some IO issue occurred.
-
setSignature
-
getSignature
-