"Fossies" - the Fresh Open Source Software Archive

Member "ne-3.2.1/syntax/csharp.jsf" (12 Apr 2017, 6984 Bytes) of package /linux/misc/ne-3.2.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # JOE syntax highlight file for C#
    2 # Based on Java highlighter
    3 
    4 =Idle
    5 =Preproc 	yellow
    6 =Comment 	green
    7 =DocComment	bold blue
    8 =Constant 	cyan
    9 =Escape 	bold cyan
   10 =Type 		bold blue
   11 =Keyword 	blue
   12 =Operator	blue
   13 =Bad		bold red
   14 =Brace		magenta
   15 =Control
   16 
   17 :begin Idle
   18 	*	begin	noeat call=.csharp()
   19 
   20 .subr csharp
   21 
   22 :reset Idle
   23 	*		first		noeat
   24 	" \t"		reset
   25 
   26 :first Idle
   27 	*		idle		noeat
   28 	"#"		pre		recolor=-1
   29 
   30 :pre Preproc
   31 	*		pre		noeat
   32 	"a-zA-Z"	preident	recolor=-1 buffer
   33 	" \t"		pre
   34 	"\n"		reset
   35 
   36 :preident Preproc
   37 	*		preunknown	strings
   38 	"if"		prebody
   39 	"else"		prebody
   40 	"elif"		prebody
   41 	"endif"		prebody
   42 	"region"	preregion
   43 	"endregion"	preregion
   44 	"define"	predefine
   45 	"undef"		predefine
   46 	"warning"	preregion
   47 	"error"		preregion
   48 	"line"		prebody
   49 done
   50 	"a-z"		preident
   51 
   52 :prebody Preproc
   53 	*		prebody
   54 	"\n"		reset
   55 
   56 :preregion Preproc
   57 	*		preregion_text
   58 	"\n"		reset
   59 
   60 :preregion_text Constant
   61 	*		preregion_text
   62 	"\n"		reset
   63 
   64 :predefine Preproc
   65 	*		predefine_text	noeat
   66 	" \t"		predefine
   67 	"\n"		reset
   68 
   69 :predefine_text Constant
   70 	*		predefine_text
   71 	" \t"		predefine_value
   72 	"\n"		reset
   73 
   74 :predefine_value Idle
   75 	*		predefine_value
   76 	"\n"		reset
   77 
   78 :preunknown Preproc
   79 	*		preunknown
   80 	"\n"		reset
   81 
   82 :idle Idle
   83 	*		idle
   84 	"\n"		reset
   85 	"/"		slash
   86 	"0"		first_digit	recolor=-1
   87 	"1-9"		decimal		recolor=-1
   88 	"."		maybe_float
   89 	"\""		string		recolor=-1
   90 	"@"		forcedliteral	recolor=-1
   91 	"'"		char		recolor=-1
   92 	"a-zA-Z_"	ident		buffer
   93 	"{}"		brace		recolor=-1
   94 	",:;=()><[]*&|!~+\-%^"	control	recolor=-1
   95 
   96 :maybe_done Control
   97 	*	idle	noeat
   98 	"/"	idle	noeat return recolor=-2
   99 
  100 :brace Brace
  101 	*	idle	noeat
  102 
  103 :control Control
  104 	*	idle	noeat
  105 
  106 :forcedliteral Idle
  107 	*		idle		noeat
  108 	"a-zA-Z_"	ident		recolor=-2
  109 	"\""		forcedstring	recolor=-2
  110 
  111 :forcedstring Constant
  112 	*		forcedstring
  113 	"\""		forcedstringquot
  114 
  115 :forcedstringquot Constant
  116 	*		idle			noeat
  117 	"\""		forcedstring			# @"This -> "" <- is a literal quote"
  118 
  119 :slash Idle
  120 	*		idle			noeat
  121 	"*"		comment			recolor=-2
  122 	"/"		maybe_line_comment	recolor=-2
  123 
  124 :comment Comment
  125 	*		comment
  126 	"*"		maybe_end_comment
  127 
  128 :maybe_end_comment Comment
  129 	*		comment
  130 	"/"		idle
  131 	"*"		maybe_end_comment
  132 
  133 :maybe_line_comment Comment
  134 	*		line_comment		noeat recolor=-1
  135 	"/"		doc_comment		recolor=-3
  136 
  137 :line_comment Comment
  138 	*		line_comment
  139 	"\n"		reset
  140 
  141 :doc_comment DocComment
  142 	*		doc_comment
  143 	"\n"		reset
  144 
  145 :first_digit Constant
  146 	*		idle	noeat
  147 	"xX"		hex
  148 	"."		float
  149 	"eE"		epart
  150 	"0-7"		octal
  151 	"89"		bad_number	recolor=-1
  152 
  153 :bad_number Bad
  154 	*		idle	noeat
  155 	"0-9"		bad_number
  156 
  157 :octal Constant
  158 	*		idle	noeat
  159 	"0-7"		octal
  160 	"89"		bad_number	recolor=-1
  161 
  162 :hex Constant
  163 	*		idle	noeat
  164 	"0-9A-Fa-f"	hex
  165 
  166 :decimal Constant
  167 	*		idle	noeat
  168 	"0-9"		decimal
  169 	"eE"		epart
  170 	"."		float
  171 
  172 :maybe_float Constant
  173 	*		idle	recolor=-2	noeat
  174 	"0-9"		float		recolor=-2
  175 
  176 :float Constant
  177 	*		idle	noeat
  178 	"eE"		epart
  179 	"0-9"		float
  180 
  181 :epart Constant
  182 	*		idle	noeat
  183 	"0-9+\-"	enum
  184 
  185 :enum Constant
  186 	*		idle	noeat
  187 	"0-9"		enum
  188 
  189 :string	Constant
  190 	*		string
  191 	"\""		idle
  192 	"\\"		string_escape		recolor=-1
  193 	"{"		maybe_string_control	recolor=-1
  194 	"}"		maybe_control_end	recolor=-1
  195 
  196 :string_escape Escape
  197 	*		string
  198 	"xu"		string_hex_4  # Yes, \x has up to 4 numbers in C#
  199 	"U"		string_hex_8
  200 	"0-7"		string_octal2
  201 	"\n"		string		recolor=-2
  202 
  203 # Eight all-purpose (hex/unicode short/unicode long) states for hexadecimal
  204 # escape sequences
  205 
  206 :string_hex_8 Escape
  207 	*		string		noeat
  208 	"0-9a-fA-F"	string_hex_7
  209 
  210 :string_hex_7 Escape
  211 	*		string		noeat
  212 	"0-9a-fA-F"	string_hex_6
  213 
  214 :string_hex_6 Escape
  215 	*		string		noeat
  216 	"0-9a-fA-F"	string_hex_5
  217 
  218 :string_hex_5 Escape
  219 	*		string		noeat
  220 	"0-9a-fA-F"	string_hex_4
  221 
  222 :string_hex_4 Escape
  223 	*		string		noeat
  224 	"0-9a-fA-F"	string_hex_3
  225 
  226 :string_hex_3 Escape
  227 	*		string		noeat
  228 	"0-9a-fA-F"	string_hex_2
  229 
  230 :string_hex_2 Escape
  231 	*		string		noeat
  232 	"0-9a-fA-F"	string_hex_1
  233 
  234 :string_hex_1 Escape
  235 	*		string		noeat
  236 	"0-9a-fA-F"	string
  237 
  238 :string_octal2 Escape
  239 	*		string		noeat
  240 	"0-7"		string_octal3
  241 
  242 :string_octal3 Escape
  243 	*		string		noeat
  244 	"0-7"		string
  245 
  246 :maybe_string_control Escape
  247 	*		string 		noeat recolor=-2
  248 	"0-9"		string_control
  249 	"{"		string
  250 
  251 :string_control Escape
  252 	*		string_control
  253 	"\""		string		noeat
  254 	"}"		string
  255 
  256 :maybe_control_end Escape
  257 	*		string		noeat recolor=-2
  258 	"}"		string
  259 
  260 :char Constant
  261 	*		char
  262 	"\n"		reset
  263 	"'"		idle
  264 	"\\"		char_escape	recolor=-1
  265 
  266 :char_escape	Escape
  267 	*		char
  268 	"xu"		char_hex4
  269 	"U"		char_hex8
  270 	"0-7"		char_octal2
  271 	"\n"		char		recolor=-2
  272 
  273 :char_hex8 Escape
  274 	*		char		noeat
  275 	"0-9a-fA-F"	char_hex7
  276 
  277 :char_hex7 Escape
  278 	*		char		noeat
  279 	"0-9a-fA-F"	char_hex6
  280 
  281 :char_hex6 Escape
  282 	*		char		noeat
  283 	"0-9a-fA-F"	char_hex5
  284 
  285 :char_hex5 Escape
  286 	*		char		noeat
  287 	"0-9a-fA-F"	char_hex4
  288 
  289 :char_hex4 Escape
  290 	*		char		noeat
  291 	"0-9a-fA-F"	char_hex3
  292 
  293 :char_hex3 Escape
  294 	*		char		noeat
  295 	"0-9a-fA-F"	char_hex2
  296 
  297 :char_hex2 Escape
  298 	*		char		noeat
  299 	"0-9a-fA-F"	char_hex1
  300 
  301 :char_hex1 Escape
  302 	*		char		noeat
  303 	"0-9a-fA-F"	char
  304 
  305 :char_octal2 Escape
  306 	*		char		noeat
  307 	"0-7"		char_octal3
  308 
  309 :char_octal3 Escape
  310 	*		char		noeat
  311 	"0-7"		char
  312 
  313 :ident Idle		# http://msdn.microsoft.com/en-us/library/x53a06bb.aspx
  314 	*		idle		noeat strings
  315 	"abstract"	kw
  316 	"as"		operator
  317 	"base"		kw
  318 	"break"		kw
  319 	"case"		kw
  320 	"catch"		kw
  321 	"checked"	operator
  322 	"class"		kw
  323 	"const"		kw
  324 	"continue"	kw
  325 	"default"	kw
  326 	"delegate"	kw
  327 	"do"		kw
  328 	"else"		kw
  329 	"enum"		kw
  330 	"event"		kw
  331 	"explicit"	kw
  332 	"extern"	kw
  333 	"finally"	kw
  334 	"fixed"		kw
  335 	"for"		kw
  336 	"foreach"	kw
  337 	"goto"		kw
  338 	"if"		kw
  339 	"implicit"	kw
  340 	"in"		operator
  341 	"interface"	kw
  342 	"internal"	kw
  343 	"is"		kw
  344 	"lock"		kw
  345 	"namespace"	kw
  346 	"new"		operator
  347 	"operator"	kw
  348 	"out"		kw
  349 	"override"	kw
  350 	"params"	kw
  351 	"private"	kw
  352 	"protected"	kw
  353 	"public"	kw
  354 	"readonly"	kw
  355 	"ref"		kw
  356 	"return"	kw
  357 	"sealed"	kw
  358 	"sizeof"	operator
  359 	"stackalloc"	kw
  360 	"static"	kw
  361 	"struct"	kw
  362 	"switch"	kw
  363 	"this"		kw
  364 	"throw"		kw
  365 	"try"		kw
  366 	"typeof"	operator
  367 	"unchecked"	operator
  368 	"unsafe"	kw
  369 	"using"		kw
  370 	"virtual"	kw
  371 	"volatile"	kw
  372 	"while"		kw
  373 	
  374 	# Types
  375 	
  376 	"bool"		type
  377 	"Boolean"	type
  378 	"byte"		type
  379 	"Byte"		type
  380 	"char"		type
  381 	"Character"	type
  382 	"decimal"	type
  383 	"double"	type
  384 	"Double"	type
  385 	"float"		type
  386 	"Float"		type
  387 	"int"		type
  388 	"Integer"	type
  389 	"int16"		type
  390 	"Int16"		type
  391 	"int32"		type
  392 	"Int32"		type
  393 	"int64"		type
  394 	"Int64"		type
  395 	"long"		type
  396 	"object"	type
  397 	"Object"	type
  398 	"sbyte"		type
  399 	"short"		type
  400 	"string"	type
  401 	"String"	type
  402 	"uint"		type
  403 	"uint16"	type
  404 	"uint32"	type
  405 	"uint64"	type
  406 	"ulong"		type
  407 	"ushort"	type
  408 	"void"		type
  409 	
  410 	
  411 	# These are "contextual" keywords.  Should try to do a better and
  412 	# and find the context (most are LINQ), but it may not be possible
  413 	# in all cases:
  414 	
  415 	"add"		kw
  416 	"alias"		kw
  417 	"ascending"	kw
  418 	"async"		kw
  419 	"await"		kw
  420 	"descending"	kw
  421 	"dynamic"	type
  422 	"from"		kw
  423 	"get"		kw
  424 	"global"	kw
  425 	"group"		kw
  426 	"into"		kw
  427 	"join"		kw
  428 	"let"		kw
  429 	"orderby"	kw
  430 	"partial"	kw
  431 	"remove"	kw
  432 	"select"	kw
  433 	"set"		kw
  434 	"value"		kw
  435 	"var"		type
  436 	"where"		kw
  437 	"yield"		kw
  438 	
  439 	# Literals
  440 	
  441 	"true"		lit
  442 	"false"		lit
  443 	"null"		lit
  444 done
  445 	"a-zA-Z0-9_"	ident
  446 
  447 :type Type
  448 	*	idle	noeat
  449 
  450 :kw Keyword
  451 	*	idle	noeat
  452 
  453 :lit Constant
  454 	*	idle	noeat
  455 
  456 :operator Operator
  457 	*	idle	noeat
  458 
  459 .end