occam.vim 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. " Vim syntax file
  2. " Language: occam
  3. " Copyright: Fred Barnes <frmb2@kent.ac.uk>, Mario Schweigler <ms44@kent.ac.uk>
  4. " Maintainer: Mario Schweigler <ms44@kent.ac.uk>
  5. " Last Change: 24 May 2003
  6. " quit when a syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. "{{{ Settings
  11. " Set shift width for indent
  12. setlocal shiftwidth=2
  13. " Set the tab key size to two spaces
  14. setlocal softtabstop=2
  15. " Let tab keys always be expanded to spaces
  16. setlocal expandtab
  17. " Dots are valid in occam identifiers
  18. setlocal iskeyword+=.
  19. "}}}
  20. syn case match
  21. syn keyword occamType BYTE BOOL INT INT16 INT32 INT64 REAL32 REAL64 ANY
  22. syn keyword occamType CHAN DATA OF TYPE TIMER INITIAL VAL PORT MOBILE PLACED
  23. syn keyword occamType PROCESSOR PACKED RECORD PROTOCOL SHARED ROUND TRUNC
  24. syn keyword occamStructure SEQ PAR IF ALT PRI FORKING PLACE AT
  25. syn keyword occamKeyword PROC IS TRUE FALSE SIZE RECURSIVE REC
  26. syn keyword occamKeyword RETYPES RESHAPES STEP FROM FOR RESCHEDULE STOP SKIP FORK
  27. syn keyword occamKeyword FUNCTION VALOF RESULT ELSE CLONE CLAIM
  28. syn keyword occamBoolean TRUE FALSE
  29. syn keyword occamRepeat WHILE
  30. syn keyword occamConditional CASE
  31. syn keyword occamConstant MOSTNEG MOSTPOS
  32. syn match occamBrackets /\[\|\]/
  33. syn match occamParantheses /(\|)/
  34. syn keyword occamOperator AFTER TIMES MINUS PLUS INITIAL REM AND OR XOR NOT
  35. syn keyword occamOperator BITAND BITOR BITNOT BYTESIN OFFSETOF
  36. syn match occamOperator /::\|:=\|?\|!/
  37. syn match occamOperator /<\|>\|+\|-\|\*\|\/\|\\\|=\|\~/
  38. syn match occamOperator /@\|\$\$\|%\|&&\|<&\|&>\|<\]\|\[>\|\^/
  39. syn match occamSpecialChar /\M**\|*'\|*"\|*#\(\[0-9A-F\]\+\)/ contained
  40. syn match occamChar /\M\L\='\[^*\]'/
  41. syn match occamChar /L'[^']*'/ contains=occamSpecialChar
  42. syn case ignore
  43. syn match occamTodo /\<todo\>:\=/ contained
  44. syn match occamNote /\<note\>:\=/ contained
  45. syn case match
  46. syn keyword occamNote NOT contained
  47. syn match occamComment /--.*/ contains=occamCommentTitle,occamTodo,occamNote
  48. syn match occamCommentTitle /--\s*\u\a*\(\s\+\u\a*\)*:/hs=s+2 contained contains=occamTodo,occamNote
  49. syn match occamCommentTitle /--\s*KROC-LIBRARY\(\.so\|\.a\)\=\s*$/hs=s+2 contained
  50. syn match occamCommentTitle /--\s*\(KROC-OPTIONS:\|RUN-PARAMETERS:\)/hs=s+2 contained
  51. syn match occamIdentifier /\<[A-Z.][A-Z.0-9]*\>/
  52. syn match occamFunction /\<[A-Za-z.][A-Za-z0-9.]*\>/ contained
  53. syn match occamPPIdentifier /##.\{-}\>/
  54. syn region occamString start=/"/ skip=/\M*"/ end=/"/ contains=occamSpecialChar
  55. syn region occamCharString start=/'/ end=/'/ contains=occamSpecialChar
  56. syn match occamNumber /\<\d\+\(\.\d\+\(E\(+\|-\)\d\+\)\=\)\=/
  57. syn match occamNumber /-\d\+\(\.\d\+\(E\(+\|-\)\d\+\)\=\)\=/
  58. syn match occamNumber /#\(\d\|[A-F]\)\+/
  59. syn match occamNumber /-#\(\d\|[A-F]\)\+/
  60. syn keyword occamCDString SHARED EXTERNAL DEFINED NOALIAS NOUSAGE NOT contained
  61. syn keyword occamCDString FILE LINE PROCESS.PRIORITY OCCAM2.5 contained
  62. syn keyword occamCDString USER.DEFINED.OPERATORS INITIAL.DECL MOBILES contained
  63. syn keyword occamCDString BLOCKING.SYSCALLS VERSION NEED.QUAD.ALIGNMENT contained
  64. syn keyword occamCDString TARGET.CANONICAL TARGET.CPU TARGET.OS TARGET.VENDOR contained
  65. syn keyword occamCDString TRUE FALSE AND OR contained
  66. syn match occamCDString /<\|>\|=\|(\|)/ contained
  67. syn region occamCDirective start=/#\(USE\|INCLUDE\|PRAGMA\|DEFINE\|UNDEFINE\|UNDEF\|IF\|ELIF\|ELSE\|ENDIF\|WARNING\|ERROR\|RELAX\)\>/ end=/$/ contains=occamString,occamComment,occamCDString
  68. hi def link occamType Type
  69. hi def link occamKeyword Keyword
  70. hi def link occamComment Comment
  71. hi def link occamCommentTitle PreProc
  72. hi def link occamTodo Todo
  73. hi def link occamNote Todo
  74. hi def link occamString String
  75. hi def link occamCharString String
  76. hi def link occamNumber Number
  77. hi def link occamCDirective PreProc
  78. hi def link occamCDString String
  79. hi def link occamPPIdentifier PreProc
  80. hi def link occamBoolean Boolean
  81. hi def link occamSpecialChar SpecialChar
  82. hi def link occamChar Character
  83. hi def link occamStructure Structure
  84. hi def link occamIdentifier Identifier
  85. hi def link occamConstant Constant
  86. hi def link occamOperator Operator
  87. hi def link occamFunction Ignore
  88. hi def link occamRepeat Repeat
  89. hi def link occamConditional Conditional
  90. hi def link occamBrackets Type
  91. hi def link occamParantheses Delimiter
  92. let b:current_syntax = "occam"