Class AspicParser<T extends Invertable>
java.lang.Object
org.tweetyproject.commons.Parser<AspicArgumentationTheory<T>,Formula>
org.tweetyproject.arg.aspic.parser.AspicParser<T>
- Type Parameters:
T
- is the type of the language that the ASPIC theory's rules range over
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>
<order> ::= <identifier> ( '<' <identifier> )+
<ordinary premise> ::= '=>' '-'? <identifier>
<axiom> ::= '->' '-'? <identifier>
<defeasible rule> ::= ( <identifier> ':' )? <identifier> ( ',' <identifier> )* '=>' (-)? <identifier>
<static rule> ::= <identifier> ( ',' <identifier> )* '->' (-)? <identifier>
- Author:
- Nils Geilen
-
Constructor Summary
ConstructorDescriptionAspicParser
(Parser<? extends BeliefBase, ? extends Formula> formulaparser, RuleFormulaGenerator<T> rfg) Constructs a new instance -
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.parseSimpleOrder
(String line) Extracts and Constructs aSimpleAspicOrder
out of a stringvoid
setSymbolComma
(String symbolComma) Sets a new symbol used for parsing parameter separatorsvoid
setSymbolDefeasible
(String symbolDefeasible) Sets a new symbol used for parsing defeasible function arrowsvoid
setSymbolStrict
(String symbolStrict) Sets a new symbol used for parsing strict function arrowsMethods inherited from class org.tweetyproject.commons.Parser
isNumeric, parseBeliefBase, parseBeliefBaseFromFile, parseFormula, parseFormulaFromFile, parseListOfBeliefBases, parseListOfBeliefBases, parseListOfBeliefBasesFromFile, parseListOfBeliefBasesFromFile
-
Constructor Details
-
AspicParser
public AspicParser(Parser<? extends BeliefBase, ? extends 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 Details
-
setSymbolStrict
Sets a new symbol used for parsing strict function arrows- Parameters:
symbolStrict
- is the new symbol
-
setSymbolDefeasible
Sets a new symbol used for parsing defeasible function arrows- Parameters:
symbolDefeasible
- is the new symbol
-
setSymbolComma
Sets a new symbol used for parsing parameter separators- Parameters:
symbolComma
- is the new symbol
-
parseBeliefBase
public AspicArgumentationTheory<T> parseBeliefBase(Reader reader) throws IOException, ParserException Description copied from class:Parser
Parses the given reader into a belief base of the given type.- Specified by:
parseBeliefBase
in classParser<AspicArgumentationTheory<T extends Invertable>,
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<AspicArgumentationTheory<T extends Invertable>,
Formula> - Parameters:
reader
- a reader- Returns:
- a formula
- Throws:
IOException
- if some IO issue occurred.ParserException
- some parsing exceptions may be added here.
-
parseSimpleOrder
Extracts and Constructs aSimpleAspicOrder
out of a string- Parameters:
line
- the source string- Returns:
- the parsed order
-