iar-linker-config-mode.el
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 07 Mar 2010 10:58:13 +0200
changeset 323 7a7dc2befa99
parent 318 6a430707c23e
permissions -rw-r--r--
Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet repository tree. So it must be installed manually. My usually configuration install user local software into ~/usr DISTDIR.

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

;; Copyright (C) 2009, 2010 by Oleksandr Gavenko <gavenkoa@gmail.com>

;; You can do anything with this file without any warranty.

;; Author: Oleksandr Gavenko <gavenkoa@gmail.com>
;; Maintainer: Oleksandr Gavenko <gavenkoa@gmail.com>
;; Created: 2009-11-08
;; Version: 0.1
;; Keywords: languages

;;; Commentary:
;;
;; Very pure highlighting and not all available syntax.

;;; 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