Skip to content

Instantly share code, notes, and snippets.

@luxbock
Created March 24, 2014 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luxbock/9740521 to your computer and use it in GitHub Desktop.
Save luxbock/9740521 to your computer and use it in GitHub Desktop.
(define-generic-mode 'ebnf-mode
'(("(*" . "*)"))
'("=" ":" ":=" "::=")
'(
("^[^ \t\n][^=]+" . font-lock-variable-name-face)
("<" . font-lock-constant-face)
(">" . font-lock-constant-face)
("['\"].*?['\"]" . font-lock-string-face)
("\\[\\|\\]\\|{\\|}\\|(\\|)\\||\\|,\\|;" . font-lock-type-face)
("\\?" . font-lock-builtin-face)
("\\*" . font-lock-builtin-face)
("\\+" . font-lock-builtin-face)
("[^ \t\n]" . font-lock-negation-char-face))
'("\\.ebnf\\'")
`(,(lambda () (setq mode-name "EBNF")))
"Major mode for EBNF metasyntax text highlighting.")
(provide 'ebnf-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment