public class IlrDTIRLTranslator extends IlrDTTranslator
| Modifier and Type | Class and Description |
|---|---|
class |
IlrDTIRLTranslator.DTRowTranslatorInput
This class is the implementation of TranslatorInput used to translate a row of the DT.
|
controller| Constructor and Description |
|---|
IlrDTIRLTranslator(IlrDTController controller)
This constructor creates a new DT translator for the DT represented by the given controller.
|
IlrDTIRLTranslator(IlrDTController controller,
boolean useInEditor)
This constructor creates a new DT translator for the DT represented by the given controller.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
convertIntoCode(java.util.Collection errors)
This method converts the DT associated to this translator into IRL.
|
protected IlrBRLTranslator |
createTranslator()
This method creates a BRL Translator to be used to translate DT rows in IRL code
|
protected IlrTranslatorInput |
createTranslatorInput(IlrDTActionSet actionSet,
java.lang.String balCode,
int ruleIndex)
This method creates a Translator Input to be used by the BRL translator to convert the given row.
|
protected void |
generateBALComment(IlrDTActionSet as,
java.lang.String balCode)
This method generates the given balCode as a comment before the IRL translation
of the rule represented by the given action set
|
protected void |
generateBegin()
This method generates a header before generating the 1st rule of the DT
|
protected void |
generateEnd()
This method generates a footer after generating the last rule of the DT
|
boolean |
generateRule(IlrDTActionSet as,
int ruleIndex)
Deprecated.
|
protected void |
generateRuleBegin(IlrDTActionSet as,
int ruleIndex)
This method generates a header before generating the rule corresponding to the given action set.
|
protected void |
generateRuleEnd(IlrDTActionSet as,
int ruleIndex)
This method generates a footer after having generated the rule corresponding to the given action set.
|
protected java.lang.String |
getRuleName(IlrDTActionSet as,
int ruleIndex)
This method compute the name of the rule corresponding to the given action set
|
IlrBRLTranslator |
getTranslator()
This method returns the BRL translator used by this DT translator
|
void |
useBAL(boolean useBAL,
boolean generateComments)
This method allows specifying if this translator should generate IRL code from the BAL
representation of the rules and if the IRL code should contains comments with the BAL
representation of the rules.
|
boolean |
useInEditor()
Deprecated.
this method was supposed to be used by the implementation only
|
getControllerpublic IlrDTIRLTranslator(IlrDTController controller)
controller - public IlrDTIRLTranslator(IlrDTController controller, boolean useInEditor)
controller - useInEditor - if true, IRL representations of rules are cached to be re-used when
regenerating the code using this translator. This cache is invalidated according to changes on the
DT model.public IlrBRLTranslator getTranslator()
public boolean useInEditor()
public void useBAL(boolean useBAL,
boolean generateComments)
useBAL - specify if code generation should be deduced from BAL representation or notgenerateComments - true to generate comments in the IRL codepublic java.lang.String convertIntoCode(java.util.Collection errors)
convertIntoCode in class IlrDTTranslatorerrors - when not null, this collection is filled with code generation errorspublic boolean generateRule(IlrDTActionSet as, int ruleIndex) throws java.io.IOException
java.io.IOExceptionas - the action setruleIndex - the index of the rule in the generated DTprotected void generateBALComment(IlrDTActionSet as, java.lang.String balCode)
as - balCode - protected void generateBegin()
throws java.io.IOException
java.io.IOExceptionprotected void generateEnd()
throws java.io.IOException
java.io.IOExceptionprotected void generateRuleBegin(IlrDTActionSet as, int ruleIndex) throws java.io.IOException
java.io.IOExceptionas - the action setruleIndex - the index of the rule in the generated DTprotected java.lang.String getRuleName(IlrDTActionSet as, int ruleIndex)
as - the action setruleIndex - the index of the rule in the generated DTprotected void generateRuleEnd(IlrDTActionSet as, int ruleIndex) throws java.io.IOException
java.io.IOExceptionas - the action setruleIndex - the index of the rule in the generated DTprotected IlrBRLTranslator createTranslator()
protected IlrTranslatorInput createTranslatorInput(IlrDTActionSet actionSet, java.lang.String balCode, int ruleIndex)
actionSet - the action set representing the row that will be translatedbalCode - the BAL code corresponding to the translated row. May be null is translation is not based on BAL text.ruleIndex - the index of the row to be translated© Copyright IBM Corp. 1987, 2017