wsml.vim 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. " Vim syntax file
  2. " Language: WSML
  3. " Maintainer: Thomas Haselwanter <thomas.haselwanter@deri.org>
  4. " URL: none
  5. " Last Change: 2006 Apr 30
  6. " quit when a syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. " WSML
  11. syn keyword wsmlHeader wsmlVariant
  12. syn keyword wsmlNamespace namespace
  13. syn keyword wsmlTopLevel concept instance relationInstance ofType usesMediator usesService relation sharedVariables importsOntology
  14. syn keyword wsmlOntology hasValue memberOf ofType impliesType subConceptOf
  15. syn keyword wsmlAxiom axiom definedBy
  16. syn keyword wsmlService assumption effect postcondition precondition capability interface
  17. syn keyword wsmlTopLevel ooMediator wwMediator wgMediator ggMediator
  18. syn keyword wsmlMediation usesService source target
  19. syn match wsmlDataTypes "\( _string\| _decimal\| _integer\| _float\| _double\| _iri\| _sqname\| _boolean\| _duration\| _dateTime\| _time\| _date\| _gyearmonth\| _gyear\| _gmonthday\| _gday\| _gmonth\| _hexbinary\| _base64binary\)\((\S*)\)\?" contains=wsmlString,wsmlNumber,wsmlCharacter
  20. syn keyword wsmlTopLevel goal webService ontology
  21. syn keyword wsmlKeywordsInsideLEs true false memberOf hasValue subConceptOf ofType impliesType and or implies impliedBy equivalent neg naf forall exists
  22. syn keyword wsmlNFP nfp endnfp nonFunctionalProperties endNonFunctionalProperties
  23. syn region wsmlNFPregion start="nfp\|nonFunctionalProperties" end="endnfp\|endNonFunctionalProperties" contains=ALL
  24. syn region wsmlNamespace start="namespace" end="}" contains=wsmlIdentifier
  25. syn match wsmlOperator "!=\|:=:\|=<\|>=\|=\|+\|\*\|/\|<->\|->\|<-\|:-\|!-\|-\|<\|>"
  26. syn match wsmlBrace "(\|)\|\[\|\]\|{\|}"
  27. syn match wsmlIdentifier +_"\S*"+
  28. syn match wsmlIdentifier "_#\d*"
  29. syn match wsmlSqName "[0-9A-Za-z]\+#[0-9A-Za-z]\+"
  30. syn match wsmlVariable "?[0-9A-Za-z]\+"
  31. " ASM-specific code
  32. syn keyword wsmlBehavioral choreography orchestration transitionRules
  33. syn keyword wsmlChoreographyPri stateSignature in out shared static controlled
  34. syn keyword wsmlChoreographySec with do withGrounding forall endForall choose if then endIf
  35. syn match wsmlChoreographyTer "\(\s\|\_^\)\(add\|delete\|update\)\s*(.*)" contains=wsmlKeywordsInsideLEs,wsmlIdentifier,wsmlSqName,wsmlString,wsmlNumber,wsmlDataTypes,wsmlVariable
  36. " Comments
  37. syn keyword wsmlTodo contained TODO
  38. syn keyword wsmlFixMe contained FIXME
  39. if exists("wsml_comment_strings")
  40. syn region wsmlCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=wsmlSpecial,wsmlCommentStar,wsmlSpecialChar,@Spell
  41. syn region wsmlComment2String contained start=+"+ end=+$\|"+ contains=wsmlSpecial,wsmlSpecialChar,@Spell
  42. syn match wsmlCommentCharacter contained "'\\[^']\{1,6\}'" contains=wsmlSpecialChar
  43. syn match wsmlCommentCharacter contained "'\\''" contains=wsmlSpecialChar
  44. syn match wsmlCommentCharacter contained "'[^\\]'"
  45. syn cluster wsmlCommentSpecial add=wsmlCommentString,wsmlCommentCharacter,wsmlNumber
  46. syn cluster wsmlCommentSpecial2 add=wsmlComment2String,wsmlCommentCharacter,wsmlNumber
  47. endif
  48. syn region wsmlComment start="/\*" end="\*/" contains=@wsmlCommentSpecial,wsmlTodo,wsmlFixMe,@Spell
  49. syn match wsmlCommentStar contained "^\s*\*[^/]"me=e-1
  50. syn match wsmlCommentStar contained "^\s*\*$"
  51. syn match wsmlLineComment "//.*" contains=@wsmlCommentSpecial2,wsmlTodo,@Spell
  52. syn cluster wsmlTop add=wsmlComment,wsmlLineComment
  53. "match the special comment /**/
  54. syn match wsmlComment "/\*\*/"
  55. " Strings
  56. syn region wsmlString start=+"+ end=+"+ contains=wsmlSpecialChar,wsmlSpecialError,@Spell
  57. syn match wsmlCharacter "'[^']*'" contains=javaSpecialChar,javaSpecialCharError
  58. syn match wsmlCharacter "'\\''" contains=javaSpecialChar
  59. syn match wsmlCharacter "'[^\\]'"
  60. syn match wsmlNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
  61. syn match wsmlNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
  62. syn match wsmlNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
  63. syn match wsmlNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
  64. " unicode characters
  65. syn match wsmlSpecial "\\u\d\{4\}"
  66. syn cluster wsmlTop add=wsmlString,wsmlCharacter,wsmlNumber,wsmlSpecial,wsmlStringError
  67. " Define the default highlighting.
  68. " Only when an item doesn't have highlighting yet
  69. hi def link wsmlHeader TypeDef
  70. hi def link wsmlNamespace TypeDef
  71. hi def link wsmlOntology Statement
  72. hi def link wsmlAxiom TypeDef
  73. hi def link wsmlService TypeDef
  74. hi def link wsmlNFP TypeDef
  75. hi def link wsmlTopLevel TypeDef
  76. hi def link wsmlMediation TypeDef
  77. hi def link wsmlBehavioral TypeDef
  78. hi def link wsmlChoreographyPri TypeDef
  79. hi def link wsmlChoreographySec Operator
  80. hi def link wsmlChoreographyTer Special
  81. hi def link wsmlString String
  82. hi def link wsmlIdentifier Normal
  83. hi def link wsmlSqName Normal
  84. hi def link wsmlVariable Define
  85. hi def link wsmlKeywordsInsideLEs Operator
  86. hi def link wsmlOperator Operator
  87. hi def link wsmlBrace Operator
  88. hi def link wsmlCharacter Character
  89. hi def link wsmlNumber Number
  90. hi def link wsmlDataTypes Special
  91. hi def link wsmlComment Comment
  92. hi def link wsmlDocComment Comment
  93. hi def link wsmlLineComment Comment
  94. hi def link wsmlTodo Todo
  95. hi def link wsmlFixMe Error
  96. hi def link wsmlCommentTitle SpecialComment
  97. hi def link wsmlCommentStar wsmlComment
  98. let b:current_syntax = "wsml"
  99. let b:spell_options="contained"