alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

jEdit example source code file (shellscript.xml)

This example jEdit source code file (shellscript.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - jEdit tags/keywords

begin, begin, end, keyword1, keyword2, mark_following, null, operator, seq, seq, span, span, type, type

The jEdit shellscript.xml source code

<?xml version="1.0"?>

<!DOCTYPE MODE SYSTEM "xmode.dtd">

<MODE>
	<PROPS>
		<PROPERTY NAME="lineComment" VALUE="#" />
		<PROPERTY NAME="indentOpenBrackets" VALUE="{" />
		<PROPERTY NAME="indentCloseBrackets" VALUE="}" />
		<PROPERTY NAME="indentNextLines"
			VALUE="^.*(then|else|case.*in)$" />
		<PROPERTY NAME="unindentThisLine"
			VALUE="^\s*(fi|else|esac|.*\))$" />
		<PROPERTY NAME="unindentNextLines"
			VALUE="^\s*(fi|else|esac)$" />
	</PROPS>
	<RULES IGNORE_CASE="TRUE" HIGHLIGHT_DIGITS="TRUE" ESCAPE="\">
		<!-- Comments -->
		<EOL_SPAN TYPE="COMMENT2">#!
		<EOL_SPAN TYPE="COMMENT1">#

		<!-- Variables -->
		<SPAN TYPE="KEYWORD2" NO_LINE_BREAK="TRUE">
			<BEGIN>${
			<END>}
		</SPAN>

		<MARK_FOLLOWING TYPE="KEYWORD2">$#
		<MARK_FOLLOWING TYPE="KEYWORD2">$?
		<MARK_FOLLOWING TYPE="KEYWORD2">$*
		<MARK_FOLLOWING TYPE="KEYWORD2">$@
		<MARK_FOLLOWING TYPE="KEYWORD2">$$
		<MARK_FOLLOWING TYPE="KEYWORD2">$<
		<MARK_FOLLOWING TYPE="KEYWORD2">$
		<MARK_PREVIOUS TYPE="KEYWORD2" MATCH_TYPE="OPERATOR">=

		<!-- weird stuff -->
		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC">
			<BEGIN>$((
			<END>))
		</SPAN>
		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC">
			<BEGIN>$(
			<END>)
		</SPAN>
		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC">
			<BEGIN>$[
			<END>]
		</SPAN>
		<SPAN TYPE="KEYWORD3" DELEGATE="EXEC">
			<BEGIN>`
			<END>`
		</SPAN>

		<!-- Literals -->
		<SPAN TYPE="LITERAL1" DELEGATE="LITERAL">
			<BEGIN>"
			<END>"
		</SPAN>
		<SPAN TYPE="LITERAL1" ESCAPE="\">
			<BEGIN>'
			<END>'
		</SPAN>

		<!-- Readins -->
		<SPAN_REGEXP HASH_CHAR="<<" TYPE="LITERAL1" DELEGATE="LITERAL">
			<BEGIN>
			<END AT_LINE_START="TRUE">$1
		</SPAN_REGEXP>

		<!-- Operators -->
		<SEQ TYPE="OPERATOR">|
		<SEQ TYPE="OPERATOR">&
		<SEQ TYPE="OPERATOR">!
		<SEQ TYPE="OPERATOR">>
		<SEQ TYPE="OPERATOR"><

		<!-- %jobnumber -->
		<MARK_FOLLOWING TYPE="KEYWORD2">%

		<!-- functions -->
		<MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">(
		<SEQ TYPE="OPERATOR">)

		<KEYWORDS>
			<KEYWORD1>if
			<KEYWORD1>then
			<KEYWORD1>elif
			<KEYWORD1>else
			<KEYWORD1>fi
			<KEYWORD1>case
			<KEYWORD1>in
			<OPERATOR>;;
			<KEYWORD1>esac
			<KEYWORD1>while
			<KEYWORD1>for
			<KEYWORD1>do
			<KEYWORD1>done
			<KEYWORD1>continue

			<KEYWORD1>local
			<KEYWORD1>return
		</KEYWORDS>

		<!-- some of these should be marked OPERATOR -->
		<!-- 
		<SEQ TYPE="NULL">(
		<SEQ TYPE="NULL">=
		<SEQ TYPE="NULL">!
		<SEQ TYPE="NULL">>=
		<SEQ TYPE="NULL"><=
		<SEQ TYPE="NULL">+
		<SEQ TYPE="NULL">-
		<SEQ TYPE="NULL">/
		<SEQ TYPE="NULL">*
		<SEQ TYPE="NULL">^
		<SEQ TYPE="NULL">~
		<SEQ TYPE="NULL">}
		<SEQ TYPE="NULL">{
		SEQ TYPE="NULL">.</SEQ
		<SEQ TYPE="NULL">,
		<SEQ TYPE="NULL">;
		<SEQ TYPE="NULL">]
		<SEQ TYPE="NULL">[
		<SEQ TYPE="NULL">?
		<SEQ TYPE="NULL">: -->
	</RULES>

	<RULES SET="LITERAL" DEFAULT="LITERAL1" ESCAPE="\">
		<!-- Variables -->
		<SPAN TYPE="KEYWORD2" NO_LINE_BREAK="TRUE">
			<BEGIN>${
			<END>}
		</SPAN>

		<MARK_FOLLOWING TYPE="KEYWORD2">$
	</RULES>

	<RULES SET="EXEC" DEFAULT="KEYWORD3" ESCAPE="\">
		<!-- Variables -->
		<SPAN TYPE="KEYWORD2" NO_LINE_BREAK="TRUE">
			<BEGIN>${
			<END>}
		</SPAN>

		<SPAN TYPE="KEYWORD3">
			<BEGIN>$((
			<END>))
		</SPAN>

		<SPAN TYPE="KEYWORD3">
			<BEGIN>$(
			<END>)
		</SPAN>

		<SPAN TYPE="KEYWORD3">
			<BEGIN>$[
			<END>]
		</SPAN>

		<MARK_FOLLOWING TYPE="KEYWORD2">$

		<SEQ TYPE="OPERATOR">|
		<SEQ TYPE="OPERATOR">&
		<SEQ TYPE="OPERATOR">!
		<SEQ TYPE="OPERATOR">>
		<SEQ TYPE="OPERATOR"><
	</RULES>
</MODE>

Other jEdit examples (source code examples)

Here is a short list of links related to this jEdit shellscript.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.