casl-mode.el revision f5c7d6d3f873962ccbe63276243e88030ce8801d
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;;;###autoload
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk(autoload 'turn-on-casl-indent "casl-indent" "Turn on CASL indentation." t)
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;;;;;;;;;;;;;;;;;;;;;;;;;;
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;; Copyright: (c) Heng Jiang, Klaus L�ttich, Uni Bremen 2007
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;; License: LGPL, see LICENSE.txt or LIZENZ.txt
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;; Contact: hets-users@informatik.uni-bremen.de
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;;;;;;;;;;;;;;;;;;;;;;;;;;
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;; Version number
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk "Version of CASL-Mode")
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk "Major mode for editing (heterogeneous) CASL specifications."
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk(defvar casl-mode-map (let ((keymap (make-keymap)))
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk (define-key keymap "\C-c\C-g" 'casl-run-hets-g))
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk (define-key keymap "\C-c\C-n" 'casl-compile-goto-next-error)
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk "Keymap for CASL major mode")
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;; Are we running FSF Emacs or XEmacs?
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk "non-nil if we are running XEmacs, nil otherwise.")
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;; ====================== S Y N T A X T A B L E ==================
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;; Syntax table for CASL major mode
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk "Syntax table for CASL mode.")
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk ;; Indicate that underscore may be part of a word
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk ;; Some of these are actually OK by default.
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk "!#$&*+.,/\\\\:<=>?@^|~")
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk ;; commenting-out plus including other kinds of comment
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;; Various mode variables.
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk (setq comment-start-skip "%[{[]") ;; %[%{[]() *")
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk (setq comment-indent-function 'casl-comment-indent)
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk (set (make-local-variable 'comment-end-skip) "[\]}]%")
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;; Find the indentation level for a comment.
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk ;; if the line is blank, put the comment at the beginning,
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk ;; else at comment-column
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk (if (bolp) 0 (max (1+ (current-column)) comment-column)))
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk;; ============= K E Y W O R D H I G H L I G H T I N G ============
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk(defvar casl-black-komma-face 'casl-black-komma-face
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk "Face name to use for black komma.")
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk(defvar casl-annotation-face 'casl-annotation-face
7d602f039beb26151cdc6306cfd3952b98bdc424jeff.schenk "CASL mode face for Annotations")
(list
(list
(list
'("\\(\\<\\|\\s-+\\)\\(/\\\\\\|\\\\/\\|=>\\|<=>\\|and\\|arch\\|assoc\\|behaviourally\\|closed\\|comm\\|else\\|end\\|exists\\|fit\\|forall\\|free\\|generated\\|given\\|hide\\|idem\\|if\\|local\\|not\\|refined\\|refinement\\|reveal\\|spec\\|then\\|to\\|unit\\|via\\|view\\|when\\|within\\|with\\|\\(\\(op\\|pred\\|var\\|type\\|sort\\)s?\\)\\)[,;]?[ \t\n]"
'("\\(\\<\\|\\[\\)\\(spec\\|view\\)\\s-+\\(\\w+\\)[ \t]*\\(\\[\\s-*\\([A-Z]\\w*\\).*\\s-*\\]\\)?\\s-*.*\\([]=:]\\|::=\\)"
'("[ \t\n]*\\(\\sw+\\)[ \t\n]+to[ \t\n]+\\(\\(\\sw+\\)\\s-*\\(\\[\\([A-Z]\\sw*\\).*\\]\\)?[, \t]*\\)?"
'("\\<spec.+=\\s-*\\(%\\sw+\\s-*\\)?[ \t\n]*\\([A-Z]\\w*\\)\\s-*\\(\\[\\s-*\\([A-Z]\\w*\\).*\\s-*\\]\\)?"
'("\\(\\<\\|\\s-+\\)sorts?[ \t\n]+\\(\\(\\sw+\\s-*\\(\\[\\s-*\\(\\sw\\|,\\)+\\s-*\\]\\s-*\\)?\\(,\\(\\s-\\)*\\|$\\|<\\|;\\|=\\)\\(=\\|<\\|;\\|,\\)*[ \t\n]*\\)+\\)"
'("\\(\\(^[^.{%]\\)\\s-*\\|\\bops?\\b\\|\\bpreds?\\b\\|\\bvars?\\b\\)\\([^:{()\n]*\\)\\(\(.*\)\\)?:\\??[^?.:=%].*;?[ \t]*$"
'("[ \t\n]*\\(__[^|_]+__\\|[^[ \t\n]+\\)\\s-*\\(\\[\\([A-Z]\\w*\\).*\\]\\)?[ \t\n]*|->[ \t\n]*\\(__[^|_]+__\\|[^[ \t\n]+\\)\\s-*\\(\\[\\([A-Z]\\w*\\).*\\]\\)?[, \t]*"
'("\\(\\btype\\|\\bfree type\\)?\\s-+\\(\\sw+\\)\\s-+\\(\\sw*\\|\\[\\(\\s-*\\sw+\\s-*\\)\\]\\)[ \t\n]*::?=[ \t\n]*\\(\\(\_\_[^_]+\_\_\\|[^|][^(|]+\\)\\s-*\\(\(.*\)\\)?\\)"
(list '("\\(\\(\"\\|^>[ \t]*\\\\\\)\\([^\"\\\\\n]\\|\\\\.\\)*\\(\"\\|\\\\[ \t]*$\\)\\|'\\([^'\\\\\n]\\|\\\\.[^'\n]*\\)'\\)"
(defvar hets-program nil)
(defvar old-buffer nil)
(defvar casl-hets-options nil
(save-buffer nil)
(if hets-program
(if opt
(set-buffer-modified-p nil)
(let* ((process-environment
(window-width))))
hets-command)))
(if opt
(defun casl-run-hets-g ()
msg)
(let ((buffer-read-only nil)
(if (bolp)
(defun casl-parse-error ()
(if (not (or (looking-at "Fail") (and (looking-at "\\*\\*\\*") (looking-at "[0-9]+\\.[0-9]+-[0-9]+\\.[0-9]*"))))
(re-search-forward ":\\([0-9]+\\)\\.\\([0-9]+\\)\\(-[0-9]+\\.[0-9]*\\)?[:,]" (save-excursion (end-of-line) (point)) t 1)
(defun casl-compile-goto-next-error ()
;; (message "DEBUG<Goto Error>: file: %s, line: %s, column: %s" error-file-name error-line error-column)
(defun casl-mode ()
;; Support for compile.el
(lambda()