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.PatternDEFAULT_SPLITregexes for parsing a default and the justificationsprivate java.lang.StringDIV_COLONtokens for parsing defaultsprivate java.lang.StringDIV_COMMAtokens for parsing defaultsprivate java.lang.StringDIV_SLASHtokens for parsing defaultsprivate FolParserfolparserparser to parse knowledge baseprivate java.util.regex.PatternJUS_SPLITregexes for parsing a default and the justifications
-
Constructor Summary
Constructors Constructor Description RdlParser()
-
Method Summary
Modifier and Type Method Description DefaultTheoryparseBeliefBase(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
-
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:ParserParses the given reader into a belief base of the given type.- Specified by:
parseBeliefBasein 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:ParserParses the given reader into a formula of the given type.- Specified by:
parseFormulain 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.
-
-