xref: /vim-8.2.3635/runtime/syntax/tsscl.vim (revision f37506f6)
1" Vim syntax file
2" Language:     TSS (Thermal Synthesizer System) Command Line
3" Maintainer:   Adrian Nagle, [email protected]
4" Last Change:  2003 May 11
5" Filenames:    *.tsscl
6" URL:		http://www.naglenet.org/vim/syntax/tsscl.vim
7" MAIN URL:     http://www.naglenet.org/vim/
8
9
10
11" quit when a syntax file was already loaded
12if exists("b:current_syntax")
13  finish
14endif
15
16
17
18" Ignore case
19syn case ignore
20
21
22
23"
24"
25" Begin syntax definitions for tss geomtery file.
26"
27
28" Load TSS geometry syntax file
29"source $VIM/myvim/tssgm.vim
30"source $VIMRUNTIME/syntax/c.vim
31
32" Define keywords for TSS
33syn keyword tssclCommand  begin radk list heatrates attr draw
34
35syn keyword tssclKeyword   cells rays error nodes levels objects cpu
36syn keyword tssclKeyword   units length positions energy time unit solar
37syn keyword tssclKeyword   solar_constant albedo planet_power
38
39syn keyword tssclEnd    exit
40
41syn keyword tssclUnits  cm feet meters inches
42syn keyword tssclUnits  Celsius Kelvin Fahrenheit Rankine
43
44
45
46" Define matches for TSS
47syn match  tssclString    /"[^"]\+"/ contains=ALLBUT,tssInteger,tssclKeyword,tssclCommand,tssclEnd,tssclUnits
48
49syn match  tssclComment     "#.*$"
50
51"  rational and logical operators
52"  <       Less than
53"  >       Greater than
54"  <=      Less than or equal
55"  >=      Greater than or equal
56"  == or = Equal to
57"  !=      Not equal to
58"  && or & Logical AND
59"  || or | Logical OR
60"  !       Logical NOT
61"
62" algebraic operators:
63"  ^ or ** Exponentation
64"  *       Multiplication
65"  /       Division
66"  %       Remainder
67"  +       Addition
68"  -       Subtraction
69"
70syn match  tssclOper      "||\||\|&&\|&\|!=\|!\|>=\|<=\|>\|<\|+\|-\|^\|\*\*\|\*\|/\|%\|==\|=\|\." skipwhite
71
72" CLI Directive Commands, with arguments
73"
74" BASIC COMMAND LIST
75" *ADD input_source
76" *ARITHMETIC { [ON] | OFF }
77" *CLOSE unit_number
78" *CPU
79" *DEFINE
80" *ECHO[/qualifiers] { [ON] | OFF }
81" *ELSE [IF { 0 | 1 } ]
82" *END { IF | WHILE }
83" *EXIT
84" *IF { 0 | 1 }
85" *LIST/n list variable
86" *OPEN[/r | /r+ | /w | /w+ ] unit_number file_name
87" *PROMPT prompt_string sybol_name
88" *READ/unit=unit_number[/LOCAL | /GLOBAL ] sym1 [sym2, [sym3 ...]]
89" *REWIND
90" *STOP
91" *STRCMP string_1 string_2 difference
92" *SYSTEM command
93" *UNDEFINE[/LOCAL][/GLOBAL] symbol_name
94" *WHILE { 0 | 1 }
95" *WRITE[/unit=unit_number] output text
96"
97syn match  tssclDirective "\*ADD"
98syn match  tssclDirective "\*ARITHMETIC \+\(ON\|OFF\)"
99syn match  tssclDirective "\*CLOSE"
100syn match  tssclDirective "\*CPU"
101syn match  tssclDirective "\*DEFINE"
102syn match  tssclDirective "\*ECHO"
103syn match  tssclConditional "\*ELSE"
104syn match  tssclConditional "\*END \+\(IF\|WHILE\)"
105syn match  tssclDirective "\*EXIT"
106syn match  tssclConditional "\*IF"
107syn match  tssclDirective "\*LIST"
108syn match  tssclDirective "\*OPEN"
109syn match  tssclDirective "\*PROMPT"
110syn match  tssclDirective "\*READ"
111syn match  tssclDirective "\*REWIND"
112syn match  tssclDirective "\*STOP"
113syn match  tssclDirective "\*STRCMP"
114syn match  tssclDirective "\*SYSTEM"
115syn match  tssclDirective "\*UNDEFINE"
116syn match  tssclConditional "\*WHILE"
117syn match  tssclDirective "\*WRITE"
118
119syn match  tssclContChar  "-$"
120
121" C library functoins
122" Bessel functions (jn, yn)
123" Error and complementary error fuctions (erf, erfc)
124" Exponential functions (exp)
125" Logrithm (log, log10)
126" Power (pow)
127" Square root (sqrt)
128" Floor (floor)
129" Ceiling (ceil)
130" Floating point remainder (fmod)
131" Floating point absolute value (fabs)
132" Gamma (gamma)
133" Euclidean distance function (hypot)
134" Hperbolic functions (sinh, cosh, tanh)
135" Trigometric functions in radians (sin, cos, tan, asin, acos, atan, atan2)
136" Trigometric functions in degrees (sind, cosd, tand, asind, acosd, atand,
137"    atan2d)
138"
139" local varialbles: cl_arg1, cl_arg2, etc. (cl_arg is an array of arguments)
140" cl_args is the number of arguments
141"
142"
143" I/O: *PROMPT, *WRITE, *READ
144"
145" Conditional branching:
146" IF, ELSE IF, END
147" *IF value       *IF I==10
148" *ELSE IF value  *ELSE IF I<10
149" *ELSE		  *ELSE
150" *ENDIF	  *ENDIF
151"
152"
153" Iterative looping:
154" WHILE
155" *WHILE test
156" .....
157" *END WHILE
158"
159"
160" EXAMPLE:
161" *DEFINE I = 1
162" *WHILE (I <= 10)
163"    *WRITE I = 'I'
164"    *DEFINE I = (I + 1)
165" *END WHILE
166"
167
168syn match  tssclQualifier "/[^/ ]\+"hs=s+1
169syn match  tssclSymbol    "'\S\+'"
170"syn match  tssclSymbol2   " \S\+ " contained
171
172syn match  tssclInteger     "-\=\<[0-9]*\>"
173syn match  tssclFloat       "-\=\<[0-9]*\.[0-9]*"
174syn match  tssclScientific  "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>"
175
176
177
178" Define the default highlighting
179" Only when an item doesn't have highlighting yet
180
181hi def link tssclCommand		Statement
182hi def link tssclKeyword		Special
183hi def link tssclEnd		Macro
184hi def link tssclUnits		Special
185
186hi def link tssclComment		Comment
187hi def link tssclDirective		Statement
188hi def link tssclConditional	Conditional
189hi def link tssclContChar		Macro
190hi def link tssclQualifier		Typedef
191hi def link tssclSymbol		Identifier
192hi def link tssclSymbol2		Symbol
193hi def link tssclString		String
194hi def link tssclOper		Operator
195
196hi def link tssclInteger		Number
197hi def link tssclFloat		Number
198hi def link tssclScientific	Number
199
200
201
202let b:current_syntax = "tsscl"
203
204" vim: ts=8 sw=2
205