Bruce's Parsing Expression Grammar tool.
Go to file
2020-09-16 19:41:28 -07:00
grammars Consolidated repetition ops (instead of '+', '*', '?', etc. now it's all 2020-09-16 17:57:56 -07:00
.gitignore Don't gitignore itself 2020-09-11 01:30:13 -07:00
bpeg.1 Updated docs 2020-09-16 18:03:04 -07:00
bpeg.c WIP 2020-09-16 19:41:28 -07:00
compiler.c WIP 2020-09-16 19:41:28 -07:00
compiler.h WIP 2020-09-16 19:41:28 -07:00
file_loader.c WIP 2020-09-16 19:41:28 -07:00
file_loader.h WIP 2020-09-16 19:41:28 -07:00
grammar.c WIP 2020-09-16 19:41:28 -07:00
grammar.h WIP 2020-09-16 19:41:28 -07:00
LICENSE Added license 2020-09-14 10:52:08 -07:00
Makefile WIP 2020-09-16 19:41:28 -07:00
README.md Added --ignore-case flag 2020-09-14 12:16:15 -07:00
types.h WIP 2020-09-16 19:41:28 -07:00
utils.c WIP 2020-09-16 19:41:28 -07:00
utils.h WIP 2020-09-16 19:41:28 -07:00
vm.c WIP 2020-09-16 19:41:28 -07:00
vm.h WIP 2020-09-16 19:41:28 -07:00

BPEG

BPEG is a parsing expression grammar tool for the command line. It's written in pure C with no dependencies.

Usage

bpeg [flags] <pattern> [<input files>...]

Flags

  • -h --help print the usage and quit
  • -v --verbose print verbose debugging info
  • -i --ignore-case perform a case-insensitive match
  • -d --define <name>=<def> define a grammar rule
  • -D --define-string <name>=<def> define a grammar rule (string-pattern)
  • -p --pattern <pat> provide a pattern (equivalent to bpeg '
  • -P --pattern-string <pat> provide a string pattern (equivalent to bpeg '', but may be useful if '' begins with a '-')
  • -r --replace <replacement> replace the input pattern with the given replacement
  • -m --mode <mode> set the behavior mode (defult: find-all)
  • -g --grammar <grammar file> use the specified file as a grammar

See man ./bpeg.1 for more details.

BPEG Patterns

BPEG patterns are a mixture of Parsing Expression Grammar and Regular Expression syntax, with a preference for prefix operators instead of suffix operators.

See man ./bpeg.1 for more details.

License

BPEG is provided under the MIT license with the Commons Clause (see LICENSE for details).