Working with syntax nodes
The syntax management dialog provides a variety of schemes for working with syntax nodes. At the moment there is no complete mechanism for exporting and importing syntax tree items as a whole, although this is something that we expect to address in future. To make it easier to archive syntax definitions cut and paste is implemented, along with an extended cut and paste facility that can work with plain text in selected cases.
Additions to the syntax tree can be made either using the toolbar buttons at the top of the dialog, or through the right click context menus offered by both the lefthand tree view, and the righthand list view of the syntax management dialog. It is important to notice that there are actually two context menus used in this dialog. The grey area in the list view and the whole tree view share the "node" context menu. The white area of the list view has it's own "subnode" context menu. These are shown below;
Node Context Menu |
Subnode Context Menu |
|
|
These menus allow full control over the syntax tree. They provide for deletion of tree items with cut and paste, and the specification of individual schemes.
By default, cut and paste works on the basis of a binary format that works only with the syntax management dialog. This applies to all syntax nodes of either scheme or group type. Within a group multiple selections may be made, and data copied will be available on the clipboard as text. Inside groups, the reverse is also true, and text data may be pasted into the group as text.
When copying or pasting text data to a group, individual fields are line delimited. In some cases, the group type will expect two strings, i.e. a start and and end sequence. In these cases, two lines of text from the clipboard will be used to create a single node specification.
This facility helps when working with completely new syntax definitions, especially where the target language requires the use of large numbers of keywords or operators.
|