<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Arduino" version="1.25" kateversion="2.4" section="Sources" extensions="*.ino" mimetype="text/plain" priority="5">
  <highlighting>
    <list name="keywords">
      <item> break </item>
      <item> case </item>
      <item> continue </item>
      <item> default </item>
      <item> do </item>
      <item> else </item>
      <item> enum </item>
      <item> extern </item>
      <item> for </item>
      <item> goto </item>
      <item> if </item>
      <item> inline </item>
      <item> return </item>
      <item> sizeof </item>
      <item> struct </item>
      <item> switch </item>
      <item> typedef </item>
      <item> union </item>
      <item> while </item>
    </list>
    
    <list name="keyword1">
     <item> boolean </item>
     <item> byte </item>
     <item> char </item>
     <item> class </item>
     <item> double </item>
     <item> false </item>
     <item> float </item>
     <item> int </item>
     <item> long </item>
     <item> new </item>
     <item> null </item>
     <item> private </item>
     <item> protected </item>
     <item> public </item>
     <item> short </item>
     <item> signed </item>
     <item> static </item>
     <item> this </item>
     <item> throw </item>
     <item> try </item>
     <item> true </item>
     <item> unsigned </item>
     <item> void </item>
     <item> word </item>
     </list>
     
     <list name="keyword2-3">
     <item> abs </item>
     <item> acos </item>
     <item> asin </item>
     <item> atan </item>
     <item> atan2 </item>
     <item> ceil </item>
     <item> constrain </item>
     <item> cos </item>
     <item> degrees </item>
     <item> exp </item>
     <item> floor </item>
     <item> log </item>
     <item> map </item>
     <item> max </item>
     <item> min </item>
     <item> radians </item>
     <item> random	 </item>
     <item> randomSeed </item>
     <item> round </item>
     <item> sin </item>
     <item> sq </item>
     <item> sqrt </item>
     <item> tan </item>
     <item> bitRead </item>
     <item> bitWrite </item>
     <item> bitSet </item>
     <item> bitClear </item>
     <item> bit </item>
     <item> highByte </item>
     <item> lowByte </item>
     <item> analogReference </item>
     <item> analogRead </item>
     <item> analogWrite </item>
     <item> attachInterrupt </item>
     <item> detachInterrupt </item>
     <item> delay </item>
     <item> delayMicroseconds </item>
     <item> digitalWrite </item>
     <item> digitalRead </item>
     <item> interrupts </item>
     <item> millis </item>
     <item> micros </item>
     <item> noInterrupts </item>
     <item> noTone </item>
     <item> pinMode </item>
     <item> pulseIn </item>
     <item> shiftOut </item>
     <item> tone </item>
     <item> Serial </item>
     <item> Serial1 </item>
     <item> Serial2 </item>
     <item> Serial3 </item>
     <item> begin </item>
     <item> end </item>
     <item> read </item>
     <item> print </item>
     <item> println </item>
     <item> available </item>
     <item> flush </item>
     <item> setup </item>
     <item> loop </item>
     </list>

     <list name="constant">
	<item> HIGH </item>
	<item> LOW </item>
	<item> INPUT </item>
	<item> OUTPUT </item>
	<item> DEC </item>
	<item> BIN </item>
	<item> HEX </item>
	<item> OCT </item>
	<item> BYTE </item>
	<item> PI </item>
	<item> HALF_PI </item>
	<item> TWO_PI </item>
	<item> LSBFIRST </item>
	<item> MSBFIRST </item>
	<item> CHANGE </item>
	<item> FALLING </item>
	<item> RISING </item>
	<item> DEFAULT </item>
	<item> EXTERNAL </item>
	<item> INTERAL </item>
    </list>

    <list name="types">
      <item> auto </item>
      <item> char </item>
      <item> const </item>
      <item> double </item>
      <item> float </item>
      <item> int </item>
      <item> long </item>
      <item> register </item>
      <item> restrict </item>
      <item> short </item>
      <item> signed </item>
      <item> static </item>
      <item> unsigned </item>
      <item> void </item>
      <item> volatile </item>
      <item> int8_t </item>
      <item> int16_t </item>
      <item> int32_t </item>
      <item> int64_t </item>
      <item> uint8_t </item>
      <item> uint16_t </item>
      <item> uint32_t </item>
      <item> uint64_t </item>
      <item> wchar_t </item>
      <item> _Imaginary </item>
      <item> _Complex </item>
      <item> _Bool </item>
    </list>
    <contexts>
      <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
        <DetectSpaces />
	      <RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="Outscoped" firstNonSpace="true" />
        <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" firstNonSpace="true" />
        <StringDetect attribute="Region Marker" context="Region Marker" String="//BEGIN" beginRegion="Region1" firstNonSpace="true" />
        <StringDetect attribute="Region Marker" context="Region Marker" String="//END" endRegion="Region1" firstNonSpace="true" />
        <keyword attribute="Keyword" context="#stay" String="keywords"/>
        <keyword attribute="Keyword" context="#stay" String="keyword1"/>
        <keyword attribute="Data Types" context="#stay" String="types"/>
        <keyword attribute="Constant" context="#stay" String="constant"/>      
	      <keyword attribute="Functions" context="#stay" String="keyword2-3"/>
        <DetectIdentifier />
        <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
        <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
        <Float attribute="Float" context="#stay">
          <AnyChar String="fF" attribute="Float" context="#stay"/>
        </Float>
        <HlCOct attribute="Octal" context="#stay"/>
        <HlCHex attribute="Hex" context="#stay"/>
        <Int attribute="Number" context="#stay"/>
        <Int attribute="Decimal" context="#stay" >
          <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
          <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
        </Int>
        <HlCChar attribute="Char" context="#stay"/>
        <DetectChar attribute="String" context="String" char="&quot;"/>
        <IncludeRules context="##Doxygen" />
        <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
        <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
        <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
      </context>
      <context attribute="String" lineEndContext="#pop" name="String">
        <LineContinue attribute="String" context="#stay"/>
        <HlCStringChar attribute="String Char" context="#stay"/>
        <DetectChar attribute="String" context="#pop" char="&quot;"/>
      </context>
      <context attribute="Region Marker" lineEndContext="#pop" name="Region Marker">
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
        <IncludeRules context="##Alerts" />
      </context>
      <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
        <IncludeRules context="##Alerts" />
      </context>
      <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
        <LineContinue attribute="Preprocessor" context="#stay"/>
        <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/>
        <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/>
        <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
        <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
        <IncludeRules context="##Doxygen" />
        <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2"/>
      </context>
      <context attribute="Preprocessor" lineEndContext="#pop" name="Define">
        <LineContinue attribute="Preprocessor" context="#stay"/>
      </context>
      <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />
      </context>
      <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >
        <DetectSpaces />
        <IncludeRules context="##Alerts" />
        <DetectIdentifier />
        <DetectChar attribute="String" context="String" char="&quot;"/>
        <IncludeRules context="##Doxygen" />
        <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
        <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" />
        <RegExpr attribute="Preprocessor" context="#pop" String="#\s*(endif|else|elif)" endRegion="Outscoped" firstNonSpace="true" />
      </context>
      <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
        <DetectSpaces />
        <IncludeRules context="##Alerts" />
        <DetectIdentifier />
        <DetectChar attribute="String" context="String" char="&quot;"/>
        <IncludeRules context="##Doxygen" />
        <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
        <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
        <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" />
        <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="Outscoped" firstNonSpace="true" />
      </context>
    </contexts>
    <itemDatas>
      <itemData name="Normal Text"  defStyleNum="dsNormal"/>
      <itemData name="Keyword"      defStyleNum="dsKeyword"/>
      <itemData name="Data Types"   defStyleNum="dsDataType"/>
      <itemData name="Number"       defStyleNum="dsDecVal"/>
      <itemData name="Decimal"      defStyleNum="dsDecVal"/>
      <itemData name="Octal"        defStyleNum="dsBaseN"/>
      <itemData name="Hex"          defStyleNum="dsBaseN"/>
      <itemData name="Float"        defStyleNum="dsFloat"/>
      <itemData name="Char"         defStyleNum="dsChar"/>
      <itemData name="String"       defStyleNum="dsString"/>
      <itemData name="String Char"  defStyleNum="dsChar"/>
      <itemData name="Comment"      defStyleNum="dsComment"/>
      <itemData name="Symbol"       defStyleNum="dsNormal"/>
      <itemData name="Preprocessor" defStyleNum="dsOthers"/>
      <itemData name="Prep. Lib"    defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->
      <itemData name="Alert"        defStyleNum="dsAlert" />
      <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
      <itemData name="Constant" defStyleNum="dsConstant"/>
      <itemData name="Functions" defStyleNum="dsFunction"/>

    </itemDatas>
  </highlighting>
  <general>
    <comments>
      <comment name="singleLine" start="//" />
      <comment name="multiLine" start="/*" end="*/" />
    </comments>
    <keywords casesensitive="1" additionalDeliminator="'&quot;" />
  </general>
</language>
