The Regular Grammar window allows the entry and manipulation of regular grammars. The window is split into two main parts - a text field from which the user may enter rules and a list box showing the currently input rules.
The text field only allows valid rules to be entered. Recall that
valid regular grammar rules consist of a single non-terminal on the
left-hand side with the right hand side in one of three formats: a
single terminal, or a single terminal followed by a single non-terminal,
or just the empty string ().
By convention, we chose a non-terminal to be represented by a single upper-case letter optionally followed by a number of digits (e.g. A, S, B2, X34564). Terminals (currently) consist of the lower-case letters (e.g. a, s, z). Thus, possible rules are:
S | ![]() | a |
C234 | ![]() | aF |
X | ![]() | cT4352 |
Z | ![]() | ![]() |
When entering rules in RELIC, the
is entered by means of the space-bar or the
TAB key.
is entered by simply leaving the right-hand side empty
when pressing ENTER to register the rule. This will appear as
(Epsilon) in the list of rules.
The current Start Symbol is shown at the bottom right hand corner of the window. The non-terminal on the left-hand side of the first rule is automatically taken to be the Start Symbol but it may be changed from the File menu.
A rule can be chosen by clicking on it in the list box of the currently active production rules. A chosen rule may be deleted by choosing the appropriate action in the File menu.