val templateDef = template.findDesiredParent(TemplateDef)
val isDerived = templateDef.derived != null
var isSendTemplate = false;
var isAmbiguous = false;
// check if it is not a present restriction, but a restriction
if (templateDef.restriction != null && templateDef.restriction.present == null) {
for (p : template.parList.params) {
if (p instanceof FormalTemplatePar) {
if (p.restriction == null || p.restriction.restriction == null ||
p.restriction.restriction.present != null) {
// problem occurred, inconsistent definition
isAmbiguous = true
}
} else {
// problem occurred, inconsistent definition
isAmbiguous = true
}
if (isAmbiguous) {
val INode node = NodeModelUtils.getNode(template)
val infoMessage = "The template definition for \"" + template.name +
"\" is ambiguous. It cannot be determined whether it is a send or a receive template according to STF160's conventions. It will not be analyzed further for naming conventions compliance."
info(
infoMessage,
TTCN3Package.eINSTANCE.TTCN3Reference_Name,
MessageClass.NAMING.toString,
node.startLine.toString,
node.endLine.toString,
"2.1, " + MiscTools.getMethodName(),
LogLevel.INFORMATION.toString
);
return;
}
}
//if no problems occurred this far check name for send template