diff options
author | 2018-01-30 01:27:48 +0100 | |
---|---|---|
committer | 2018-01-30 01:27:48 +0100 | |
commit | 777d5ecc6031f02ad3757db1c9736b6aad5ac6f5 (patch) | |
tree | c80be670a4d3dc519837c575338cde6c73b17b3e /Application/hu.bme.mit.inf.dslreasoner.application/src/hu | |
parent | Loading services (diff) | |
download | VIATRA-Generator-777d5ecc6031f02ad3757db1c9736b6aad5ac6f5.tar.gz VIATRA-Generator-777d5ecc6031f02ad3757db1c9736b6aad5ac6f5.tar.zst VIATRA-Generator-777d5ecc6031f02ad3757db1c9736b6aad5ac6f5.zip |
Scoping + Linking services fixed
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu')
6 files changed, 76 insertions, 40 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext index 2ac81bf6..3efde6ec 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext | |||
@@ -15,7 +15,7 @@ Command : | |||
15 | ; | 15 | ; |
16 | 16 | ||
17 | QualifiedName returns ecore::EString: | 17 | QualifiedName returns ecore::EString: |
18 | ID (=>'.' ID)*; | 18 | ID ('.' ID)*; |
19 | 19 | ||
20 | /////////////////////////////////////////////////// | 20 | /////////////////////////////////////////////////// |
21 | // Imports | 21 | // Imports |
@@ -106,10 +106,14 @@ enum Solver: SMTSolver | AlloySolver | ViatraSolver; | |||
106 | ScopeSpecification: {ScopeSpecification} '{' | 106 | ScopeSpecification: {ScopeSpecification} '{' |
107 | (scopes += TypeScope (',' scopes += TypeScope)*)? | 107 | (scopes += TypeScope (',' scopes += TypeScope)*)? |
108 | '}'; | 108 | '}'; |
109 | TypeScope: ( min = INT ( greather?='<' | greaterOrEqual?= '<='))? '#' type = TypeReference (( less?='<' | lessOrEqual?= '<=') max = INT)?; | 109 | TypeScope: '#' type = TypeReference |
110 | (setsNew ?='+=' | setsSum ?= '=') | ||
111 | ( min = INT ) | ||
112 | ('..' (maxUnlimited?='*' | max=INT))? | ||
113 | ; | ||
110 | TypeReference: ClassReference | ObjectReference | IntegerReference | RealReference | StringReference; | 114 | TypeReference: ClassReference | ObjectReference | IntegerReference | RealReference | StringReference; |
111 | ClassReference: '[' element = MetamodelElement ']'; | 115 | ClassReference: '[' element = MetamodelElement ']'; |
112 | ObjectReference: {ObjectReference} 'Object'; | 116 | ObjectReference: {ObjectReference} 'node'; |
113 | IntegerReference: {IntegerScope} 'int'; | 117 | IntegerReference: {IntegerScope} 'int'; |
114 | RealReference: {RealScope} 'real'; | 118 | RealReference: {RealScope} 'real'; |
115 | StringReference: {StringScope} 'string'; | 119 | StringReference: {StringScope} 'string'; |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfigurationRuntimeModule.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfigurationRuntimeModule.xtend index 919dd297..59b2f3f8 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfigurationRuntimeModule.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfigurationRuntimeModule.xtend | |||
@@ -3,17 +3,18 @@ | |||
3 | */ | 3 | */ |
4 | package hu.bme.mit.inf.dslreasoner.application | 4 | package hu.bme.mit.inf.dslreasoner.application |
5 | 5 | ||
6 | import hu.bme.mit.inf.dslreasoner.application.linking.ApplicationConfigurationLinkingService | ||
7 | import com.google.inject.Binder | 6 | import com.google.inject.Binder |
8 | import com.google.inject.multibindings.Multibinder | 7 | import com.google.inject.multibindings.Multibinder |
9 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.IMetamodelProviderInstance | 8 | import hu.bme.mit.inf.dslreasoner.application.linking.ApplicationConfigurationLinkingService |
9 | import hu.bme.mit.inf.dslreasoner.application.valueconverter.ApplicationConfigurationValueConverterService | ||
10 | import org.apache.log4j.Logger | 10 | import org.apache.log4j.Logger |
11 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.IMetamodelProvider | 11 | import org.eclipse.viatra.query.patternlanguage.emf.GenmodelExtensionLoader |
12 | import org.eclipse.viatra.query.patternlanguage.emf.IGenmodelMappingLoader | ||
12 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.CompoundMetamodelProviderService | 13 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.CompoundMetamodelProviderService |
14 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.IMetamodelProvider | ||
15 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.IMetamodelProviderInstance | ||
13 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.MetamodelProviderService | 16 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.MetamodelProviderService |
14 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.ResourceSetMetamodelProviderService | 17 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.ResourceSetMetamodelProviderService |
15 | import org.eclipse.viatra.query.patternlanguage.emf.IGenmodelMappingLoader | ||
16 | import org.eclipse.viatra.query.patternlanguage.emf.GenmodelExtensionLoader | ||
17 | 18 | ||
18 | /** | 19 | /** |
19 | * Use this class to register components to be used at runtime / without the Equinox extension registry. | 20 | * Use this class to register components to be used at runtime / without the Equinox extension registry. |
@@ -40,4 +41,12 @@ class ApplicationConfigurationRuntimeModule extends AbstractApplicationConfigura | |||
40 | def Class<? extends IGenmodelMappingLoader> bindIGenmodelMappingLoader() { | 41 | def Class<? extends IGenmodelMappingLoader> bindIGenmodelMappingLoader() { |
41 | GenmodelExtensionLoader | 42 | GenmodelExtensionLoader |
42 | } | 43 | } |
44 | |||
45 | override bindIValueConverterService() { | ||
46 | ApplicationConfigurationValueConverterService | ||
47 | } | ||
48 | |||
49 | // override bindIQualifiedNameProvider() { | ||
50 | // ApplicationConfigurationQualifiedNameProvider | ||
51 | // } | ||
43 | } | 52 | } |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ModelLoader.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ModelLoader.xtend index 1de7ee22..5fc2cdc5 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ModelLoader.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ModelLoader.xtend | |||
@@ -1,11 +1,24 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.application.execution | 1 | package hu.bme.mit.inf.dslreasoner.application.execution |
2 | 2 | ||
3 | import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl | ||
4 | import org.eclipse.emf.common.util.URI | ||
5 | |||
3 | class ModelLoader { | 6 | class ModelLoader { |
4 | //def loadMetamodels()7 | 7 | def loadModel(String path, Context context) { |
5 | // val List<EClass> classes = new LinkedList | 8 | var URI uri |
6 | // val List<EReference> references = new LinkedList | 9 | try { |
7 | // val List<EAttribute> attributes = new LinkedList | 10 | uri = URI::createURI(path) |
8 | // val List<EEnum> enums = new LinkedList | 11 | } catch(IllegalArgumentException e) { |
9 | // val List<EEnumLiteral> literals = new LinkedList | 12 | context.writeError('''Malformed uri: "«uri»"!''') |
10 | // | 13 | return null |
14 | } | ||
15 | |||
16 | val resourceSet = new ResourceSetImpl | ||
17 | val resource = resourceSet.getResource(uri,true) | ||
18 | if(resource === null) { | ||
19 | |||
20 | } else { | ||
21 | return resource | ||
22 | } | ||
23 | } | ||
11 | } \ No newline at end of file | 24 | } \ No newline at end of file |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/util/VQLParser.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/util/VQLParser.xtend index 9b5c538f..6eb9e3c8 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/util/VQLParser.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/util/VQLParser.xtend | |||
@@ -3,7 +3,9 @@ package hu.bme.mit.inf.dslreasoner.application.execution.util | |||
3 | import com.google.inject.Guice | 3 | import com.google.inject.Guice |
4 | import com.google.inject.Injector | 4 | import com.google.inject.Injector |
5 | import com.google.inject.Module | 5 | import com.google.inject.Module |
6 | import hu.bme.mit.inf.dslreasoner.application.execution.Context | ||
6 | import java.util.LinkedHashMap | 7 | import java.util.LinkedHashMap |
8 | import java.util.List | ||
7 | import org.eclipse.emf.common.util.URI | 9 | import org.eclipse.emf.common.util.URI |
8 | import org.eclipse.emf.ecore.resource.Resource | 10 | import org.eclipse.emf.ecore.resource.Resource |
9 | import org.eclipse.emf.ecore.resource.ResourceSet | 11 | import org.eclipse.emf.ecore.resource.ResourceSet |
@@ -17,11 +19,8 @@ import org.eclipse.viatra.query.patternlanguage.emf.GenmodelExtensionLoader | |||
17 | import org.eclipse.viatra.query.patternlanguage.emf.IGenmodelMappingLoader | 19 | import org.eclipse.viatra.query.patternlanguage.emf.IGenmodelMappingLoader |
18 | import org.eclipse.viatra.query.patternlanguage.emf.eMFPatternLanguage.PatternModel | 20 | import org.eclipse.viatra.query.patternlanguage.emf.eMFPatternLanguage.PatternModel |
19 | import org.eclipse.viatra.query.patternlanguage.emf.specification.SpecificationBuilder | 21 | import org.eclipse.viatra.query.patternlanguage.emf.specification.SpecificationBuilder |
20 | import org.eclipse.xtext.resource.XtextResourceSet | ||
21 | import hu.bme.mit.inf.dslreasoner.application.execution.Context | ||
22 | import java.util.List | ||
23 | import java.util.HashMap | ||
24 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification | 22 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification |
23 | import org.eclipse.xtext.resource.XtextResourceSet | ||
25 | 24 | ||
26 | class MyModule extends EMFPatternLanguageRuntimeModule implements Module { | 25 | class MyModule extends EMFPatternLanguageRuntimeModule implements Module { |
27 | def public Class<? extends IAnnotationValidatorLoader> bindAnnotationValidatorLoader() { | 26 | def public Class<? extends IAnnotationValidatorLoader> bindAnnotationValidatorLoader() { |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/linking/ApplicationConfigurationLinkingService.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/linking/ApplicationConfigurationLinkingService.xtend index 35d4008b..e48b74ba 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/linking/ApplicationConfigurationLinkingService.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/linking/ApplicationConfigurationLinkingService.xtend | |||
@@ -2,33 +2,30 @@ package hu.bme.mit.inf.dslreasoner.application.linking | |||
2 | 2 | ||
3 | import com.google.inject.Inject | 3 | import com.google.inject.Inject |
4 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage | 4 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage |
5 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript | ||
5 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport | 6 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport |
7 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternEntry | ||
6 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport | 8 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport |
7 | import java.util.Collections | 9 | import java.util.Collections |
10 | import java.util.List | ||
8 | import java.util.Optional | 11 | import java.util.Optional |
9 | import org.eclipse.emf.common.util.URI | 12 | import org.eclipse.emf.common.util.URI |
10 | import org.eclipse.emf.ecore.EObject | 13 | import org.eclipse.emf.ecore.EObject |
11 | import org.eclipse.emf.ecore.EReference | 14 | import org.eclipse.emf.ecore.EReference |
15 | import org.eclipse.emf.ecore.resource.Resource | ||
12 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.IMetamodelProvider | 16 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.IMetamodelProvider |
17 | import org.eclipse.xtext.EcoreUtil2 | ||
13 | import org.eclipse.xtext.conversion.IValueConverterService | 18 | import org.eclipse.xtext.conversion.IValueConverterService |
14 | import org.eclipse.xtext.conversion.ValueConverterException | 19 | import org.eclipse.xtext.conversion.ValueConverterException |
15 | import org.eclipse.xtext.linking.impl.DefaultLinkingService | 20 | import org.eclipse.xtext.linking.impl.DefaultLinkingService |
16 | import org.eclipse.xtext.nodemodel.ILeafNode | 21 | import org.eclipse.xtext.nodemodel.ILeafNode |
17 | import org.eclipse.xtext.nodemodel.INode | 22 | import org.eclipse.xtext.nodemodel.INode |
18 | import org.eclipse.emf.ecore.resource.Resource | ||
19 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternEntry | ||
20 | import org.eclipse.emf.ecore.util.EcoreUtil | ||
21 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript | ||
22 | import org.eclipse.xtext.EcoreUtil2 | ||
23 | import java.util.List | ||
24 | import org.eclipse.xtext.conversion.impl.QualifiedNameValueConverter | ||
25 | 23 | ||
26 | class ApplicationConfigurationLinkingService extends DefaultLinkingService{ | 24 | class ApplicationConfigurationLinkingService extends DefaultLinkingService{ |
27 | 25 | ||
28 | //@Inject Logger logger | 26 | //@Inject Logger logger |
29 | 27 | ||
30 | @Inject IValueConverterService valueConverterService | 28 | @Inject IValueConverterService valueConverterService |
31 | |||
32 | @Inject IMetamodelProvider metamodelProvider | 29 | @Inject IMetamodelProvider metamodelProvider |
33 | 30 | ||
34 | public static extension ApplicationConfigurationPackage pac = ApplicationConfigurationPackage.eINSTANCE | 31 | public static extension ApplicationConfigurationPackage pac = ApplicationConfigurationPackage.eINSTANCE |
@@ -39,8 +36,8 @@ class ApplicationConfigurationLinkingService extends DefaultLinkingService{ | |||
39 | return getEPackage(context as EPackageImport, node as ILeafNode) | 36 | return getEPackage(context as EPackageImport, node as ILeafNode) |
40 | } | 37 | } |
41 | } else if(context instanceof ViatraImport) { | 38 | } else if(context instanceof ViatraImport) { |
42 | if(ref == viatraImport_ImportedViatra && node instanceof ILeafNode) { | 39 | if(ref == viatraImport_ImportedViatra) { |
43 | return getViatra(context as ViatraImport, node as ILeafNode) | 40 | return getViatra(context as ViatraImport, node) |
44 | } | 41 | } |
45 | } else if(context instanceof PatternEntry) { | 42 | } else if(context instanceof PatternEntry) { |
46 | if(ref === patternEntry_Package) { | 43 | if(ref === patternEntry_Package) { |
@@ -67,7 +64,7 @@ class ApplicationConfigurationLinkingService extends DefaultLinkingService{ | |||
67 | ].orElse(emptyList) | 64 | ].orElse(emptyList) |
68 | } | 65 | } |
69 | 66 | ||
70 | private def getViatra(ViatraImport viatraImport, ILeafNode node) { | 67 | private def getViatra(ViatraImport viatraImport, INode node) { |
71 | val uri = getNSUri(node) | 68 | val uri = getNSUri(node) |
72 | if(uri.present) { | 69 | if(uri.present) { |
73 | var URI createdURI | 70 | var URI createdURI |
@@ -92,7 +89,7 @@ class ApplicationConfigurationLinkingService extends DefaultLinkingService{ | |||
92 | } | 89 | } |
93 | } | 90 | } |
94 | 91 | ||
95 | private def getNSUri(ILeafNode node) { | 92 | private def getNSUri(INode node) { |
96 | try { | 93 | try { |
97 | val convertedValue = valueConverterService.toValue(node.text, | 94 | val convertedValue = valueConverterService.toValue(node.text, |
98 | linkingHelper.getRuleNameFrom(node.grammarElement), node) | 95 | linkingHelper.getRuleNameFrom(node.grammarElement), node) |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend index 97cda4a4..ea0e8d1e 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend | |||
@@ -19,6 +19,9 @@ import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternEl | |||
19 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.AllPatternEntry | 19 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.AllPatternEntry |
20 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternSpecification | 20 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternSpecification |
21 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport | 21 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport |
22 | import com.google.common.base.Function | ||
23 | import org.eclipse.viatra.query.patternlanguage.patternLanguage.PatternModel | ||
24 | import org.eclipse.xtext.naming.QualifiedName | ||
22 | 25 | ||
23 | /** | 26 | /** |
24 | * This class contains custom scoping description. | 27 | * This class contains custom scoping description. |
@@ -29,21 +32,29 @@ import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImp | |||
29 | class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigurationScopeProvider { | 32 | class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigurationScopeProvider { |
30 | 33 | ||
31 | private val language = ApplicationConfigurationPackage.eINSTANCE | 34 | private val language = ApplicationConfigurationPackage.eINSTANCE |
35 | protected val nameConverter = new Function<PatternModel,QualifiedName>() { | ||
36 | override apply(PatternModel input) { | ||
37 | println(input) | ||
38 | val res = QualifiedName.create(input.packageName.split("\\.")) | ||
39 | println(res.toString) | ||
40 | return res | ||
41 | } | ||
42 | } | ||
32 | 43 | ||
33 | override getScope(EObject context, EReference reference) { | 44 | override getScope(EObject context, EReference reference) { |
34 | val document = EcoreUtil2.getContainerOfType(context,ConfigurationScript) | 45 | val document = EcoreUtil2.getContainerOfType(context,ConfigurationScript) |
35 | if(context instanceof MetamodelElement) { | 46 | if(context instanceof MetamodelElement) { |
36 | context.scopeForMetamodelElement(reference,document) | 47 | return context.scopeForMetamodelElement(reference,document) |
37 | } else if(context instanceof MetamodelSpecification) { | 48 | } else if(context instanceof MetamodelSpecification) { |
38 | context.scopeForMetamodelSpecification(reference,document) | 49 | return context.scopeForMetamodelSpecification(reference,document) |
39 | } else if(context instanceof AllPackageEntry){ | 50 | } else if(context instanceof AllPackageEntry){ |
40 | context.scopeForAllPackageEntry(reference,document) | 51 | return context.scopeForAllPackageEntry(reference,document) |
41 | } else if(context instanceof PatternElement) { | 52 | } else if(context instanceof PatternElement) { |
42 | context.scopeForPatternElement(reference,document) | 53 | return context.scopeForPatternElement(reference,document) |
43 | } else if(context instanceof PatternSpecification) { | 54 | } else if(context instanceof PatternSpecification) { |
44 | context.scopeForPatternSpecification(reference,document) | 55 | return context.scopeForPatternSpecification(reference,document) |
45 | } else if(context instanceof AllPatternEntry) { | 56 | } else if(context instanceof AllPatternEntry) { |
46 | context.scopeForAllPatternEntry(reference,document) | 57 | return context.scopeForAllPatternEntry(reference,document) |
47 | } else { | 58 | } else { |
48 | return super.getScope(context,reference) | 59 | return super.getScope(context,reference) |
49 | } | 60 | } |
@@ -111,11 +122,13 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
111 | } | 122 | } |
112 | } | 123 | } |
113 | 124 | ||
125 | // Todo [] scope | ||
126 | |||
114 | ////////// | 127 | ////////// |
115 | 128 | ||
116 | protected def scopeForPatternElement(PatternElement context, EReference reference, ConfigurationScript document) { | 129 | protected def scopeForPatternElement(PatternElement context, EReference reference, ConfigurationScript document) { |
117 | if(reference === language.patternEntry_Package) { | 130 | if(reference === language.patternEntry_Package) { |
118 | return Scopes.scopeFor(document.allViatraPackages) | 131 | return Scopes.scopeFor(document.allViatraPackages,nameConverter,super.getScope(context,reference)) |
119 | } else if(reference === language.patternElement_Pattern) { | 132 | } else if(reference === language.patternElement_Pattern) { |
120 | if(context.package !== null) { | 133 | if(context.package !== null) { |
121 | return Scopes.scopeFor(context.package.patterns) | 134 | return Scopes.scopeFor(context.package.patterns) |
@@ -129,7 +142,7 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
129 | 142 | ||
130 | protected def scopeForPatternSpecification(PatternSpecification context, EReference reference, ConfigurationScript document) { | 143 | protected def scopeForPatternSpecification(PatternSpecification context, EReference reference, ConfigurationScript document) { |
131 | if(reference === language.patternEntry_Package) { | 144 | if(reference === language.patternEntry_Package) { |
132 | return Scopes.scopeFor(document.allViatraPackages) | 145 | return Scopes.scopeFor(document.allViatraPackages,nameConverter,super.getScope(context,reference)) |
133 | } else if(reference ===language.patternElement_Pattern) { | 146 | } else if(reference ===language.patternElement_Pattern) { |
134 | return Scopes.scopeFor(document.allPatterns) | 147 | return Scopes.scopeFor(document.allPatterns) |
135 | } else { | 148 | } else { |
@@ -139,7 +152,8 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
139 | 152 | ||
140 | protected def scopeForAllPatternEntry(AllPatternEntry context, EReference reference, ConfigurationScript document) { | 153 | protected def scopeForAllPatternEntry(AllPatternEntry context, EReference reference, ConfigurationScript document) { |
141 | if(reference === language.patternEntry_Package) { | 154 | if(reference === language.patternEntry_Package) { |
142 | return Scopes.scopeFor(document.allViatraPackages) | 155 | val res = Scopes.scopeFor(document.allViatraPackages,nameConverter,super.getScope(context,reference)) |
156 | return res | ||
143 | } else if(reference === language.patternElement_Pattern) { | 157 | } else if(reference === language.patternElement_Pattern) { |
144 | if(context.package === null) { | 158 | if(context.package === null) { |
145 | return Scopes.scopeFor(document.allPatterns) | 159 | return Scopes.scopeFor(document.allPatterns) |