Skip to main content

openbim_step/
lib.rs

1//! Generic ISO 10303 STEP Part 21 and EXPRESS syntax infrastructure.
2//!
3//! The crate has no domain-schema dependency. It tokenizes bytes with spans,
4//! decodes physical-file strings, parses records into generic parameters,
5//! writes them back, partitions complete records, and offers a structural,
6//! explicitly partial EXPRESS declaration extractor.
7
8#![forbid(unsafe_code)]
9
10mod diagnostic;
11/// STEP string escape codec.
12pub mod escape;
13/// Structural, explicitly partial EXPRESS declaration extraction.
14pub mod express;
15mod header;
16/// Physical-file tokenizer.
17pub mod lexer;
18mod model;
19mod parser;
20mod partition;
21/// Malformed-record recovery policy and non-fatal diagnostics.
22pub mod recovery;
23/// Semantic exchange writer.
24pub mod writer;
25
26pub use diagnostic::{Source, SourceLocation, Span, Spanned, StepError};
27pub use header::is_step_file;
28pub use model::{
29    DataRecord, DataSection, Exchange, HeaderRecord, HeaderSection, InstanceId, Parameter, Record,
30    StandardHeader,
31};
32pub use parser::{parse, parse_events, parse_events_with, parse_with, Event, EventSink};
33pub use partition::{data_record_spans, partition_data_records, Partition};
34pub use recovery::{Diagnostic, OnMalformed, ParseOptions, ParseOutcome, Severity};
35pub use writer::{write, write_parameter, write_to_string};
36
37/// Maximum nesting accepted for lists and typed parameters.
38pub const MAX_PARAMETER_NESTING: usize = 128;