Class 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 justifications
      private java.lang.String DIV_COLON
      tokens for parsing defaults
      private java.lang.String DIV_COMMA
      tokens for parsing defaults
      private java.lang.String DIV_SLASH
      tokens for parsing defaults
      private FolParser folparser
      parser to parse knowledge base
      private java.util.regex.Pattern JUS_SPLIT
      regexes for parsing a default and the justifications
    • Constructor Summary

      Constructors 
      Constructor Description
      RdlParser()  
    • 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
    • Constructor Detail

      • RdlParser

        public RdlParser()
    • 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 class Parser<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 class Parser<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.