public final class IlrTranslationHelper
extends java.lang.Object
IlrTranslationHelper contains shared helper methods used to
translate business rule languages to IRL.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String[] |
IRL_KEYWORDS |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
containerQName(java.lang.String qualifiedName) |
static java.lang.String |
containerQName(java.lang.String qualifiedName,
char separator) |
static IlrConcept |
getConcept(IlrSyntaxTree.Node conceptNode,
IlrVocabulary voc)
Retrieves a concept from a target node.
|
static IlrConceptInstance |
getConceptInstance(IlrSyntaxTree.Node valueNode,
IlrVocabulary voc)
Retrieves a concept instance from a
T-voc-value abstract
syntax tree node. |
static IlrCardinality |
getParameterCardinality(IlrSyntaxTree.Node variableNode) |
static java.lang.String |
getParameterName(IlrSyntaxTree.Node variableNode)
Returns the name of the parameter referenced by this variable node.
|
static IlrSyntaxTree.Node |
getRoleNode(IlrSyntaxTree.Node sentenceNode,
int synRoleIndex)
Returns the abstract syntax tree node that corresponds to a specific
role in a sentence.
|
static IlrSentence |
getSentence(IlrSyntaxTree.Node sentenceNode,
IlrVocabulary voc)
Retrieves a sentence from a sentence node.
|
static IlrSyntaxTree.Node |
getThisSyntaxNode(IlrSyntaxTree.Node node,
IlrVocabulary vocabulary)
Returns the abstract syntax tree node that corresponds to the holder role
in a phrase.
|
static IlrTypeInfo |
getTypeInfo(IlrSyntaxTree.Node conceptNode,
IlrVocabulary voc)
Returns the type information for a node.
|
static java.lang.String |
getVariableName(IlrSyntaxTree.Node variableNode)
Returns the name of the variable.
|
static boolean |
isAutomaticVariable(IlrSyntaxTree.Node variableNode)
Tests if a variable node is an automatic variable.
|
static boolean |
isBinding(IlrSyntaxTree.Node node)
Tests if the given syntactic node is a binding.
|
static boolean |
isCollection(IlrSyntaxTree.Node node)
Tests if an object is a collection node, that is, is of type
T-collection. |
static boolean |
isConditionSeparator(IlrSyntaxTree.Node sentenceNode,
IlrVocabulary vocabulary)
Tests if a node references a sentence that is marked as a condition
separator.
|
static boolean |
isExpression(IlrSyntaxTree.Node node)
Tests if an object is an expression node, that is, a node of
type
T-expression. |
static boolean |
isImplicitVariable(IlrSyntaxTree.Node variableNode)
Tests if a variable node is an implicit variable.
|
static boolean |
isOperator(IlrSyntaxTree.Node node)
Tests if an object is an operator sentence node, that is, a node of type
T-operator-sentence. |
static boolean |
isRulesetParameter(IlrSyntaxTree.Node variableNode)
Deprecated.
use IlrSyntaxTreeHelper API
|
static boolean |
isRulesetVariable(IlrSyntaxTree.Node variableNode)
Deprecated.
use IlrSyntaxTreeHelper API
|
static boolean |
isSentence(IlrSyntaxTree.Node node)
Tests if an object is a sentence node, that is, a node of type
T-navigation-sentence or T-operator-sentence. |
static boolean |
isSentenceNode(IlrSyntaxTree.Node node)
Deprecated.
|
static boolean |
isSubExpression(IlrSyntaxTree.Node node)
Tests if an object is a subexpression node.
|
static boolean |
isValue(IlrSyntaxTree.Node node)
Tests if an object is a value node, that is, a node of type
T-voc-value or T-operator-sentence. |
static boolean |
isValueNode(IlrSyntaxTree.Node node)
Deprecated.
|
static boolean |
isVariable(IlrSyntaxTree.Node node)
Tests if an object is a variable node, that is, a node of
type
T-voc-variable. |
static java.lang.String |
makeIdentifier(java.lang.String name)
Makes a valid identifier from the specified name.
|
static java.lang.String |
shortName(java.lang.String qualifiedName) |
static java.lang.String |
shortName(java.lang.String qualifiedName,
char separator) |
public static IlrSyntaxTree.Node getThisSyntaxNode(IlrSyntaxTree.Node node, IlrVocabulary vocabulary)
node - The node.vocabulary - The vocabulary.null is returned.public static boolean isSentenceNode(IlrSyntaxTree.Node node)
isSentence(ilog.rules.brl.syntaxtree.IlrSyntaxTree.Node) instead.true if the node passed as argument is a sentence node
(T-navigation-sentence or T-operator-sentence).node - The Abstract Syntax Tree node.true if the node is a sentence node.public static boolean isSentence(IlrSyntaxTree.Node node)
T-navigation-sentence or T-operator-sentence.node - An abstract syntax tree node.node is a sentence node, true is
returned.public static boolean isOperator(IlrSyntaxTree.Node node)
T-operator-sentence.node - An abstract syntax tree node.node is an operator sentence node, true is
returned.public static boolean isValueNode(IlrSyntaxTree.Node node)
isValue(ilog.rules.brl.syntaxtree.IlrSyntaxTree.Node) instead.T-voc-value or T-operator-sentence.node - An abstract syntax tree node.node is a value node, true is
returned.public static boolean isValue(IlrSyntaxTree.Node node)
T-voc-value or T-operator-sentence.node - An abstract syntax tree node.node is a value node, true is
returned.public static boolean isVariable(IlrSyntaxTree.Node node)
T-voc-variable.node - An abstract syntax tree node.node is a variable node, true is
returned.public static boolean isExpression(IlrSyntaxTree.Node node)
T-expression.node - The Abstract Syntax Tree node.node is an expression node, true is
returned.public static boolean isSubExpression(IlrSyntaxTree.Node node)
node - An abstract syntax tree node.node is a subexpression node, true
is returned.public static boolean isCollection(IlrSyntaxTree.Node node)
T-collection.node - An abstract syntax tree node.node is a collection node, true is
returned.public static boolean isConditionSeparator(IlrSyntaxTree.Node sentenceNode, IlrVocabulary vocabulary)
The "and"," or", and "not" operators are treates as condition separators.
sentenceNode - The node. This object must reference a sentence.vocabulary - The vocabulary.sentenceNode references a sentence marked as a
condition separator, true is returned.public static IlrSentence getSentence(IlrSyntaxTree.Node sentenceNode, IlrVocabulary voc)
sentenceNode - A node of type T-voc-sentence.voc - The vocabulary.voc. If no sentence
is found, null is returned.isSentence(IlrSyntaxTree.Node)public static IlrConcept getConcept(IlrSyntaxTree.Node conceptNode, IlrVocabulary voc)
conceptNode - The abstract syntax tree node.voc - The vocabulary.null is returned.public static IlrTypeInfo getTypeInfo(IlrSyntaxTree.Node conceptNode, IlrVocabulary voc)
conceptNode - The node of type T-voc-concept.voc - The vocabulary.IlrTypeInfo corresponding to this concept node.public static IlrConceptInstance getConceptInstance(IlrSyntaxTree.Node valueNode, IlrVocabulary voc)
T-voc-value abstract
syntax tree node.valueNode - A node of type T-voc-value.voc - The vocabulary.null is returned.public static boolean isImplicitVariable(IlrSyntaxTree.Node variableNode)
variableNode - A node of type T-voc-variable.variableNode is marked as implicit,
true is returned.public static boolean isBinding(IlrSyntaxTree.Node node)
node - The node to test.node is binding, true is returned.public static java.lang.String getParameterName(IlrSyntaxTree.Node variableNode)
variableNode - A node of type T-voc-variable.variableNode does not
reference a parameter, null is returned.public static java.lang.String containerQName(java.lang.String qualifiedName)
public static java.lang.String containerQName(java.lang.String qualifiedName,
char separator)
public static java.lang.String shortName(java.lang.String qualifiedName)
public static java.lang.String shortName(java.lang.String qualifiedName,
char separator)
public static IlrCardinality getParameterCardinality(IlrSyntaxTree.Node variableNode)
public static boolean isAutomaticVariable(IlrSyntaxTree.Node variableNode)
variableNode - A T-voc-variable node.automatic,
true is returned.public static IlrSyntaxTree.Node getRoleNode(IlrSyntaxTree.Node sentenceNode, int synRoleIndex)
sentenceNode - The node that references the sentence.synRoleIndex - The index of the role (syntactic).synRoleIndex role in the sentence referred to by
sentenceNode.public static java.lang.String makeIdentifier(java.lang.String name)
name - The name.public static java.lang.String getVariableName(IlrSyntaxTree.Node variableNode)
XML_PI_EXE_VARNAME processing instruction has been set,
the name specified is returned. If not, the name stored in the node is returned.variableNode - The node whose name is to be returned.public static boolean isRulesetParameter(IlrSyntaxTree.Node variableNode)
variableNode - The node of type T-voc-variable.true if the variable node is a parameter.public static boolean isRulesetVariable(IlrSyntaxTree.Node variableNode)
variableNode - The node of type T-voc-variable.true if the variable node is a ruleset variable.© Copyright IBM Corp. 1987, 2017