2 " Language: TSS (Thermal Synthesizer System) Command Line
3 " Maintainer: Adrian Nagle, anagle@ball.com
4 " Last Change: 2001 May 10
6 " URL: http://www.naglenet.org/vim/syntax/tsscl.vim
7 " MAIN URL: http://www.naglenet.org/vim/
11 " For version 5.x: Clear all syntax items
12 " For version 6.x: Quit when a syntax file was already loaded
15 elseif exists("b:current_syntax")
28 " Begin syntax definitions for tss geomtery file.
31 " Load TSS geometry syntax file
32 "source $VIM/myvim/tssgm.vim
33 "source $VIMRUNTIME/syntax/c.vim
35 " Define keywords for TSS
36 syn keyword tssclCommand begin radk list heatrates attr draw
38 syn keyword tssclKeyword cells rays error nodes levels objects cpu
39 syn keyword tssclKeyword units length positions energy time unit solar
40 syn keyword tssclKeyword solar_constant albedo planet_power
42 syn keyword tssclEnd exit
44 syn keyword tssclUnits cm feet meters inches
45 syn keyword tssclUnits Celsius Kelvin Fahrenheit Rankine
49 " Define matches for TSS
50 syn match tssclString /"[^"]\+"/ contains=ALLBUT,tssInteger,tssclKeyword,tssclCommand,tssclEnd,tssclUnits
52 syn match tssclComment "#.*$"
54 " rational and logical operators
57 " <= Less than or equal
58 " >= Greater than or equal
65 " algebraic operators:
66 " ^ or ** Exponentation
73 syn match tssclOper "||\||\|&&\|&\|!=\|!\|>=\|<=\|>\|<\|+\|-\|^\|\*\*\|\*\|/\|%\|==\|=\|\." skipwhite
75 " CLI Directive Commands, with arguments
79 " *ARITHMETIC { [ON] | OFF }
83 " *ECHO[/qualifiers] { [ON] | OFF }
84 " *ELSE [IF { 0 | 1 } ]
88 " *LIST/n list variable
89 " *OPEN[/r | /r+ | /w | /w+ ] unit_number file_name
90 " *PROMPT prompt_string sybol_name
91 " *READ/unit=unit_number[/LOCAL | /GLOBAL ] sym1 [sym2, [sym3 ...]]
94 " *STRCMP string_1 string_2 difference
96 " *UNDEFINE[/LOCAL][/GLOBAL] symbol_name
98 " *WRITE[/unit=unit_number] output text
100 syn match tssclDirective "\*ADD"
101 syn match tssclDirective "\*ARITHMETIC \+\(ON\|OFF\)"
102 syn match tssclDirective "\*CLOSE"
103 syn match tssclDirective "\*CPU"
104 syn match tssclDirective "\*DEFINE"
105 syn match tssclDirective "\*ECHO"
106 syn match tssclConditional "\*ELSE"
107 syn match tssclConditional "\*END \+\(IF\|WHILE\)"
108 syn match tssclDirective "\*EXIT"
109 syn match tssclConditional "\*IF"
110 syn match tssclDirective "\*LIST"
111 syn match tssclDirective "\*OPEN"
112 syn match tssclDirective "\*PROMPT"
113 syn match tssclDirective "\*READ"
114 syn match tssclDirective "\*REWIND"
115 syn match tssclDirective "\*STOP"
116 syn match tssclDirective "\*STRCMP"
117 syn match tssclDirective "\*SYSTEM"
118 syn match tssclDirective "\*UNDEFINE"
119 syn match tssclConditional "\*WHILE"
120 syn match tssclDirective "\*WRITE"
122 syn match tssclContChar "-$"
124 " C library functoins
125 " Bessel functions (jn, yn)
126 " Error and complementary error fuctions (erf, erfc)
127 " Exponential functions (exp)
128 " Logrithm (log, log10)
133 " Floating point remainder (fmod)
134 " Floating point absolute value (fabs)
136 " Euclidean distance function (hypot)
137 " Hperbolic functions (sinh, cosh, tanh)
138 " Trigometric functions in radians (sin, cos, tan, asin, acos, atan, atan2)
139 " Trigometric functions in degrees (sind, cosd, tand, asind, acosd, atand,
142 " local varialbles: cl_arg1, cl_arg2, etc. (cl_arg is an array of arguments)
143 " cl_args is the number of arguments
146 " I/O: *PROMPT, *WRITE, *READ
148 " Conditional branching:
150 " *IF value *IF I==10
151 " *ELSE IF value *ELSE IF I<10
167 " *DEFINE I = (I + 1)
171 syn match tssclQualifier "/[^/ ]\+"hs=s+1
172 syn match tssclSymbol "'\S\+'"
173 "syn match tssclSymbol2 " \S\+ " contained
175 syn match tssclInteger "-\=\<[0-9]*\>"
176 syn match tssclFloat "-\=\<[0-9]*\.[0-9]*"
177 syn match tssclScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>"
181 " Define the default highlighting
182 " For version 5.7 and earlier: only when not done already
183 " For version 5.8 and later: only when an item doesn't have highlighting yet
184 if version >= 508 || !exists("did_tsscl_syntax_inits")
186 let did_tsscl_syntax_inits = 1
187 command -nargs=+ HiLink hi link <args>
189 command -nargs=+ HiLink hi def link <args>
192 HiLink tssclCommand Statement
193 HiLink tssclKeyword Special
194 HiLink tssclEnd Macro
195 HiLink tssclUnits Special
197 HiLink tssclComment Comment
198 HiLink tssclDirective Statement
199 HiLink tssclConditional Conditional
200 HiLink tssclContChar Macro
201 HiLink tssclQualifier Typedef
202 HiLink tssclSymbol Identifier
203 HiLink tssclSymbol2 Symbol
204 HiLink tssclString String
205 HiLink tssclOper Operator
207 HiLink tssclInteger Number
208 HiLink tssclFloat Number
209 HiLink tssclScientific Number
215 let b:current_syntax = "tsscl"