2 " Language: DCL (Digital Command Language - vms)
3 " Maintainer: Dr. Charles E. Campbell, Jr. <Charles.E.Campbell.1@gsfc.nasa.gov>
4 " Last Change: September 19, 2000
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
15 set iskeyword=$,@,48-57,_
17 setlocal iskeyword=$,@,48-57,_
21 syn keyword dclInstr accounting del[ete] gen[cat] mou[nt] run
22 syn keyword dclInstr all[ocate] dep[osit] gen[eral] ncp run[off]
23 syn keyword dclInstr ana[lyze] dia[gnose] gos[ub] ncs sca
24 syn keyword dclInstr app[end] dif[ferences] got[o] on sea[rch]
25 syn keyword dclInstr ass[ign] dir[ectory] hel[p] ope[n] set
26 syn keyword dclInstr att[ach] dis[able] ico[nv] pas[cal] sho[w]
27 syn keyword dclInstr aut[horize] dis[connect] if pas[sword] sor[t]
28 syn keyword dclInstr aut[ogen] dis[mount] ini[tialize] pat[ch] spa[wn]
29 syn keyword dclInstr bac[kup] dpm[l] inq[uire] pca sta[rt]
30 syn keyword dclInstr cal[l] dqs ins[tall] pho[ne] sto[p]
31 syn keyword dclInstr can[cel] dsr job pri[nt] sub[mit]
32 syn keyword dclInstr cc dst[graph] lat[cp] pro[duct] sub[routine]
33 syn keyword dclInstr clo[se] dtm lib[rary] psw[rap] swx[cr]
34 syn keyword dclInstr cms dum[p] lic[ense] pur[ge] syn[chronize]
35 syn keyword dclInstr con[nect] edi[t] lin[k] qde[lete] sys[gen]
36 syn keyword dclInstr con[tinue] ena[ble] lmc[p] qse[t] sys[man]
37 syn keyword dclInstr con[vert] end[subroutine] loc[ale] qsh[ow] tff
38 syn keyword dclInstr cop[y] eod log[in] rea[d] then
39 syn keyword dclInstr cre[ate] eoj log[out] rec[all] typ[e]
40 syn keyword dclInstr cxx exa[mine] lse[dit] rec[over] uil
41 syn keyword dclInstr cxx[l_help] exc[hange] mac[ro] ren[ame] unl[ock]
42 syn keyword dclInstr dea[llocate] exi[t] mai[l] rep[ly] ves[t]
43 syn keyword dclInstr dea[ssign] fdl mer[ge] req[uest] vie[w]
44 syn keyword dclInstr deb[ug] flo[wgraph] mes[sage] ret[urn] wai[t]
45 syn keyword dclInstr dec[k] fon[t] mms rms wri[te]
46 syn keyword dclInstr def[ine] for[tran]
48 syn keyword dclLexical f$context f$edit f$getjpi f$message f$setprv
49 syn keyword dclLexical f$csid f$element f$getqui f$mode f$string
50 syn keyword dclLexical f$cvsi f$environment f$getsyi f$parse f$time
51 syn keyword dclLexical f$cvtime f$extract f$identifier f$pid f$trnlnm
52 syn keyword dclLexical f$cvui f$fao f$integer f$privilege f$type
53 syn keyword dclLexical f$device f$file_attributes f$length f$process f$user
54 syn keyword dclLexical f$directory f$getdvi f$locate f$search f$verify
56 syn match dclMdfy "/\I\i*" nextgroup=dclMdfySet,dclMdfySetString
57 syn match dclMdfySet "=[^ \t"]*" contained
58 syn region dclMdfySet matchgroup=dclMdfyBrkt start="=\[" matchgroup=dclMdfyBrkt end="]" contains=dclMdfySep
59 syn region dclMdfySetString start='="' skip='""' end='"' contained
60 syn match dclMdfySep "[:,]" contained
63 syn match dclNumber "\d\+"
65 " Varname (mainly to prevent dclNumbers from being recognized when part of a dclVarname)
66 syn match dclVarname "\I\i*"
68 " Filenames (devices, paths)
69 syn match dclDevice "\I\i*\(\$\I\i*\)\=:[^=]"me=e-1 nextgroup=dclDirPath,dclFilename
70 syn match dclDirPath "\[\(\I\i*\.\)*\I\i*\]" contains=dclDirSep nextgroup=dclFilename
71 syn match dclFilename "\I\i*\$\(\I\i*\)\=\.\(\I\i*\)*\(;\d\+\)\=" contains=dclDirSep
72 syn match dclFilename "\I\i*\.\(\I\i*\)\=\(;\d\+\)\=" contains=dclDirSep contained
73 syn match dclDirSep "[[\].;]"
76 syn region dclString start='"' skip='""' end='"'
78 " $ stuff and comments
79 syn cluster dclCommentGroup contains=dclStart,dclTodo
80 syn match dclStart "^\$" skipwhite nextgroup=dclExe
81 syn match dclContinue "-$"
82 syn match dclComment "^\$!.*$" contains=@dclCommentGroup
83 syn match dclExe "\I\i*" contained
84 syn match dclTodo "DEBUG\|TODO" contained
86 " Assignments and Operators
87 syn match dclAssign ":==\="
88 syn match dclAssign "="
89 syn match dclOper "--\|+\|\*\|/"
90 syn match dclLogOper "\.[a-zA-Z][a-zA-Z][a-zA-Z]\=\." contains=dclLogical,dclLogSep
91 syn keyword dclLogical contained and ge gts lt nes
92 syn keyword dclLogical contained eq ges le lts not
93 syn keyword dclLogical contained eqs gt les ne or
94 syn match dclLogSep "\." contained
97 syn match dclCmdProcStart "@" nextgroup=dclCmdProc
98 syn match dclCmdProc "\I\i*\(\.\I\i*\)\=" contained
99 syn match dclCmdProc "\I\i*:" contained nextgroup=dclCmdDirPath,dclCmdProc
100 syn match dclCmdDirPath "\[\(\I\i*\.\)*\I\i*\]" contained nextgroup=delCmdProc
103 syn match dclGotoLabel "^\$\s*\I\i*:\s*$" contains=dclStart
106 syn match dclParam "'\I[a-zA-Z0-9_$]*'\="
108 " () matching (the clusters are commented out until a vim/vms comes out for v5.2+)
109 "syn cluster dclNextGroups contains=dclCmdDirPath,dclCmdProc,dclCmdProc,dclDirPath,dclFilename,dclFilename,dclMdfySet,dclMdfySetString,delCmdProc,dclExe,dclTodo
110 "syn region dclFuncList matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,@dclNextGroups
111 syn region dclFuncList matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,dclCmdDirPath,dclCmdProc,dclCmdProc,dclDirPath,dclFilename,dclFilename,dclMdfySet,dclMdfySetString,delCmdProc,dclExe,dclTodo
112 syn match dclError ")"
114 " Define the default highlighting.
115 " For version 5.7 and earlier: only when not done already
116 " For version 5.8 and later: only when an item doesn't have highlighting yet
117 if version >= 508 || !exists("did_dcl_syntax_inits")
119 let did_dcl_syntax_inits = 1
120 command -nargs=+ HiLink hi link <args>
122 command -nargs=+ HiLink hi def link <args>
125 HiLink dclLogOper dclError
126 HiLink dclLogical dclOper
127 HiLink dclLogSep dclSep
129 HiLink dclAssign Operator
130 HiLink dclCmdProc Special
131 HiLink dclCmdProcStart Operator
132 HiLink dclComment Comment
133 HiLink dclContinue Statement
134 HiLink dclDevice Identifier
135 HiLink dclDirPath Identifier
136 HiLink dclDirPath Identifier
137 HiLink dclDirSep Delimiter
138 HiLink dclError Error
139 HiLink dclExe Statement
140 HiLink dclFilename NONE
141 HiLink dclGotoLabel Label
142 HiLink dclInstr Statement
143 HiLink dclLexical Function
145 HiLink dclMdfyBrkt Delimiter
146 HiLink dclMdfySep Delimiter
147 HiLink dclMdfySet Type
148 HiLink dclMdfySetString String
149 HiLink dclNumber Number
150 HiLink dclOper Operator
151 HiLink dclParam Special
152 HiLink dclSep Delimiter
153 HiLink dclStart Delimiter
154 HiLink dclString String
160 let b:current_syntax = "dcl"