Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/common/TTCN3ScopeHelper.xtend +33 −1 Original line number Diff line number Diff line Loading @@ -546,10 +546,42 @@ class TTCN3ScopeHelper { list.addAll(type.defs) } else if (type instanceof NestedSetDef) { list.addAll(type.defs) //DONE: this should be only for arrays -> handle separately } else if (type instanceof NestedRecordOfDef) { //TODO: handle? -> separate in exceptional cases } else if (type instanceof NestedSetOfDef) { //TODO: handle? -> separate in exceptional cases } return list } def static Iterable<RefValueElement> nestedFields(EObject type) { var ArrayList<RefValueElement> list = newArrayList if (type instanceof NestedRecordOfDef) { if (type.nested !== null) { list.addAll(type.nested.nestedTypeFieldElements) } else if (type.type !== null && type.type.ref !== null) { list.addAll(type.type.ref.templateFieldScope) } } else if (type instanceof NestedSetOfDef) { if (type.nested !== null) { list.addAll(type.nested.nestedTypeFieldElements) } else if (type.type !== null && type.type.ref !== null) { list.addAll(type.type.ref.templateFieldScope) } } else if (type instanceof RecordOfDefNamed) { //handle? } else if (type instanceof SetOfDefNamed) { //handle? } else if (type instanceof SubTypeDefNamed) { if (type.type.ref !== null) { val original = type.type.ref.referencedOrNestedTypeWithTail list.addAll(original.nestedFields) } } return list } def static Iterable<RefValueElement> templateFieldScope(TypeReference ref) { val ArrayList<RefValueElement> list = newArrayList Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/scoping/TTCN3ScopeProvider.xtend +18 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,9 @@ import de.ugoe.cs.swe.tTCN3.ImportDef import de.ugoe.cs.swe.tTCN3.ExtendedFieldOrTypeReference import de.ugoe.cs.swe.tTCN3.ArrayOrMixedExpression import de.ugoe.cs.swe.tTCN3.SubTypeDefNamed import de.ugoe.cs.swe.tTCN3.NestedRecordOfDef import de.ugoe.cs.swe.tTCN3.RecordOfDefNamed import de.ugoe.cs.swe.tTCN3.NestedTypeDef //TODO: switch to TTCN3LocalScopeProvider as base class? class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { Loading Loading @@ -250,6 +253,15 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { if (eField !== null) { list.addAll(eField.fieldRef.scopeFieldReferences) if (hasArrayAsParent) { val ref = eField.fieldRef if (ref instanceof StructFieldDef) { if (ref.nestedType !== null) { val type = ref.nestedType list.addAll(type.nestedFields) } } } } else if (cField !== null) { list.addAll(cField.fieldRef.scopeFieldReferences) } else if (sField !== null) { Loading @@ -275,6 +287,12 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { } else if (template !== null) { if (template.base.type !== null && template.base.type.ref !== null) { list.addAll(template.base.type.ref.templateFieldScope) //TODO: this has to be more specific.. -> perhaps too specific now? if (hasArrayAsParent) { val type = getReferencedOrNestedTypeWithTail(template.base.type.ref) //TODO: repeats parts, need to integrate better list.addAll(type.nestedFields) } } } else if (variable !== null) { if (variable.type !== null && variable.type.ref !== null) { Loading Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/common/TTCN3ScopeHelper.xtend +33 −1 Original line number Diff line number Diff line Loading @@ -546,10 +546,42 @@ class TTCN3ScopeHelper { list.addAll(type.defs) } else if (type instanceof NestedSetDef) { list.addAll(type.defs) //DONE: this should be only for arrays -> handle separately } else if (type instanceof NestedRecordOfDef) { //TODO: handle? -> separate in exceptional cases } else if (type instanceof NestedSetOfDef) { //TODO: handle? -> separate in exceptional cases } return list } def static Iterable<RefValueElement> nestedFields(EObject type) { var ArrayList<RefValueElement> list = newArrayList if (type instanceof NestedRecordOfDef) { if (type.nested !== null) { list.addAll(type.nested.nestedTypeFieldElements) } else if (type.type !== null && type.type.ref !== null) { list.addAll(type.type.ref.templateFieldScope) } } else if (type instanceof NestedSetOfDef) { if (type.nested !== null) { list.addAll(type.nested.nestedTypeFieldElements) } else if (type.type !== null && type.type.ref !== null) { list.addAll(type.type.ref.templateFieldScope) } } else if (type instanceof RecordOfDefNamed) { //handle? } else if (type instanceof SetOfDefNamed) { //handle? } else if (type instanceof SubTypeDefNamed) { if (type.type.ref !== null) { val original = type.type.ref.referencedOrNestedTypeWithTail list.addAll(original.nestedFields) } } return list } def static Iterable<RefValueElement> templateFieldScope(TypeReference ref) { val ArrayList<RefValueElement> list = newArrayList Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/scoping/TTCN3ScopeProvider.xtend +18 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,9 @@ import de.ugoe.cs.swe.tTCN3.ImportDef import de.ugoe.cs.swe.tTCN3.ExtendedFieldOrTypeReference import de.ugoe.cs.swe.tTCN3.ArrayOrMixedExpression import de.ugoe.cs.swe.tTCN3.SubTypeDefNamed import de.ugoe.cs.swe.tTCN3.NestedRecordOfDef import de.ugoe.cs.swe.tTCN3.RecordOfDefNamed import de.ugoe.cs.swe.tTCN3.NestedTypeDef //TODO: switch to TTCN3LocalScopeProvider as base class? class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { Loading Loading @@ -250,6 +253,15 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { if (eField !== null) { list.addAll(eField.fieldRef.scopeFieldReferences) if (hasArrayAsParent) { val ref = eField.fieldRef if (ref instanceof StructFieldDef) { if (ref.nestedType !== null) { val type = ref.nestedType list.addAll(type.nestedFields) } } } } else if (cField !== null) { list.addAll(cField.fieldRef.scopeFieldReferences) } else if (sField !== null) { Loading @@ -275,6 +287,12 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { } else if (template !== null) { if (template.base.type !== null && template.base.type.ref !== null) { list.addAll(template.base.type.ref.templateFieldScope) //TODO: this has to be more specific.. -> perhaps too specific now? if (hasArrayAsParent) { val type = getReferencedOrNestedTypeWithTail(template.base.type.ref) //TODO: repeats parts, need to integrate better list.addAll(type.nestedFields) } } } else if (variable !== null) { if (variable.type !== null && variable.type.ref !== null) { Loading