1" Vim syntax file
2" Language: Comshare Dimension Definition Language
3" Maintainer:	Raul Segura Acevedo <raulseguraaceved@netscape.net>
4" Last change:	2001 Jul 31
5
6if version < 600
7	syntax clear
8elseif exists("b:current_syntax")
9	finish
10endif
11
12sy case ignore
13sy sync fromstart
14sy keyword	cdlStatement	dimension hierarchy group grouphierarchy schedule class
15sy keyword	cdlType		add update file category main altername removeall required notrequired
16sy keyword	cdlConditional	if then elseif else endif and or not cons rpt xlt
17sy keyword	cdlFunction	ChildOf IChildOf LeafChildOf DescendantOf IDescendantOf LeafDescendantOf MemberIs CountOf
18
19sy keyword	cdlIdentifier	contained id name desc description xlttype precision symbol curr_ name group_name rate_name
20sy keyword	cdlIdentifier	contained xcheck endbal accounttype natsign consolidate formula pctown usage periodicity
21sy match	cdlIdentifier	contained 'child\s*name'
22sy match	cdlIdentifier	contained 'parent\s*name'
23sy match	cdlIdentifier	contained 'grp\s*description'
24sy match	cdlIdentifier	contained 'grpchild\s*name'
25sy match	cdlIdentifier	contained 'grpparent\s*name'
26sy match	cdlIdentifier	contained 'preceding\s*member'
27sy match	cdlIdentifier	contained 'unit\s*name'
28sy match	cdlIdentifier	contained 'unit\s*id'
29sy match	cdlIdentifier	contained 'schedule\s*name'
30sy match	cdlIdentifier	contained 'schedule\s*id'
31
32sy match	cdlString	/\[[^]]*]/	contains=cdlRestricted,cdlNotSupported
33sy match	cdlRestricted	contained /[&*,_]/
34" not supported , [, ]
35sy match	cdlNotSupported	contained /[:"!']/
36
37sy keyword	cdlTodo		contained TODO FIXME XXX
38sy cluster	cdlCommentGroup contains=cdlTodo
39sy match	cdlComment	'//.*' contains=@cdlCommentGroup
40sy region	cdlComment	start="/\*" end="\*/" contains=@cdlCommentGroup fold
41sy match	cdlCommentE	"\*/"
42
43sy region	cdlParen	transparent start='(' end=')' contains=ALLBUT,cdlParenE,cdlRestricted,cdlNotSupported
44"sy region	cdlParen	transparent start='(' end=')' contains=cdlIdentifier,cdlComment,cdlParenWordE
45sy match	cdlParenE	")"
46"sy match	cdlParenWordE	contained "\k\+"
47
48sy keyword	cdlFxType	allocation downfoot expr xltgain
49"sy keyword	cdlFxType	contained allocation downfoot expr xltgain
50"sy region	cdlFx		transparent start='\k\+(' end=')' contains=cdlConditional,cdlFunction,cdlString,cdlComment,cdlFxType
51
52set foldmethod=expr
53set foldexpr=(getline(v:lnum+1)=~'{'\|\|getline(v:lnum)=~'//\\s\\*\\{5}.*table')?'>1':1
54%foldo!
55set foldmethod=manual
56let b:match_words='\<if\>:\<then\>:\<elseif\>:\<else\>:\<endif\>'
57
58" Define the default highlighting.
59" For version 5.7 and earlier: only when not done already
60" For version 5.8 and later: only when an item doesn't have highlighting yet
61if version >= 508 || !exists("did_csc_syntax_inits")
62	if version < 508
63		let did_csc_syntax_inits = 1
64		command -nargs=+ HiLink hi link <args>
65	else
66		command -nargs=+ HiLink hi def link <args>
67	endif
68
69	HiLink cdlStatement	Statement
70	HiLink cdlType		Type
71	HiLink cdlFxType	Type
72	HiLink cdlIdentifier	Identifier
73	HiLink cdlString	String
74	HiLink cdlRestricted	WarningMsg
75	HiLink cdlNotSupported	ErrorMsg
76	HiLink cdlTodo		Todo
77	HiLink cdlComment	Comment
78	HiLink cdlCommentE	ErrorMsg
79	HiLink cdlParenE	ErrorMsg
80	HiLink cdlParenWordE	ErrorMsg
81	HiLink cdlFunction	Function
82	HiLink cdlConditional	Conditional
83
84	delcommand HiLink
85endif
86
87let b:current_syntax = "cdl"
88
89" vim: ts=8
90