forked from nfnty/vim-nftables
-
Notifications
You must be signed in to change notification settings - Fork 0
How I Did This
Egbert edited this page Feb 16, 2025
·
9 revisions
How I broke down NFTABLES into VimL/vimscript syntax
The VimL/vimscript syntax programming was accomplished by doing the following steps:
- Converting nftables Yacc (
parser_bison.y
) file into a grammar file. - Processing dotgraph file into EBNF-W3C format.
- Creating Railroad Diagram from EBNF-W3C into
nftables.html
Visit the online Grammar Convertor website at https://www.bottlecaps.de/ebnf-convert/
Copy entire content of nftables/src/parser_bison.y
into the "Input Grammar" textbox.
Ensure that all checkboxes and settings for below are:
- Direct recursion elimination: checked
- Factoring: checked
- Inline single-string nonterminals: checked
- Keep references to epsilon-only nonterminals: checked
- Target format: EBNF
Click on "Convert" button.
In the "W3C-style grammar" textbox, copy entire text content into a file (nftables.ebnf-w3c
).
You get this (screenshot of a) .
A much larger PNG image file of the nftables syntax which is not viewable here, but from your cloned repository of this vim-nftables
.