Commit 9c40ffc2 authored by Daniel Honsel's avatar Daniel Honsel
Browse files

fixed naming validation issues

parent 30d942d7
Loading
Loading
Loading
Loading
+48 −14
Original line number Diff line number Diff line
@@ -43,6 +43,11 @@ import org.eclipse.xtext.validation.EValidatorRegistrar
import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.*
import static extension org.eclipse.xtext.EcoreUtil2.*
import de.ugoe.cs.swe.tTCN3.SingleTempVarInstance
import de.ugoe.cs.swe.tTCN3.ComponentDef
import de.ugoe.cs.swe.tTCN3.SetDefNamed
import de.ugoe.cs.swe.tTCN3.RecordDefNamed
import de.ugoe.cs.swe.tTCN3.UnionDefNamed
import de.ugoe.cs.swe.tTCN3.PortDef

public class NamingConventionsValidator extends AbstractDeclarativeValidator {
	val ConfigTools configTools = ConfigTools.getInstance;
@@ -165,6 +170,36 @@ public class NamingConventionsValidator extends AbstractDeclarativeValidator {
		dataType.checkIdentifierForNamingConventionCompliance(regExp, "DataType")
	}

	@Check
	def checkSetOfTypeName(SetDefNamed dataType) {
		val regExp = activeProfile.namingConventionsConfig.dataTypeRegExp;
		dataType.checkIdentifierForNamingConventionCompliance(regExp, "DataType")
	}

	@Check
	def checkSetOfTypeName(RecordDefNamed dataType) {
		val regExp = activeProfile.namingConventionsConfig.dataTypeRegExp;
		dataType.checkIdentifierForNamingConventionCompliance(regExp, "DataType")
	}

	@Check
	def checkSetOfTypeName(ComponentDef dataType) {
		val regExp = activeProfile.namingConventionsConfig.dataTypeRegExp;
		dataType.checkIdentifierForNamingConventionCompliance(regExp, "DataType")
	}

	@Check
	def checkSetOfTypeName(UnionDefNamed dataType) {
		val regExp = activeProfile.namingConventionsConfig.dataTypeRegExp;
		dataType.checkIdentifierForNamingConventionCompliance(regExp, "DataType")
	}

	@Check
	def checkSetOfTypeName(PortDef dataType) {
		val regExp = activeProfile.namingConventionsConfig.dataTypeRegExp;
		dataType.checkIdentifierForNamingConventionCompliance(regExp, "DataType")
	}

	// TODO: check if something more is required (see implementation of old t3tools)
	// Timer instances are included here
	@Check
@@ -269,7 +304,6 @@ public class NamingConventionsValidator extends AbstractDeclarativeValidator {
			// if no problems occurred this far check name for send template
			isSendTemplate = true;
		} // (else) check name for receive template

		if (!isDerived) {
			if (isSendTemplate) {
				message = "STF160SendTemplate";