1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE language SYSTEM "language.dtd">
4
========================================================================
6
LEX.XML supports syntax highlighting for Lex/Flex source under Kate.
8
Copyright (C) 2004 - Jan Villat <jan.villat@net2000.ch>
9
This code is released under the LGPL as part of kdelibs/kate.
11
========================================================================
13
Updates for LEX.XML can be obtained from http://kate.kde.org/hl/
16
2004.05.25 - LEX.XML 1.00 - First released.
19
- Add a mime type (cannot find it !?)
21
========================================================================
23
<language name="Lex/Flex" version="1.01" kateversion="2.4" section="Sources" extensions="*.l;*.lex;*.flex" author="Jan Villat (jan.villat@net2000.ch)" license="LGPL">
27
<context name="Pre Start" attribute="Normal Text" lineEndContext="#stay">
28
<RegExpr attribute="Normal Text" context="Definitions" String="." lookAhead="true" beginRegion="definitions" />
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"/>
35
<RegExpr attribute="Definition" context="Definition RegExpr" String="[A-Za-z_]\w*\s+" column="0"/>
37
<context name="Rules" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Rule RegExpr">
38
<IncludeRules context="Detect C" />
39
<Detect2Chars attribute="Content-Type Delimiter" context="User Code" char="%" char1="%" beginRegion="code" endRegion="rules" />
41
<context name="User Code" attribute="Normal Text" lineEndContext="#stay">
42
<IncludeRules context="##C++" />
45
<context name="Percent Command" attribute="Directive" lineEndContext="#pop">
47
<context name="Comment" attribute="Comment" lineEndContext="#stay">
48
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
51
<context name="Definition RegExpr" attribute="RegExpr" lineEndContext="#pop">
52
<IncludeRules context="RegExpr Base" />
53
<RegExpr attribute="RegExpr" context="#stay" String="\S" />
54
<RegExpr attribute="Alert" context="#stay" String=".*" />
56
<context name="Rule RegExpr" attribute="RegExpr" lineEndContext="#pop">
57
<RegExpr attribute="Content-Type Delimiter" context="Start Conditions Scope" String="\{$" beginRegion="SCscope" />
58
<IncludeRules context="RegExpr Base" />
59
<RegExpr attribute="RegExpr" context="#stay" String="\S" />
60
<RegExpr attribute="Normal Text" context="Action" String="\s+" />
62
<context name="RegExpr (" attribute="RegExpr" lineEndContext="#stay">
63
<IncludeRules context="RegExpr Base" />
64
<DetectChar attribute="RegExpr" context="#pop" char=")" />
65
<RegExpr attribute="RegExpr" context="#stay" String="." />
67
<context name="RegExpr [" attribute="RegExpr" lineEndContext="#stay">
68
<RegExpr attribute="Backslash Code" context="#stay" String="\\." />
69
<DetectChar attribute="RegExpr" context="#pop" char="]" />
70
<RegExpr attribute="RegExpr" context="#stay" String="." />
72
<context name="RegExpr {" attribute="RegExpr" lineEndContext="#stay">
73
<RegExpr attribute="Backslash Code" context="#stay" String="\\." />
74
<DetectChar attribute="RegExpr" context="#pop" char="}" />
75
<RegExpr attribute="RegExpr" context="#stay" String="." />
77
<context name="RegExpr Q" attribute="RegExpr" lineEndContext="#stay">
78
<RegExpr attribute="Backslash Code" context="#stay" String="\\." />
79
<DetectChar attribute="RegExpr" context="#pop" char=""" />
80
<RegExpr attribute="RegExpr" context="#stay" String="." />
82
<context name="RegExpr Base" attribute="RegExpr" lineEndContext="#stay">
83
<RegExpr attribute="Backslash Code" context="#stay" String="\\." />
84
<DetectChar attribute="RegExpr" context="RegExpr (" char="(" />
85
<DetectChar attribute="RegExpr" context="RegExpr [" char="[" />
86
<DetectChar attribute="RegExpr" context="RegExpr {" char="{" />
87
<DetectChar attribute="RegExpr" context="RegExpr Q" char=""" />
90
<context name="Start Conditions Scope" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Rule RegExpr">
91
<RegExpr attribute="Content-Type Delimiter" context="#pop" String="\s*\}" endRegion="SCscope" />
92
<RegExpr attribute="Normal Text" context="Rule RegExpr" String="\s*" />
95
<context name="Action" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="Action C">
96
<RegExpr attribute="Directive" context="#stay" String="\|\s*$" />
97
<Detect2Chars attribute="Content-Type Delimiter" context="Lex Rule C Bloc" char="%" char1="{" beginRegion="lexCbloc" />
100
<context name="Detect C" attribute="Normal Text" lineEndContext="#stay">
101
<RegExpr attribute="Normal Text" context="Indented C" String="^\s" />
102
<Detect2Chars attribute="Content-Type Delimiter" context="Lex C Bloc" char="%" char1="{" beginRegion="lexCbloc" column="0"/>
104
<context name="Indented C" attribute="Normal Text" lineEndContext="#pop">
105
<IncludeRules context="##C++" />
107
<context name="Lex C Bloc" attribute="Normal Text" lineEndContext="#stay">
108
<Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="}" endRegion="lexCbloc" column="0"/>
109
<IncludeRules context="##C++" />
111
<context name="Lex Rule C Bloc" attribute="Normal Text" lineEndContext="#stay">
112
<Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="}" endRegion="lexCbloc" />
113
<IncludeRules context="##C++" />
115
<context name="Normal C Bloc" attribute="Normal Text" lineEndContext="#stay">
116
<DetectChar attribute="Normal Text" context="Normal C Bloc" char="{" beginRegion="bloc" />
117
<DetectChar attribute="Normal Text" context="#pop" char="}" endRegion="bloc" />
118
<IncludeRules context="##C++" />
120
<context name="Action C" attribute="Normal Text" lineEndContext="#pop">
121
<DetectChar attribute="Normal Text" context="Normal C Bloc" char="{" beginRegion="bloc" />
122
<DetectChar attribute="Alert" context="#stay" char="}" />
123
<IncludeRules context="##C++" />
128
<itemData name="Normal Text" defStyleNum="dsNormal" />
129
<itemData name="Definition" defStyleNum="dsDataType" />
130
<itemData name="Comment" defStyleNum="dsComment" />
131
<itemData name="Content-Type Delimiter" defStyleNum="dsBaseN" bold="1" />
132
<itemData name="Directive" defStyleNum="dsKeyword"/>
133
<itemData name="RegExpr" defStyleNum="dsString" />
134
<itemData name="Backslash Code" defStyleNum="dsString" bold="1" />
135
<itemData name="Alert" defStyleNum="dsAlert" />
141
<comment name="multiLine" start="/*" end="*/" />