This directory contains an altered version of the AP242 (ISO 10303-242) schema.
It is corrected to avoid the non-standard parsing requirement of the original by using explicit TREAT expression for type narrowing
Both files are identical except for a single line at line 34149 in the styled_item entity WHERE rule WR3:
Original (242_mim_lf.exp):
QUERY(it <* item | ...)
TREAT version (242_mim_lf_treat.exp):
QUERY(it <* TREAT(item AS set_representation_item) | ...)
The original AP242 schema contains a WHERE rule that:
- Checks if
item(a SELECT type) is aSET_REPRESENTATION_ITEM - Then tries to iterate over
itemin a QUERY expression
This pattern requires implicit type narrowing, which is not part of the ISO 10303-11 standard.
STEPcode implements flow-sensitive type narrowing as an extension:
- Recognizes TYPEOF guard patterns like
'Type' IN TYPEOF(var)in AND expressions - Automatically narrows the type for subsequent uses
- Makes the original schema parse successfully
The TREAT version uses the ISO 10303-11 TREAT expression:
TREAT(item AS set_representation_item)explicitly narrows the type- No implicit narrowing needed
- Works in any compliant EXPRESS parser
Both versions parse successfully and produce identical output:
# Run comparison test
./test/compare_ap242_versions.shExpected output:
✓ Both versions parse successfully
✓ Both versions generate the same number of files
For detailed comparison, see doc/ap242-comparison.md.
doc/ap242-comparison.md- Detailed comparison and analysisdoc/express-type-unwrapping.md- TREAT and narrowing documentationsrc/express/test/README_AP242_BASELINE.md- Historical PE056 error info