1 | module de.ugoe.cs.swe.bnftools.GenerateEBNF
|
---|
2 |
|
---|
3 | import org.eclipse.emf.mwe.utils.*
|
---|
4 | import org.eclipse.xtext.generator.*
|
---|
5 | import org.eclipse.xtext.ui.generator.*
|
---|
6 |
|
---|
7 | var grammarURI = "classpath:/de/ugoe/cs/swe/bnftools/EBNF.xtext"
|
---|
8 | var fileExtensions = "bnf"
|
---|
9 | var projectName = "de.ugoe.cs.swe.bnftools.ebnf"
|
---|
10 | var runtimeProject = "../${projectName}"
|
---|
11 | var generateXtendStub = true
|
---|
12 | var encoding = "UTF-8"
|
---|
13 |
|
---|
14 | Workflow {
|
---|
15 | bean = StandaloneSetup {
|
---|
16 | scanClassPath = true
|
---|
17 | platformUri = "${runtimeProject}/.."
|
---|
18 | // The following two lines can be removed, if Xbase is not used.
|
---|
19 | registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
|
---|
20 | registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
|
---|
21 | }
|
---|
22 |
|
---|
23 | component = DirectoryCleaner {
|
---|
24 | directory = "${runtimeProject}/src-gen"
|
---|
25 | }
|
---|
26 |
|
---|
27 | component = DirectoryCleaner {
|
---|
28 | directory = "${runtimeProject}/model"
|
---|
29 | }
|
---|
30 |
|
---|
31 | component = DirectoryCleaner {
|
---|
32 | directory = "${runtimeProject}.ui/src-gen"
|
---|
33 | }
|
---|
34 |
|
---|
35 | component = DirectoryCleaner {
|
---|
36 | directory = "${runtimeProject}.tests/src-gen"
|
---|
37 | }
|
---|
38 |
|
---|
39 | component = Generator {
|
---|
40 | pathRtProject = runtimeProject
|
---|
41 | pathUiProject = "${runtimeProject}.ui"
|
---|
42 | pathTestProject = "${runtimeProject}.tests"
|
---|
43 | projectNameRt = projectName
|
---|
44 | projectNameUi = "${projectName}.ui"
|
---|
45 | encoding = encoding
|
---|
46 | language = auto-inject {
|
---|
47 | uri = grammarURI
|
---|
48 |
|
---|
49 | // Java API to access grammar elements (required by several other fragments)
|
---|
50 | fragment = grammarAccess.GrammarAccessFragment auto-inject {}
|
---|
51 |
|
---|
52 | // generates Java API for the generated EPackages
|
---|
53 | fragment = ecore.EMFGeneratorFragment auto-inject {}
|
---|
54 |
|
---|
55 | // the old serialization component
|
---|
56 | // fragment = parseTreeConstructor.ParseTreeConstructorFragment auto-inject {}
|
---|
57 |
|
---|
58 | // serializer 2.0
|
---|
59 | fragment = serializer.SerializerFragment auto-inject {
|
---|
60 | generateStub = false
|
---|
61 | }
|
---|
62 |
|
---|
63 | // a custom ResourceFactory for use with EMF
|
---|
64 | fragment = resourceFactory.ResourceFactoryFragment auto-inject {}
|
---|
65 |
|
---|
66 | // The antlr parser generator fragment.
|
---|
67 | fragment = parser.antlr.XtextAntlrGeneratorFragment auto-inject {
|
---|
68 | // options = {
|
---|
69 | // backtrack = true
|
---|
70 | // }
|
---|
71 | }
|
---|
72 |
|
---|
73 | // Xtend-based API for validation
|
---|
74 | fragment = validation.ValidatorFragment auto-inject {
|
---|
75 | composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
|
---|
76 | // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
|
---|
77 | }
|
---|
78 |
|
---|
79 | // old scoping and exporting API
|
---|
80 | fragment = scoping.ImportURIScopingFragment auto-inject {}
|
---|
81 | fragment = exporting.SimpleNamesFragment auto-inject {}
|
---|
82 |
|
---|
83 | // scoping and exporting API
|
---|
84 | // fragment = scoping.ImportNamespacesScopingFragment auto-inject {}
|
---|
85 | // fragment = exporting.QualifiedNamesFragment auto-inject {}
|
---|
86 | // fragment = builder.BuilderIntegrationFragment auto-inject {}
|
---|
87 |
|
---|
88 | // generator API
|
---|
89 | fragment = generator.GeneratorFragment auto-inject {}
|
---|
90 |
|
---|
91 | // formatter API
|
---|
92 | fragment = formatting.FormatterFragment auto-inject {}
|
---|
93 |
|
---|
94 | // labeling API
|
---|
95 | fragment = labeling.LabelProviderFragment auto-inject {}
|
---|
96 |
|
---|
97 | // outline API
|
---|
98 | fragment = outline.OutlineTreeProviderFragment auto-inject {}
|
---|
99 | fragment = outline.QuickOutlineFragment auto-inject {}
|
---|
100 |
|
---|
101 | // quickfix API
|
---|
102 | fragment = quickfix.QuickfixProviderFragment auto-inject {}
|
---|
103 |
|
---|
104 | // content assist API
|
---|
105 | fragment = contentAssist.ContentAssistFragment auto-inject {}
|
---|
106 |
|
---|
107 | // generates a more lightweight Antlr parser and lexer tailored for content assist
|
---|
108 | fragment = parser.antlr.XtextAntlrUiGeneratorFragment auto-inject {}
|
---|
109 |
|
---|
110 | // generates junit test support classes into Generator#pathTestProject
|
---|
111 | fragment = junit.Junit4Fragment auto-inject {}
|
---|
112 |
|
---|
113 | // rename refactoring
|
---|
114 | fragment = refactoring.RefactorElementNameFragment auto-inject {}
|
---|
115 |
|
---|
116 | // provides the necessary bindings for java types integration
|
---|
117 | //fragment = types.TypesGeneratorFragment auto-inject {}
|
---|
118 |
|
---|
119 | // generates the required bindings only if the grammar inherits from Xbase
|
---|
120 | fragment = xbase.XbaseGeneratorFragment auto-inject {}
|
---|
121 |
|
---|
122 | // provides a preference page for template proposals
|
---|
123 | fragment = templates.CodetemplatesGeneratorFragment auto-inject {}
|
---|
124 |
|
---|
125 | // provides a compare view
|
---|
126 | fragment = compare.CompareFragment auto-inject {}
|
---|
127 | }
|
---|
128 | }
|
---|
129 | }
|
---|
130 |
|
---|