Module ruststep::parser[][src]

Expand description

Tokenize ASCII exchange structure (or STEP-file) defined by ISO-10303-21

This submodule responsible only for tokenize into abstract syntax tree (AST), not for semantic validation.

STEP-file consists of following sections:

  • HEADER
  • 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.

Example

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

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

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

Modules

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

Functions

Parse entire STEP file

Parse HEADER section