Function: bovine-grammar-expand-action

bovine-grammar-expand-action is a byte-compiled function defined in grammar.el.gz.

Signature

(bovine-grammar-expand-action TEXTFORM QUOTEMODE)

Documentation

Expand semantic action string TEXTFORM into Lisp code.

QUOTEMODE is the mode in which quoted symbols are slurred.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/bovine/grammar.el.gz
(defun bovine-grammar-expand-action (textform quotemode)
  "Expand semantic action string TEXTFORM into Lisp code.
QUOTEMODE is the mode in which quoted symbols are slurred."
  (if (string= "" textform)
      nil
    (let ((sexp (read textform)))
      ;; We converted the lambda string into a list.  Now write it
      ;; out as the bovine lambda expression, and do macro-like
      ;; conversion upon it.
      (insert "\n")
      (cond
       ((eq (car sexp) 'EXPAND)
        (insert ",(lambda (vals start end)"
                "\n(ignore vals start end)")
        ;; The EXPAND macro definition is mandatory
        (bovine-grammar-expand-form
         (apply (cdr (assq 'EXPAND bovine--grammar-macros)) (cdr sexp))
         quotemode t)
        )
       ((and (listp (car sexp)) (eq (caar sexp) 'EVAL))
        ;; The user wants to evaluate the following args.
        ;; Use a simpler expander
        )
       (t
        (insert ",(semantic-lambda")
        (bovine-grammar-expand-form sexp quotemode)
        ))
      (insert ")\n")))
)