Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2012-03-20 05:36:55 -0400
committerptessier2012-03-20 05:36:55 -0400
commita1a209068ac085895fc552129e0de015bfb8deeb (patch)
treec1470ea633d802482de4da47c066aa5492938659 /plugins/uml/alf/org.eclipse.papyrus.uml.alf/src/org/eclipse/papyrus/uml/alf/GenerateAlf.mwe2
parente543da634be6fffe1947a864b20d8408d0ea70bb (diff)
downloadorg.eclipse.papyrus-a1a209068ac085895fc552129e0de015bfb8deeb.tar.gz
org.eclipse.papyrus-a1a209068ac085895fc552129e0de015bfb8deeb.tar.xz
org.eclipse.papyrus-a1a209068ac085895fc552129e0de015bfb8deeb.zip
329865: [ALF editor] Papyrus shall provide a specific textual editor for ALF.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329865
Diffstat (limited to 'plugins/uml/alf/org.eclipse.papyrus.uml.alf/src/org/eclipse/papyrus/uml/alf/GenerateAlf.mwe2')
-rw-r--r--plugins/uml/alf/org.eclipse.papyrus.uml.alf/src/org/eclipse/papyrus/uml/alf/GenerateAlf.mwe2114
1 files changed, 114 insertions, 0 deletions
diff --git a/plugins/uml/alf/org.eclipse.papyrus.uml.alf/src/org/eclipse/papyrus/uml/alf/GenerateAlf.mwe2 b/plugins/uml/alf/org.eclipse.papyrus.uml.alf/src/org/eclipse/papyrus/uml/alf/GenerateAlf.mwe2
new file mode 100644
index 00000000000..109432a4f4b
--- /dev/null
+++ b/plugins/uml/alf/org.eclipse.papyrus.uml.alf/src/org/eclipse/papyrus/uml/alf/GenerateAlf.mwe2
@@ -0,0 +1,114 @@
+module org.eclipse.papyrus.uml.alf.Alf
+
+import org.eclipse.emf.mwe.utils.*
+import org.eclipse.xtext.generator.*
+import org.eclipse.xtext.ui.generator.*
+
+var grammarURI = "classpath:/org/eclipse/papyrus/alf/Alf.xtext"
+var file.extensions = "alf"
+var projectName = "org.eclipse.papyrus.uml.alf"
+var runtimeProject = "../${projectName}"
+
+Workflow {
+ bean = StandaloneSetup {
+ scanClassPath = true
+ platformUri = "${runtimeProject}/.."
+ }
+
+ component = DirectoryCleaner {
+ directory = "${runtimeProject}/src-gen"
+ }
+
+ component = DirectoryCleaner {
+ directory = "${runtimeProject}.ui/src-gen"
+ }
+
+
+
+
+ component = Generator {
+ pathRtProject = runtimeProject
+ pathUiProject = "${runtimeProject}.ui"
+ projectNameRt = projectName
+ projectNameUi = "${projectName}.ui"
+ language = {
+ uri = grammarURI
+ fileExtensions = file.extensions
+
+ // Java API to access grammar elements (required by several other fragments)
+ fragment = grammarAccess.GrammarAccessFragment {}
+
+ // generates Java API for the generated EPackages
+ fragment = ecore.EcoreGeneratorFragment {
+ // referencedGenModels = "uri to genmodel, uri to next genmodel"
+ }
+ // Serializer 2.0
+ fragment = serializer.SerializerFragment {
+ generateStub = false
+ }
+
+
+ // a custom ResourceFactory for use with EMF
+ fragment = resourceFactory.ResourceFactoryFragment {
+ fileExtensions = file.extensions
+ }
+
+ // The antlr parser generator fragment.
+ fragment = parser.antlr.XtextAntlrGeneratorFragment {
+ //options = {
+ // backtrack = true
+ //}
+ }
+
+ // java-based API for validation
+ fragment = validation.JavaValidatorFragment {
+ composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
+ // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
+ // registerForImportedPackages = true
+ }
+
+ // scoping and exporting API
+ fragment = scoping.ImportURIScopingFragment {}
+ fragment = exporting.SimpleNamesFragment {}
+
+ // scoping and exporting API
+ //fragment = scoping.ImportNamespacesScopingFragment {}
+ //fragment = exporting.QualifiedNamesFragment {}
+ //fragment = builder.BuilderIntegrationFragment {}
+
+ // generator API
+ fragment = generator.GeneratorFragment {
+ generateMwe = false
+ generateJavaMain = false
+ }
+ // formatter API
+ fragment = formatting.FormatterFragment {}
+
+ // labeling API
+ fragment = labeling.LabelProviderFragment {}
+
+ // outline API
+ fragment = outline.OutlineTreeProviderFragment {}
+ fragment = outline.QuickOutlineFragment {}
+
+ // quickfix API
+ fragment = quickfix.QuickfixProviderFragment {}
+
+ // content assist API
+ fragment = contentAssist.JavaBasedContentAssistFragment {}
+
+ // generates a more lightweight Antlr parser and lexer tailored for content assist
+ fragment = parser.antlr.XtextAntlrUiGeneratorFragment {
+ //options = {
+ // backtrack = true
+ //}
+ }
+
+ // project wizard (optional)
+ // fragment = projectWizard.SimpleProjectWizardFragment {
+ // generatorProjectName = "${projectName}.generator"
+ // modelFileExtension = file.extensions
+ // }
+ }
+ }
+}

Back to the top