syntax:specification

This is an old revision of the document!


SPECIFICATION

<SPECIFICATION>
      <CaseSensitive>true</CaseSensitive>
      <OpenClose>()[]{}''""</OpenClose>
      <LineEnd>;</LineEnd>
      <EscapeChar>\</EscapeChar>
      <Operators>@?%*-/&amp;*=&lt;&gt;|!~^{}()[];:</Operators>
      <Delimiters>&quot;'@#{}</Delimiters>
      <Words init="A-Za-z_">0-9A-Za-z_</Words>
      <WrapBy>(),</WrapBy>
      <Numbers>-+0-9.EUL</Numbers>
      <FilePattern mask="*.c;*.cpp;*.cxx;*.hpp;*.hxx;*.inl;*.h">
        <Pair file1="*.cpp" file2="*.h"/>
        ...
        <Pair file1="*.cxx" file2="*.hpp"/>
      </FilePattern>  
      <HierarchySeparator>
        <Separator text="::"/>
        <Separator text="."/>
      </HierarchySeparator>
      <Bars navigation="true"/>      
...
</SPECIFICATION>

This node contains base settings for syntax (as file pattern, braces list, case sensitive flag etc).

<CaseSensitive>true</CaseSensitive>

Option tells engine to treat syntax as case sensitive. This setting will apply on parsing, statistic, search etc. By default syntax treated as not case sensitive.

<OpenClose override="false">()[]{}''""</OpenClose>

Here you can define pair symbols which should be treated together in such operations like brace matching, auto closing/deleting of pair braces etc.

You always should enter two symbols, where first is opening and second closing symbol in pair (even if symbols are same).

Sequence of pairs in the list matters. First one has most priority and in some operations (as brace matching) processed differently.

Symbol, that indicates end of syntax line. Used by editor in several places for optimizing formatting/parsing behavior.

Symbol that shalle be used for character escaping in syntax. For example symbol \ for C/C++.
By default empty.

<Operators override="false">?%--+/&amp;*=&lt;&gt;|!~^,;.:()[]</Operators>

Set of single symbols, which will be treated as operator symbols by HE and displayed with operator style, if it is defined/inherited for current schema. Operator style is one of special HE known styles (as comments for example).

<Delimiters override="false">&quot;'@#{}</Delimiters>

Additional symbols to be treated as delimiters. Normally not needed.

<Words init="A-Za-z" override="false">0-9A-Za-z</Words>

The node defines which characters are allowed in words for text in this syntax. If nothing is specified, values from default syntax is used that equal to 0-9A-Za-z_ (means words are all continues character blocks, containing numbers, alpha characters or underscore).

  • init - this defines set of characters that are allowed for word start (allowed first characters of the word). If not defined, word can start from any number from word symbols. For example code below tells to HippoEDIT that words can be any alpha numeric sequence, but word can not start from number.
<WrapBy override="false">(),</WrapBy>

Node defines additional to white space charcters (space, tab) symbols, which will be indicate prefferebale position for wrapping lines.

<Numbers override="false">-+0-9.EUL</Numbers>

The node defines characters that can be used in numbers. Number than will be recognized as continues character block, formed by characters defined in Numbers node.

<Delimiters override="false">$</Delimiters>

Set of single symbols, which used to determine delimiter symbol (symbol which stops/starts word). You can place here only that symbols which do not come to operators or OpenClose node. If they will intersect, it is not a problem. But if some of the delimiter symbols will be forgotten, HippoEDIT will “stop” on it during next word navigation, for example.

Using this settings, you can define default file mapping for the syntax schema. If nothing defined, mask from parent syntax is used. For mask you can use same mask as normaly can be used for any file operation on Windows.

<Pair file1="*.cpp" file2="*.h"/>

For some programming languages is essential to have binding between file pairs. For example in C++ you have header (*.h) and source (*.cpp) file and they should be treated together (for definition searches for example or for easy toggle between files). As exampleusage of such binding you can check Open Opposite command. Using Pair node here, you can define such binding.

<Encoding default="utf-8" bom="false">
  <Block open="encoding=&quot;"/>
</Encoding>

You can define default encoding for syntax and specify is BOM signs shall be used. In addition to that one can add “magic” strings which may help to detect encoding from the source file (see XML and HTML syntax definitions as example).