Function: srecode-compile-inserter

srecode-compile-inserter is a byte-compiled function defined in compile.el.gz.

Signature

(srecode-compile-inserter NAME KEY STATE &rest PROPS)

Documentation

Create an srecode inserter object for some macro NAME.

KEY indicates a single character key representing a type of inserter to create. STATE is the current compile state. PROPS are additional properties that might need to be passed to the inserter constructor.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/compile.el.gz
(defun srecode-compile-inserter (name key STATE &rest props)
  "Create an srecode inserter object for some macro NAME.
KEY indicates a single character key representing a type
of inserter to create.
STATE is the current compile state.
PROPS are additional properties that might need to be passed
to the inserter constructor."
  ;;(message "Compile: %s %S" name props)
  (if (not key)
      (apply #'make-instance 'srecode-template-inserter-variable
             :object-name name props)
    (let ((classes (eieio-class-children 'srecode-template-inserter))
	  (new nil))
      ;; Loop over the various subclasses and
      ;; create the correct inserter.
      (while (and (not new) classes)
	(setq classes (append classes (eieio-class-children (car classes))))
	;; Do we have a match?
	(when (and (not (class-abstract-p (car classes)))
		   (equal (oref-default (car classes) key) key))
	  ;; Create the new class, and apply state.
	  (setq new (apply #'make-instance (car classes)
                           :object-name name props))
	  (srecode-inserter-apply-state new STATE)
	  )
	(setq classes (cdr classes)))
      (if (not new) (error "SRECODE: Unknown macro code %S" key))
      new)))