Welcome to "HippoEDIT explained"
Today we will learn something about the language - "Syntax" files (see picture on the end)
Please note that Alex have explain the basic about this in the topic
"Adding new Language Syntax" and also in this topic "
What means All, Default, Default source, Text etc" already.
I only take this information and test it how this works to get an better understanding for it.
This may be from interest for others, so i share here my experiences on the way to succeed
(Please note that english isn't my mother language, so perhaps something may be not well written)
Preamble:To know how to highlight the syntax, where to fold the code,
what are the keywords and to provide you with Code Templates
HippoEDIT store this information in Language Syntax Files (LSF) in XML format.
This LSF are stored in an SYNTAX-sub-folder of the HippoEDIT (HE) DATA-folder.
For example: if you have installed HE on "X:\HippoEDIT"
then the syntax files are found in "X:\HippoEDIT\Data\Syntax" (see (1) in picture)
(Note: you can change this path, but that's not an topic of this post)
{todo - note that data folder is searched recursively with all sub-folders }
InheritanceHippoEDIT use an clever technic that allow you to add and modify common definitions for one,
two or many (programming) languages at only one single place,
inheritance.
That means that there is an basic LSF which holds common rules* and other LSF can
be advised to inherit this rules. The inherited and the own rules are combined with an ingenious
algorithm to an new, just-in-time rule. This strategy works across several LSF too, if needed,
Dummy Example: Basic-LSF < Common-Language-LSF < Language-LSF < YourOwn-LSF (see (2) in picture)
*Rules: which rules that are is explained later.Inheritance Explanation:In the picture at point (2) you can see how the LSF's are inherited.
Note: You don't have to use this inheritance feature. You can still modify every LSF on its own,
but then you may do the work twice. So its proposed to get familiar with some basic of this
to understand how HE works and to make your work more easy and boost your performance.
- Inherit-Level 1
First there is an LSF called def_spec.xml (DEFinition SPECification)
In def_spec.xml are all rules defined which should be set for all other LSF which inherit from this def-LSF.
In theory on this level there could be an "stand alone", independent syntax, which inherit from nothing, too.
- Inherit-Level 2
Then there is an fork. Two other basic LSF inherit from def : defsource_spec.xml and deftext_spec.xml
* defsource is the basic LSF for all languages dealing with source code (c++, php, css etc)
* deftext is the basic LSF for text based (Plain text, xml, html etc) documents.
- Inherit-Level 3
On this level there are LSF with different purposes:
A Just an "stand alone" LSF for an language as xxxxxxx e.g.
B An LSF as f.ex. basic_spec (basic means the BASIC language),
which works "stand alone" for the BASIC language itself
and in turn is an Common-Basic-LSF for other BASIC-like languages as VB and VBS.
C Dedicated Common-Basic-LSF.
Example: Since all C-language dialects may have the same basic rules there is in consistence
an cBase_spec which is the starting-point for all following c-language like syntaxes, as C++_spec e.g.
- Inherit-Level 4
Here are LSF which have an Common-Basic-LSF, as VBS_spec has basic_spec as ancestor.
(BTW: again, there is no strict advice that you have to use this Inherit-Level-thinggy, you may also create
an xyz_spec for your own use without any inherit-instruction and put all rules there in. It's up to you)
- Inherit-Level 5
I don't know if there is any LSF on this level right now.
But you could for example create your own LSF which you can advice to inherit from vbs_spec.
This way it must be possible to create user-own syntax files which no installer overwrites never.
I will test this too since this is an common question.
What means Inheritance? - What is inherited from ancestor?How to break Inheritance? - How to use other rule as the ancestor has defined?
todo, will come soon (i hope

)
Accessing the LanguageSyntaxFiles:(see (3) and (4) in picture)
- to have a overview of the inheritance Tools or Help manage dialogs can be use with Show All Syntaxes
todo, will come soon (i hope

)
The Rules:* <FILEINFO author="HippoEDIT.com" type="LangSpec"/>
* <SYNTAX id="cpp" name="C++" inherit="cbased" inherit_url="cbase_spec.xml">
* SPECIFICATION
<FilePattern mask="*.c;*.cpp;*.cxx;*.hpp;*.hxx;*.inl;*.h">
<Pair file1="*.cpp" file2="*.h"/>
* Keywords
How to make keyword list for syntax file at easy* Styles
http://forum.hippoedit.com/index.php/topic,83.msg883.html#msg883<Blocks>
<Containers>
* Scopes / Code Folding =>
HowTo fold your code with code foldingWhere does "Region Name" being referenced fromhttp://forum.hippoedit.com/index.php/topic,204.0.html* Highlighting
* Labels / Code Explorer =>
"Navigation Bar", "Function List", "Code Browser"* Code Templates
Code Templates Tricks & Tipshttp://forum.hippoedit.com/index.php/topic,137.0.html
todo, will come soon (i hope

)
User specific LanguageSyntaxFiles
<lang>_user.xml:(see (5) in picture)
XML Syntax RulesWhat do you have to know about HippoEDIT XML files?
First: you should use HippoEDITs build-in possibilities
to modify the syntax files to always get an proper formated syntax file.
However, if you are an experienced user you may want to edit the files directly in editor.
So here are some rules generally about XML and specially for HippoEDIT:
* Tag elements must be nested with care: first close an tag before open an another one.
Example Tree:
<root>
<childtag>
<subchild>.....</subchild>
<elementtag> value value value </elementtag>
<element attribute="value"/>
</childtag>
<!-- <element> element commented out </element> -->
<settings>switch</settings>
</root>
* There is no specific order in XML tags necessary. E.g. it's no matter if SCOPES came first or STYLE.
But for keywords-list it is better to keep alphabetic order - this way internal loading is faster.
* All XML tags and attributes are case sensitive.
* The opening and closing tags must be written with the same case.
* You can use comments in XML by using: <!-- comment -->
* All not English text should be correctly encoded in UTF-8
* Attribute "values" mostly have to be quoted with double quotes "...".
But not always. For code template the template itself and for <settings>...</settings> there are no quotes needed.
Just take an look into the default distributed syntax files to get an idea where quotes are needed and where not.
The best is you let HippoEDIT modify the LSF for you. He knows best which signs where to exchange with entities.
* Entity List:
< < less than
> > greater than
& & ampersand
' ' apostrophe
" " quotation mark
* Special chars in values:
\t tab
\n new line (line break)
\\ backslash
Extern Links about XML:
http://de.wikipedia.org/wiki/Extensible_Markup_Languagehttp://en.wikipedia.org/wiki/XML.