codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: CSP (Communication Sequential Processes, using FDR input syntax)3" Maintainer: Jan Bredereke <brederek@tzi.de>4" Version: 0.6.05" Last change: Mon Mar 25, 20026" URL: http://www.tzi.de/~brederek/vim/7" Copying: You may distribute and use this file freely, in the same8" way as the vim editor itself.9"10" To Do: - Probably I missed some keywords or operators, please11" fix them and notify me, the maintainer.12" - Currently, we do lexical highlighting only. It would be13" nice to have more actual syntax checks, including14" highlighting of wrong syntax.15" - The additional syntax for the RT-Tester (pseudo-comments)16" should be optional.17 18" quit when a syntax file was already loaded19if exists("b:current_syntax")20 finish21endif22 23" case is significant to FDR:24syn case match25 26" Block comments in CSP are between {- and -}27syn region cspComment start="{-" end="-}" contains=cspTodo28" Single-line comments start with --29syn region cspComment start="--" end="$" contains=cspTodo,cspOldRttComment,cspSdlRttComment keepend30 31" Numbers:32syn match cspNumber "\<\d\+\>"33 34" Conditionals:35syn keyword cspConditional if then else36 37" Operators on processes:38" -> ? : ! ' ; /\ \ [] |~| [> & [[..<-..]] ||| [|..|] || [..<->..] ; : @ |||39syn match cspOperator "->"40syn match cspOperator "/\\"41syn match cspOperator "[^/]\\"lc=142syn match cspOperator "\[\]"43syn match cspOperator "|\~|"44syn match cspOperator "\[>"45syn match cspOperator "\[\["46syn match cspOperator "\]\]"47syn match cspOperator "<-"48syn match cspOperator "|||"49syn match cspOperator "[^|]||[^|]"lc=1,me=e-150syn match cspOperator "[^|{\~]|[^|}\~]"lc=1,me=e-151syn match cspOperator "\[|"52syn match cspOperator "|\]"53syn match cspOperator "\[[^>]"me=e-154syn match cspOperator "\]"55syn match cspOperator "<->"56syn match cspOperator "[?:!';@]"57syn match cspOperator "&"58syn match cspOperator "\."59 60" (not on processes:)61" syn match cspDelimiter "{|"62" syn match cspDelimiter "|}"63" syn match cspDelimiter "{[^-|]"me=e-164" syn match cspDelimiter "[^-|]}"lc=165 66" Keywords:67syn keyword cspKeyword length null head tail concat elem68syn keyword cspKeyword union inter diff Union Inter member card69syn keyword cspKeyword empty set Set Seq70syn keyword cspKeyword true false and or not within let71syn keyword cspKeyword nametype datatype diamond normal72syn keyword cspKeyword sbisim tau_loop_factor model_compress73syn keyword cspKeyword explicate74syn match cspKeyword "transparent"75syn keyword cspKeyword external chase prioritize76syn keyword cspKeyword channel Events77syn keyword cspKeyword extensions productions78syn keyword cspKeyword Bool Int79 80" Reserved keywords:81syn keyword cspReserved attribute embed module subtype82 83" Include:84syn region cspInclude matchgroup=cspIncludeKeyword start="^include" end="$" keepend contains=cspIncludeArg85syn region cspIncludeArg start='\s\+\"' end= '\"\s*' contained86 87" Assertions:88syn keyword cspAssert assert deterministic divergence free deadlock89syn keyword cspAssert livelock90syn match cspAssert "\[T="91syn match cspAssert "\[F="92syn match cspAssert "\[FD="93syn match cspAssert "\[FD\]"94syn match cspAssert "\[F\]"95 96" Types and Sets97" (first char a capital, later at least one lower case, no trailing underscore):98syn match cspType "\<_*[A-Z][A-Z_0-9]*[a-z]\(\|[A-Za-z_0-9]*[A-Za-z0-9]\)\>"99 100" Processes (all upper case, no trailing underscore):101" (For identifiers that could be types or sets, too, this second rule set102" wins.)103syn match cspProcess "\<[A-Z_][A-Z_0-9]*[A-Z0-9]\>"104syn match cspProcess "\<[A-Z_]\>"105 106" reserved identifiers for tool output (ending in underscore):107syn match cspReservedIdentifier "\<[A-Za-z_][A-Za-z_0-9]*_\>"108 109" ToDo markers:110syn match cspTodo "FIXME" contained111syn match cspTodo "TODO" contained112syn match cspTodo "!!!" contained113 114" RT-Tester pseudo comments:115" (The now obsolete syntax:)116syn match cspOldRttComment "^--\$\$AM_UNDEF"lc=2 contained117syn match cspOldRttComment "^--\$\$AM_ERROR"lc=2 contained118syn match cspOldRttComment "^--\$\$AM_WARNING"lc=2 contained119syn match cspOldRttComment "^--\$\$AM_SET_TIMER"lc=2 contained120syn match cspOldRttComment "^--\$\$AM_RESET_TIMER"lc=2 contained121syn match cspOldRttComment "^--\$\$AM_ELAPSED_TIMER"lc=2 contained122syn match cspOldRttComment "^--\$\$AM_OUTPUT"lc=2 contained123syn match cspOldRttComment "^--\$\$AM_INPUT"lc=2 contained124" (The current syntax:)125syn region cspRttPragma matchgroup=cspRttPragmaKeyword start="^pragma\s\+" end="\s*$" oneline keepend contains=cspRttPragmaArg,cspRttPragmaSdl126syn keyword cspRttPragmaArg AM_ERROR AM_WARNING AM_SET_TIMER contained127syn keyword cspRttPragmaArg AM_RESET_TIMER AM_ELAPSED_TIMER contained128syn keyword cspRttPragmaArg AM_OUTPUT AM_INPUT AM_INTERNAL contained129" the "SDL_MATCH" extension:130syn region cspRttPragmaSdl matchgroup=cspRttPragmaKeyword start="SDL_MATCH\s\+" end="\s*$" contains=cspRttPragmaSdlArg contained131syn keyword cspRttPragmaSdlArg TRANSLATE nextgroup=cspRttPragmaSdlTransName contained132syn keyword cspRttPragmaSdlArg PARAM SKIP OPTIONAL CHOICE ARRAY nextgroup=cspRttPragmaSdlName contained133syn match cspRttPragmaSdlName "\s*\S\+\s*" nextgroup=cspRttPragmaSdlTail contained134syn region cspRttPragmaSdlTail start="" end="\s*$" contains=cspRttPragmaSdlTailArg contained135syn keyword cspRttPragmaSdlTailArg SUBSET_USED DEFAULT_VALUE Present contained136syn match cspRttPragmaSdlTransName "\s*\w\+\s*" nextgroup=cspRttPragmaSdlTransTail contained137syn region cspRttPragmaSdlTransTail start="" end="\s*$" contains=cspRttPragmaSdlTransTailArg contained138syn keyword cspRttPragmaSdlTransTailArg sizeof contained139syn match cspRttPragmaSdlTransTailArg "\*" contained140syn match cspRttPragmaSdlTransTailArg "(" contained141syn match cspRttPragmaSdlTransTailArg ")" contained142 143" temporary syntax extension for commented-out "pragma SDL_MATCH":144syn match cspSdlRttComment "pragma\s\+SDL_MATCH\s\+" nextgroup=cspRttPragmaSdlArg contained145 146syn sync lines=250147 148" Define the default highlighting.149" Only when an item doesn't have highlighting yet150 151" The default methods for highlighting. Can be overridden later152" (For vim version <=5.7, the command groups are defined in153" $VIMRUNTIME/syntax/synload.vim )154hi def link cspComment Comment155hi def link cspNumber Number156hi def link cspConditional Conditional157hi def link cspOperator Delimiter158hi def link cspKeyword Keyword159hi def link cspReserved SpecialChar160hi def link cspInclude Error161hi def link cspIncludeKeyword Include162hi def link cspIncludeArg Include163hi def link cspAssert PreCondit164hi def link cspType Type165hi def link cspProcess Function166hi def link cspTodo Todo167hi def link cspOldRttComment Define168hi def link cspRttPragmaKeyword Define169hi def link cspSdlRttComment Define170hi def link cspRttPragmaArg Define171hi def link cspRttPragmaSdlArg Define172hi def link cspRttPragmaSdlName Default173hi def link cspRttPragmaSdlTailArg Define174hi def link cspRttPragmaSdlTransName Default175hi def link cspRttPragmaSdlTransTailArg Define176hi def link cspReservedIdentifier Error177" (Currently unused vim method: Debug)178 179 180let b:current_syntax = "csp"181 182" vim: ts=8183 