Skip to main content

Module p21

Module p21 

Source

Structs§

Parser

Constants§

MAX_NESTING_DEPTH
Recursive-descent parser for ISO 10303-21 (Part 21) files.

Functions§

parse
Convenience function: parse a complete Part 21 source into an Graph.
parse_bytes
Parse a Part 21 source given as raw bytes. Tries UTF-8 first; on failure falls back to ISO 8859-1 (Latin-1), which ISO 10303-21 §3.2 defines as the file format’s default encoding. Real-world STEP files frequently embed raw non-ASCII bytes (Cyrillic, Latin-1) directly instead of using the spec’s \X\ / \X2\ / \X4\ escapes — those bytes decode losslessly under the fallback (every byte 0x00..0xFF maps 1:1 to U+0000..U+00FF).