Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

XSHD Tags

Andrew C. Dvorak edited this page Mar 13, 2014 · 9 revisions

Note this list is not finished. You can help and finish the list.

Nodes

Full list of nodes.

SyntaxDefinition

It is the root element for the syntax definition. It is compulsory for the syntax highlighter.

Attributes

  • name: The name of the mode. This is used when you, in the definition of a RuleSet refers to another mode. I.E., one that is defined in an external file. For an example of this see the HTML-Mode that uses the JavaScript-mode this way.
  • extends: Optional. With this you can extend an existing definition. Use the name of the other definition. The HighlightingManager will look for it, but both definition-files must be in the same directory.
  • extensions: Optional. The file extensions that the mode is applicable for. Extensions must be written with lower case and should include the ., as in .txt. If several extensions are applicable they should be separated with ;.

Example

<SyntaxDefinition name="Example" extensions=".ex;.ext;.exf" extends="C#">
    <!-- definitions ... -->
</SyntaxDefinition>

Environment

Contains a list of <EnvironmentEntry> tags or <CustomEnvironmentEntry> tags.

Properties

Contains a list of <Property> tags.

Digits

Defines the rendering of all digits in the definition.

Attributes

  • name: Optional. Just sets a name for the element, in case of the <Digits>-element, set it to "Digits".
  • bold: Optional. Accepts "true" or "false". Defines if the digits are rendered bold or not.
  • italic: Optional. Accepts "true" or "false". Defines if the digits are rendered italic or not.
  • color: Optional. Accepts all color names from System.Drawing.Color. Defines the color of the text.
  • bgcolor: Optional. Accepts all color names from System.Drawing.Color. Defines the color of the background.

Example

<Digits name="Digits" bold="false" italic="false" color="DarkBlue" />

RuleSets

The <RuleSets> tag defines the rule sets that are used in the mode, it's just a grouping of the set of rule sets for a mode. You can connect rule sets with each other. Note that all modes are defined in a flat structure even if they are used recursively.

For an example of a mode that uses multiple rule sets see the XML-mode. There is a top level rule-set and and another rule-set that handles highlighting within a tag, i.e., between < and >.

RuleSet

Each <RuleSet> element is a set of <KeyWord> lists, <Span>s, and additional rules like <MarkPrevious> and <MarkFollowing>.

Attributes

  • name: Each rule set should have a name, except the default rule set. The highlighting parser will look for the default rule set.
  • reference: Optional. With this you can reference a rule set from another highlighting definition. (Like the extends attribute in <SyntaxDefinition>.)
  • ignorecase: Optional. Accepts "true" and "false". Defines if the character casing is important for the highlighting of the keywords.
  • noescapesequences: Optional. Obsolete. Accepts "true" and "false". Defines if the rule set has escape sequences or not.
  • escapecharacter: Optional. Accepts a char. Defines the escape character for the rule set.

Example

<SyntaxDefinition name="Example">
    <!-- ... -->

    <RuleSets>
        <RuleSet ignorecase="true">
            <!-- ... -->
        </RuleSet>
    </RuleSets>
</SyntaxDefinition>

Delimiters

Defines the delimiting characters of the syntax, e.g., the characters that, "break up" a line into separate symbols, typically key words. It is not necessary, or desirable to include the characters that denote the start or end of a span. Space and Tab are implicitly defined as delimiters and they don't need to be included explicitly (this will probably be changed at some future time).

Example

<SyntaxDefinition name="Example">
    <!-- ... -->

    <RuleSets>
        <RuleSet ignorecase="true">
            <Delimiters>&amp;&lt;&gt;~!@$%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
            
            <!-- ... -->
        </RuleSet>
    </RuleSets>
</SyntaxDefinition>

Spans

Clone this wiki locally