Git Product home page Git Product logo

bnf-mode's Introduction

BNF Mode for GNU Emacs

https://img.shields.io/badge/license-GPL_3-green.svg https://travis-ci.com/sergeyklay/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 in my plans for the near future.

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

Features

  • Basic syntax definition
  • Syntax highlighting

Installation

Known to work with GNU Emacs 24.3 and later. BNF Mode may work 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 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 master 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.

Using MELPA

The best way of installing this major mode, at least for GNU Emacs 24, is to use the packaging system. Add MELPA or MELPA Stable to the list of repositories to access this mode. For those who want only formal, tagged releases use MELPA Stable:

(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)

For those who want rolling releases as they happen use MELPA:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

and then use M-x package-refresh-contents and M-x package-list-packages to get to the package listing and install bnf-mode from there. MELPA tracks this Git repository and updates relatively soon after each commit or formal release. For more detail on setting up see MELPA Getting Started.

You can install bnf-mode manually by adding following to your init file:

(unless (package-installed-p 'bnf-mode)
    (package-refresh-contents)
    (package-install 'bnf-mode))

Using Cask

Add following to your Cask file:

(source melpa)

(depends-on "bnf-mode")

Using use-package

Add following to your init file:

(use-package bnf-mode
  :ensure t
  :mode "\\.bnf\\'")

El-get

If you use el-get, just create a recipe file bnf.rcp:

(:name bnf-mode
       :website "https://github.com/sergeyklay/bnf-mode"
       :description "BNF Mode: A major mode for editing BNF grammars"
       :type github
       :pkgname "sergeyklay/bnf-mode")

and add it to a directory present in el-get-recipe-path. Then, use M-x el-get-install <RET> bnf-mode or add:

(el-get-bundle bnf-mode)

to your init file.

Manual Install

  1. Download bnf-mode.el
  2. Put the file in your Elisp common folder like $HOME/.emacs.d/lisp/
  3. Then you can include like this:
    (add-to-list 'load-path
                 (expand-file-name "lisp" user-emacs-directory))
        
  4. Add either of the two following lines to your initialization file. The first only loads BNF Mode when necessary, the 2nd always during startup of GNU Emacs.
    (autoload 'bnf-mode "bnf-mode" nil t)
    ;; OR
    (require 'bnf-mode)
        
  5. Optionally byte compile bnf-mode.el for faster startup: M-x byte-compile

Usage

Interactive Commands

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

Any file that matches the glob *.bnf is automatically opened in bnf-mode.

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 the CHANGELOG.org .

External Links

License

BNF Mode is open source software licensed under the GNU General Public Licence version 3 .

bnf-mode's People

Contributors

sergeyklay avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.