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

+ extended handling of system and mtc compnents and their constituents

parent 80f29174
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -493,6 +493,29 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider {
			if (reference !== null) {
				list.addAll(reference.scopeReferencedFields)
			}
		} else if (pRef.component.system !== null ||
		    pRef.component.mtc !== null) {
		    //extension for references to system ports
		    //TODO: filter for types actually used as system? 
		    val module = pRef.findDesiredParent(TTCN3Module)

            for (ComponentDef ct : module.eAllOfType(ComponentDef)) {
                list.addAll(ct.scopeReferencedFields)
            }
		    
    	    synchronized (IMPORTS) {
                if (IMPORTS.containsKey(module.eResource)) {
                    val imported = IMPORTS.get(module.eResource)
                    for (i : 0 .. imported.size - 1) {
                        val d = imported.get(i)
                        for (o : d.exportedObjects) {
                            if (TTCN3Package.eINSTANCE.fieldReference.isAssignableFrom(ComponentDef.newInstance.eClass)) {
                                list.add(o.EObjectOrProxy)
                            }
                        }
                    }
                }
            }
		}
		scopeFor(list, pRef.scope_communicationPort)
	}