;;; semantic/grammar.el --- Major mode framework for Semantic grammars
-;; Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2002-2005, 2007-2011 Free Software Foundation, Inc.
;; Author: David Ponce <david@dponce.com>
;; Maintainer: David Ponce <david@dponce.com>
(skip-chars-backward "\r\n\t")
;; If a grammar footer is found, skip it.
(re-search-backward "^;;;\\s-+\\S-+\\s-+ends here"
- (save-excursion
- (beginning-of-line)
- (point))
- t)
+ (point-at-bol) t)
(skip-chars-backward "\r\n\t")
(point)))
"\n"))
;; If running interactively, eval declarations and epilogue
;; code, then pop to the buffer visiting the generated file.
(eval-region (point) (point-max))
+ ;; Loop over the defvars and eval them explicitly to force
+ ;; them to be evaluated and ready to use.
+ (goto-char (point-min))
+ (while (re-search-forward "(defvar " nil t)
+ (eval-defun nil))
+ ;; Move cursor to a logical spot in the generated code.
(goto-char (point-min))
(pop-to-buffer (current-buffer))
;; The generated code has been evaluated and updated into
(car (semantic-find-tags-by-class
'function
(or (semantic-find-tags-by-name name (current-buffer))
- (and (featurep 'semanticdb)
+ (and (featurep 'semantic/db)
semanticdb-current-database
(cdar (semanticdb-find-tags-by-name name nil t)))))))
(provide 'semantic/grammar)
-;; arch-tag: 12ffc9d5-557d-49af-a5fd-a66a006ddb3e
;;; semantic/grammar.el ends here