这是一个 Scheme 荧光笔的开始。不是很花哨,但展示了递归如何与规则集一起工作。
<SyntaxDefinition name="Scheme" extensions=".sls;.sps;.ss;.scm"
xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color foreground="Green" name="Comment" />
<Color foreground="Blue" name="Syntax" />
<Color foreground="Blue" name="Library Syntax" />
<Color foreground="Blue" name="Auxilliary Syntax" />
<Color foreground="DarkMagenta" name="Procedure" />
<RuleSet>
<Import ruleSet="Expression"/>
</RuleSet>
<RuleSet name="Expression">
<Span color="Comment" multiline="false">
<Begin>;</Begin>
</Span>
<Span color="Comment" multiline="true" >
<Begin>\#\|</Begin>
<End>\|\#</End>
</Span>
<Span ruleSet="Expression" multiline="true" >
<Begin fontWeight="bold">\(</Begin>
<End fontWeight="bold">\)</End>
</Span>
<Span ruleSet="Expression" multiline="true">
<Begin fontWeight="bold">\#\(</Begin>
<End fontWeight="bold">\)</End>
</Span>
<Keywords color="Library Syntax">
<Word>import</Word>
<Word>export</Word>
<Word>library</Word>
</Keywords>
<Keywords color="Syntax">
<Word>define</Word>
<Word>set!</Word>
<Word>lambda</Word>
<Word>begin</Word>
<Word>if</Word>
<Word>cond</Word>
<Word>let</Word>
<Word>letrec</Word>
</Keywords>
<Keywords color="Auxilliary Syntax">
<Word>else</Word>
</Keywords>
<Keywords color="Procedure">
<Word>map</Word>
<Word>cons</Word>
<Word>car</Word>
</Keywords>
</RuleSet>
</SyntaxDefinition>