ILOG JRules

ilog.rules.brl.bal60
Class IlrBALRuleNodeTranslator

java.lang.Object
  extended by ilog.rules.brl.bal60.IlrBALRuleNodeTranslator
All Implemented Interfaces:
IlrNodeTranslator

public class IlrBALRuleNodeTranslator
extends Object
implements IlrNodeTranslator

Root node translator for the Business Action Language. This node translator is attached to the node of type T-rule in BAL.properties. This class may be subclassed to redefine the following methods :

to customize the default behavior of BAL translation.


Constructor Summary
IlrBALRuleNodeTranslator()
           
 
Method Summary
protected  void postProcessRule(IlrSyntaxTree.Node node, IlrTranslationContext context)
          Postprocesses the produced intermediate form.
 IlrStatement process(IlrSyntaxTree.Node node, IlrTranslationContext context)
          Processes the specified node.
protected  void processAction(IlrSyntaxTree.Node actionNode, IlrTranslationContext context)
          Processes the node node to add the corresponding action or else action.
protected  void processActions(IlrSyntaxTree.Node node, IlrTranslationContext context)
          Processes the node to add all necessary actions to the rule statement.
protected  void processBinding(IlrSyntaxTree.Node node, IlrTranslationContext context)
          Processes the node node to add the corresponding binding.
protected  void processBindings(IlrSyntaxTree.Node node, IlrTranslationContext context)
          Processes the node to add all necessary bindings to the rule statement.
protected  void processConditions(IlrSyntaxTree.Node node, IlrTranslationContext context)
          Processes the node to add an instance of IlrEvaluateStatement to the rule statement, corresponding to the tests of the business rule.
protected  void processElseActions(IlrSyntaxTree.Node node, IlrTranslationContext context)
          Processes the node to add all necessary else actions to the rule statement.
protected  void processRule(IlrSyntaxTree.Node node, IlrTranslationContext context)
          Processes the node to create an instance of IlrRuleStatement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrBALRuleNodeTranslator

public IlrBALRuleNodeTranslator()
Method Detail

process

public IlrStatement process(IlrSyntaxTree.Node node,
                            IlrTranslationContext context)
Processes the specified node. This methods calls sequentially: Note: The behavior implemented by this method is generic. It should not be overriden, unless you have good reasons to do so.

Specified by:
process in interface IlrNodeTranslator
Parameters:
node - The node to process.
context - the translation context.

processRule

protected void processRule(IlrSyntaxTree.Node node,
                           IlrTranslationContext context)
Processes the node to create an instance of IlrRuleStatement.

Parameters:
node - The syntax tree node.
context - The translation context.

processBindings

protected void processBindings(IlrSyntaxTree.Node node,
                               IlrTranslationContext context)
Processes the node to add all necessary bindings to the rule statement.

Parameters:
node - The syntax tree node.
context - The translation context.

processBinding

protected void processBinding(IlrSyntaxTree.Node node,
                              IlrTranslationContext context)
Processes the node node to add the corresponding binding.

Parameters:
node - The node.
context - The translation context.

processConditions

protected void processConditions(IlrSyntaxTree.Node node,
                                 IlrTranslationContext context)
Processes the node to add an instance of IlrEvaluateStatement to the rule statement, corresponding to the tests of the business rule.

Parameters:
node - The syntax tree node.
context - The translation context.

processActions

protected void processActions(IlrSyntaxTree.Node node,
                              IlrTranslationContext context)
Processes the node to add all necessary actions to the rule statement. It actually calls processAction(IlrSyntaxTree.Node, IlrTranslationContext) on all subnodes.

Parameters:
node - The syntax tree node.
context - The translation context.

processAction

protected void processAction(IlrSyntaxTree.Node actionNode,
                             IlrTranslationContext context)
Processes the node node to add the corresponding action or else action.

Parameters:
actionNode - The action node.
context - The translation context.

processElseActions

protected void processElseActions(IlrSyntaxTree.Node node,
                                  IlrTranslationContext context)
Processes the node to add all necessary else actions to the rule statement.

Parameters:
node - The syntax tree node.
context - The translation context.

postProcessRule

protected void postProcessRule(IlrSyntaxTree.Node node,
                               IlrTranslationContext context)
Postprocesses the produced intermediate form. When this method is called, the intermediate form is in its final state and is ready to be transfered to the code generator.

Parameters:
node - The syntax tree node.
context - The translation context.

ILOG JRules