Module logicng

Class FormulaParser

    • Constructor Detail

      • FormulaParser

        protected FormulaParser​(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 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
      • factory

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