Warning, /frameworks/syntax-highlighting/data/syntax/antlr.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language>
0003 
0004 <!--
0005   SPDX-FileCopyrightText: 2023 Andrzej Borucki <borucki.andrzej@gmail.com>
0006   SPDX-License-Identifier: MIT
0007 -->
0008 
0009 
0010 <language name="ANTLR"
0011           section="Sources" 
0012           version="2"
0013           kateversion="5.62"
0014           extensions="*.g4"
0015           mimetype="" 
0016           priority="1"
0017           author="Andrzej Borucki (borucki.andrzej@gmail.com)"
0018           license="MIT"
0019           >
0020 
0021   <highlighting>
0022     <list name="keywords">
0023       <item>import</item>
0024       <item>fragment</item>
0025       <item>lexer</item>
0026       <item>parser</item>
0027       <item>grammar</item>
0028       <item>protected</item>
0029       <item>public</item>
0030       <item>private</item>
0031       <item>returns</item>
0032       <item>locals</item>
0033       <item>throws</item>
0034       <item>catch</item>
0035       <item>finally</item>
0036       <item>mode</item>
0037     </list>
0038 
0039     <contexts>
0040       <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
0041         <DetectSpaces/>
0042         <IncludeRules context="match keywords" />
0043         <IncludeRules context="match attributes" />
0044         <IncludeRules context="match symbol" />
0045         <IncludeRules context="find literal" />
0046         <IncludeRules context="find charset" />
0047         <IncludeRules context="MatchComment" />
0048         <DetectIdentifier/>
0049       </context>
0050 
0051       <context name="match keywords" attribute="Normal Text" lineEndContext="#pop">
0052         <keyword attribute="Keyword" context="#stay" String="keywords"/>
0053       </context>
0054 
0055       <context name="find literal" attribute="Normal Text" lineEndContext="#pop">
0056         <DetectChar attribute="String" context="match literal" char="&apos;" />
0057       </context>
0058 
0059       <context name="match literal" attribute="String" lineEndContext="#pop">
0060         <Detect2Chars attribute="String" char="\" char1="\" />
0061         <Detect2Chars attribute="String" char="\" char1="&apos;" />
0062         <DetectChar attribute="String" context="#pop" char="&apos;" />
0063       </context>
0064 
0065       <context name="find charset" attribute="Normal Text" lineEndContext="#pop">
0066         <DetectChar attribute="Charset" context="match charset" char="[" />
0067       </context>
0068 
0069       <context name="match charset" attribute="Charset" lineEndContext="#pop">
0070         <Detect2Chars attribute="Charset" char="\" char1="\" />
0071         <Detect2Chars attribute="Charset" char="\" char1="]" />
0072         <DetectChar attribute="Charset" context="#pop" char="]" />
0073       </context>
0074 
0075       <context name="match attributes" attribute="Normal Text" lineEndContext="#pop">
0076         <RegExpr attribute="Attribute" context="#stay" String="(options|tokens|channels)(?=([\s]*{))" />
0077       </context>
0078 
0079       <context name="match symbol" attribute="Normal Text" lineEndContext="#stay">
0080         <Detect2Chars attribute="Symbol" context="#stay" char="-" char1="&gt;"/>
0081         <AnyChar attribute="Symbol" context="#stay" String="{};=,:|*?()+~"/>
0082       </context>
0083 
0084       <context name="MatchComment" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop">
0085         <Detect2Chars attribute="Comment" context="#pop!Comment 1" char="/" char1="/" />
0086         <Detect2Chars attribute="Comment" context="#pop!Comment 2" char="/" char1="*" beginRegion="Comment" />
0087       </context>
0088 
0089       <context name="Comment 1" attribute="Comment" lineEndContext="#pop">
0090         <LineContinue attribute="Comment" context="#stay"/>
0091         <IncludeRules context="##Comments" />
0092       </context>
0093 
0094       <context name="Comment 2" attribute="Comment" lineEndContext="#stay">
0095         <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
0096         <IncludeRules context="##Comments" />
0097       </context>
0098     </contexts>
0099     <itemDatas>
0100       <itemData name="Normal Text"  defStyleNum="dsNormal" spellChecking="false"/>
0101       <itemData name="Comment"      defStyleNum="dsComment"/>
0102       <itemData name="Keyword"      defStyleNum="dsKeyword" spellChecking="false"/>
0103       <itemData name="String"       defStyleNum="dsString" spellChecking="false"/>
0104       <itemData name="Charset"      defStyleNum="dsChar" spellChecking="false"/>
0105       <itemData name="Attribute"    defStyleNum="dsAttribute" spellChecking="false"/>
0106       <itemData name="Symbol"       defStyleNum="dsOperator" spellChecking="false"/>
0107     </itemDatas>
0108   </highlighting>
0109   <general>
0110     <comments>
0111       <comment name="singleLine" start="//" position="afterwhitespace" />
0112       <comment name="multiLine" start="/*" end="*/" region="Comment" />
0113     </comments>
0114   </general>
0115 
0116 </language>