1" Vim syntax file
2" Language:	rpcgen
3" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
4" Last Change:	Sep 06, 2005
5" Version:	8
6" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
7
8" For version 5.x: Clear all syntax items
9" For version 6.x: Quit when a syntax file was already loaded
10if version < 600
11  syntax clear
12elseif exists("b:current_syntax")
13  finish
14endif
15
16" Read the C syntax to start with
17if version < 600
18  source <sfile>:p:h/c.vim
19else
20  runtime! syntax/c.vim
21endif
22
23syn keyword rpcProgram	program				skipnl skipwhite nextgroup=rpcProgName
24syn match   rpcProgName	contained	"\<\i\I*\>"	skipnl skipwhite nextgroup=rpcProgZone
25syn region  rpcProgZone	contained	matchgroup=Delimiter start="{" matchgroup=Delimiter end="}\s*=\s*\(\d\+\|0x[23]\x\{7}\)\s*;"me=e-1 contains=rpcVersion,cComment,rpcProgNmbrErr
26syn keyword rpcVersion	contained	version		skipnl skipwhite nextgroup=rpcVersName
27syn match   rpcVersName	contained	"\<\i\I*\>"	skipnl skipwhite nextgroup=rpcVersZone
28syn region  rpcVersZone	contained	matchgroup=Delimiter start="{" matchgroup=Delimiter end="}\s*=\s*\d\+\s*;"me=e-1 contains=cType,cStructure,cStorageClass,rpcDecl,rpcProcNmbr,cComment
29syn keyword rpcDecl	contained	string
30syn match   rpcProcNmbr	contained	"=\s*\d\+;"me=e-1
31syn match   rpcProgNmbrErr contained	"=\s*0x[^23]\x*"ms=s+1
32syn match   rpcPassThru			"^\s*%.*$"
33
34" Define the default highlighting.
35" For version 5.7 and earlier: only when not done already
36" For version 5.8 and later: only when an item doesn't have highlighting yet
37if version >= 508 || !exists("did_rpcgen_syntax_inits")
38  if version < 508
39    let did_rpcgen_syntax_inits = 1
40    command -nargs=+ HiLink hi link <args>
41  else
42    command -nargs=+ HiLink hi def link <args>
43  endif
44
45  HiLink rpcProgName	rpcName
46  HiLink rpcProgram	rpcStatement
47  HiLink rpcVersName	rpcName
48  HiLink rpcVersion	rpcStatement
49
50  HiLink rpcDecl	cType
51  HiLink rpcPassThru	cComment
52
53  HiLink rpcName	Special
54  HiLink rpcProcNmbr	Delimiter
55  HiLink rpcProgNmbrErr	Error
56  HiLink rpcStatement	Statement
57
58  delcommand HiLink
59endif
60
61let b:current_syntax = "rpcgen"
62
63" vim: ts=8
64