Member
Group: Members
Posts: 435
Member No.: 20
Joined: 20-May 04
|
Syntax highlight quick guide
This quick guide will summarize and explain the options available for the syntax highlight file (.hes).
1. File structure
The file .hes is structured in sections, each of which specify the keywords for a one (or more) file extension. Thus, a single .hes file can be used to specify the syntax highlight of several different file types.
2. Section structure
Each section starts with a list of file extensions, separated by a comma, enclosed in square brackets. ie.
-> starts a section for the keywords that will be applied to .asm and .inc files. The lines following the section start will specify a color and the keywords to which it is applied in this form:
CODE | 0x00bbggrr = keyword1 keyword2 keyword3 ... |
- the number is a DWORD in hexadecimal format - first byte specifies the type of keywords (00=normal, 01=separators). - rr, gg, bb specify the red green blue parts of the color (note the reverse order). - after the equal sign follow the list of keywords separated by a space.
3. Keyword specification
^ in front of keyword: the keyword is case sensitive. ~ in front of keyword: forces the specified case (display only). + at the end of keyword: all the rest of the line will be treated as a comment. - at the end of keyword: all the rest of the line will be treated as a string. & at the end of keyword: specify the enclosing characters for a string (ie. "& specifies " as the string quotes, meaning that "string" is a string).
4. Comments
A line starting with ; is a comment and ignored by the syntax highlight parser.
5. Notes
- The same file extension can be specified in up to nine (9) sections and all the keywords will be taken into account. This simplifies the management of keywords that are shared among different file types. - There is no limit on the number of languages, keywords and keyword groups. - You can specify a default syntax highlight for new, unsaved files by adding an "empty" extension between the square brackets at the beginning of the section. i.e. [,asm,inc] means that new files will have by default applied the syntax highlight of asm files.
6. Example
This is an example (simplified) of a .hes syntax highlight file.
CODE | [asm,inc] ;Registers 0x00408080=~AH ~AL ~AX ~BH ~BL ~BH ;User instructions 0x008000ff=~AAA ~AAD ~AAM ~AAS ~ADC ~ADD
[rc] ;General statements 0x10000080=#define #include ACCELERATORS ALT AUTOCHECKBOX ;Object states 0x104080ff=^BS_3STATE ^BS_AUTO3STATE ^BS_AUTOCHECKBOX
|
blues
|