PageRenderTime 110ms CodeModel.GetById 104ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-3-pre5/modes/c.xml

#
XML | 185 lines | 181 code | 3 blank | 1 comment | 0 complexity | 84e92be33d2e11baa1a9c0ab1510922f MD5 | raw file
  1<?xml version="1.0"?>
  2
  3<!DOCTYPE MODE SYSTEM "xmode.dtd">
  4
  5<MODE>
  6    <PROPS>
  7        <PROPERTY NAME="commentStart" VALUE="/*" />
  8        <PROPERTY NAME="commentEnd" VALUE="*/" />
  9        <PROPERTY NAME="lineComment" VALUE="//" />
 10        <PROPERTY NAME="wordBreakChars" VALUE=",+-=&lt;&gt;/?^&amp;*" />
 11
 12	<!-- Auto indent -->
 13	<PROPERTY NAME="indentOpenBrackets" VALUE="{" />
 14	<PROPERTY NAME="indentCloseBrackets" VALUE="}" />
 15	<PROPERTY NAME="unalignedOpenBrackets" VALUE="(" />
 16	<PROPERTY NAME="unalignedCloseBrackets" VALUE=")" />
 17	<PROPERTY NAME="indentNextLine"
 18		VALUE="\s*(((if|while)\s*\(|else\s*|else\s+if\s*\(|for\s*\(.*\))[^{;]*)" />
 19	<PROPERTY NAME="unindentThisLine"
 20		VALUE="^.*(default:\s*|case.*:.*)$" />
 21	<PROPERTY NAME="electricKeys" VALUE=":" />
 22    </PROPS>
 23    <RULES ESCAPE="\"
 24        IGNORE_CASE="FALSE"
 25        HIGHLIGHT_DIGITS="TRUE"
 26        DIGIT_RE="(0x\p{XDigit}+[lL]?|\d+(e\d*)?[lLdDfF]?)">
 27
 28        <!-- Silly comment -->
 29	<SEQ TYPE="COMMENT1">/**/</SEQ>
 30
 31	<!-- Doxygen comment, Javadoc style -->
 32        <SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">
 33            <BEGIN>/**</BEGIN>
 34            <END>*/</END>
 35        </SPAN>
 36
 37        <!-- Doxygen comment, Qt style -->
 38        <SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">
 39            <BEGIN>/*!</BEGIN>
 40            <END>*/</END>
 41        </SPAN>
 42
 43        <!-- C style comment -->
 44        <SPAN TYPE="COMMENT1">
 45            <BEGIN>/*</BEGIN>
 46            <END>*/</END>
 47        </SPAN>
 48
 49        <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
 50            <BEGIN>"</BEGIN>
 51            <END>"</END>
 52        </SPAN>
 53        <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
 54            <BEGIN>'</BEGIN>
 55            <END>'</END>
 56        </SPAN>
 57
 58        <!-- preprocessor statements -->
 59        <SEQ TYPE="KEYWORD2">##</SEQ>
 60        <EOL_SPAN TYPE="KEYWORD2" DELEGATE="CPP">#</EOL_SPAN>
 61
 62        <EOL_SPAN TYPE="COMMENT2">//</EOL_SPAN>
 63        <SEQ TYPE="OPERATOR">=</SEQ>
 64        <SEQ TYPE="OPERATOR">!</SEQ>
 65        <SEQ TYPE="OPERATOR">&gt;=</SEQ>
 66        <SEQ TYPE="OPERATOR">&lt;=</SEQ>
 67        <SEQ TYPE="OPERATOR">+</SEQ>
 68        <SEQ TYPE="OPERATOR">-</SEQ>
 69        <SEQ TYPE="OPERATOR">/</SEQ>
 70
 71        <SEQ TYPE="OPERATOR">*</SEQ>
 72        <SEQ TYPE="OPERATOR">&gt;</SEQ>
 73        <SEQ TYPE="OPERATOR">&lt;</SEQ>
 74        <SEQ TYPE="OPERATOR">%</SEQ>
 75        <SEQ TYPE="OPERATOR">&amp;</SEQ>
 76        <SEQ TYPE="OPERATOR">|</SEQ>
 77        <SEQ TYPE="OPERATOR">^</SEQ>
 78        <SEQ TYPE="OPERATOR">~</SEQ>
 79        <SEQ TYPE="OPERATOR">}</SEQ>
 80        <SEQ TYPE="OPERATOR">{</SEQ>
 81        <MARK_PREVIOUS AT_WHITESPACE_END="TRUE"
 82            EXCLUDE_MATCH="TRUE"
 83            TYPE="LABEL">:</MARK_PREVIOUS>
 84
 85        <!-- Function calls -->
 86        <MARK_PREVIOUS TYPE="FUNCTION" EXCLUDE_MATCH="TRUE">(</MARK_PREVIOUS>
 87
 88        <KEYWORDS>
 89            <KEYWORD3>char</KEYWORD3>
 90            <KEYWORD3>double</KEYWORD3>
 91            <KEYWORD3>enum</KEYWORD3>
 92            <KEYWORD3>float</KEYWORD3>
 93            <KEYWORD3>int</KEYWORD3>
 94            <KEYWORD3>long</KEYWORD3>
 95            <KEYWORD3>short</KEYWORD3>
 96            <KEYWORD3>signed</KEYWORD3>
 97            <KEYWORD3>struct</KEYWORD3>
 98            <KEYWORD3>typedef</KEYWORD3>
 99            <KEYWORD3>union</KEYWORD3>
100            <KEYWORD3>unsigned</KEYWORD3>
101            <KEYWORD3>void</KEYWORD3>
102            <KEYWORD1>auto</KEYWORD1>
103            <KEYWORD1>const</KEYWORD1>
104            <KEYWORD1>extern</KEYWORD1>
105            <KEYWORD1>register</KEYWORD1>
106            <KEYWORD1>static</KEYWORD1>
107            <KEYWORD1>volatile</KEYWORD1>
108            <KEYWORD1>break</KEYWORD1>
109            <KEYWORD1>case</KEYWORD1>
110            <KEYWORD1>continue</KEYWORD1>
111            <KEYWORD1>default</KEYWORD1>
112            <KEYWORD1>do</KEYWORD1>
113            <KEYWORD1>else</KEYWORD1>
114            <KEYWORD1>for</KEYWORD1>
115            <KEYWORD1>goto</KEYWORD1>
116            <KEYWORD1>if</KEYWORD1>
117            <KEYWORD1>return</KEYWORD1>
118            <KEYWORD1>sizeof</KEYWORD1>
119            <KEYWORD1>switch</KEYWORD1>
120            <KEYWORD1>while</KEYWORD1>
121            <KEYWORD2>asm</KEYWORD2>
122            <KEYWORD2>asmlinkage</KEYWORD2>
123            <KEYWORD2>far</KEYWORD2>
124            <KEYWORD2>huge</KEYWORD2>
125            <KEYWORD2>inline</KEYWORD2>
126            <KEYWORD2>near</KEYWORD2>
127            <KEYWORD2>pascal</KEYWORD2>
128            <LITERAL2>true</LITERAL2>
129            <LITERAL2>false</LITERAL2>
130            <LITERAL2>NULL</LITERAL2>
131        </KEYWORDS>
132    </RULES>
133
134    <RULES SET="CPP" DEFAULT="KEYWORD2" IGNORE_CASE="FALSE"
135        HIGHLIGHT_DIGITS="TRUE"
136        DIGIT_RE="(0x\p{XDigit}+[lL]?|\d+(e\d*)?[lLdDfF]?)">
137        <!-- Doxygen comment, Javadoc style -->
138        <SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">
139            <BEGIN>/**</BEGIN>
140            <END>*/</END>
141        </SPAN>
142        <!-- Doxygen comment, Qt style -->
143        <SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">
144            <BEGIN>/*!</BEGIN>
145            <END>*/</END>
146        </SPAN>
147        <!-- C style comment -->
148        <SPAN TYPE="COMMENT1">
149            <BEGIN>/*</BEGIN>
150            <END>*/</END>
151        </SPAN>
152
153        <!-- this is a hack so that #include <net/if.h> does not get
154             the if highlighted -->
155        <EOL_SPAN TYPE="MARKUP" DELEGATE="INCLUDE">include</EOL_SPAN>
156
157        <!-- Directives -->
158        <KEYWORDS>
159            <MARKUP>assert</MARKUP>
160            <MARKUP>define</MARKUP>
161            <MARKUP>assert</MARKUP>
162            <MARKUP>define</MARKUP>
163            <MARKUP>elif</MARKUP>
164            <MARKUP>else</MARKUP>
165            <MARKUP>endif</MARKUP>
166            <MARKUP>error</MARKUP>
167            <MARKUP>ident</MARKUP>
168            <MARKUP>if</MARKUP>
169            <MARKUP>ifdef</MARKUP>
170            <MARKUP>ifndef</MARKUP>
171            <MARKUP>import</MARKUP>
172            <MARKUP>include</MARKUP>
173            <MARKUP>include_next</MARKUP>
174            <MARKUP>line</MARKUP>
175            <MARKUP>pragma</MARKUP>
176            <MARKUP>sccs</MARKUP>
177            <MARKUP>unassert</MARKUP>
178            <MARKUP>undef</MARKUP>
179            <MARKUP>warning</MARKUP>
180        </KEYWORDS>
181    </RULES>
182
183    <RULES SET="INCLUDE" DEFAULT="KEYWORD2" />
184
185</MODE>