PageRenderTime 244ms CodeModel.GetById 237ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
XML | 153 lines | 130 code | 19 blank | 4 comment | 0 complexity | 1652e5bdad7c0f7edd6536dbf104517c MD5 | raw file
  1<?xml version="1.0"?>
  2<!DOCTYPE MODE SYSTEM "xmode.dtd">
  3
  4<!-- RetroForth is one of the nicest Forth implementations, so we
  5support that one. You can extend this to your own Forth's vocabulary
  6easily. -->
  7
  8<MODE>
  9	<PROPS>
 10		<PROPERTY NAME="indentNextLines" VALUE="^:[^;]*"/>>
 11		<PROPERTY NAME="unindentNextLines" VALUE="^.*;$"/>
 12		<PROPERTY NAME="commentStart" VALUE="("/>
 13		<PROPERTY NAME="commentEnd" VALUE=")"/>
 14		<PROPERTY NAME="lineComment" VALUE="|"/>
 15		<PROPERTY NAME="noWordSep" VALUE="+-*=&gt;&lt;;.?/'()%,_|$"/>
 16	</PROPS>
 17	<RULES IGNORE_CASE="FALSE"
 18		NO_WORD_SEP="+-*=&gt;&lt;;.?/'&quot;()%,_$"
 19		HIGHLIGHT_DIGITS="TRUE"
 20		DIGIT_RE="|-?\d+([./]\d+)?">
 21
 22		<EOL_SPAN TYPE="COMMENT1" AT_WORD_START="TRUE">| </EOL_SPAN>
 23
 24		<MARK_FOLLOWING TYPE="DIGIT" AT_WORD_START="TRUE">$</MARK_FOLLOWING>
 25		<MARK_FOLLOWING TYPE="LITERAL3" AT_WORD_START="TRUE">'</MARK_FOLLOWING>
 26
 27		<!-- parsing words -->
 28		<SEQ_REGEXP TYPE="MARKUP"
 29			HASH_CHAR=":"
 30			AT_WORD_START="TRUE">:\s+(\S+)</SEQ_REGEXP>
 31
 32		<SPAN TYPE="COMMENT3" DELEGATE="STACK_EFFECT">
 33			<BEGIN>( </BEGIN>
 34			<END>)</END>
 35		</SPAN>
 36
 37		<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE"
 38			AT_WORD_START="TRUE">
 39			<BEGIN>s"</BEGIN>
 40			<END>"</END>
 41		</SPAN>
 42
 43		<SPAN TYPE="LITERAL2" NO_LINE_BREAK="TRUE"
 44			AT_WORD_START="TRUE">
 45			<BEGIN>."</BEGIN>
 46			<END>"</END>
 47		</SPAN>
 48
 49		<SPAN TYPE="LITERAL3" NO_LINE_BREAK="TRUE"
 50			AT_WORD_START="TRUE">
 51			<BEGIN>f"</BEGIN>
 52			<END>"</END>
 53		</SPAN>
 54
 55		<SPAN TYPE="LITERAL3" NO_LINE_BREAK="TRUE"
 56			AT_WORD_START="TRUE">
 57			<BEGIN>m"</BEGIN>
 58			<END>"</END>
 59		</SPAN>
 60
 61		<SPAN TYPE="LITERAL4" NO_LINE_BREAK="TRUE"
 62			AT_WORD_START="TRUE">
 63			<BEGIN>"</BEGIN>
 64			<END>"</END>
 65		</SPAN>
 66
 67		<KEYWORDS>
 68			<MARKUP>;</MARKUP>
 69			<MARKUP>;;</MARKUP>
 70			<MARKUP>0;</MARKUP>
 71
 72			<KEYWORD1>swap</KEYWORD1>
 73			<KEYWORD1>drop</KEYWORD1>
 74			<KEYWORD1>dup</KEYWORD1>
 75			<KEYWORD1>nip</KEYWORD1>
 76			<KEYWORD1>over</KEYWORD1>
 77			<KEYWORD1>rot</KEYWORD1>
 78			<KEYWORD1>-rot</KEYWORD1>
 79			<KEYWORD1>2dup</KEYWORD1>
 80			<KEYWORD1>2drop</KEYWORD1>
 81			<KEYWORD1>2over</KEYWORD1>
 82			<KEYWORD1>2swap</KEYWORD1>
 83			<KEYWORD1>&gt;r</KEYWORD1>
 84			<KEYWORD1>r&gt;</KEYWORD1>
 85
 86			<KEYWORD2>and</KEYWORD2>
 87			<KEYWORD2>or</KEYWORD2>
 88			<KEYWORD2>xor</KEYWORD2>
 89			<KEYWORD2>&gt;&gt;</KEYWORD2>
 90			<KEYWORD2>&lt;&lt;</KEYWORD2>
 91			<KEYWORD2>not</KEYWORD2>
 92			<KEYWORD2>+</KEYWORD2>
 93			<KEYWORD2>*</KEYWORD2>
 94			<KEYWORD2>negate</KEYWORD2>
 95			<KEYWORD2>-</KEYWORD2>
 96			<KEYWORD2>/</KEYWORD2>
 97			<KEYWORD2>mod</KEYWORD2>
 98			<KEYWORD2>/mod</KEYWORD2>
 99			<KEYWORD2>*/</KEYWORD2>
