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