@ifc-lite/codegen 1.15.4 ā 1.15.6
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/README.md +18 -15
- package/package.json +16 -6
- package/.turbo/turbo-build.log +0 -4
- package/CHANGELOG.md +0 -165
- package/INTEGRATION.md +0 -360
- package/generated/ifc4/entities.ts +0 -7400
- package/generated/ifc4/enums.ts +0 -2467
- package/generated/ifc4/index.ts +0 -17
- package/generated/ifc4/schema-registry.ts +0 -63186
- package/generated/ifc4/selects.ts +0 -315
- package/generated/ifc4/serializers.ts +0 -51
- package/generated/ifc4/test-compile.ts +0 -49
- package/generated/ifc4/type-ids.ts +0 -1682
- package/generated/ifc4/types.ts +0 -401
- package/generated/ifc4x3/entities.ts +0 -8300
- package/generated/ifc4x3/enums.ts +0 -3096
- package/generated/ifc4x3/index.ts +0 -17
- package/generated/ifc4x3/schema-registry.ts +0 -71489
- package/generated/ifc4x3/selects.ts +0 -312
- package/generated/ifc4x3/serializers.ts +0 -51
- package/generated/ifc4x3/test-compile.ts +0 -49
- package/generated/ifc4x3/type-ids.ts +0 -1882
- package/generated/ifc4x3/types.ts +0 -407
- package/src/cli.ts +0 -72
- package/src/crc32.ts +0 -77
- package/src/express-parser.ts +0 -457
- package/src/generator.ts +0 -268
- package/src/index.ts +0 -57
- package/src/rust-generator.ts +0 -714
- package/src/serialization-generator.ts +0 -74
- package/src/type-ids-generator.ts +0 -166
- package/src/typescript-generator.ts +0 -631
- package/test/express-parser.test.ts +0 -363
- package/test/integration.test.ts +0 -246
- package/test/serialization-generator.test.ts +0 -65
- package/test/typescript-generator.test.ts +0 -348
- package/tsconfig.json +0 -21
- package/vitest.config.ts +0 -18
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IFC Type Aliases
|
|
3
|
-
* Generated from EXPRESS schema: IFC4X3_DEV_923b0514
|
|
4
|
-
*
|
|
5
|
-
* DO NOT EDIT - This file is auto-generated
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type {
|
|
9
|
-
IfcPropertySetDefinition,
|
|
10
|
-
} from './entities.js';
|
|
11
|
-
|
|
12
|
-
/** IfcAbsorbedDoseMeasure */
|
|
13
|
-
export type IfcAbsorbedDoseMeasure = number;
|
|
14
|
-
|
|
15
|
-
/** IfcAccelerationMeasure */
|
|
16
|
-
export type IfcAccelerationMeasure = number;
|
|
17
|
-
|
|
18
|
-
/** IfcAmountOfSubstanceMeasure */
|
|
19
|
-
export type IfcAmountOfSubstanceMeasure = number;
|
|
20
|
-
|
|
21
|
-
/** IfcAngularVelocityMeasure */
|
|
22
|
-
export type IfcAngularVelocityMeasure = number;
|
|
23
|
-
|
|
24
|
-
/** IfcArcIndex */
|
|
25
|
-
export type IfcArcIndex = IfcPositiveInteger[];
|
|
26
|
-
|
|
27
|
-
/** IfcAreaDensityMeasure */
|
|
28
|
-
export type IfcAreaDensityMeasure = number;
|
|
29
|
-
|
|
30
|
-
/** IfcAreaMeasure */
|
|
31
|
-
export type IfcAreaMeasure = number;
|
|
32
|
-
|
|
33
|
-
/** IfcBinary */
|
|
34
|
-
export type IfcBinary = string;
|
|
35
|
-
|
|
36
|
-
/** IfcBoolean */
|
|
37
|
-
export type IfcBoolean = boolean;
|
|
38
|
-
|
|
39
|
-
/** IfcBoxAlignment */
|
|
40
|
-
export type IfcBoxAlignment = IfcLabel;
|
|
41
|
-
|
|
42
|
-
/** IfcCardinalPointReference */
|
|
43
|
-
export type IfcCardinalPointReference = number;
|
|
44
|
-
|
|
45
|
-
/** IfcComplexNumber */
|
|
46
|
-
export type IfcComplexNumber = number[];
|
|
47
|
-
|
|
48
|
-
/** IfcCompoundPlaneAngleMeasure */
|
|
49
|
-
export type IfcCompoundPlaneAngleMeasure = number[];
|
|
50
|
-
|
|
51
|
-
/** IfcContextDependentMeasure */
|
|
52
|
-
export type IfcContextDependentMeasure = number;
|
|
53
|
-
|
|
54
|
-
/** IfcCountMeasure */
|
|
55
|
-
export type IfcCountMeasure = number;
|
|
56
|
-
|
|
57
|
-
/** IfcCurvatureMeasure */
|
|
58
|
-
export type IfcCurvatureMeasure = number;
|
|
59
|
-
|
|
60
|
-
/** IfcDate */
|
|
61
|
-
export type IfcDate = string;
|
|
62
|
-
|
|
63
|
-
/** IfcDateTime */
|
|
64
|
-
export type IfcDateTime = string;
|
|
65
|
-
|
|
66
|
-
/** IfcDayInMonthNumber */
|
|
67
|
-
export type IfcDayInMonthNumber = number;
|
|
68
|
-
|
|
69
|
-
/** IfcDayInWeekNumber */
|
|
70
|
-
export type IfcDayInWeekNumber = number;
|
|
71
|
-
|
|
72
|
-
/** IfcDescriptiveMeasure */
|
|
73
|
-
export type IfcDescriptiveMeasure = string;
|
|
74
|
-
|
|
75
|
-
/** IfcDimensionCount */
|
|
76
|
-
export type IfcDimensionCount = number;
|
|
77
|
-
|
|
78
|
-
/** IfcDoseEquivalentMeasure */
|
|
79
|
-
export type IfcDoseEquivalentMeasure = number;
|
|
80
|
-
|
|
81
|
-
/** IfcDuration */
|
|
82
|
-
export type IfcDuration = string;
|
|
83
|
-
|
|
84
|
-
/** IfcDynamicViscosityMeasure */
|
|
85
|
-
export type IfcDynamicViscosityMeasure = number;
|
|
86
|
-
|
|
87
|
-
/** IfcElectricCapacitanceMeasure */
|
|
88
|
-
export type IfcElectricCapacitanceMeasure = number;
|
|
89
|
-
|
|
90
|
-
/** IfcElectricChargeMeasure */
|
|
91
|
-
export type IfcElectricChargeMeasure = number;
|
|
92
|
-
|
|
93
|
-
/** IfcElectricConductanceMeasure */
|
|
94
|
-
export type IfcElectricConductanceMeasure = number;
|
|
95
|
-
|
|
96
|
-
/** IfcElectricCurrentMeasure */
|
|
97
|
-
export type IfcElectricCurrentMeasure = number;
|
|
98
|
-
|
|
99
|
-
/** IfcElectricResistanceMeasure */
|
|
100
|
-
export type IfcElectricResistanceMeasure = number;
|
|
101
|
-
|
|
102
|
-
/** IfcElectricVoltageMeasure */
|
|
103
|
-
export type IfcElectricVoltageMeasure = number;
|
|
104
|
-
|
|
105
|
-
/** IfcEnergyMeasure */
|
|
106
|
-
export type IfcEnergyMeasure = number;
|
|
107
|
-
|
|
108
|
-
/** IfcFontStyle */
|
|
109
|
-
export type IfcFontStyle = string;
|
|
110
|
-
|
|
111
|
-
/** IfcFontVariant */
|
|
112
|
-
export type IfcFontVariant = string;
|
|
113
|
-
|
|
114
|
-
/** IfcFontWeight */
|
|
115
|
-
export type IfcFontWeight = string;
|
|
116
|
-
|
|
117
|
-
/** IfcForceMeasure */
|
|
118
|
-
export type IfcForceMeasure = number;
|
|
119
|
-
|
|
120
|
-
/** IfcFrequencyMeasure */
|
|
121
|
-
export type IfcFrequencyMeasure = number;
|
|
122
|
-
|
|
123
|
-
/** IfcGloballyUniqueId */
|
|
124
|
-
export type IfcGloballyUniqueId = string;
|
|
125
|
-
|
|
126
|
-
/** IfcHeatFluxDensityMeasure */
|
|
127
|
-
export type IfcHeatFluxDensityMeasure = number;
|
|
128
|
-
|
|
129
|
-
/** IfcHeatingValueMeasure */
|
|
130
|
-
export type IfcHeatingValueMeasure = number;
|
|
131
|
-
|
|
132
|
-
/** IfcIdentifier */
|
|
133
|
-
export type IfcIdentifier = string;
|
|
134
|
-
|
|
135
|
-
/** IfcIlluminanceMeasure */
|
|
136
|
-
export type IfcIlluminanceMeasure = number;
|
|
137
|
-
|
|
138
|
-
/** IfcInductanceMeasure */
|
|
139
|
-
export type IfcInductanceMeasure = number;
|
|
140
|
-
|
|
141
|
-
/** IfcInteger */
|
|
142
|
-
export type IfcInteger = number;
|
|
143
|
-
|
|
144
|
-
/** IfcIntegerCountRateMeasure */
|
|
145
|
-
export type IfcIntegerCountRateMeasure = number;
|
|
146
|
-
|
|
147
|
-
/** IfcIonConcentrationMeasure */
|
|
148
|
-
export type IfcIonConcentrationMeasure = number;
|
|
149
|
-
|
|
150
|
-
/** IfcIsothermalMoistureCapacityMeasure */
|
|
151
|
-
export type IfcIsothermalMoistureCapacityMeasure = number;
|
|
152
|
-
|
|
153
|
-
/** IfcKinematicViscosityMeasure */
|
|
154
|
-
export type IfcKinematicViscosityMeasure = number;
|
|
155
|
-
|
|
156
|
-
/** IfcLabel */
|
|
157
|
-
export type IfcLabel = string;
|
|
158
|
-
|
|
159
|
-
/** IfcLanguageId */
|
|
160
|
-
export type IfcLanguageId = IfcIdentifier;
|
|
161
|
-
|
|
162
|
-
/** IfcLengthMeasure */
|
|
163
|
-
export type IfcLengthMeasure = number;
|
|
164
|
-
|
|
165
|
-
/** IfcLineIndex */
|
|
166
|
-
export type IfcLineIndex = IfcPositiveInteger[];
|
|
167
|
-
|
|
168
|
-
/** IfcLinearForceMeasure */
|
|
169
|
-
export type IfcLinearForceMeasure = number;
|
|
170
|
-
|
|
171
|
-
/** IfcLinearMomentMeasure */
|
|
172
|
-
export type IfcLinearMomentMeasure = number;
|
|
173
|
-
|
|
174
|
-
/** IfcLinearStiffnessMeasure */
|
|
175
|
-
export type IfcLinearStiffnessMeasure = number;
|
|
176
|
-
|
|
177
|
-
/** IfcLinearVelocityMeasure */
|
|
178
|
-
export type IfcLinearVelocityMeasure = number;
|
|
179
|
-
|
|
180
|
-
/** IfcLogical */
|
|
181
|
-
export type IfcLogical = boolean | null;
|
|
182
|
-
|
|
183
|
-
/** IfcLuminousFluxMeasure */
|
|
184
|
-
export type IfcLuminousFluxMeasure = number;
|
|
185
|
-
|
|
186
|
-
/** IfcLuminousIntensityDistributionMeasure */
|
|
187
|
-
export type IfcLuminousIntensityDistributionMeasure = number;
|
|
188
|
-
|
|
189
|
-
/** IfcLuminousIntensityMeasure */
|
|
190
|
-
export type IfcLuminousIntensityMeasure = number;
|
|
191
|
-
|
|
192
|
-
/** IfcMagneticFluxDensityMeasure */
|
|
193
|
-
export type IfcMagneticFluxDensityMeasure = number;
|
|
194
|
-
|
|
195
|
-
/** IfcMagneticFluxMeasure */
|
|
196
|
-
export type IfcMagneticFluxMeasure = number;
|
|
197
|
-
|
|
198
|
-
/** IfcMassDensityMeasure */
|
|
199
|
-
export type IfcMassDensityMeasure = number;
|
|
200
|
-
|
|
201
|
-
/** IfcMassFlowRateMeasure */
|
|
202
|
-
export type IfcMassFlowRateMeasure = number;
|
|
203
|
-
|
|
204
|
-
/** IfcMassMeasure */
|
|
205
|
-
export type IfcMassMeasure = number;
|
|
206
|
-
|
|
207
|
-
/** IfcMassPerLengthMeasure */
|
|
208
|
-
export type IfcMassPerLengthMeasure = number;
|
|
209
|
-
|
|
210
|
-
/** IfcModulusOfElasticityMeasure */
|
|
211
|
-
export type IfcModulusOfElasticityMeasure = number;
|
|
212
|
-
|
|
213
|
-
/** IfcModulusOfLinearSubgradeReactionMeasure */
|
|
214
|
-
export type IfcModulusOfLinearSubgradeReactionMeasure = number;
|
|
215
|
-
|
|
216
|
-
/** IfcModulusOfRotationalSubgradeReactionMeasure */
|
|
217
|
-
export type IfcModulusOfRotationalSubgradeReactionMeasure = number;
|
|
218
|
-
|
|
219
|
-
/** IfcModulusOfSubgradeReactionMeasure */
|
|
220
|
-
export type IfcModulusOfSubgradeReactionMeasure = number;
|
|
221
|
-
|
|
222
|
-
/** IfcMoistureDiffusivityMeasure */
|
|
223
|
-
export type IfcMoistureDiffusivityMeasure = number;
|
|
224
|
-
|
|
225
|
-
/** IfcMolecularWeightMeasure */
|
|
226
|
-
export type IfcMolecularWeightMeasure = number;
|
|
227
|
-
|
|
228
|
-
/** IfcMomentOfInertiaMeasure */
|
|
229
|
-
export type IfcMomentOfInertiaMeasure = number;
|
|
230
|
-
|
|
231
|
-
/** IfcMonetaryMeasure */
|
|
232
|
-
export type IfcMonetaryMeasure = number;
|
|
233
|
-
|
|
234
|
-
/** IfcMonthInYearNumber */
|
|
235
|
-
export type IfcMonthInYearNumber = number;
|
|
236
|
-
|
|
237
|
-
/** IfcNonNegativeLengthMeasure */
|
|
238
|
-
export type IfcNonNegativeLengthMeasure = number;
|
|
239
|
-
|
|
240
|
-
/** IfcNormalisedRatioMeasure */
|
|
241
|
-
export type IfcNormalisedRatioMeasure = number;
|
|
242
|
-
|
|
243
|
-
/** IfcNumericMeasure */
|
|
244
|
-
export type IfcNumericMeasure = number;
|
|
245
|
-
|
|
246
|
-
/** IfcPHMeasure */
|
|
247
|
-
export type IfcPHMeasure = number;
|
|
248
|
-
|
|
249
|
-
/** IfcParameterValue */
|
|
250
|
-
export type IfcParameterValue = number;
|
|
251
|
-
|
|
252
|
-
/** IfcPlanarForceMeasure */
|
|
253
|
-
export type IfcPlanarForceMeasure = number;
|
|
254
|
-
|
|
255
|
-
/** IfcPlaneAngleMeasure */
|
|
256
|
-
export type IfcPlaneAngleMeasure = number;
|
|
257
|
-
|
|
258
|
-
/** IfcPositiveInteger */
|
|
259
|
-
export type IfcPositiveInteger = IfcInteger;
|
|
260
|
-
|
|
261
|
-
/** IfcPositiveLengthMeasure */
|
|
262
|
-
export type IfcPositiveLengthMeasure = number;
|
|
263
|
-
|
|
264
|
-
/** IfcPositivePlaneAngleMeasure */
|
|
265
|
-
export type IfcPositivePlaneAngleMeasure = number;
|
|
266
|
-
|
|
267
|
-
/** IfcPositiveRatioMeasure */
|
|
268
|
-
export type IfcPositiveRatioMeasure = number;
|
|
269
|
-
|
|
270
|
-
/** IfcPowerMeasure */
|
|
271
|
-
export type IfcPowerMeasure = number;
|
|
272
|
-
|
|
273
|
-
/** IfcPresentableText */
|
|
274
|
-
export type IfcPresentableText = string;
|
|
275
|
-
|
|
276
|
-
/** IfcPressureMeasure */
|
|
277
|
-
export type IfcPressureMeasure = number;
|
|
278
|
-
|
|
279
|
-
/** IfcPropertySetDefinitionSet */
|
|
280
|
-
export type IfcPropertySetDefinitionSet = IfcPropertySetDefinition[];
|
|
281
|
-
|
|
282
|
-
/** IfcRadioActivityMeasure */
|
|
283
|
-
export type IfcRadioActivityMeasure = number;
|
|
284
|
-
|
|
285
|
-
/** IfcRatioMeasure */
|
|
286
|
-
export type IfcRatioMeasure = number;
|
|
287
|
-
|
|
288
|
-
/** IfcReal */
|
|
289
|
-
export type IfcReal = number;
|
|
290
|
-
|
|
291
|
-
/** IfcRotationalFrequencyMeasure */
|
|
292
|
-
export type IfcRotationalFrequencyMeasure = number;
|
|
293
|
-
|
|
294
|
-
/** IfcRotationalMassMeasure */
|
|
295
|
-
export type IfcRotationalMassMeasure = number;
|
|
296
|
-
|
|
297
|
-
/** IfcRotationalStiffnessMeasure */
|
|
298
|
-
export type IfcRotationalStiffnessMeasure = number;
|
|
299
|
-
|
|
300
|
-
/** IfcSectionModulusMeasure */
|
|
301
|
-
export type IfcSectionModulusMeasure = number;
|
|
302
|
-
|
|
303
|
-
/** IfcSectionalAreaIntegralMeasure */
|
|
304
|
-
export type IfcSectionalAreaIntegralMeasure = number;
|
|
305
|
-
|
|
306
|
-
/** IfcShearModulusMeasure */
|
|
307
|
-
export type IfcShearModulusMeasure = number;
|
|
308
|
-
|
|
309
|
-
/** IfcSolidAngleMeasure */
|
|
310
|
-
export type IfcSolidAngleMeasure = number;
|
|
311
|
-
|
|
312
|
-
/** IfcSoundPowerLevelMeasure */
|
|
313
|
-
export type IfcSoundPowerLevelMeasure = number;
|
|
314
|
-
|
|
315
|
-
/** IfcSoundPowerMeasure */
|
|
316
|
-
export type IfcSoundPowerMeasure = number;
|
|
317
|
-
|
|
318
|
-
/** IfcSoundPressureLevelMeasure */
|
|
319
|
-
export type IfcSoundPressureLevelMeasure = number;
|
|
320
|
-
|
|
321
|
-
/** IfcSoundPressureMeasure */
|
|
322
|
-
export type IfcSoundPressureMeasure = number;
|
|
323
|
-
|
|
324
|
-
/** IfcSpecificHeatCapacityMeasure */
|
|
325
|
-
export type IfcSpecificHeatCapacityMeasure = number;
|
|
326
|
-
|
|
327
|
-
/** IfcSpecularExponent */
|
|
328
|
-
export type IfcSpecularExponent = number;
|
|
329
|
-
|
|
330
|
-
/** IfcSpecularRoughness */
|
|
331
|
-
export type IfcSpecularRoughness = number;
|
|
332
|
-
|
|
333
|
-
/** IfcStrippedOptional */
|
|
334
|
-
export type IfcStrippedOptional = boolean;
|
|
335
|
-
|
|
336
|
-
/** IfcTemperatureGradientMeasure */
|
|
337
|
-
export type IfcTemperatureGradientMeasure = number;
|
|
338
|
-
|
|
339
|
-
/** IfcTemperatureRateOfChangeMeasure */
|
|
340
|
-
export type IfcTemperatureRateOfChangeMeasure = number;
|
|
341
|
-
|
|
342
|
-
/** IfcText */
|
|
343
|
-
export type IfcText = string;
|
|
344
|
-
|
|
345
|
-
/** IfcTextAlignment */
|
|
346
|
-
export type IfcTextAlignment = string;
|
|
347
|
-
|
|
348
|
-
/** IfcTextDecoration */
|
|
349
|
-
export type IfcTextDecoration = string;
|
|
350
|
-
|
|
351
|
-
/** IfcTextFontName */
|
|
352
|
-
export type IfcTextFontName = string;
|
|
353
|
-
|
|
354
|
-
/** IfcTextTransformation */
|
|
355
|
-
export type IfcTextTransformation = string;
|
|
356
|
-
|
|
357
|
-
/** IfcThermalAdmittanceMeasure */
|
|
358
|
-
export type IfcThermalAdmittanceMeasure = number;
|
|
359
|
-
|
|
360
|
-
/** IfcThermalConductivityMeasure */
|
|
361
|
-
export type IfcThermalConductivityMeasure = number;
|
|
362
|
-
|
|
363
|
-
/** IfcThermalExpansionCoefficientMeasure */
|
|
364
|
-
export type IfcThermalExpansionCoefficientMeasure = number;
|
|
365
|
-
|
|
366
|
-
/** IfcThermalResistanceMeasure */
|
|
367
|
-
export type IfcThermalResistanceMeasure = number;
|
|
368
|
-
|
|
369
|
-
/** IfcThermalTransmittanceMeasure */
|
|
370
|
-
export type IfcThermalTransmittanceMeasure = number;
|
|
371
|
-
|
|
372
|
-
/** IfcThermodynamicTemperatureMeasure */
|
|
373
|
-
export type IfcThermodynamicTemperatureMeasure = number;
|
|
374
|
-
|
|
375
|
-
/** IfcTime */
|
|
376
|
-
export type IfcTime = string;
|
|
377
|
-
|
|
378
|
-
/** IfcTimeMeasure */
|
|
379
|
-
export type IfcTimeMeasure = number;
|
|
380
|
-
|
|
381
|
-
/** IfcTimeStamp */
|
|
382
|
-
export type IfcTimeStamp = number;
|
|
383
|
-
|
|
384
|
-
/** IfcTorqueMeasure */
|
|
385
|
-
export type IfcTorqueMeasure = number;
|
|
386
|
-
|
|
387
|
-
/** IfcURIReference */
|
|
388
|
-
export type IfcURIReference = string;
|
|
389
|
-
|
|
390
|
-
/** IfcVaporPermeabilityMeasure */
|
|
391
|
-
export type IfcVaporPermeabilityMeasure = number;
|
|
392
|
-
|
|
393
|
-
/** IfcVolumeMeasure */
|
|
394
|
-
export type IfcVolumeMeasure = number;
|
|
395
|
-
|
|
396
|
-
/** IfcVolumetricFlowRateMeasure */
|
|
397
|
-
export type IfcVolumetricFlowRateMeasure = number;
|
|
398
|
-
|
|
399
|
-
/** IfcWarpingConstantMeasure */
|
|
400
|
-
export type IfcWarpingConstantMeasure = number;
|
|
401
|
-
|
|
402
|
-
/** IfcWarpingMomentMeasure */
|
|
403
|
-
export type IfcWarpingMomentMeasure = number;
|
|
404
|
-
|
|
405
|
-
/** IfcWellKnownTextLiteral */
|
|
406
|
-
export type IfcWellKnownTextLiteral = string;
|
|
407
|
-
|
package/src/cli.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
-
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* CLI for IFC code generation
|
|
8
|
-
*
|
|
9
|
-
* Generates TypeScript and optionally Rust code from IFC EXPRESS schemas.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { Command } from 'commander';
|
|
13
|
-
import { generateFromFile, type GeneratorOptions } from './generator.js';
|
|
14
|
-
|
|
15
|
-
const program = new Command();
|
|
16
|
-
|
|
17
|
-
program
|
|
18
|
-
.name('ifc-codegen')
|
|
19
|
-
.description('Generate TypeScript and Rust code from IFC EXPRESS schemas')
|
|
20
|
-
.version('0.2.0');
|
|
21
|
-
|
|
22
|
-
program
|
|
23
|
-
.argument('<schema>', 'Path to EXPRESS schema file (.exp)')
|
|
24
|
-
.option('-o, --output <dir>', 'Output directory', './generated')
|
|
25
|
-
.option('-r, --rust', 'Generate Rust code', false)
|
|
26
|
-
.option('--rust-dir <dir>', 'Rust output subdirectory (relative to output)', 'rust')
|
|
27
|
-
.option('--skip-collision-check', 'Skip CRC32 collision check', false)
|
|
28
|
-
.option('-v, --verbose', 'Verbose output', false)
|
|
29
|
-
.action(
|
|
30
|
-
(
|
|
31
|
-
schemaPath: string,
|
|
32
|
-
options: {
|
|
33
|
-
output: string;
|
|
34
|
-
rust: boolean;
|
|
35
|
-
rustDir: string;
|
|
36
|
-
skipCollisionCheck: boolean;
|
|
37
|
-
verbose: boolean;
|
|
38
|
-
}
|
|
39
|
-
) => {
|
|
40
|
-
try {
|
|
41
|
-
console.log('š IFC Code Generator\n');
|
|
42
|
-
console.log(`Schema: ${schemaPath}`);
|
|
43
|
-
console.log(`Output: ${options.output}`);
|
|
44
|
-
if (options.rust) {
|
|
45
|
-
// Check if rustDir is absolute or relative for display
|
|
46
|
-
const rustDisplay = options.rustDir.startsWith('/')
|
|
47
|
-
? options.rustDir
|
|
48
|
-
: `${options.output}/${options.rustDir}`;
|
|
49
|
-
console.log(`Rust: ${rustDisplay}`);
|
|
50
|
-
}
|
|
51
|
-
console.log();
|
|
52
|
-
|
|
53
|
-
const start = Date.now();
|
|
54
|
-
|
|
55
|
-
const genOptions: GeneratorOptions = {
|
|
56
|
-
rust: options.rust,
|
|
57
|
-
rustDir: options.rustDir,
|
|
58
|
-
skipCollisionCheck: options.skipCollisionCheck,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
generateFromFile(schemaPath, options.output, genOptions);
|
|
62
|
-
|
|
63
|
-
const elapsed = Date.now() - start;
|
|
64
|
-
console.log(`\nā±ļø Completed in ${elapsed}ms`);
|
|
65
|
-
} catch (error) {
|
|
66
|
-
console.error('\nā Error:', error instanceof Error ? error.message : error);
|
|
67
|
-
process.exit(1);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
program.parse();
|
package/src/crc32.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* CRC32 Type ID Generator
|
|
7
|
-
*
|
|
8
|
-
* Generates consistent CRC32 hashes for IFC type names.
|
|
9
|
-
* Used for fast O(1) type lookup in both TypeScript and Rust.
|
|
10
|
-
*
|
|
11
|
-
* This matches the algorithm used by web-ifc for compatibility.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
// Pre-computed CRC32 lookup table (IEEE polynomial)
|
|
15
|
-
const CRC32_TABLE = buildCRC32Table();
|
|
16
|
-
|
|
17
|
-
function buildCRC32Table(): Uint32Array {
|
|
18
|
-
const table = new Uint32Array(256);
|
|
19
|
-
for (let i = 0; i < 256; i++) {
|
|
20
|
-
let c = i;
|
|
21
|
-
for (let j = 0; j < 8; j++) {
|
|
22
|
-
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
23
|
-
}
|
|
24
|
-
table[i] = c >>> 0;
|
|
25
|
-
}
|
|
26
|
-
return table;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Calculate CRC32 hash for a string
|
|
31
|
-
* @param str Input string (will be uppercased)
|
|
32
|
-
* @returns 32-bit unsigned integer hash
|
|
33
|
-
*/
|
|
34
|
-
export function crc32(str: string): number {
|
|
35
|
-
const upper = str.toUpperCase();
|
|
36
|
-
let crc = 0xffffffff;
|
|
37
|
-
for (let i = 0; i < upper.length; i++) {
|
|
38
|
-
crc = CRC32_TABLE[(crc ^ upper.charCodeAt(i)) & 0xff] ^ (crc >>> 8);
|
|
39
|
-
}
|
|
40
|
-
return (crc ^ 0xffffffff) >>> 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Generate type IDs for all entities in a schema
|
|
45
|
-
*/
|
|
46
|
-
export function generateTypeIds(entityNames: string[]): Map<string, number> {
|
|
47
|
-
const ids = new Map<string, number>();
|
|
48
|
-
for (const name of entityNames) {
|
|
49
|
-
ids.set(name, crc32(name));
|
|
50
|
-
}
|
|
51
|
-
return ids;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Check for CRC32 collisions in a list of names
|
|
56
|
-
* @returns Map of hash -> names[] for any collisions
|
|
57
|
-
*/
|
|
58
|
-
export function findCollisions(names: string[]): Map<number, string[]> {
|
|
59
|
-
const hashToNames = new Map<number, string[]>();
|
|
60
|
-
|
|
61
|
-
for (const name of names) {
|
|
62
|
-
const hash = crc32(name);
|
|
63
|
-
const existing = hashToNames.get(hash) || [];
|
|
64
|
-
existing.push(name);
|
|
65
|
-
hashToNames.set(hash, existing);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Filter to only collisions
|
|
69
|
-
const collisions = new Map<number, string[]>();
|
|
70
|
-
for (const [hash, nameList] of hashToNames) {
|
|
71
|
-
if (nameList.length > 1) {
|
|
72
|
-
collisions.set(hash, nameList);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return collisions;
|
|
77
|
-
}
|