bp/grammars
2021-10-02 11:33:40 -07:00
..
bash.bp Added C++ grammar and aliases. 2021-01-17 20:19:49 -08:00
bp.bp Left recursion correctness fixes 2021-10-02 11:33:40 -07:00
builtins.bp Optimization for parens pattern 2021-08-29 13:44:43 -07:00
c.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
c++.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
cpp.bp Added C++ grammar and aliases. 2021-01-17 20:19:49 -08:00
go.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
html.bp Performance optimization for common case where pattern starts with 2021-07-17 15:25:24 -07:00
javascript.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
js.bp Added Javscript and simplified python imports 2021-01-17 20:30:59 -08:00
lisp.bp Added | as alias for \b 2021-07-30 20:23:18 -07:00
lua.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
py.bp Added some aliases 2021-01-17 21:42:06 -08:00
python.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
README.md Adding more language grammars 2021-01-17 19:42:11 -08:00
rust.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
sh.bp Added some aliases 2021-01-17 21:42:06 -08:00
shell.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
web.bp Micro optimization 2021-08-01 22:06:33 -07: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.