IfcOpenShell / step-file-parser

ISO 10303 21 Step Physical File parser in pure python
GNU Lesser General Public License v2.1
17 stars 4 forks source link

Invalid FILE_DESCRIPTION not detected #8

Open thbeu opened 7 months ago

thbeu commented 7 months ago

Despite the issue with the UTF-8 BOM I wonder why https://github.com/buildingSMART/IFC/blob/776c6d92a3674bc8a5b371061a40a09a4e6b8354/Examples/Building%20element%20elemented%20case/Examples/Wall%20elemented%20case/File.ifc containg an invalid FILE_DESCRIPTION is reported Valid.

aothms commented 7 months ago

This is only a syntax checker, the definition for header entities we have here in the grammar is fully untyped https://github.com/IfcOpenShell/step-file-parser/blob/master/main.py#L86

We have an item on the backlog to implement header entity validation in https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcopenshell-python/ifcopenshell/validate.py

Although it could easily be implemented here as well, as actually the header is constant/independent for all schema versions. Are you interested in contributing this perhaps?

thbeu commented 6 months ago

Are you interested in contributing this perhaps?

I have no background regarding lark.

aothms commented 6 months ago

Cool. no worries. I don't think it would be implemented in the actual grammar. There's some character length requirements on the header fields for example. I think it's easiest to just implement them as imperative checks as the ast is being built/streamed. But no worries. We'll get to it at some point.