GNU-devel ELPA - bnf-mode

bnf-mode Atom Feed

Description
Major mode for editing BNF grammars.
Latest
bnf-mode-0.4.5.0.20240915.211838.tar (.sig), 2024-Sep-16, 90.0 KiB
Maintainer
Serghei Iakovlev <gnu@serghei.pl>
Website
https://github.com/sergeyklay/bnf-mode
Browse ELPA's repository
CGit or Gitweb
Badge

To install this package from Emacs, use package-install or list-packages.

Full description

1. BNF Mode for GNU Emacs

license-GPL_3-green.svg badge.svg bnf-mode.svg bnf-mode-badge.svg 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:

1.1. Features

  • Basic syntax definition
  • Syntax highlighting

1.2. 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.

1.3. Usage

1.3.1. Interactive Commands
Command (For the M-x prompt.) Description
bnf-mode Switches to BNF Mode.

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

1.4. Customization

To customize various options, use command as follows:

M-x customize-group RET bnf RET

1.5. Support

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

1.6. Changes

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

1.8. 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.

1.8.1. 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.

Old versions

bnf-mode-0.4.5.0.20240915.125256.tar.lz2024-Sep-1520.9 KiB
bnf-mode-0.4.5.0.20240915.75211.tar.lz2024-Sep-1520.9 KiB
bnf-mode-0.4.5.0.20221205.150230.tar.lz2024-Mar-3120.9 KiB
bnf-mode-0.4.5.0.20220102.150900.tar.lz2022-Jan-2020.2 KiB
bnf-mode-0.4.5.0.20210423.215914.tar.lz2021-May-1320.1 KiB
bnf-mode-0.4.5.0.20200323.134831.tar.lz2021-Mar-1820.1 KiB
bnf-mode-0.4.4.0.20200301.214031.tar.lz2020-Dec-1419.5 KiB

News

bnf-mode NEWS -- history of user-visible changes.

Copyright (C) 2019-2024 Free Software Foundation, Inc.
See the end of the file for license conditions.

This file is about changes in BNF Mode.

* BNF Mode 0.5.0
** Incompatible changes.
*** Dropped support for GNU Emacs < 27.1.
BNF Mode no longer support GNU Emacs versions older than 27.1.  This
change allows to use modern APIs, like `rx-define', and simplifies CI
workflows by not having to accommodate outdated Emacs versions.  If
you are still using an older version of Emacs or other flavors (e.g.,
XEmacs), please stick with an earlier version of BNF Mode.

*** Removed the 'bnf-rx' macro.
The `bnf-rx' macro is no longer part of BNF Mode as it's no longer
necessary.  BNF Mode now fully utilizes the modern `rx' API, relying
directly on `rx-define' for pattern definitions.

*** Removed the 'bnf-rx-constituents' constant.
BNF Mode no longer uses the `bnf-rx-constituents' constant.  Instead,
it now relies on `rx-define' to define patterns directly, utilizing
the modern `rx' API to simplify and streamline pattern definitions.

** Syntax Table changes.
*** Improved Syntax Table Handling.
Changed the syntax classification of :, =, and | from symbol
constituents to punctuation characters.  This adjustment ensures that
navigation commands like C-M-f and C-M-b work as expected, treating
these characters as separate tokens rather than part of a symbol.

*** Improved Handling of Angle Brackets.
Changed the default syntax classification of < and > to punctuation
characters.  Introduced the `bnf--syntax-propertize' constant that
performs a detailed examination of the buffer content.  It selectively
reclassifies < and > as angle brackets (delimiter characters) only
when they enclose nonterminal symbols.  This approach allows for more
accurate syntax highlighting and parsing, especially in lines where
angle brackets are not part of nonterminals.  By defaulting to
punctuation and then dynamically adjusting the syntax properties as
needed, we ensure that angle brackets are correctly interpreted in
various contexts within BNF grammar files.

*** Fixed Incorrect Symbol Classification.
Adjusted the syntax entries for characters like ', ", (, ), {, }, [,
and ] to be treated as punctuation rather than symbols.  This change
prevents these characters from being incorrectly grouped with adjacent
symbols, enhancing text manipulation and editing commands.

* BNF Mode 0.4.5
** Tests were migrated from ert-runner to buttercup.
Previously BNF Mode used `ert' through `ert-runner' for testing
purposes.  However, it seems `ert-runner' is semi-abandoned.  Thus,
tests were migrated to use more aggressively maintained test
framework calles `buttercup'.

** Removed support of ALGOL 60 style comments.
Actually, this syntax was never part of the BNF and was mistakenly
interpreted as an alternative way of commenting BNF grammars
introduced by Peter Naur.

* BNF Mode 0.4.4
** Rework documentation and provide Info-file.
Previous releases of BNF Mode were bundled with incorrect “dir” file
that contained an invalid link to documentation.  This was
resolved.  All documentation now lives in “info bnf-mode”.

* BNF Mode 0.4.3
** Fixed dependency list in the Cask file.
Dependency list was fixed by specifying `cl-lib' version as well as
removing `rx' (`rx' is part of GNU Emacs actually).  This fixed the
issue reported in <https://github.com/sergeyklay/bnf-mode/issues/5>.
The issue is related to installation from the TAR file.

** CI/CD process was moved on GitHub Actions.

* BNF Mode 0.4.2
** First release in ELPA.

** Introduced ALGOL 60 comments style. Disabled by default.

** Use semicolons as a comments.
Only setting `bnf-mode-algol-comments-style' to non-nil will allow use
semicolons as a regular terminal symbols.

* BNF Mode 0.4.1
** Minor fix related to build & deploy BNF Mode on Travis CI.

* BNF Mode 0.4.0
** Added comment-start-skip to improve recognize comments.

** Return back comment-start and comment-end.

** Use more intelligent terminal syntax recognition.
...
...