The SRGS editors consist of an SRGS-ABNF editor and an SRGS-XML editor.
The SRGS-ABNF editor is a source editor while the SRGS-XML editor is a multi-page
editor that has a graphic and a source editor page.
The following information is covered in this topic:
The graphical editor page
The Graphics Editor is used to graphically build grammar rules. Rule elements
are selected from the Palette and placed on the Canvas. Element properties
can be modified in the Property Sheet. The Outline View lists a summary of
rules built.
Components of the graphical editor page
- Canvas
The canvas is the area on which grammar objects are arranged
and linked to represent grammar rules. The following are some canvas constraints:
- Rules are arranged vertically, one after the other on the Canvas.
- Items in a rule expansion can only be placed in designated locations (see
drop targets below).
- Figures on the Canvas are not re-sizable. Figure sizes are determined
by the editor and are sized large enough so that their ID can be seen.
- Drop targets and mouse icon feedback
The drop targets and mouse icon
feedback refer to the visual aids that the editor gives when dropping grammar
elements onto the Canvas. They are used when adding new rules or grammar elements
by dragging and dropping them from the palette.
- When dragging and dropping a new rule declaration to the canvas, the drop
targets are shown when the mouse icon is moved near a legal place to drop
the declaration. When the mouse icon hovers in the vicinity of a place that
a rule can be added, a horizontal line is drawn to mark the legal drop area
and the mouse icon changes to a plus (+) sign. If inserting a new rule between
existing rules, all rules after the inserted rule are shifted downward to
allow for the new rule.
- When dragging and dropping a new rule element (Item, Reference, Embedded
Reference), drop targets appear as lines that designate the place where
the figure can be dropped. The mouse icon also gives feedback by changing
to a plus (+) sign to indicate a legal drop location. Clicking the left mouse
button drops the selected element into the designated area and automatically
connects it to an existing element.
- Outline view
The outline view is a zoomed-out view of the whole canvas.
Selecting an item in this view transitions the editor to that item on the
canvas.
- Property sheet
The property sheet is used for viewing and editing the
properties of the elements on the canvas. You can access these properties
by right-clicking in any white space on the canvas.
- SISR editing view
The SISR editing view is used for editing SISR. Clicking
on a figure that contains a tag in the graphical editor makes its content
available in the SISR editing view. This view provides:
- Syntax checking for SISR
- Content Assist for SISR
- Source coloring for SISR
- Pop-up menu
The pop-up menu is displayed by right-clicking on a rule
element on the canvas. Certain menu options are invalid for some objects.
The following table shows the options that might be available for a selected
object:
Table 1. Pop-up menu options| Menu Option |
Description |
| Add Repetition |
Adds repetition to the selected object. |
| Edit Comment |
Adds a comment to the selected object. |
| Delete |
Deletes the selected object. |
| Add Tag |
Adds a Script Tag to the selected object. |
| Make Optional |
Changes the “scope” of the selected rule object to optional. |
The source editor page
The source editor is a fully functional XML based editor for writing grammars.
It validates the SRGS source and reports errors. It contains features for
Source Formatting and Content Assistance.
Any updates in the SRGS-XML source editor are reflected in the graphical
editor.