Class FormulaParser

    • Constructor Detail

      • FormulaParser

        protected FormulaParser​(org.logicng.formulas.FormulaFactory f)
        Constructor.
        Parameters:
        f - the formula factory
    • Method Detail

      • setLexerAndParser

        protected void setLexerAndParser​(org.antlr.v4.runtime.Lexer lexer,
                                         ParserWithFormula parser)
        Sets the internal lexer and the parser.
        Parameters:
        lexer - the lexer
        parser - the parser
      • parse

        public org.logicng.formulas.Formula parse​(InputStream inputStream)
                                           throws ParserException
        Parses and returns a given input stream.
        Parameters:
        inputStream - an input stream
        Returns:
        the Formula representation of this stream
        Throws:
        ParserException - if there was a problem with the input stream
      • parse

        public org.logicng.formulas.Formula parse​(String in)
                                           throws ParserException
        Parses and returns a given string.
        Parameters:
        in - a string
        Returns:
        the Formula representation of this string
        Throws:
        ParserException - if the string was not a valid formula
      • factory

        public org.logicng.formulas.FormulaFactory factory()
        Returns the factory of this parser.
        Returns:
        the factory of this parser