Mercurial > emacs
comparison lisp/cedet/srecode/template.el @ 104498:41dc39934483
lisp/cedet/srecode.el:
lisp/cedet/srecode/*.el:
test/cedet/srecode-tests.el: New files
lisp/files.el (auto-mode-alist): Use srecode-template-mode for .srt files.
lisp/cedet/semantic/bovine/scm.el: Add local vars section for autoloading.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sun, 20 Sep 2009 21:06:41 +0000 |
parents | |
children | 1c6153d17f64 |
comparison
equal
deleted
inserted
replaced
104497:31e9b85bc047 | 104498:41dc39934483 |
---|---|
1 ;;; srecode-template.el --- SRecoder template language parser support. | |
2 | |
3 ;;; Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. | |
4 | |
5 ;; This file is part of GNU Emacs. | |
6 | |
7 ;; GNU Emacs is free software: you can redistribute it and/or modify | |
8 ;; it under the terms of the GNU General Public License as published by | |
9 ;; the Free Software Foundation, either version 3 of the License, or | |
10 ;; (at your option) any later version. | |
11 | |
12 ;; GNU Emacs is distributed in the hope that it will be useful, | |
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 ;; GNU General Public License for more details. | |
16 | |
17 ;; You should have received a copy of the GNU General Public License | |
18 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |
19 | |
20 ;;; Commentary: | |
21 ;; | |
22 ;; Parser setup for the semantic recoder template parser. | |
23 | |
24 ;;; Code: | |
25 (require 'semantic) | |
26 (require 'semantic/ctxt) | |
27 (require 'semantic/wisent) | |
28 (require 'srecode/srt-wy) | |
29 | |
30 (define-mode-local-override semantic-tag-components | |
31 srecode-template-mode (tag) | |
32 "Return sectiondictionary tags." | |
33 (when (semantic-tag-of-class-p tag 'function) | |
34 (let ((dicts (semantic-tag-get-attribute tag :dictionaries)) | |
35 (ans nil)) | |
36 (while dicts | |
37 (setq ans (append ans (cdr (car dicts)))) | |
38 (setq dicts (cdr dicts))) | |
39 ans) | |
40 )) | |
41 | |
42 (defun srecode-template-setup-parser () | |
43 "Setup buffer for parse." | |
44 (srecode-template-wy--install-parser) | |
45 | |
46 (setq | |
47 ;; Lexical Analysis | |
48 semantic-lex-analyzer 'wisent-srecode-template-lexer | |
49 ;; Parsing | |
50 ;; Environment | |
51 semantic-imenu-summary-function 'semantic-format-tag-name | |
52 imenu-create-index-function 'semantic-create-imenu-index | |
53 semantic-command-separation-character "\n" | |
54 semantic-lex-comment-regex ";;" | |
55 ;; Speedbar | |
56 semantic-symbol->name-assoc-list | |
57 '((function . "Template") | |
58 (variable . "Variable") | |
59 ) | |
60 ;; Navigation | |
61 senator-step-at-tag-classes '(function variable) | |
62 )) | |
63 | |
64 ;;;;###autoload | |
65 (add-hook 'srecode-template-mode-hook 'srecode-template-setup-parser) | |
66 | |
67 (provide 'srecode/template) | |
68 | |
69 ;;; srecode/template.el ends here |