Package net.sf.tweety.arg.aspic.parser
Class AspicParser<T extends net.sf.tweety.logics.commons.syntax.interfaces.Invertable>
- java.lang.Object
-
- net.sf.tweety.commons.Parser<AspicArgumentationTheory<T>,net.sf.tweety.commons.Formula>
-
- net.sf.tweety.arg.aspic.parser.AspicParser<T>
-
- Type Parameters:
T- is the type of the language that the ASPIC theory's rules range over
public class AspicParser<T extends net.sf.tweety.logics.commons.syntax.interfaces.Invertable> extends net.sf.tweety.commons.Parser<AspicArgumentationTheory<T>,net.sf.tweety.commons.Formula>
Parses a Aspic Argumentation System out of an input text. Every line contains one of the following:
<order> ::= <identifier> ( '<' <identifier> )+
<ordinary premise> ::= '=>' '-'? <identifier>
<axiom> ::= '->' '-'? <identifier>
<defeasible rule> ::= ( <identifier> ':' )? <identifier> ( ',' <identifier> )* '=>' (-)? <identifier>
<static rule> ::= <identifier> ( ',' <identifier> )* '->' (-)? <identifier>- Author:
- Nils Geilen
-
-
Constructor Summary
Constructors Constructor Description AspicParser(net.sf.tweety.commons.Parser<? extends net.sf.tweety.commons.BeliefBase,? extends net.sf.tweety.commons.Formula> formulaparser, RuleFormulaGenerator<T> rfg)Constructs a new instance
-
Method Summary
Modifier and Type Method Description AspicArgumentationTheory<T>parseBeliefBase(Reader reader)net.sf.tweety.commons.FormulaparseFormula(Reader reader)SimpleAspicOrder<T>parseSimpleOrder(String line)Extracts and Constructs aSimpleAspicOrderout of a stringvoidsetSymbolComma(String symbolComma)Sets a new symbol used for parsing parameter separatorsvoidsetSymbolDefeasible(String symbolDefeasible)Sets a new symbol used for parsing defeasible function arrowsvoidsetSymbolStrict(String symbolStrict)Sets a new symbol used for parsing strict function arrows
-
-
-
Constructor Detail
-
AspicParser
public AspicParser(net.sf.tweety.commons.Parser<? extends net.sf.tweety.commons.BeliefBase,? extends net.sf.tweety.commons.Formula> formulaparser, RuleFormulaGenerator<T> rfg)Constructs a new instance- Parameters:
formulaparser- parses the bodies and the heads of the ASPIC argumentation systems rulesrfg- a generator, that transforms InferenceRule<T> into T
-
-
Method Detail
-
setSymbolStrict
public void setSymbolStrict(String symbolStrict)
Sets a new symbol used for parsing strict function arrows- Parameters:
symbolStrict- is the new symbol
-
setSymbolDefeasible
public void setSymbolDefeasible(String symbolDefeasible)
Sets a new symbol used for parsing defeasible function arrows- Parameters:
symbolDefeasible- is the new symbol
-
setSymbolComma
public void setSymbolComma(String symbolComma)
Sets a new symbol used for parsing parameter separators- Parameters:
symbolComma- is the new symbol
-
parseBeliefBase
public AspicArgumentationTheory<T> parseBeliefBase(Reader reader) throws IOException, net.sf.tweety.commons.ParserException
- Specified by:
parseBeliefBasein classnet.sf.tweety.commons.Parser<AspicArgumentationTheory<T extends net.sf.tweety.logics.commons.syntax.interfaces.Invertable>,net.sf.tweety.commons.Formula>- Throws:
IOExceptionnet.sf.tweety.commons.ParserException
-
parseFormula
public net.sf.tweety.commons.Formula parseFormula(Reader reader) throws IOException, net.sf.tweety.commons.ParserException
- Specified by:
parseFormulain classnet.sf.tweety.commons.Parser<AspicArgumentationTheory<T extends net.sf.tweety.logics.commons.syntax.interfaces.Invertable>,net.sf.tweety.commons.Formula>- Throws:
IOExceptionnet.sf.tweety.commons.ParserException
-
parseSimpleOrder
public SimpleAspicOrder<T> parseSimpleOrder(String line)
Extracts and Constructs aSimpleAspicOrderout of a string- Parameters:
line- the source string- Returns:
- the parsed order
-
-