casl-mode.el revision f5ca7e49a6d1602c3f3a12ea6723fa67fea5757a
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose;;;###autoload
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose(autoload 'turn-on-casl-indent "casl-indent" "Turn on CASL indentation." t)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose;; Version number
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose "Version of CASL-Mode")
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose "Major mode for editing (heterogeneous) CASL programs."
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose(defvar casl-mode-map (let ((keymap (make-keymap)))
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose (define-key keymap "\C-c\C-n" 'casl-compile-goto-next-error)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose "Keymap for CASL major mode")
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose;; Are we running FSF Emacs or XEmacs?
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose "non-nil if we are running XEmacs, nil otherwise.")
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose;; ============= K E Y W O R D H I G H L I G H T I N G ============
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose(defvar casl-black-komma-face 'casl-black-komma-face
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose "Face name to use for black komma.")
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose(defvar casl-annotation-face 'casl-annotation-face
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose "CASL mode face for Annotations")
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose(setq casl-annotation-face 'font-lock-constant-face)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose(defvar casl-library-name-face 'casl-library-name-face)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose(setq casl-library-name-face 'font-lock-type-face)
(list
;; '("\\(\\<\\|\\s-+\\)\\(%authors\\|%date\\|%display\\|%prec\\|%left_assoc\\|%number\\|%floating\\|%LATEX\\|%implies\\)[ :\t\n]+"
'("\\(\\<\\|\\[\\)\\(spec\\|view\\)\\s-+\\(\\w+\\)[ \t]*\\(\\[\\([A-Z]\\w*\\).*\\]\\)?\\s-*.*\\([]=:]\\|::=\\)"
'("\\(\\<\\|\\s-+\\)sorts?[ \t]+\\(\\(\\sw+\\s-*\\(\\[\\(\\sw\\|,\\)+\\]\\s-*\\)?\\(,\\(\\s-\\)*\\|$\\|<\\|;\\|=\\)\\(\\sw\\|=\\|<\\|;\\|,\\)*[ \t\n]*\\)+\\)"
'("\\(^\\|\\bops?\\|\\bpreds?\\|\\bvars?\\)\\s-+\\([^.]\\(,\\s-*\\)?\\(\\sw\\(,\\s-*\\)?\\|\\(\\s_\\|\\s_+::?\\s_+\\)\\(,\\s-*\\)?\\|\\s(\\|\\s)\\)*\\)\\s-*\\(\(.*\)\\)?\\s-*\\(:\\??\\|<=>\\)[^:\n]*;?[ \t]*$"
'("[ \t\n]*\\([^[ \t\n]+\\)\\s-*\\(\\[\\([A-Z]\\w*\\).*\\]\\)?[ \t\n]+|->[ \t\n]+\\([^[ \t\n]+\\)\\s-*\\(\\[\\([A-Z]\\w*\\).*\\]\\)?[, \t]*"
'("\\(\\<\\|\\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]"
(list '("\\(\\(\"\\|^>[ \t]*\\\\\\)\\([^\"\\\\\n]\\|\\\\.\\)*\\(\"\\|\\\\[ \t]*$\\)\\|'\\([^'\\\\\n]\\|\\\\.[^'\n]*\\)'\\)" (0 casl-string-char-face t t))
(list
(defvar casl-mode-syntax-table nil
(defun casl-vars ()
(defun casl-comment-indent ()
(defvar hets-program nil)
(defvar old-buffer nil)
(save-buffer nil)
(if hets-program
(if opt
(set-buffer-modified-p nil)
(let* ((process-environment
(window-width))))
hets-command)))
(defun casl-run-hets-g ()
msg)
(let ((buffer-read-only nil)
(if (bolp)
(defun casl-parse-error ()
(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()