Debian Codegraph @

data/syntax/selinux-cil.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE language
3 [
4 <!ENTITY symbol "\w\[\]\.@\=/\*\-&#036;&#037;\+&#033;\|&amp;\^&#058;&#126;&#096;#\{\}&#039;&lt;&gt;\?,\\"> <!-- [].@=/*-_$%+!|&^:~`#{}'<>?,\ -->
5 <!ENTITY identifier "[a-zA-Z][\w\-]*">
6 <!ENTITY statementchar "[a-z_\-]">
7
8 <!ENTITY fullIdentifier "[a-zA-Z][\w\-]*(?:\.?[\w\-])*">
9 <!ENTITY mlsLevel "&fullIdentifier;(?:\:&fullIdentifier;(?:\s*,\s*&fullIdentifier;)*)?">
10 ]>
11
12 <!--
13 SELinux CIL (Common Interface Language) Policy Syntax Highlighting Definition
14 ===============================================================================
15
16 This file is part of the KDE's KSyntaxHighlighting framework.
17
18 SPDX-FileCopyrightText: 2018-2020 Nibaldo González S. <[email protected]>
19
20 SPDX-License-Identifier: MIT
21
22 ===============================================================================
23
24 Based on the Scheme syntax highlighting file (scheme.xml),
25 created by Dominik Haumann ([email protected]).
26
27 Last update: secilc 3.0
28 More details about CIL:
29 https://github.com/SELinuxProject/selinux/tree/master/secilc/docs
30
31 Change log:
32 * Version 7 [30-Sep-2020]: Use include-keywods and other minor changes.
33 * Version 6 [25-Aug-2020]: Update colors in brackets.
34 * Version 5 [10-Dec-2019]: Add "glblub" keyword (defaultrange).
35 * Version 4 [03-Oct-2019]: Replace unnecessary WordDetect rules.
36 * Version 3 [02-Apr-2019]: Remove one indentation.
37 * Version 2 [28-Aug-2018]:
38 - Implement "selinux.xml": some rules and keywords are moved there. Improve RegExp
39 highlighting, add Android permissions and BPF permissions, improve IPv6
40 detection and others improvements.
41 - Fix permissions list in "ioctl" kind and "call" statements.
42 - Add "sctp" protocol keyword and policy capabilities keywords.
43 * Version 1 [26-Jan-2018, by Nibaldo González]:
44 - Initial version.
45 -->
46
47 <language name="SELinux CIL Policy"
48 version="10"
49 kateversion="5.53"
50 section="Sources"
51 extensions="*.cil"
52 priority="9"
53 mimetype=""
54 author="Nibaldo González ([email protected])"
55 license="MIT">
56
57 <highlighting>
58
59 <list name="expr_keys">
60 <item>and</item>
61 <item>or</item>
62 <item>xor</item>
63 <item>not</item>
64 <item>all</item>
65 <item>eq</item>
66 <item>ne</item>
67 <item>neq</item>
68 <item>dom</item>
69 <item>domby</item>
70 <item>incomp</item>
71 <item>range</item>
72 </list>
73
74 <!-- Access Vector Rules -->
75 <list name="access">
76 <item>allow</item>
77 <item>auditallow</item>
78 <item>dontaudit</item>
79 <item>neverallow</item>
80 <item>auditdeny</item>
81 <item>allowx</item>
82 <item>auditallowx</item>
83 <item>dontauditx</item>
84 <item>neverallowx</item>
85 </list>
86
87 <list name="booleans">
88 <item>true</item>
89 <item>false</item>
90 </list>
91
92 <list name="file_types">
93 <item>file</item>
94 <item>dir</item>
95 <item>char</item>
96 <item>block</item>
97 <item>socket</item>
98 <item>pipe</item>
99 <item>symlink</item>
100 <item>any</item>
101 </list>
102 <list name="fs_types">
103 <item>task</item>
104 <item>trans</item>
105 <item>xattr</item>
106 </list>
107 <list name="protocols">
108 <item>tcp</item>
109 <item>udp</item>
110 <item>dccp</item>
111 <item>sctp</item>
112 </list>
113
114 <list name="special_keys">
115 <item>self</item>
116 </list>
117 <list name="classorder_keys">
118 <item>unordered</item>
119 </list>
120 <list name="handleunknown_keys">
121 <item>allow</item>
122 <item>deny</item>
123 <item>reject</item>
124 </list>
125
126 <list name="type_statements">
127 <item>block</item>
128 <item>optional</item>
129 <item>common</item>
130 <item>class</item>
131 <item>classmap</item>
132 <item>classmapping</item>
133 <item>sid</item>
134 <item>user</item>
135 <item>role</item>
136 <item>roleattribute</item>
137 <item>type</item>
138 <item>classpermission</item>
139 <item>typeattribute</item>
140 <item>typealias</item>
141 <item>tunable</item>
142 <item>sensitivity</item>
143 <item>sensitivityalias</item>
144 <item>category</item>
145 <item>categoryalias</item>
146 <item>categoryset</item>
147 <item>level</item>
148 <item>levelrange</item>
149 <item>context</item>
150 <item>ipaddr</item>
151 <item>macro</item>
152 <item>boolean</item>
153 <!-- policycap, classpermissionset -->
154 </list>
155 <list name="policy_config_statements">
156 <item>policycap</item>
157 <item>mls</item>
158 <item>handleunknown</item>
159 </list>
160 <list name="statements">
161 <!-- Container Statements.
162 Also: block, optional, macro -->
163 <item>blockabstract</item>
164 <item>blockinherit</item>
165 <item>in</item>
166 <item>call</item>
167
168 <!-- Default Object Statements -->
169 <item>defaultuser</item>
170 <item>defaultrole</item>
171 <item>defaulttype</item>
172 <item>defaultrange</item>
173
174 <!-- User Statements.
175 Also: user -->
176 <item>userrole</item>
177 <item>userattribute</item>
178 <item>userattributeset</item>
179 <item>userlevel</item>
180 <item>userrange</item>
181 <item>userbounds</item>
182 <item>userprefix</item>
183 <item>selinuxuser</item>
184 <item>selinuxuserdefault</item>
185
186 <!-- Role Statements.
187 Also: role, roleattribute -->
188 <item>roletype</item>
189 <item>roleattributeset</item>
190 <item>roleallow</item>
191 <item>roletransition</item>
192 <item>rolebounds</item>
193
194 <!-- Type Statements.
195 Also: type, typeattribute, typealias -->
196 <item>typealiasactual</item>
197 <item>typeattributeset</item>
198 <item>typebounds</item>
199 <item>typechange</item>
200 <item>typemember</item>
201 <item>typetransition</item>
202 <item>typepermissive</item>
203 <item>attributetype</item>
204
205 <item>expandtypeattribute</item>
206 <item>nametypetransition</item>
207
208 <!-- Class and Permission Statements.
209 Also: common, class, classmap, classmapping, classpermission -->
210 <item>classcommon</item>
211 <item>classorder</item>
212 <item>permission</item>
213 <item>permissionset</item>
214 <item>classpermissionset</item>
215 <item>permissionx</item>
216
217 <!-- Conditional Statements.
218 Also: tunable, boolean -->
219 <item>booleanif</item>
220 <item>tunableif</item>
221
222 <!-- Constraint Statements -->
223 <item>constrain</item>
224 <item>validatetrans</item>
225 <item>mlsconstrain</item>
226 <item>mlsvalidatetrans</item>
227
228 <!-- Multi-Level Security Labeling Statements.
229 Also: sensitivity, sensitivityalias, category, categoryalias, categoryset, level, levelrange -->
230 <item>sensitivityaliasactual</item>
231 <item>sensitivityorder</item>
232 <item>categoryaliasactual</item>
233 <item>categoryorder</item>
234 <item>sensitivitycategory</item>
235 <item>rangetransition</item>
236 <item>categoryrange</item>
237
238 <!-- Context Statement: context -->
239 <!-- SID Statements.
240 Also: sid -->
241 <item>sidorder</item>
242 <item>sidcontext</item>
243
244 <!-- File Labeling Statements -->
245 <item>filecon</item>
246 <item>fsuse</item>
247 <item>genfscon</item>
248 <item>fscon</item>
249 <item>fsusexattr</item>
250 <item>fsusetask</item>
251 <item>fsusetrans</item>
252
253 <!-- Network Labeling Statements.
254 Also: ipaddr -->
255 <item>netifcon</item>
256 <item>nodecon</item>
257 <item>portcon</item>
258 <!-- ipv4_addr, ipv6_addr -->
259
260 <!-- Xen Statements -->
261 <item>iomemcon</item>
262 <item>ioportcon</item>
263 <item>pcidevicecon</item>
264 <item>pirqcon</item>
265 <item>devicetreecon</item>
266
267 <!-- Infiniband Statements -->
268 <item>ibpkeycon</item>
269 <item>ibendportcon</item>
270
271 <!-- Others -->
272 <item>dominance</item>
273 <item>allowxperm</item>
274 <item>auditallowxperm</item>
275 <item>dontauditxperm</item>
276 <item>neverallowxperm</item>
277 </list>
278
279 <list name="type_name">
280 <item>string</item>
281 <item>name</item>
282 <item>ioctl</item> <!-- permissionx -->
283 </list>
284
285 <list name="other_keywords">
286 <item>source</item>
287 <item>target</item>
288 <item>glblub</item> <!-- defaultrange -->
289 <item>low</item>
290 <item>high</item>
291 <item>low-high</item>
292
293 <item>perm</item>
294 <item>object_r</item>
295 <item>t1</item>
296 <item>t2</item>
297 <item>t3</item>
298 <item>r1</item>
299 <item>r2</item>
300 <item>r3</item>
301 <item>u1</item>
302 <item>u2</item>
303 <item>u3</item>
304 <item>l1</item>
305 <item>l2</item>
306 <item>h1</item>
307 <item>h2</item>
308 </list>
309 <list name="policy_capabilities">
310 <include>policy_capabilities##SELinux Policy</include>
311 </list>
312 <list name="filesystem">
313 <include>filesystem##SELinux Policy</include>
314 </list>
315
316 <contexts>
317
318 <context name="_normal" attribute="Normal Text" lineEndContext="#stay">
319 <DetectChar context="_rule_bracket_level1" attribute="Brackets Level 1" char="("/>
320 <DetectChar context="#stay" attribute="Error" char=")"/>
321 <IncludeRules context="_common"/>
322 <IncludeRules context="_identifiers"/>
323 </context>
324 <context name="_common" attribute="Normal Text" lineEndContext="#stay">
325 <DetectChar context="_comment" attribute="Comment" char=";"/>
326 <DetectChar context="_quoted" attribute="Text Quoted" char="&quot;"/>
327 <DetectChar context="_path_content" attribute="Path" char="/"/>
328
329 <!-- IP Address -->
330 <IncludeRules context="_ip_addr##SELinux Policy"/>
331 <!-- Special Characters -->
332 <DetectChar context="#stay" attribute="Special Char" char="*"/>
333
334 <!-- File Contexts: user_u:role_r:type_t:s0:c0 -->
335 <RegExpr context="_file_contexts" attribute="File Contexts" String="\b&fullIdentifier;(?:\:&fullIdentifier;){2}(?:\:&mlsLevel;(?:\s*\-\s*&mlsLevel;)?)?(?:[^&symbol;:]|\s|$)" lookAhead="true"/>
336 <!-- Global Namespace (this avoids highlighting keywords) -->
337 <RegExpr context="#stay" String="(?:\b&identifier;)?(?:\.&identifier;)+(?=\s|[^&symbol;]|$)"/>
338
339 <!-- Numbers -->
340 <HlCHex context="#stay" attribute="Hexadecimal"/>
341 <Float context="#stay" attribute="Number"/>
342 <Int context="#stay" attribute="Number"/>
343 </context>
344 <context name="_identifiers" attribute="Normal Text" lineEndContext="#stay">
345 <!-- Avoid highlighting numbers in identifiers.
346 IMPORTANT: Do not put this rule before the keywords! -->
347 <RegExpr context="#stay" String="&identifier;"/>
348 </context>
349
350 <context name="_comment" attribute="Comment" lineEndContext="#pop">
351 <DetectSpaces />
352 <LineContinue context="#pop" attribute="Comment"/>
353 <IncludeRules context="##Comments"/>
354 <IncludeRules context="_default_comment##SELinux Policy"/>
355 </context>
356
357 <context name="_quoted" attribute="Text Quoted" lineEndContext="#pop">
358 <DetectChar context="#pop" attribute="Text Quoted" char="&quot;"/>
359 <IncludeRules context="_regex_quoted##SELinux Policy"/> <!-- This does not support line breaks and line cont. escape -->
360 <RegExpr context="#stay" attribute="Text Quoted Open" String="[^\s&quot;\[\(\\](?=\s*$)"/>
361 </context>
362
363 <context name="_path_content" attribute="Path" lineEndContext="#pop">
364 <DetectSpaces context="#pop" attribute="Normal Text" lookAhead="true"/>
365 <RegExpr context="#pop" attribute="Normal Text" String="[^&symbol;]" lookAhead="true"/>
366
367 <IncludeRules context="_default_regex##SELinux Policy"/>
368 <DetectChar context="_square_brackets_cil_path" attribute="RegExp Brackets (Paths)" char="["/>
369 </context>
370 <context name="_square_brackets_cil_path" attribute="RegExp Brackets (Paths)"
371 lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_square_brackets_cil_path_content">
372 <RegExpr context="#pop!_square_brackets_cil_path_content" attribute="Special Char of Brackets (Paths)" String="\^(?=[&symbol;])"/>
373 </context>
374 <context name="_square_brackets_cil_path_content" attribute="RegExp Brackets (Paths)" lineEndContext="#pop">
375 <DetectChar context="#pop" attribute="RegExp Brackets (Paths)" char="]"/>
376 <RegExpr context="#pop" String="[^&symbol;]" lookAhead="true"/>
377 <RegExpr context="#stay" attribute="Open RegExp Brackets (Paths)" String="[^\s\[\]\\](?![&symbol;])"/>
378 <DetectChar context="#stay" attribute="Error" char="["/>
379 <IncludeRules context="_special_chars##SELinux Policy"/>
380 </context>
381
382 <!-- RULES -->
383
384 <!-- Highlighting specific keywords in some rules -->
385 <context name="_filecon_statement" attribute="Normal Text" lineEndContext="#stay">
386 <IncludeRules context="_default_end"/>
387 <keyword context="#pop" attribute="Types" String="file_types"/>
388 <IncludeRules context="_default_rule"/>
389 </context>
390 <context name="_portcon_statement" attribute="Normal Text" lineEndContext="#stay">
391 <IncludeRules context="_default_end"/>
392 <keyword context="#pop" attribute="Types" String="protocols"/>
393 <IncludeRules context="_default_rule"/>
394 </context>
395 <context name="_fsuse_statement" attribute="Normal Text" lineEndContext="#stay">
396 <IncludeRules context="_default_end"/>
397 <keyword context="#pop" attribute="Types" String="fs_types"/>
398 <IncludeRules context="_default_rule"/>
399 </context>
400 <context name="_handleunknown_statement" attribute="Normal Text" lineEndContext="#stay">
401 <IncludeRules context="_default_end"/>
402 <keyword context="#pop" attribute="Access Keys" String="handleunknown_keys"/>
403 <IncludeRules context="_default_rule"/>
404 </context>
405 <context name="_policycap_statement" attribute="Normal Text" lineEndContext="#stay">
406 <IncludeRules context="_default_end"/>
407 <keyword context="#stay" attribute="Policy Capability" String="policy_capabilities"/>
408 <IncludeRules context="_common"/>
409 <IncludeRules context="_identifiers"/>
410 </context>
411 <context name="_av_permissions_statement" attribute="Normal Text" lineEndContext="#stay">
412 <IncludeRules context="_default_end"/>
413 <IncludeRules context="_av_permissions##SELinux Policy"/>
414 <IncludeRules context="_default_rule"/>
415 </context>
416 <context name="_default_end" attribute="Normal Text" lineEndContext="#stay">
417 <AnyChar context="#pop" attribute="Normal Text" String=")(" lookAhead="true"/>
418 </context>
419
420 <context name="_find_ioctl_kind" attribute="Normal Text"
421 lineEndContext="#pop!_av_permissions_statement" fallthrough="true" fallthroughContext="#pop!_av_permissions_statement">
422 <!-- ioctl is a kind in permissionx/accessx statement:
423 (permissionx permissionx_id (ioctl class_id (permission ... | expr ...))) -->
424 <RegExpr context="#pop" attribute="Type Name Statements" String="ioctl(?=\s+[&symbol;]+\s*\()"/>
425 <!-- ioctl can be a kind of permissionx or AV permission -->
426 <RegExpr context="#pop!_av_permissions_statement" attribute="Type Name Statements" String="ioctl(?=\s+[&symbol;]+\s+\d|(?:\s+[&symbol;]+)?\s*(?:$|;))"/>
427 </context>
428
429 <context name="_default_statement" attribute="Normal Text" lineEndContext="#stay">
430 <WordDetect context="_handleunknown_statement" attribute="Policy Config. Statements" String="handleunknown"/>
431 <WordDetect context="_policycap_statement" attribute="Policy Config. Statements" String="policycap"/>
432 <WordDetect context="_filecon_statement" attribute="Statements" String="filecon"/>
433 <WordDetect context="_fsuse_statement" attribute="Statements" String="fsuse"/>
434 <WordDetect context="_portcon_statement" attribute="Statements" String="portcon"/>
435 <!-- Fix permissions list if the keywords "ioctl" or "call" are not statements,
436 but a permissions (see "av_permissions" keyword list of "selinux.xml"). -->
437 <RegExpr context="_av_permissions_statement" String="\b(?:call|ioctl)\s*\)" lookAhead="true"/>
438 <WordDetect context="_find_ioctl_kind" String="ioctl" lookAhead="true"/>
439 <WordDetect context="_av_permissions_statement" attribute="Statements" String="call"/>
440
441 <keyword context="#stay" attribute="Policy Config. Statements" String="policy_config_statements"/>
442 <keyword context="#stay" attribute="Type Statements" String="type_statements"/>
443 <keyword context="#stay" attribute="Statements" String="statements"/>
444 <keyword context="#stay" attribute="Expression Keys" String="expr_keys"/>
445 <keyword context="#stay" attribute="Access Keys" String="access"/>
446
447 <keyword context="#stay" attribute="Booleans" String="booleans"/>
448 <keyword context="#stay" attribute="Type Name Statements" String="classorder_keys"/>
449 <keyword context="#stay" attribute="Type Name Statements" String="type_name"/>
450 </context>
451 <context name="_default_rule" attribute="Normal Text" lineEndContext="#stay">
452 <IncludeRules context="_common"/>
453 <keyword context="#stay" attribute="Booleans" String="booleans"/>
454 <keyword context="#stay" attribute="Special Keys" String="special_keys"/>
455
456 <StringDetect context="#stay" attribute="Other Keywords" String="&lt;root&gt;"/>
457 <StringDetect context="#stay" attribute="Other Keywords" String="&lt;node&gt;"/>
458 <StringDetect context="#stay" attribute="Other Keywords" String="&lt;src_info&gt;"/>
459 <StringDetect context="#stay" attribute="Other Keywords" String="&lt;src_cil&gt;"/>
460 <StringDetect context="#stay" attribute="Other Keywords" String="&lt;src_hll&gt;"/>
461 <keyword context="#stay" attribute="Other Keywords" String="other_keywords"/>
462 <keyword context="#stay" attribute="Filesystem" String="filesystem"/>
463
464 <IncludeRules context="_identifiers"/>
465 </context>
466 <context name="_default_rule_without_statement" attribute="Normal Text" lineEndContext="#stay">
467 <IncludeRules context="_av_permissions##SELinux Policy"/>
468 </context>
469 <context name="_default_rule_bracket" attribute="Normal Text" lineEndContext="#stay">
470 <DetectSpaces context="#stay" attribute="Normal Text"/>
471 <DetectChar context="_comment" attribute="Comment" char=";"/>
472 </context>
473
474 <!-- Levels of rule brackets.
475 Only the first word of a rule can be highlighted as a statement keyword. -->
476 <context name="_rule_bracket_level1" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_without_statement_level1" lineEndContext="#stay">
477 <IncludeRules context="_default_rule_bracket"/> <!-- Detect spaces & comments -->
478 <!-- Detect first word -->
479 <RegExpr context="#pop!_statement_level1" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
480 </context>
481 <context name="_statement_level1" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_level1" lineEndContext="#pop!_rule_level1">
482 <!-- When writing a statement and then a delimiter (like a space), go to the context "_rule_level1" -->
483 <IncludeRules context="_default_statement"/>
484 <RegExpr context="#pop!_rule_without_statement_level1" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
485 </context>
486 <context name="_rule_level1" attribute="Normal Text" lineEndContext="#stay"> <!-- Rule content -->
487 <DetectChar attribute="Brackets Level 2" context="_rule_bracket_level2" char="("/>
488 <DetectChar attribute="Brackets Level 1" context="#pop" char=")" />
489 <IncludeRules context="_default_rule"/>
490 </context>
491 <context name="_rule_without_statement_level1" attribute="Normal Text" lineEndContext="#stay">
492 <IncludeRules context="_default_rule_without_statement"/>
493 <IncludeRules context="_rule_level1"/>
494 </context>
495
496 <context name="_rule_bracket_level2" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_without_statement_level2" lineEndContext="#stay">
497 <IncludeRules context="_default_rule_bracket"/>
498 <RegExpr context="#pop!_statement_level2" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
499 </context>
500 <context name="_statement_level2" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_level2" lineEndContext="#pop!_rule_level2">
501 <IncludeRules context="_default_statement"/>
502 <RegExpr context="#pop!_rule_without_statement_level2" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
503 </context>
504 <context name="_rule_level2" attribute="Normal Text" lineEndContext="#stay">
505 <DetectChar attribute="Brackets Level 3" context="_rule_bracket_level3" char="("/>
506 <DetectChar attribute="Brackets Level 2" context="#pop" char=")" />
507 <IncludeRules context="_default_rule"/>
508 </context>
509 <context name="_rule_without_statement_level2" attribute="Normal Text" lineEndContext="#stay">
510 <IncludeRules context="_default_rule_without_statement"/>
511 <IncludeRules context="_rule_level2"/>
512 </context>
513
514 <context name="_rule_bracket_level3" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_without_statement_level3" lineEndContext="#stay">
515 <IncludeRules context="_default_rule_bracket"/>
516 <RegExpr context="#pop!_statement_level3" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
517 </context>
518 <context name="_statement_level3" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_level3" lineEndContext="#pop!_rule_level3">
519 <IncludeRules context="_default_statement"/>
520 <RegExpr context="#pop!_rule_without_statement_level3" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
521 </context>
522 <context name="_rule_level3" attribute="Normal Text" lineEndContext="#stay">
523 <DetectChar attribute="Brackets Level 4" context="_rule_bracket_level4" char="("/>
524 <DetectChar attribute="Brackets Level 3" context="#pop" char=")" />
525 <IncludeRules context="_default_rule"/>
526 </context>
527 <context name="_rule_without_statement_level3" attribute="Normal Text" lineEndContext="#stay">
528 <IncludeRules context="_default_rule_without_statement"/>
529 <IncludeRules context="_rule_level3"/>
530 </context>
531
532 <context name="_rule_bracket_level4" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_without_statement_level4" lineEndContext="#stay">
533 <IncludeRules context="_default_rule_bracket"/>
534 <RegExpr context="#pop!_statement_level4" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
535 </context>
536 <context name="_statement_level4" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_level4" lineEndContext="#pop!_rule_level4">
537 <IncludeRules context="_default_statement"/>
538 <RegExpr context="#pop!_rule_without_statement_level4" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
539 </context>
540 <context name="_rule_level4" attribute="Normal Text" lineEndContext="#stay">
541 <DetectChar attribute="Brackets Level 5" context="_rule_bracket_level5" char="("/>
542 <DetectChar attribute="Brackets Level 4" context="#pop" char=")" />
543 <IncludeRules context="_default_rule"/>
544 </context>
545 <context name="_rule_without_statement_level4" attribute="Normal Text" lineEndContext="#stay">
546 <IncludeRules context="_default_rule_without_statement"/>
547 <IncludeRules context="_rule_level4"/>
548 </context>
549
550 <context name="_rule_bracket_level5" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_without_statement_level5" lineEndContext="#stay">
551 <IncludeRules context="_default_rule_bracket"/>
552 <RegExpr context="#pop!_statement_level5" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
553 </context>
554 <context name="_statement_level5" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_level5" lineEndContext="#pop!_rule_level5">
555 <IncludeRules context="_default_statement"/>
556 <RegExpr context="#pop!_rule_without_statement_level5" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
557 </context>
558 <context name="_rule_level5" attribute="Normal Text" lineEndContext="#stay">
559 <DetectChar attribute="Brackets Level 6" context="_rule_bracket_level6" char="("/>
560 <DetectChar attribute="Brackets Level 5" context="#pop" char=")" />
561 <IncludeRules context="_default_rule"/>
562 </context>
563 <context name="_rule_without_statement_level5" attribute="Normal Text" lineEndContext="#stay">
564 <IncludeRules context="_default_rule_without_statement"/>
565 <IncludeRules context="_rule_level5"/>
566 </context>
567
568 <context name="_rule_bracket_level6" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_without_statement_level6" lineEndContext="#stay">
569 <IncludeRules context="_default_rule_bracket"/>
570 <RegExpr context="#pop!_statement_level6" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
571 </context>
572 <context name="_statement_level6" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop!_rule_level6" lineEndContext="#pop!_rule_level6">
573 <IncludeRules context="_default_statement"/>
574 <RegExpr context="#pop!_rule_without_statement_level6" attribute="Normal Text" String="&statementchar;" lookAhead="true"/>
575 </context>
576 <context name="_rule_level6" attribute="Normal Text" lineEndContext="#stay">
577 <DetectChar attribute="Brackets Level 1" context="_rule_bracket_level1" char="("/>
578 <DetectChar attribute="Brackets Level 6" context="#pop" char=")" />
579 <IncludeRules context="_default_rule"/>
580 </context>
581 <context name="_rule_without_statement_level6" attribute="Normal Text" lineEndContext="#stay">
582 <IncludeRules context="_default_rule_without_statement"/>
583 <IncludeRules context="_rule_level6"/>
584 </context>
585
586 <!-- File Contexts -->
587 <!-- user:role:type -->
588 <context name="_file_contexts" attribute="File Contexts" lineEndContext="#pop">
589 <DetectChar context="#pop!_fc_role" attribute="Normal Text" char=":"/>
590 <DetectSpaces context="#pop" attribute="Normal Text" lookAhead="true"/>
591 </context>
592 <context name="_fc_role" attribute="File Contexts" lineEndContext="#pop">
593 <DetectChar context="#pop!_fc_type" attribute="Normal Text" char=":"/>
594 <DetectSpaces context="#pop" attribute="Normal Text" lookAhead="true"/>
595 </context>
596 <context name="_fc_type" attribute="File Contexts (Type Enforcement)" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
597 <RegExpr context="#pop!_fc_mls" attribute="File Contexts (Type Enforcement)" String="&fullIdentifier;(?=\:&mlsLevel;)"/> <!-- Find Level/Range -->
598 <RegExpr context="#pop" attribute="File Contexts (Type Enforcement)" String="&fullIdentifier;"/>
599 </context>
600 <!-- (MLS/MCS) user:role:type:level -->
601 <context name="_fc_mls" attribute="File Contexts" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
602 <DetectChar context="#pop!_fc_level_range_sen" attribute="Normal Text" char=":"/>
603 </context>
604 <context name="_fc_level_range_sen" attribute="File Contexts" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
605 <RegExpr context="#pop!_fc_level_range_cat" attribute="Normal Text" String=":(?=&identifier;)"/> <!-- Find Category -->
606 <RegExpr context="#pop!_fc_level_sen" attribute="Normal Text" String="\s*\-\s*(?=&mlsLevel;)"/> <!-- Find Range -->
607 <RegExpr context="#stay" attribute="Normal Text" String="\.(?=&identifier;)"/>
608 <IncludeRules context="_default_fc_level"/>
609 </context>
610 <context name="_fc_level_range_cat" attribute="File Contexts" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
611 <RegExpr context="#pop!_fc_level_sen" attribute="Normal Text" String="\s*\-\s*(?=&mlsLevel;)"/> <!-- Find Range -->
612 <RegExpr context="#stay" attribute="Normal Text" String="(?:\.|\s*,\s*)(?=&identifier;)"/>
613 <IncludeRules context="_default_fc_level"/>
614 </context>
615 <!-- (MLS/MCS) user:role:type:level-level -->
616 <context name="_fc_level_sen" attribute="File Contexts" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
617 <RegExpr context="#pop!_fc_level_cat" attribute="Normal Text" String=":(?=&identifier;)"/> <!-- Find Category -->
618 <RegExpr context="#stay" attribute="Normal Text" String="\.(?=&identifier;)"/>
619 <IncludeRules context="_default_fc_level"/>
620 </context>
621 <context name="_fc_level_cat" attribute="File Contexts" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
622 <RegExpr context="#stay" attribute="Normal Text" String="(?:\.|\s*,\s*)(?=&identifier;)"/>
623 <IncludeRules context="_default_fc_level"/>
624 </context>
625 <context name="_default_fc_level" attribute="File Contexts" lineEndContext="#pop">
626 <RegExpr context="#stay" attribute="File Contexts" String="\w+"/>
627 <DetectChar context="#stay" attribute="File Contexts" char="-"/>
628 </context>
629
630 </contexts>
631
632 <itemDatas>
633 <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
634 <itemData name="Comment" defStyleNum="dsComment"/>
635 <itemData name="Text Quoted" defStyleNum="dsString" spellChecking="false"/>
636 <itemData name="Path" defStyleNum="dsNormal" spellChecking="false"/>
637
638 <itemData name="Statements" defStyleNum="dsKeyword" bold="1" italic="0" underline="0" spellChecking="false"/>
639 <itemData name="Type Statements" defStyleNum="dsFunction" bold="1" italic="0" underline="0" spellChecking="false"/>
640 <itemData name="Policy Config. Statements" defStyleNum="dsPreprocessor" bold="1" italic="0" underline="0" spellChecking="false"/>
641 <itemData name="Access Keys" defStyleNum="dsWarning" bold="1" italic="0" underline="0" spellChecking="false"/>
642 <itemData name="Expression Keys" defStyleNum="dsVariable" bold="1" italic="0" underline="0" spellChecking="false"/>
643 <itemData name="Type Name Statements" defStyleNum="dsDataType" bold="1" italic="0" underline="0" spellChecking="false"/>
644 <itemData name="Booleans" defStyleNum="dsExtension" bold="1" spellChecking="false"/>
645
646 <itemData name="Types" defStyleNum="dsDataType" bold="0" spellChecking="false"/>
647 <itemData name="Special Keys" defStyleNum="dsOthers" spellChecking="false"/>
648 <itemData name="File Contexts" defStyleNum="dsSpecialString" bold="0" italic="0" underline="0" spellChecking="false"/>
649 <itemData name="File Contexts (Type Enforcement)" defStyleNum="dsInformation" bold="0" italic="0" underline="0" spellChecking="false"/>
650 <itemData name="Policy Capability" defStyleNum="dsPreprocessor" bold="0" italic="0" underline="0" spellChecking="false"/>
651 <itemData name="Filesystem" defStyleNum="dsNormal" italic="1" spellChecking="false"/>
652 <itemData name="Other Keywords" defStyleNum="dsNormal" italic="1" spellChecking="false"/>
653
654 <itemData name="Number" defStyleNum="dsDecVal" spellChecking="false"/>
655 <itemData name="Hexadecimal" defStyleNum="dsBaseN" spellChecking="false"/>
656
657 <!-- Obtained from "scheme.xml" -->
658 <itemData name="Brackets Level 1" defStyleNum="dsNormal" color="#c6262e" bold="1" spellChecking="false"/>
659 <itemData name="Brackets Level 2" defStyleNum="dsNormal" color="#ff8800" bold="1" spellChecking="false"/>
660 <itemData name="Brackets Level 3" defStyleNum="dsNormal" color="#888800" bold="1" spellChecking="false"/>
661 <itemData name="Brackets Level 4" defStyleNum="dsNormal" color="#009400" bold="1" spellChecking="false"/>
662 <itemData name="Brackets Level 5" defStyleNum="dsNormal" color="#3689e6" bold="1" spellChecking="false"/>
663 <itemData name="Brackets Level 6" defStyleNum="dsNormal" color="#a56de2" bold="1" spellChecking="false"/>
664
665 <itemData name="Special Char" defStyleNum="dsSpecialChar" spellChecking="false"/>
666 <itemData name="Special Char of Brackets (Paths)" defStyleNum="dsAnnotation" bold="0" italic="0" underline="0" spellChecking="false"/>
667 <itemData name="RegExp Brackets (Paths)" defStyleNum="dsSpecialString" spellChecking="false"/>
668 <itemData name="Open RegExp Brackets (Paths)" defStyleNum="dsSpecialString" underline="1" spellChecking="false"/>
669 <itemData name="Text Quoted Open" defStyleNum="dsString" underline="1" spellChecking="false"/>
670
671 <itemData name="Error" defStyleNum="dsError" spellChecking="false"/>
672 </itemDatas>
673
674 </highlighting>
675
676 <general>
677 <keywords casesensitive="true" additionalDeliminator="&quot;&apos;&#096;" weakDeliminator="-"/>
678 <comments>
679 <comment name="singleLine" start=";"/>
680 </comments>
681 </general>
682
683 </language>
684 <!-- kate: replace-tabs off; tab-width 3; indent-width 3; remove-trailing-spaces mod; dynamic-word-wrap off; -->