Commit a0764fde authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ improvements for timer resolution

parent b8e19575
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -230,7 +230,8 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider {
		}
		list.addAll(nestedFields.map[it as RefValueElement])

		list.addAll(module.eAllOfType(FieldReference))
		//TODO:why is this here and is it ever filtered afterwards? 
		//list.addAll(module.eAllOfType(FieldReference))

		synchronized (IMPORTS) {
			if (IMPORTS.containsKey(module.eResource)) {
@@ -305,6 +306,7 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider {
				if (parent.system != null) {
					componentScopeValueRefs(parent.system.component, list, true, false, false)
				}
				list.addAll(parent.eAllOfType(SingleVarInstance))
				list.addAll(parent.functionLocalParameter)
			} else if (parent instanceof ComponentDef) {
				for (ComponentDefList l : parent.defs) {
@@ -325,10 +327,13 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider {
			}
			parent = parent.eContainer
		}
		val function = parent.findDesiredParent(FunctionDef)
		if (function != null) {
			list.addAll(function.functionLocalParameter)
		}
		//TODO: this is nonsense! parent is already null according to the loop above
		//but why is it even necessary?
		//val function = parent.findDesiredParent(FunctionDef) // - wrong parent is already null
		//val function = variable.findDesiredParent(FunctionDef)
		//if (function != null) {
			//list.addAll(function.functionLocalParameter)
		//}
		scopeFor(list)
	}

@@ -337,19 +342,25 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider {
	}

	def IScope scope_TimerRefOrAll_ref(FunctionDef function, EReference ref) {
		scopeFor(function.eAllOfType(SingleVarInstance), function.scopeTimerSpec)
		val ArrayList<EObject> list = newArrayList
		list.addAll(function.functionLocalParameter)
		list.addAll(function.eAllOfType(SingleVarInstance))
		scopeFor(list, function.scopeTimerSpec)
	}

	def scope_StartTimerStatement_ref(FunctionDef function, EReference ref) {
		//TODO: does this ever hit?
		scopeFor(function.eAllOfType(SingleVarInstance), function.scopeTimerSpec)
	}

	def IScope scope_TimerRefOrAll_ref(AltstepDef altstep, EReference ref) {
		val ArrayList<EObject> list = newArrayList
		//TODO: does this ever hit?
		val function = altstep.findDesiredParent(FunctionDef)
		if (function != null) {
			list.addAll(function.functionLocalParameter)
		}
		list.addAll(altstep.altstepLocalParameter)
		list.addAll(altstep.eAllOfType(SingleVarInstance))
		scopeFor(list, altstep.scopeTimerSpec)
	}