Mercurial > emacs
annotate lisp/progmodes/simula.el @ 1487:09bc6fe443d9
(fortran-prepare-abbrev-list-buffer): Fix typo.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 27 Oct 1992 20:11:05 +0000 |
parents | 2cdce064065f |
children | ec2c000b8b69 |
rev | line source |
---|---|
805 | 1 ;;; simula.el --- SIMULA 87 code editing commands for Emacs |
2 | |
841 | 3 ;; Copyright (C) 1992 Free Software Foundation, Inc. |
4 | |
810
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
5 ;; Author: Hans Henrik Eriksen <hhe@ifi.uio.no> |
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
6 ;; Maintainer: simula-mode@ifi.uio.no |
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
7 ;; Version: 0.99 |
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
8 ;; Adapted-By: ESR |
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
9 ;; Keywords: languages |
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
10 |
805 | 11 ;; This file is part of GNU Emacs. |
12 | |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
14 ;; it under the terms of the GNU General Public License as published by | |
810
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
15 ;; the Free Software Foundation; either version 1, or (at your option) |
805 | 16 ;; any later version. |
17 | |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
24 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
25 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
26 | |
810
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
27 ;;; Commentary: |
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
28 |
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
29 ;; Hans Henrik Eriksen may be reached at: |
805 | 30 ;; Institutt for informatikk, |
31 ;; Universitetet i Oslo | |
32 | |
810
80303373daae
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
805
diff
changeset
|
33 ;;; Code: |
805 | 34 |
35 (provide 'simula-mode) | |
36 | |
37 (defconst simula-tab-always-indent nil | |
38 "*Non-nil means TAB in SIMULA mode should always reindent the current line, | |
39 regardless of where in the line point is when the TAB command is used.") | |
40 | |
41 (defconst simula-indent-level 3 | |
42 "*Indentation of SIMULA statements with respect to containing block.") | |
43 | |
44 (defconst simula-substatement-offset 3 | |
45 "*Extra indentation after DO, THEN, ELSE, WHEN and OTHERWISE.") | |
46 | |
47 (defconst simula-continued-statement-offset 3 | |
48 "*Extra indentation for lines not starting a statement or substatement. | |
49 If value is a list, each line in a multipleline continued statement | |
50 will have the car of the list extra indentation with respect to | |
51 the previous line of the statement.") | |
52 | |
53 (defconst simula-label-offset -4711 | |
54 "*Offset of SIMULA label lines relative to usual indentation") | |
55 | |
56 (defconst simula-if-indent '(0 . 0) | |
57 "*Extra indentation of THEN and ELSE with respect to the starting IF. | |
58 Value is a cons cell, the car is extra THEN indention and the cdr | |
59 extra ELSE indention. IF after ELSE is indented as the starting IF.") | |
60 | |
61 (defconst simula-inspect-indent '(0 . 0) | |
62 "*Extra indentation of WHEN and OTHERWISE with respect to the | |
63 corresponding INSPECT. Value is a cons cell, the car is | |
64 extra WHEN indention and the cdr extra OTHERWISE indention.") | |
65 | |
66 (defconst simula-electric-indent nil | |
67 "*If this variable is non-nil, the simula-indent-line function | |
68 will check the previous line to see if it has to be reindented.") | |
69 | |
70 (defconst simula-abbrev-keyword 'upcase | |
71 "*Determine how SIMULA keywords will be expanded. Value is one of | |
72 the symbols upcase, downcase, capitalize, (as in) abbrev-table or | |
73 nil if they should not be changed.") | |
74 | |
75 (defconst simula-abbrev-stdproc 'abbrev-table | |
76 "*Determine how standard SIMULA procedure and class names will be | |
77 expanded. Value is one of the symbols upcase, downcase, capitalize, | |
78 (as in) abbrev-table or nil if they should not be changed.") | |
79 | |
80 (defvar simula-abbrev-file nil | |
81 "*File with abbrev definitions that are merged together with | |
82 the standard abbrev definitions. Please note that the standard | |
83 definitions are required for simula-mode to function correctly.") | |
84 | |
85 (defvar simula-mode-syntax-table nil | |
86 "Syntax table in simula-mode buffers.") | |
87 | |
88 (if simula-mode-syntax-table | |
89 () | |
90 (setq simula-mode-syntax-table (standard-syntax-table)) | |
91 (modify-syntax-entry ?! "<" simula-mode-syntax-table) | |
92 (modify-syntax-entry ?$ "." simula-mode-syntax-table) | |
93 (modify-syntax-entry ?% "." simula-mode-syntax-table) | |
94 (modify-syntax-entry ?' "\"" simula-mode-syntax-table) | |
95 (modify-syntax-entry ?\( "()" simula-mode-syntax-table) | |
96 (modify-syntax-entry ?\) ")(" simula-mode-syntax-table) | |
97 (modify-syntax-entry ?\; ">" simula-mode-syntax-table) | |
98 (modify-syntax-entry ?\[ "." simula-mode-syntax-table) | |
99 (modify-syntax-entry ?\\ "." simula-mode-syntax-table) | |
100 (modify-syntax-entry ?\] "." simula-mode-syntax-table) | |
101 (modify-syntax-entry ?_ "w" simula-mode-syntax-table) | |
102 (modify-syntax-entry ?\| "." simula-mode-syntax-table) | |
103 (modify-syntax-entry ?\{ "." simula-mode-syntax-table) | |
104 (modify-syntax-entry ?\} "." simula-mode-syntax-table)) | |
105 | |
106 (defvar simula-mode-map () | |
107 "Keymap used in simula mode.") | |
108 | |
109 (if simula-mode-map | |
110 () | |
111 (setq simula-mode-map (make-sparse-keymap)) | |
112 (define-key simula-mode-map "\C-c\C-u" 'simula-backward-up-level) | |
113 (define-key simula-mode-map "\C-c\C-p" 'simula-previous-statement) | |
114 (define-key simula-mode-map "\C-c\C-d" 'simula-forward-down-level) | |
115 (define-key simula-mode-map "\C-c\C-n" 'simula-next-statement) | |
116 ;(define-key simula-mode-map "\C-c\C-g" 'simula-goto-definition) | |
117 ;(define-key simula-mode-map "\C-c\C-h" 'simula-standard-help) | |
118 (define-key simula-mode-map "\177" 'backward-delete-char-untabify) | |
119 (define-key simula-mode-map ":" 'simula-electric-label) | |
120 (define-key simula-mode-map "\t" 'simula-indent-command)) | |
121 | |
122 (defvar simula-mode-abbrev-table nil | |
123 "Abbrev table in simula-mode buffers") | |
124 | |
125 | |
126 (defun simula-mode () | |
127 "Major mode for editing SIMULA code. | |
128 \\{simula-mode-map} | |
129 Variables controlling indentation style: | |
130 simula-tab-always-indent | |
131 Non-nil means TAB in SIMULA mode should always reindent the current line, | |
132 regardless of where in the line point is when the TAB command is used. | |
133 simula-indent-level | |
134 Indentation of SIMULA statements with respect to containing block. | |
135 simula-substatement-offset | |
136 Extra indentation after DO, THEN, ELSE, WHEN and OTHERWISE. | |
137 simula-continued-statement-offset 3 | |
138 Extra indentation for lines not starting a statement or substatement, | |
139 e.g. a nested FOR-loop. If value is a list, each line in a multipple- | |
140 line continued statement will have the car of the list extra indentation | |
141 with respect to the previous line of the statement. | |
142 simula-label-offset -4711 | |
143 Offset of SIMULA label lines relative to usual indentation | |
144 simula-if-indent '(0 . 0) | |
145 Extra indentation of THEN and ELSE with respect to the starting IF. | |
146 Value is a cons cell, the car is extra THEN indention and the cdr | |
147 extra ELSE indention. IF after ELSE is indented as the starting IF. | |
148 simula-inspect-indent '(0 . 0) | |
149 Extra indentation of WHEN and OTHERWISE with respect to the | |
150 corresponding INSPECT. Value is a cons cell, the car is | |
151 extra WHEN indention and the cdr extra OTHERWISE indention. | |
152 simula-electric-indent nil | |
153 If this variable non-nil value, simula-indent-line | |
154 will check the previous line to see if it has to be reindented. | |
155 simula-abbrev-keyword 'upcase | |
156 Determine how SIMULA keywords will be expanded. Value is one of | |
157 the symbols upcase, downcase, capitalize, (as in) abbrev-table or | |
158 nil if they should not be changed. | |
159 simula-abbrev-stdproc 'abbrev-table | |
160 Determine how standard SIMULA procedure and class names will be | |
161 expanded. Value is one of the symbols upcase, downcase, capitalize, | |
162 (as in) abbrev-table or nil if they should not be changed. | |
163 | |
164 Turning on SIMULA mode calls the value of the variable simula-mode-hook | |
165 with no arguments, if that value is non-nil | |
166 | |
167 Warning: simula-mode-hook should not read in an abbrev file without calling | |
168 the function simula-install-standard-abbrevs afterwards, preferrably not | |
169 at all." | |
170 (interactive) | |
171 (kill-all-local-variables) | |
172 (use-local-map simula-mode-map) | |
173 (setq major-mode 'simula-mode) | |
174 (setq mode-name "SIMULA") | |
175 (make-local-variable 'comment-column) | |
176 (setq comment-column 40) | |
177 (make-local-variable 'end-comment-column) | |
178 (setq end-comment-column 75) | |
179 (set-syntax-table simula-mode-syntax-table) | |
180 (make-local-variable 'paragraph-start) | |
181 (setq paragraph-start "^[ \t]*$\\|\\f") | |
182 (make-local-variable 'paragraph-separate) | |
183 (setq paragraph-separate paragraph-start) | |
184 (make-local-variable 'indent-line-function) | |
185 (setq indent-line-function 'simula-indent-line) | |
186 (make-local-variable 'require-final-newline) | |
187 (setq require-final-newline t) | |
188 (make-local-variable 'comment-start) | |
189 (setq comment-start "! ") | |
190 (make-local-variable 'comment-end) | |
191 (setq comment-end " ;") | |
192 (make-local-variable 'comment-start-skip) | |
193 (setq comment-start-skip "!+ *") | |
194 (make-local-variable 'parse-sexp-ignore-comments) | |
195 (setq parse-sexp-ignore-comments nil) | |
196 (make-local-variable 'comment-multi-line) | |
197 (setq comment-multi-line t) | |
198 (if simula-mode-abbrev-table | |
199 () | |
200 (if simula-abbrev-file | |
201 (read-abbrev-file simula-abbrev-file) | |
202 (define-abbrev-table 'simula-mode-abbrev-table ())) | |
203 (let (abbrevs-changed) | |
204 (simula-install-standard-abbrevs))) | |
205 (setq local-abbrev-table simula-mode-abbrev-table) | |
206 (abbrev-mode 1) | |
207 (run-hooks 'simula-mode-hook)) | |
208 | |
209 | |
210 | |
211 (defun simula-indent-line () | |
212 "Indent this line as SIMULA code. If simula-electric-indent | |
213 is non-nil, indent previous line if necessary." | |
214 (let ((origin (- (point-max) (point))) | |
215 (indent (simula-calculate-indent)) | |
216 (case-fold-search t)) | |
217 (unwind-protect | |
218 (progn | |
219 ;; | |
220 ;; manually expand abbrev on last line, if any | |
221 ;; | |
222 (end-of-line 0) | |
223 (expand-abbrev) | |
224 ;; now maybe we should reindent that line | |
225 (if simula-electric-indent | |
226 (progn | |
227 (beginning-of-line) | |
228 (skip-chars-forward " \t\f") | |
229 (if (and | |
230 (looking-at | |
231 "\\(end\\|if\\|then\\|else\\|when\\|otherwise\\)\\>") | |
232 (not (simula-context))) | |
233 ;; yes - reindent | |
234 (let ((post-indent (simula-calculate-indent))) | |
235 (if (eq (current-indentation) post-indent) | |
236 () | |
237 (delete-horizontal-space) | |
238 (indent-to post-indent))))))) | |
239 (goto-char (- (point-max) origin)) | |
240 (if (eq (current-indentation) indent) | |
241 (back-to-indentation) | |
242 (delete-horizontal-space) | |
243 (indent-to indent))))) | |
244 | |
245 | |
246 (defun simula-indent-command (&optional whole-exp) | |
247 "Indent current line as SIMULA code, or insert TAB character. | |
248 If simula-tab-always-indent is non-nil, always indent current line. | |
249 Otherwise, indent only if point is before any non-whitespace | |
250 character on the line. | |
251 | |
252 A numeric argument, regardless of its value, means indent rigidly | |
253 all the lines of the SIMULA statement after point so that this line | |
254 becomes properly indented. | |
255 The relative indentation among the lines of the statement are preserved." | |
256 (interactive "P") | |
257 (let ((case-fold-search t)) | |
258 (if (or whole-exp simula-tab-always-indent | |
259 (save-excursion | |
260 (skip-chars-backward " \t\f") | |
261 (bolp))) | |
262 ;; reindent current line | |
263 (let ((indent (save-excursion | |
264 (beginning-of-line) | |
265 (simula-calculate-indent))) | |
266 (current (current-indentation)) | |
267 (origin (- (point-max) (point))) | |
268 (bol (save-excursion | |
269 (skip-chars-backward " \t\f") | |
270 (bolp))) | |
271 beg end) | |
272 (unwind-protect | |
273 (if (eq current indent) | |
274 (if (save-excursion | |
275 (skip-chars-backward " \t\f") | |
276 (bolp)) | |
277 (back-to-indentation)) | |
278 (beginning-of-line) | |
279 (delete-horizontal-space) | |
280 (indent-to indent)) | |
281 (if (not bol) | |
282 (goto-char (- (point-max) origin)))) | |
283 (setq origin (point)) | |
284 (if whole-exp | |
285 (save-excursion | |
286 (beginning-of-line 2) | |
287 (setq beg (point)) | |
288 (goto-char origin) | |
289 (simula-next-statement 1) | |
290 (setq end (point)) | |
291 (if (and (> end beg) (not (eq indent current))) | |
292 (indent-code-rigidly beg end (- indent current) "%"))))) | |
293 (insert-tab)))) | |
294 | |
295 | |
296 (defun simula-context () | |
297 "Returns value according to position of point inside SIMULA text: | |
298 0 point inside COMMENT | |
299 1 point on SIMULA-compiler directive line | |
300 2 point inside END comment | |
301 3 point inside string | |
302 4 point inside character constant | |
303 nil otherwise." | |
304 ;; first, find out if this is a compiler directive line | |
305 (if (save-excursion | |
306 (beginning-of-line) | |
307 (eq (following-char) ?%)) | |
308 ;; YES - return 1 | |
309 1 | |
310 (save-excursion | |
311 ;; The current line is NOT a compiler directive line. | |
312 ;; Now, the strategy is to search backward to find a semicolon | |
313 ;; that is NOT inside a string. The point after semicolon MUST be | |
314 ;; outside a comment, since semicolons are comment-ending and | |
315 ;; comments are non-recursive. We take advantage of the fact | |
316 ;; that strings MUST end on the same line as they started, so | |
317 ;; that we can easily decide whether we are inside a string or not. | |
318 (let (return-value (origin (point))) | |
319 (skip-chars-backward "^;" (point-min)) | |
320 ;; found semicolon or beginning of buffer | |
321 (let (loopvalue (saved-point origin)) | |
322 (while (and (not (bobp)) | |
323 (if (progn | |
324 (beginning-of-line) | |
325 ;; compiler directive line? If so, cont searching.. | |
326 (eq (following-char) ?%)) | |
327 t | |
328 (while (< (point) saved-point) | |
329 (skip-chars-forward "^;\"'") | |
330 (forward-char 1) | |
331 (cond | |
332 ((eq (preceding-char) ?\;) | |
333 (setq saved-point (point))) | |
334 ((eq (preceding-char) ?\") | |
335 (skip-chars-forward "^\";") | |
336 (if (eq (following-char) ?\;) | |
337 (setq saved-point (point) loopvalue t) | |
338 (forward-char 1))) | |
339 (t | |
340 (if (eq (following-char) ?') | |
341 (forward-char 1)) | |
342 (skip-chars-forward "^';") | |
343 (if (eq (following-char) ?\;) | |
344 (setq saved-point (point) loopvalue t) | |
345 (forward-char 1))))) | |
346 loopvalue)) | |
347 (backward-char 1) | |
348 (skip-chars-backward "^;") | |
349 (setq saved-point (point) loopvalue nil))) | |
350 ;; Now we are CERTAIN that we are outside comments and strings. | |
351 ;; The job now is to search forward again towards the origin | |
352 ;; skipping directives, comments and strings correctly, | |
353 ;; so that we know what context we are in when we find the origin. | |
354 (while (and | |
355 (< (point) origin) | |
356 (re-search-forward | |
357 "\\<end\\>\\|!\\|\"\\|'\\|^%\\|\\<comment\\>" origin 'move)) | |
358 (cond | |
359 ((memq (preceding-char) '(?d ?D)) | |
360 (setq return-value 2) | |
361 (while (and (memq (preceding-char) '(?d ?D)) (not return-value)) | |
362 (while (and (re-search-forward | |
363 ";\\|\\<end\\>\\|\\<else\\>\\|\\<otherwise\\>\\|\\<when\\>\\|^%" | |
364 origin 'move) | |
365 (eq (preceding-char) ?%)) | |
366 (beginning-of-line 2))) | |
367 (if (looking-at "[ \t\n\f]*\\(;\\|\\<end\\>\\|\\<else\\>\\|\\<otherwise\\>\\|\\<when\\>\\)") | |
368 (setq return-value nil))) | |
369 ((memq (preceding-char) '(?! ?t ?T)) | |
370 ; skip comment | |
371 (setq return-value 0) | |
372 (skip-chars-forward "^%;" origin) | |
373 (while (and return-value (< (point) origin)) | |
374 (if (eq (following-char) ?\;) | |
375 (setq return-value nil) | |
376 (if (bolp) | |
377 (beginning-of-line 2) ; skip directive inside comment | |
378 (forward-char 1)) ; or single '%' | |
379 (skip-chars-forward "^%;" origin)))) | |
380 ((eq (preceding-char) ?\") | |
381 (if (not (search-forward "\"" origin 'move)) | |
382 (setq return-value 3))) | |
383 ((eq (preceding-char) ?\') | |
384 (if (or (eq (point) origin) (eobp)) | |
385 (setq return-value 4) | |
386 (forward-char 1) | |
387 (if (not (search-forward "'" origin 'move)) | |
388 (setq return-value 4)))) | |
389 ;; compiler directive line - skip | |
390 (t (beginning-of-line 2)))) | |
391 return-value) | |
392 ))) | |
393 | |
394 | |
395 (defun simula-electric-label () | |
396 "If this is a label that starts the line, reindent the line" | |
397 (interactive) | |
398 (expand-abbrev) | |
399 (insert ?:) | |
400 (let ((origin (- (point-max) (point))) | |
401 (case-fold-search t) | |
402 ;; don't mix a label with an assignment operator := :- | |
403 ;; therefore look at next typed character... | |
404 (next-char (setq unread-command-char (read-char))) | |
405 (com-char last-command-char)) | |
406 (unwind-protect | |
407 ;; Problem: find out if character just read is a command char | |
408 ;; that would insert something after ':' making it a label. | |
409 ;; At least \n, \r (and maybe \t) falls into this category. | |
410 ;; This is a real crock, it depends on traditional keymap | |
411 ;; bindings, that is, printing characters doing self-insert, | |
412 ;; and no other command sequence inserting '-' or '='. | |
413 ;; simula-electric-label can be easily fooled... | |
414 (if (and (not (memq next-char '(?= ?-))) | |
415 (or (memq next-char '(?\n ?\r)) | |
416 (and (eq next-char ?\t) | |
417 simula-tab-always-indent) | |
418 (not (memq (following-char) '(?= ?-)))) | |
419 (not (simula-context)) | |
420 ;; label? | |
421 (progn | |
422 (backward-char 1) | |
423 (skip-chars-backward " \t\f") | |
424 (skip-chars-backward "a-zA-Z0-9_") | |
425 (if (looking-at "virtual\\>") | |
426 nil | |
427 (skip-chars-backward " \t\f") | |
428 (bolp)))) | |
429 (let ((amount (simula-calculate-indent))) | |
430 (delete-horizontal-space) | |
431 (indent-to amount))) | |
432 (goto-char (- (point-max) origin))))) | |
433 | |
434 | |
435 (defun simula-backward-up-level (count) | |
436 "Move backward up COUNT block levels. | |
437 If COUNT is negative, move forward up block level instead" | |
438 (interactive "p") | |
439 (let ((origin (point)) | |
440 (case-fold-search t)) | |
441 (condition-case () | |
442 (if (> count 0) | |
443 (while (> count 0) | |
444 (re-search-backward "\\<begin\\>\\|\\<end\\>") | |
445 (if (not (simula-context)) | |
446 (setq count (if (memq (following-char) '(?b ?B)) | |
447 (1- count) | |
448 (1+ count))))) | |
449 (while (< count 0) | |
450 (re-search-forward "\\<begin\\>\\|\\<end\\>") | |
451 (backward-word 1) | |
452 (if (not (simula-context)) | |
453 (setq count (if (memq (following-char) '(?e ?E)) | |
454 (1+ count) | |
455 (1- count)))) | |
456 (backward-word -1))) | |
457 ;; If block level not found, jump back to origin and signal an error | |
458 (error (progn | |
459 (goto-char origin) | |
460 (error "No higher block level"))) | |
461 (quit (progn | |
462 (goto-char origin) | |
463 (signal 'quit nil)))))) | |
464 | |
465 | |
466 (defun simula-forward-down-level (count) | |
467 "Move forward down COUNT block levels. | |
468 If COUNT is negative, move backward down block level instead" | |
469 (interactive "p") | |
470 ;; When we search for a deeper block level, we must never | |
471 ;; get out of the block where we started -> count >= start-count | |
472 (let ((start-count count) | |
473 (origin (point)) | |
474 (case-fold-search t)) | |
475 (condition-case () | |
476 (if (< count 0) | |
477 (while (< count 0) | |
478 (re-search-backward "\\<begin\\>\\|\\<end\\>") | |
479 (if (not (simula-context)) | |
480 (setq count (if (memq (following-char) '(?e ?E)) | |
481 (1+ count) | |
482 (1- count)))) | |
483 (if (< count start-count) (signal 'error nil))) | |
484 (while (> count 0) | |
485 (re-search-forward "\\<begin\\>\\|\\<end\\>") | |
486 (backward-word 1) | |
487 (if (not (simula-context)) | |
488 (setq count (if (memq (following-char) '(?b ?B)) | |
489 (1- count) | |
490 (1+ count)))) | |
491 (backward-word -1) | |
492 ;; deeper level has to be found within starting block | |
493 (if (> count start-count) (signal 'error nil)))) | |
494 ;; If block level not found, jump back to origin and signal an error | |
495 (error (progn | |
496 (goto-char origin) | |
497 (error "No containing block level"))) | |
498 (quit (progn | |
499 (goto-char origin) | |
500 (signal 'quit nil)))))) | |
501 | |
502 | |
503 (defun simula-previous-statement (count) | |
504 "Move backward COUNT statements. | |
505 If COUNT is negative, move forward instead (simula-next-statement)" | |
506 (interactive "p") | |
507 (if (< count 0) | |
508 (simula-next-statement (- count)) | |
509 (let (status | |
510 (case-fold-search t) | |
511 (origin (point))) | |
512 (condition-case () | |
513 (progn | |
514 (simula-skip-comment-backward) | |
515 (if (memq (preceding-char) '(?n ?N)) | |
516 (progn | |
517 (backward-word 1) | |
518 (if (not (looking-at "\\<begin\\>")) | |
519 (backward-word -1))) | |
520 (if (eq (preceding-char) ?\;) | |
521 (backward-char 1))) | |
522 (while (and (natnump (setq count (1- count))) | |
523 (setq status (simula-search-backward | |
524 ";\\|\\<begin\\>" nil 'move)))) | |
525 (if status | |
526 (progn | |
527 (if (eq (following-char) ?\;) | |
528 (forward-char 1) | |
529 (backward-word -1)))) | |
530 (simula-skip-comment-forward)) | |
531 (error (progn (goto-char origin) | |
532 (error "Incomplete statement (too many ENDs)"))) | |
533 (quit (progn (goto-char origin) (signal 'quit nil))))))) | |
534 | |
535 | |
536 (defun simula-next-statement (count) | |
537 "Move backward COUNT statements. | |
538 If COUNT is negative, move forward instead (simula-next-statement)" | |
539 (interactive "p") | |
540 (if (< count 0) | |
541 (simula-previous-statement (- count)) | |
542 (let (status | |
543 (case-fold-search t) | |
544 (origin (point))) | |
545 (condition-case () | |
546 (progn | |
547 (simula-skip-comment-forward) | |
548 (if (looking-at "\\<end\\>") (forward-word 1)) | |
549 (while (and (natnump (setq count (1- count))) | |
550 (setq status (simula-search-forward | |
551 ";\\|\\<end\\>" (point-max) 'move)))) | |
552 (if (and status (/= (preceding-char) ?\;)) | |
553 (progn | |
554 (backward-word 1) | |
555 (simula-skip-comment-backward)))) | |
556 (error (progn (goto-char origin) | |
557 (error "Incomplete statement (too few ENDs)"))) | |
558 (quit (progn (goto-char origin) (signal 'quit nil))))))) | |
559 | |
560 | |
561 (defun simula-skip-comment-backward () | |
562 "Search towards bob to find first char that is outside a comment" | |
563 (interactive) | |
564 (catch 'simula-out | |
565 (let (context) | |
566 (while t | |
567 (skip-chars-backward " \t\n\f") | |
568 (if (eq (preceding-char) ?\;) | |
569 (save-excursion | |
570 (backward-char 1) | |
571 (setq context (simula-context))) | |
572 (setq context (simula-context))) | |
573 (cond | |
574 ((memq context '(nil 3 4)) | |
575 ;; check to see if we found a label | |
576 (if (and (eq (preceding-char) ?:) | |
577 (not (memq (following-char) '(?- ?=))) | |
578 (save-excursion | |
579 (skip-chars-backward ": \t\fa-zA-Z0-9_") | |
580 (not (looking-at "virtual\\>")))) | |
581 (skip-chars-backward ": \t\fa-zA-Z0-9_") | |
582 (throw 'simula-out nil))) | |
583 ((eq context 0) | |
584 ;; since we are inside a comment, it must start somewhere! | |
585 (while (and (re-search-backward "!\\|\\<comment\\>") | |
586 (memq (simula-context) '(0 1))))) | |
587 ((eq context 1) | |
588 (end-of-line 0) | |
589 (if (bobp) | |
590 (throw 'simula-out nil))) | |
591 ((eq context 2) | |
592 ;; an END-comment must belong to an END | |
593 (re-search-backward "\\<end\\>") | |
594 (forward-word 1) | |
595 (throw 'simula-out nil)) | |
596 ;; should be impossible to get here.. | |
597 ))))) | |
598 | |
599 | |
600 (defun simula-skip-comment-forward () | |
601 "Search towards eob to find first char that is outside a comment" | |
602 ;; this function assumes we start with point .outside a comment | |
603 (interactive) | |
604 (catch 'simula-out | |
605 (while t | |
606 (skip-chars-forward " \t\n\f") | |
607 (cond | |
608 ((looking-at "!\\|\\<comment\\>") | |
609 (search-forward ";" nil 'move)) | |
610 ((and (bolp) (eq (following-char) ?%)) | |
611 (beginning-of-line 2)) | |
612 ((and (looking-at "[a-z0-9_]*[ \t\f]*:[^-=]") | |
613 (not (looking-at "virtual\\>"))) | |
614 (skip-chars-forward "a-zA-Z0-9_ \t\f:")) | |
615 (t | |
616 (throw 'simula-out t)))))) | |
617 | |
618 | |
619 (defun simula-forward-up-level () | |
620 (let ((continue-loop t) | |
621 (origin (point)) | |
622 (case-fold-search t) | |
623 return-value | |
624 temp) | |
625 (while continue-loop | |
626 (if (re-search-backward "\\<begin\\>\\|\\<end\\>" (point-min) 'move) | |
627 (setq temp (simula-context) | |
628 return-value (and (memq (preceding-char) '(?d ?D)) | |
629 (memq temp '(nil 2))) | |
630 continue-loop (and (not return-value) | |
631 (simula-forward-up-level))) | |
632 (setq continue-loop nil))) | |
633 (if return-value | |
634 t | |
635 (goto-char origin) | |
636 nil))) | |
637 | |
638 | |
639 (defun simula-calculate-indent () | |
640 (save-excursion | |
641 (let ((where (simula-context)) | |
642 (origin (point)) | |
643 (indent 0) | |
644 continued | |
645 start-line | |
646 temp | |
647 found-end | |
648 prev-cont) | |
649 (cond | |
650 ((eq where 0) | |
651 ;; | |
652 ;; Comment. | |
653 ;; If comment started on previous non-blank line, indent to the | |
654 ;; column where the comment started, else indent as that line. | |
655 ;; | |
656 (skip-chars-backward " \t\n\f") | |
657 (while (and (not (bolp)) (eq (simula-context) 0)) | |
658 (re-search-backward "^\\|!\\|\\<comment\\>")) | |
659 (skip-chars-forward " \t\n\f") | |
660 (prog1 | |
661 (current-column) | |
662 (goto-char origin))) | |
663 ;; | |
664 ;; Detect missing string delimiters | |
665 ;; | |
666 ((eq where 3) | |
667 (error "Inside string")) | |
668 ((eq where 4) | |
669 (error "Inside character constant")) | |
670 ;; | |
671 ;; check to see if inside ()'s | |
672 ;; | |
673 ((setq temp (simula-inside-parens)) | |
674 temp) | |
675 ;; | |
676 ;; Calculate non-comment indentation | |
677 (t | |
678 ;; first, find out if this line starts with something that needs | |
679 ;; special indention (END/IF/THEN/ELSE/WHEN/OTHERWISE or label) | |
680 ;; | |
681 (skip-chars-forward " \t\f") | |
682 (cond | |
683 ;; | |
684 ;; END | |
685 ;; | |
686 ((looking-at "end\\>") | |
687 (setq indent (- simula-indent-level) | |
688 found-end t)) | |
689 ;; | |
690 ;; IF/THEN/ELSE | |
691 ;; | |
692 ((looking-at "if\\>\\|then\\>\\|else\\>") | |
693 ;; search for the *starting* IF | |
694 (cond | |
695 ((memq (following-char) '(?T ?t)) | |
696 (setq indent (car simula-if-indent))) | |
697 ((memq (following-char) '(?E ?e)) | |
698 (setq indent (cdr simula-if-indent))) | |
699 (t | |
700 (forward-word 1) | |
701 (setq indent 0))) | |
702 (simula-find-if)) | |
703 ;; | |
704 ;; WHEN/OTHERWISE | |
705 ;; | |
706 ((looking-at "when\\>\\|otherwise\\>") | |
707 ;; search for corresponding INSPECT | |
708 (if (memq (following-char) '(?W ?w)) | |
709 (setq indent (car simula-inspect-indent)) | |
710 (setq indent (cdr simula-inspect-indent))) | |
711 (simula-find-inspect)) | |
712 ;; | |
713 ;; label: | |
714 ;; | |
715 ((and (not (looking-at "virtual\\>")) | |
716 (looking-at "[a-z0-9_]*[ \t\f]*:[^-=]")) | |
717 (setq indent simula-label-offset))) | |
718 ;; find line with non-comment text | |
719 (simula-skip-comment-backward) | |
720 (if (and found-end | |
721 (not (eq (preceding-char) ?\;)) | |
722 (if (memq (preceding-char) '(?N ?n)) | |
723 (save-excursion | |
724 (backward-word) | |
725 (not (looking-at "begin\\>"))) | |
726 t)) | |
727 (progn | |
728 (simula-previous-statement 1) | |
729 (simula-skip-comment-backward))) | |
730 (setq start-line | |
731 (save-excursion (beginning-of-line) (point)) | |
732 ;; - perhaps this is a continued statement | |
733 continued | |
734 (save-excursion | |
735 (and (not (bobp)) | |
736 ;; (not found-end) | |
737 (if (eq (char-syntax (preceding-char)) ?w) | |
738 (progn | |
739 (backward-word 1) | |
740 (not (looking-at | |
741 "begin\\|then\\|else\\|when\\|otherwise\\|do" | |
742 ))) | |
743 (not (memq (preceding-char) '(?: ?\;))))))) | |
744 ;; | |
745 ;; MAIN calculation loop - count BEGIN/DO etc. | |
746 ;; | |
747 (while (not (bolp)) | |
748 (if (re-search-backward | |
749 ";\\|\\<\\(begin\\|end\\|if\\|else\\|then\\|when\\|otherwise\\|do\\)\\>" | |
750 start-line 'move) | |
751 (if (simula-context) | |
752 ();; found something in a comment/string - ignore | |
753 (setq temp (following-char)) | |
754 (cond | |
755 ((eq temp ?\;) | |
756 (simula-previous-statement 1)) | |
757 ((looking-at "begin\\>") | |
758 (setq indent (+ indent simula-indent-level))) | |
759 ((looking-at "end\\>") | |
760 (forward-word 1) | |
761 (simula-previous-statement 1)) | |
762 ((looking-at "do\\>") | |
763 (setq indent (+ indent simula-substatement-offset)) | |
764 (simula-find-do-match)) | |
765 ((looking-at "\\(if\\|then\\|else\\)\\>") | |
766 (if (memq temp '(?I ?i)) | |
767 (forward-word 1) | |
768 (setq indent (+ indent | |
769 simula-substatement-offset | |
770 (if (memq temp '(?T ?t)) | |
771 (car simula-if-indent) | |
772 (cdr simula-if-indent))))) | |
773 (simula-find-if)) | |
774 ((looking-at "\\<when\\>\\|\\<otherwise\\>") | |
775 (setq indent (+ indent | |
776 simula-substatement-offset | |
777 (if (memq temp '(?W ?w)) | |
778 (car simula-if-indent) | |
779 (cdr simula-if-indent)))) | |
780 (simula-find-inspect))) | |
781 ;; found the start of a [sub]statement | |
782 ;; add indention for continued statement | |
783 (if continued | |
784 (setq indent | |
785 (+ indent | |
786 (if (listp simula-continued-statement-offset) | |
787 (car simula-continued-statement-offset) | |
788 simula-continued-statement-offset)))) | |
789 (setq start-line | |
790 (save-excursion (beginning-of-line) (point)) | |
791 continued nil)) | |
792 ;; search failed .. point is at beginning of line | |
793 ;; determine if we should continue searching | |
794 ;; (at or before comment or label) | |
795 ;; temp = t means finished | |
796 (setq temp | |
797 (and (not (simula-context)) | |
798 (save-excursion | |
799 (skip-chars-forward " \t\f") | |
800 (or (looking-at "virtual") | |
801 (not | |
802 (looking-at | |
803 "!\\|comment\\>\\|[a-z0-9_]*[ \t\f]*:[^-=]"))))) | |
804 prev-cont continued) | |
805 ;; if we are finished, find current line's indentation | |
806 (if temp | |
807 (setq indent (+ indent (current-indentation)))) | |
808 ;; find next line with non-comment SIMULA text | |
809 ;; maybe indent extra if statement continues | |
810 (simula-skip-comment-backward) | |
811 (setq continued | |
812 (and (not (bobp)) | |
813 (if (eq (char-syntax (preceding-char)) ?w) | |
814 (save-excursion | |
815 (backward-word 1) | |
816 (not (looking-at | |
817 "begin\\|then\\|else\\|when\\|otherwise\\|do"))) | |
818 (not (memq (preceding-char) '(?: ?\;)))))) | |
819 ;; if we the state of the continued-variable | |
820 ;; changed, add indention for continued statement | |
821 (if (or (and prev-cont (not continued)) | |
822 (and continued | |
823 (listp simula-continued-statement-offset))) | |
824 (setq indent | |
825 (+ indent | |
826 (if (listp simula-continued-statement-offset) | |
827 (car simula-continued-statement-offset) | |
828 simula-continued-statement-offset)))) | |
829 ;; while ends if point is at beginning of line at loop test | |
830 (if (not temp) | |
831 (setq start-line (save-excursion (beginning-of-line) (point))) | |
832 (beginning-of-line)))) | |
833 ;; | |
834 ;; return indention | |
835 ;; | |
836 indent))))) | |
837 | |
838 | |
839 (defun simula-find-if () | |
840 "Find starting IF of a IF-THEN[-ELSE[-IF-THEN...]] statement" | |
841 (catch 'simula-out | |
842 (while t | |
843 (if (and (simula-search-backward "\\<if\\>\\|;\\|\\<begin\\>"nil t) | |
844 (memq (following-char) '(?I ?i))) | |
845 (save-excursion | |
846 ;; | |
847 ;; find out if this IF was really the start of the IF statement | |
848 ;; | |
849 (simula-skip-comment-backward) | |
850 (if (and (eq (char-syntax (preceding-char)) ?w) | |
851 (progn | |
852 (backward-word 1) | |
853 (looking-at "else\\>"))) | |
854 () | |
855 (throw 'simula-out t))) | |
856 (if (not (looking-at "\\<if\\>")) | |
857 (error "Missing IF or misplaced BEGIN or ';' (can't find IF)") | |
858 ;; | |
859 ;; we were at the starting IF in the first place.. | |
860 ;; | |
861 (throw 'simula-out t)))))) | |
862 | |
863 | |
864 (defun simula-find-inspect () | |
865 "Find INSPECT matching WHEN or OTHERWISE" | |
866 (catch 'simula-out | |
867 (let ((level 0)) | |
868 ;; | |
869 ;; INSPECTs can be nested, have to find the corresponding one | |
870 ;; | |
871 (while t | |
872 (if (and (simula-search-backward "\\<inspect\\>\\|\\<otherwise\\>\\|;" | |
873 nil t) | |
874 (/= (following-char) ?\;)) | |
875 (if (memq (following-char) '(?O ?o)) | |
876 (setq level (1+ level)) | |
877 (if (zerop level) | |
878 (throw 'simula-out t) | |
879 (setq level (1- level)))) | |
880 (error "Missing INSPECT or misplaced ';' (can't find INSPECT)")))))) | |
881 | |
882 | |
883 (defun simula-find-do-match () | |
884 "Find keyword matching DO: FOR, WHILE, INSPECT or WHEN" | |
885 (while (and (re-search-backward | |
886 "\\<\\(do\\|for\\|while\\|inspect\\|when\\|end\\|begin\\)\\>\\|;" | |
887 nil 'move) | |
888 (simula-context))) | |
889 (if (and (looking-at "\\<\\(for\\|while\\|inspect\\|when\\)\\>") | |
890 (not (simula-context))) | |
891 () ;; found match | |
892 (error "No matching FOR, WHILE or INSPECT for DO, or misplaced ';'"))) | |
893 | |
894 | |
895 (defun simula-inside-parens () | |
896 "Return position after '(' on line if inside parentheses, nil otherwise." | |
897 (save-excursion | |
898 (let ((parlevel 0)) | |
899 (catch 'simula-out | |
900 (while t | |
901 (if (re-search-backward "(\\|)\\|;" nil t) | |
902 (if (eq (simula-context) nil) | |
903 ;; found something - check it out | |
904 (cond | |
905 ((eq (following-char) ?\;) | |
906 (if (zerop parlevel) | |
907 (throw 'simula-out nil) | |
908 (error "Parethesis mismatch or misplaced ';'"))) | |
909 ((eq (following-char) ?\() | |
910 (if (zerop parlevel) | |
911 (throw 'simula-out (1+ (current-column))) | |
912 (setq parlevel (1- parlevel)))) | |
913 (t (setq parlevel (1+ parlevel)))) | |
914 );; nothing - inside comment or string | |
915 ;; search failed | |
916 (throw 'simula-out nil))))))) | |
917 | |
918 | |
919 (defun simula-goto-definition () | |
920 "Goto point of definition of variable, procedure or class." | |
921 (interactive)) | |
922 | |
923 | |
924 (defun simula-expand-stdproc () | |
925 (if (or (not simula-abbrev-stdproc) (simula-context)) | |
926 (unexpand-abbrev) | |
927 (cond | |
928 ((eq simula-abbrev-stdproc 'upcase) (upcase-word -1)) | |
929 ((eq simula-abbrev-stdproc 'downcase) (downcase-word -1)) | |
930 ((eq simula-abbrev-stdproc 'capitalize) (capitalize-word -1))))) | |
931 | |
932 | |
933 (defun simula-expand-keyword () | |
934 (if (or (not simula-abbrev-keyword) (simula-context)) | |
935 (unexpand-abbrev) | |
936 (cond | |
937 ((eq simula-abbrev-keyword 'upcase) (upcase-word -1)) | |
938 ((eq simula-abbrev-keyword 'downcase) (downcase-word -1)) | |
939 ((eq simula-abbrev-keyword 'capitalize) (capitalize-word -1))))) | |
940 | |
941 | |
942 (defun simula-electric-keyword () | |
943 "Expand SIMULA keyword. If it starts the line, reindent." | |
944 ;; redisplay | |
945 (let ((show-char (eq this-command 'self-insert-command))) | |
946 ;; If the abbrev expansion results in reindention, the user may have | |
947 ;; to wait some time before the character he typed is displayed | |
948 ;; (the char causing the expansion is inserted AFTER the hook function | |
949 ;; is called). This is annoying in case of normal characters. | |
950 ;; However, if the user pressed a key bound to newline, it is better | |
951 ;; to have the line inserted after the begin-end match. | |
952 (if show-char | |
953 (progn | |
954 (insert-char last-command-char 1) | |
955 (sit-for 0) | |
956 (backward-char 1))) | |
957 (if (let ((where (simula-context)) | |
958 (case-fold-search t)) | |
959 (if where | |
960 (if (and (eq where 2) (eq (char-syntax (preceding-char)) ?w)) | |
961 (save-excursion | |
962 (backward-word 1) | |
963 (not (looking-at "end\\>")))))) | |
964 (unexpand-abbrev) | |
965 (cond | |
966 ((not simula-abbrev-keyword) (unexpand-abbrev)) | |
967 ((eq simula-abbrev-keyword 'upcase) (upcase-word -1)) | |
968 ((eq simula-abbrev-keyword 'downcase) (downcase-word -1)) | |
969 ((eq simula-abbrev-keyword 'capitalize) (capitalize-word -1))) | |
970 (let ((pos (- (point-max) (point))) | |
971 (case-fold-search t) | |
972 null) | |
973 (condition-case null | |
974 (progn | |
975 ;; check if the expanded word is on the beginning of the line. | |
976 (if (and (eq (char-syntax (preceding-char)) ?w) | |
977 (progn | |
978 (backward-word 1) | |
979 (if (looking-at "end\\>") | |
980 (save-excursion | |
981 (simula-backward-up-level 1) | |
982 (if (pos-visible-in-window-p) | |
983 (sit-for 1) | |
984 (message | |
985 (concat "Matches " | |
986 (buffer-substring | |
987 (point) | |
988 (+ (point) (window-width)))))))) | |
989 (skip-chars-backward " \t\f") | |
990 (bolp))) | |
991 (let ((indent (simula-calculate-indent))) | |
992 (if (eq indent (current-indentation)) | |
993 () | |
994 (delete-horizontal-space) | |
995 (indent-to indent))) | |
996 (skip-chars-forward " \t\f")) | |
997 ;; check for END - blow whistles and ring bells | |
998 | |
999 (goto-char (- (point-max) pos)) | |
1000 (if show-char | |
1001 (delete-char 1))) | |
1002 (quit (goto-char (- (point-max) pos)))))))) | |
1003 | |
1004 | |
1005 (defun simula-search-backward (string &optional limit move) | |
1006 (setq string (concat string "\\|\\<end\\>")) | |
1007 (let (level) | |
1008 (catch 'simula-out | |
1009 (while (re-search-backward string limit move) | |
1010 (if (simula-context) | |
1011 () | |
1012 (if (looking-at "\\<end\\>") | |
1013 (progn | |
1014 (setq level 0) | |
1015 (while (natnump level) | |
1016 (re-search-backward "\\<begin\\>\\|\\<end\\>") | |
1017 (if (simula-context) | |
1018 () | |
1019 (setq level (if (memq (following-char) '(?b ?B)) | |
1020 (1- level) | |
1021 (1+ level)))))) | |
1022 (throw 'simula-out t))))))) | |
1023 | |
1024 | |
1025 (defun simula-search-forward (string &optional limit move) | |
1026 (setq string (concat string "\\|\\<begin\\>")) | |
1027 (let (level) | |
1028 (catch 'exit | |
1029 (while (re-search-forward string limit move) | |
1030 (goto-char (match-beginning 0)) | |
1031 (if (simula-context) | |
1032 (goto-char (1- (match-end 0))) | |
1033 (if (looking-at "\\<begin\\>") | |
1034 (progn | |
1035 (goto-char (1- (match-end 0))) | |
1036 (setq level 0) | |
1037 (while (natnump level) | |
1038 (re-search-forward "\\<begin\\>\\|\\<end\\>") | |
1039 (backward-word 1) | |
1040 (if (not (simula-context)) | |
1041 (setq level (if (memq (following-char) '(?e ?E)) | |
1042 (1- level) | |
1043 (1+ level)))) | |
1044 (backward-word -1))) | |
1045 (goto-char (1- (match-end 0))) | |
1046 (throw 'exit t))))))) | |
1047 | |
1048 | |
1049 (defun simula-install-standard-abbrevs () | |
1050 "Define Simula keywords, standard procedures and classes in | |
1051 local abbrev table." | |
1052 ;; procedure and class names are as of the SIMULA 87 standard. | |
1053 (interactive) | |
1054 (mapcar (function (lambda (args) | |
1055 (apply 'define-abbrev simula-mode-abbrev-table args))) | |
1056 '(("abs" "Abs" simula-expand-stdproc) | |
1057 ("accum" "Accum" simula-expand-stdproc) | |
1058 ("activate" "ACTIVATE" simula-expand-keyword) | |
1059 ("addepsilon" "AddEpsilon" simula-expand-stdproc) | |
1060 ("after" "AFTER" simula-expand-keyword) | |
1061 ("and" "AND" simula-expand-keyword) | |
1062 ("arccos" "ArcCos" simula-expand-stdproc) | |
1063 ("arcsin" "ArcSin" simula-expand-stdproc) | |
1064 ("arctan" "ArcTan" simula-expand-stdproc) | |
1065 ("arctan2" "ArcTan2" simula-expand-stdproc) | |
1066 ("array" "ARRAY" simula-expand-keyword) | |
1067 ("at" "AT" simula-expand-keyword) | |
1068 ("before" "BEFORE" simula-expand-keyword) | |
1069 ("begin" "BEGIN" simula-expand-keyword) | |
1070 ("blanks" "Blanks" simula-expand-stdproc) | |
1071 ("boolean" "BOOLEAN" simula-expand-keyword) | |
1072 ("breakoutimage" "BreakOutImage" simula-expand-stdproc) | |
1073 ("bytefile" "ByteFile" simula-expand-stdproc) | |
1074 ("call" "Call" simula-expand-stdproc) | |
1075 ("cancel" "Cancel" simula-expand-stdproc) | |
1076 ("cardinal" "Cardinal" simula-expand-stdproc) | |
1077 ("char" "Char" simula-expand-stdproc) | |
1078 ("character" "CHARACTER" simula-expand-keyword) | |
1079 ("checkpoint" "CheckPoint" simula-expand-stdproc) | |
1080 ("class" "CLASS" simula-expand-keyword) | |
1081 ("clear" "Clear" simula-expand-stdproc) | |
1082 ("clocktime" "ClockTime" simula-expand-stdproc) | |
1083 ("close" "Close" simula-expand-stdproc) | |
1084 ("comment" "COMMENT" simula-expand-keyword) | |
1085 ("constant" "Constant" simula-expand-stdproc) | |
1086 ("copy" "Copy" simula-expand-stdproc) | |
1087 ("cos" "Cos" simula-expand-stdproc) | |
1088 ("cosh" "CosH" simula-expand-stdproc) | |
1089 ("cotan" "CoTan" simula-expand-stdproc) | |
1090 ("cputime" "CpuTime" simula-expand-stdproc) | |
1091 ("current" "Current" simula-expand-stdproc) | |
1092 ("datetime" "DateTime" simula-expand-stdproc) | |
1093 ("decimalmark" "DecimalMark" simula-expand-stdproc) | |
1094 ("delay" "DELAY" simula-expand-keyword) | |
1095 ("deleteimage" "DeleteImage" simula-expand-stdproc) | |
1096 ("detach" "Detach" simula-expand-stdproc) | |
1097 ("digit" "Digit" simula-expand-stdproc) | |
1098 ("directbytefile" "DirectByteFile" simula-expand-stdproc) | |
1099 ("directfile" "DirectFile" simula-expand-stdproc) | |
1100 ("discrete" "Discrete" simula-expand-stdproc) | |
1101 ("do" "DO" simula-expand-keyword) | |
1102 ("downcase" "Downcase" simula-expand-stdproc) | |
1103 ("draw" "Draw" simula-expand-stdproc) | |
1104 ("eject" "Eject" simula-expand-stdproc) | |
1105 ("else" "ELSE" simula-electric-keyword) | |
1106 ("empty" "Empty" simula-expand-stdproc) | |
1107 ("end" "END" simula-electric-keyword) | |
1108 ("endfile" "Endfile" simula-expand-stdproc) | |
1109 ("entier" "Entier" simula-expand-stdproc) | |
1110 ("eq" "EQ" simula-expand-keyword) | |
1111 ("eqv" "EQV" simula-expand-keyword) | |
1112 ("erlang" "Erlang" simula-expand-stdproc) | |
1113 ("error" "Error" simula-expand-stdproc) | |
1114 ("evtime" "EvTime" simula-expand-stdproc) | |
1115 ("exp" "Exp" simula-expand-stdproc) | |
1116 ("external" "EXTERNAL" simula-expand-keyword) | |
1117 ("false" "FALSE" simula-expand-keyword) | |
1118 ("field" "Field" simula-expand-stdproc) | |
1119 ("file" "File" simula-expand-stdproc) | |
1120 ("first" "First" simula-expand-stdproc) | |
1121 ("follow" "Follow" simula-expand-stdproc) | |
1122 ("for" "FOR" simula-expand-keyword) | |
1123 ("ge" "GE" simula-expand-keyword) | |
1124 ("getchar" "GetChar" simula-expand-stdproc) | |
1125 ("getfrac" "GetFrac" simula-expand-stdproc) | |
1126 ("getint" "GetInt" simula-expand-stdproc) | |
1127 ("getreal" "GetReal" simula-expand-stdproc) | |
1128 ("go" "GO" simula-expand-keyword) | |
1129 ("goto" "GOTO" simula-expand-keyword) | |
1130 ("gt" "GT" simula-expand-keyword) | |
1131 ("head" "Head" simula-expand-stdproc) | |
1132 ("hidden" "HIDDEN" simula-expand-keyword) | |
1133 ("histd" "HistD" simula-expand-stdproc) | |
1134 ("histo" "Histo" simula-expand-stdproc) | |
1135 ("hold" "Hold" simula-expand-stdproc) | |
1136 ("idle" "Idle" simula-expand-stdproc) | |
1137 ("if" "IF" simula-expand-keyword) | |
1138 ("image" "Image" simula-expand-stdproc) | |
1139 ("imagefile" "ImageFile" simula-expand-stdproc) | |
1140 ("imp" "IMP" simula-expand-keyword) | |
1141 ("in" "IN" simula-expand-keyword) | |
1142 ("inbyte" "InByte" simula-expand-stdproc) | |
1143 ("inbytefile" "InByteFile" simula-expand-stdproc) | |
1144 ("inchar" "InChar" simula-expand-stdproc) | |
1145 ("infile" "InFile" simula-expand-stdproc) | |
1146 ("infrac" "InFrac" simula-expand-stdproc) | |
1147 ("inimage" "InImage" simula-expand-stdproc) | |
1148 ("inint" "InInt" simula-expand-stdproc) | |
1149 ("inner" "INNER" simula-expand-keyword) | |
1150 ("inreal" "InReal" simula-expand-stdproc) | |
1151 ("inrecord" "InRecord" simula-expand-stdproc) | |
1152 ("inspect" "INSPECT" simula-expand-keyword) | |
1153 ("integer" "INTEGER" simula-expand-keyword) | |
1154 ("intext" "InText" simula-expand-stdproc) | |
1155 ("into" "Into" simula-expand-stdproc) | |
1156 ("is" "IS" simula-expand-keyword) | |
1157 ("isochar" "ISOChar" simula-expand-stdproc) | |
1158 ("isopen" "IsOpen" simula-expand-stdproc) | |
1159 ("isorank" "ISORank" simula-expand-stdproc) | |
1160 ("label" "LABEL" simula-expand-keyword) | |
1161 ("last" "Last" simula-expand-stdproc) | |
1162 ("lastitem" "LastItem" simula-expand-stdproc) | |
1163 ("lastloc" "LastLoc" simula-expand-stdproc) | |
1164 ("le" "LE" simula-expand-keyword) | |
1165 ("length" "Length" simula-expand-stdproc) | |
1166 ("letter" "Letter" simula-expand-stdproc) | |
1167 ("line" "Line" simula-expand-stdproc) | |
1168 ("linear" "Linear" simula-expand-stdproc) | |
1169 ("linesperpage" "LinesPerPage" simula-expand-stdproc) | |
1170 ("link" "Link" simula-expand-stdproc) | |
1171 ("linkage" "Linkage" simula-expand-stdproc) | |
1172 ("ln" "Ln" simula-expand-stdproc) | |
1173 ("locate" "Locate" simula-expand-stdproc) | |
1174 ("location" "Location" simula-expand-stdproc) | |
1175 ("lock" "Lock" simula-expand-stdproc) | |
1176 ("locked" "Locked" simula-expand-stdproc) | |
1177 ("log10" "Log10" simula-expand-stdproc) | |
1178 ("long" "LONG" simula-expand-keyword) | |
1179 ("lowcase" "LowCase" simula-expand-stdproc) | |
1180 ("lowerbound" "LowerBound" simula-expand-stdproc) | |
1181 ("lowten" "LowTen" simula-expand-stdproc) | |
1182 ("lt" "LT" simula-expand-keyword) | |
1183 ("main" "Main" simula-expand-stdproc) | |
1184 ("max" "Max" simula-expand-stdproc) | |
1185 ("maxint" "MaxInt" simula-expand-stdproc) | |
1186 ("maxlongreal" "MaxLongReal" simula-expand-stdproc) | |
1187 ("maxloc" "MaxLoc" simula-expand-stdproc) | |
1188 ("maxrank" "MaxRank" simula-expand-stdproc) | |
1189 ("maxreal" "MaxReal" simula-expand-stdproc) | |
1190 ("min" "Min" simula-expand-stdproc) | |
1191 ("minint" "MinInt" simula-expand-stdproc) | |
1192 ("minlongreal" "MinLongReal" simula-expand-stdproc) | |
1193 ("minrank" "MinRank" simula-expand-stdproc) | |
1194 ("minreal" "MinReal" simula-expand-stdproc) | |
1195 ("mod" "Mod" simula-expand-stdproc) | |
1196 ("more" "More" simula-expand-stdproc) | |
1197 ("name" "NAME" simula-expand-keyword) | |
1198 ("ne" "NE" simula-expand-keyword) | |
1199 ("negexp" "NegExp" simula-expand-stdproc) | |
1200 ("new" "NEW" simula-expand-keyword) | |
1201 ("nextev" "NextEv" simula-expand-stdproc) | |
1202 ("none" "NONE" simula-expand-keyword) | |
1203 ("normal" "Normal" simula-expand-stdproc) | |
1204 ("not" "NOT" simula-expand-keyword) | |
1205 ("notext" "NOTEXT" simula-expand-keyword) | |
1206 ("open" "Open" simula-expand-stdproc) | |
1207 ("or" "OR" simula-expand-keyword) | |
1208 ("otherwise" "OTHERWISE" simula-electric-keyword) | |
1209 ("out" "Out" simula-expand-stdproc) | |
1210 ("outbyte" "OutByte" simula-expand-stdproc) | |
1211 ("outbytefile" "OutByteFile" simula-expand-stdproc) | |
1212 ("outchar" "OutChar" simula-expand-stdproc) | |
1213 ("outfile" "OutFile" simula-expand-stdproc) | |
1214 ("outfix" "OutFix" simula-expand-stdproc) | |
1215 ("outfrac" "OutFrac" simula-expand-stdproc) | |
1216 ("outimage" "OutImage" simula-expand-stdproc) | |
1217 ("outint" "OutInt" simula-expand-stdproc) | |
1218 ("outreal" "OutReal" simula-expand-stdproc) | |
1219 ("outrecord" "OutRecord" simula-expand-stdproc) | |
1220 ("outtext" "OutText" simula-expand-stdproc) | |
1221 ("page" "Page" simula-expand-stdproc) | |
1222 ("passivate" "Passivate" simula-expand-stdproc) | |
1223 ("poisson" "Poisson" simula-expand-stdproc) | |
1224 ("pos" "Pos" simula-expand-stdproc) | |
1225 ("precede" "Precede" simula-expand-stdproc) | |
1226 ("pred" "Pred" simula-expand-stdproc) | |
1227 ("prev" "Prev" simula-expand-stdproc) | |
1228 ("printfile" "PrintFile" simula-expand-stdproc) | |
1229 ("prior" "PRIOR" simula-expand-keyword) | |
1230 ("procedure" "PROCEDURE" simula-expand-keyword) | |
1231 ("process" "Process" simula-expand-stdproc) | |
1232 ("protected" "PROTECTED" simula-expand-keyword) | |
1233 ("putchar" "PutChar" simula-expand-stdproc) | |
1234 ("putfix" "PutFix" simula-expand-stdproc) | |
1235 ("putfrac" "PutFrac" simula-expand-stdproc) | |
1236 ("putint" "PutInt" simula-expand-stdproc) | |
1237 ("putreal" "PutReal" simula-expand-stdproc) | |
1238 ("qua" "QUA" simula-expand-keyword) | |
1239 ("randint" "RandInt" simula-expand-stdproc) | |
1240 ("rank" "Rank" simula-expand-stdproc) | |
1241 ("reactivate" "REACTIVATE" simula-expand-keyword) | |
1242 ("real" "REAL" simula-expand-keyword) | |
1243 ("ref" "REF" simula-expand-keyword) | |
1244 ("resume" "Resume" simula-expand-stdproc) | |
1245 ("setaccess" "SetAccess" simula-expand-stdproc) | |
1246 ("setpos" "SetPos" simula-expand-stdproc) | |
1247 ("short" "SHORT" simula-expand-keyword) | |
1248 ("sign" "Sign" simula-expand-stdproc) | |
1249 ("simset" "SimSet" simula-expand-stdproc) | |
1250 ("simulaid" "SimulaId" simula-expand-stdproc) | |
1251 ("simulation" "Simulation" simula-expand-stdproc) | |
1252 ("sin" "Sin" simula-expand-stdproc) | |
1253 ("sinh" "SinH" simula-expand-stdproc) | |
1254 ("sourceline" "SourceLine" simula-expand-stdproc) | |
1255 ("spacing" "Spacing" simula-expand-stdproc) | |
1256 ("sqrt" "Sqrt" simula-expand-stdproc) | |
1257 ("start" "Start" simula-expand-stdproc) | |
1258 ("step" "STEP" simula-expand-keyword) | |
1259 ("strip" "Strip" simula-expand-stdproc) | |
1260 ("sub" "Sub" simula-expand-stdproc) | |
1261 ("subepsilon" "SubEpsilon" simula-expand-stdproc) | |
1262 ("suc" "Suc" simula-expand-stdproc) | |
1263 ("switch" "SWITCH" simula-expand-keyword) | |
1264 ("sysin" "SysIn" simula-expand-stdproc) | |
1265 ("sysout" "SysOut" simula-expand-stdproc) | |
1266 ("tan" "Tan" simula-expand-stdproc) | |
1267 ("tanh" "TanH" simula-expand-stdproc) | |
1268 ("terminate_program" "Terminate_Program" simula-expand-stdproc) | |
1269 ("terminated" "Terminated" simula-expand-stdproc) | |
1270 ("text" "TEXT" simula-expand-keyword) | |
1271 ("then" "THEN" simula-electric-keyword) | |
1272 ("this" "THIS" simula-expand-keyword) | |
1273 ("time" "Time" simula-expand-stdproc) | |
1274 ("to" "TO" simula-expand-keyword) | |
1275 ("true" "TRUE" simula-expand-keyword) | |
1276 ("uniform" "Uniform" simula-expand-stdproc) | |
1277 ("unlock" "Unlock" simula-expand-stdproc) | |
1278 ("until" "UNTIL" simula-expand-keyword) | |
1279 ("upcase" "Upcase" simula-expand-stdproc) | |
1280 ("upperbound" "UpperBound" simula-expand-stdproc) | |
1281 ("value" "VALUE" simula-expand-keyword) | |
1282 ("virtual" "VIRTUAL" simula-expand-keyword) | |
1283 ("wait" "Wait" simula-expand-stdproc) | |
1284 ("when" "WHEN" simula-electric-keyword) | |
1285 ("while" "WHILE" simula-expand-keyword)))) | |
1286 | |
1287 ;;; simula.el ends here |