Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/TTCN3.xtext +2 −2 Original line number Diff line number Diff line Loading @@ -1110,7 +1110,7 @@ ExtendedFieldReference: // BaseTemplate contained in FunctionRef // SingleVarInstance contained in TimerVarInstance (according to EBNF rules) RefValue: SingleConstDef | ModuleParameter | FieldReference | FormalTemplatePar | SingleTempVarInstance | ModuleParameter | FieldReference | FormalTemplatePar | SingleTempVarInstance | FunctionRef | TimerVarInstance | FormalPortPar | PortElement; // IDENTIFIER omitted Loading Loading @@ -1196,7 +1196,7 @@ TTCN3ReferenceList: //TODO: check if SubTypeDefNamed is really needed here //TODO: check if Enumeration is really needed here FieldReference: StructFieldDef | FormalValuePar | UnionFieldDef | SubTypeDefNamed | Enumeration; StructFieldDef | FormalValuePar | UnionFieldDef | SubTypeDefNamed | Enumeration | SingleConstDef; ArrayOrBitRef: SQUAREOPEN FieldOrBitNumber SQUARECLOSE; Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/scoping/TTCN3ScopeProvider.xtend +29 −4 Original line number Diff line number Diff line Loading @@ -70,8 +70,14 @@ import static org.eclipse.xtext.scoping.Scopes.* import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.* import static extension org.eclipse.xtext.EcoreUtil2.* import com.google.inject.Inject import org.eclipse.xtext.scoping.IGlobalScopeProvider import de.ugoe.cs.swe.tTCN3.TTCN3Package class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { @Inject private IGlobalScopeProvider globalScopeProvider; private final static Logger LOG = Logger.getLogger(TTCN3LocalScopeProvider); def IScope scope_FieldSpec_ref(FieldSpec spec, EReference ref) { Loading Loading @@ -183,6 +189,7 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { } private def Iterable<EObject> scopeListFieldExpressionList(EObject field) { val module = field.findDesiredParent(TTCN3Module) val inlineTemplate = field.findDesiredParent(InLineTemplate) val template = field.findDesiredParent(TemplateDef) val variable = field.findDesiredParent(VarInstance) Loading @@ -199,9 +206,13 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { } else if (cField != null) { list.addAll(cField.fieldRef.scopeFieldReferences) } else if (sField != null) { if (sField.ref != null) { list.addAll(sField.ref.scopeFieldReferences) } } else if (constDef != null) { if (constDef.type.ref != null) { list.addAll(constDef.type.ref.scopeReferencedFields) } } else if (inlineTemplate != null) { if (inlineTemplate.type != null && inlineTemplate.type.ref != null) { list.addAll(inlineTemplate.type.ref.templateFieldScope) Loading @@ -224,6 +235,20 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { } list.addAll(nestedFields.map[it as RefValueElement]) list.addAll(module.eAllOfType(FieldReference)) val scopeProvider = globalScopeProvider as TTCN3GlobalScopeProvider val imported = scopeProvider.importedObjects(module.eResource) // TODO: figure out if this is really needed for (i : imported) { for (o : i.exportedObjects) { if (TTCN3Package.eINSTANCE.fieldReference.isSuperTypeOf(o.EClass)) { list.add(o.EObjectOrProxy) } } } return list } Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/CodeStyleValidator.xtend +1 −3 Original line number Diff line number Diff line Loading @@ -612,8 +612,6 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { var TTCN3Reference detailDef = null var notReferenced = false // TODO: maybe use another type of cross referencer // TODO: find global cross references if (definition.def instanceof ConstDef) { val constDefList = (definition.def as ConstDef).defs as ConstList for (SingleConstDef d : constDefList.list) { Loading Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/TTCN3.xtext +2 −2 Original line number Diff line number Diff line Loading @@ -1110,7 +1110,7 @@ ExtendedFieldReference: // BaseTemplate contained in FunctionRef // SingleVarInstance contained in TimerVarInstance (according to EBNF rules) RefValue: SingleConstDef | ModuleParameter | FieldReference | FormalTemplatePar | SingleTempVarInstance | ModuleParameter | FieldReference | FormalTemplatePar | SingleTempVarInstance | FunctionRef | TimerVarInstance | FormalPortPar | PortElement; // IDENTIFIER omitted Loading Loading @@ -1196,7 +1196,7 @@ TTCN3ReferenceList: //TODO: check if SubTypeDefNamed is really needed here //TODO: check if Enumeration is really needed here FieldReference: StructFieldDef | FormalValuePar | UnionFieldDef | SubTypeDefNamed | Enumeration; StructFieldDef | FormalValuePar | UnionFieldDef | SubTypeDefNamed | Enumeration | SingleConstDef; ArrayOrBitRef: SQUAREOPEN FieldOrBitNumber SQUARECLOSE; Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/scoping/TTCN3ScopeProvider.xtend +29 −4 Original line number Diff line number Diff line Loading @@ -70,8 +70,14 @@ import static org.eclipse.xtext.scoping.Scopes.* import static extension de.ugoe.cs.swe.common.TTCN3ScopeHelper.* import static extension org.eclipse.xtext.EcoreUtil2.* import com.google.inject.Inject import org.eclipse.xtext.scoping.IGlobalScopeProvider import de.ugoe.cs.swe.tTCN3.TTCN3Package class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { @Inject private IGlobalScopeProvider globalScopeProvider; private final static Logger LOG = Logger.getLogger(TTCN3LocalScopeProvider); def IScope scope_FieldSpec_ref(FieldSpec spec, EReference ref) { Loading Loading @@ -183,6 +189,7 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { } private def Iterable<EObject> scopeListFieldExpressionList(EObject field) { val module = field.findDesiredParent(TTCN3Module) val inlineTemplate = field.findDesiredParent(InLineTemplate) val template = field.findDesiredParent(TemplateDef) val variable = field.findDesiredParent(VarInstance) Loading @@ -199,9 +206,13 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { } else if (cField != null) { list.addAll(cField.fieldRef.scopeFieldReferences) } else if (sField != null) { if (sField.ref != null) { list.addAll(sField.ref.scopeFieldReferences) } } else if (constDef != null) { if (constDef.type.ref != null) { list.addAll(constDef.type.ref.scopeReferencedFields) } } else if (inlineTemplate != null) { if (inlineTemplate.type != null && inlineTemplate.type.ref != null) { list.addAll(inlineTemplate.type.ref.templateFieldScope) Loading @@ -224,6 +235,20 @@ class TTCN3ScopeProvider extends AbstractDeclarativeScopeProvider { } list.addAll(nestedFields.map[it as RefValueElement]) list.addAll(module.eAllOfType(FieldReference)) val scopeProvider = globalScopeProvider as TTCN3GlobalScopeProvider val imported = scopeProvider.importedObjects(module.eResource) // TODO: figure out if this is really needed for (i : imported) { for (o : i.exportedObjects) { if (TTCN3Package.eINSTANCE.fieldReference.isSuperTypeOf(o.EClass)) { list.add(o.EObjectOrProxy) } } } return list } Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/CodeStyleValidator.xtend +1 −3 Original line number Diff line number Diff line Loading @@ -612,8 +612,6 @@ class CodeStyleValidator extends AbstractDeclarativeValidator { var TTCN3Reference detailDef = null var notReferenced = false // TODO: maybe use another type of cross referencer // TODO: find global cross references if (definition.def instanceof ConstDef) { val constDefList = (definition.def as ConstDef).defs as ConstList for (SingleConstDef d : constDefList.list) { Loading