1 | module de.ugoe.cs.swe.bnftools.Ebnf |
---|
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 file.extensions = "bnf" |
---|
9 | var projectName = "de.ugoe.cs.swe.bnftools.ebnf" |
---|
10 | var runtimeProject = "../${projectName}" |
---|
11 | |
---|
12 | Workflow { |
---|
13 | bean = StandaloneSetup { |
---|
14 | platformUri = "${runtimeProject}/.." |
---|
15 | } |
---|
16 | |
---|
17 | component = DirectoryCleaner { |
---|
18 | directory = "${runtimeProject}/src-gen" |
---|
19 | } |
---|
20 | |
---|
21 | component = DirectoryCleaner { |
---|
22 | directory = "${runtimeProject}.ui/src-gen" |
---|
23 | } |
---|
24 | |
---|
25 | component = Generator { |
---|
26 | pathRtProject = runtimeProject |
---|
27 | pathUiProject = "${runtimeProject}.ui" |
---|
28 | projectNameRt = projectName |
---|
29 | projectNameUi = "${projectName}.ui" |
---|
30 | |
---|
31 | language = { |
---|
32 | uri = grammarURI |
---|
33 | fileExtensions = file.extensions |
---|
34 | |
---|
35 | // Java API to access grammar elements (required by several other fragments) |
---|
36 | fragment = grammarAccess.GrammarAccessFragment {} |
---|
37 | |
---|
38 | // generates Java API for the generated EPackages |
---|
39 | fragment = ecore.EcoreGeneratorFragment { |
---|
40 | // referencedGenModels = "uri to genmodel, uri to next genmodel" |
---|
41 | } |
---|
42 | |
---|
43 | // the serialization component |
---|
44 | fragment = parseTreeConstructor.ParseTreeConstructorFragment {} |
---|
45 | |
---|
46 | // a custom ResourceFactory for use with EMF |
---|
47 | fragment = resourceFactory.ResourceFactoryFragment { |
---|
48 | fileExtensions = file.extensions |
---|
49 | } |
---|
50 | |
---|
51 | // the following fragment tries to use the Antlr Generator fragment which can be installed via update manager from http://download.itemis.com/updates/ |
---|
52 | fragment = AntlrDelegatingFragment {} |
---|
53 | |
---|
54 | /* |
---|
55 | If you don't want to use the Antlr fragment for some reason, remove the antlr fragment and uncomment the packrat parser fragment below. |
---|
56 | fragment = parser.PackratParserFragment {} |
---|
57 | */ |
---|
58 | |
---|
59 | // check-based API for validation |
---|
60 | /* |
---|
61 | fragment = validation.CheckFragment {} |
---|
62 | */ |
---|
63 | |
---|
64 | // java-based API for validation |
---|
65 | fragment = validation.JavaValidatorFragment { |
---|
66 | composedCheck = "org.eclipse.xtext.validation.ImportUriValidator" |
---|
67 | composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" |
---|
68 | } |
---|
69 | |
---|
70 | // scoping and exporting API |
---|
71 | fragment = scoping.ImportURIScopingFragment {} |
---|
72 | fragment = exporting.SimpleNamesFragment {} |
---|
73 | |
---|
74 | // scoping and exporting API |
---|
75 | //fragment = scoping.ImportNamespacesScopingFragment {} |
---|
76 | //fragment = exporting.QualifiedNamesFragment {} |
---|
77 | |
---|
78 | // formatter API |
---|
79 | // skip it as it is not sufficient for our case... |
---|
80 | // fragment = formatting.FormatterFragment {} |
---|
81 | |
---|
82 | // labeling API |
---|
83 | fragment = labeling.LabelProviderFragment {} |
---|
84 | |
---|
85 | // outline API |
---|
86 | fragment = outline.TransformerFragment {} |
---|
87 | fragment = outline.OutlineNodeAdapterFactoryFragment {} |
---|
88 | fragment = outline.QuickOutlineFragment {} |
---|
89 | |
---|
90 | // java-based API for content assistance |
---|
91 | fragment = contentAssist.JavaBasedContentAssistFragment {} |
---|
92 | |
---|
93 | // the following fragment tries to use the Antlr based content assist |
---|
94 | // fragment which can be downloaded from http://www.itemis.com |
---|
95 | // and will be ignored if it's not available. |
---|
96 | fragment = DelegatingGeneratorFragment { |
---|
97 | delegate = "de.itemis.xtext.antlr.XtextAntlrUiGeneratorFragment" |
---|
98 | message="You are generating without ANTLR. " |
---|
99 | } |
---|
100 | |
---|
101 | fragment = builder.BuilderIntegrationFragment {} |
---|
102 | |
---|
103 | // project wizard (optional) |
---|
104 | /* |
---|
105 | fragment = projectWizard.SimpleProjectWizardFragment { |
---|
106 | generatorProjectName = "${projectName}.generator" |
---|
107 | modelFileExtension = file.extensions |
---|
108 | } |
---|
109 | */ |
---|
110 | |
---|
111 | // quickfix API |
---|
112 | fragment = quickfix.QuickfixProviderFragment {} |
---|
113 | } |
---|
114 | } |
---|
115 | } |
---|