Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 771fabb5024c4f61e831fdae9dc4952005694d67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*******************************************************************************
 * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * CONTRIBUTORS:
 * 		Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
 * 
 *******************************************************************************/


module org.eclipse.etrice.core.Room

import org.eclipse.emf.mwe.utils.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*

var grammarURI = "classpath:/org/eclipse/etrice/core/Room.xtext"
var file.extensions = "room"
var projectName = "org.eclipse.etrice.core.room"
var runtimeProject = "../${projectName}"

Workflow {
    bean = StandaloneSetup {
		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 {}
			
			// the serialization component (1.0)
			fragment = parseTreeConstructor.ParseTreeConstructorFragment {}
			
			// 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
			//	}
			}
			
			/*
			If you don't want to use the Antlr fragment for some reason, remove the antlr fragment and uncomment the packrat parser fragment below.
			fragment = parser.PackratParserFragment {}
			*/
			
			// check-based API for validation
			/*
			fragment = validation.CheckFragment {}
			*/
			 
			// java-based API for validation 
			fragment = validation.JavaValidatorFragment {
				// HOWTO: use URI imports - configure validator
                composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
                composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
                
                // HOWTO: extension manager is added here (CAUTION: don't register with RoomPackage in the class since this makes it is called twice)
                composedCheck = "org.eclipse.etrice.core.validation.ValidatorExtensionManager"
            }
            
			// scoping and exporting API
			/*
			fragment = scoping.ImportURIScopingFragment {}
			fragment = exporting.SimpleNamesFragment {}
			*/
			
			// scoping and exporting API 
			fragment = scoping.ImportURIScopingFragment {}
			fragment = exporting.QualifiedNamesFragment {}
			fragment = builder.BuilderIntegrationFragment {}
			
			// formatter API 
			fragment = formatting.FormatterFragment {}

			// labeling API 
			fragment = labeling.LabelProviderFragment {}

			// outline API 
			fragment = outline.OutlineTreeProviderFragment {}
			fragment = outline.QuickOutlineFragment {}

			// quickfix API 
			fragment = quickfix.QuickfixProviderFragment {}

			// java-based API for content assistance 
			fragment = contentAssist.JavaBasedContentAssistFragment {}
			
			// rename refactoring  
			fragment = refactoring.RefactorElementNameFragment {}
			
			// generates a more lightweight Antlr parser and lexer tailored for content assist  
			fragment = parser.antlr.XtextAntlrUiGeneratorFragment {}

			// project wizard (optional) 
			/*
			fragment = projectWizard.SimpleProjectWizardFragment {
				generatorProjectName = "${projectName}.generator" 
				modelFileExtension = file.extensions
			}
			*/

            // provides a compare view
            fragment = compare.CompareFragment {
                 fileExtensions = file.extensions
            }
		}
	}
}

Back to the top