codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: TSS (Thermal Synthesizer System) Command Line3" Maintainer: Adrian Nagle, anagle@ball.com4" Last Change: 2003 May 115" Filenames: *.tsscl6" URL: http://www.naglenet.org/vim/syntax/tsscl.vim7" MAIN URL: http://www.naglenet.org/vim/8 9 10 11" quit when a syntax file was already loaded12if exists("b:current_syntax")13 finish14endif15 16 17 18" Ignore case19syn case ignore20 21 22 23"24"25" Begin syntax definitions for tss geometry file.26"27 28" Load TSS geometry syntax file29"source $VIM/myvim/tssgm.vim30"source $VIMRUNTIME/syntax/c.vim31 32" Define keywords for TSS33syn keyword tssclCommand begin radk list heatrates attr draw34 35syn keyword tssclKeyword cells rays error nodes levels objects cpu36syn keyword tssclKeyword units length positions energy time unit solar37syn keyword tssclKeyword solar_constant albedo planet_power38 39syn keyword tssclEnd exit40 41syn keyword tssclUnits cm feet meters inches42syn keyword tssclUnits Celsius Kelvin Fahrenheit Rankine43 44 45 46" Define matches for TSS47syn match tssclString /"[^"]\+"/ contains=ALLBUT,tssInteger,tssclKeyword,tssclCommand,tssclEnd,tssclUnits48 49syn match tssclComment "#.*$"50 51" rational and logical operators52" < Less than53" > Greater than54" <= Less than or equal55" >= Greater than or equal56" == or = Equal to57" != Not equal to58" && or & Logical AND59" || or | Logical OR60" ! Logical NOT61"62" algebraic operators:63" ^ or ** Exponentation64" * Multiplication65" / Division66" % Remainder67" + Addition68" - Subtraction69"70syn match tssclOper "||\||\|&&\|&\|!=\|!\|>=\|<=\|>\|<\|+\|-\|^\|\*\*\|\*\|/\|%\|==\|=\|\." skipwhite71 72" CLI Directive Commands, with arguments73"74" BASIC COMMAND LIST75" *ADD input_source76" *ARITHMETIC { [ON] | OFF }77" *CLOSE unit_number78" *CPU79" *DEFINE80" *ECHO[/qualifiers] { [ON] | OFF }81" *ELSE [IF { 0 | 1 } ]82" *END { IF | WHILE }83" *EXIT84" *IF { 0 | 1 }85" *LIST/n list variable86" *OPEN[/r | /r+ | /w | /w+ ] unit_number file_name87" *PROMPT prompt_string sybol_name88" *READ/unit=unit_number[/LOCAL | /GLOBAL ] sym1 [sym2, [sym3 ...]]89" *REWIND90" *STOP91" *STRCMP string_1 string_2 difference92" *SYSTEM command93" *UNDEFINE[/LOCAL][/GLOBAL] symbol_name94" *WHILE { 0 | 1 }95" *WRITE[/unit=unit_number] output text96"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 functoins122" 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 arguments141"142"143" I/O: *PROMPT, *WRITE, *READ144"145" Conditional branching:146" IF, ELSE IF, END147" *IF value *IF I==10148" *ELSE IF value *ELSE IF I<10149" *ELSE *ELSE150" *ENDIF *ENDIF151"152"153" Iterative looping:154" WHILE155" *WHILE test156" .....157" *END WHILE158"159"160" EXAMPLE:161" *DEFINE I = 1162" *WHILE (I <= 10)163" *WRITE I = 'I'164" *DEFINE I = (I + 1)165" *END WHILE166"167 168syn match tssclQualifier "/[^/ ]\+"hs=s+1169syn match tssclSymbol "'\S\+'"170"syn match tssclSymbol2 " \S\+ " contained171 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 highlighting179" Only when an item doesn't have highlighting yet180 181hi def link tssclCommand Statement182hi def link tssclKeyword Special183hi def link tssclEnd Macro184hi def link tssclUnits Special185 186hi def link tssclComment Comment187hi def link tssclDirective Statement188hi def link tssclConditional Conditional189hi def link tssclContChar Macro190hi def link tssclQualifier Typedef191hi def link tssclSymbol Identifier192hi def link tssclSymbol2 Symbol193hi def link tssclString String194hi def link tssclOper Operator195 196hi def link tssclInteger Number197hi def link tssclFloat Number198hi def link tssclScientific Number199 200 201 202let b:current_syntax = "tsscl"203 204" vim: ts=8 sw=2205 