PageRenderTime 17ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/modes/c.xml

#
XML | 156 lines | 151 code | 3 blank | 2 comment | 0 complexity | 47f63cac6fff0eebdeb5fc5a2fdbba3f 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="indentNextLine"
 16			VALUE="\s*(((if|while)\s*\(|else\s*|else\s+if\s*\(|for\s*\(.*\))[^{;]*)" />
 17		<!-- set this to 'true' if you want to use GNU coding style -->
 18		<PROPERTY NAME="doubleBracketIndent" VALUE="false" />
 19		<PROPERTY NAME="lineUpClosingBracket" VALUE="true" />
 20	</PROPS>
 21	<RULES ESCAPE="\"
 22		IGNORE_CASE="FALSE"
 23		HIGHLIGHT_DIGITS="TRUE"
 24		DIGIT_RE="(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)">
 25
 26		<!-- C style comment -->
 27		<SPAN TYPE="COMMENT1">
 28			<BEGIN>/*</BEGIN>
 29			<END>*/</END>
 30		</SPAN>
 31
 32		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
 33			<BEGIN>"</BEGIN>
 34			<END>"</END>
 35		</SPAN>
 36		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
 37			<BEGIN>'</BEGIN>
 38			<END>'</END>
 39		</SPAN>
 40
 41		<!-- preprocessor statements -->
 42		<EOL_SPAN TYPE="KEYWORD2" DELEGATE="CPP">#</EOL_SPAN>
 43
 44		<EOL_SPAN TYPE="COMMENT2">//</EOL_SPAN>
 45		<SEQ TYPE="OPERATOR">=</SEQ>
 46		<SEQ TYPE="OPERATOR">!</SEQ>
 47		<SEQ TYPE="OPERATOR">&gt;=</SEQ>
 48		<SEQ TYPE="OPERATOR">&lt;=</SEQ>
 49		<SEQ TYPE="OPERATOR">+</SEQ>
 50		<SEQ TYPE="OPERATOR">-</SEQ>
 51		<SEQ TYPE="OPERATOR">/</SEQ>
 52
 53		<SEQ TYPE="OPERATOR">*</SEQ>
 54		<SEQ TYPE="OPERATOR">&gt;</SEQ>
 55		<SEQ TYPE="OPERATOR">&lt;</SEQ>
 56		<SEQ TYPE="OPERATOR">%</SEQ>
 57		<SEQ TYPE="OPERATOR">&amp;</SEQ>
 58		<SEQ TYPE="OPERATOR">|</SEQ>
 59		<SEQ TYPE="OPERATOR">^</SEQ>
 60		<SEQ TYPE="OPERATOR">~</SEQ>
 61		<SEQ TYPE="OPERATOR">}</SEQ>
 62		<SEQ TYPE="OPERATOR">{</SEQ>
 63		<MARK_PREVIOUS AT_WHITESPACE_END="TRUE"
 64			EXCLUDE_MATCH="TRUE"
 65			TYPE="LABEL">:</MARK_PREVIOUS>
 66
 67		<!-- Function calls -->
 68		<MARK_PREVIOUS TYPE="FUNCTION" EXCLUDE_MATCH="TRUE">(</MARK_PREVIOUS>
 69
 70		<KEYWORDS>
 71			<KEYWORD3>char</KEYWORD3>
 72			<KEYWORD3>double</KEYWORD3>
 73			<KEYWORD3>enum</KEYWORD3>
 74			<KEYWORD3>float</KEYWORD3>
 75			<KEYWORD3>int</KEYWORD3>
 76			<KEYWORD3>long</KEYWORD3>
 77			<KEYWORD3>short</KEYWORD3>
 78			<KEYWORD3>signed</KEYWORD3>
 79			<KEYWORD3>struct</KEYWORD3>
 80			<KEYWORD3>typedef</KEYWORD3>
 81			<KEYWORD3>union</KEYWORD3>
 82			<KEYWORD3>unsigned</KEYWORD3>
 83			<KEYWORD3>void</KEYWORD3>
 84			<KEYWORD1>auto</KEYWORD1>
 85			<KEYWORD1>const</KEYWORD1>
 86			<KEYWORD1>extern</KEYWORD1>
 87			<KEYWORD1>register</KEYWORD1>
 88			<KEYWORD1>static</KEYWORD1>
 89			<KEYWORD1>volatile</KEYWORD1>
 90			<KEYWORD1>break</KEYWORD1>
 91			<KEYWORD1>case</KEYWORD1>
 92			<KEYWORD1>continue</KEYWORD1>
 93			<KEYWORD1>default</KEYWORD1>
 94			<KEYWORD1>do</KEYWORD1>
 95			<KEYWORD1>else</KEYWORD1>
 96			<KEYWORD1>for</KEYWORD1>
 97			<KEYWORD1>goto</KEYWORD1>
 98			<KEYWORD1>if</KEYWORD1>
 99			<KEYWORD1>return</KEYWORD1>
100			<KEYWORD1>sizeof</KEYWORD1>
101			<KEYWORD1>switch</KEYWORD1>
102			<KEYWORD1>while</KEYWORD1>
103			<KEYWORD2>asm</KEYWORD2>
104			<KEYWORD2>asmlinkage</KEYWORD2>
105			<KEYWORD2>far</KEYWORD2>
106			<KEYWORD2>huge</KEYWORD2>
107			<KEYWORD2>inline</KEYWORD2>
108			<KEYWORD2>near</KEYWORD2>
109			<KEYWORD2>pascal</KEYWORD2>
110			<LITERAL2>true</LITERAL2>
111			<LITERAL2>false</LITERAL2>
112			<LITERAL2>NULL</LITERAL2>
113		</KEYWORDS>
114	</RULES>
115
116	<RULES SET="CPP" DEFAULT="KEYWORD2" IGNORE_CASE="FALSE"
117		HIGHLIGHT_DIGITS="TRUE"
118		DIGIT_RE="(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)">
119		<!-- C style comment -->
120		<SPAN TYPE="COMMENT1">
121			<BEGIN>/*</BEGIN>
122			<END>*/</END>
123		</SPAN>
124
125		<!-- this is a hack so that #include <net/if.h> does not get
126		     the if highlighted -->
127		<EOL_SPAN TYPE="MARKUP" DELEGATE="INCLUDE">include</EOL_SPAN>
128
129		<!-- Directives -->
130		<KEYWORDS>
131			<MARKUP>assert</MARKUP>
132			<MARKUP>define</MARKUP>
133			<MARKUP>assert</MARKUP>
134			<MARKUP>define</MARKUP>
135			<MARKUP>elif</MARKUP>
136			<MARKUP>else</MARKUP>
137			<MARKUP>endif</MARKUP>
138			<MARKUP>error</MARKUP>
139			<MARKUP>ident</MARKUP>
140			<MARKUP>if</MARKUP>
141			<MARKUP>ifdef</MARKUP>
142			<MARKUP>ifndef</MARKUP>
143			<MARKUP>import</MARKUP>
144			<MARKUP>include</MARKUP>
145			<MARKUP>include_next</MARKUP>
146			<MARKUP>line</MARKUP>
147			<MARKUP>pragma</MARKUP>
148			<MARKUP>sccs</MARKUP>
149			<MARKUP>unassert</MARKUP>
150			<MARKUP>undef</MARKUP>
151			<MARKUP>warning</MARKUP>
152		</KEYWORDS>
153	</RULES>
154
155	<RULES SET="INCLUDE" DEFAULT="KEYWORD2" />
156</MODE>