template-pre/iar4-linker-config-mode.el
changeset 280 9250e3ad5f4a
parent 259 b6c514e81d2c
parent 279 fd6164dfec82
child 281 457b9057a35a
equal deleted inserted replaced
259:b6c514e81d2c 280:9250e3ad5f4a
     1 ;;; iar-linker-config-mode.el --- major mode for highlighting IAR Embedded Workbench 4.x linker scripts
       
     2 
       
     3 ;; DO NOT EDIT COMMENT! TAG: iar4-linker-config-mode
       
     4 
       
     5 ;; Copyright (C) 2009, 2010 by Oleksandr Gavenko <gavenkoa@gmail.com>
       
     6 
       
     7 ;; Author: Oleksandr Gavenko <gavenkoa@gmail.com>
       
     8 ;; Maintainer: Oleksandr Gavenko <gavenkoa@gmail.com>
       
     9 ;; Created: 2009-11-04
       
    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 (define-generic-mode iar4-linker-config-mode
       
    20   '("// " ("/*" . "*/"))
       
    21   nil
       
    22   '(
       
    23     ("^\\(-c\\)\\([_a-zA-Z]+\\)"
       
    24      (1 font-lock-keyword-face)
       
    25      (2 font-lock-variable-name-face) )
       
    26     ("^\\(-D\\)\\([_a-zA-Z0-9]+\\)=\\(\\(0x\\)?[0-9a-fA-F]+\\|.[0-9]+\\)"
       
    27      (1 font-lock-keyword-face)
       
    28      (2 font-lock-variable-name-face)
       
    29      (3 font-lock-constant-face) )
       
    30     ("^\\(-Q\\)\\([_a-zA-Z]+\\)=\\([_a-zA-Z]+\\)"
       
    31      (1 font-lock-keyword-face)
       
    32      (2 font-lock-variable-name-face)
       
    33      (3 font-lock-variable-name-face) )
       
    34     ("^\\(-Z\\|-P\\|-b\\)(\\([_a-zA-Z]+\\))\\([_a-zA-Z]+\\)="
       
    35      (1 font-lock-keyword-face)
       
    36      (2 font-lock-variable-name-face)
       
    37      (3 font-lock-variable-name-face) )
       
    38     ("^\\(-Z\\|-P\\|-b\\)(\\([_a-zA-Z]+\\))\\([_a-zA-Z]+\\)\\+\\([_a-zA-Z]+\\)="
       
    39      (1 font-lock-keyword-face)
       
    40      (2 font-lock-variable-name-face)
       
    41      (3 font-lock-variable-name-face)
       
    42      (4 font-lock-variable-name-face) )
       
    43     )
       
    44   (list "\\.\\(xcl\\)\\'")
       
    45   (list
       
    46    (lambda () (setq comment-start "// " comment-end ""))
       
    47    )
       
    48   "Generic mode for iar linker config files.")
       
    49 
       
    50 (provide 'iar4-linker-config-mode)
       
    51 
       
    52 ;;; iar4-linker-config-mode.el ends here