code / bp

Lines4.3K C3.3K Markdown541 YAML273 make110 Shell77 Lua54
(14 lines)

BP Grammars

The files in this directory are predefined grammars for different languages and contexts. They are intended to be used for common search patterns, and not intended to be complete PEG definitions of language grammars, other than bp.bp, which is included for stress-testing purposes, as well as a showcase of some BP features.

Adding Grammars

If you want to add your own grammar, the easiest way to do so is to create a .bp file in ~/.config/bp/. The syntax for grammar files is fully and formally defined in bp.bp, but in short, it's a list of whitespace-separated rule definitions of the form id __ ":" __ pattern.

1 # BP Grammars
3 The files in this directory are predefined grammars for different languages and
4 contexts. They are intended to be used for common search patterns, and **not**
5 intended to be complete PEG definitions of language grammars, other than
6 [bp.bp](./bp.bp), which is included for stress-testing purposes, as well as a
7 showcase of some BP features.
9 ## Adding Grammars
11 If you want to add your own grammar, the easiest way to do so is to create a
12 `.bp` file in `~/.config/bp/`. The syntax for grammar files is fully and
13 formally defined in [bp.bp](./bp.bp), but in short, it's a list of
14 whitespace-separated rule definitions of the form `id __ ":" __ pattern`.