2 <!-- $Id: cpp.xml,v 1.2 2008-07-31 23:06:30 ssttoo Exp $ -->
4 <highlight lang="CPP" case="no">
7 <author name="Aaron Kalin"/>
8 <author name="Andrey Demenev" email="demenev@gmail.com"/>
12 Thanks to Aaron Kalin for initial
13 implementation of this highlighter
16 <default innerClass="code" />
18 <block name="escaped" match="\\" innerClass="special" contained="yes">
19 <onlyin region="strdouble"/>
22 <region name="strdouble" delimClass="quotes" innerClass="string" start=""" end="""/>
24 <region name="block" delimClass="brackets" innerClass="code" start="\{" end="\}">
28 <region name="brackets" delimClass="brackets" innerClass="code" start="\(" end="\)">
32 <region name="sqbrackets" delimClass="brackets" innerClass="code" start="\[" end="\]">
36 <block name="identifier" match="[a-z_]\w*" innerClass="identifier" case="no"/>
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"/>
44 <region name="strincl" delimClass="quotes" innerClass="string" start="<" end=">">
45 <onlyin region="include" />
48 <!-- <block name="preprocessor" match="^#[azAZ_]\w*" innerClass="prepro"/> -->
49 <region name="include" innerClass="prepro" start="/^[ \t]*#include/m" end="/(?<!\\)$/m">
50 <contains region="strdouble"/>
51 <contains region="strincl"/>
54 <region name="preprocessor" delimClass="prepro" innerClass="code" start="/^[ \t]*#[ \t]*[a-z]+/mi" end="/(?<!\\)$/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"/>
68 <block name="number" match="\d*\.?\d+" innerClass="number"/>
71 <region name="mlcomment" innerClass="mlcomment" start="\/\*" end="\*\/" >
72 <contains block="cvstag"/>
75 <block name="cvstag" match="\$\w+\s*:.+\$" innerClass="inlinedoc">
77 <onlyin region="mlcomment"/>
78 <onlyin region="comment"/>
81 <region name="comment" start="\/\/.+" end="/$/m" innerClass="comment" delimClass="comment">
82 <contains block="cvstag"/>
85 <keywords name="reserved" inherits="identifier" innerClass="reserved" case="yes">
86 <keyword match="and" />
87 <keyword match="and_eq" />
88 <keyword match="asm" />
90 <keyword match="bitand" />
91 <keyword match="bitor" />
92 <keyword match="break" />
93 <keyword match="case" />
94 <keyword match="catch" />
95 <keyword match="compl" />
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" />
104 <keyword match="else" />
105 <keyword match="for" />
106 <keyword match="fortran" />
107 <keyword match="friend" />
108 <keyword match="goto" />
109 <keyword match="if" />
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" />
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" />
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" />
132 <keyword match="using" />
133 <keyword match="while" />
134 <keyword match="xor" />
135 <keyword match="xor_eq" />
137 <keyword match="false" />
138 <keyword match="true" />
141 <keywords name="types" inherits="identifier" innerClass="types" case="yes">
143 <keyword match="auto" />
144 <keyword match="bool" />
145 <keyword match="char" />
146 <keyword match="class" />
147 <keyword match="const" />
148 <keyword match="double" />
150 <keyword match="enum" />
151 <keyword match="explicit" />
152 <keyword match="export" />
153 <keyword match="extern" />
154 <keyword match="float" />
155 <keyword match="inline" />
157 <keyword match="int" />
158 <keyword match="long" />
159 <keyword match="mutable" />
160 <keyword match="namespace" />
161 <keyword match="register" />
162 <keyword match="short" />
164 <keyword match="signed" />
165 <keyword match="static" />
166 <keyword match="struct" />
167 <keyword match="template" />
168 <keyword match="typedef" />
169 <keyword match="typename" />
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" />
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" />
186 <keyword match="MIN" />
187 <keyword match="__LINE__" />
188 <keyword match="__DATA__" />
189 <keyword match="__FILE__" />
190 <keyword match="__TIME__" />
191 <keyword match="__STDC__" />
197 <keywords name="reserved" inherits="identifier" innerClass="reserved" case="yes">