Skip to content

A GNU Emacs major mode for editing BNF grammars

License

Notifications You must be signed in to change notification settings

sergeyklay/bnf-mode

Repository files navigation

BNF Mode for GNU Emacs

https://img.shields.io/badge/license-GPL_3-green.svg https://github.com/sergeyklay/bnf-mode/workflows/build/badge.svg https://elpa.gnu.org/packages/bnf-mode.svg https://melpa.org/packages/bnf-mode-badge.svg https://stable.melpa.org/packages/bnf-mode-badge.svg

A GNU Emacs major mode for editing BNF grammars.

“Precise language is not the problem. Clear language is the problem.”

Richard Feynman

Currently provides basic syntax and font-locking for BNF files. BNF notation is supported exactly form as it was first announced in the ALGOL 60 report. EBNF and ABNF are not supported but their implementation is planned in the near future.

When developing this mode, the following documents were taken into account:

Features

  • Basic syntax definition
  • Syntax highlighting

Installation

The current version of BNF Mode known to work with GNU Emacs 27.1 and later. It may still function with older versions of Emacs, or with other flavors of Emacs (e.g. XEmacs) but this is not guaranteed. Bug reports for problems related to using this version of BNF Mode with older versions of Emacs will most like not be addressed.

The master of all the material is the Git repository at https://github.com/sergeyklay/bnf-mode .

NOTE: The main branch will always contain the latest unstable version. If you wish to check older versions or formal, tagged release, please switch to the relevant tag.

The recommended way is to use ELPA, MELPA Stable or MELPA. If either is in your package-archives, do:

M-x package-install RET bnf-mode RET

To learn on how to use any other installation methods refer to relevant documentation.

Usage

Interactive Commands

Command (For the M-x prompt.)Description
bnf-modeSwitches to BNF Mode.

By default any file that matches the glob *.bnf is automatically opened in bnf-mode.

Customization

To customize various options, use command as follows:

M-x customize-group RET bnf RET

Support

Feel free to ask question or make suggestions in our issue tracker .

Changes

To see what has changed in recent versions of BNF Mode see: https://github.com/sergeyklay/bnf-mode/blob/main/NEWS .

External Links

License

BNF Mode is open source software licensed under the GNU General Public Licence version 3. Copyright © 2019, 2020, 2021, 2022, 2023, 2024 Free Software Foundation, Inc.

Note On Copyright Years

In copyright notices where the copyright holder is the Free Software Foundation, then where a range of years appears, this is an inclusive range that applies to every year in the range. For example: 2005-2008 represents the years 2005, 2006, 2007, and 2008.