emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Backus-Naur major mode.


From: Alin Soare
Subject: Backus-Naur major mode.
Date: Wed, 4 Nov 2009 16:39:34 +0200

I did write for me a major mode for writing grammars in Backus-Naur notation.

I send you the code of the Backus-Naur mode.

If you consider that this code would be useful for emacs, I will send improved versions.

I attach here a grammar file for testing it.

The font lock of the right nonterminals is chaged while typing.

A few key binding :

C-x SPC jumps to the definition of the right-nonterminal under the cursor.
mouse-3 jumps to the definition of the clicked right-nonterminal .
M-s rotate the cursor to all the matches of the left-nonterminal under the cursor.

C-u C-SPC can be used, because every jump adds a mark.

Note that I do not parse for myself in yacc notation: `;' between right symbols, `|' for another rule, etc.

I parse using a rule on every line, and all the symbols of a rule are separated by simple spaces.





Alin.



Attachment: gram-test
Description: Binary data

Attachment: bn-mode.el
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]