ilog.rules.brl.semantic

Class IlrBRLSemanticContext

  • java.lang.Object
    • ilog.rules.brl.semantic.IlrBRLSemanticContext
  • All Implemented Interfaces:
    ilog.rules.brl.brldf.IlrGrammarConstants


    public class IlrBRLSemanticContext
    extends java.lang.Object
    implements ilog.rules.brl.brldf.IlrGrammarConstants
    Represents the semantic context associated with a business rule language parser.

    A business rule language semantic context is associated with a vocabulary and a business rule language definition.

    See Also:
    IlrVocabulary, IlrBRLDefinition
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void addSemanticError(java.lang.Object reporter, java.lang.Object target, java.lang.String id, java.lang.Object[] args)
      Adds a semantic error on a syntax node.
      void addSemanticError(java.lang.Object reporter, java.lang.Object target, java.lang.String id, java.lang.Object[] args, java.lang.Object[] fixArgs)
      Adds a semantic error on a syntax node, and sets the Quick Fix facility parameters.
      IlrBRLMarker createMarker(java.lang.String id, int offset, int length, java.lang.Object[] args)
      Creates a marker that can report errors or warnings.
      IlrBRLMarker createMarker(java.lang.String id, int offset, int length, java.lang.Object[] args, java.lang.Object[] fixArgs)
      Creates a marker that can report errors or warnings, and sets the Quick Fix facility parameters.
      IlrBRLVariable declareAssignableVariable(java.lang.String name, IlrConcept type, IlrCardinality cardinality, int offset, int availabilityOffset)
      Declares an assignable variable in the current scope.
      void disableCategoryFiltering()
      Disables the filtering based on categories.
      static java.util.Set getAnyCategoryFilter()
      Setting the category filter to this value is equivalent to disabling category filtering
      IlrBRLDefinition getDefinition()
      Returns the business rule language definition associated with the semantic context.
      IlrBRLSemanticContextExtension getExtension()
      Returns the semantic context language extension associated with the semantic context.
      IlrBRLVariable getVariable(IlrSyntaxTree.Node node, java.lang.String name)
      Returns the variable named as the given argument name, or null if no variable is found.
      IlrBRLVariableProvider getVariableProvider()
      Returns the variable provider associated with the semantic context, if any.
      IlrVocabulary getVocabulary()
      Returns the vocabulary associated to the semantic context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getVocabulary

        public IlrVocabulary getVocabulary()
        Returns the vocabulary associated to the semantic context.
        Returns:
        The vocabulary associated to the semantic context.
      • getDefinition

        public IlrBRLDefinition getDefinition()
        Returns the business rule language definition associated with the semantic context.
        Returns:
        The business rule language definition associated with the semantic context
      • getExtension

        public IlrBRLSemanticContextExtension getExtension()
        Returns the semantic context language extension associated with the semantic context. The semantic context extension is declared in the business rule language definition with the property semanticContextExtension.
        Returns:
        The semantic context extension.
        See Also:
        IlrBRLSemanticContextExtension
      • createMarker

        public IlrBRLMarker createMarker(java.lang.String id,
                                int offset,
                                int length,
                                java.lang.Object[] args)
        Creates a marker that can report errors or warnings.
        Parameters:
        id - The ID of the marker to create.
        offset - The offset in the text referenced by the marker.
        length - The length in the text referenced by the marker.
        args - The arguments associated to the marker message.
        Returns:
        A new business rule language marker.
        See Also:
        IlrBRLMarker
      • createMarker

        public IlrBRLMarker createMarker(java.lang.String id,
                                int offset,
                                int length,
                                java.lang.Object[] args,
                                java.lang.Object[] fixArgs)
        Creates a marker that can report errors or warnings, and sets the Quick Fix facility parameters.
        Parameters:
        id - The ID of the marker to create.
        offset - The offset in the text referenced by the marker.
        length - The length in the text referenced by the marker.
        args - The arguments associated to the marker message.
        fixArgs - The arguments associated to the marker fix processor.
        Returns:
        A new business rule language marker.
        See Also:
        IlrBRLMarker
      • getVariableProvider

        public IlrBRLVariableProvider getVariableProvider()
        Returns the variable provider associated with the semantic context, if any.
        Returns:
        The variable provider associated with the semantic context.
      • getAnyCategoryFilter

        public static java.util.Set getAnyCategoryFilter()
        Setting the category filter to this value is equivalent to disabling category filtering
        Returns:
        the category filter "any".
      • disableCategoryFiltering

        public void disableCategoryFiltering()
        Disables the filtering based on categories. It is equivalent to setting the any category filter.
      • addSemanticError

        public void addSemanticError(java.lang.Object reporter,
                            java.lang.Object target,
                            java.lang.String id,
                            java.lang.Object[] args)
        Adds a semantic error on a syntax node.
        Parameters:
        reporter - The node from which the error is reported.
        target - The node on which the error is reported.
        id - The ID of the error marker.
        args - The argument for the error message.
        See Also:
        IlrSyntaxTree.Node, IlrBRLMarker
      • addSemanticError

        public void addSemanticError(java.lang.Object reporter,
                            java.lang.Object target,
                            java.lang.String id,
                            java.lang.Object[] args,
                            java.lang.Object[] fixArgs)
        Adds a semantic error on a syntax node, and sets the Quick Fix facility parameters.
        Parameters:
        reporter - The node from which the error is reported.
        target - The node on which the error is reported.
        id - The ID of the error marker.
        args - The arguments for the error message.
        fixArgs - The arguments for the quick fix processor.
        See Also:
        IlrSyntaxTree.Node, IlrBRLMarker
      • declareAssignableVariable

        public IlrBRLVariable declareAssignableVariable(java.lang.String name,
                                               IlrConcept type,
                                               IlrCardinality cardinality,
                                               int offset,
                                               int availabilityOffset)
        Declares an assignable variable in the current scope.
        Parameters:
        name - The name of the new variable.
        type - The concept of the new variable.
        cardinality - The cardinality of the new variable.
        offset - The offset of the variable declaration.
        availabilityOffset - The offset from where the variable can be referenced.
        Returns:
        The new declared variable.
      • getVariable

        public IlrBRLVariable getVariable(IlrSyntaxTree.Node node,
                                 java.lang.String name)
        Returns the variable named as the given argument name, or null if no variable is found. The variable is looked up from a specific node. The call to this method is only valid during the application of semantic actions and semantic filters.
        Parameters:
        node - The node from which the variable is looked up.
        name - The name of the variable to find.
        Returns:
        The variable named name, or null if no variable is found.
        See Also:
        IlrBRLVariable

© Copyright IBM Corp. 1987, 2017