Class default<TypeIDType>

Parses out STEP files to allow indexing and deserialization.

Type Parameters

  • TypeIDType

Hierarchy (view full)

Constructors

Accessors

  • get instance(): StepHeaderParser
  • Get the singleton static instance of this.

    Returns StepHeaderParser

    The singleton instance of this.

Methods

  • Parse arguments from a single line from a step file, indexing it.,

    Parameters

    • input: default

      The input parsing buffer, in the data section.

    • expressID: number

    Returns [any, ParseResult]

    The parsing result, including the arguments array and result enum.

  • This uses a much lighter non correctness verifying parse to extract the locations of the fields for an entry, using the v-table builder to append the top level entries.

    In this case, the cursor should represent the start of the

    Parameters

    • input: Uint8Array<ArrayBufferLike>
    • cursor: number
    • endCursor: number
    • vtableBuilder: default

    Returns undefined | [number, number, number]

    The vtable slice or undefined if it's not defined due to an error.

  • Parse the data block of a step file, indexing it.

    Synchronous driver over parseDataBlockIncremental — see parseDataBlockAsync for the cooperative (repaint-friendly) variant.

    Parameters

    • input: default

      The input parsing buffer, in the data section.

    • OptionalonProgress: ParseProgressCallback

      Optional byte-cursor progress callback, invoked roughly every PARSE_PROGRESS_ELEMENT_MASK + 1 elements.

    Returns BlockParseResult<TypeIDType>

    The parsing result, including the index and result enum.

  • Cooperative variant of parseDataBlock: identical parse (same generator body), but periodically awaits a macrotask so the event loop can run — browsers repaint progress UI, watchdog timers fire, and the tab is not flagged as stalled during a large parse. Issue #301 §2.

    Parameters

    • input: default

      The input parsing buffer, in the data section.

    • OptionalonProgress: ParseProgressCallback

      Optional byte-cursor progress callback.

    • yieldIntervalMs: number = DEFAULT_PARSE_YIELD_INTERVAL_MS

      Minimum ms between event-loop yields.

    Returns Promise<BlockParseResult<TypeIDType>>

    The parsing result, including the index and result enum.

  • Streaming driver over parseDataBlockIncremental: identical parse (same generator body) but invokes onRecordBoundary at every top-level record boundary so a caller feeding the parser from a moving window can slide that window forward while the rewind stack is empty. See streaming_index_builder.ts for the coordinator that owns the window.

    Parameters

    • input: default

      The input parsing buffer, positioned at the data section.

    • onRecordBoundary: ((input: default) => void)

      Called at each top-level record boundary with the buffer; the callback may rebase the buffer's window in place.

        • (input): void
        • Parameters

          Returns void

    • OptionalonRecordIndexed: ((localID: number, expressID: number, typeID: undefined | TypeIDType) => void)

      Called as each top-level record is indexed, with its localID, expressID and typeID (0 for external-mapping records) — the seam for incremental semantic consumers (type index, roots registry, names skeleton). Must be synchronous and cheap; expensive work belongs on a demand queue, not the parse path.

        • (localID, expressID, typeID): void
        • Parameters

          • localID: number
          • expressID: number
          • typeID: undefined | TypeIDType

          Returns void

    • OptionalonProgress: ParseProgressCallback

      Optional byte-cursor progress callback.

    • Optionalsink: StepIndexSink<TypeIDType>

    Returns BlockParseResult<TypeIDType>

    The parsing result, including the index and result enum.

  • Cooperative variant of parseDataBlockStreamed: identical parse and window-slide behaviour (same generator body, same boundary callback), but periodically awaits a macrotask so the event loop can run — browsers repaint progress UI during a large streamed parse instead of flagging the tab as stalled. Issue #301 §2 for the streamed path.

    Parameters

    • input: default

      The input parsing buffer, positioned at the data section.

    • onRecordBoundary: ((input: default) => void)

      Called at each top-level record boundary with the buffer; the callback may rebase the buffer's window in place.

        • (input): void
        • Parameters

          Returns void

    • OptionalonRecordIndexed: ((localID: number, expressID: number, typeID: undefined | TypeIDType) => void)

      Called as each top-level record is indexed — see parseDataBlockStreamed.

        • (localID, expressID, typeID): void
        • Parameters

          • localID: number
          • expressID: number
          • typeID: undefined | TypeIDType

          Returns void

    • OptionalonProgress: ParseProgressCallback

      Optional byte-cursor progress callback.

    • Optionalsink: StepIndexSink<TypeIDType>

      Optional index sink (columnar builds).

    • yieldIntervalMs: number = DEFAULT_PARSE_YIELD_INTERVAL_MS

      Minimum ms between event-loop yields.

    Returns Promise<BlockParseResult<TypeIDType>>

    The parsing result, including the index and result enum.