mylisp-obsolete/iar-linker-config-mode.el
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 16 Jun 2021 12:50:08 +0300
changeset 1734 ae2c6a001464
parent 1718 9d72f4424570
permissions -rw-r--r--
Add some standard places to PATH if they are not set by login script. Rearrange the order of paths so system's are first, user's are last. For Cygwin this helps with Cygwin's paths to be situated before "C:/Windows" (Emacs is not started from a login shell on Windows!).

;;; iar-linker-config-mode.el --- major mode for highlighting IAR Embedded Workbench 5.x linker scripts

;;; Commentary:
;;
;; Very poor highlighting, not all syntax is covered.

;;; Code:

;;;###autoload
(define-generic-mode iar-linker-config-mode
  '("// " ("/*" . "*/"))
  '("zeroinit" "code" "readwrite" "rw" "readonly" "ro")
  '(
    ("\\(define +symbol\\) +\\([_a-zA-Z0-9]+\\) *= *\\(0x[0-9a-fA-F]+\\);"
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face)
     (3 font-lock-constant-face) )
    ("\\(define +memory\\) +\\([_a-zA-Z]+\\) +\\(with +size\\) = \\(0x[0-9a-fA-F]+\\|[0-9]+\\)[GMK]?;"
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face)
     (3 font-lock-keyword-face)
     (4 font-lock-constant-face) )
    ("\\([_a-zA-Z]+\\):\\[\\(from\\) +\\([_a-zA-Z0-9]+\\) +\\(to\\|size\\) +\\([_a-zA-Z0-9]+\\)\\]"
     (1 font-lock-variable-name-face)
     (2 font-lock-keyword-face)
     (3 font-lock-variable-name-face)
     (4 font-lock-keyword-face)
     (5 font-lock-variable-name-face) )
    ("\\(define +region\\) +\\([_a-zA-Z]+\\) *="
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face) )
    ("\\(define +block\\) +\\([_a-zA-Z]+\\) +\\(with +alignment\\) *= *[0-9]+, *\\(size\\) *= *\\([_a-zA-Z]+\\).*;"
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face)
     (3 font-lock-keyword-face)
     (4 font-lock-keyword-face)
     (5 font-lock-variable-name-face) )
    ("\\(do +not +initialize\\) *{"
     (1 font-lock-keyword-face) )
    ("\\(place +in\\) +\\([_a-zA-Z]+\\) *{"
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face) )
    ("\\(place +at +address\\) +\\([_a-zA-Z]+\\):\\([_a-zA-Z]+\\) *{"
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face)
     (3 font-lock-variable-name-face) )
    ("\\(initialize by copy\\) *{"
     (1 font-lock-keyword-face) )
    ("\\(block\\|section\\) +\\([_.a-zA-Z0-9]+\\)"
     (1 font-lock-keyword-face)
     (2 font-lock-variable-name-face) )
    )
  (list "\\.\\(icf\\)\\'")
  (list
   (lambda () (setq comment-start "/* " comment-end " */"))
   )
  "Generic mode for iar linker config files.")

(provide 'iar-linker-config-mode)

;;; iar-linker-config-mode.el ends here