;;; srecode/compile --- Compilation of srecode template files.
-;; Copyright (C) 2005, 2007-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2013 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: codegeneration
(defun srecode-compile-templates ()
"Compile a semantic recode template file into a mode-local variable."
(interactive)
+ (unless (semantic-active-p)
+ (error "You have to activate semantic-mode to compile SRecode templates."))
(require 'srecode/insert)
(message "Compiling template %s..."
(file-name-nondirectory (buffer-file-name)))
;;(message "Compile: %s %S" name props)
(if (not key)
(apply 'srecode-template-inserter-variable name props)
- (let ((classes (class-children srecode-template-inserter))
+ (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 (class-children (car 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 (car classes) key) key))
(defmethod srecode-dump ((tmp srecode-template))
"Dump the contents of the SRecode template tmp."
(princ "== Template \"")
- (princ (object-name-string tmp))
+ (princ (eieio-object-name-string tmp))
(princ "\" in context ")
(princ (oref tmp context))
(princ "\n")
(defmethod srecode-dump ((ins srecode-template-inserter) indent)
"Dump the state of the SRecode template inserter INS."
(princ "INS: \"")
- (princ (object-name-string ins))
+ (princ (eieio-object-name-string ins))
(when (oref ins :secondname)
(princ "\" : \"")
(princ (oref ins :secondname)))
(princ "\" type \"")
- (let* ((oc (symbol-name (object-class ins)))
+ (let* ((oc (symbol-name (eieio-object-class ins)))
(junk (string-match "srecode-template-inserter-" oc))
(on (if junk
(substring oc (match-end 0))