Bruce's Parsing Expression Grammar tool.
Go to file
2020-09-23 22:37:28 -07:00
grammars Added rule to help skip binary files, and improved looping logic 2020-09-18 22:32:36 -07:00
.gitignore Don't gitignore itself 2020-09-11 01:30:13 -07:00
bpeg.1 Changed arg parsing to '-d foo:baz' for consistency (was: '-d foo=baz') 2020-09-16 22:39:33 -07:00
bpeg.c Some error handling 2020-09-17 00:29:11 -07:00
compiler.c More rigorous compile-time checks via __attribute__s 2020-09-23 22:37:28 -07:00
compiler.h More rigorous compile-time checks via __attribute__s 2020-09-23 22:37:28 -07:00
file_loader.c Slightly better handling of NULL bytes 2020-09-18 22:49:02 -07:00
file_loader.h More rigorous compile-time checks via __attribute__s 2020-09-23 22:37:28 -07:00
grammar.c More rigorous compile-time checks via __attribute__s 2020-09-23 22:37:28 -07:00
grammar.h More rigorous compile-time checks via __attribute__s 2020-09-23 22:37:28 -07:00
LICENSE Added license 2020-09-14 10:52:08 -07:00
Makefile Added configurability for CC 2020-09-20 21:04:59 -07:00
README.md Changed arg parsing to '-d foo:baz' for consistency (was: '-d foo=baz') 2020-09-16 22:39:33 -07:00
types.h Some error handling 2020-09-17 00:29:11 -07:00
utils.c WIP 2020-09-16 19:41:28 -07:00
utils.h More rigorous compile-time checks via __attribute__s 2020-09-23 22:37:28 -07:00
vm.c More rigorous compile-time checks via __attribute__s 2020-09-23 22:37:28 -07:00
vm.h More rigorous compile-time checks via __attribute__s 2020-09-23 22:37: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).