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
-
-
Constructor Summary
Constructors Constructor Description KppADFFormatParser(LinkStrategy linkStrategy, boolean lazy)
-
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
-
-
-
-
Constructor Detail
-
KppADFFormatParser
public KppADFFormatParser(LinkStrategy linkStrategy, boolean lazy)
- Parameters:
linkStrategy
- the strategy which is used to compute the linkslazy
- specifies if the link computation should be done lazily
-
-
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.
-
-