Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/TTCN3.xtext +12 −13 Original line number Diff line number Diff line Loading @@ -15,7 +15,8 @@ Type: pre=PredefinedType | ref=TypeReference extensions+=ExtendedFieldReference*; TypeReference: head=[ReferencedType|IDENTIFIER] (DOT field=[FieldReference|IDENTIFIER])? array=ArrayOrBitRef? (DOT tail=TypeReference)?; head=[ReferencedType|IDENTIFIER] (DOT field=[FieldReference|IDENTIFIER])? array=ArrayOrBitRef? (DOT tail=TypeReference)?; ArrayDef: (SQUAREOPEN expr+=SingleExpression (RANGEOP range+=SingleExpression)? SQUARECLOSE)+; Loading Loading @@ -65,8 +66,8 @@ ExtConstDef: EXTKEYWORD CONSTKEYWORD type=Type id=IdentifierList; ImportDef: IMPORTKEYWORD FROMKEYWORD name=IDENTIFIER spec=LanguageSpec? RECURSIVEKEYWORD? (all=AllWithExcepts | LBRACKET importSpec=ImportSpec RBRACKET); IMPORTKEYWORD FROMKEYWORD name=IDENTIFIER spec=LanguageSpec? RECURSIVEKEYWORD? (all=AllWithExcepts | LBRACKET importSpec=ImportSpec RBRACKET); AllWithExcepts: {AllWithExcepts} ALLKEYWORD def=ExceptsDef?; Loading Loading @@ -679,12 +680,11 @@ StructFieldDef: optional=OPTIONALKEYWORD?; SetOfDef: SETKEYWORD setLength=StringLength? OFKEYWORD (setType=Type | nested2=NestedTypeDef) ADDRESSKEYWORD setSpec=SubTypeSpec? | SetOfDefNamed; SETKEYWORD setLength=StringLength? OFKEYWORD (type=Type | nested=NestedTypeDef) ADDRESSKEYWORD setSpec=SubTypeSpec? | SetOfDefNamed; SetOfDefNamed: SETKEYWORD setLength=StringLength? OFKEYWORD (setType=Type | nested2=NestedTypeDef) name=IDENTIFIER setSpec=SubTypeSpec?; SETKEYWORD setLength=StringLength? OFKEYWORD (type=Type | nested=NestedTypeDef) name=IDENTIFIER setSpec=SubTypeSpec?; PortDef: PORTKEYWORD name=IDENTIFIER body=PortDefBody; Loading Loading @@ -779,7 +779,7 @@ NestedSetOfDef: {NestedSetOfDef} SETKEYWORD length=StringLength? OFKEYWORD (type=Type | nested=NestedTypeDef); NestedEnumDef: ENUMKEYWORD LBRACKET EnumerationList RBRACKET; ENUMKEYWORD LBRACKET list=EnumerationList RBRACKET; MessageList: Direction allOrTypeList=AllOrTypeList; Loading Loading @@ -809,7 +809,7 @@ Enumeration: name=IDENTIFIER (LPAREN MINUS? NUMBER RPAREN)?; UnionFieldDef: (type=Type | NestedTypeDef) name=IDENTIFIER array=ArrayDef? subType=SubTypeSpec?; (type=Type | nestedType=NestedTypeDef) name=IDENTIFIER array=ArrayDef? subType=SubTypeSpec?; SetDef: SETKEYWORD ADDRESSKEYWORD body=StructDefBody | SetDefNamed; Loading Loading @@ -1971,7 +1971,6 @@ terminal HEX_STRING_OR_MATCH returns ecore::EString: terminal OCTET_STRING_OR_MATCH returns ecore::EString: SINGLEQUOTE OCT_OR_MATCH* SINGLEQUOTE 'O'; /* * Enumerations */ Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/common/TTCN3ScopeHelper.xtend +51 −22 Original line number Diff line number Diff line Loading @@ -56,6 +56,9 @@ import org.eclipse.emf.ecore.EObject import org.eclipse.xtext.scoping.IScope import static org.eclipse.xtext.scoping.Scopes.* import de.ugoe.cs.swe.tTCN3.NestedTypeDef import de.ugoe.cs.swe.tTCN3.NestedRecordOfDef import de.ugoe.cs.swe.tTCN3.NestedSetOfDef class TTCN3ScopeHelper { Loading Loading @@ -86,7 +89,7 @@ class TTCN3ScopeHelper { var StructuredTypeDef struct = null; var SubTypeDef sub = null; // treat signature as type: makes things easy and should be changed eventually // treat signature as type: makes things easy, but should be changed maybe if (!onlyPorts) { for (ModuleDefinition d : moduleDefs.definitions.filter[it.def instanceof SignatureDef]) { res.add(d.def) Loading Loading @@ -383,13 +386,16 @@ class TTCN3ScopeHelper { def static void templateFieldScope(TemplateDef template, ArrayList<EObject> list) { val type = findOriginalType(getReferencedType((template.base.type.ref))) if (type != null && type != null && typeof(RecordDefNamed).isAssignableFrom(type.class)) { if (type != null && typeof(RecordDefNamed).isAssignableFrom(type.class)) { list.addAll((type as RecordDefNamed).body.defs) } if (type != null && type != null && typeof(UnionDefNamed).isAssignableFrom(type.class)) { if (type != null && typeof(UnionDefNamed).isAssignableFrom(type.class)) { list.addAll((type as UnionDefNamed).body.defs) } if (type != null && type != null && typeof(SignatureDef).isAssignableFrom(type.class)) { if (type != null && typeof(SetDefNamed).isAssignableFrom(type.class)) { list.addAll((type as SetDefNamed).body.defs) } if (type != null && typeof(SignatureDef).isAssignableFrom(type.class)) { list.addAll((type as SignatureDef).paramList.params) } } Loading @@ -397,13 +403,16 @@ class TTCN3ScopeHelper { def static void templateFieldScope(InLineTemplate template, ArrayList<EObject> list) { val type = findOriginalType(getReferencedType((template.type.ref))) if (type != null && type != null && typeof(RecordDefNamed).isAssignableFrom(type.class)) { if (type != null && typeof(RecordDefNamed).isAssignableFrom(type.class)) { list.addAll((type as RecordDefNamed).body.defs) } if (type != null && type != null && typeof(UnionDefNamed).isAssignableFrom(type.class)) { if (type != null && typeof(UnionDefNamed).isAssignableFrom(type.class)) { list.addAll((type as UnionDefNamed).body.defs) } if (type != null && type != null && typeof(SignatureDef).isAssignableFrom(type.class)) { if (type != null && typeof(SetDefNamed).isAssignableFrom(type.class)) { list.addAll((type as SetDefNamed).body.defs) } if (type != null && typeof(SignatureDef).isAssignableFrom(type.class)) { list.addAll((type as SignatureDef).paramList.params) } } Loading @@ -415,12 +424,34 @@ class TTCN3ScopeHelper { } else if (type != null && typeof(RecordOfDefNamed).isAssignableFrom(type.class)) { findOriginalType(getReferencedType((type as RecordOfDefNamed).type.ref)) } else if (type != null && typeof(SetOfDefNamed).isAssignableFrom(type.class)) { findOriginalType(getReferencedType((type as SetOfDefNamed).setType.ref)) findOriginalType(getReferencedType((type as SetOfDefNamed).type.ref)) } else { return type; } } def static TypeReference findUsedType(NestedTypeDef it) { // TODO; consider missing nested types switch it { NestedRecordOfDef: { if (it.type != null) { return it.type.ref; } else if (it.nested != null) { it.nested.findUsedType } } NestedSetOfDef: { if (it.type != null) { return it.type.ref; } else if (it.nested != null) { it.nested.findUsedType } } } return null; } def static void componentScopePorts(ComponentDef component, ArrayList<EObject> list) { for (ComponentDefList l : component.defs.filter[it.element.port != null]) { for (PortElement e : l.element.port.instances) { Loading Loading @@ -467,6 +498,4 @@ class TTCN3ScopeHelper { return type; } } de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/scoping/TTCN3ScopeProvider.xtend +51 −59 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import de.ugoe.cs.swe.tTCN3.SendStatement import de.ugoe.cs.swe.tTCN3.SingleTempVarInstance import de.ugoe.cs.swe.tTCN3.SingleVarInstance import de.ugoe.cs.swe.tTCN3.SpecElement import de.ugoe.cs.swe.tTCN3.StructFieldDef import de.ugoe.cs.swe.tTCN3.TemplateDef import de.ugoe.cs.swe.tTCN3.TestcaseDef import de.ugoe.cs.swe.tTCN3.TimerRefOrAny Loading @@ -57,6 +56,7 @@ import static org.eclipse.xtext.scoping.Scopes.* import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.* import static extension org.eclipse.xtext.EcoreUtil2.* import de.ugoe.cs.swe.tTCN3.StructFieldDef class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { Loading @@ -76,36 +76,17 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { spec.scopeFieldExpressionList } private def IScope scopeFieldExpressionList(EObject field) { val inlineTemplate = field.findDesiredParent(InLineTemplate) val template = field.findDesiredParent(TemplateDef) val variable = field.findDesiredParent(VarInstance) val eField = field.findDesiredParent(FieldExpressionSpec) val cField = field.findDesiredParent(FieldConstExpressionSpec) val sField = field.findDesiredParent(FieldSpec) val constDef = field.findDesiredParent(ConstDef) val list = newArrayList if (eField != null) { val fieldRef = eField.fieldRef private def IScope scopeFieldReferences(FieldReference fieldRef) { if (fieldRef instanceof StructFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } else if (fieldRef instanceof FormalValuePar) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } else if (fieldRef instanceof UnionFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } else if (fieldRef.nestedType != null) { if (fieldRef.nestedType != null) { val nType = fieldRef.nestedType.findUsedType if (nType != null) { scopeFor(nType.scopeReferencedFields) } } } else if (cField != null) { val fieldRef = cField.fieldRef if (fieldRef instanceof StructFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } else if (fieldRef instanceof FormalValuePar) { if (fieldRef.type != null && fieldRef.type.ref != null) { Loading @@ -114,23 +95,33 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { } else if (fieldRef instanceof UnionFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } else if (fieldRef.nestedType != null) { if (fieldRef.nestedType != null) { val nType = fieldRef.nestedType.findUsedType if (nType != null) { scopeFor(nType.scopeReferencedFields) } } } else if (sField != null) { val fieldRef = sField.ref if (fieldRef instanceof StructFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } else if (fieldRef instanceof FormalValuePar) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } else if (fieldRef instanceof UnionFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } private def IScope scopeFieldExpressionList(EObject field) { val inlineTemplate = field.findDesiredParent(InLineTemplate) val template = field.findDesiredParent(TemplateDef) val variable = field.findDesiredParent(VarInstance) val eField = field.findDesiredParent(FieldExpressionSpec) val cField = field.findDesiredParent(FieldConstExpressionSpec) val sField = field.findDesiredParent(FieldSpec) val constDef = field.findDesiredParent(ConstDef) val list = newArrayList if (eField != null) { eField.fieldRef.scopeFieldReferences } else if (cField != null) { cField.fieldRef.scopeFieldReferences } else if (sField != null) { sField.ref.scopeFieldReferences } else if (constDef != null) { scopeFor(constDef.type.ref.scopeReferencedFields) } else if (inlineTemplate != null) { Loading Loading @@ -327,7 +318,8 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { if (parameter.port != null) { res.add(parameter.port) } else if (parameter.value != null) { // TODO: FormatlValuePar and FormalPortPar are ambiguous, this hack resolves FormalValuePars as Ports too if (getReferencedType(parameter.value.type.ref) != null && getReferencedType(parameter.value.type.ref) instanceof PortDef) { if (getReferencedType(parameter.value.type.ref) != null && getReferencedType(parameter.value.type.ref) instanceof PortDef) { res.add(parameter.value) } } Loading Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/TTCN3.xtext +12 −13 Original line number Diff line number Diff line Loading @@ -15,7 +15,8 @@ Type: pre=PredefinedType | ref=TypeReference extensions+=ExtendedFieldReference*; TypeReference: head=[ReferencedType|IDENTIFIER] (DOT field=[FieldReference|IDENTIFIER])? array=ArrayOrBitRef? (DOT tail=TypeReference)?; head=[ReferencedType|IDENTIFIER] (DOT field=[FieldReference|IDENTIFIER])? array=ArrayOrBitRef? (DOT tail=TypeReference)?; ArrayDef: (SQUAREOPEN expr+=SingleExpression (RANGEOP range+=SingleExpression)? SQUARECLOSE)+; Loading Loading @@ -65,8 +66,8 @@ ExtConstDef: EXTKEYWORD CONSTKEYWORD type=Type id=IdentifierList; ImportDef: IMPORTKEYWORD FROMKEYWORD name=IDENTIFIER spec=LanguageSpec? RECURSIVEKEYWORD? (all=AllWithExcepts | LBRACKET importSpec=ImportSpec RBRACKET); IMPORTKEYWORD FROMKEYWORD name=IDENTIFIER spec=LanguageSpec? RECURSIVEKEYWORD? (all=AllWithExcepts | LBRACKET importSpec=ImportSpec RBRACKET); AllWithExcepts: {AllWithExcepts} ALLKEYWORD def=ExceptsDef?; Loading Loading @@ -679,12 +680,11 @@ StructFieldDef: optional=OPTIONALKEYWORD?; SetOfDef: SETKEYWORD setLength=StringLength? OFKEYWORD (setType=Type | nested2=NestedTypeDef) ADDRESSKEYWORD setSpec=SubTypeSpec? | SetOfDefNamed; SETKEYWORD setLength=StringLength? OFKEYWORD (type=Type | nested=NestedTypeDef) ADDRESSKEYWORD setSpec=SubTypeSpec? | SetOfDefNamed; SetOfDefNamed: SETKEYWORD setLength=StringLength? OFKEYWORD (setType=Type | nested2=NestedTypeDef) name=IDENTIFIER setSpec=SubTypeSpec?; SETKEYWORD setLength=StringLength? OFKEYWORD (type=Type | nested=NestedTypeDef) name=IDENTIFIER setSpec=SubTypeSpec?; PortDef: PORTKEYWORD name=IDENTIFIER body=PortDefBody; Loading Loading @@ -779,7 +779,7 @@ NestedSetOfDef: {NestedSetOfDef} SETKEYWORD length=StringLength? OFKEYWORD (type=Type | nested=NestedTypeDef); NestedEnumDef: ENUMKEYWORD LBRACKET EnumerationList RBRACKET; ENUMKEYWORD LBRACKET list=EnumerationList RBRACKET; MessageList: Direction allOrTypeList=AllOrTypeList; Loading Loading @@ -809,7 +809,7 @@ Enumeration: name=IDENTIFIER (LPAREN MINUS? NUMBER RPAREN)?; UnionFieldDef: (type=Type | NestedTypeDef) name=IDENTIFIER array=ArrayDef? subType=SubTypeSpec?; (type=Type | nestedType=NestedTypeDef) name=IDENTIFIER array=ArrayDef? subType=SubTypeSpec?; SetDef: SETKEYWORD ADDRESSKEYWORD body=StructDefBody | SetDefNamed; Loading Loading @@ -1971,7 +1971,6 @@ terminal HEX_STRING_OR_MATCH returns ecore::EString: terminal OCTET_STRING_OR_MATCH returns ecore::EString: SINGLEQUOTE OCT_OR_MATCH* SINGLEQUOTE 'O'; /* * Enumerations */ Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/common/TTCN3ScopeHelper.xtend +51 −22 Original line number Diff line number Diff line Loading @@ -56,6 +56,9 @@ import org.eclipse.emf.ecore.EObject import org.eclipse.xtext.scoping.IScope import static org.eclipse.xtext.scoping.Scopes.* import de.ugoe.cs.swe.tTCN3.NestedTypeDef import de.ugoe.cs.swe.tTCN3.NestedRecordOfDef import de.ugoe.cs.swe.tTCN3.NestedSetOfDef class TTCN3ScopeHelper { Loading Loading @@ -86,7 +89,7 @@ class TTCN3ScopeHelper { var StructuredTypeDef struct = null; var SubTypeDef sub = null; // treat signature as type: makes things easy and should be changed eventually // treat signature as type: makes things easy, but should be changed maybe if (!onlyPorts) { for (ModuleDefinition d : moduleDefs.definitions.filter[it.def instanceof SignatureDef]) { res.add(d.def) Loading Loading @@ -383,13 +386,16 @@ class TTCN3ScopeHelper { def static void templateFieldScope(TemplateDef template, ArrayList<EObject> list) { val type = findOriginalType(getReferencedType((template.base.type.ref))) if (type != null && type != null && typeof(RecordDefNamed).isAssignableFrom(type.class)) { if (type != null && typeof(RecordDefNamed).isAssignableFrom(type.class)) { list.addAll((type as RecordDefNamed).body.defs) } if (type != null && type != null && typeof(UnionDefNamed).isAssignableFrom(type.class)) { if (type != null && typeof(UnionDefNamed).isAssignableFrom(type.class)) { list.addAll((type as UnionDefNamed).body.defs) } if (type != null && type != null && typeof(SignatureDef).isAssignableFrom(type.class)) { if (type != null && typeof(SetDefNamed).isAssignableFrom(type.class)) { list.addAll((type as SetDefNamed).body.defs) } if (type != null && typeof(SignatureDef).isAssignableFrom(type.class)) { list.addAll((type as SignatureDef).paramList.params) } } Loading @@ -397,13 +403,16 @@ class TTCN3ScopeHelper { def static void templateFieldScope(InLineTemplate template, ArrayList<EObject> list) { val type = findOriginalType(getReferencedType((template.type.ref))) if (type != null && type != null && typeof(RecordDefNamed).isAssignableFrom(type.class)) { if (type != null && typeof(RecordDefNamed).isAssignableFrom(type.class)) { list.addAll((type as RecordDefNamed).body.defs) } if (type != null && type != null && typeof(UnionDefNamed).isAssignableFrom(type.class)) { if (type != null && typeof(UnionDefNamed).isAssignableFrom(type.class)) { list.addAll((type as UnionDefNamed).body.defs) } if (type != null && type != null && typeof(SignatureDef).isAssignableFrom(type.class)) { if (type != null && typeof(SetDefNamed).isAssignableFrom(type.class)) { list.addAll((type as SetDefNamed).body.defs) } if (type != null && typeof(SignatureDef).isAssignableFrom(type.class)) { list.addAll((type as SignatureDef).paramList.params) } } Loading @@ -415,12 +424,34 @@ class TTCN3ScopeHelper { } else if (type != null && typeof(RecordOfDefNamed).isAssignableFrom(type.class)) { findOriginalType(getReferencedType((type as RecordOfDefNamed).type.ref)) } else if (type != null && typeof(SetOfDefNamed).isAssignableFrom(type.class)) { findOriginalType(getReferencedType((type as SetOfDefNamed).setType.ref)) findOriginalType(getReferencedType((type as SetOfDefNamed).type.ref)) } else { return type; } } def static TypeReference findUsedType(NestedTypeDef it) { // TODO; consider missing nested types switch it { NestedRecordOfDef: { if (it.type != null) { return it.type.ref; } else if (it.nested != null) { it.nested.findUsedType } } NestedSetOfDef: { if (it.type != null) { return it.type.ref; } else if (it.nested != null) { it.nested.findUsedType } } } return null; } def static void componentScopePorts(ComponentDef component, ArrayList<EObject> list) { for (ComponentDefList l : component.defs.filter[it.element.port != null]) { for (PortElement e : l.element.port.instances) { Loading Loading @@ -467,6 +498,4 @@ class TTCN3ScopeHelper { return type; } }
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/scoping/TTCN3ScopeProvider.xtend +51 −59 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import de.ugoe.cs.swe.tTCN3.SendStatement import de.ugoe.cs.swe.tTCN3.SingleTempVarInstance import de.ugoe.cs.swe.tTCN3.SingleVarInstance import de.ugoe.cs.swe.tTCN3.SpecElement import de.ugoe.cs.swe.tTCN3.StructFieldDef import de.ugoe.cs.swe.tTCN3.TemplateDef import de.ugoe.cs.swe.tTCN3.TestcaseDef import de.ugoe.cs.swe.tTCN3.TimerRefOrAny Loading @@ -57,6 +56,7 @@ import static org.eclipse.xtext.scoping.Scopes.* import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.* import static extension org.eclipse.xtext.EcoreUtil2.* import de.ugoe.cs.swe.tTCN3.StructFieldDef class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { Loading @@ -76,36 +76,17 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { spec.scopeFieldExpressionList } private def IScope scopeFieldExpressionList(EObject field) { val inlineTemplate = field.findDesiredParent(InLineTemplate) val template = field.findDesiredParent(TemplateDef) val variable = field.findDesiredParent(VarInstance) val eField = field.findDesiredParent(FieldExpressionSpec) val cField = field.findDesiredParent(FieldConstExpressionSpec) val sField = field.findDesiredParent(FieldSpec) val constDef = field.findDesiredParent(ConstDef) val list = newArrayList if (eField != null) { val fieldRef = eField.fieldRef private def IScope scopeFieldReferences(FieldReference fieldRef) { if (fieldRef instanceof StructFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } else if (fieldRef instanceof FormalValuePar) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } else if (fieldRef instanceof UnionFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } else if (fieldRef.nestedType != null) { if (fieldRef.nestedType != null) { val nType = fieldRef.nestedType.findUsedType if (nType != null) { scopeFor(nType.scopeReferencedFields) } } } else if (cField != null) { val fieldRef = cField.fieldRef if (fieldRef instanceof StructFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } else if (fieldRef instanceof FormalValuePar) { if (fieldRef.type != null && fieldRef.type.ref != null) { Loading @@ -114,23 +95,33 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { } else if (fieldRef instanceof UnionFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } else if (fieldRef.nestedType != null) { if (fieldRef.nestedType != null) { val nType = fieldRef.nestedType.findUsedType if (nType != null) { scopeFor(nType.scopeReferencedFields) } } } else if (sField != null) { val fieldRef = sField.ref if (fieldRef instanceof StructFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } else if (fieldRef instanceof FormalValuePar) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } else if (fieldRef instanceof UnionFieldDef) { if (fieldRef.type != null && fieldRef.type.ref != null) { scopeFor(fieldRef.type.ref.scopeReferencedFields) } } private def IScope scopeFieldExpressionList(EObject field) { val inlineTemplate = field.findDesiredParent(InLineTemplate) val template = field.findDesiredParent(TemplateDef) val variable = field.findDesiredParent(VarInstance) val eField = field.findDesiredParent(FieldExpressionSpec) val cField = field.findDesiredParent(FieldConstExpressionSpec) val sField = field.findDesiredParent(FieldSpec) val constDef = field.findDesiredParent(ConstDef) val list = newArrayList if (eField != null) { eField.fieldRef.scopeFieldReferences } else if (cField != null) { cField.fieldRef.scopeFieldReferences } else if (sField != null) { sField.ref.scopeFieldReferences } else if (constDef != null) { scopeFor(constDef.type.ref.scopeReferencedFields) } else if (inlineTemplate != null) { Loading Loading @@ -327,7 +318,8 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { if (parameter.port != null) { res.add(parameter.port) } else if (parameter.value != null) { // TODO: FormatlValuePar and FormalPortPar are ambiguous, this hack resolves FormalValuePars as Ports too if (getReferencedType(parameter.value.type.ref) != null && getReferencedType(parameter.value.type.ref) instanceof PortDef) { if (getReferencedType(parameter.value.type.ref) != null && getReferencedType(parameter.value.type.ref) instanceof PortDef) { res.add(parameter.value) } } Loading