lisp/iar4-linker-config-mode.el
changeset 270 61173396cfe4
parent 264 14b612ad9ec1
child 274 7c18567f0754
equal deleted inserted replaced
269:81c80df45b37 270:61173396cfe4
       
     1 ;;; iar-linker-config-mode.el --- major mode for highlighting IAR Embedded Workbench 4.x linker scripts
       
     2 
       
     3 ;; Copyright (C) 2009, 2010 by Oleksandr Gavenko <gavenkoa@gmail.com>
       
     4 
       
     5 ;; Author: Oleksandr Gavenko <gavenkoa@gmail.com>
       
     6 ;; Maintainer: Oleksandr Gavenko <gavenkoa@gmail.com>
       
     7 ;; Created: 2009-11-04
       
     8 ;; Version: 0.1
       
     9 ;; Keywords: languages
       
    10 
       
    11 ;;; Commentary:
       
    12 ;;
       
    13 ;; Very pure highlighting and not all available syntax.
       
    14 
       
    15 ;;; Code:
       
    16 
       
    17 (define-generic-mode iar4-linker-config-mode
       
    18   '("// " ("/*" . "*/"))
       
    19   nil
       
    20   '(
       
    21     ("^\\(-c\\)\\([_a-zA-Z]+\\)"
       
    22      (1 font-lock-keyword-face)
       
    23      (2 font-lock-variable-name-face) )
       
    24     ("^\\(-D\\)\\([_a-zA-Z0-9]+\\)=\\(\\(0x\\)?[0-9a-fA-F]+\\|.[0-9]+\\)"
       
    25      (1 font-lock-keyword-face)
       
    26      (2 font-lock-variable-name-face)
       
    27      (3 font-lock-constant-face) )
       
    28     ("^\\(-Q\\)\\([_a-zA-Z]+\\)=\\([_a-zA-Z]+\\)"
       
    29      (1 font-lock-keyword-face)
       
    30      (2 font-lock-variable-name-face)
       
    31      (3 font-lock-variable-name-face) )
       
    32     ("^\\(-Z\\|-P\\|-b\\)(\\([_a-zA-Z]+\\))\\([_a-zA-Z]+\\)="
       
    33      (1 font-lock-keyword-face)
       
    34      (2 font-lock-variable-name-face)
       
    35      (3 font-lock-variable-name-face) )
       
    36     ("^\\(-Z\\|-P\\|-b\\)(\\([_a-zA-Z]+\\))\\([_a-zA-Z]+\\)\\+\\([_a-zA-Z]+\\)="
       
    37      (1 font-lock-keyword-face)
       
    38      (2 font-lock-variable-name-face)
       
    39      (3 font-lock-variable-name-face)
       
    40      (4 font-lock-variable-name-face) )
       
    41     )
       
    42   (list "\\.\\(xcl\\)\\'")
       
    43   (list
       
    44    (lambda () (setq comment-start "// " comment-end ""))
       
    45    )
       
    46   "Generic mode for iar linker config files.")
       
    47 
       
    48 (provide 'iar4-linker-config-mode)
       
    49 
       
    50 ;;; iar4-linker-config-mode.el ends here