Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/TTCN3Validator.xtend +27 −29 Original line number Diff line number Diff line Loading @@ -52,6 +52,8 @@ import org.eclipse.emf.ecore.EStructuralFeature import org.eclipse.xtext.validation.Check import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.* import de.ugoe.cs.swe.tTCN3.VarInstance import de.ugoe.cs.swe.tTCN3.SingleTempVarInstance class TTCN3Validator extends AbstractTTCN3Validator { Loading Loading @@ -393,29 +395,35 @@ class TTCN3Validator extends AbstractTTCN3Validator { } } } if (l.locInst != null && l.locInst.variable != null) { val varList = l.locInst.variable.list as VarList for (SingleVarInstance d : varList.variables) { if (d != variable && d.name == variable.name) { if (l.locInst.variable.checkNameClashVarInstance(variable)) return true; } } return false; } def private boolean checkNameClashVarInstance(VarInstance instance, RefValue variable) { if (instance.list != null) { for (SingleVarInstance d : instance.list.variables) { if (d != variable && d.name == variable.name) { return true; } return false; } def private boolean checkNameClashInitial(Initial init, RefValue variable) { if (init.variable != null) { val varList = init.variable.list as VarList for (SingleVarInstance d : varList.variables) { } else if (instance.tempList != null) { for (SingleTempVarInstance d : instance.tempList.variables) { if (d != variable && d.name == variable.name) { return true; } } } return false } def private boolean checkNameClashInitial(Initial init, RefValue variable) { if (init.variable != null && init.variable.checkNameClashVarInstance(variable)) { return true; } return false; } Loading @@ -438,14 +446,12 @@ class TTCN3Validator extends AbstractTTCN3Validator { } } if (o.def.localInst != null && o.def.localInst.variable != null) { val varList = o.def.localInst.variable.list as VarList for (SingleVarInstance d : varList.variables) { if (d != variable && d.name == variable.name) { if (o.def.localInst != null && o.def.localInst.variable != null) { if (o.def.localInst.variable.checkNameClashVarInstance(variable)) return true; } } } } return false; } Loading @@ -462,14 +468,10 @@ class TTCN3Validator extends AbstractTTCN3Validator { } } if (l.element.variable != null) { val varList = l.element.variable.list as VarList for (SingleVarInstance d : varList.variables) { if (d != variable && d.name == variable.name) { if (l.element.variable.checkNameClashVarInstance(variable)) return false; } } } } return true; } Loading Loading @@ -510,13 +512,9 @@ class TTCN3Validator extends AbstractTTCN3Validator { } if (a.variable != null) { val varList = a.variable.list as VarList for (SingleVarInstance d : varList.variables) { if (d != variable && d.name == variable.name) { if (a.variable.checkNameClashVarInstance(variable)) return true; } } } } return false; Loading Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/TTCN3Validator.xtend +27 −29 Original line number Diff line number Diff line Loading @@ -52,6 +52,8 @@ import org.eclipse.emf.ecore.EStructuralFeature import org.eclipse.xtext.validation.Check import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.* import de.ugoe.cs.swe.tTCN3.VarInstance import de.ugoe.cs.swe.tTCN3.SingleTempVarInstance class TTCN3Validator extends AbstractTTCN3Validator { Loading Loading @@ -393,29 +395,35 @@ class TTCN3Validator extends AbstractTTCN3Validator { } } } if (l.locInst != null && l.locInst.variable != null) { val varList = l.locInst.variable.list as VarList for (SingleVarInstance d : varList.variables) { if (d != variable && d.name == variable.name) { if (l.locInst.variable.checkNameClashVarInstance(variable)) return true; } } return false; } def private boolean checkNameClashVarInstance(VarInstance instance, RefValue variable) { if (instance.list != null) { for (SingleVarInstance d : instance.list.variables) { if (d != variable && d.name == variable.name) { return true; } return false; } def private boolean checkNameClashInitial(Initial init, RefValue variable) { if (init.variable != null) { val varList = init.variable.list as VarList for (SingleVarInstance d : varList.variables) { } else if (instance.tempList != null) { for (SingleTempVarInstance d : instance.tempList.variables) { if (d != variable && d.name == variable.name) { return true; } } } return false } def private boolean checkNameClashInitial(Initial init, RefValue variable) { if (init.variable != null && init.variable.checkNameClashVarInstance(variable)) { return true; } return false; } Loading @@ -438,14 +446,12 @@ class TTCN3Validator extends AbstractTTCN3Validator { } } if (o.def.localInst != null && o.def.localInst.variable != null) { val varList = o.def.localInst.variable.list as VarList for (SingleVarInstance d : varList.variables) { if (d != variable && d.name == variable.name) { if (o.def.localInst != null && o.def.localInst.variable != null) { if (o.def.localInst.variable.checkNameClashVarInstance(variable)) return true; } } } } return false; } Loading @@ -462,14 +468,10 @@ class TTCN3Validator extends AbstractTTCN3Validator { } } if (l.element.variable != null) { val varList = l.element.variable.list as VarList for (SingleVarInstance d : varList.variables) { if (d != variable && d.name == variable.name) { if (l.element.variable.checkNameClashVarInstance(variable)) return false; } } } } return true; } Loading Loading @@ -510,13 +512,9 @@ class TTCN3Validator extends AbstractTTCN3Validator { } if (a.variable != null) { val varList = a.variable.list as VarList for (SingleVarInstance d : varList.variables) { if (d != variable && d.name == variable.name) { if (a.variable.checkNameClashVarInstance(variable)) return true; } } } } return false; Loading