annotate lisp/oobr/br-eif.el @ 215:1f0dabaa0855 r20-4b6

Import from CVS: tag r20-4b6
author cvs
date Mon, 13 Aug 2007 10:07:35 +0200
parents 4be1180a9e89
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;!emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; FILE: br-eif.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Support routines for Eiffel inheritance browsing and error parsing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; USAGE: GNU Emacs Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; KEYWORDS: oop, tools
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; AUTHOR: Bob Weiner
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
9 ;; ORG: InfoDock Associates
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; ORIG-DATE: 7-Dec-89
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
12 ;; LAST-MOD: 21-Feb-97 at 17:22:26 by Bob Weiner
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 70
diff changeset
14 ;; Copyright (C) 1989-1995, 1997 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; See the file BR-COPY for license information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; This file is part of the OO-Browser.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; Other required Elisp libraries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 (require 'br-lib)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;; User visible variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (defvar eif-lib-search-dirs nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 "List of directories below which Eiffel Library source files are found.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 Subdirectories of Library source are also searched. A Library is a stable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 group of classes.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (defvar eif-sys-search-dirs nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 "List of directories below which Eiffel System source files are found.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 Subdirectories of System source are also searched. A System class is one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 that is not yet reusable and is likely to change before release.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (defconst eif-narrow-view-to-class nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 "*Non-nil means narrow buffer to just the matching class definition when displayed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;;; Internal functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (defun eif-get-classes-from-source (filename &optional skip-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 skip-tags-cleanup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 "Scans FILENAME and returns cons of class list with parents-class alist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 Handles multiple inheritance. Assumes file existence and readability have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 already been checked.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 With optional SKIP-TAGS non-nil, does not compute and store lookup tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 for element definitions. If SKIP-TAGS is nil, normally a cleanup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 function is called after scanning the elements. SKIP-TAGS-CLEANUP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 non-nil suppresses this action."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;; Multiple classes per file allowed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (let ((no-kill (get-file-buffer filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 classes class end parents signatures start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (if no-kill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (set-buffer no-kill)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (funcall br-view-file-function filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (while (re-search-forward eif-class-def-regexp nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (setq start (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 class
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (eif-set-case
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (buffer-substring (match-beginning 2) (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 classes (cons class classes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 parents (cons (cons (eif-get-parents-from-source
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 filename class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 class)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 parents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (eif-to-class-end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (setq end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (or skip-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ;; Scan class features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (setq signatures
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (eif-scan-features-in-class class start end))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (if skip-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (eif-get-feature-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 buffer-file-name (eif-sort-features signatures))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (or skip-tags-cleanup (br-feature-tags-save)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (or no-kill (kill-buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (cons classes (delq nil parents))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (defun eif-get-parents-from-source (filename &optional class-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 "Return list of downcased parents of Eiffel class in FILENAME.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 Return nil if file is not readable. Assume that Eiffel keywords
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 'inherit' and 'feature' occur at the beginning of lines, when present."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (let ((parents) (par)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (no-kill (get-file-buffer filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (obuf (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (if no-kill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (set-buffer no-kill))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (if (or no-kill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (if (file-readable-p filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (let ((br-view-file-function 'br-insert-file-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (message "Scanning %s ..." filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (funcall br-view-file-function filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (let ((case-fold-search t) ;; Ignore case in searches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (if (or (null class-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (let ((class-def (concat eif-class-name-before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (eif-set-case-type class-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 eif-class-name-after)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (re-search-forward class-def nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (if (not (re-search-forward (concat "^inherit[ \t\n]+"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 eif-parent-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;; Save first parent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (setq parents (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (eif-set-case (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (match-end 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 indent (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (goto-char (match-beginning 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (current-column)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ;; Save any succeeding parents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (if (re-search-forward "^[a-zA-Z]" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (setq end (1- (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (while (< (point) end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (back-to-indentation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (and (<= (current-column) indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (looking-at eif-identifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (setq par (eif-set-case (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (match-end 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (if (or (br-member par parents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (br-member-sorted-strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 par eif-reserved-words))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (setq parents (cons par parents))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (forward-line 1)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (or no-kill (kill-buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (set-buffer obuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (nreverse parents)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (defun eif-select-path (paths-htable-elt &optional feature-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 "Select proper pathname from PATHS-HTABLE-ELT based upon value of optional FEATURE-P.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 Selection is between path of class definition and path for features associated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 with the class."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (cdr paths-htable-elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (defun eif-set-case (type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 "Return string TYPE identifier for use as a class name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (downcase type))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (defun eif-set-case-type (class-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 "Return string CLASS-NAME for use as a type identifier."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (upcase class-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (defun eif-to-class-end ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 "Assuming point is at start of class, move to start of line after end of class."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (if (and (re-search-forward "^end[ \t\n-]" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (= (forward-line 1) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (goto-char (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (defun eif-to-comments-begin ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 "Skip back from current point past any preceding blank lines and comments."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (let ((opoint))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (while
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (progn (setq opoint (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ;; To previous line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (and (= 0 (forward-line -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 ;; If begins with "--", then is a comment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (cond ((looking-at "[ \t]*--"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ((looking-at "[ \t]*$"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (goto-char opoint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ;; Skip past whitespace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (skip-chars-forward " \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (beginning-of-line)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ;;; Internal variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (defconst eif-class-name-before "^[ \t]*\\(deferred[ \t\n]+\\|expanded[ \t\n]+\\)?class[ \t\n]+"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 "Regexp preceding the class name in a class definition.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (defconst eif-class-name-after "[ \t\n]+"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 "Regexp following the class name in a class definition.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (defconst eif-identifier-chars "A-Za-z0-9_"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 "String of chars and char ranges that may be used within an Eiffel identifier.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (defconst eif-identifier (concat "\\([a-zA-Z][" eif-identifier-chars "]*\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 "Regular expression matching an Eiffel identifier.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (defconst eif-class-def-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (concat eif-class-name-before eif-identifier eif-class-name-after)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 "Regular expression used to match to class definitions in source text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 Class name identifier is grouped expression 2.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (defconst eif-class-name-preceding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 "\\([\[\{>;:][ \t\n]*\\|[a-zA-z][ \t\n]+\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 "Pattern preceding any valid non-comment use of an Eiffel class/type name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (defconst eif-class-name-pat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (concat eif-class-name-preceding eif-identifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 "Class name is grouped expression 2.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (defconst eif-lang-prefix "eif-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 "Prefix string that starts \"br-eif.el\" symbol names.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (defconst eif-parent-regexp (concat "[ \t\n]*\\(--.*[\n]\\)*[ \t\n]*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 eif-identifier)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 "Parent identifier is grouped expression 2.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (defconst eif-src-file-regexp ".\\.e$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 "Regular expression matching a unique part of Eiffel class filenames and no others.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (defvar eif-children-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 "Htable whose elements are of the form: (LIST-OF-CHILD-CLASSES . CLASS-NAME).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 Used to traverse Eiffel inheritance graph. 'br-build-children-htable' builds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 this list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (defvar eif-parents-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 "Htable whose elements are of the form: (LIST-OF-PARENT-CLASSES . CLASS-NAME).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 Used to traverse Eiffel inheritance graph. 'br-build-parents-htable' builds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 this list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (defvar eif-paths-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 "Htable whose elements are of the form: (LIST-OF-CLASS-NAMES . DIRECTORY).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 DIRECTORY gives the location of classes found in LIST-OF-CLASS-NAMES.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 'br-build-paths-htable' builds this list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (defvar eif-lib-parents-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 "Htable whose elements are of the form: (LIST-OF-PARENT-CLASSES . CLASS-NAME).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 Only classes from stable software libraries are used to build the list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (defvar eif-lib-paths-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 "Htable whose elements are of the form: (LIST-OF-CLASS-NAMES . DIRECTORY).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 DIRECTORY gives the location of classes found in LIST-OF-CLASS-NAMES.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 Only classes from stable software libraries are used to build the list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (defvar eif-sys-parents-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 "Htable whose elements are of the form: (LIST-OF-PARENT-CLASSES . CLASS-NAME).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 Only classes from systems that are likely to change are used to build the list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (defvar eif-sys-paths-htable nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 "Htable whose elements are of the form: (LIST-OF-CLASS-NAMES . DIRECTORY).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 DIRECTORY gives the location of classes found in LIST-OF-CLASS-NAMES.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 Only classes from systems that are likely to change are used to build the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 list.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (defvar eif-lib-prev-search-dirs nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 "Used to check if 'eif-lib-paths-htable' must be regenerated.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (defvar eif-sys-prev-search-dirs nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 "Used to check if 'eif-sys-paths-htable' must be regenerated.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (defvar eif-env-spec nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 "Non-nil value means Environment specification has been given but not yet built.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 Nil means current Environment has been built, though it may still require updating.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (provide 'br-eif)