Function: antlr-try-rule-or-grammar-option

antlr-try-rule-or-grammar-option is a byte-compiled function defined in antlr-mode.el.gz.

Signature

(antlr-try-rule-or-grammar-option REQUESTED BOR)

Documentation

Try whether rule or grammar option can be applied.

Called by function antlr-option-level with arguments REQUESTED, and BOR pointing to the beginning of the current rule.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/antlr-mode.el.gz
(defun antlr-try-rule-or-grammar-option (requested bor)
  "Try whether rule or grammar option can be applied.
Called by function `antlr-option-level' with arguments REQUESTED,
and BOR pointing to the beginning of the current rule."
  (or (and (memq requested '(nil 3)) (elt antlr-options-alists 2)
           (progn (goto-char bor) 3))
      (and (memq requested '(nil 2)) (cadr antlr-options-alists)
           (let (boc)		; beginning of class
             (goto-char (point-min))
             (while (and (<= (point) bor)
                         (antlr-re-search-forward antlr-grammar-header-regexp nil))
               (if (<= (match-beginning 0) bor)
                   (setq boc (match-end 0))))
             (when boc
               (goto-char boc)
               2)))))