| SpanClass = "span" "class" Name MatchTokens=("=" RegexExpression)? ";";

SpanClass lets you specify a highlighting class, making it possible to define highlighting for your language or  for another language extension.

The specified highlighting class can be assigned to the rule through a SpanClass attribute.

If you specify a MatchTokens regular expression while defining the highlighting class, then this class will be automatically assigned to all the literals that match the regular expression.  

For example, as the result of the following definition, all the literals containing two or more alphabet characters will be highlighted with the Keyword highlighting class:

span class Keyword = ['a'..'z', '_']['a'..'z', '_']+;

Here is an example of using string highlighting:

span class String;

[SpanClass(String)]
token RegularStringLiteral = "\"" RegularStringLiteralPart* "\"";

See also

Name
RegexExpression