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 parallel;
20mod parser;
21mod partition;
22/// Malformed-record recovery policy and non-fatal diagnostics.
23pub mod recovery;
24mod references;
25mod scan;
26pub mod schema;
27/// Semantic exchange writer.
28pub mod writer;
29
30pub use diagnostic::{Source, SourceLocation, Span, Spanned, StepError};
31pub use header::is_step_file;
32pub use model::{
33    DataRecord, DataSection, Exchange, HeaderRecord, HeaderSection, Instance, InstanceId,
34    Parameter, Record, StandardHeader, Str,
35};
36pub use parallel::parse_parallel_with;
37pub use parser::{
38    parse, parse_events, parse_events_borrowed, parse_events_with, parse_with, Event, EventSink,
39};
40pub use partition::{data_record_spans, partition_data_records, Partition};
41pub use recovery::{Diagnostic, DiagnosticKind, OnMalformed, ParseOptions, ParseOutcome, Severity};
42pub use scan::{
43    decode_record, decode_record_borrowed, decode_record_borrowed_with, decode_record_with, scan,
44    Records, Scan, ScannedRecord,
45};
46pub use schema::SchemaGraph;
47pub use writer::{write, write_parameter, write_to_string};
48
49/// Maximum nesting accepted for lists and typed parameters.
50pub const MAX_PARAMETER_NESTING: usize = 128;