Package net.sf.tweety.arg.adf.parser
Class KPPADFFormatParser
- java.lang.Object
-
- net.sf.tweety.commons.Parser<AbstractDialecticalFramework,Formula>
-
- net.sf.tweety.arg.adf.parser.KPPADFFormatParser
-
public class KPPADFFormatParser extends Parser<AbstractDialecticalFramework,Formula>
A parser for the input format described at https://www.cs.helsinki.fi/group/coreo/k++adf/ Since the input format is only described informally, we assume that each argument has to be defined before it can be used in some way, e.g. 's(a). ac(a,c(v)).' is a valid input but 'ac(a,c(v)). s(a).' is not. This assumption makes error handling and reporting much easier. However, this also means that the order of the input statements matter and we are thus not fully declarative.- Author:
- Mathias Hofer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
KPPADFFormatParser.ACNode
private class
KPPADFFormatParser.AndNode
private class
KPPADFFormatParser.BinaryNode
private class
KPPADFFormatParser.CNode
private class
KPPADFFormatParser.IdentifierNode
private class
KPPADFFormatParser.IffNode
private class
KPPADFFormatParser.ImpNode
private class
KPPADFFormatParser.NegNode
private class
KPPADFFormatParser.Node
Represents a node of the parse-tree.private class
KPPADFFormatParser.OrNode
private class
KPPADFFormatParser.SNode
private class
KPPADFFormatParser.UnaryNode
private class
KPPADFFormatParser.XorNode
-
Field Summary
Fields Modifier and Type Field Description private static int
BUFFER_CAPACITY
-
Constructor Summary
Constructors Constructor Description KPPADFFormatParser()
-
Method Summary
Modifier and Type Method Description AbstractDialecticalFramework
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.-
Methods inherited from class net.sf.tweety.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormula, parseFormulaFromFile
-
-
-
-
Field Detail
-
BUFFER_CAPACITY
private static final int BUFFER_CAPACITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
parseBeliefBase
public AbstractDialecticalFramework 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<AbstractDialecticalFramework,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<AbstractDialecticalFramework,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.
-
-