Function: antlr-insert-keyword-rule

antlr-insert-keyword-rule is an interactive and byte-compiled function defined in antlr-mode.el.gz.

Signature

(antlr-insert-keyword-rule &optional KEYWORD)

Documentation

Insert token rule for an case-insensitive keyword KEYWORD at point.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/antlr-mode.el.gz
(defun antlr-insert-keyword-rule (&optional keyword)
  "Insert token rule for an case-insensitive keyword KEYWORD at point."
  (interactive "sKeyword: ")
  ;; Should be probably made a bit customizable...
  (insert (upcase keyword) " : "
          (mapconcat (lambda (c)
                       (let ((d (downcase c)) (u (upcase c)))
                         (cond ((eq d u) (string ?\' c ?\'))
                               ((eq antlr-tool-version 'antlr-v4)
                                (string ?\[ d u ?\]))
                               (t (string ?\( ?\' d ?\' ?| ?\' u ?\' ?\))))))
                     keyword "")
          " ;\n"))