iar-linker-config-mode.el
changeset 1662 f697f2772ec9
parent 1661 e4711ae3529f
child 1663 a0494ee73d5f
equal deleted inserted replaced
1661:e4711ae3529f 1662:f697f2772ec9
     1 ;;; iar-linker-config-mode.el --- major mode for highlighting IAR Embedded Workbench 5.x linker scripts
       
     2 
       
     3 ;; Copyright (C) 2009, 2010 by Oleksandr Gavenko <gavenkoa@gmail.com>
       
     4 
       
     5 ;; You can do anything with this file without any warranty.
       
     6 
       
     7 ;; Author: Oleksandr Gavenko <gavenkoa@gmail.com>
       
     8 ;; Maintainer: Oleksandr Gavenko <gavenkoa@gmail.com>
       
     9 ;; Created: 2009-11-08
       
    10 ;; Version: 0.1
       
    11 ;; Keywords: languages
       
    12 
       
    13 ;;; Commentary:
       
    14 ;;
       
    15 ;; Very pure highlighting and not all available syntax.
       
    16 
       
    17 ;;; Code:
       
    18 
       
    19 ;;;###autoload
       
    20 (define-generic-mode iar-linker-config-mode
       
    21   '("// " ("/*" . "*/"))
       
    22   '("zeroinit" "code" "readwrite" "rw" "readonly" "ro")
       
    23   '(
       
    24     ("\\(define +symbol\\) +\\([_a-zA-Z0-9]+\\) *= *\\(0x[0-9a-fA-F]+\\);"
       
    25      (1 font-lock-keyword-face)
       
    26      (2 font-lock-variable-name-face)
       
    27      (3 font-lock-constant-face) )
       
    28     ("\\(define +memory\\) +\\([_a-zA-Z]+\\) +\\(with +size\\) = \\(0x[0-9a-fA-F]+\\|[0-9]+\\)[GMK]?;"
       
    29      (1 font-lock-keyword-face)
       
    30      (2 font-lock-variable-name-face)
       
    31      (3 font-lock-keyword-face)
       
    32      (4 font-lock-constant-face) )
       
    33     ("\\([_a-zA-Z]+\\):\\[\\(from\\) +\\([_a-zA-Z0-9]+\\) +\\(to\\|size\\) +\\([_a-zA-Z0-9]+\\)\\]"
       
    34      (1 font-lock-variable-name-face)
       
    35      (2 font-lock-keyword-face)
       
    36      (3 font-lock-variable-name-face)
       
    37      (4 font-lock-keyword-face)
       
    38      (5 font-lock-variable-name-face) )
       
    39     ("\\(define +region\\) +\\([_a-zA-Z]+\\) *="
       
    40      (1 font-lock-keyword-face)
       
    41      (2 font-lock-variable-name-face) )
       
    42     ("\\(define +block\\) +\\([_a-zA-Z]+\\) +\\(with +alignment\\) *= *[0-9]+, *\\(size\\) *= *\\([_a-zA-Z]+\\).*;"
       
    43      (1 font-lock-keyword-face)
       
    44      (2 font-lock-variable-name-face)
       
    45      (3 font-lock-keyword-face)
       
    46      (4 font-lock-keyword-face)
       
    47      (5 font-lock-variable-name-face) )
       
    48     ("\\(do +not +initialize\\) *{"
       
    49      (1 font-lock-keyword-face) )
       
    50     ("\\(place +in\\) +\\([_a-zA-Z]+\\) *{"
       
    51      (1 font-lock-keyword-face)
       
    52      (2 font-lock-variable-name-face) )
       
    53     ("\\(place +at +address\\) +\\([_a-zA-Z]+\\):\\([_a-zA-Z]+\\) *{"
       
    54      (1 font-lock-keyword-face)
       
    55      (2 font-lock-variable-name-face)
       
    56      (3 font-lock-variable-name-face) )
       
    57     ("\\(initialize by copy\\) *{"
       
    58      (1 font-lock-keyword-face) )
       
    59     ("\\(block\\|section\\) +\\([_.a-zA-Z0-9]+\\)"
       
    60      (1 font-lock-keyword-face)
       
    61      (2 font-lock-variable-name-face) )
       
    62     )
       
    63   (list "\\.\\(icf\\)\\'")
       
    64   (list
       
    65    (lambda () (setq comment-start "/* " comment-end " */"))
       
    66    )
       
    67   "Generic mode for iar linker config files.")
       
    68 
       
    69 (provide 'iar-linker-config-mode)
       
    70 
       
    71 ;;; iar-linker-config-mode.el ends here