bp/grammars
2021-01-17 22:13:32 -08:00
..
bash.bp Added C++ grammar and aliases. 2021-01-17 20:19:49 -08:00
bp.bp Adding more language grammars 2021-01-17 19:42:11 -08:00
builtins.bp Improved rules for word boundary matching and ids (more utf8-compliant, 2021-01-17 22:07:08 -08:00
c.bp Added C++ grammar and aliases. 2021-01-17 20:19:49 -08:00
c++.bp Added C++ grammar and aliases. 2021-01-17 20:19:49 -08:00
cpp.bp Added C++ grammar and aliases. 2021-01-17 20:19:49 -08:00
go.bp Adding and improving grammars. 2021-01-17 20:05:19 -08:00
html.bp Improved HTML grammar 2021-01-17 19:44:44 -08:00
javascript.bp Added Javscript and simplified python imports 2021-01-17 20:30:59 -08:00
js.bp Added Javscript and simplified python imports 2021-01-17 20:30:59 -08:00
lisp.bp Added Lisp 2021-01-17 22:13:32 -08:00
lua.bp Adding more language grammars 2021-01-17 19:42:11 -08:00
py.bp Added some aliases 2021-01-17 21:42:06 -08:00
python.bp Added Javscript and simplified python imports 2021-01-17 20:30:59 -08:00
README.md Adding more language grammars 2021-01-17 19:42:11 -08:00
rust.bp Adding and improving grammars. 2021-01-17 20:05:19 -08:00
sh.bp Added some aliases 2021-01-17 21:42:06 -08:00
shell.bp Added shell grammar 2021-01-17 20:13:34 -08:00
utf8-id.bp Bugfix for typo 2021-01-17 21:59:23 -08:00

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.