public class IlrIRLCodeGenerator extends IlrBOMBasedCodeGenerator
Important note: this class must be used jointly with an IlrBOMTranslationSupport.
currentRuleStatement| Constructor and Description |
|---|
IlrIRLCodeGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addStandardProperties(IlrRuleStatement rule,
java.util.Map properties)
This method add some standard properties to the Map given as argument.
|
java.lang.String |
getImplicitVariableText(IlrSyntaxTree.Node node,
IlrStatement stmt)
Gets the text to be generated for an implicit variable.
|
java.lang.String |
getIRLTranslation(IlrSentence sentence,
IlrSyntaxTree.Node node)
Gets the IRL code generation template for the sentence.
|
java.lang.String |
getTargetLanguage()
Returns "irl".
|
protected java.lang.String |
makeDefaultIRLCodeTemplate(IlrSentence sentence)
Produces a default template for navigation sentence translation.
|
protected java.lang.String |
makeSetterIRLCodeTemplate(IlrSentence sentence)
Produces a default template for setter sentence translation.
|
void |
printCodeStatement(IlrCodeStatement stmt)
Prints a code statement code.
|
void |
printCollectBinding(IlrSimpleBindingStatement stmt)
Prints a COLLECT binding.
|
void |
printComment(java.lang.String comment)
Prints an IRL comment.
|
void |
printDocumentation(java.lang.String documentation)
Prints documentation as a IRL comment.
|
void |
printEvaluateBinding(IlrSimpleBindingStatement stmt)
Prints a EVALUATE binding.
|
void |
printExistsBinding(IlrSimpleBindingStatement stmt)
Prints a EXISTS binding.
|
void |
printExpressionNode(IlrSyntaxTree.Node node,
IlrStatement stmt,
java.lang.String expectedType)
Prints a BAL expression node.
|
void |
printForEachAction(IlrBlockActionStatement stmt)
Prints a "for each" action.
|
void |
printFromClause(IlrSyntaxTree.Node node,
IlrStatement stmt)
Prints a FROM clause of a binding.
|
void |
printInClause(IlrSyntaxTree.Node node,
IlrStatement stmt)
Prints a IN clause of a binding.
|
void |
printNotBinding(IlrSimpleBindingStatement stmt)
Prints a NOT binding.
|
void |
printOriginClause(IlrSimpleBindingStatement stmt)
Prints the origin clause (the 'from' or the 'in') of
a simple binding statement.
|
void |
printProperties(java.util.Map properties)
Prints rule properties.
|
void |
printRule(IlrRuleStatement rule)
Prints a rule statement.
|
void |
printSentenceNode(IlrSyntaxTree.Node node,
IlrStatement stmt,
java.lang.String expectedType)
Prints a node that references an
IlrSentence. |
void |
printSimpleAction(IlrSimpleActionStatement stmt)
Prints a simple action.
|
void |
printSimpleBinding(IlrSimpleBindingStatement stmt)
Prints simple binding.
|
void |
printUpdateContext(IlrSimpleActionStatement stmt)
Prints an update action.
|
void |
printUpdateObjectAction(IlrSimpleActionStatement stmt)
Prints an update object action.
|
void |
printUseHeader(IlrHeaderStatement header)
Prints a 'use' clause.
|
void |
printValueNode(IlrSyntaxTree.Node node,
java.lang.String expectedType)
Prints a value node.
|
void |
printVariableAssignment(IlrSimpleActionStatement stmt)
Prints a variable assignment action.
|
void |
printVariableNode(IlrSyntaxTree.Node node,
IlrStatement stmt,
java.lang.String expectedType)
Prints variable node.
|
getBOMVocabulary, getObjectModeladdIndent, close, flush, generateCode, getExtender, getIndent, getIndentSize, getTranslationSupport, getTranslator, getVocabulary, ignoreNewline, ignoreNewline, indent, indent, newline, print, print, println, reportDuplicateVariables, reportDuplicateVariables, reset, setIndentSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetTranslatorpublic java.lang.String getTargetLanguage()
public void printComment(java.lang.String comment)
comment - the comment to printpublic void printRule(IlrRuleStatement rule)
rule - The rule statement to print.protected void addStandardProperties(IlrRuleStatement rule, java.util.Map properties)
rule - a rule statementproperties - a non-null property mappublic void printProperties(java.util.Map properties)
properties - The map of properties to print.public void printDocumentation(java.lang.String documentation)
documentation - The documentation.public void printCodeStatement(IlrCodeStatement stmt)
stmt - The code statement.public void printUseHeader(IlrHeaderStatement header)
header - The IlrHeaderStatement.public void printSimpleBinding(IlrSimpleBindingStatement stmt)
stmt - The simple binding statement.public void printOriginClause(IlrSimpleBindingStatement stmt)
stmt - The simple binding statement.public void printInClause(IlrSyntaxTree.Node node, IlrStatement stmt)
node - The syntax tree node.stmt - The statement.public void printFromClause(IlrSyntaxTree.Node node, IlrStatement stmt)
node - The syntax tree node.stmt - The statement.public void printNotBinding(IlrSimpleBindingStatement stmt)
stmt - The simple binding.public void printExistsBinding(IlrSimpleBindingStatement stmt)
stmt - The simple binding.public void printCollectBinding(IlrSimpleBindingStatement stmt)
stmt - The simple binding.public void printEvaluateBinding(IlrSimpleBindingStatement stmt)
stmt - The simple binding.public void printExpressionNode(IlrSyntaxTree.Node node, IlrStatement stmt, java.lang.String expectedType)
node
is searched. If one exists, the extender printExpression()
is called.public void printSentenceNode(IlrSyntaxTree.Node node, IlrStatement stmt, java.lang.String expectedType)
IlrSentence.node - The sentence node.stmt - The associated statement.expectedType - The expected type or null.public void printVariableNode(IlrSyntaxTree.Node node, IlrStatement stmt, java.lang.String expectedType)
node - The variable node.stmt - The statement.expectedType - The expected type or null.public void printValueNode(IlrSyntaxTree.Node node, java.lang.String expectedType)
node - The value node.expectedType - The expected type or null.public void printSimpleAction(IlrSimpleActionStatement stmt)
stmt - The action statement.public void printUpdateContext(IlrSimpleActionStatement stmt)
stmt - The action statement.public void printVariableAssignment(IlrSimpleActionStatement stmt)
stmt - The action statement.public void printUpdateObjectAction(IlrSimpleActionStatement stmt)
stmt - The statement.public void printForEachAction(IlrBlockActionStatement stmt)
stmt - The action statement.public java.lang.String getImplicitVariableText(IlrSyntaxTree.Node node, IlrStatement stmt)
node - The node.stmt - The statement.public java.lang.String getIRLTranslation(IlrSentence sentence, IlrSyntaxTree.Node node)
It first looks for the property "translation" in the BOM. If no value is returned, it produces a template depending on the sentence category and the underlying member.
sentence - The sentence.node - The syntax tree node.protected java.lang.String makeDefaultIRLCodeTemplate(IlrSentence sentence)
sentence - The sentence.protected java.lang.String makeSetterIRLCodeTemplate(IlrSentence sentence)
sentence - The sentence.© Copyright IBM Corp. 1987, 2017