diff options
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu')
2 files changed, 27 insertions, 13 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 3efde6ec..1d12b3f7 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 | |||
@@ -112,7 +112,7 @@ TypeScope: '#' type = TypeReference | |||
112 | ('..' (maxUnlimited?='*' | max=INT))? | 112 | ('..' (maxUnlimited?='*' | max=INT))? |
113 | ; | 113 | ; |
114 | TypeReference: ClassReference | ObjectReference | IntegerReference | RealReference | StringReference; | 114 | TypeReference: ClassReference | ObjectReference | IntegerReference | RealReference | StringReference; |
115 | ClassReference: '[' element = MetamodelElement ']'; | 115 | ClassReference: '<' element = MetamodelElement '>'; |
116 | ObjectReference: {ObjectReference} 'node'; | 116 | ObjectReference: {ObjectReference} 'node'; |
117 | IntegerReference: {IntegerScope} 'int'; | 117 | IntegerReference: {IntegerScope} 'int'; |
118 | RealReference: {RealScope} 'real'; | 118 | RealReference: {RealScope} 'real'; |
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 ea0e8d1e..8973e7cf 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 | |||
@@ -3,25 +3,27 @@ | |||
3 | */ | 3 | */ |
4 | package hu.bme.mit.inf.dslreasoner.application.scoping | 4 | package hu.bme.mit.inf.dslreasoner.application.scoping |
5 | 5 | ||
6 | import org.eclipse.emf.ecore.EObject | 6 | import com.google.common.base.Function |
7 | import org.eclipse.emf.ecore.EReference | 7 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.AllPackageEntry |
8 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelElement | 8 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.AllPatternEntry |
9 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage | 9 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage |
10 | import org.eclipse.xtext.EcoreUtil2 | 10 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ClassReference |
11 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript | 11 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript |
12 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport | 12 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport |
13 | import org.eclipse.xtext.scoping.Scopes | 13 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelElement |
14 | import org.eclipse.emf.ecore.EClass | ||
15 | import org.eclipse.emf.ecore.EEnum | ||
16 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelSpecification | 14 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelSpecification |
17 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.AllPackageEntry | ||
18 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternElement | 15 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternElement |
19 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.AllPatternEntry | ||
20 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternSpecification | 16 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternSpecification |
21 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport | 17 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport |
22 | import com.google.common.base.Function | 18 | import org.eclipse.emf.ecore.EClass |
19 | import org.eclipse.emf.ecore.EEnum | ||
20 | import org.eclipse.emf.ecore.EObject | ||
21 | import org.eclipse.emf.ecore.EReference | ||
23 | import org.eclipse.viatra.query.patternlanguage.patternLanguage.PatternModel | 22 | import org.eclipse.viatra.query.patternlanguage.patternLanguage.PatternModel |
23 | import org.eclipse.xtext.EcoreUtil2 | ||
24 | import org.eclipse.xtext.naming.QualifiedName | 24 | import org.eclipse.xtext.naming.QualifiedName |
25 | import org.eclipse.xtext.scoping.IScope | ||
26 | import org.eclipse.xtext.scoping.Scopes | ||
25 | 27 | ||
26 | /** | 28 | /** |
27 | * This class contains custom scoping description. | 29 | * This class contains custom scoping description. |
@@ -55,7 +57,9 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
55 | return context.scopeForPatternSpecification(reference,document) | 57 | return context.scopeForPatternSpecification(reference,document) |
56 | } else if(context instanceof AllPatternEntry) { | 58 | } else if(context instanceof AllPatternEntry) { |
57 | return context.scopeForAllPatternEntry(reference,document) | 59 | return context.scopeForAllPatternEntry(reference,document) |
58 | } else { | 60 | } else if(context instanceof ClassReference) { |
61 | return context.scopeForClassReference(reference,document) | ||
62 | }else { | ||
59 | return super.getScope(context,reference) | 63 | return super.getScope(context,reference) |
60 | } | 64 | } |
61 | } | 65 | } |
@@ -122,7 +126,17 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
122 | } | 126 | } |
123 | } | 127 | } |
124 | 128 | ||
125 | // Todo [] scope | 129 | ////////// |
130 | |||
131 | def IScope scopeForClassReference(ClassReference classReference, EReference eReference, ConfigurationScript document) { | ||
132 | if(eReference === language.metamodelEntry_Package) { | ||
133 | return Scopes.scopeFor(document.allEPackages) | ||
134 | } else if(eReference === language.metamodelElement_Classifier) { | ||
135 | Scopes.scopeFor(document.allEClassifiers) | ||
136 | } else { | ||
137 | return super.getScope(classReference,eReference) | ||
138 | } | ||
139 | } | ||
126 | 140 | ||
127 | ////////// | 141 | ////////// |
128 | 142 | ||