cpp.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <?xml version="1.0"?>
  2. <!-- $Id: cpp.xml,v 1.1 2007/06/03 02:35:28 ssttoo Exp $ -->
  3. <highlight lang="CPP" case="no">
  4. <authors>
  5. <author name="Aaron Kalin"/>
  6. <author name="Andrey Demenev" email="demenev@gmail.com"/>
  7. </authors>
  8. <comment>
  9. Thanks to Aaron Kalin for initial
  10. implementation of this highlighter
  11. </comment>
  12. <default innerClass="code" />
  13. <block name="escaped" match="\\" innerClass="special" contained="yes">
  14. <onlyin region="strdouble"/>
  15. </block>
  16. <region name="strdouble" delimClass="quotes" innerClass="string" start="&quot;" end="&quot;"/>
  17. <region name="block" delimClass="brackets" innerClass="code" start="\{" end="\}">
  18. <contains all="yes"/>
  19. </region>
  20. <region name="brackets" delimClass="brackets" innerClass="code" start="\(" end="\)">
  21. <contains all="yes"/>
  22. </region>
  23. <region name="sqbrackets" delimClass="brackets" innerClass="code" start="\[" end="\]">
  24. <contains all="yes"/>
  25. </region>
  26. <block name="identifier" match="[a-z_]\w*" innerClass="identifier" case="no"/>
  27. <block name="hexinteger" match="\b0[xX][\da-f]+" innerClass="number" contained="yes"/>
  28. <block name="integer" match="\b\d\d*|\b0\b" innerClass="number" contained="yes"/>
  29. <block name="octinteger" match="\b0[0-7]+" innerClass="number" contained="yes"/>
  30. <block name="float" match="\b(\d*\.\d+)|(\d+\.\d*)" innerClass="number" contained="yes"/>
  31. <region name="strincl" delimClass="quotes" innerClass="string" start="&lt;" end="&gt;">
  32. <onlyin region="include" />
  33. </region>
  34. <!-- <block name="preprocessor" match="^#[azAZ_]\w*" innerClass="prepro"/> -->
  35. <region name="include" innerClass="prepro" start="/^[ \t]*#include/m" end="/(?&lt;!\\)$/m">
  36. <contains region="strdouble"/>
  37. <contains region="strincl"/>
  38. </region>
  39. <region name="preprocessor" delimClass="prepro" innerClass="code" start="/^[ \t]*#[ \t]*[a-z]+/mi" end="/(?&lt;!\\)$/m">
  40. <contains region="comment"/>
  41. <contains region="mlcomment"/>
  42. <contains region="strdouble"/>
  43. <contains region="brackets"/>
  44. <contains region="block"/>
  45. <contains block="identifier"/>
  46. <contains block="integer"/>
  47. <contains block="hexinteger"/>
  48. <contains block="octinteger"/>
  49. <contains block="float"/>
  50. </region>
  51. <block name="number" match="\d*\.?\d+" innerClass="number"/>
  52. <region name="mlcomment" innerClass="mlcomment" start="\/\*" end="\*\/" >
  53. <contains block="cvstag"/>
  54. </region>
  55. <block name="cvstag" match="\$\w+\s*:.+\$" innerClass="inlinedoc">
  56. <onlyin region="mlcomment"/>
  57. <onlyin region="comment"/>
  58. </block>
  59. <region name="comment" start="\/\/.+" end="/$/m" innerClass="comment" delimClass="comment">
  60. <contains block="cvstag"/>
  61. </region>
  62. <keywords name="reserved" inherits="identifier" innerClass="reserved" case="yes">
  63. <keyword match="and" />
  64. <keyword match="and_eq" />
  65. <keyword match="asm" />
  66. <keyword match="bitand" />
  67. <keyword match="bitor" />
  68. <keyword match="break" />
  69. <keyword match="case" />
  70. <keyword match="catch" />
  71. <keyword match="compl" />
  72. <keyword match="const_cast" />
  73. <keyword match="continue" />
  74. <keyword match="default" />
  75. <keyword match="delete" />
  76. <keyword match="do" />
  77. <keyword match="dynamic_cast" />
  78. <keyword match="else" />
  79. <keyword match="for" />
  80. <keyword match="fortran" />
  81. <keyword match="friend" />
  82. <keyword match="goto" />
  83. <keyword match="if" />
  84. <keyword match="new" />
  85. <keyword match="not" />
  86. <keyword match="not_eq" />
  87. <keyword match="operator" />
  88. <keyword match="or" />
  89. <keyword match="or_eq" />
  90. <keyword match="private" />
  91. <keyword match="protected" />
  92. <keyword match="public" />
  93. <keyword match="reinterpret_cast" />
  94. <keyword match="return" />
  95. <keyword match="sizeof" />
  96. <keyword match="static_cast" />
  97. <keyword match="switch" />
  98. <keyword match="this" />
  99. <keyword match="throw" />
  100. <keyword match="try" />
  101. <keyword match="typeid" />
  102. <keyword match="using" />
  103. <keyword match="while" />
  104. <keyword match="xor" />
  105. <keyword match="xor_eq" />
  106. <keyword match="false" />
  107. <keyword match="true" />
  108. </keywords>
  109. <keywords name="types" inherits="identifier" innerClass="types" case="yes">
  110. <keyword match="auto" />
  111. <keyword match="bool" />
  112. <keyword match="char" />
  113. <keyword match="class" />
  114. <keyword match="const" />
  115. <keyword match="double" />
  116. <keyword match="enum" />
  117. <keyword match="explicit" />
  118. <keyword match="export" />
  119. <keyword match="extern" />
  120. <keyword match="float" />
  121. <keyword match="inline" />
  122. <keyword match="int" />
  123. <keyword match="long" />
  124. <keyword match="mutable" />
  125. <keyword match="namespace" />
  126. <keyword match="register" />
  127. <keyword match="short" />
  128. <keyword match="signed" />
  129. <keyword match="static" />
  130. <keyword match="struct" />
  131. <keyword match="template" />
  132. <keyword match="typedef" />
  133. <keyword match="typename" />
  134. <keyword match="union" />
  135. <keyword match="unsigned" />
  136. <keyword match="virtual" />
  137. <keyword match="void" />
  138. <keyword match="volatile" />
  139. <keyword match="wchar_t" />
  140. </keywords>
  141. <keywords name="Common Macros" inherits="identifier" innerClass="prepro" case="yes">
  142. <keyword match="NULL" />
  143. <keyword match="TRUE" />
  144. <keyword match="FALSE" />
  145. <keyword match="MAX" />
  146. <keyword match="MIN" />
  147. <keyword match="__LINE__" />
  148. <keyword match="__DATA__" />
  149. <keyword match="__FILE__" />
  150. <keyword match="__TIME__" />
  151. <keyword match="__STDC__" />
  152. </keywords>
  153. <!--
  154. <keywords name="reserved" inherits="identifier" innerClass="reserved" case="yes">
  155. -->
  156. </highlight>