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