Function: semantic-grammar-batch-build-one-package
semantic-grammar-batch-build-one-package is a byte-compiled function
defined in grammar.el.gz.
Signature
(semantic-grammar-batch-build-one-package FILE)
Documentation
Build a Lisp package from the grammar in FILE.
That is, generate Lisp code from FILE, and byte-compile it.
Return non-nil if there were no errors, nil if errors.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/grammar.el.gz
(defun semantic-grammar-batch-build-one-package (file)
"Build a Lisp package from the grammar in FILE.
That is, generate Lisp code from FILE, and `byte-compile' it.
Return non-nil if there were no errors, nil if errors."
;; We need this require so that we can find `byte-compile-dest-file'.
(require 'bytecomp)
(unless (auto-save-file-name-p file)
;; Create the package
(let ((packagename
(condition-case err
(with-current-buffer (find-file-noselect file)
(let ((semantic-new-buffer-setup-functions nil)
(vc-handled-backends nil))
(setq semanticdb-new-database-class 'semanticdb-project-database)
(semantic-mode 1)
(semantic-grammar-create-package t)))
(error
(message "%s" (error-message-string err))
nil))))
(when packagename
;; Only byte compile if out of date
(if (file-newer-than-file-p
packagename (byte-compile-dest-file packagename))
(let (;; Some complex grammar table expressions need a few
;; more resources than the default.
(max-specpdl-size (max 3000 max-specpdl-size))
(max-lisp-eval-depth (max 1000 max-lisp-eval-depth))
)
;; byte compile the resultant file
(byte-compile-file packagename))
t)))))