Class ParserWithFormula

  • Direct Known Subclasses:
    LogicNGPropositionalParser, LogicNGPseudoBooleanParser

    public abstract class ParserWithFormula
    extends org.antlr.v4.runtime.Parser
    Abstract super class for parsers which have a formula factory and return a formula.
    Since:
    1.4.0
    Version:
    1.4.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.antlr.v4.runtime.Parser

        org.antlr.v4.runtime.Parser.TraceListener, org.antlr.v4.runtime.Parser.TrimToSizeListener
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.logicng.formulas.FormulaFactory f  
      • Fields inherited from class org.antlr.v4.runtime.Parser

        _buildParseTrees, _ctx, _errHandler, _input, _parseListeners, _precedenceStack, _syntaxErrors, matchedEOF
      • Fields inherited from class org.antlr.v4.runtime.Recognizer

        _interp, EOF
    • Constructor Summary

      Constructors 
      Constructor Description
      ParserWithFormula​(org.antlr.v4.runtime.TokenStream input)
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract org.logicng.formulas.Formula getParsedFormula()
      Returns the parsed formula.
      void setFormulaFactory​(org.logicng.formulas.FormulaFactory f)
      Sets the LogicNG formula factory for this parser
      • Methods inherited from class org.antlr.v4.runtime.Parser

        addContextToParseTree, addParseListener, compileParseTreePattern, compileParseTreePattern, consume, createErrorNode, createTerminalNode, dumpDFA, dumpDFA, enterOuterAlt, enterRecursionRule, enterRecursionRule, enterRule, exitRule, getATNWithBypassAlts, getBuildParseTree, getContext, getCurrentToken, getDFAStrings, getErrorHandler, getExpectedTokens, getExpectedTokensWithinCurrentRule, getInputStream, getInvokingContext, getNumberOfSyntaxErrors, getParseInfo, getParseListeners, getPrecedence, getRuleContext, getRuleIndex, getRuleInvocationStack, getRuleInvocationStack, getSourceName, getTokenFactory, getTokenStream, getTrimParseTree, inContext, isExpectedToken, isMatchedEOF, isTrace, match, matchWildcard, notifyErrorListeners, notifyErrorListeners, precpred, pushNewRecursionContext, removeParseListener, removeParseListeners, reset, setBuildParseTree, setContext, setErrorHandler, setInputStream, setProfile, setTokenFactory, setTokenStream, setTrace, setTrimParseTree, triggerEnterRuleEvent, triggerExitRuleEvent, unrollRecursionContexts
      • Methods inherited from class org.antlr.v4.runtime.Recognizer

        action, addErrorListener, getATN, getErrorHeader, getErrorListenerDispatch, getErrorListeners, getGrammarFileName, getInterpreter, getRuleIndexMap, getRuleNames, getSerializedATN, getState, getTokenErrorDisplay, getTokenNames, getTokenType, getTokenTypeMap, getVocabulary, removeErrorListener, removeErrorListeners, sempred, setInterpreter, setState
    • Field Detail

      • f

        protected org.logicng.formulas.FormulaFactory f
    • Constructor Detail

      • ParserWithFormula

        public ParserWithFormula​(org.antlr.v4.runtime.TokenStream input)
        Constructor.
        Parameters:
        input - the token stream (e.g. a lexer) for the parser
    • Method Detail

      • setFormulaFactory

        public void setFormulaFactory​(org.logicng.formulas.FormulaFactory f)
        Sets the LogicNG formula factory for this parser
        Parameters:
        f - the LogicNG formula factory
      • getParsedFormula

        public abstract org.logicng.formulas.Formula getParsedFormula()
        Returns the parsed formula.
        Returns:
        the parsed formula