public final class IlrTranslationContext
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
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.
| Modifier and Type | Field and Description |
|---|---|
static int |
ACTIONS_PART
Constant to be used in
setCurrentRulePart(int) to indicate the new current rule part
to be the actions part. |
static int |
CONDITIONS_PART
Constant to be used in
setCurrentRulePart(int) to indicate the new current rule part
to be the conditions part. |
static int |
ELSE_ACTIONS_PART
Constant to be used in
setCurrentRulePart(int) to indicate the new current rule part
to be the else-actions part. |
| Modifier and Type | Method and Description |
|---|---|
int |
getCurrentRulePart()
Returns the current rule part.
|
IlrStatement |
getCurrentStatementInRule()
Deprecated.
use getIntermediateForm()
|
IlrIntermediateForm |
getIntermediateForm()
Returns the instance of
IlrIntermediateForm. |
IlrRuleStatement |
getRuleStatement()
Returns the current rule statement.
|
IlrBRLTranslator |
getTranslator()
Returns the instance of
IlrBRLTranslator. |
IlrVocabulary |
getVocabulary()
Returns the instance of
IlrVocabulary. |
boolean |
isInActions()
Tests if the current rule part is the actions part.
|
boolean |
isInConditions()
Tests if the current rule part is the conditions part.
|
boolean |
isInElseActions()
Tests if the current rule part is the else-actions part.
|
IlrStatement |
processNode(IlrSyntaxTree.Node node)
Forward the processing of nodes to the specified
node. |
void |
setCurrentRulePart(int rulePart)
Sets the current rule part.
|
void |
setCurrentRuleStatement(IlrRuleStatement rule)
Specifies the current rule statement being processed.
|
void |
setCurrentStatementInRule(IlrStatement currentStatementInRule)
Deprecated.
|
public static final int CONDITIONS_PART
setCurrentRulePart(int) to indicate the new current rule part
to be the conditions part.public static final int ACTIONS_PART
setCurrentRulePart(int) to indicate the new current rule part
to be the actions part.public static final int ELSE_ACTIONS_PART
setCurrentRulePart(int) to indicate the new current rule part
to be the else-actions part.public IlrStatement getCurrentStatementInRule()
public void setCurrentStatementInRule(IlrStatement currentStatementInRule)
currentStatementInRule - The current statement in the rule statement.public IlrBRLTranslator getTranslator()
IlrBRLTranslator.IlrBRLTranslator.public IlrIntermediateForm getIntermediateForm()
IlrIntermediateForm.IlrIntermediateForm.public IlrVocabulary getVocabulary()
IlrVocabulary.IlrVocabulary.public void setCurrentRuleStatement(IlrRuleStatement rule)
rule - The rule statement.public IlrRuleStatement getRuleStatement()
public int getCurrentRulePart()
public void setCurrentRulePart(int rulePart)
rulePart - The current rule part.public boolean isInConditions()
true if the current rule part is the conditions part.public boolean isInActions()
true if the current rule part is the actions part.public boolean isInElseActions()
true if the current rule part is the else-actions part.public IlrStatement processNode(IlrSyntaxTree.Node node)
node.node - The node.© Copyright IBM Corp. 1987, 2017