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 classKppADFFormatParser.ACNodeprivate classKppADFFormatParser.AndNodeprivate classKppADFFormatParser.BinaryNodeprivate classKppADFFormatParser.CNodeprivate classKppADFFormatParser.IdentifierNodeprivate classKppADFFormatParser.IffNodeprivate classKppADFFormatParser.ImpNodeprivate classKppADFFormatParser.NegNodeprivate classKppADFFormatParser.NodeRepresents a node of the parse-tree.private classKppADFFormatParser.OrNodeprivate classKppADFFormatParser.SNodeprivate classKppADFFormatParser.UnaryNodeprivate classKppADFFormatParser.XorNode
-
Field Summary
Fields Modifier and Type Field Description private static intBUFFER_CAPACITY
-
Constructor Summary
Constructors Constructor Description KppADFFormatParser()
-
Method Summary
Modifier and Type Method Description AbstractDialecticalFrameworkparseBeliefBase(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.-
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:ParserParses the given reader into a belief base of the given type.- Specified by:
parseBeliefBasein 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:ParserParses the given reader into a formula of the given type.- Specified by:
parseFormulain 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.
-
-