1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language>
<!--
SPDX-FileCopyrightText: 2023 Andrzej Borucki <borucki.andrzej@gmail.com>
SPDX-License-Identifier: MIT
-->
<language name="ANTLR"
section="Sources"
version="2"
kateversion="5.62"
extensions="*.g4"
mimetype=""
priority="1"
author="Andrzej Borucki (borucki.andrzej@gmail.com)"
license="MIT"
>
<highlighting>
<list name="keywords">
<item>import</item>
<item>fragment</item>
<item>lexer</item>
<item>parser</item>
<item>grammar</item>
<item>protected</item>
<item>public</item>
<item>private</item>
<item>returns</item>
<item>locals</item>
<item>throws</item>
<item>catch</item>
<item>finally</item>
<item>mode</item>
</list>
<contexts>
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
<DetectSpaces/>
<IncludeRules context="match keywords" />
<IncludeRules context="match attributes" />
<IncludeRules context="match symbol" />
<IncludeRules context="find literal" />
<IncludeRules context="find charset" />
<IncludeRules context="MatchComment" />
<DetectIdentifier/>
</context>
<context name="match keywords" attribute="Normal Text" lineEndContext="#pop">
<keyword attribute="Keyword" context="#stay" String="keywords"/>
</context>
<context name="find literal" attribute="Normal Text" lineEndContext="#pop">
<DetectChar attribute="String" context="match literal" char="'" />
</context>
<context name="match literal" attribute="String" lineEndContext="#pop">
<Detect2Chars attribute="String" char="\" char1="\" />
<Detect2Chars attribute="String" char="\" char1="'" />
<DetectChar attribute="String" context="#pop" char="'" />
</context>
<context name="find charset" attribute="Normal Text" lineEndContext="#pop">
<DetectChar attribute="Charset" context="match charset" char="[" />
</context>
<context name="match charset" attribute="Charset" lineEndContext="#pop">
<Detect2Chars attribute="Charset" char="\" char1="\" />
<Detect2Chars attribute="Charset" char="\" char1="]" />
<DetectChar attribute="Charset" context="#pop" char="]" />
</context>
<context name="match attributes" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Attribute" context="#stay" String="(options|tokens|channels)(?=([\s]*{))" />
</context>
<context name="match symbol" attribute="Normal Text" lineEndContext="#stay">
<Detect2Chars attribute="Symbol" context="#stay" char="-" char1=">"/>
<AnyChar attribute="Symbol" context="#stay" String="{};=,:|*?()+~"/>
</context>
<context name="MatchComment" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop">
<Detect2Chars attribute="Comment" context="#pop!Comment 1" char="/" char1="/" />
<Detect2Chars attribute="Comment" context="#pop!Comment 2" char="/" char1="*" beginRegion="Comment" />
</context>
<context name="Comment 1" attribute="Comment" lineEndContext="#pop">
<LineContinue attribute="Comment" context="#stay"/>
<IncludeRules context="##Comments" />
</context>
<context name="Comment 2" attribute="Comment" lineEndContext="#stay">
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
<IncludeRules context="##Comments" />
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="String" defStyleNum="dsString" spellChecking="false"/>
<itemData name="Charset" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="Attribute" defStyleNum="dsAttribute" spellChecking="false"/>
<itemData name="Symbol" defStyleNum="dsOperator" spellChecking="false"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="//" position="afterwhitespace" />
<comment name="multiLine" start="/*" end="*/" region="Comment" />
</comments>
</general>
</language>
|