@lionweb/class-core-generator 0.6.13-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/api/entity-types.templates.d.ts +4 -0
- package/dist/api/entity-types.templates.d.ts.map +1 -0
- package/dist/api/entity-types.templates.js +171 -0
- package/dist/api/entity-types.templates.js.map +1 -0
- package/dist/api/generation-headers.d.ts +9 -0
- package/dist/api/generation-headers.d.ts.map +1 -0
- package/dist/api/generation-headers.js +40 -0
- package/dist/api/generation-headers.js.map +1 -0
- package/dist/api/generator.d.ts +11 -0
- package/dist/api/generator.d.ts.map +1 -0
- package/dist/api/generator.js +59 -0
- package/dist/api/generator.js.map +1 -0
- package/dist/api/helpers/classifiers.d.ts +6 -0
- package/dist/api/helpers/classifiers.d.ts.map +1 -0
- package/dist/api/helpers/classifiers.js +49 -0
- package/dist/api/helpers/classifiers.js.map +1 -0
- package/dist/api/helpers/dependencies.d.ts +11 -0
- package/dist/api/helpers/dependencies.d.ts.map +1 -0
- package/dist/api/helpers/dependencies.js +52 -0
- package/dist/api/helpers/dependencies.js.map +1 -0
- package/dist/api/helpers/entities.d.ts +5 -0
- package/dist/api/helpers/entities.d.ts.map +1 -0
- package/dist/api/helpers/entities.js +33 -0
- package/dist/api/helpers/entities.js.map +1 -0
- package/dist/api/helpers/features.d.ts +9 -0
- package/dist/api/helpers/features.d.ts.map +1 -0
- package/dist/api/helpers/features.js +96 -0
- package/dist/api/helpers/features.js.map +1 -0
- package/dist/api/helpers/imports-tracking.d.ts +22 -0
- package/dist/api/helpers/imports-tracking.d.ts.map +1 -0
- package/dist/api/helpers/imports-tracking.js +80 -0
- package/dist/api/helpers/imports-tracking.js.map +1 -0
- package/dist/api/helpers/index.d.ts +8 -0
- package/dist/api/helpers/index.d.ts.map +1 -0
- package/dist/api/helpers/index.js +24 -0
- package/dist/api/helpers/index.js.map +1 -0
- package/dist/api/helpers/mps-annotations.d.ts +19 -0
- package/dist/api/helpers/mps-annotations.d.ts.map +1 -0
- package/dist/api/helpers/mps-annotations.js +65 -0
- package/dist/api/helpers/mps-annotations.js.map +1 -0
- package/dist/api/helpers/types.d.ts +3 -0
- package/dist/api/helpers/types.d.ts.map +1 -0
- package/dist/api/helpers/types.js +28 -0
- package/dist/api/helpers/types.js.map +1 -0
- package/dist/api/index-ts.d.ts +4 -0
- package/dist/api/index-ts.d.ts.map +1 -0
- package/dist/api/index-ts.js +52 -0
- package/dist/api/index-ts.js.map +1 -0
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +21 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/language-file.templates.d.ts +4 -0
- package/dist/api/language-file.templates.d.ts.map +1 -0
- package/dist/api/language-file.templates.js +65 -0
- package/dist/api/language-file.templates.js.map +1 -0
- package/dist/api/mega-factory.templates.d.ts +4 -0
- package/dist/api/mega-factory.templates.d.ts.map +1 -0
- package/dist/api/mega-factory.templates.js +61 -0
- package/dist/api/mega-factory.templates.js.map +1 -0
- package/dist/api/reflective-layer.templates.d.ts +4 -0
- package/dist/api/reflective-layer.templates.d.ts.map +1 -0
- package/dist/api/reflective-layer.templates.js +211 -0
- package/dist/api/reflective-layer.templates.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +20 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/json-as-ts.d.ts +2 -0
- package/dist/utils/json-as-ts.d.ts.map +1 -0
- package/dist/utils/json-as-ts.js +18 -0
- package/dist/utils/json-as-ts.js.map +1 -0
- package/dist/utils/string-sorting.d.ts +4 -0
- package/dist/utils/string-sorting.d.ts.map +1 -0
- package/dist/utils/string-sorting.js +23 -0
- package/dist/utils/string-sorting.js.map +1 -0
- package/dist/utils/textgen.d.ts +21 -0
- package/dist/utils/textgen.d.ts.map +1 -0
- package/dist/utils/textgen.js +67 -0
- package/dist/utils/textgen.js.map +1 -0
- package/dist/utils/toposort.d.ts +6 -0
- package/dist/utils/toposort.d.ts.map +1 -0
- package/dist/utils/toposort.js +41 -0
- package/dist/utils/toposort.js.map +1 -0
- package/package.json +34 -0
- package/src/api/entity-types.templates.ts +257 -0
- package/src/api/generation-headers.ts +47 -0
- package/src/api/generator.ts +84 -0
- package/src/api/helpers/classifiers.ts +67 -0
- package/src/api/helpers/dependencies.ts +62 -0
- package/src/api/helpers/entities.ts +43 -0
- package/src/api/helpers/features.ts +121 -0
- package/src/api/helpers/imports-tracking.ts +96 -0
- package/src/api/helpers/index.ts +24 -0
- package/src/api/helpers/mps-annotations.ts +69 -0
- package/src/api/helpers/types.ts +31 -0
- package/src/api/index-ts.ts +59 -0
- package/src/api/index.ts +21 -0
- package/src/api/language-file.templates.ts +79 -0
- package/src/api/mega-factory.templates.ts +79 -0
- package/src/api/reflective-layer.templates.ts +273 -0
- package/src/index.ts +19 -0
- package/src/utils/index.ts +21 -0
- package/src/utils/json-as-ts.ts +20 -0
- package/src/utils/string-sorting.ts +29 -0
- package/src/utils/textgen.ts +89 -0
- package/src/utils/toposort.ts +49 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
import { Classifier, cycleWith, inheritsFrom, nameOf, nameSorted } from "@lionweb/core";
|
|
18
|
+
import { uniquesAmong } from "@lionweb/utilities/dist/utils/array.js";
|
|
19
|
+
import { asString, when } from "littoral-templates";
|
|
20
|
+
import { indent } from "../../utils/index.js";
|
|
21
|
+
/**
|
|
22
|
+
* @return all languages that any {@link Classifier classifier} of the given {@link Language language} depends on through direct inheritance.
|
|
23
|
+
*/
|
|
24
|
+
export const dependenciesThroughDirectInheritanceOf = (language) => uniquesAmong(language.entities
|
|
25
|
+
.filter((entity) => entity instanceof Classifier)
|
|
26
|
+
.flatMap((entity) => inheritsFrom(entity))
|
|
27
|
+
.map((classifier) => classifier.language)
|
|
28
|
+
.filter((depLanguage) => depLanguage !== language));
|
|
29
|
+
/**
|
|
30
|
+
* @return the – currently only those arising from direct inheritance on classifier-level – dependencies of the given {@link Language languages},
|
|
31
|
+
* as a human-readable text
|
|
32
|
+
*/
|
|
33
|
+
export const verboseDependencies = (languages) => {
|
|
34
|
+
const nameSortedLanguages = nameSorted(languages);
|
|
35
|
+
return asString([
|
|
36
|
+
nameSortedLanguages.map((language) => {
|
|
37
|
+
const deps = dependenciesThroughDirectInheritanceOf(language);
|
|
38
|
+
const what = `direct type-wise dependencies (through inheritance)`;
|
|
39
|
+
const cycle = cycleWith(language, dependenciesThroughDirectInheritanceOf);
|
|
40
|
+
return deps.length === 0
|
|
41
|
+
? `language ${language.name} has no ${what}`
|
|
42
|
+
: [
|
|
43
|
+
`language ${language.name} has the following ${what}:`,
|
|
44
|
+
indent([
|
|
45
|
+
nameSorted(dependenciesThroughDirectInheritanceOf(language)).map(nameOf),
|
|
46
|
+
when(cycle.length > 0)(`⚠ language "${language.name}" is part of the following cycle through type-wise (through direct inheritance): ${cycle.map(nameOf).join(" -> ")}`)
|
|
47
|
+
])
|
|
48
|
+
];
|
|
49
|
+
})
|
|
50
|
+
]);
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../src/api/helpers/dependencies.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,YAAY,EAAY,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAA;AAC/F,OAAO,EAAC,YAAY,EAAC,MAAM,wCAAwC,CAAA;AACnE,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAC,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAA;AAG3C;;GAEG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,QAAkB,EAAE,EAAE,CACzE,YAAY,CACR,QAAQ,CAAC,QAAQ;KACZ,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,YAAY,UAAU,CAAC;KAChD,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAoB,CAAC,CAAC;KACvD,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;KACxC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,KAAK,QAAQ,CAAC,CACzD,CAAA;AAGL;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,SAAqB,EAAU,EAAE;IACjE,MAAM,mBAAmB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAA;IACjD,OAAO,QAAQ,CAAC;QACZ,mBAAmB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;YACjC,MAAM,IAAI,GAAG,sCAAsC,CAAC,QAAQ,CAAC,CAAA;YAC7D,MAAM,IAAI,GAAG,qDAAqD,CAAA;YAClE,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,sCAAsC,CAAC,CAAA;YACzE,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC;gBACpB,CAAC,CAAC,YAAY,QAAQ,CAAC,IAAI,WAAW,IAAI,EAAE;gBAC5C,CAAC,CAAC;oBACE,YAAY,QAAQ,CAAC,IAAI,sBAAsB,IAAI,GAAG;oBACtD,MAAM,CAAC;wBACH,UAAU,CAAC,sCAAsC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;wBACxE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAClB,eAAe,QAAQ,CAAC,IAAI,oFAAoF,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CACnJ;qBACJ,CAAC;iBACL,CAAA;QACT,CAAC,CAAC;KACL,CAAC,CAAA;AACN,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LanguageEntity } from "@lionweb/core";
|
|
2
|
+
type EntityMetaType = "Annotation" | "Concept" | "Enumeration" | "Interface" | "PrimitiveType";
|
|
3
|
+
export declare const entityMetaType: (entity: LanguageEntity) => EntityMetaType;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/api/helpers/entities.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAiC,cAAc,EAAgB,MAAM,eAAe,CAAA;AAG3F,KAAK,cAAc,GACb,YAAY,GACZ,SAAS,GACT,aAAa,GACb,WAAW,GACX,eAAe,CAAA;AAErB,eAAO,MAAM,cAAc,WAAY,cAAc,KAAG,cAcvD,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
import { Annotation, Concept, Interface, PrimitiveType } from "@lionweb/core";
|
|
18
|
+
export const entityMetaType = (entity) => {
|
|
19
|
+
if (entity instanceof Annotation) {
|
|
20
|
+
return "Annotation";
|
|
21
|
+
}
|
|
22
|
+
if (entity instanceof Concept) {
|
|
23
|
+
return "Concept";
|
|
24
|
+
}
|
|
25
|
+
if (entity instanceof Interface) {
|
|
26
|
+
return "Interface";
|
|
27
|
+
}
|
|
28
|
+
if (entity instanceof PrimitiveType) {
|
|
29
|
+
return "PrimitiveType";
|
|
30
|
+
}
|
|
31
|
+
throw new Error(`unhandled LanguageEntity sub type ${entity.constructor.name}`);
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.js","sourceRoot":"","sources":["../../../src/api/helpers/entities.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAkB,aAAa,EAAC,MAAM,eAAe,CAAA;AAU3F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAkB,EAAE;IACrE,IAAI,MAAM,YAAY,UAAU,EAAE,CAAC;QAC/B,OAAO,YAAY,CAAA;IACvB,CAAC;IACD,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAA;IACpB,CAAC;IACD,IAAI,MAAM,YAAY,SAAS,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAA;IACtB,CAAC;IACD,IAAI,MAAM,YAAY,aAAa,EAAE,CAAC;QAClC,OAAO,eAAe,CAAA;IAC1B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAA;AACnF,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Classifier, Datatype, Feature, LanguageEntity, SingleRef } from "@lionweb/core";
|
|
2
|
+
import { Imports } from "./index.js";
|
|
3
|
+
export declare const typeOf: (feature: Feature) => SingleRef<LanguageEntity>;
|
|
4
|
+
export declare const tsTypeForDatatype: (datatype: SingleRef<Datatype>, imports: Imports) => string;
|
|
5
|
+
export declare const tsTypeForClassifier: (classifier: SingleRef<Classifier>, imports: Imports) => string;
|
|
6
|
+
export declare const optionalityPostfix: (feature: Feature) => "" | " | undefined";
|
|
7
|
+
export declare const tsFieldTypeForFeature: (feature: Feature, imports: Imports) => string;
|
|
8
|
+
export declare const tsTypeForValueManager: (feature: Feature, imports: Imports) => string;
|
|
9
|
+
//# sourceMappingURL=features.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../src/api/helpers/features.ts"],"names":[],"mappings":"AAiBA,OAAO,EAEH,UAAU,EACV,QAAQ,EAER,OAAO,EAIP,cAAc,EAId,SAAS,EACZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAAC,OAAO,EAAyB,MAAM,YAAY,CAAA;AAG1D,eAAO,MAAM,MAAM,YAAa,OAAO,KAAG,UAAU,cAAc,CAQjE,CAAA;AAGD,eAAO,MAAM,iBAAiB,aAAc,UAAU,QAAQ,CAAC,WAAW,OAAO,WAWhF,CAAA;AAGD,eAAO,MAAM,mBAAmB,eAAgB,UAAU,UAAU,CAAC,WAAW,OAAO,WAKtF,CAAA;AAGD,eAAO,MAAM,kBAAkB,YAAa,OAAO,wBAA2C,CAAA;AAE9F,eAAO,MAAM,qBAAqB,YAAa,OAAO,WAAW,OAAO,KAAG,MA0B1E,CAAA;AAED,eAAO,MAAM,qBAAqB,YAAa,OAAO,WAAW,OAAO,KAAG,MAqB1E,CAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
import { builtinClassifiers, Enumeration, isContainment, isProperty, isReference, Link, PrimitiveType, Property } from "@lionweb/core";
|
|
18
|
+
import { tsTypeForPrimitiveType } from "./index.js";
|
|
19
|
+
export const typeOf = (feature) => {
|
|
20
|
+
if (feature instanceof Property) {
|
|
21
|
+
return feature.type;
|
|
22
|
+
}
|
|
23
|
+
if (feature instanceof Link) {
|
|
24
|
+
return feature.type;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
};
|
|
28
|
+
export const tsTypeForDatatype = (datatype, imports) => {
|
|
29
|
+
if (datatype === null) {
|
|
30
|
+
return `unknown /* [ERROR] can't compute a TS type for a null datatype */`;
|
|
31
|
+
}
|
|
32
|
+
if (datatype instanceof PrimitiveType) {
|
|
33
|
+
return tsTypeForPrimitiveType(datatype);
|
|
34
|
+
}
|
|
35
|
+
if (datatype instanceof Enumeration) {
|
|
36
|
+
return imports.entity(datatype);
|
|
37
|
+
}
|
|
38
|
+
return `unknown /* [ERROR] can't compute a TS type for datatype ${datatype.name} that has an unhandled/-known meta-type ${datatype.constructor.name} */`;
|
|
39
|
+
};
|
|
40
|
+
export const tsTypeForClassifier = (classifier, imports) => {
|
|
41
|
+
if (classifier === null) {
|
|
42
|
+
return `unknown /* [ERROR] can't compute a TS type for a null classifier */`;
|
|
43
|
+
}
|
|
44
|
+
return classifier === builtinClassifiers.node ? imports.generic("INodeBase") : imports.entity(classifier);
|
|
45
|
+
};
|
|
46
|
+
export const optionalityPostfix = (feature) => feature.optional ? " | undefined" : "";
|
|
47
|
+
export const tsFieldTypeForFeature = (feature, imports) => {
|
|
48
|
+
const type = typeOf(feature);
|
|
49
|
+
if (type === null) {
|
|
50
|
+
return `unknown /* [ERROR] can't compute a TS type for feature ${feature.name} on classifier ${feature.classifier.name} with null type */`;
|
|
51
|
+
}
|
|
52
|
+
if (isProperty(feature)) {
|
|
53
|
+
const typeId = (() => {
|
|
54
|
+
if (type instanceof PrimitiveType) {
|
|
55
|
+
return tsTypeForPrimitiveType(type);
|
|
56
|
+
}
|
|
57
|
+
if (type instanceof Enumeration) {
|
|
58
|
+
return type.name;
|
|
59
|
+
}
|
|
60
|
+
return `unknown /* [ERROR] can't compute a TS type for feature ${feature.name} on classifier ${feature.classifier.name} whose type has an unhandled/-known meta-type ${type.constructor.name} */`;
|
|
61
|
+
})();
|
|
62
|
+
return `${typeId}${(optionalityPostfix(feature))}`;
|
|
63
|
+
}
|
|
64
|
+
if (isContainment(feature)) {
|
|
65
|
+
const typeId = type === builtinClassifiers.node ? imports.generic("INodeBase") : imports.entity(type);
|
|
66
|
+
return `${typeId}${feature.multiple ? "[]" : optionalityPostfix(feature)}`;
|
|
67
|
+
}
|
|
68
|
+
if (isReference(feature)) {
|
|
69
|
+
const typeId = type === builtinClassifiers.node ? imports.generic("INodeBase") : imports.entity(type);
|
|
70
|
+
return `${imports.core("SingleRef")}<${typeId}>${feature.multiple ? "[]" : optionalityPostfix(feature)}`;
|
|
71
|
+
}
|
|
72
|
+
return `unknown /* [ERROR] can't compute a TS type for feature ${feature.name} on classifier ${feature.classifier.name} whose type has an unhandled/-known meta-type ${type.constructor.name} */`;
|
|
73
|
+
};
|
|
74
|
+
export const tsTypeForValueManager = (feature, imports) => {
|
|
75
|
+
const type = typeOf(feature);
|
|
76
|
+
if (type === null) {
|
|
77
|
+
return `unknown /* [ERROR] can't compute a TS type for feature ${feature.name} on classifier ${feature.classifier.name} with null type */`;
|
|
78
|
+
}
|
|
79
|
+
if (isProperty(feature)) {
|
|
80
|
+
const typeId = (() => {
|
|
81
|
+
if (type instanceof PrimitiveType) {
|
|
82
|
+
return tsTypeForPrimitiveType(type);
|
|
83
|
+
}
|
|
84
|
+
if (type instanceof Enumeration) {
|
|
85
|
+
return type.name;
|
|
86
|
+
}
|
|
87
|
+
return `unknown /* [ERROR] can't compute a TS type for feature ${feature.name} on classifier ${feature.classifier.name} whose type has an unhandled/-known meta-type ${type.constructor.name} */`;
|
|
88
|
+
})();
|
|
89
|
+
return typeId;
|
|
90
|
+
}
|
|
91
|
+
if (isContainment(feature) || isReference(feature)) {
|
|
92
|
+
return type === builtinClassifiers.node ? imports.generic("INodeBase") : imports.entity(type);
|
|
93
|
+
}
|
|
94
|
+
return `unknown /* [ERROR] can't compute a TS type for feature ${feature.name} on classifier ${feature.classifier.name} whose type has an unhandled/-known meta-type ${type.constructor.name} */`;
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=features.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../../src/api/helpers/features.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EACH,kBAAkB,EAGlB,WAAW,EAEX,aAAa,EACb,UAAU,EACV,WAAW,EAEX,IAAI,EACJ,aAAa,EACb,QAAQ,EAEX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAU,sBAAsB,EAAC,MAAM,YAAY,CAAA;AAG1D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAgB,EAA6B,EAAE;IAClE,IAAI,OAAO,YAAY,QAAQ,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC,IAAI,CAAA;IACvB,CAAC;IACD,IAAI,OAAO,YAAY,IAAI,EAAE,CAAC;QAC1B,OAAO,OAAO,CAAC,IAAI,CAAA;IACvB,CAAC;IACD,OAAO,IAAI,CAAA;AACf,CAAC,CAAA;AAGD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAA6B,EAAE,OAAgB,EAAE,EAAE;IACjF,IAAI,QAAQ,KAAK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AA;AACrM,CAAC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Language, LanguageEntity } from "@lionweb/core";
|
|
2
|
+
export declare const importRenamingForLanguage: (language: Language) => string;
|
|
3
|
+
export declare const nameOfBaseClassForLanguage: (language: Language) => string;
|
|
4
|
+
export declare class Imports {
|
|
5
|
+
readonly thisLanguage: Language;
|
|
6
|
+
constructor(thisLanguage: Language);
|
|
7
|
+
get thisLanguageNameAsJsIdentifier(): string;
|
|
8
|
+
get thisBaseClassName(): string;
|
|
9
|
+
private readonly _coreImports;
|
|
10
|
+
get coreImports(): string[];
|
|
11
|
+
core(identifier: string): string;
|
|
12
|
+
private readonly _genericImports;
|
|
13
|
+
get genericImports(): string[];
|
|
14
|
+
generic(identifier: string): string;
|
|
15
|
+
private readonly _indexImports;
|
|
16
|
+
get indexImports(): string[];
|
|
17
|
+
entity(entity: LanguageEntity): string;
|
|
18
|
+
private readonly _languageImports;
|
|
19
|
+
get languageImports(): string[];
|
|
20
|
+
language(language: Language): string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=imports-tracking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports-tracking.d.ts","sourceRoot":"","sources":["../../../src/api/helpers/imports-tracking.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAmB,MAAM,eAAe,CAAA;AAIxE,eAAO,MAAM,yBAAyB,aAAc,QAAQ,WAC3B,CAAA;AAEjC,eAAO,MAAM,0BAA0B,aAAc,QAAQ,WACnB,CAAA;AAM1C,qBAAa,OAAO;aAEY,YAAY,EAAE,QAAQ;gBAAtB,YAAY,EAAE,QAAQ;IAGlD,IAAI,8BAA8B,WAEjC;IAED,IAAI,iBAAiB,WAEpB;IAED,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoB;IACjD,IAAI,WAAW,aAEd;IACD,IAAI,CAAC,UAAU,EAAE,MAAM;IAKvB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoB;IACpD,IAAI,cAAc,aAEjB;IACD,OAAO,CAAC,UAAU,EAAE,MAAM;IAK1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAClD,IAAI,YAAY,aAEf;IACD,MAAM,CAAC,MAAM,EAAE,cAAc;IAY7B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoB;IACrD,IAAI,eAAe,aAElB;IACD,QAAQ,CAAC,QAAQ,EAAE,QAAQ;CAY9B"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
import { lioncoreBuiltins } from "@lionweb/core";
|
|
18
|
+
import { asJSIdentifier } from "../../utils/textgen.js";
|
|
19
|
+
export const importRenamingForLanguage = (language) => asJSIdentifier(language.name);
|
|
20
|
+
export const nameOfBaseClassForLanguage = (language) => asJSIdentifier(language.name) + "Base";
|
|
21
|
+
const lionCoreBuiltinsIdentifier = nameOfBaseClassForLanguage(lioncoreBuiltins);
|
|
22
|
+
export class Imports {
|
|
23
|
+
constructor(thisLanguage) {
|
|
24
|
+
this.thisLanguage = thisLanguage;
|
|
25
|
+
this._coreImports = new Set();
|
|
26
|
+
this._genericImports = new Set();
|
|
27
|
+
this._indexImports = new Set();
|
|
28
|
+
this._languageImports = new Set();
|
|
29
|
+
}
|
|
30
|
+
get thisLanguageNameAsJsIdentifier() {
|
|
31
|
+
return asJSIdentifier(this.thisLanguage.name);
|
|
32
|
+
}
|
|
33
|
+
get thisBaseClassName() {
|
|
34
|
+
return this.thisLanguageNameAsJsIdentifier + "Base";
|
|
35
|
+
}
|
|
36
|
+
get coreImports() {
|
|
37
|
+
return [...this._coreImports];
|
|
38
|
+
}
|
|
39
|
+
core(identifier) {
|
|
40
|
+
this._coreImports.add(identifier);
|
|
41
|
+
return identifier;
|
|
42
|
+
}
|
|
43
|
+
get genericImports() {
|
|
44
|
+
return [...this._genericImports];
|
|
45
|
+
}
|
|
46
|
+
generic(identifier) {
|
|
47
|
+
this._genericImports.add(identifier);
|
|
48
|
+
return identifier;
|
|
49
|
+
}
|
|
50
|
+
get indexImports() {
|
|
51
|
+
return [...this._indexImports];
|
|
52
|
+
}
|
|
53
|
+
entity(entity) {
|
|
54
|
+
if (entity.language === lioncoreBuiltins) {
|
|
55
|
+
this._genericImports.add(entity.name);
|
|
56
|
+
return entity.name;
|
|
57
|
+
}
|
|
58
|
+
if (entity.language === this.thisLanguage) {
|
|
59
|
+
return entity.name;
|
|
60
|
+
}
|
|
61
|
+
this._languageImports.add(importRenamingForLanguage(entity.language));
|
|
62
|
+
return `${importRenamingForLanguage(entity.language)}.${entity.name}`;
|
|
63
|
+
}
|
|
64
|
+
get languageImports() {
|
|
65
|
+
return [...this._languageImports];
|
|
66
|
+
}
|
|
67
|
+
language(language) {
|
|
68
|
+
if (language === lioncoreBuiltins) {
|
|
69
|
+
this._genericImports.add(lionCoreBuiltinsIdentifier);
|
|
70
|
+
return lionCoreBuiltinsIdentifier;
|
|
71
|
+
}
|
|
72
|
+
const externalName = importRenamingForLanguage(language);
|
|
73
|
+
if (language === this.thisLanguage) {
|
|
74
|
+
return nameOfBaseClassForLanguage(language);
|
|
75
|
+
}
|
|
76
|
+
this._languageImports.add(externalName);
|
|
77
|
+
return `${externalName}.${nameOfBaseClassForLanguage(language)}`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=imports-tracking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports-tracking.js","sourceRoot":"","sources":["../../../src/api/helpers/imports-tracking.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAA2B,gBAAgB,EAAC,MAAM,eAAe,CAAA;AACxE,OAAO,EAAC,cAAc,EAAC,MAAM,wBAAwB,CAAA;AAGrD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAkB,EAAE,EAAE,CAC5D,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAEjC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,QAAkB,EAAE,EAAE,CAC7D,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAA;AAG1C,MAAM,0BAA0B,GAAG,0BAA0B,CAAC,gBAAgB,CAAC,CAAA;AAG/E,MAAM,OAAO,OAAO;IAEhB,YAA4B,YAAsB;QAAtB,iBAAY,GAAZ,YAAY,CAAU;QAWjC,iBAAY,GAAG,IAAI,GAAG,EAAU,CAAA;QAShC,oBAAe,GAAG,IAAI,GAAG,EAAU,CAAA;QASnC,kBAAa,GAAG,IAAI,GAAG,EAAU,CAAA;QAgBjC,qBAAgB,GAAG,IAAI,GAAG,EAAU,CAAA;IA5CrD,CAAC;IAED,IAAI,8BAA8B;QAC9B,OAAO,cAAc,CAAC,IAAI,CAAC,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AC,QAAkB;QACvB,IAAI,QAAQ,KAAK,gBAAgB,EAAE,CAAC;YAChC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;YACpD,OAAO,0BAA0B,CAAA;QACrC,CAAC;QACD,MAAM,YAAY,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAA;QACxD,IAAI,QAAQ,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;YACjC,OAAO,0BAA0B,CAAC,QAAQ,CAAC,CAAA;QAC/C,CAAC;QACD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QACvC,OAAO,GAAG,YAAY,IAAI,0BAA0B,CAAC,QAAQ,CAAC,EAAE,CAAA;IACpE,CAAC;CACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./classifiers.js";
|
|
2
|
+
export * from "./dependencies.js";
|
|
3
|
+
export * from "./entities.js";
|
|
4
|
+
export * from "./features.js";
|
|
5
|
+
export * from "./imports-tracking.js";
|
|
6
|
+
export * from "./mps-annotations.js";
|
|
7
|
+
export * from "./types.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/helpers/index.ts"],"names":[],"mappings":"AAiBA,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
export * from "./classifiers.js";
|
|
18
|
+
export * from "./dependencies.js";
|
|
19
|
+
export * from "./entities.js";
|
|
20
|
+
export * from "./features.js";
|
|
21
|
+
export * from "./imports-tracking.js";
|
|
22
|
+
export * from "./mps-annotations.js";
|
|
23
|
+
export * from "./types.js";
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/helpers/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Id, SerializationChunk } from "@lionweb/core";
|
|
2
|
+
export declare abstract class MpsAnnotation {
|
|
3
|
+
readonly annotatedNodeId: Id;
|
|
4
|
+
constructor(annotatedNodeId: Id);
|
|
5
|
+
}
|
|
6
|
+
export declare class ConceptDescription extends MpsAnnotation {
|
|
7
|
+
readonly shortDescription: string | null;
|
|
8
|
+
readonly alias: string | null;
|
|
9
|
+
constructor(annotatedNodeId: Id, shortDescription: string | null, alias: string | null);
|
|
10
|
+
toString(): string;
|
|
11
|
+
}
|
|
12
|
+
export declare class Deprecated extends MpsAnnotation {
|
|
13
|
+
readonly comment: string | null;
|
|
14
|
+
readonly build: string | null;
|
|
15
|
+
constructor(annotatedNodeId: Id, comment: string | null, build: string | null);
|
|
16
|
+
toString(): string;
|
|
17
|
+
}
|
|
18
|
+
export declare const extractedMpsAnnotations: ({ nodes }: SerializationChunk) => MpsAnnotation[];
|
|
19
|
+
//# sourceMappingURL=mps-annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mps-annotations.d.ts","sourceRoot":"","sources":["../../../src/api/helpers/mps-annotations.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,EAAE,EAAE,kBAAkB,EAAC,MAAM,eAAe,CAAA;AAGpD,8BAAsB,aAAa;aACH,eAAe,EAAE,EAAE;gBAAnB,eAAe,EAAE,EAAE;CAElD;AAED,qBAAa,kBAAmB,SAAQ,aAAa;aACA,gBAAgB,EAAE,MAAM,GAAG,IAAI;aAAkB,KAAK,EAAE,MAAM,GAAG,IAAI;gBAA1G,eAAe,EAAE,EAAE,EAAkB,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAAkB,KAAK,EAAE,MAAM,GAAG,IAAI;IAGtH,QAAQ;CAGX;AAED,qBAAa,UAAW,SAAQ,aAAa;aACQ,OAAO,EAAE,MAAM,GAAG,IAAI;aAAkB,KAAK,EAAE,MAAM,GAAG,IAAI;gBAAjG,eAAe,EAAE,EAAE,EAAkB,OAAO,EAAE,MAAM,GAAG,IAAI,EAAkB,KAAK,EAAE,MAAM,GAAG,IAAI;IAG7G,QAAQ;CAGX;AAGD,eAAO,MAAM,uBAAuB,cAAa,kBAAkB,KAAG,aAAa,EAuB7E,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
export class MpsAnnotation {
|
|
18
|
+
constructor(annotatedNodeId) {
|
|
19
|
+
this.annotatedNodeId = annotatedNodeId;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export class ConceptDescription extends MpsAnnotation {
|
|
23
|
+
constructor(annotatedNodeId, shortDescription, alias) {
|
|
24
|
+
super(annotatedNodeId);
|
|
25
|
+
this.shortDescription = shortDescription;
|
|
26
|
+
this.alias = alias;
|
|
27
|
+
}
|
|
28
|
+
toString() {
|
|
29
|
+
return `<ConceptDescription> annotatedNodeId=${this.annotatedNodeId}, shortDescription="${this.shortDescription}"`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export class Deprecated extends MpsAnnotation {
|
|
33
|
+
constructor(annotatedNodeId, comment, build) {
|
|
34
|
+
super(annotatedNodeId);
|
|
35
|
+
this.comment = comment;
|
|
36
|
+
this.build = build;
|
|
37
|
+
}
|
|
38
|
+
toString() {
|
|
39
|
+
return `<Deprecated> annotatedNodeId=${this.annotatedNodeId}, comment="${this.comment}", build="${this.build}"`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export const extractedMpsAnnotations = ({ nodes }) => nodes.flatMap(({ classifier, properties, parent }) => {
|
|
43
|
+
const propertyValue = (key) => {
|
|
44
|
+
const property = properties.find(({ property }) => property.key === key);
|
|
45
|
+
return property === undefined
|
|
46
|
+
? null
|
|
47
|
+
: property.value;
|
|
48
|
+
};
|
|
49
|
+
if (classifier.language !== "io-lionweb-mps-specific" || classifier.version !== "0") {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
switch (classifier.key) {
|
|
53
|
+
case "ConceptDescription": {
|
|
54
|
+
return [new ConceptDescription(parent, propertyValue("ConceptDescription-conceptShortDescription"), propertyValue("ConceptDescription-conceptAlias"))];
|
|
55
|
+
}
|
|
56
|
+
case "Deprecated": {
|
|
57
|
+
return [new Deprecated(parent, propertyValue("Deprecated-comment"), propertyValue("Deprecated-build"))];
|
|
58
|
+
}
|
|
59
|
+
default: {
|
|
60
|
+
console.log(`couldn't handle MPS annotation with key ${classifier.key}`);
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=mps-annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mps-annotations.js","sourceRoot":"","sources":["../../../src/api/helpers/mps-annotations.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAKtC,MAAM,OAAgB,aAAa;IAC/B,YAA4B,eAAmB;QAAnB,oBAAe,GAAf,eAAe,CAAI;IAC/C,CAAC;CACJ;AAED,MAAM,OAAO,kBAAmB,SAAQ,aAA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AE,CAAC;QACrB,KAAK,oBAAoB,CAAC,CAAC,CAAC;YACxB,OAAO,CAAC,IAAI,kBAAkB,CAAC,MAAO,EAAE,aAAa,CAAC,4CAA4C,CAAC,EAAE,aAAa,CAAC,iCAAiC,CAAC,CAAC,CAAC,CAAA;QAC3J,CAAC;QACD,KAAK,YAAY,CAAC,CAAC,CAAC;YAChB,OAAO,CAAC,IAAI,UAAU,CAAC,MAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAA;QAC5G,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,2CAA2C,UAAU,CAAC,GAAG,EAAE,CAAC,CAAA;YACxE,OAAO,EAAE,CAAA;QACb,CAAC;IACL,CAAC;AACL,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/helpers/types.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAoB,aAAa,EAAC,MAAM,eAAe,CAAA;AAG9D,eAAO,MAAM,sBAAsB,kBAAmB,aAAa,KAAG,MASrE,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
import { builtinPrimitives } from "@lionweb/core";
|
|
18
|
+
export const tsTypeForPrimitiveType = (primitiveType) => {
|
|
19
|
+
switch (primitiveType) {
|
|
20
|
+
case builtinPrimitives.booleanDatatype: return `boolean`;
|
|
21
|
+
case builtinPrimitives.stringDatatype: return `string`;
|
|
22
|
+
case builtinPrimitives.integerDatatype: return `number`;
|
|
23
|
+
case builtinPrimitives.jsonDatatype: return `unknown`;
|
|
24
|
+
default:
|
|
25
|
+
return `string`;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/helpers/types.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAC,iBAAiB,EAAgB,MAAM,eAAe,CAAA;AAG9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,aAA4B,EAAU,EAAE;IAC3E,QAAQ,aAAa,EAAE,CAAC;QACpB,KAAK,iBAAiB,CAAC,eAAe,CAAC,CAAC,OAAO,SAAS,CAAA;QACxD,KAAK,iBAAiB,CAAC,cAAc,CAAC,CAAC,OAAO,QAAQ,CAAA;QACtD,KAAK,iBAAiB,CAAC,eAAe,CAAC,CAAC,OAAO,QAAQ,CAAA;QACvD,KAAK,iBAAiB,CAAC,YAAY,CAAC,CAAC,OAAO,SAAS,CAAA;QACrD;YACI,OAAO,QAAQ,CAAA;IACvB,CAAC;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-ts.d.ts","sourceRoot":"","sources":["../../src/api/index-ts.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;AAMtC,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAG/C,eAAO,MAAM,UAAU,cAAe,QAAQ,EAAE,WAAW,gBAAgB,WA+B1E,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
import { asString, commaSeparated } from "littoral-templates";
|
|
18
|
+
import { indent } from "../utils/textgen.js";
|
|
19
|
+
import { dependencyOrderOf } from "../utils/toposort.js";
|
|
20
|
+
import { dependenciesThroughDirectInheritanceOf, importRenamingForLanguage, nameOfBaseClassForLanguage } from "./helpers/index.js";
|
|
21
|
+
export const indexTsFor = (languages, options) => {
|
|
22
|
+
const dependenciesInOrderOfDirectInheritance = dependencyOrderOf(languages, dependenciesThroughDirectInheritanceOf);
|
|
23
|
+
if (dependenciesInOrderOfDirectInheritance === false) {
|
|
24
|
+
console.error(`⚠ CYCLE detected! Proceeding with order of languages as-is, instead of in type-wise (through direct inheritance) dependency order ⇒ generated code might not initialize!`);
|
|
25
|
+
}
|
|
26
|
+
const languagesForImports = dependenciesInOrderOfDirectInheritance === false
|
|
27
|
+
? languages
|
|
28
|
+
: dependenciesInOrderOfDirectInheritance
|
|
29
|
+
.filter((language) => languages.indexOf(language) > -1);
|
|
30
|
+
return asString([
|
|
31
|
+
options.header === undefined ? [] : [options.header, ``],
|
|
32
|
+
`import {ILanguageBase, LionCore_builtinsBase} from "${options.genericImportLocation}";`,
|
|
33
|
+
``,
|
|
34
|
+
languagesForImports.map((language) => `import * as ${importRenamingForLanguage(language)} from "./${language.name}.g.js";`),
|
|
35
|
+
``,
|
|
36
|
+
`// ensure that all languages get wired up by triggering that through their first entity:`,
|
|
37
|
+
`LionCore_builtinsBase.INSTANCE.String;`,
|
|
38
|
+
languages
|
|
39
|
+
.filter(({ entities }) => entities.length > 0)
|
|
40
|
+
.map((language) => `${importRenamingForLanguage(language)}.${nameOfBaseClassForLanguage(language)}.INSTANCE.${language.entities[0].name};`),
|
|
41
|
+
``,
|
|
42
|
+
`export const allLanguageBases: ILanguageBase[] = [`,
|
|
43
|
+
indent(commaSeparated(languagesForImports.map((language) => `${importRenamingForLanguage(language)}.${nameOfBaseClassForLanguage(language)}.INSTANCE`))),
|
|
44
|
+
`];`,
|
|
45
|
+
``,
|
|
46
|
+
`export {`,
|
|
47
|
+
indent(commaSeparated(languages.map(importRenamingForLanguage))),
|
|
48
|
+
`};`,
|
|
49
|
+
``
|
|
50
|
+
]);
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=index-ts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-ts.js","sourceRoot":"","sources":["../../src/api/index-ts.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACt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AAC,QAAQ,EAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;aAC3C,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,yBAAyB,CAAC,QAAQ,CAAC,IAAI,0BAA0B,CAAC,QAAQ,CAAC,aAAa,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;QAC/I,EAAE;QACF,oDAAoD;QACpD,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,yBAAyB,CAAC,QAAQ,CAAC,IAAI,0BAA0B,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;QACxJ,IAAI;QACJ,EAAE;QACF,UAAU;QACV,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,CAAC;QAChE,IAAI;QACJ,EAAE;KACL,CAAC,CAAA;AACN,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { generateLanguage, generateApiFromLanguages, generateApiFromLanguagesJson } from "./generator.js";
|
|
2
|
+
export * from "./generation-headers.js";
|
|
3
|
+
export * from "./helpers/mps-annotations.js";
|
|
4
|
+
export * from "./mega-factory.templates.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,gBAAgB,EAAE,wBAAwB,EAAE,4BAA4B,EAAC,MAAM,gBAAgB,CAAA;AACvG,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
export { generateLanguage, generateApiFromLanguages, generateApiFromLanguagesJson } from "./generator.js";
|
|
18
|
+
export * from "./generation-headers.js";
|
|
19
|
+
export * from "./helpers/mps-annotations.js";
|
|
20
|
+
export * from "./mega-factory.templates.js";
|
|
21
|
+
//# sourceMappingURL=index.js.map
|