simple BNF parser makes xml markup of matches

Add a Review
1 Download (This Week)
Last Update:
Download bnf2xml-7.0.2.tar.gz
Browse All Files


bnf2xml a simple BNF parser that takes text as input, searches according to a BNF query file, and outputs text marked up by the xml labels that show context.

bnf2xml is as simple to use as any text binary ie, awk(1) grep(1). bnf2xml does not require C API because it outputs simple xml labeling.

README is visible on file dl page.

EXAMPLE: $ echo "hi" | bnf2xml patternfile

<gas>hydrogen iodide</gas>

patternfile says how to find needle in haystack and what to show, ie:
<alph> ::= a | b | c | d ...
<word> ::= <alph>+

bnf2xml is a top down recursive parser. Unlike buttom up parsers like gcc(1) or some top downs, bnf2xml is completely unambiguous / resolves ALL conflicts. Slower on ave. for parsing C or than sed(1) for simple searches. Far easier than using flex/C to create a parser.

caveate: I do not suggest it's worth while to make a new gcc(1) using bnf2xml. bnf2xml an nth BETA release, but no complains yet.

bnf2xml Web Site



  • XML OUTPUT. (most that say xml mean xml input)
  • BNF for C, K&R CPL, included (xml output example on file dl page)
  • Ability to do Binary Searching into very large strings lists.
  • Other output allows full trace of matching (including errors).
  • allows matching against a given BNF line number
  • (note: some bnf parsers can be programmed to do xml output)
  • README is visible on file download page
  • featured yet small simple end-to-end footprint
  • NEW: skip or print data (to not parse) quickly (for large file / data file work)
  • NEW: emit uniqe label, position, length for pre-post filter processing


Write a Review

User Reviews

Be the first to post a review of bnf2xml!

Additional Project Details


Screenshots can attract more users to your project.
Features can attract more users to your project.