Module ruststep::parser[][src]

Expand description

Tokenize exchange structure string into ast

ASCII encoding of exchange structure, a.k.a. STEP file, consists of following sections:

  • ANCHOR (optional)
  • REFERENCE (optional)
  • DATA
  • SIGNATURE (optional)

ANCHOR, REFERENCE, and SIGNATURE sections are optional. The syntax of STEP-file is common through schemas, i.e. the tokenize of STEP-file can be done without reading any EXPRESS schema. A target schema is specified in the HEADER section, and it determines how we should understand AST.


use std::{fs, path::*};

// Read ABC Dataset's STEP file format example
let step_file = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
let step_str = fs::read_to_string(step_file).unwrap();

// Parse STEP file into `Exchange` struct
let ex = ruststep::parser::parse(&step_str).unwrap();


Parser for basic alphabets defined in the table 1 of ISO-10303-21

Parser combinators extended for STEP exchange structure

Parser for exchange structure

Parser for tokens defined in the table 2 of ISO-10303-21


Parse entire STEP file

Parse HEADER section