• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
        • Grammar-parser
        • Meta-circular-validation
        • Parsing-primitives-defresult
          • Parse-schars
          • Parse-ichars
          • Parse-direct
          • Parse-range
          • Parse-next
        • Parsing-primitives-seq
        • Operations
        • Examples
        • Differences-with-paper
        • Constructor-utilities
        • Grammar-printer
        • Parsing-tools
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Bigmems
      • Builtins
      • Execloader
      • Aleo
      • Solidity
      • Paco
      • Concurrent-programs
      • Bls12-377-curves
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Abnf

Parsing-primitives-defresult

Some basic ABNF parsing functions for use with fty::defresult.

These functions may be be useful when writing fty::defresult-based parsers for languages specified via ABNF grammars. These functions take lists of natural numbers as inputs and return two outputs: (i) a fty::defresult value (e.g. tree or error) obtained from the consumed input natural numbers, and (ii) the remaining unconsumed input natural numbers.

These are somewhat similar to the Seq-based parsing primitives, but they have an interface suitable for fty::defresult instead of an interface suitable for Seq.

Subtopics

Parse-schars
Parse a case-sensitive character value consisting of a given string of characters.
Parse-ichars
Parse a case-insensitive character value consisting of a given string of characters.
Parse-direct
Parse a direct numeric value consisting of given natural numbers.
Parse-range
Parse a range numeric value consisting of given minimum and maximum.
Parse-next
Obtain the next natural number from the input.