Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: WildPackets EtherPeek Decoder (.dcd) file |
| 3 | " Maintainer: Christopher Shinn <christopher@lucent.com> |
| 4 | " Last Change: 2003 Apr 25 |
| 5 | |
| 6 | " For version 5.x: Clear all syntax items |
| 7 | " For version 6.x: Quit when a syntax file was already loaded |
| 8 | if version < 600 |
| 9 | syntax clear |
| 10 | elseif exists("b:current_syntax") |
| 11 | finish |
| 12 | endif |
| 13 | |
| 14 | " Keywords |
| 15 | syn keyword dcdFunction DCod TRTS TNXT CRLF |
| 16 | syn match dcdFunction display "\(STR\)\#" |
| 17 | syn keyword dcdLabel LABL |
| 18 | syn region dcdLabel start="[A-Z]" end=";" |
| 19 | syn keyword dcdConditional CEQU CNEQ CGTE CLTE CBIT CLSE |
| 20 | syn keyword dcdConditional LSTS LSTE LSTZ |
| 21 | syn keyword dcdConditional TYPE TTST TEQU TNEQ TGTE TLTE TBIT TLSE TSUB SKIP |
| 22 | syn keyword dcdConditional MARK WHOA |
| 23 | syn keyword dcdConditional SEQU SNEQ SGTE SLTE SBIT |
| 24 | syn match dcdConditional display "\(CST\)\#" "\(TST\)\#" |
| 25 | syn keyword dcdDisplay HBIT DBIT BBIT |
| 26 | syn keyword dcdDisplay HBYT DBYT BBYT |
| 27 | syn keyword dcdDisplay HWRD DWRD BWRD |
| 28 | syn keyword dcdDisplay HLNG DLNG BLNG |
| 29 | syn keyword dcdDisplay D64B |
| 30 | syn match dcdDisplay display "\(HEX\)\#" "\(CHR\)\#" "\(EBC\)\#" |
| 31 | syn keyword dcdDisplay HGLB DGLB BGLB |
| 32 | syn keyword dcdDisplay DUMP |
| 33 | syn keyword dcdStatement IPLG IPV6 ATLG AT03 AT01 ETHR TRNG PRTO PORT |
| 34 | syn keyword dcdStatement TIME OSTP PSTR CSTR NBNM DMPE FTPL CKSM FCSC |
| 35 | syn keyword dcdStatement GBIT GBYT GWRD GLNG |
| 36 | syn keyword dcdStatement MOVE ANDG ORRG NOTG ADDG SUBG MULG DIVG MODG INCR DECR |
| 37 | syn keyword dcdSpecial PRV1 PRV2 PRV3 PRV4 PRV5 PRV6 PRV7 PRV8 |
| 38 | |
| 39 | " Comment |
| 40 | syn region dcdComment start="\*" end="\;" |
| 41 | |
| 42 | " Define the default highlighting. |
| 43 | " For version 5.7 and earlier: only when not done already |
| 44 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 45 | if version >= 508 || !exists("did_dcd_syntax_inits") |
| 46 | if version < 508 |
| 47 | let did_dcd_syntax_inits = 1 |
| 48 | command -nargs=+ HiLink hi link <args> |
| 49 | else |
| 50 | command -nargs=+ HiLink hi def link <args> |
| 51 | endif |
| 52 | |
| 53 | HiLink dcdFunction Identifier |
| 54 | HiLink dcdLabel Constant |
| 55 | HiLink dcdConditional Conditional |
| 56 | HiLink dcdDisplay Type |
| 57 | HiLink dcdStatement Statement |
| 58 | HiLink dcdSpecial Special |
| 59 | HiLink dcdComment Comment |
| 60 | |
| 61 | delcommand HiLink |
| 62 | endif |
| 63 | |
| 64 | let b:current_syntax = "dcd" |