grew.el 1.48 KB
Newer Older
bguillaum's avatar
bguillaum committed
1 2 3
;;====================================================================
;; Grew mode
;; Mode used to write Grew with emacs (highlight)
4
;; see: https://wikilligramme.loria.fr/doku.php?id=grew:grew
bguillaum's avatar
bguillaum committed
5

6
(require 'generic-x) ;;pour Emacs OK, mais semble ne pas marcher avec XEmacs
bguillaum's avatar
bguillaum committed
7 8
(define-generic-mode 'grew-mode
  '("%");;comments
9
  '("features" "module" "rule" "match" "without" "labels" "sequences" "commands" "graph" "confluent" "deterministic" "include" "filter");;keywords
bguillaum's avatar
bguillaum committed
10 11 12 13 14 15 16 17 18 19
  '(
;;    ("class\\s (\*\*)* +\\(\\sw[a-zA-Z0-9_.-]*\\)" 1 'font-lock-type-face);noms de classes
;;    ("\?[a-zA-Z0-9]+" . font-lock-variable-name-face)
;;    ("\![a-zA-Z0-9]+" . font-lock-constant-face)
;;    ("\(\\(\\sw[a-zA-Z0-9_.-]*\\(,\\sw[a-zA-Z0-9_.-]*\\)*\\)\)" 1 font-lock-constant-face);;params & node props
;;    ("$\\(\\sw*\\)*" . font-lock-constant-face);;params inside

;;    ("$[a-zA-Z0-9_àéèçâôûêäïüö'\-]+" . font-lock-constant-face);;params inside
    ("del_edge" . font-lock-constant-face)
    ("add_edge" . font-lock-constant-face)
bguillaum's avatar
bguillaum committed
20
    ("merge" . font-lock-constant-face)
bguillaum's avatar
bguillaum committed
21
    ("shift" . font-lock-constant-face)
bguillaum's avatar
bguillaum committed
22 23
    ("shift_in" . font-lock-constant-face)
    ("shift_out" . font-lock-constant-face)
bguillaum's avatar
bguillaum committed
24 25 26 27
    ("del_node" . font-lock-constant-face)
    ("add_node" . font-lock-constant-face)
    ("del_feat" . font-lock-constant-face)
    ("@[a-zA-Z0-9_]+" . font-lock-variable-name-face)
bguillaum's avatar
bguillaum committed
28
    ("$[a-zA-Z0-9_]+" . font-lock-variable-name-face)
bguillaum's avatar
bguillaum committed
29 30 31 32 33

    )
  '(".grs\\'") ;;file extension
  nil
  "Major mode for grew file")