annotate lisp/cedet/semantic/bovine/scm.el @ 104452:688cf3b99678

lisp/cedet/semantic/bovine/c-by.el lisp/cedet/semantic/bovine/c.el lisp/cedet/semantic/bovine/debug.el lisp/cedet/semantic/bovine/el.el lisp/cedet/semantic/bovine/gcc.el lisp/cedet/semantic/bovine/java.el lisp/cedet/semantic/bovine/make-by.el lisp/cedet/semantic/bovine/make.el lisp/cedet/semantic/bovine/scm-by.el lisp/cedet/semantic/bovine/scm.el: New files.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 05 Sep 2009 20:47:41 +0000
parents
children 6ccad1511df1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
3 ;;; Copyright (C) 2001, 2002, 2003, 2004, 2008, 2009
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)
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
31 (eval-when-compile
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32 (require 'semantic/dep))
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 ;;; Code:
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
36 (defcustom-mode-local-semantic-dependency-system-include-path
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
37 scheme-mode semantic-default-scheme-path
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
38 '("/usr/share/guile/")
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
39 "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
40 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
41 actually on the local machine.")
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
42
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
43 (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
44 "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
45 (let* ((tok (semantic-tag-class tag))
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
46 (args (semantic-tag-components tag))
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47 )
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
48 (if (eq tok 'function)
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
49 (concat (semantic-tag-name tag) " ("
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
50 (mapconcat (lambda (a) a) args " ")
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 (semantic-format-tag-prototype-default tag))))
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
53
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
54 (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
55 "Return the documentation string for TAG.
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
56 Optional argument NOSNARF is ignored."
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
57 (let ((d (semantic-tag-docstring tag)))
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
58 (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
59 (substring d 1)
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
60 d)))
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
61
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
62 (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
63 "Insert TAG from TAGFILE at point.
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
64 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
65 (cond ((eq (semantic-tag-class tag) 'function)
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
66 (insert "(" (semantic-tag-name tag) " )")
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
67 (forward-char -1))
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
68 (t
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
69 (insert (semantic-tag-name tag)))))
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
70
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
71 ;; Note: Analyzer from Henry S. Thompson
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
72 (define-lex-regex-analyzer semantic-lex-scheme-symbol
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
73 "Detect and create symbol and keyword tokens."
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
74 "\\(\\sw\\([:]\\|\\sw\\|\\s_\\)+\\)"
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
75 ;; (message (format "symbol: %s" (match-string 0)))
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
76 (semantic-lex-push-token
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
77 (semantic-lex-token
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
78 (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
79 (match-beginning 0) (match-end 0))))
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
80
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
81
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
82 (define-lex semantic-scheme-lexer
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
83 "A simple lexical analyzer that handles simple buffers.
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
84 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
85 syntax as specified by the syntax table."
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
86 semantic-lex-ignore-whitespace
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
87 semantic-lex-ignore-newline
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
88 semantic-lex-scheme-symbol
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
89 semantic-lex-charquote
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
90 semantic-lex-paren-or-list
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
91 semantic-lex-close-paren
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
92 semantic-lex-string
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
93 semantic-lex-ignore-comments
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
94 semantic-lex-punctuation
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
95 semantic-lex-number
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
96 semantic-lex-default-action)
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
97
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
98 (defun semantic-default-scheme-setup ()
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
99 "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
100 (semantic-scm-by--install-parser)
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
101 (setq semantic-symbol->name-assoc-list '( (variable . "Variables")
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
102 ;;(type . "Types")
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
103 (function . "Functions")
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
104 (include . "Loads")
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
105 (package . "DefineModule"))
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 imenu-create-index-function 'semantic-create-imenu-index
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
108 )
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
109 (setq semantic-lex-analyzer #'semantic-scheme-lexer)
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
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
112 (add-hook 'scheme-mode-hook 'semantic-default-scheme-setup)
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
113
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
114 (provide 'semantic/bovine/scm)
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
115
688cf3b99678 lisp/cedet/semantic/bovine/c-by.el
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
116 ;;; semantic/bovine/scm.el ends here