<!--
  CAUTION: Do not modify this file directly on it's code unless you know what you are doing.
           Unexpected results may occur if the code is changed deliberately.
-->
<!ELEMENT source-code-highlight (word-delimiters?, word-separators?, ignored-chars?, completion-trigger?, highlight-order, group+)>

<!-- 
The order in which the group expressions must be matched against extracted words. All groups withing this tag must be 
declared afterwards or the highlighter will raise a error.
-->
<!ELEMENT highlight-order (group+)>

<!--
The characters that indicates the boundaries of a word. The highlighter will start extracting a word
by the delimiter until it finds another occurrency of the delimiter. This is useful, for instance, when 
highlighting strings in which delimiters are "" or ''. In that case, word delimiters are quote and
apostrophe chars. The word delimiters are always attached to extracted words when found. 

value: a list of characters that must be used as word delimiters.
-->
<!ELEMENT word-delimiters EMPTY>
<!ATTLIST word-delimiters value CDATA #IMPLIED>

<!-- 
The characters that separates words. The highlighter will stop extracting a word
in the presence of a separator. Word separators will never be part of a previously extracted
word. Instead, when found, they are considered a single word that may be handled differently 
by the highlighter.

value: a list of characters that must be used as word separators.
capture-nearby: indicates if the word separators should be captured together when they are found contiguously.
                The default behaviour is to return a single separator as a complete word. When this attribute 
                is set to true, the highlighter will keep capturing word separators while they are being found
                until the next char is not a separator. The result is a word containing multiples word separators
                captured in line.
-->
<!ELEMENT word-separators EMPTY>
<!ATTLIST word-separators value CDATA #IMPLIED>
<!ATTLIST word-separators capture-nearby (false|true) "false">

<!-- 
The ignored characters that are completely discarded when the highlighter is extracting words.

value: a list of characters that must be used as ignored characters.
-->
<!ELEMENT ignored-chars EMPTY>
<!ATTLIST ignored-chars value CDATA #IMPLIED>

<!-- 
The character that is used to trigger the code completion widget. The default trigger is the dot (.)
any single character can be specified to override the default one. Once the highlighter finds it'll request
the displaying of the completion widget.

value: a single character that must be used as completion trigger.
-->
<!ELEMENT completion-trigger EMPTY>
<!ATTLIST completion-trigger value CDATA #IMPLIED>

<!--
The configuration of a highlight group. The group itself contains a set of formatting attributes and elements which 
store the expressions that are matched against the captured words.

name: the name of the group
background-color: the color of the background of words matching the group (omitting this attribute causes transparent background to be applied).
background-color: the color of the foreground of words matching the group (omitting this attribute causes black foreground to be applied)
lookahead-char: the character used to break the highlight for a group. This character itself is not highlighted.
case-sensitive: indicates if the expressions matching must be case sensitive or not.
bold: words matching the group will have a bold style.
italic: words matching the group will have a italic style.
underline: words matching the group will have a underline style.
strikeout: words matching the group will have a strikeout style.
-->
<!ELEMENT group (element*)>
<!ATTLIST group name CDATA #REQUIRED>
<!ATTLIST group background-color CDATA #IMPLIED>
<!ATTLIST group foreground-color CDATA #IMPLIED>
<!ATTLIST group lookahead-char CDATA #IMPLIED>
<!ATTLIST group case-sensitive (false|true) "false">
<!ATTLIST group bold (false|true) "false">
<!ATTLIST group italic (false|true) "false">
<!ATTLIST group underline (false|true) "false">
<!ATTLIST group strikeout (false|true) "false">

<!--
The element of a group. The element stores an expression that is matched against a captured word.
In case of positive matching the word will receive the formatting associated to the group in which the element
is part of. Elements can hold simple, wildcard or regular expressions.

value: the expression of the element.
type: the type of the element expression. When initial-exp is set then the first occurrency of the expression matched
      will cause any further words to be highlighted as the same group in which the element matched is part even the word 
      is part of another group. The forced highlighting is finished only when another expression in this group and which is
      marked as final-exp is found. This is useful when you need to highlight multiple lines of code in which the words
      eventually is part of the same group. Code comments is a classical example of this situation /* */.
regexp: the expression of the element must be treated as a regular expression.
wildcard: the expression of the element must be treated as a wildcard expression.

Note: if neither regexp or wildcard is specified then the expression matching is perfomed in exact mode.
-->
<!ELEMENT element EMPTY>
<!ATTLIST element value CDATA #REQUIRED>
<!ATTLIST element type (initial-exp|final-exp) "initial-exp">
<!ATTLIST element regexp (false|true) "false">
<!ATTLIST element wildcard (false|true) "false">
