aboutsummaryrefslogtreecommitdiff
path: root/data/wmap.lang
diff options
context:
space:
mode:
Diffstat (limited to 'data/wmap.lang')
-rw-r--r--data/wmap.lang123
1 files changed, 123 insertions, 0 deletions
diff --git a/data/wmap.lang b/data/wmap.lang
new file mode 100644
index 0000000..e05c8d3
--- /dev/null
+++ b/data/wmap.lang
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<language id="wmap" name="wmap Wardley Map Definition Language" version="2.0" section="Markup">
+ <metadata>
+ <property name="mimetypes">text/x-wmap</property>
+ <property name="globs">*.wmap</property>
+ <property name="line-comment-start">#</property>
+ </metadata>
+
+ <styles>
+ <style id="keyword" name="Keyword" map-to="def:keyword"/>
+ <style id="node-name" name="Node Name" map-to="def:identifier"/>
+ <style id="coordinate" name="Coordinate" map-to="def:number"/>
+ <style id="shape" name="Shape" map-to="def:type"/>
+ <style id="operator" name="Operator" map-to="def:operator"/>
+ <style id="note-text" name="Note Text" map-to="def:string"/>
+ <style id="evolution-sign" name="Evolution Sign" map-to="def:operator"/>
+ <style id="stage" name="Stage" map-to="def:special-constant"/>
+ <style id="group-list" name="Group List" map-to="def:identifier"/>
+ </styles>
+
+ <definitions>
+ <!-- Node pattern: Name (x,y) [optional shape] -->
+ <context id="node">
+ <match extended="true" case-sensitive="false">
+ ^([^\(\[\]]*?)\s*
+ \(\s*([0-9]+\.?[0-9]*)\s*,\s*([0-9]+\.?[0-9]*)\s*\)
+ \s*(?:\[(Square|Triangle|x)\])?\s*$
+ </match>
+ <include>
+ <context sub-pattern="1" style-ref="node-name"/>
+ <context sub-pattern="2" style-ref="coordinate"/>
+ <context sub-pattern="3" style-ref="coordinate"/>
+ <context sub-pattern="4" style-ref="shape"/>
+ </include>
+ </context>
+
+ <!-- Edge pattern: Node -\- Node or Node -> Node -->
+ <context id="edge">
+ <match extended="true" case-sensitive="false">
+ ^(.+?)\s*(--|-&gt;)\s*(.+)$
+ </match>
+ <include>
+ <context sub-pattern="1" style-ref="node-name"/>
+ <context sub-pattern="2" style-ref="operator"/>
+ <context sub-pattern="3" style-ref="node-name"/>
+ </include>
+ </context>
+
+ <!-- Inertia pattern: [Inertia] Node -->
+ <context id="inertia">
+ <match extended="true" case-sensitive="false">
+ ^\[(inertia)\]\s*(.+)$
+ </match>
+ <include>
+ <context sub-pattern="1" style-ref="keyword"/>
+ <context sub-pattern="2" style-ref="node-name"/>
+ </include>
+ </context>
+
+ <!-- Evolution pattern: [Evolution] Node +/-x -->
+ <context id="evolution">
+ <match extended="true" case-sensitive="false">
+ ^\[(Evolution)\]\s*(.+)\s*([-+])\s*([0-9]+\.?[0-9]*)$
+ </match>
+ <include>
+ <context sub-pattern="1" style-ref="keyword"/>
+ <context sub-pattern="2" style-ref="node-name"/>
+ <context sub-pattern="3" style-ref="evolution-sign"/>
+ <context sub-pattern="4" style-ref="coordinate"/>
+ </include>
+ </context>
+
+ <!-- Note pattern: [Note] (x,y) Text -->
+ <context id="note">
+ <match extended="true" case-sensitive="false">
+ ^\[(Note)\]\s*
+ \(\s*([0-9]+\.?[0-9]*)\s*,\s*([0-9]+\.?[0-9]*)\s*\)
+ \s*(.*)$
+ </match>
+ <include>
+ <context sub-pattern="1" style-ref="keyword"/>
+ <context sub-pattern="2" style-ref="coordinate"/>
+ <context sub-pattern="3" style-ref="coordinate"/>
+ <context sub-pattern="4" style-ref="note-text"/>
+ </include>
+ </context>
+
+ <!-- Stage pattern: [I], [II], or [III] x -->
+ <context id="stage">
+ <match extended="true" case-sensitive="false">
+ ^\[(I{1,3})\]\s*([0-9]+\.?[0-9]*)$
+ </match>
+ <include>
+ <context sub-pattern="1" style-ref="stage"/>
+ <context sub-pattern="2" style-ref="coordinate"/>
+ </include>
+ </context>
+
+ <!-- Group pattern: [Group] Node1, Node2, ... -->
+ <context id="group">
+ <match extended="true" case-sensitive="false">
+ ^\[(Group)\]\s*(.+)$
+ </match>
+ <include>
+ <context sub-pattern="1" style-ref="keyword"/>
+ <context sub-pattern="2" style-ref="group-list"/>
+ </include>
+ </context>
+
+ <!-- Main context -->
+ <context id="wmap">
+ <include>
+ <context ref="inertia"/>
+ <context ref="evolution"/>
+ <context ref="note"/>
+ <context ref="stage"/>
+ <context ref="group"/>
+ <context ref="edge"/>
+ <context ref="node"/>
+ </include>
+ </context>
+ </definitions>
+</language>