Download

grammars

NameModifiedLinesSize
README.md 14 lines4% of this folder's lines 667 B4% of this folder's bytes
bp.bp 92 lines26% of this folder's lines 3.5 KiB21% of this folder's bytes
builtins.bp 35 lines10% of this folder's lines 855 B5% of this folder's bytes
c++.bp 27 lines8% of this folder's lines 1.8 KiB11% of this folder's bytes
c.bp 20 lines6% of this folder's lines 1 KiB6% of this folder's bytes
go.bp 16 lines4% of this folder's lines 891 B5% of this folder's bytes
html.bp 24 lines7% of this folder's lines 1019 B6% of this folder's bytes
javascript.bp 22 lines6% of this folder's lines 1.4 KiB8% of this folder's bytes
lisp.bp 15 lines4% of this folder's lines 708 B4% of this folder's bytes
lua.bp 22 lines6% of this folder's lines 1.3 KiB8% of this folder's bytes
python.bp 20 lines6% of this folder's lines 1 KiB6% of this folder's bytes
rust.bp 17 lines5% of this folder's lines 989 B6% of this folder's bytes
shell.bp 18 lines5% of this folder's lines 981 B6% of this folder's bytes
web.bp 14 lines4% of this folder's lines 480 B3% of this folder's bytes

README.md

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.