Function: antlr-mode

antlr-mode is an autoloaded, interactive and byte-compiled function defined in antlr-mode.el.gz.

Signature

(antlr-mode)

Documentation

Major mode for editing ANTLR grammar files.

In addition to any hooks its parent mode prog-mode might have run, this mode runs the hook antlr-mode-hook, as the final or penultimate step during initialization.

& antlr-electric-character
( antlr-electric-character
) antlr-electric-character
: antlr-electric-character
; antlr-electric-character
C-M-a antlr-beginning-of-rule
C-M-e antlr-end-of-rule
C-c C-a antlr-beginning-of-body
C-c C-b subword-backward
C-c C-c comment-region
C-c C-e antlr-end-of-body
C-c C-f subword-forward
C-c C-k antlr-insert-keyword-rule
C-c C-o antlr-insert-option
C-c C-r antlr-run-tool
C-c C-v antlr-hide-actions
M-a c-beginning-of-statement
M-e c-end-of-statement
TAB antlr-indent-command
{ antlr-electric-character
| antlr-electric-character
} antlr-electric-character

Probably introduced at or before Emacs version 21.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/antlr-mode.el.gz
;;;###autoload
(define-derived-mode antlr-mode prog-mode
  "Antlr"
  "Major mode for editing ANTLR grammar files."
  :abbrev-table antlr-mode-abbrev-table
  (c-initialize-cc-mode)		; cc-mode is required
  (set (make-local-variable 'require-final-newline) mode-require-final-newline)
  (set (make-local-variable 'outline-regexp) "[^#\n\^M]")
  (set (make-local-variable 'outline-level) #'c-outline-level) ;TODO: define own
  (setq-local comment-start "// "
              comment-end ""
              comment-start-skip "/\\*+ *\\|//+ *")
  ;; various -----------------------------------------------------------------
  ;; the following vars are auto buffer-local:
  (setq font-lock-defaults antlr-font-lock-defaults)
  (setq imenu-create-index-function #'antlr-imenu-create-index-function)
  (setq imenu-generic-expression t)     ; fool stupid test
  ;; FIXME: How does this hook differ from `antlr-mode-hook'?
  (run-mode-hooks 'antlr-delayed-mode-hook))