Debian Codegraph @

data/syntax/lex.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE language>
3 <!--
4 ========================================================================
5
6 LEX.XML supports syntax highlighting for Lex/Flex source under Kate.
7
8 Copyright (C) 2004 - Jan Villat <[email protected]>
9 This code is released under the LGPL as part of kdelibs/kate.
10
11 ========================================================================
12
13 Updates for LEX.XML can be obtained from http://kate.kde.org/hl/
14
15 UPDATE HISTORY:-
16 2004.05.25 - LEX.XML 1.00 - First released.
17
18 TODO:-
19 - Add a mime type (cannot find it !?)
20
21 ========================================================================
22 -->
23 <language name="Lex/Flex" version="7" kateversion="5.79" section="Sources" extensions="*.l;*.lex;*.flex" author="Jan Villat ([email protected])" license="LGPL">
24
25 <highlighting>
26 <contexts>
27 <context name="Pre Start" attribute="Normal Text" lineEndContext="#stay">
28 <RegExpr attribute="Normal Text" context="Definitions" String="." lookAhead="true" beginRegion="definitions" />
29 </context>
30 <context name="Definitions" attribute="Normal Text" lineEndContext="#stay">
31 <IncludeRules context="Detect C" />
32 <Detect2Chars attribute="Content-Type Delimiter" context="Rules" char="%" char1="%" beginRegion="rules" endRegion="definitions" />
33 <DetectChar attribute="Directive" context="Percent Command" char="%" />
34 <Detect2Chars attribute="Comment" context="Comment" char="/" char1="*" column="0" beginRegion="BlockComment"/>
35 <RegExpr attribute="Definition" context="Definition RegExpr" String="^[A-Za-z_]\w*\s+" column="0"/>
36 </context>
37 <context name="Rules" attribute="Normal Text" lineEndContext="#stay" fallthroughContext="Rule RegExpr">
38 <IncludeRules context="Detect C" />
39 <Detect2Chars attribute="Content-Type Delimiter" context="User Code" char="%" char1="%" beginRegion="code" endRegion="rules" />
40 </context>
41 <context name="User Code" attribute="Normal Text" lineEndContext="#stay">
42 <IncludeRules context="##C++" />
43 </context>
44
45 <context name="Percent Command" attribute="Directive" lineEndContext="#pop">
46 </context>
47 <context name="Comment" attribute="Comment" lineEndContext="#stay">
48 <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="BlockComment"/>
49 <DetectSpaces />
50 <IncludeRules context="##Comments" />
51 </context>
52
53 <context name="Definition RegExpr" attribute="RegExpr" lineEndContext="#pop">
54 <IncludeRules context="RegExpr Base" />
55 <RegExpr attribute="RegExpr" context="#stay" String="\S" />
56 <RegExpr attribute="Alert" context="#stay" String=".*" />
57 </context>
58 <context name="Rule RegExpr" attribute="RegExpr" lineEndContext="#pop">
59 <LineContinue attribute="Content-Type Delimiter" context="Start Conditions Scope" char="{" beginRegion="SCscope" />
60 <IncludeRules context="RegExpr Base" />
61 <RegExpr attribute="RegExpr" context="#stay" String="\S" />
62 <DetectSpaces attribute="Normal Text" context="Action" />
63 </context>
64 <context name="RegExpr (" attribute="RegExpr" lineEndContext="#stay">
65 <IncludeRules context="RegExpr Base" />
66 <DetectChar attribute="RegExpr" context="#pop" char=")" />
67 <RegExpr attribute="RegExpr" context="#stay" String="." />
68 </context>
69 <context name="RegExpr [" attribute="RegExpr" lineEndContext="#stay">
70 <RegExpr attribute="Backslash Code" context="#stay" String="\\." />
71 <DetectChar attribute="RegExpr" context="#pop" char="]" />
72 <RegExpr attribute="RegExpr" context="#stay" String="." />
73 </context>
74 <context name="RegExpr {" attribute="RegExpr" lineEndContext="#stay">
75 <RegExpr attribute="Backslash Code" context="#stay" String="\\." />
76 <DetectChar attribute="RegExpr" context="#pop" char="}" />
77 <RegExpr attribute="RegExpr" context="#stay" String="." />
78 </context>
79 <context name="RegExpr Q" attribute="RegExpr" lineEndContext="#stay">
80 <RegExpr attribute="Backslash Code" context="#stay" String="\\." />
81 <DetectChar attribute="RegExpr" context="#pop" char="&quot;" />
82 <RegExpr attribute="RegExpr" context="#stay" String="." />
83 </context>
84 <context name="RegExpr Base" attribute="RegExpr" lineEndContext="#stay">
85 <RegExpr attribute="Backslash Code" context="#stay" String="\\." />
86 <DetectChar attribute="RegExpr" context="RegExpr (" char="(" />
87 <DetectChar attribute="RegExpr" context="RegExpr [" char="[" />
88 <DetectChar attribute="RegExpr" context="RegExpr {" char="{" />
89 <DetectChar attribute="RegExpr" context="RegExpr Q" char="&quot;" />
90 </context>
91
92 <context name="Start Conditions Scope" attribute="Normal Text" lineEndContext="#stay" fallthroughContext="Rule RegExpr">
93 <RegExpr attribute="Content-Type Delimiter" context="#pop" String="\s*\}" endRegion="SCscope" />
94 <DetectSpaces attribute="Normal Text" context="Rule RegExpr" />
95 </context>
96
97 <context name="Action" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="Action C">
98 <RegExpr attribute="Directive" context="#stay" String="\|\s*$" />
99 <Detect2Chars attribute="Content-Type Delimiter" context="Lex Rule C Bloc" char="%" char1="{" beginRegion="lexCbloc" />
100 </context>
101
102 <context name="Detect C" attribute="Normal Text" lineEndContext="#stay">
103 <DetectSpaces attribute="Normal Text" context="Indented C" column="0" />
104 <Detect2Chars attribute="Content-Type Delimiter" context="Lex C Bloc" char="%" char1="{" beginRegion="lexCbloc" column="0"/>
105 </context>
106 <context name="Indented C" attribute="Normal Text" lineEndContext="#pop">
107 <IncludeRules context="##C++" />
108 </context>
109 <context name="Lex C Bloc" attribute="Normal Text" lineEndContext="#stay">
110 <Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="}" endRegion="lexCbloc" column="0"/>
111 <IncludeRules context="##C++" />
112 </context>
113 <context name="Lex Rule C Bloc" attribute="Normal Text" lineEndContext="#stay">
114 <Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="}" endRegion="lexCbloc" />
115 <IncludeRules context="##C++" />
116 </context>
117 <context name="Normal C Bloc" attribute="Normal Text" lineEndContext="#stay">
118 <DetectChar attribute="Normal Text" context="Normal C Bloc" char="{" beginRegion="bloc" />
119 <DetectChar attribute="Normal Text" context="#pop" char="}" endRegion="bloc" />
120 <IncludeRules context="##C++" />
121 </context>
122 <context name="Action C" attribute="Normal Text" lineEndContext="#pop">
123 <DetectChar attribute="Normal Text" context="Normal C Bloc" char="{" beginRegion="bloc" />
124 <DetectChar attribute="Alert" context="#stay" char="}" />
125 <IncludeRules context="##C++" />
126 </context>
127 </contexts>
128
129 <itemDatas>
130 <itemData name="Normal Text" defStyleNum="dsNormal" />
131 <itemData name="Definition" defStyleNum="dsDataType" />
132 <itemData name="Comment" defStyleNum="dsComment" />
133 <itemData name="Content-Type Delimiter" defStyleNum="dsBaseN" bold="1" />
134 <itemData name="Directive" defStyleNum="dsKeyword"/>
135 <itemData name="RegExpr" defStyleNum="dsString" />
136 <itemData name="Backslash Code" defStyleNum="dsString" bold="1" />
137 <itemData name="Alert" defStyleNum="dsAlert" />
138 </itemDatas>
139
140 </highlighting>
141 <general>
142 <comments>
143 <comment name="multiLine" start="/*" end="*/" />
144 </comments>
145 </general>
146 </language>
147 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->