WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Partners
Codegravity.com
Logix4u.net
Recover Data
custom t-shirts by Promopays.ca
Lost Birth Certificate
CF-Works.com
Easy Food Recipes
 
Forum
Pages (5) [1] 2 3 4 5   ( Go to first unread post )

Syntax highlight quick guide, a quick guide to the HiEditor's syntax highlight features and usage.

blues
Quote Post


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.
CODE
[asm,inc]

-> 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

PMEmail Poster
Top
akyprian
Quote Post


Administrator
******

Group: Admins
Posts: 2292
Member No.: 1
Joined: 12-May 04


Nice guide, blues.

Could you, please, include how new files (i.e. unsaved) can be handled?

Regards
PMEmail PosterUsers Website
Top
blues
Quote Post


Member
******

Group: Members
Posts: 435
Member No.: 20
Joined: 20-May 04


QUOTE
Could you, please, include how new files (i.e. unsaved) can be handled?

i don't think i get the meaning of the above... is this releated to syntax highlight?

blues
PMEmail Poster
Top
akyprian
Quote Post


Administrator
******

Group: Admins
Posts: 2292
Member No.: 1
Joined: 12-May 04


Yes, for example [,asm,inc] will handle new files as assembly source files and color them accordingly.
PMEmail PosterUsers Website
Top
blues
Quote Post


Member
******

Group: Members
Posts: 435
Member No.: 20
Joined: 20-May 04


oh, i understand.
yes you are right, i will add it.

blues
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (5) [1] 2 3 4 5  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian