Mercurial > emacs
annotate lisp/cedet/semantic/bovine/scm.el @ 112150:14a97ab281d5
* install-sh, mkinstalldirs, move-if-change: Update from master
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Fri, 07 Jan 2011 12:42:11 -0800 |
parents | 1d1d5d9bd884 |
children | 376148b31b5e |
rev | line source |
---|---|
104452
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1 ;;; semantic/bovine/scm.el --- Semantic details for Scheme (guile) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
106815 | 3 ;;; Copyright (C) 2001, 2002, 2003, 2004, 2008, 2009, 2010 |
104452
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
4 ;;; Free Software Foundation, Inc. |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 ;; Author: Eric M. Ludlam <zappo@gnu.org> |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 ;; it under the terms of the GNU General Public License as published by |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 ;; (at your option) any later version. |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 ;; GNU Emacs is distributed in the hope that it will be useful, |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 ;; GNU General Public License for more details. |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 ;;; Commentary: |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;; |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;; Use the Semantic Bovinator for Scheme (guile) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 (require 'semantic) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
28 (require 'semantic/bovine/scm-by) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 (require 'semantic/format) |
105260
bbd7017a25d9
CEDET (development tools) package merged.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
30 (require 'semantic/dep) |
104452
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 ;;; Code: |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 (defcustom-mode-local-semantic-dependency-system-include-path |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 scheme-mode semantic-default-scheme-path |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 '("/usr/share/guile/") |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
37 "Default set of include paths for scheme (guile) code. |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
38 This should probably do some sort of search to see what is |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
39 actually on the local machine.") |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
40 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
41 (define-mode-local-override semantic-format-tag-prototype scheme-mode (tag) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
42 "Return a prototype for the Emacs Lisp nonterminal TAG." |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
43 (let* ((tok (semantic-tag-class tag)) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 (args (semantic-tag-components tag)) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 ) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 (if (eq tok 'function) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 (concat (semantic-tag-name tag) " (" |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 (mapconcat (lambda (a) a) args " ") |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 ")") |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 (semantic-format-tag-prototype-default tag)))) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 (define-mode-local-override semantic-documentation-for-tag scheme-mode (tag &optional nosnarf) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 "Return the documentation string for TAG. |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 Optional argument NOSNARF is ignored." |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 (let ((d (semantic-tag-docstring tag))) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 (if (and d (> (length d) 0) (= (aref d 0) ?*)) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 (substring d 1) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 d))) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 (define-mode-local-override semantic-insert-foreign-tag scheme-mode (tag tagfile) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 "Insert TAG from TAGFILE at point. |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 Attempts a simple prototype for calling or using TAG." |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 (cond ((eq (semantic-tag-class tag) 'function) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 (insert "(" (semantic-tag-name tag) " )") |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 (forward-char -1)) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
66 (t |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 (insert (semantic-tag-name tag))))) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 ;; Note: Analyzer from Henry S. Thompson |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
70 (define-lex-regex-analyzer semantic-lex-scheme-symbol |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 "Detect and create symbol and keyword tokens." |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
72 "\\(\\sw\\([:]\\|\\sw\\|\\s_\\)+\\)" |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 ;; (message (format "symbol: %s" (match-string 0))) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 (semantic-lex-push-token |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 (semantic-lex-token |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 (or (semantic-lex-keyword-p (match-string 0)) 'symbol) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 (match-beginning 0) (match-end 0)))) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 (define-lex semantic-scheme-lexer |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 "A simple lexical analyzer that handles simple buffers. |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 This lexer ignores comments and whitespace, and will return |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
83 syntax as specified by the syntax table." |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 semantic-lex-ignore-whitespace |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
85 semantic-lex-ignore-newline |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 semantic-lex-scheme-symbol |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 semantic-lex-charquote |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 semantic-lex-paren-or-list |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 semantic-lex-close-paren |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 semantic-lex-string |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 semantic-lex-ignore-comments |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
92 semantic-lex-punctuation |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
93 semantic-lex-number |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
94 semantic-lex-default-action) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
95 |
104470
6ccad1511df1
Minor whitespace changes and `require' fixes.
Chong Yidong <cyd@stupidchicken.com>
parents:
104452
diff
changeset
|
96 ;;;###autoload |
104452
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
97 (defun semantic-default-scheme-setup () |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
98 "Setup hook function for Emacs Lisp files and Semantic." |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
99 (semantic-scm-by--install-parser) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
100 (setq semantic-symbol->name-assoc-list '( (variable . "Variables") |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
101 ;;(type . "Types") |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
102 (function . "Functions") |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
103 (include . "Loads") |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
104 (package . "DefineModule")) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
105 imenu-create-index-function 'semantic-create-imenu-index |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
106 imenu-create-index-function 'semantic-create-imenu-index |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
107 ) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 (setq semantic-lex-analyzer #'semantic-scheme-lexer) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 ) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
110 |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
111 (provide 'semantic/bovine/scm) |
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
112 |
104498
41dc39934483
lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
104470
diff
changeset
|
113 ;; Local variables: |
41dc39934483
lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
104470
diff
changeset
|
114 ;; generated-autoload-file: "../loaddefs.el" |
41dc39934483
lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
104470
diff
changeset
|
115 ;; generated-autoload-load-name: "semantic/bovine/scm" |
41dc39934483
lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
104470
diff
changeset
|
116 ;; End: |
41dc39934483
lisp/cedet/srecode.el:
Chong Yidong <cyd@stupidchicken.com>
parents:
104470
diff
changeset
|
117 |
105377 | 118 ;; arch-tag: 4f929838-b817-447d-848c-d47789ff140f |
104452
688cf3b99678
lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
119 ;;; semantic/bovine/scm.el ends here |