Class ProductionRule

    • Constructor Detail

      • ProductionRule

        public ProductionRule()
    • Method Detail

      • setCondition

        public void setCondition​(Condition condition)
        Sets what must be true for this rule to be true
      • getCondition

        public Condition getCondition()
      • setProduction

        public void setProduction​(ProductionList production)
        Sets what is produced when this rule is true
      • matches

        public boolean matches​(RuleEvaluation e)
        Returns whether this rule matches the given query
      • matchReferences

        public java.util.Set<java.lang.String> matchReferences()
        Returns the set of context names the production of this rule references
        Returns:
        an unmodifiable Set of condition context name Strings
      • makeReferences

        public void makeReferences​(RuleBase rules)
      • produce

        public void produce​(RuleEvaluation e)
        Carries out the production of this rule
      • toString

        public java.lang.String toString()
        Returns the canonical string representation of this rule. This string representation can always be reparsed to produce an identical rule to this one.
        Overrides:
        toString in class java.lang.Object
      • getSymbol

        protected abstract java.lang.String getSymbol()
        Returns the symbol of this production rule. All rules are on the form condition symbol production.
      • isLoop

        public boolean isLoop()
        Returns true if it is known that this rule matches its own output. If it does, it will only be evaluated once, to avoid infinite loops. This default implementation returns false;