Package net.sf.tweety.logics.rdl.parser
Class RdlParser
- java.lang.Object
-
- net.sf.tweety.commons.Parser<DefaultTheory,Formula>
-
- net.sf.tweety.logics.rdl.parser.RdlParser
-
public class RdlParser extends Parser<DefaultTheory,Formula>
This class implements a parser for default logic.- Author:
- Nils Geilen
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.regex.Pattern
DEFAULT_SPLIT
regexes for parsing a default and the justificationsprivate java.lang.String
DIV_COLON
tokens for parsing defaultsprivate java.lang.String
DIV_COMMA
tokens for parsing defaultsprivate java.lang.String
DIV_SLASH
tokens for parsing defaultsprivate FolParser
folparser
parser to parse knowledge baseprivate java.util.regex.Pattern
JUS_SPLIT
regexes for parsing a default and the justifications
-
Constructor Summary
Constructors Constructor Description RdlParser()
-
Method Summary
Modifier and Type Method Description DefaultTheory
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
-
folparser
private FolParser folparser
parser to parse knowledge base
-
DIV_COLON
private final java.lang.String DIV_COLON
tokens for parsing defaults- See Also:
- Constant Field Values
-
DIV_COMMA
private final java.lang.String DIV_COMMA
tokens for parsing defaults- See Also:
- Constant Field Values
-
DIV_SLASH
private final java.lang.String DIV_SLASH
tokens for parsing defaults- See Also:
- Constant Field Values
-
JUS_SPLIT
private final java.util.regex.Pattern JUS_SPLIT
regexes for parsing a default and the justifications
-
DEFAULT_SPLIT
private final java.util.regex.Pattern DEFAULT_SPLIT
regexes for parsing a default and the justifications
-
-
Method Detail
-
parseBeliefBase
public DefaultTheory 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<DefaultTheory,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<DefaultTheory,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.
-
-