1616
1717package org.modelix.model.api
1818
19- import kotlin.reflect.KProperty
20-
2119/* *
2220 * TODO if you add a new Concept to a language, do not forget to add it to the language's included concepts field.
2321 * Otherwise the concept will not be eagerly added to the Language, when registering the language in the ILanguageRegistry.
@@ -38,9 +36,18 @@ object BuiltinLanguages {
3836 addConcept(this )
3937 }
4038
41- val virtualPackage by property(" ceab5195-25ea-4f22-9b92-103b95ca8c0c/1133920641626/1193676396447" )
42- val smodelAttribute by childLink(" ceab5195-25ea-4f22-9b92-103b95ca8c0c/1133920641626/5169995583184591170" ).multiple()
43- .optional().type { Attribute }
39+ val virtualPackage = SimpleProperty (
40+ " virtualPackage" ,
41+ uid = " ceab5195-25ea-4f22-9b92-103b95ca8c0c/1133920641626/1193676396447" ,
42+ ).also (this ::addProperty)
43+
44+ val smodelAttribute = SimpleChildLink (
45+ simpleName = " smodelAttribute" ,
46+ isMultiple = true ,
47+ isOptional = true ,
48+ targetConcept = Attribute ,
49+ uid = " ceab5195-25ea-4f22-9b92-103b95ca8c0c/1133920641626/5169995583184591170" ,
50+ ).also (this ::addChildLink)
4451 }
4552
4653 object Attribute : SimpleConcept(
@@ -63,7 +70,10 @@ object BuiltinLanguages {
6370
6471 object INamedConcept : SimpleConcept(conceptName = " INamedConcept" ) {
6572 init { addConcept(this ) }
66- val name by property(" ceab5195-25ea-4f22-9b92-103b95ca8c0c/1169194658468/1169194664001" )
73+ val name = SimpleProperty (
74+ " name" ,
75+ uid = " ceab5195-25ea-4f22-9b92-103b95ca8c0c/1169194658468/1169194664001" ,
76+ ).also (this ::addProperty)
6777 }
6878 }
6979
@@ -88,30 +98,39 @@ object BuiltinLanguages {
8898 ) {
8999 init { addConcept(this ) }
90100
91- val id by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618892/2615330535972958738" )
92- val stereotype by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618892/3832696962605996173" )
101+ val id = SimpleProperty (
102+ " id" ,
103+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618892/2615330535972958738" ,
104+ ).also (this ::addProperty)
105+
106+ val stereotype = SimpleProperty (
107+ " stereotype" ,
108+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618892/3832696962605996173" ,
109+ ).also (this ::addProperty)
93110
94111 val rootNodes = SimpleChildLink (
95112 simpleName = " rootNodes" ,
96113 isMultiple = true ,
97114 isOptional = true ,
98115 targetConcept = jetbrains_mps_lang_core.BaseConcept ,
99116 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618892/474657388638618900" ,
100- )
117+ ).also (this ::addChildLink)
118+
101119 val modelImports = SimpleChildLink (
102120 simpleName = " modelImports" ,
103121 isMultiple = true ,
104122 isOptional = true ,
105123 targetConcept = ModelReference ,
106124 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618892/6402965165736931000" ,
107- )
125+ ).also (this ::addChildLink)
126+
108127 val usedLanguages = SimpleChildLink (
109128 simpleName = " usedLanguages" ,
110129 isMultiple = true ,
111130 isOptional = true ,
112131 targetConcept = SingleLanguageDependency ,
113132 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618892/5381564949800872334" ,
114- )
133+ ). also ( this ::addChildLink)
115134 }
116135
117136 object Module : SimpleConcept(
@@ -121,38 +140,52 @@ object BuiltinLanguages {
121140 ) {
122141 init { addConcept(this ) }
123142
124- val id by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618895/4225291329823310560" )
125- val moduleVersion by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618895/2206727074858242370" )
126- val compileInMPS by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618895/2206727074858242373" )
143+ val id = SimpleProperty (
144+ " id" ,
145+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618895/4225291329823310560" ,
146+ ).also (this ::addProperty)
147+
148+ val moduleVersion = SimpleProperty (
149+ " moduleVersion" ,
150+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618895/2206727074858242370" ,
151+ ).also (this ::addProperty)
152+
153+ val compileInMPS = SimpleProperty (
154+ " compileInMPS" ,
155+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618895/2206727074858242373" ,
156+ ).also (this ::addProperty)
127157
128158 val models = SimpleChildLink (
129159 simpleName = " models" ,
130160 isMultiple = true ,
131161 isOptional = true ,
132162 targetConcept = Model ,
133163 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618895/474657388638618898" ,
134- )
164+ ).also (this ::addChildLink)
165+
135166 val facets = SimpleChildLink (
136167 simpleName = " facets" ,
137168 isMultiple = true ,
138169 isOptional = true ,
139170 targetConcept = ModuleFacet ,
140171 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618895/2206727074858242412" ,
141- )
172+ ).also (this ::addChildLink)
173+
142174 val dependencies = SimpleChildLink (
143175 simpleName = " dependencies" ,
144176 isMultiple = true ,
145177 isOptional = true ,
146178 targetConcept = ModuleDependency ,
147179 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618895/2206727074858242425" ,
148- )
180+ ).also (this ::addChildLink)
181+
149182 val languageDependencies = SimpleChildLink (
150183 simpleName = " languageDependencies" ,
151184 isMultiple = true ,
152185 isOptional = true ,
153186 targetConcept = LanguageDependency ,
154187 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618895/2206727074858242439" ,
155- )
188+ ). also ( this ::addChildLink)
156189 }
157190
158191 object Solution : SimpleConcept(
@@ -192,23 +225,23 @@ object BuiltinLanguages {
192225 isOptional = true ,
193226 targetConcept = Module ,
194227 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618902/474657388638618903" ,
195- )
228+ ). also ( this ::addChildLink)
196229
197230 val projects = SimpleChildLink (
198231 simpleName = " projects" ,
199232 isMultiple = true ,
200233 isOptional = true ,
201234 targetConcept = Project ,
202235 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618902/7064605579395546636" ,
203- )
236+ ). also ( this ::addChildLink)
204237
205238 val tempModules = SimpleChildLink (
206239 simpleName = " tempModules" ,
207240 isMultiple = true ,
208241 isOptional = true ,
209242 targetConcept = Module ,
210243 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/474657388638618902/8226136427470548682" ,
211- )
244+ ). also ( this ::addChildLink)
212245 }
213246
214247 object Project : SimpleConcept(
@@ -224,15 +257,15 @@ object BuiltinLanguages {
224257 isOptional = true ,
225258 targetConcept = Module ,
226259 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/4008363636171860313/4008363636171860450" ,
227- )
260+ ). also ( this ::addChildLink)
228261
229262 val projectModules = SimpleChildLink (
230263 simpleName = " projectModules" ,
231264 isMultiple = true ,
232265 isOptional = true ,
233266 targetConcept = ProjectModule ,
234267 uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/4008363636171860313/4201834143491306088" ,
235- )
268+ ). also ( this ::addChildLink)
236269 }
237270
238271 object ProjectModule : SimpleConcept(
@@ -242,7 +275,10 @@ object BuiltinLanguages {
242275 ) {
243276 init { addConcept(this ) }
244277
245- val virtualFolder by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/4201834143491306084/4201834143491306085" )
278+ val virtualFolder = SimpleProperty (
279+ " virtualFolder" ,
280+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/4201834143491306084/4201834143491306085" ,
281+ ).also (this ::addProperty)
246282 }
247283
248284 object ModuleReference : SimpleConcept(
@@ -283,8 +319,15 @@ object BuiltinLanguages {
283319 ) {
284320 init { addConcept(this ) }
285321
286- val uuid by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/8958347146611575311/8958347146611575314" )
287- val name by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/8958347146611575311/8958347146611575315" )
322+ val uuid = SimpleProperty (
323+ " uuid" ,
324+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/8958347146611575311/8958347146611575314" ,
325+ ).also (this ::addProperty)
326+
327+ val name = SimpleProperty (
328+ " name" ,
329+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/8958347146611575311/8958347146611575315" ,
330+ ).also (this ::addProperty)
288331 }
289332
290333 object SingleLanguageDependency : SimpleConcept(
@@ -294,7 +337,10 @@ object BuiltinLanguages {
294337 ) {
295338 init { addConcept(this ) }
296339
297- val version by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242429/2206727074858242435" )
340+ val version = SimpleProperty (
341+ " version" ,
342+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242429/2206727074858242435" ,
343+ ).also (this ::addProperty)
298344 }
299345
300346 object DevkitDependency : SimpleConcept(
@@ -320,8 +366,15 @@ object BuiltinLanguages {
320366 ) {
321367 init { addConcept(this ) }
322368
323- val generated by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242406/2206727074858242407" )
324- val path by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242406/2206727074858242409" )
369+ val generated = SimpleProperty (
370+ " generated" ,
371+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242406/2206727074858242407" ,
372+ ).also (this ::addProperty)
373+
374+ val path = SimpleProperty (
375+ " path" ,
376+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242406/2206727074858242409" ,
377+ ).also (this ::addProperty)
325378 }
326379
327380 object ModuleDependency : SimpleConcept(
@@ -331,12 +384,35 @@ object BuiltinLanguages {
331384 ) {
332385 init { addConcept(this ) }
333386
334- val reexport by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/2206727074858242416" )
335- val uuid by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/2206727074858242418" )
336- val name by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/2206727074858242421" )
337- val explicit by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/2206727074858750565" )
338- val version by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/2206727074858750570" )
339- val scope by property(" 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/8438396892798826745" )
387+ val reexport = SimpleProperty (
388+ " reexport" ,
389+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/2206727074858242416" ,
390+ ).also (this ::addProperty)
391+
392+ val uuid = SimpleProperty (
393+ " uuid" ,
394+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/2206727074858242418" ,
395+ ).also (this ::addProperty)
396+
397+ val name = SimpleProperty (
398+ " name" ,
399+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/2206727074858242421" ,
400+ ).also (this ::addProperty)
401+
402+ val explicit = SimpleProperty (
403+ " explicit" ,
404+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/2206727074858750565" ,
405+ ).also (this ::addProperty)
406+
407+ val version = SimpleProperty (
408+ " version" ,
409+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/2206727074858750570" ,
410+ ).also (this ::addProperty)
411+
412+ val scope = SimpleProperty (
413+ " scope" ,
414+ uid = " 0a7577d1-d4e5-431d-98b1-fae38f9aee80/2206727074858242415/8438396892798826745" ,
415+ ).also (this ::addProperty)
340416 }
341417 }
342418
@@ -358,7 +434,7 @@ object BuiltinLanguages {
358434 isOptional = true ,
359435 targetConcept = RepositoryInfo ,
360436 uid = " b6980ebd-f01d-459d-a952-38740f6313b4/7113393488488348863/7113393488488348866" ,
361- )
437+ ). also ( this ::addChildLink)
362438 }
363439
364440 object RepositoryInfo : SimpleConcept(
@@ -368,15 +444,18 @@ object BuiltinLanguages {
368444 ) {
369445 init { addConcept(this ) }
370446
371- val id by property(" b6980ebd-f01d-459d-a952-38740f6313b4/7113393488488348864/7113393488488348870" )
447+ val id = SimpleProperty (
448+ " id" ,
449+ uid = " b6980ebd-f01d-459d-a952-38740f6313b4/7113393488488348864/7113393488488348870" ,
450+ ).also (this ::addProperty)
372451
373452 val branches = SimpleChildLink (
374453 simpleName = " branches" ,
375454 isMultiple = true ,
376455 isOptional = true ,
377456 targetConcept = BranchInfo ,
378457 uid = " b6980ebd-f01d-459d-a952-38740f6313b4/7113393488488348864/7113393488488348868" ,
379- )
458+ ). also ( this ::addChildLink)
380459 }
381460
382461 object BranchInfo : SimpleConcept(
@@ -394,46 +473,3 @@ object BuiltinLanguages {
394473 ModelixRuntimelang ,
395474 )
396475}
397-
398- private fun SimpleConcept.property (uid : String ) = object {
399- private lateinit var name: String
400- private lateinit var owner: SimpleConcept
401- private val instance: IProperty by lazy {
402- SimpleProperty (name, uid = uid).also { owner.addProperty(it) }
403- }
404-
405- operator fun getValue (ownerConcept : SimpleConcept , kotlinProperty : KProperty <* >): IProperty {
406- this .owner = ownerConcept
407- this .name = kotlinProperty.name
408- return instance
409- }
410- }
411-
412- private fun SimpleConcept.childLink (uid : String ) = object {
413- private lateinit var name: String
414- private lateinit var owner: SimpleConcept
415- private var multiple: Boolean = true
416- private var optional: Boolean = true
417- private lateinit var targetConcept: () -> IConcept
418- private val instance: IChildLink by lazy {
419- SimpleChildLink (
420- simpleName = name,
421- uid = uid,
422- isMultiple = multiple,
423- isOptional = optional,
424- targetConcept = targetConcept(),
425- ).also { owner.addChildLink(it) }
426- }
427-
428- operator fun getValue (ownerConcept : SimpleConcept , kotlinProperty : KProperty <* >): IChildLink {
429- this .owner = ownerConcept
430- this .name = kotlinProperty.name
431- return instance
432- }
433-
434- fun mandatory () = this .also { this .optional = false }
435- fun optional () = this .also { this .optional = true }
436- fun single () = this .also { this .multiple = false }
437- fun multiple () = this .also { this .multiple = true }
438- fun type (targetConcept : () -> IConcept ) = also { this .targetConcept = targetConcept }
439- }
0 commit comments