diff options
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen')
21 files changed, 491 insertions, 0 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/.CftLanguageRuntimeModule.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/.CftLanguageRuntimeModule.xtendbin new file mode 100644 index 00000000..5f61bd34 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/.CftLanguageRuntimeModule.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/.CftLanguageStandaloneSetup.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/.CftLanguageStandaloneSetup.xtendbin new file mode 100644 index 00000000..deb1eee6 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/.CftLanguageStandaloneSetup.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/.gitignore new file mode 100644 index 00000000..b3125e3f --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/.gitignore | |||
@@ -0,0 +1,2 @@ | |||
1 | /.CftLanguageRuntimeModule.java._trace | ||
2 | /.CftLanguageStandaloneSetup.java._trace | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/CftLanguageRuntimeModule.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/CftLanguageRuntimeModule.java new file mode 100644 index 00000000..c63cd33c --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/CftLanguageRuntimeModule.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | * generated by Xtext 2.16.0 | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components; | ||
5 | |||
6 | import com.google.inject.Binder; | ||
7 | import com.google.inject.name.Names; | ||
8 | import hu.bme.mit.inf.dslreasoner.faulttree.components.AbstractCftLanguageRuntimeModule; | ||
9 | import hu.bme.mit.inf.dslreasoner.faulttree.components.naming.CftLanguageQualifiedNameProvider; | ||
10 | import hu.bme.mit.inf.dslreasoner.faulttree.components.scoping.CftLanguageImportedNamespaceAwareLocalScopeProvider; | ||
11 | import org.eclipse.xtext.naming.IQualifiedNameProvider; | ||
12 | import org.eclipse.xtext.scoping.IGlobalScopeProvider; | ||
13 | import org.eclipse.xtext.scoping.IScopeProvider; | ||
14 | import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider; | ||
15 | import org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider; | ||
16 | |||
17 | /** | ||
18 | * Use this class to register components to be used at runtime / without the Equinox extension registry. | ||
19 | */ | ||
20 | @SuppressWarnings("all") | ||
21 | public class CftLanguageRuntimeModule extends AbstractCftLanguageRuntimeModule { | ||
22 | @Override | ||
23 | public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { | ||
24 | return DefaultGlobalScopeProvider.class; | ||
25 | } | ||
26 | |||
27 | @Override | ||
28 | public void configureIScopeProviderDelegate(final Binder binder) { | ||
29 | binder.<IScopeProvider>bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to( | ||
30 | CftLanguageImportedNamespaceAwareLocalScopeProvider.class); | ||
31 | } | ||
32 | |||
33 | @Override | ||
34 | public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() { | ||
35 | return CftLanguageQualifiedNameProvider.class; | ||
36 | } | ||
37 | } | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/CftLanguageStandaloneSetup.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/CftLanguageStandaloneSetup.java new file mode 100644 index 00000000..3eed418e --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/CftLanguageStandaloneSetup.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /** | ||
2 | * generated by Xtext 2.16.0 | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguageStandaloneSetupGenerated; | ||
7 | |||
8 | /** | ||
9 | * Initialization support for running Xtext languages without Equinox extension registry. | ||
10 | */ | ||
11 | @SuppressWarnings("all") | ||
12 | public class CftLanguageStandaloneSetup extends CftLanguageStandaloneSetupGenerated { | ||
13 | public static void doSetup() { | ||
14 | new CftLanguageStandaloneSetup().createInjectorAndDoEMFRegistration(); | ||
15 | } | ||
16 | } | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/generator/.CftLanguageGenerator.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/generator/.CftLanguageGenerator.xtendbin new file mode 100644 index 00000000..a974921d --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/generator/.CftLanguageGenerator.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/generator/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/generator/.gitignore new file mode 100644 index 00000000..c1d8820b --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/generator/.gitignore | |||
@@ -0,0 +1 @@ | |||
/.CftLanguageGenerator.java._trace | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/generator/CftLanguageGenerator.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/generator/CftLanguageGenerator.java new file mode 100644 index 00000000..8dddfb2e --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/generator/CftLanguageGenerator.java | |||
@@ -0,0 +1,21 @@ | |||
1 | /** | ||
2 | * generated by Xtext 2.16.0 | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.generator; | ||
5 | |||
6 | import org.eclipse.emf.ecore.resource.Resource; | ||
7 | import org.eclipse.xtext.generator.AbstractGenerator; | ||
8 | import org.eclipse.xtext.generator.IFileSystemAccess2; | ||
9 | import org.eclipse.xtext.generator.IGeneratorContext; | ||
10 | |||
11 | /** | ||
12 | * Generates code from your model files on save. | ||
13 | * | ||
14 | * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation | ||
15 | */ | ||
16 | @SuppressWarnings("all") | ||
17 | public class CftLanguageGenerator extends AbstractGenerator { | ||
18 | @Override | ||
19 | public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) { | ||
20 | } | ||
21 | } | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/.CftLanguageQualifiedNameProvider.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/.CftLanguageQualifiedNameProvider.xtendbin new file mode 100644 index 00000000..73ada4f1 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/.CftLanguageQualifiedNameProvider.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/.PackageNameProvider.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/.PackageNameProvider.xtendbin new file mode 100644 index 00000000..6f4eaae7 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/.PackageNameProvider.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/.gitignore new file mode 100644 index 00000000..b982f16c --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/.gitignore | |||
@@ -0,0 +1,2 @@ | |||
1 | /.CftLanguageQualifiedNameProvider.java._trace | ||
2 | /.PackageNameProvider.java._trace | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/CftLanguageQualifiedNameProvider.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/CftLanguageQualifiedNameProvider.java new file mode 100644 index 00000000..4e0607dd --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/CftLanguageQualifiedNameProvider.java | |||
@@ -0,0 +1,35 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.components.naming; | ||
2 | |||
3 | import com.google.inject.Inject; | ||
4 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.ComponentDefinition; | ||
5 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.TransformationDefinition; | ||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.components.naming.PackageNameProvider; | ||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider; | ||
9 | import org.eclipse.xtext.naming.QualifiedName; | ||
10 | |||
11 | @SuppressWarnings("all") | ||
12 | public class CftLanguageQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider { | ||
13 | @Inject | ||
14 | private PackageNameProvider packageNameProvider; | ||
15 | |||
16 | public QualifiedName qualifiedName(final ComponentDefinition componentDefinition) { | ||
17 | return this.computePackageQualifiedName(componentDefinition, componentDefinition.getName()); | ||
18 | } | ||
19 | |||
20 | public QualifiedName qualifiedName(final TransformationDefinition transformationDefinition) { | ||
21 | return this.computePackageQualifiedName(transformationDefinition, transformationDefinition.getName()); | ||
22 | } | ||
23 | |||
24 | private QualifiedName computePackageQualifiedName(final EObject eObj, final String name) { | ||
25 | QualifiedName _xblockexpression = null; | ||
26 | { | ||
27 | if ((name == null)) { | ||
28 | return null; | ||
29 | } | ||
30 | final QualifiedName packageQualifier = this.packageNameProvider.getPackageName(eObj); | ||
31 | _xblockexpression = packageQualifier.append(name); | ||
32 | } | ||
33 | return _xblockexpression; | ||
34 | } | ||
35 | } | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.java new file mode 100644 index 00000000..5841dc75 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.java | |||
@@ -0,0 +1,46 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.components.naming; | ||
2 | |||
3 | import com.google.inject.Inject; | ||
4 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.CftModel; | ||
5 | import org.eclipse.emf.ecore.EObject; | ||
6 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor; | ||
7 | import org.eclipse.xtext.EcoreUtil2; | ||
8 | import org.eclipse.xtext.naming.IQualifiedNameConverter; | ||
9 | import org.eclipse.xtext.naming.QualifiedName; | ||
10 | import org.eclipse.xtext.xbase.lib.StringExtensions; | ||
11 | |||
12 | @SuppressWarnings("all") | ||
13 | public class PackageNameProvider { | ||
14 | private final IQualifiedNameConverter qualifiedNameConverter; | ||
15 | |||
16 | @FinalFieldsConstructor | ||
17 | @Inject | ||
18 | public PackageNameProvider(final IQualifiedNameConverter qualifiedNameConverter) { | ||
19 | super(); | ||
20 | this.qualifiedNameConverter = qualifiedNameConverter; | ||
21 | } | ||
22 | |||
23 | public QualifiedName getPackageName(final EObject eObj) { | ||
24 | QualifiedName _xblockexpression = null; | ||
25 | { | ||
26 | if ((eObj == null)) { | ||
27 | return QualifiedName.EMPTY; | ||
28 | } | ||
29 | CftModel _containerOfType = EcoreUtil2.<CftModel>getContainerOfType(eObj, CftModel.class); | ||
30 | String _packageName = null; | ||
31 | if (_containerOfType!=null) { | ||
32 | _packageName=_containerOfType.getPackageName(); | ||
33 | } | ||
34 | final String pacakgeName = _packageName; | ||
35 | QualifiedName _xifexpression = null; | ||
36 | boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(pacakgeName); | ||
37 | if (_isNullOrEmpty) { | ||
38 | _xifexpression = QualifiedName.EMPTY; | ||
39 | } else { | ||
40 | _xifexpression = this.qualifiedNameConverter.toQualifiedName(pacakgeName); | ||
41 | } | ||
42 | _xblockexpression = _xifexpression; | ||
43 | } | ||
44 | return _xblockexpression; | ||
45 | } | ||
46 | } | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/.CftLanguageImportedNamespaceAwareLocalScopeProvider.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/.CftLanguageImportedNamespaceAwareLocalScopeProvider.xtendbin new file mode 100644 index 00000000..4a0036bd --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/.CftLanguageImportedNamespaceAwareLocalScopeProvider.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/.CftLanguageScopeProvider.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/.CftLanguageScopeProvider.xtendbin new file mode 100644 index 00000000..722c0e58 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/.CftLanguageScopeProvider.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/.gitignore new file mode 100644 index 00000000..75285868 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/.gitignore | |||
@@ -0,0 +1,4 @@ | |||
1 | /.CftLanguageScopeProvider.java._trace | ||
2 | /.CftLanguageImportedNamespaceAwareScopeProvider.java._trace | ||
3 | /.CftLanguageImportedNamespaceAwareScopeLocalProvider.java._trace | ||
4 | /.CftLanguageImportedNamespaceAwareLocalScopeProvider.java._trace | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageImportedNamespaceAwareLocalScopeProvider.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageImportedNamespaceAwareLocalScopeProvider.java new file mode 100644 index 00000000..d90fe787 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageImportedNamespaceAwareLocalScopeProvider.java | |||
@@ -0,0 +1,63 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.components.scoping; | ||
2 | |||
3 | import com.google.inject.Inject; | ||
4 | import com.google.inject.Singleton; | ||
5 | import hu.bme.mit.inf.dslreasoner.faulttree.components.naming.PackageNameProvider; | ||
6 | import java.util.List; | ||
7 | import org.eclipse.emf.ecore.EClass; | ||
8 | import org.eclipse.emf.ecore.EObject; | ||
9 | import org.eclipse.emf.ecore.EReference; | ||
10 | import org.eclipse.xtext.naming.IQualifiedNameConverter; | ||
11 | import org.eclipse.xtext.naming.IQualifiedNameProvider; | ||
12 | import org.eclipse.xtext.naming.QualifiedName; | ||
13 | import org.eclipse.xtext.scoping.ICaseInsensitivityHelper; | ||
14 | import org.eclipse.xtext.scoping.IGlobalScopeProvider; | ||
15 | import org.eclipse.xtext.scoping.IScope; | ||
16 | import org.eclipse.xtext.scoping.impl.ImportNormalizer; | ||
17 | import org.eclipse.xtext.scoping.impl.ImportScope; | ||
18 | import org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider; | ||
19 | |||
20 | @Singleton | ||
21 | @SuppressWarnings("all") | ||
22 | public class CftLanguageImportedNamespaceAwareLocalScopeProvider extends ImportedNamespaceAwareLocalScopeProvider { | ||
23 | @Inject | ||
24 | private PackageNameProvider packageNameProvider; | ||
25 | |||
26 | @Inject | ||
27 | public CftLanguageImportedNamespaceAwareLocalScopeProvider() { | ||
28 | } | ||
29 | |||
30 | public CftLanguageImportedNamespaceAwareLocalScopeProvider(final IGlobalScopeProvider globalScopeProvider, final IQualifiedNameProvider qualifiedNameProvider, final IQualifiedNameConverter qualifiedNameConverter, final ICaseInsensitivityHelper caseInsensitivityHelper) { | ||
31 | super(globalScopeProvider, qualifiedNameProvider, qualifiedNameConverter, caseInsensitivityHelper); | ||
32 | PackageNameProvider _packageNameProvider = new PackageNameProvider(qualifiedNameConverter); | ||
33 | this.packageNameProvider = _packageNameProvider; | ||
34 | } | ||
35 | |||
36 | @Override | ||
37 | protected List<ImportNormalizer> internalGetImportedNamespaceResolvers(final EObject context, final boolean ignoreCase) { | ||
38 | List<ImportNormalizer> _xblockexpression = null; | ||
39 | { | ||
40 | final List<ImportNormalizer> resolvers = super.internalGetImportedNamespaceResolvers(context, ignoreCase); | ||
41 | final QualifiedName packageName = this.packageNameProvider.getPackageName(context); | ||
42 | boolean _isEmpty = packageName.isEmpty(); | ||
43 | boolean _not = (!_isEmpty); | ||
44 | if (_not) { | ||
45 | final ImportNormalizer packageNormalizer = this.doCreateImportNormalizer(packageName, true, ignoreCase); | ||
46 | resolvers.add(0, packageNormalizer); | ||
47 | } | ||
48 | _xblockexpression = resolvers; | ||
49 | } | ||
50 | return _xblockexpression; | ||
51 | } | ||
52 | |||
53 | public ImportScope createImportNormalizedScope(final IScope elements, final EObject context, final EReference reference) { | ||
54 | ImportScope _xblockexpression = null; | ||
55 | { | ||
56 | final boolean ignoreCase = this.isIgnoreCase(reference); | ||
57 | final EClass type = reference.getEReferenceType(); | ||
58 | final List<ImportNormalizer> namespaceResolvers = this.getImportedNamespaceResolvers(context, ignoreCase); | ||
59 | _xblockexpression = this.createImportScope(elements, namespaceResolvers, null, type, ignoreCase); | ||
60 | } | ||
61 | return _xblockexpression; | ||
62 | } | ||
63 | } | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageScopeProvider.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageScopeProvider.java new file mode 100644 index 00000000..0149c8d1 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageScopeProvider.java | |||
@@ -0,0 +1,248 @@ | |||
1 | /** | ||
2 | * generated by Xtext 2.16.0 | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.scoping; | ||
5 | |||
6 | import com.google.common.base.Objects; | ||
7 | import com.google.common.collect.Lists; | ||
8 | import com.google.inject.Inject; | ||
9 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.CftLanguagePackage; | ||
10 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.ComponentDefinition; | ||
11 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.ComponentInstance; | ||
12 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.EventDeclaration; | ||
13 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.EventReference; | ||
14 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.LookupDefinition; | ||
15 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingDefinition; | ||
16 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingParameter; | ||
17 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.TransformationDefinition; | ||
18 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.Variable; | ||
19 | import hu.bme.mit.inf.dslreasoner.faulttree.components.scoping.AbstractCftLanguageScopeProvider; | ||
20 | import hu.bme.mit.inf.dslreasoner.faulttree.components.scoping.CftLanguageImportedNamespaceAwareLocalScopeProvider; | ||
21 | import java.util.ArrayList; | ||
22 | import org.eclipse.emf.common.notify.Notifier; | ||
23 | import org.eclipse.emf.ecore.EObject; | ||
24 | import org.eclipse.emf.ecore.EReference; | ||
25 | import org.eclipse.emf.ecore.resource.ResourceSet; | ||
26 | import org.eclipse.viatra.query.patternlanguage.emf.vql.Pattern; | ||
27 | import org.eclipse.xtext.EcoreUtil2; | ||
28 | import org.eclipse.xtext.naming.QualifiedName; | ||
29 | import org.eclipse.xtext.resource.EObjectDescription; | ||
30 | import org.eclipse.xtext.resource.IEObjectDescription; | ||
31 | import org.eclipse.xtext.resource.IResourceDescriptions; | ||
32 | import org.eclipse.xtext.resource.IResourceDescriptionsProvider; | ||
33 | import org.eclipse.xtext.scoping.IScope; | ||
34 | import org.eclipse.xtext.scoping.Scopes; | ||
35 | import org.eclipse.xtext.scoping.impl.ImportScope; | ||
36 | import org.eclipse.xtext.scoping.impl.SimpleScope; | ||
37 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | ||
38 | import org.eclipse.xtext.xbase.lib.Functions.Function1; | ||
39 | import org.eclipse.xtext.xbase.lib.IterableExtensions; | ||
40 | |||
41 | /** | ||
42 | * This class contains custom scoping description. | ||
43 | * | ||
44 | * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping | ||
45 | * on how and when to use it. | ||
46 | */ | ||
47 | @SuppressWarnings("all") | ||
48 | public class CftLanguageScopeProvider extends AbstractCftLanguageScopeProvider { | ||
49 | public static final String SINGLETON_VARIABLE_PREFIX = "_"; | ||
50 | |||
51 | @Inject | ||
52 | private IResourceDescriptionsProvider resourceDescriptionsProvider; | ||
53 | |||
54 | @Inject | ||
55 | private CftLanguageImportedNamespaceAwareLocalScopeProvider importedNamespaceProvider; | ||
56 | |||
57 | @Override | ||
58 | public IScope getScope(final EObject context, final EReference reference) { | ||
59 | IScope _switchResult = null; | ||
60 | boolean _matched = false; | ||
61 | if (Objects.equal(reference, CftLanguagePackage.Literals.LOOKUP_DEFINITION__MAPPING)) { | ||
62 | _matched=true; | ||
63 | _switchResult = this.getRuleDefinitionsScope(context, reference); | ||
64 | } | ||
65 | if (!_matched) { | ||
66 | if (Objects.equal(reference, CftLanguagePackage.Literals.LOOKUP_DEFINITION__ARGUMENTS)) { | ||
67 | _matched=true; | ||
68 | _switchResult = this.getMappingParametersScope(context); | ||
69 | } | ||
70 | } | ||
71 | if (!_matched) { | ||
72 | if (Objects.equal(reference, CftLanguagePackage.Literals.EVENT_REFERENCE__COMPONENT)) { | ||
73 | _matched=true; | ||
74 | _switchResult = this.getComponentInstancesScope(context); | ||
75 | } | ||
76 | } | ||
77 | if (!_matched) { | ||
78 | if (Objects.equal(reference, CftLanguagePackage.Literals.EVENT_REFERENCE__EVENT)) { | ||
79 | _matched=true; | ||
80 | _switchResult = this.getEventDeclarationsScope(context); | ||
81 | } | ||
82 | } | ||
83 | if (!_matched) { | ||
84 | _switchResult = super.getScope(context, reference); | ||
85 | } | ||
86 | return _switchResult; | ||
87 | } | ||
88 | |||
89 | protected IScope getRuleDefinitionsScope(final EObject context, final EReference referece) { | ||
90 | ImportScope _xblockexpression = null; | ||
91 | { | ||
92 | final TransformationDefinition transformationDefinition = EcoreUtil2.<TransformationDefinition>getContainerOfType(context, TransformationDefinition.class); | ||
93 | if ((transformationDefinition == null)) { | ||
94 | return IScope.NULLSCOPE; | ||
95 | } | ||
96 | final IResourceDescriptions resourceDescriptions = this.getResourceDescriptions(transformationDefinition); | ||
97 | final ArrayList<IEObjectDescription> mappingDefinitionDescriptions = this.toMappingDefinitionDescriptions(resourceDescriptions, | ||
98 | transformationDefinition.getMappingDefinitions()); | ||
99 | final SimpleScope ruleDefinitionsScope = new SimpleScope(IScope.NULLSCOPE, mappingDefinitionDescriptions); | ||
100 | _xblockexpression = this.importedNamespaceProvider.createImportNormalizedScope(ruleDefinitionsScope, context, referece); | ||
101 | } | ||
102 | return _xblockexpression; | ||
103 | } | ||
104 | |||
105 | protected ArrayList<IEObjectDescription> toMappingDefinitionDescriptions(final IResourceDescriptions resourceDescriptions, final Iterable<? extends MappingDefinition> ruleDefinitions) { | ||
106 | ArrayList<IEObjectDescription> _xblockexpression = null; | ||
107 | { | ||
108 | final ArrayList<IEObjectDescription> mappingDefinitionDescriptions = Lists.<IEObjectDescription>newArrayListWithExpectedSize(IterableExtensions.size(ruleDefinitions)); | ||
109 | for (final MappingDefinition ruleDefinition : ruleDefinitions) { | ||
110 | { | ||
111 | Pattern _pattern = null; | ||
112 | if (ruleDefinition!=null) { | ||
113 | _pattern=ruleDefinition.getPattern(); | ||
114 | } | ||
115 | final Pattern pattern = _pattern; | ||
116 | if ((pattern != null)) { | ||
117 | IEObjectDescription _head = IterableExtensions.<IEObjectDescription>head(resourceDescriptions.getExportedObjectsByObject(pattern)); | ||
118 | QualifiedName _qualifiedName = null; | ||
119 | if (_head!=null) { | ||
120 | _qualifiedName=_head.getQualifiedName(); | ||
121 | } | ||
122 | final QualifiedName patternName = _qualifiedName; | ||
123 | if ((patternName != null)) { | ||
124 | IEObjectDescription _create = EObjectDescription.create(patternName, ruleDefinition); | ||
125 | mappingDefinitionDescriptions.add(_create); | ||
126 | } | ||
127 | } | ||
128 | } | ||
129 | } | ||
130 | _xblockexpression = mappingDefinitionDescriptions; | ||
131 | } | ||
132 | return _xblockexpression; | ||
133 | } | ||
134 | |||
135 | private IResourceDescriptions getResourceDescriptions(final Notifier notifier) { | ||
136 | IResourceDescriptions _xblockexpression = null; | ||
137 | { | ||
138 | final ResourceSet resourceSet = EcoreUtil2.getResourceSet(notifier); | ||
139 | IResourceDescriptions _xifexpression = null; | ||
140 | if ((resourceSet == null)) { | ||
141 | _xifexpression = new IResourceDescriptions.NullImpl(); | ||
142 | } else { | ||
143 | _xifexpression = this.resourceDescriptionsProvider.getResourceDescriptions(resourceSet); | ||
144 | } | ||
145 | _xblockexpression = _xifexpression; | ||
146 | } | ||
147 | return _xblockexpression; | ||
148 | } | ||
149 | |||
150 | protected IScope getMappingParametersScope(final EObject context) { | ||
151 | IScope _xblockexpression = null; | ||
152 | { | ||
153 | final MappingDefinition mappingDefinition = EcoreUtil2.<MappingDefinition>getContainerOfType(context, MappingDefinition.class); | ||
154 | if ((mappingDefinition == null)) { | ||
155 | return IScope.NULLSCOPE; | ||
156 | } | ||
157 | final Function1<MappingParameter, Boolean> _function = (MappingParameter it) -> { | ||
158 | boolean _startsWith = it.getName().startsWith(CftLanguageScopeProvider.SINGLETON_VARIABLE_PREFIX); | ||
159 | return Boolean.valueOf((!_startsWith)); | ||
160 | }; | ||
161 | final Iterable<MappingParameter> variables = IterableExtensions.<MappingParameter>filter(mappingDefinition.getParameters(), _function); | ||
162 | _xblockexpression = Scopes.scopeFor(variables); | ||
163 | } | ||
164 | return _xblockexpression; | ||
165 | } | ||
166 | |||
167 | protected IScope getComponentInstancesScope(final EObject context) { | ||
168 | IScope _xblockexpression = null; | ||
169 | { | ||
170 | final MappingDefinition mappingDefinition = EcoreUtil2.<MappingDefinition>getContainerOfType(context, MappingDefinition.class); | ||
171 | if ((mappingDefinition == null)) { | ||
172 | return IScope.NULLSCOPE; | ||
173 | } | ||
174 | final ArrayList<Variable> componentInstances = CollectionLiterals.<Variable>newArrayList(); | ||
175 | componentInstances.addAll(mappingDefinition.getLookupDefinitions()); | ||
176 | ComponentInstance _componentInstance = mappingDefinition.getComponentInstance(); | ||
177 | boolean _tripleNotEquals = (_componentInstance != null); | ||
178 | if (_tripleNotEquals) { | ||
179 | ComponentInstance _componentInstance_1 = mappingDefinition.getComponentInstance(); | ||
180 | componentInstances.add(_componentInstance_1); | ||
181 | } | ||
182 | _xblockexpression = Scopes.scopeFor(componentInstances); | ||
183 | } | ||
184 | return _xblockexpression; | ||
185 | } | ||
186 | |||
187 | protected IScope getEventDeclarationsScope(final EObject context) { | ||
188 | IScope _xblockexpression = null; | ||
189 | { | ||
190 | EventReference _containerOfType = EcoreUtil2.<EventReference>getContainerOfType(context, EventReference.class); | ||
191 | Variable _component = null; | ||
192 | if (_containerOfType!=null) { | ||
193 | _component=_containerOfType.getComponent(); | ||
194 | } | ||
195 | final Variable variable = _component; | ||
196 | ArrayList<EventDeclaration> _switchResult = null; | ||
197 | boolean _matched = false; | ||
198 | if (variable instanceof ComponentInstance) { | ||
199 | _matched=true; | ||
200 | ComponentDefinition _componentType = ((ComponentInstance)variable).getComponentType(); | ||
201 | ArrayList<EventDeclaration> _allEventDeclarations = null; | ||
202 | if (_componentType!=null) { | ||
203 | _allEventDeclarations=this.getAllEventDeclarations(_componentType); | ||
204 | } | ||
205 | _switchResult = _allEventDeclarations; | ||
206 | } | ||
207 | if (!_matched) { | ||
208 | if (variable instanceof LookupDefinition) { | ||
209 | _matched=true; | ||
210 | MappingDefinition _mapping = ((LookupDefinition)variable).getMapping(); | ||
211 | ComponentInstance _componentInstance = null; | ||
212 | if (_mapping!=null) { | ||
213 | _componentInstance=_mapping.getComponentInstance(); | ||
214 | } | ||
215 | ComponentDefinition _componentType = null; | ||
216 | if (_componentInstance!=null) { | ||
217 | _componentType=_componentInstance.getComponentType(); | ||
218 | } | ||
219 | ArrayList<EventDeclaration> _allEventDeclarations = null; | ||
220 | if (_componentType!=null) { | ||
221 | _allEventDeclarations=this.getAllEventDeclarations(_componentType); | ||
222 | } | ||
223 | _switchResult = _allEventDeclarations; | ||
224 | } | ||
225 | } | ||
226 | if (!_matched) { | ||
227 | _switchResult = null; | ||
228 | } | ||
229 | final ArrayList<EventDeclaration> events = _switchResult; | ||
230 | if ((events == null)) { | ||
231 | return IScope.NULLSCOPE; | ||
232 | } | ||
233 | _xblockexpression = Scopes.scopeFor(events); | ||
234 | } | ||
235 | return _xblockexpression; | ||
236 | } | ||
237 | |||
238 | private ArrayList<EventDeclaration> getAllEventDeclarations(final ComponentDefinition componentDefinition) { | ||
239 | ArrayList<EventDeclaration> _xblockexpression = null; | ||
240 | { | ||
241 | final ArrayList<EventDeclaration> eventDeclarations = CollectionLiterals.<EventDeclaration>newArrayList(); | ||
242 | eventDeclarations.addAll(componentDefinition.getInputEvents()); | ||
243 | eventDeclarations.addAll(componentDefinition.getEventDefinitions()); | ||
244 | _xblockexpression = eventDeclarations; | ||
245 | } | ||
246 | return _xblockexpression; | ||
247 | } | ||
248 | } | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/validation/.CftLanguageValidator.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/validation/.CftLanguageValidator.xtendbin new file mode 100644 index 00000000..c978854b --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/validation/.CftLanguageValidator.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/validation/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/validation/.gitignore new file mode 100644 index 00000000..9065804d --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/validation/.gitignore | |||
@@ -0,0 +1 @@ | |||
/.CftLanguageValidator.java._trace | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/validation/CftLanguageValidator.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/validation/CftLanguageValidator.java new file mode 100644 index 00000000..758d29f4 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/validation/CftLanguageValidator.java | |||
@@ -0,0 +1,15 @@ | |||
1 | /** | ||
2 | * generated by Xtext 2.16.0 | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.validation; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.components.validation.AbstractCftLanguageValidator; | ||
7 | |||
8 | /** | ||
9 | * This class contains custom validation rules. | ||
10 | * | ||
11 | * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation | ||
12 | */ | ||
13 | @SuppressWarnings("all") | ||
14 | public class CftLanguageValidator extends AbstractCftLanguageValidator { | ||
15 | } | ||