SynGen .msg Designer – Online SynEdit Message File Editor

SynGen .msg Designer is a browser-based tool for creating and editing SynEdit .msg files used in Delphi syntax highlighters. It provides structured editors for KEYS, CHARS, TOKENS, and sample source sections, validates your grammar, and exports a fully compliant .msg file for use in custom syntax highlighters.

This tool is designed for Delphi developers working with SynEdit, SynHighlighter, and custom language grammars. It simplifies the creation of message files by providing a clean interface, live validation, and instant export.

A visual IDE for creating and editing SynEdit highlighter descriptor files.
Design token types, keyword groups, char rules and enclosures — then export a ready-to-use .msg file.
How to use
1
Drag sections from the Palette on the left onto the canvas lanes. Each lane accepts only its matching section type. Drop onto the lane header or the lane body.
2
Click any card to open it in the Inspector on the right. Edit the name, colours, font style, keywords or delimiters. Changes are reflected instantly in the live preview.
3
Validate the document to check for cross-reference errors. Problem lanes are highlighted in red with a description of each issue.
4
Generate .msg to export the finished descriptor file. Copy it to the clipboard or download it directly.
5
Click Open .msg to reopen a previously saved .msg file and continue editing where you left off.
6
Click Example in the toolbar to load a complete x86-64 assembly highlighter and explore a real-world document.
Resources

Help & Reference

What is a .msg file?

A .msg file is a SynEdit Highlighter Descriptor — a plain-text specification that the SynEdit highlighter generator uses to create a complete Delphi syntax-highlighting unit. It defines the token types, keywords, character dispatch rules and enclosure pairs for any programming language or file format.

SynGen .msg Designer gives you a visual canvas for building these files without writing any descriptor syntax by hand.

Canvas sections

SectionPurpose
HeaderSets the generated class name (TSyn…Syn), the token-kind enum prefix, and the identifier character sets. One per document.
Token typesEach token type becomes a value in the TtkTokenKind enumeration and a TSynHighlighterAttributes instance with its own foreground, background and font style. Add as many as your language needs.
Key groupsA KEYS block maps a list of reserved words to one token type. The group name must exactly match a token type name.
Char rulesAuto-generated from the Header's Ident start chars. Defines which characters trigger the identifier scanner and provides the BeginProc/EndProc dispatch body. Read-only.
Enclosed byDefines delimiter pairs (e.g. { }, /* */, " ") and whether they can span multiple lines.
Sample sourceA block of representative code shown in the SynEdit highlighter preview dialog. One per document.

Preset token types

The Common presets area in the palette provides one-click buttons for the token types found in almost every programming language. Clicking a preset:

PresetAuto-adds enclosure(s)
Identifier
CommentLine comment ; and block comment {…}
StringDouble-quote string "…"
Keyword
Number
DirectiveCompiler directive {$…}
Space / Symbol / Attribute
DocCommentBlock doc comment /**…*/

Each preset token type is created with sensible default colours and font styles. You can customise them in the Inspector after adding them.

When a Comment or String preset is added, matching Enclosure cards are created automatically and linked to the new token type.

Working with the canvas

Adding sections: drag a palette item onto a lane. Drop onto the lane header (← drop here hint) or the lane body. The lane highlights blue when the drop is valid, red when the type is wrong for that lane.

Reordering: drag a card onto another card within the same lane to swap their positions. Order matters — it controls the order in the generated file.

Selecting: click any card to open its properties in the Inspector. The selected card shows a blue outline.

Renaming: double-click any card title to edit it in place. Press Enter to confirm or Esc to cancel. Works on Token type names, Key group names, and Enclosure rule names.

Removing: click the icon on the top-right of any card. The Char rule card cannot be removed — it is managed automatically.

Resizing panels: drag the thin vertical handles between the palette, canvas and inspector to adjust panel widths.

Inspector — token type colours

Each token type has independent foreground and background colour controls. Enable a colour with the checkbox, then use the colour editor:

Swatch bar: the wide bar shows the current colour. Click anywhere on it to open the browser's native colour picker.

RGB sliders: drag the Red, Green and Blue sliders for precise channel control. The value updates live.

Output format: choose how the colour is written into the .msg file — Name (e.g. clNavy), $Hex (Delphi BGR format, e.g. $00800000) or RGB() (e.g. RGB(0,0,128)).

The live preview in the Token type inspector shows exactly how a sample code snippet will look with the current token styles applied — including keywords, enclosures and identifier colours.

Validation

Click Validate in the toolbar to check the document for structural errors. Each problem is shown as a red highlight on the affected lane, with a badge showing the number of issues and a list of descriptions below the lane body.

Common issues:

IssueFix
Key group has no matching token typeEnsure the group name exactly matches a token type name (case-sensitive).
Key group has no keywordsAdd at least one keyword in the Inspector.
Enclosure references unknown token typeSet Token type to an existing token type name.
No Header sectionDrag a Header card from the palette.

Validation errors clear automatically as soon as you make any change to the document.

Opening a saved .msg file

A .msg file saved from SynGen can be reopened at any time to continue editing. Click Open .msg in the toolbar or the start page, then select the file.

The loader restores all sections exactly as they were saved:

SectionRestored from
HeaderClass name, token prefix, ident chars (first 3 lines)
Token typesTOKENTYPES block — names and colour/style expressions
Key groupsEach KEYS block — group name and word list
Char rulesCHARS block is read then auto-regenerated from the header
EnclosuresENCLOSEDBY block — token type, rule name, delimiters, multi-line flag
Sample sourceSAMPLESOURCE block — verbatim text
The .msg format is the canonical save format for SynGen. Always use Generate .msg → Save .msg file to save, then Open .msg to resume. Opening a .msg file replaces the current canvas.

Generating & exporting

Click Generate .msg to open the output modal. The generated file is syntax-highlighted for readability. Use Copy to clipboard to paste it into your project, or Save .msg file to download it directly. The filename is derived from the class name in the Header card.

Keyboard shortcuts

KeyAction
EnterAdd a keyword in the keyword input field
EscClose the Generate modal or Help panel

Opening a SynHighlighter .pas file

You can reverse-parse an existing SynEdit highlighter unit to populate the designer automatically. Click Open .pas in the toolbar or the Open .pas file button on the start page, then select a SynHighlighterXxx.pas file.

The parser extracts:

Extracted fromPopulated in
class TSynXxxSynHeader — class name and token prefix
TtkTokenKind enum valuesToken type cards (one per tk… value)
fXxxAttri.Style/Foreground/Background in constructorToken type colour and font style
Keyword string constants + EnumerateKeywords callsKey group cards with full word lists
Next procedure char dispatch (#34, #39, ';', '//', '{'…)Enclosure cards
GetSampleSource functionSample source card
IdentProc character ranges in NextHeader ident start chars + auto Char rule
The parser works on standard SynEdit highlighter units. Highly customised units may need manual correction of some token types or enclosures after import. Use Validate to check for any cross-reference issues.

About

SynGen .msg Designer is copyright © 2026 Mark Stephen Day. All Rights Reserved.

Source code: github.com/GrooverMD/SynEditMsgDesigner

Built with assistance from Claude AI by Anthropic.

SynEdit: github.com/TurboPack/SynEdit

Inspector