100			<KEYWORD2>1+</KEYWORD2>
101			<KEYWORD2>1-</KEYWORD2>
102			<KEYWORD2>base</KEYWORD2>
103			<KEYWORD2>hex</KEYWORD2>
104			<KEYWORD2>decimal</KEYWORD2>
105			<KEYWORD2>binary</KEYWORD2>
106			<KEYWORD2>octal</KEYWORD2>
107
108			<KEYWORD3>@</KEYWORD3>
109			<KEYWORD3>!</KEYWORD3>
110			<KEYWORD3>c@</KEYWORD3>
111			<KEYWORD3>c!</KEYWORD3>
112			<KEYWORD3>+!</KEYWORD3>
113			<KEYWORD3>cell+</KEYWORD3>
114			<KEYWORD3>cells</KEYWORD3>
115			<KEYWORD3>char+</KEYWORD3>
116			<KEYWORD3>chars</KEYWORD3>
117
118			<KEYWORD4>[</KEYWORD4>
119			<KEYWORD4>]</KEYWORD4>
120			<KEYWORD4>create</KEYWORD4>
121			<KEYWORD4>does&gt;</KEYWORD4>
122			<KEYWORD4>variable</KEYWORD4>
123			<KEYWORD4>variable,</KEYWORD4>
124			<KEYWORD4>literal</KEYWORD4>
125			<KEYWORD4>last</KEYWORD4>
126			<KEYWORD4>1,</KEYWORD4>
127			<KEYWORD4>2,</KEYWORD4>
128			<KEYWORD4>3,</KEYWORD4>
129			<KEYWORD4>,</KEYWORD4>
130			<KEYWORD4>here</KEYWORD4>
131			<KEYWORD4>allot</KEYWORD4>
132			<KEYWORD4>parse</KEYWORD4>
133			<KEYWORD4>find</KEYWORD4>
134			<KEYWORD4>compile</KEYWORD4>
135
136			<OPERATOR>if</OPERATOR>
137			<OPERATOR>=if</OPERATOR>
138			<OPERATOR>&lt;if</OPERATOR>
139			<OPERATOR>&gt;if</OPERATOR>
140			<OPERATOR>&lt;&gt;if</OPERATOR>
141			<OPERATOR>then</OPERATOR>
142			<OPERATOR>repeat</OPERATOR>
143			<OPERATOR>until</OPERATOR>
144
145			<OPERATOR>forth</OPERATOR>
146			<OPERATOR>macro</OPERATOR>
147		</KEYWORDS>
148	</RULES>
149
150	<RULES SET="STACK_EFFECT" DEFAULT="COMMENT4">
151		<SEQ TYPE="COMMENT3">--</SEQ>
152	</RULES>
153</MODE>