0% found this document useful (0 votes)
131 views

Batch Mode

The document defines syntax highlighting rules for Batch (BAT and CMD) files in an XML format. It identifies elements like comments marked with REM or ::, labels marked with a colon :, environment variables wrapped in percent signs, and standard command keywords to be highlighted with distinct formatting. The rules distinguish internal commands, external commands, and I/O redirectors for command.com.

Uploaded by

Jake Rieger
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views

Batch Mode

The document defines syntax highlighting rules for Batch (BAT and CMD) files in an XML format. It identifies elements like comments marked with REM or ::, labels marked with a colon :, environment variables wrapped in percent signs, and standard command keywords to be highlighted with distinct formatting. The rules distinguish internal commands, external commands, and I/O redirectors for command.com.

Uploaded by

Jake Rieger
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

<?xml version="1.0" encoding="utf-8"?

>
<!-- Batch File syntax highlighting for DigitalRune TextEditor. Created by Cyote
k (http://cyotek.com/) -->
<SyntaxDefinition name="Batch" extensions="*.bat;*.cmd">
<Environment>
<Default color="#000000" bgcolor="#ffffff" />
</Environment>
<RuleSets>
<RuleSet ignorecase="true">
<!-- Adding @ as a delimiter means the "ECHO" in "@ECHO OFF" will be highl
ighted. -->
<Delimiters>@:</Delimiters>
<!-- REM comment -->
<Span name="LineComment" bold="false" italic="false" color="#008000" stopa
teol="true">
<Begin>REM</Begin>
</Span>
<!-- :: style comment -->
<Span name="LineComment2" bold="false" italic="false" color="#008000" stop
ateol="true">
<Begin>::</Begin>
</Span>
<!-- label -->
<Span name="Label" bold="false" italic="false" color="#FF0000" bgcolor="#F
FFF80" stopateol="true">
<Begin startofline="true">:</Begin>
</Span>
<!-- Environment Variable -->
<Span name="Variable" bold="false" italic="false" color="#FF8000" bgcolor=
"#FCFFF0" stopateol="true">
<Begin>%</Begin>
<End>%</End>
</Span>
<!-- Programs -->
<!-- The idea here is the first word on a line that isn't a keyword is a p
rogram.
Doesn't work with the default TextEditorControl though. -->
<!--<Span name="Program" bold="false" italic="true" color="Red" bgcolor="#
FCFFF0" stopateol="true">
<Begin startofline="true" singleword="true"></Begin>
<End> </End>
</Span>-->
<!-- Operators -->
<KeyWords name="Punctuation" bold="false" italic="false" color="#FF0000">
<Key word="+" />
<Key word="-" />
<Key word="*" />
<Key word="&lt;" />

<Key word="&gt;" />


<Key word="=" />
<Key word="@" />
</KeyWords>
<!-- Standard command.com keywords -->
<!-- http://en.wikipedia.org/wiki/COMMAND.COM -->
<KeyWords name="command.com-internalcommands" bold="true" italic="false" c
olor="#0000FF">
<Key word="break" />
<Key word="chcp" />
<Key word="chdir" />
<Key word="cd" />
<Key word="cls" />
<Key word="copy" />
<Key word="ctty" />
<Key word="date" />
<Key word="del" />
<Key word="erase" />
<Key word="dir" />
<Key word="echo" />
<Key word="exit" />
<Key word="lfnfor" />
<Key word="loadhigh" />
<Key word="lh" />
<Key word="lock" />
<Key word="move" />
<Key word="mkdir" />
<Key word="md" />
<Key word="path" />
<Key word="prompt" />
<Key word="ren" />
<Key word="rename" />
<Key word="rmdir" />
<Key word="rd" />
<Key word="set" />
<Key word="time" />
<Key word="truename" />
<Key word="type" />
<Key word="unlock" />
<Key word="ver" />
<Key word="verify" />
<Key word="vol" />
<!-- http://ss64.com/nt/ -->
<Key word="color" />
<Key word="endlocal" />
<Key word="ftype" />
<Key word="mklink" />
<Key word="popd" />
<Key word="pushd" />
<Key word="setlocal" />
<Key word="start" />
<Key word="title" />
</KeyWords>
<KeyWords name="command.com-commands" bold="true" italic="false" color="#0
000FF">
<Key word="call" />
<Key word="for" />

<Key word="goto" />


<Key word="if" />
<Key word="in" />
<Key word="do" />
<Key word="pause" />
<Key word="rem" />
<Key word="shift" />
</KeyWords>
<!-- Redirects -->
<KeyWords name="command.com-redirects" bold="true" italic="false" color="#
0000FF">
<Key word="nul" />
<Key word="con" />
<Key word="prn" />
<Key word="aux" />
<Key word="clock$" />
<Key word="com0" />
<Key word="com1" />
<Key word="com2" />
<Key word="com3" />
<Key word="com4" />
<Key word="com5" />
<Key word="com6" />
<Key word="com7" />
<Key word="com8" />
<Key word="com9" />
<Key word="lpt0" />
<Key word="lpt1" />
<Key word="lpt2" />
<Key word="lpt3" />
<Key word="lpt4" />
<Key word="lpt5" />
<Key word="lpt6" />
<Key word="lpt7" />
<Key word="lpt8" />
<Key word="lpt9" />
</KeyWords>
</RuleSet>
</RuleSets>
</SyntaxDefinition>

You might also like