ilog.rules.brl.semantic

Interface IlrBRLSemanticFilter

  • All Known Implementing Classes:
    IlrBRL.ValueFilter, IlrBRLSemanticFilterAdapter


    public interface IlrBRLSemanticFilter
    The filter to apply when a prediction is required.

    For example, this is used when a rule is being edited in the text or the guided editor. Semantic filters are associated to the node type of the business rule language definition in the concrete syntax .properties file, with the property semanticFilter. Semantic filters can also be associated to the role of a sentence (parameter of a BOM method or a BOM attribute) in the BOM file, with the property semanticFilter[<argument_index>] for an argument of a method or semanticFilter for an attribute.

    • Method Detail

      • acceptValue

        boolean acceptValue(IlrBRLSemanticContext context,
                          IlrSyntaxTree.Node node,
                          IlrConcept concept)
        States if any value of the given concept is accepted. This method is invoked when a value can be predicted. If a Value Provider is associated to this prediction context, it will be invoked only if this filter answers true in this method.
        Parameters:
        context - The associated semantic context.
        node - The node under which a value can be added.
        concept - The concept representing the predicted value.
        Returns:
        true if a value is accepted, false otherwise.
      • acceptConceptInstance

        boolean acceptConceptInstance(IlrBRLSemanticContext context,
                                    IlrSyntaxTree.Node node,
                                    IlrConceptInstance conceptInstance)
        States if a concept instance is accepted. This method is invoked when a concept instance can be predicted.
        Parameters:
        context - The associated semantic context.
        node - The node under which a concept instance can be added.
        conceptInstance - The predicted concept instance.
        Returns:
        true if the concept instance is accepted, false otherwise.
      • acceptSentence

        boolean acceptSentence(IlrBRLSemanticContext context,
                             IlrSyntaxTree.Node node,
                             IlrSentence sentence)
        States if a sentence is accepted. This method is invoked when a sentence can be predict.
        Parameters:
        context - The associated semantic context.
        node - The node under which a sentence can be added.
        sentence - The predicted sentence.
        Returns:
        true if the sentence is accepted, false otherwise.
      • acceptConcept

        boolean acceptConcept(IlrBRLSemanticContext context,
                            IlrSyntaxTree.Node node,
                            IlrConcept concept)
        States if a concept is accepted. This method is invoked when a concept can be predict.
        Parameters:
        context - The associated semantic context.
        node - The node under which a concept can be added.
        concept - The predicted concept.
        Returns:
        true if the concept is accepted, false otherwise.
      • acceptVariable

        boolean acceptVariable(IlrBRLSemanticContext context,
                             IlrSyntaxTree.Node node,
                             IlrBRLVariable variable)
        States if a variable is accepted. This method is invoked when a variable can be predict.
        Parameters:
        context - The associated semantic context.
        node - The node under which a variable can be added.
        variable - The predicted variable.
        Returns:
        true if the variable is accepted, false otherwise.
        See Also:
        IlrBRLVariable
      • acceptExpression

        boolean acceptExpression(IlrBRLSemanticContext context,
                               IlrSyntaxTree.Node node,
                               IlrBRLGrammar.Node expression)
        This method is invoked when an expression (grammar construction) can be predicted.
        Parameters:
        context - The associated semantic context.
        node - The node under which an expression can be added.
        expression - The predicted expression.
        Returns:
        true if the expression is accepted, false otherwise.

© Copyright IBM Corp. 1987, 2017