Expand description
Generic ISO 10303 STEP Part 21 and EXPRESS syntax infrastructure.
The crate has no domain-schema dependency. It tokenizes bytes with spans, decodes physical-file strings, parses records into generic parameters, writes them back, partitions complete records, and offers a structural, explicitly partial EXPRESS declaration extractor.
Re-exports§
pub use recovery::Diagnostic;pub use recovery::DiagnosticKind;pub use recovery::OnMalformed;pub use recovery::ParseOptions;pub use recovery::ParseOutcome;pub use recovery::Severity;pub use schema::SchemaGraph;pub use writer::write;pub use writer::write_parameter;pub use writer::write_to_string;
Modules§
- escape
- STEP string escape codec. STEP string-literal escape decoding and encoding.
- express
- Structural, explicitly partial EXPRESS declaration extraction. Explicitly structural, partial EXPRESS declaration extraction.
- lexer
- Physical-file tokenizer. Byte-level tokenizer for STEP physical files.
- recovery
- Malformed-record recovery policy and non-fatal diagnostics. Opt-in malformed-record recovery policy and non-fatal diagnostics.
- schema
- The parsed schema as a queryable graph.
- writer
- Semantic exchange writer. Semantic exchange writer.
Structs§
- Data
Record - A simple or complex
#id=...;instance inDATA;. - Data
Section - The generic
DATA; ... ENDSEC;section. - Exchange
- A complete ISO 10303-21 exchange structure.
- Header
Record - A record in
HEADER;. - Header
Section - The generic
HEADER; ... ENDSEC;section. - Instance
Id - An arbitrary-precision instance identifier as written by
#42. - Partition
- A half-open byte range containing one or more complete data records.
- Record
- One named parameter record within a DATA instance.
- Records
- Iterator over framed data records; see
Scan::records. - Scan
- A data section indexed by
scan: the parsed header and an iterator over the framed data records. - Scanned
Record - One framed data record:
#id = NAME(...);or#id = (A(...)B(...));. - Source
- Source text used to resolve byte spans to human-readable locations.
- Source
Location - A source span resolved to a display location.
- Span
- A half-open byte range in the original source.
- Spanned
- A value paired with its source span.
- Standard
Header - Standard header fields projected from raw header records.
- Step
Error - Failure while tokenizing or semantically parsing a physical file.
- Str
- The owned model’s string: values of up to 22 bytes – nearly every
number, GUID and entity name in a STEP file – are stored inline without
an allocation, and longer ones are one shared
Arc<str>.
Enums§
- Event
- A semantic parser event.
- Instance
- The body of a
#id=...;instance, as written. - Parameter
- One generic parameter value.
Constants§
- MAX_
PARAMETER_ NESTING - Maximum nesting accepted for lists and typed parameters.
Traits§
- Event
Sink - Consumer for parse events.
Functions§
- data_
record_ spans - Locates complete data records.
- decode_
record - Parses the data record that occupies exactly
spanofinput, with owned text asparsereturns it. - decode_
record_ borrowed decode_recordwith text borrowed frominputwherever it needs no rewriting, asparse_events_borrowedreturns it.- decode_
record_ borrowed_ with decode_record_borrowedunderoptions; seedecode_record_with.- decode_
record_ with decode_recordunderoptions: the record exactly asparse_withreads it with the same options, and the diagnostics that parse reports for it.- is_
step_ file - Returns whether bytes begin with the ISO 10303-21 marker.
- parse
- Parses a physical file into an owned generic exchange structure.
- parse_
events - Parses a physical file and sends semantic records to
sink. - parse_
events_ borrowed - Streams semantic records whose text borrows from
inputwhere it can. - parse_
events_ with - Streams semantic records under explicit
ParseOptions, returning the non-fatal diagnostics collected on the way. - parse_
parallel_ with - Parses on up to
threadsthreads, returning exactly whatparse_withreturns for the same input and options: the same exchange, the same diagnostics in the same order, the same error. - parse_
with - Parses a physical file under explicit
ParseOptions. - partition_
data_ records - Splits data records into at most
partition_countbalanced groups. - scan
- Indexes the data records of a physical file without decoding them.