byte-machine 0.8.0

Generator of fast, resumable, byte-level parsers

Describe a parser as a state machine over bytes, built with ordinary Scheme procedures. byte-machine verifies it and emits a plain R6RS library that parses input incrementally: feed it bytes as they arrive, in any split, and it calls you back.

The generated library depends only on (rnrs) and (byte-machine runtime). Spans are delivered as ranges into the fed bytevector, and the generated per-byte path allocates nothing.

$ akku update
$ akku install byte-machine
$ .akku/env
Authors

Kiyomi Computation Systems LLC

License

BSD-3-Clause

Dependencies

No dependencies.

Source code

https://github.com/Kiyomi-Computation-Systems/byte-machine.git git
c1f77911efb55030df0b2cd811903d74d2ba3d64
Tag: v0.8.0

Package contents

  • (byte-machine compile) R6
    • → compile-machine compilation-ok? compilation-diagnostics render-machine emit-machine reserved-member-2 reserved-member-3 reserved-member-4
    • ← (rnrs) R6
    • ← (byte-machine verify)
    • ← (byte-machine private ir)
    • ← (byte-machine private normal-ir)
    • ← (byte-machine private names)
  • (byte-machine graph) R6
    • → make-uint-field uint-field? uint-field-name uint-field-width uint-field-initial uint-field-settable? uint-field-source-label make-callback-declaration callback-declaration? callback-declaration-name callback-declaration-kind callback-declaration-required? callback-declaration-branch-keys callback-declaration-default-branch callback-declaration-source-label make-span-declaration span-declaration? span-declaration-name span-declaration-data-callback span-declaration-complete-callback span-declaration-source-label make-machine make-byte-dispatch-node make-byte-case make-exact-byte-matcher make-edge make-stop-node make-finish-node make-pause-node make-error-node make-error-declaration make-field-action-node make-field-branch-node make-integer-accumulate-node make-callback-node make-span-start-node make-span-end-node make-counted-consume-node make-byte-set-matcher make-byte-range-matcher make-byte-complement-matcher ascii-bytes matcher? exact-byte-matcher? exact-byte-matcher-byte byte-set-matcher? byte-set-matcher-bytes byte-range-matcher? byte-range-matcher-low byte-range-matcher-high byte-complement-matcher? byte-complement-matcher-matcher make-sequence-dispatch-node make-sequence-case sequence-dispatch-node? sequence-dispatch-node-name sequence-dispatch-node-cases sequence-dispatch-node-mismatch sequence-dispatch-node-eof-target sequence-case? sequence-case-bytes sequence-case-target make-keyword-table-node make-keyword-entry
    • ← (byte-machine private ir)
  • (byte-machine interpret) R6
    • → make-interpreted-machine
    • ← (rnrs) R6
    • ← (byte-machine private ir)
    • ← (byte-machine private conditions)
    • ← (byte-machine verify)
    • ← (byte-machine runtime)
  • (byte-machine private conditions) R6 Internal
    • → byte-machine-contract-violation byte-machine-contract-condition? byte-machine-contract-condition-code byte-machine-contract-condition-who byte-machine-contract-condition-detail
    • ← (rnrs) R6
  • (byte-machine private ir) R6 Internal
    • → make-machine machine? machine-name machine-entry machine-fields machine-callbacks machine-spans machine-errors machine-nodes machine-default-eof-error machine-source-label make-byte-dispatch-node byte-dispatch-node? byte-dispatch-node-name byte-dispatch-node-cases byte-dispatch-node-fallback byte-dispatch-node-eof-target byte-dispatch-node-source-label make-byte-case byte-case? byte-case-matcher byte-case-edge byte-case-source-label make-exact-byte-matcher exact-byte-matcher? exact-byte-matcher-byte make-byte-set-matcher byte-set-matcher? byte-set-matcher-bytes make-byte-range-matcher byte-range-matcher? byte-range-matcher-low byte-range-matcher-high make-byte-complement-matcher byte-complement-matcher? byte-complement-matcher-matcher matcher? matcher-bytes ascii-bytes make-edge edge? edge-target edge-mode make-stop-node stop-node? stop-node-name stop-node-source-label make-finish-node finish-node? finish-node-name finish-node-source-label make-pause-node pause-node? pause-node-name pause-node-continuation pause-node-reason pause-node-source-label make-error-node error-node? error-node-name error-node-error-name error-node-source-label machine-ir-version-of supported-ir-version make-uint-field uint-field? uint-field-name uint-field-width uint-field-initial uint-field-settable? uint-field-source-label make-error-declaration error-declaration? error-declaration-name error-declaration-code error-declaration-reason error-declaration-source-label make-callback-declaration callback-declaration? callback-declaration-name callback-declaration-kind callback-declaration-required? callback-declaration-branch-keys callback-declaration-default-branch callback-declaration-source-label make-span-declaration span-declaration? span-declaration-name span-declaration-data-callback span-declaration-complete-callback span-declaration-source-label make-sequence-dispatch-node sequence-dispatch-node? sequence-dispatch-node-name sequence-dispatch-node-cases sequence-dispatch-node-mismatch sequence-dispatch-node-eof-target sequence-dispatch-node-source-label make-sequence-case sequence-case? sequence-case-bytes sequence-case-target sequence-case-source-label make-keyword-table-node keyword-table-node? keyword-table-node-name keyword-table-node-entries keyword-table-node-no-match keyword-table-node-eof-target keyword-table-node-case-insensitive? keyword-table-node-source-label make-keyword-entry keyword-entry? keyword-entry-bytes keyword-entry-target keyword-entry-source-label make-field-action-node field-action-node? field-action-node-name field-action-node-operation field-action-node-arguments field-action-node-next field-action-node-error field-action-node-source-label make-field-branch-node field-branch-node? field-branch-node-name field-branch-node-predicate field-branch-node-arguments field-branch-node-true-target field-branch-node-false-target field-branch-node-source-label field-operations field-predicates make-integer-accumulate-node integer-accumulate-node? integer-accumulate-node-name integer-accumulate-node-field integer-accumulate-node-base integer-accumulate-node-digit-target integer-accumulate-node-nondigit-edge integer-accumulate-node-overflow-error integer-accumulate-node-eof-target integer-accumulate-node-source-label accumulate-bases make-span-start-node span-start-node? span-start-node-name span-start-node-span span-start-node-next span-start-node-source-label make-span-end-node span-end-node? span-end-node-name span-end-node-span span-end-node-next span-end-node-source-label make-callback-node callback-node? callback-node-name callback-node-callback callback-node-continue-target callback-node-branch-targets callback-node-pause-continuation callback-node-reason callback-node-source-label make-counted-consume-node counted-consume-node? counted-consume-node-name counted-consume-node-field counted-consume-node-next counted-consume-node-eof-target counted-consume-node-source-label node? node-name node-source-label make-verification-result verification-result? verification-result-ok? verification-result-diagnostics verification-result-machine
    • ← (rnrs) R6
    • ← (byte-machine private conditions)
  • (byte-machine private names) R6 Internal
    • → portable-name?
    • ← (rnrs) R6
  • (byte-machine private normal-ir) R6 Internal
    • → normalize-machine normal-machine? normal-machine-entry normal-machine-states normal-machine-fingerprint normal-state-kind normal-state-id normal-dispatch-transitions normal-dispatch-fallback normal-error-code normal-error-reason normal-dispatch-eof normal-pause-target normal-machine-debug-map normal-machine-fields normal-machine-callbacks normal-machine-spans normal-machine-callback-decls normal-machine-span-decls normal-field-selector normal-field-arguments normal-field-targets normal-keyword-entries normal-keyword-no-match normal-keyword-ci?
    • ← (rnrs) R6
    • ← (byte-machine private ir)
  • (byte-machine runtime) R6
    • → make-compiled-machine compiled-machine? byte-machine-make-compiled-machine byte-machine-make-compiled-machine/v1 byte-machine-make-compiled-machine/v2 byte-machine-make-feed-outcome/v1 make-parser parser? parser-feed! parser-finish! parser-resume! parser-lifecycle parser-reset! parser-result? parser-result-status parser-result-next parser-result-consumed parser-result-stream-offset parser-result-error parser-result-pause byte-machine-make-parser-error/v1 parser-error? parser-error-domain parser-error-code parser-error-reason parser-error-detail parser-error-node-name parser-error-state-id parser-error-offset parser-error-position-kind parser-error-span parser-error-span-offset parser-field-ref callback-continue callback-pause parser-stream-offset parser-user-context parser-active-span parser-state-name make-callback-failure callback-failure? callback-failure-code callback-failure-detail byte-machine-callback-step/v1 byte-machine-callback-step/v2 byte-machine-make-callback-error/v1 byte-machine-span-open/v1 byte-machine-span-fragment-step/v1 byte-machine-span-fragment-step/v2 byte-machine-span-close/v1 byte-machine-keyword-step/v1
    • ← (rnrs) R6
    • ← (byte-machine private conditions)
    • ← (byte-machine private names)
  • (byte-machine verify) R6
    • → verify-machine verification-ok? verification-diagnostics verification-machine diagnostic? diagnostic-code diagnostic-node diagnostic-message diagnostic-edge diagnostic-severity diagnostic-machine diagnostic-declarations diagnostic-path
    • ← (rnrs) R6
    • ← (byte-machine private ir)
    • ← (byte-machine private names)
  • (generated accm) R6 golden Test
    • → accm
    • ← (rnrs) R6
    • ← (byte-machine runtime)
  • (generated countedm) R6 golden Test
    • → countedm
    • ← (rnrs) R6
    • ← (byte-machine runtime)
  • (generated http-version) R6 golden Test
    • → http-version-parser
    • ← (rnrs) R6
    • ← (byte-machine runtime)
  • (generated httpreq) R6 golden Test
    • → httpreq
    • ← (rnrs) R6
    • ← (byte-machine runtime)
  • (generated kwtableci) R6 golden Test
    • → kwtableci
    • ← (rnrs) R6
    • ← (byte-machine runtime)
  • (generated one-byte) R6 golden Test
    • → one-byte-parser
    • ← (rnrs) R6
    • ← (byte-machine runtime)
  • (generated pausem) R6 golden Test
    • → pausem
    • ← (rnrs) R6
    • ← (byte-machine runtime)
  • (byte-machine test harness) R6 Chez Scheme Test
    • → harness-begin harness-finish harness-summary harness-exit-status harness-status-pass harness-status-failed harness-status-harness-error harness-status-provenance harness-empty-selection-error harness-empty-selection-diagnosis harness-group harness-case check check-equal check-not-equal check-fail check-raises with-cleanup harness-probe harness-set-filter! probe-cases probe-failed-cases probe-checks probe-failures probe-errors probe-skipped probe-cleanup-failures probe-raised? probe-failure-records failure-record-id failure-record-what failure-record-detail harness-string-contains? harness-join harness-split harness-take harness-member? harness-failure-context harness-normalize-filter harness-counters harness-restore-counters! harness-capture-state harness-fingerprint-bytevector harness-fingerprint-combine harness-fingerprint->string harness-fingerprint-file harness-bytes->string harness-provenance-diagnosis harness-verify-provenance! harness-provenance-reachability-diagnosis adapter-runtime-name adapter-runtime-version adapter-machine-type adapter-os adapter-architecture adapter-execution-mode adapter-environment-variable adapter-exit adapter-value->string adapter-describe-condition adapter-file-bytes adapter-flush-output adapter-machine-type->os adapter-machine-type->architecture modulo quotient remainder
    • ← (rnrs) R6
    • ← (byte-machine test fingerprint)
    • ← (rnrs r5rs) R6
    • ← (chezscheme) Built-in
  • (byte-machine test accumulate-machine) R6 Test
    • → make-accumulate-machine
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test class-machine) R6 Test
    • → make-byte-set-machine make-byte-range-machine make-byte-complement-machine make-nested-complement-machine make-ascii-machine class-machines
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test counted-machine) R6 Test
    • → make-counted-machine make-only-consumer-machine make-entry-zero-machine make-big-count-machine make-counted-span-machine
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test eof-machine) R6 Test
    • → make-eof-machine
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test error-projection) R6 Test
    • → project-error projected-members error-state-id
    • ← (rnrs) R6
    • ← (byte-machine runtime)
  • (byte-machine test fingerprint) R6 Test
    • → harness-fingerprint-bytevector harness-fingerprint-file harness-fingerprint-combine harness-fingerprint->string
    • ← (rnrs) R6
    • ← (rnrs r5rs) R6
  • (byte-machine test harness) R6 Chez Scheme Test
    • → harness-begin harness-finish harness-summary harness-exit-status harness-status-pass harness-status-failed harness-status-harness-error harness-status-provenance harness-empty-selection-error harness-empty-selection-diagnosis harness-group harness-case check check-equal check-not-equal check-fail check-raises with-cleanup harness-probe harness-set-filter! probe-cases probe-failed-cases probe-checks probe-failures probe-errors probe-skipped probe-cleanup-failures probe-raised? probe-failure-records failure-record-id failure-record-what failure-record-detail harness-string-contains? harness-join harness-split harness-take harness-member? harness-failure-context harness-normalize-filter harness-counters harness-restore-counters! harness-capture-state harness-fingerprint-bytevector harness-fingerprint-combine harness-fingerprint->string harness-fingerprint-file harness-bytes->string harness-provenance-diagnosis harness-verify-provenance! harness-provenance-reachability-diagnosis adapter-runtime-name adapter-runtime-version adapter-machine-type adapter-os adapter-architecture adapter-execution-mode adapter-environment-variable adapter-exit adapter-value->string adapter-describe-condition adapter-file-bytes adapter-flush-output adapter-machine-type->os adapter-machine-type->architecture modulo quotient remainder
    • ← (rnrs) R6
    • ← (byte-machine test fingerprint)
    • ← (rnrs r5rs) R6
    • ← (chezscheme) Built-in
  • (byte-machine test http-error-table) R6 Test
    • → http-error-rows http-error-inapplicable http-error-regions http-error-triggers http-error-region-nodes
    • ← (rnrs) R6
  • (byte-machine test http-event-order) R6 Test
    • → http-data-events http-request-grammar trace-skeleton event-sequence-matches? event-sequence-diagnosis
    • ← (rnrs) R6
  • (byte-machine test http-machine) R6 Test
    • → make-http-machine http-tchar-bytes http-target-bytes http-field-value-bytes http-request-line-bytes
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test http-version-machine) R6 Test
    • → make-http-version-machine make-http-version-advance-machine http-version-bytes http-version-shared-prefix
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test keyword-header-machine) R6 Test
    • → make-keyword-header-machine make-keyword-header-ci-machine make-keyword-collision-ci-machine make-keyword-collision-cs-machine keyword-header-keywords keyword-collision-keywords
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test keyword-method-table) R6 Test
    • → make-method-keyword-machine make-method-trie-machine method-names
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test keyword-span-machine) R6 Test
    • → make-keyword-span-machine keyword-span-keywords
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test keyword-table-machine) R6 Test
    • → make-keyword-table-machine make-keyword-table-ci-machine keyword-table-keywords
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test machine-corrupt) R6 Test
    • → corruption-entry? make-corruption-entry corruption-entry-name corruption-entry-bullet corruption-entry-applies? corruption-entry-corrupt corruption-entry-twin corruption-entry-expected corruption-entries refusal? make-refusal refusal-bullet refusal-name refusal-thunk refusal-reason constructor-refusals unconstructible-codes operand-value q locate edit all-node-ctors
    • ← (rnrs) R6
    • ← (rnrs eval) R6
    • ← (byte-machine private ir)
    • ← (byte-machine test machine-print)
  • (byte-machine test machine-gen) R6 Test
    • → gen-machine make-steering steering? property-steering free-steering steering-placed? steering-back-prog? steering-few-cases? steering-entry-bd? steering-span-pair? steering-span-body? steering-fin-kind? steering-stop-on? steering-default-branch-mode steering-dangling-prob steering-orphan-prob steering-coverage? manifest? manifest-fields manifest-callbacks manifest-spans manifest-node-kinds manifest-key->node manifest-cb-targets manifest-witnesses manifest-markers manifest-script node-kind-draw-table matcher-kind-draw-table field-operation-draw-table field-predicate-draw-table callback-kind-draw-table reset-draw-state!
    • ← (rnrs) R6
    • ← (byte-machine test prng)
    • ← (byte-machine graph)
  • (byte-machine test machine-print) R6 Test
    • → print-machine node-print-arm-table matcher-print-arm-table
    • ← (rnrs) R6
    • ← (byte-machine private ir)
  • (byte-machine test one-byte-machine) R6 Test
    • → make-one-byte-machine
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test pause-machine) R6 Test
    • → make-pause-machine
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test prng) R6 Test
    • → make-prng prng-next
    • ← (rnrs) R6
  • (byte-machine test property-driver) R6 Chez Scheme Test
    • → schedules-for schedules-per-input run-machine run-machine-verdict run-one-trial fixture-text minimize machine-node-count make-counter-set observe-counters counter-ref counter-keys counter-labels family-members counter-agreed-label counter-interp-label make-rejection* rejection? rejection-index rejection-machine rejection-diagnostics rejection-codes rejection-code-sites disagreement->detail coalesce-fragments distinct distinct-count observe-fixture fx-steps fx-coalesced fx-cbtrace fx-raws fx-span fx-final3 check-invariants invariant-rows
    • ← (rnrs) R6
    • ← (rnrs mutable-pairs) R6
    • ← (chezscheme) Built-in
    • ← (rnrs eval) R6
    • ← (byte-machine graph)
    • ← (byte-machine verify)
    • ← (byte-machine interpret)
    • ← (byte-machine compile)
    • ← (byte-machine runtime)
    • ← (byte-machine private ir)
    • ← (byte-machine private conditions)
    • ← (byte-machine test error-projection)
    • ← (byte-machine test rejection-ledger)
    • ← (byte-machine test prng)
    • ← (byte-machine test machine-gen)
  • (byte-machine test rejection-ledger) R6 Test
    • → make-rejection* rejection? rejection-index rejection-machine rejection-diagnostics rejection-codes rejection-code-sites
    • ← (rnrs) R6
    • ← (byte-machine verify)
  • (byte-machine test release-ledger) R6 Test
    • → release-criteria release-deliverables criterion-ref criterion-text criterion-state criterion-kind criterion-witness criterion-receiver deliverable-ref deliverable-text deliverable-exists? deliverable-receiver release-version release-version-surfaces release-version-export?
    • ← (rnrs) R6
  • (byte-machine test sequence-machine) R6 Test
    • → make-sequence-machine sequence-bytes
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test sequence-node-machine) R6 Test
    • → make-sequence-node-machine make-advance-mismatch-machine sequence-node-bytes
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test settable-machine) R6 Test
    • → make-settable-machine
    • ← (rnrs) R6
    • ← (byte-machine graph)
  • (byte-machine test verify-oracle) R6 Test
    • → oracle-rules oracle-rule-name oracle-rule-codes oracle-rule-comparison oracle-rule-fn oracle-rule-reach? oracle-eval nodes-unique?
    • ← (rnrs) R6
    • ← (byte-machine private ir)

Version history

  • 2026-10-11 ~ 0.8.0