Overal Structure

Top  Previous  Next

Each Syntax Schemes Language file is a XML document and contains either several language prototypes or one language type. XML content starts with root <SchemeList> element, which contains all other scheme definitions.

 

Element: <SchemeList>

 

Root of the Syntax Schemes Language file XML structure. Scheme list contains schemes (<Scheme> elements).

 

Attribute: root, type: string;
Specifies main scheme, from which syntax parsing starts.

 

Element: <Scheme>

 

Scheme is a generic structure of the SSL language to define syntax of programming languages. Every scheme contains various syntax elements, matched or not matched as text analysis goes on. For example, a scheme for "C++" language contains different keywords, strings, numbers, comments etc. The scheme is defined by <Scheme> element.

Scheme alone is not very useful for analysis. It is much more convenient to think about text of a language to be highlighted in terms of tokens. Scheme searches for tokens using search rules listed inside scheme (see description of <RegexRule> and <RegexBlock> ) .
When scheme matches a piece of text it can assign various parts of this text to different tokens. Each <Token> defines some meaningful part of the syntax. When parsed, source text is described as a set of these tokens with specified positions, lengths and font attributes.

 

Attribute: name, type: string, case-sensitive
Specifies scheme name to refer scheme from other schemes or rules.
Attribute: defaultToken, type: string, case-sensitive
Specifies <Token> token name for chunk of text, which not belongs to any syntax rule.
This attribute should be valid reference for existing token in color scheme (see “Color Schemes” section).
Attribute: keywordsIgnoreCase, type: boolean, case-sensitive, valid values: 0/1 or true/false.
Specifies whether scheme should ignore case on identifying keywords (see keywords section for more )
Attribute: allIgnoreCase, type: boolean, case-sensitive, valid values: 0/1 or true/false.
Specifies whether scheme should ignore case on searching for any rule (see description for <RegexRule> and <RegexBlock>)
Attribute: inherit, inherit0, inherit1…inheritN, type: string, case-sensitive
Specifies parent schemes. Parent schemes should be listed in ascending order: inherit=”…”, inherit0=”…”, inherit1=”…”, inherit2=”…” … In this case: inherit, inherit0, inherit1, inherit5 scheme will not inherit from inherit5.
Scheme inherits from its parent scheme processing rules (see “Rules” section). At parsing stage, scheme’s own rules have bigger priority. Thus, scheme can override parent rule creating its own rule matching the same text as parent rule.
Also, scheme can inherit any scheme from other SSL document from TLMDEditDocument.SyntaxSchemes collection using syntax like this: inherit=”OtherDoc.SomeScheme”;
Attribute: moreWordSeparators.
This attribute extends default word separator chars, used by \b regexp operator, for all regexps used in Scheme. See topic in regexps section. See <KeywordRegex> element for example.
Attribute: moreWordChars
This attribute extends default word chars, used by \b regexp operator, for all regexps used in Scheme. See topic in regexps section. See <KeywordRegex> element for example.

 

Example 1.Common Syntax Schemes Language file

 

<?xml version="1.0" encoding="UTF-8"?>

<SchemeList root='MainScheme'>

    .... other schemes ...

    <Scheme name='MainScheme' ... scheme attributes ...>

    ... scheme contents ....

    </Scheme>

    .... other schemes ...

</SchemeList>