项目作者: heb12

项目描述 :
Flexible Bible Reference Parser
高级语言: C
项目地址: git://github.com/heb12/fbrp.git
创建时间: 2021-05-09T19:42:23Z
项目社区:https://github.com/heb12/fbrp

开源协议:MIT License

下载


FBRP

“Fast Bible Reference Parser”
A tiny Bible reference parser written in C99. It parses references like

  1. 2 Kings 1, 3-5:2-4, 3-6, 1-2

and parses it into structures like:

  1. Book: 2Kings
  2. Chapter: [1]-[1]
  3. Chapter: [3]-[5]
  4. Verse: [2]-[4]
  5. Verse: [3]-[6]
  6. Verse: [1]-[2]

Features

  • No dependencies or even standard C headers
  • One C file, one header file, no complex build system needed

Cannot Parse:

By design, it cannot parse references like:

  • “John 3 16, John 3 17”
  • “John 3, Hebrews 4”
  • “John 3 16, KJV”

Testing:

cc -D TEST fbrp.c && ./a.out

How it works:

Like a lexer/parser, it parses the string into a tokens.
Then, it uses that to run through each token and figure out
exactly what they all mean.

There is currently no algorithm specification, but feel free to
ask if you need any clarification.