//Helper operations

operation TDL!Package targetElement() : String {
	return self.qualifiedName();
}

operation TDL!Member targetElement() : String {
	return self.eContainer.qualifiedName()+"::"+self.name;
}

operation TDL!ElementImport targetElement() : String {
	return self.qualifiedName()+"::Import " +self.importedElement.collect(e|e.name).concat(",")+ " from "+self.importedPackage.qualifiedName();
}


operation TDL!MemberAssignment targetElement() : String {
	return self.qualifiedName()+self.member.name + " = " +self.memberSpec.targetElement();
}

operation TDL!DataInstanceUse targetElement() : String {
	return self.dataInstance.qualifiedName();
}

operation TDL!DataInstance targetElement() : String {
	return self.qualifiedName();
}

operation TDL!FunctionCall targetElement() : String {
	return self.`function`.qualifiedName();
}

operation TDL!FormalParameterUse targetElement() : String {
	return self.parameter.qualifiedName();
}

operation TDL!VariableUse targetElement() : String {
	return self.variable.qualifiedName();
}


operation TDL!ParameterBinding targetElement() : String {
	return self.parameter.qualifiedName() +" = ?:"+self.dataUse.getDataType().name+ " [Expecting "+self.parameter.dataType.name+"]";
}

operation TDL!AnyValueOrOmit targetElement() : String {
	return "*";
}

operation TDL!AnyValue targetElement() : String {
	return "?";
}

operation TDL!OmitValue targetElement() : String {
	return "omit";
}

operation TDL!TimeLabelUse targetElement() : String {
	return self.timeLabel.qualifiedName();
}

operation TDL!ComponentInstance targetElement() : String {
	return self.qualifiedName();
}

operation TDL!ComponentType targetElement() : String {
	return self.qualifiedName();
}

operation TDL!Comment targetElement() : String {
	return self.qualifiedName();
}

operation TDL!Action targetElement() : String {
	return self.qualifiedName();
}

operation TDL!AnnotationType targetElement() : String {
	return self.qualifiedName();
}


operation TDL!TimeConstraint targetElement() : String {
	return 'TimeConstraint';
}

operation TDL!Quiescence targetElement() : String {
	return 'Q';
}

operation TDL!Wait targetElement() : String {
	return 'W';
}

operation TDL!TimerOperation targetElement() : String {
	return self.timer.qualifiedName();
}

operation TDL!GateReference targetElement() : String {
	return self.component.qualifiedName()+ "." + self.gate.qualifiedName();
}

operation TDL!Connection targetElement() : String {
	return self.endPoint.at(0).targetElement()+ " --- " + self.endPoint.at(1).targetElement();
}

operation TDL!TestConfiguration targetElement() : String {
	return self.qualifiedName();
}

operation TDL!Block targetElement() : String {
	return self.qualifiedName() + "Block";
}

operation TDL!Behaviour targetElement() : String {
	return self.qualifiedName() + self.type().name;
}

operation TDL!Target targetElement() : String {
	return self.qualifiedName() + self.type().name;
}

operation TDL!ComponentInstanceBinding targetElement() : String {
	return self.qualifiedName() + "Binding";
}

operation TDL!Function targetElement() : String {
	return self.qualifiedName();
}

operation Any targetElement() : String {
	if (self.isDefined()) {
		return "[not implemented "+self+"]";
	} else {
		return "";
	}
}
