ilog.rules.brl.translation

Class IlrTranslationContext

  • java.lang.Object
    • ilog.rules.brl.translation.IlrTranslationContext
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable


    public final class IlrTranslationContext
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable
    This class defines a translation context.

    It is used in the first step of the translation process, and provides contextual informations on the translation. For example, it indicates if the condition part (isInConditions()), the action part (isInActions()()) or the else-action part (isInElseActions()) are being processed. It also provides references to the most important objects used when translating BRL rules: the IlrBRLTranslator instance, the IlrIntermediateForm instance, the IlrVocabulary instance, and so on. It also defines an important method: processNode(IlrSyntaxTree.Node), which must be called in implementations of IlrNodeTranslator to forward the processing of nodes to a specific node.

    See Also:
    Serialized Form
    • Method Detail

      • getCurrentStatementInRule

        public IlrStatement getCurrentStatementInRule()
        Deprecated. use getIntermediateForm()
        Returns the current statement in the rule statement.
        Returns:
        The current statement in the rule statement.
      • setCurrentStatementInRule

        public void setCurrentStatementInRule(IlrStatement currentStatementInRule)
        Deprecated. 
        Sets the current statement in the rule statement.
        Parameters:
        currentStatementInRule - The current statement in the rule statement.
      • getTranslator

        public IlrBRLTranslator getTranslator()
        Returns the instance of IlrBRLTranslator.
        Returns:
        The instance of IlrBRLTranslator.
      • getIntermediateForm

        public IlrIntermediateForm getIntermediateForm()
        Returns the instance of IlrIntermediateForm.
        Returns:
        The instance of IlrIntermediateForm.
      • getVocabulary

        public IlrVocabulary getVocabulary()
        Returns the instance of IlrVocabulary.
        Returns:
        The instance of IlrVocabulary.
      • setCurrentRuleStatement

        public void setCurrentRuleStatement(IlrRuleStatement rule)
        Specifies the current rule statement being processed. If the rule statement passed as argument is not already contained in the intermediate form, that it is added.
        Parameters:
        rule - The rule statement.
      • getRuleStatement

        public IlrRuleStatement getRuleStatement()
        Returns the current rule statement.
        Returns:
        The current rule statement.
      • getCurrentRulePart

        public int getCurrentRulePart()
        Returns the current rule part.
        Returns:
        The current rule part.
      • setCurrentRulePart

        public void setCurrentRulePart(int rulePart)
        Sets the current rule part.
        Parameters:
        rulePart - The current rule part.
      • isInConditions

        public boolean isInConditions()
        Tests if the current rule part is the conditions part.
        Returns:
        true if the current rule part is the conditions part.
      • isInActions

        public boolean isInActions()
        Tests if the current rule part is the actions part.
        Returns:
        true if the current rule part is the actions part.
      • isInElseActions

        public boolean isInElseActions()
        Tests if the current rule part is the else-actions part.
        Returns:
        true if the current rule part is the else-actions part.
      • processNode

        public IlrStatement processNode(IlrSyntaxTree.Node node)
        Forward the processing of nodes to the specified node.
        Parameters:
        node - The node.

© Copyright IBM Corp. 1987, 2017