Graphical Design and Generation of Textual User Interfaces
Here are a couple of simple examples of informal english descriptions of
the structure of a particular kind of text file, and the corresponding
informal graphical descriptions.
There are stylistic differences between them, purely to illustrate
different options. The first uses colour to emphasise the different components
of the complete design. The second is monochrome, and the rules for "symbol
string" and "state number" have not been substituted into the main rule (for
"automaton").
Student course choices
original problem,
including
complete formal grammars.
The whole file consists of one or more students, with the information about
each student on a separate line. For each student,
the first item on the line is a school (e.g. CIS),
the next is a tutorial group (e.g. W7),
the next is the student's name (e.g. Abramson,Paul B)
and finally there is list of modules that they are taking (e.g. CS3001 CS3071 CS3102 CS3132
CS3311 CS3322 CS3361 CS3900 EM2490):
The list of modules can be empty or contain any number of module names.
A school is some number of upper-case letters.
A group can be an upper-case letter followed by a digit, or two underline
characters (e.g. if it is unknown because the student has not yet been put in
a group).
A module name is two upper-case letters, followed by 3 or 4 digits.
A student's name starts with an upper-case letter, the second character is
either lower-case or an apostrophe, and then any remaining characters are
upper- and lower-case letters, commas, spaces, hyphens and apostrophes.
The different fields are separated by tab characters, and the individual
module names within the module list field are separated by spaces.
e.g.:
CIS W7 Abramson,Paul B CS3001 CS3071 CS3102 CS3132 CS3311 CS3322 CS3361 CS3900 EM2490
CE X1 O'Rourke,Daniel M CS3001 CS3041 CS3052 CS3071 CS3082 CS3111 CS3322 CS3900 EM2490
AI Y6 Naismith,Gregory S CS3001 CS3052 CS3071 CS3082 CS3311 CS3322 CS3361 CS3900 EM2490
CIS X4 Sanders,Alexander P CS3001 CS3071 CS3102 CS3132 CS3311 CS3322 CS3361 CS3900 EM2490
SI __ Varney,Samantha CS3041 CS3052 CS3071 CS3082 CS3251 CS3311 CS3432 CS3900 EM2490
CS W1 Smith,Mark CS3001 CS3052 CS3071 CS3082 CS3212 CS3232 CS3241 CS3251 CS3900 EM2490
MI I3 Cooper,Paul CS3311 CS3561 CS3572 CS3902 MK3322 HM3111 HM3132 HM3142 HM3152 HM3121
MI I4 Smythe,Helen Ruth CS3561 CS3572 CS3902 MK3322 MK3311 DI3111 HM3132 HM3152 HM3121 HS3132
CE Z5 Grant,Ellie CS3052 CS3071 CS3082 CS3111 CS3311 CS3322 CS3361 CS3900 EM2490
the whole file is
|
---|
(list of) one or more
|
---|
student is
|
---|
school is
|
---|
(list of) one or more
|
---|
[A-Z]
|
|
|
tutorial group is
|
---|
(choice of)
|
[A-Z] | [0-9]
| or
|
---|
'_' | '_'
|
|
|
student name is
|
---|
[A-Z]
| [a-z']
|
(list of) none or more
|
---|
[A-Za-z, '-]
|
|
|
module list is
|
---|
(list of) none or more
|
---|
module is
|
---|
[A-Z] | [A-Z] |
(choice of)
|
[0-9] |
[0-9] |
[0-9] |
|
or
|
---|
[0-9] |
[0-9] |
[0-9] |
[0-9] |
|
| separated by ' ' |
|
| separated by '\t' |
| separated by '\n' |
|
Finite state automaton
original problem
The description of the automaton consists of one or more state
declarations, followed by the definition of the start state, given by a '*'
followed by a state-number. Each state declaration starts with the
state-number, followed by a colon or a "@", followed by a list of one or more
pairs of a symbol-string and a state-number, separated by commas and
terminated by a semicolon.
A symbol-string is one or more characters between a pair of apostrophes (').
Any characters (except a newline, or another apostrophe) can appear between
the apostrophes containing a symbol-string.
Spaces, tabs and newlines can appear between any components of the input, but
not inside a state-number. A space or tab (or both) can appear inside a
symbol-string, in which case it is significant, but a newline cannot.
e.g.:
7: ' ' 7, '+' 1, '-' 1,
'0123456789' 2; 1: '0123456789' 2;
2@ '0123456789' 2, '.' 3, 'E' 4;
3@ '0123456789' 3, 'E' 4;
4: '+-' 5, '0123456789' 6;
5: '0123456789' 6;
6@ '0123456789' 6;
*7
automaton is
|
---|
(list of) one or more
|
---|
state declaration is
|
---|
state number
|
|
(list of) one or more
|
---|
pair is
|
---|
symbol string | state number
|
| separated by ','
|
---|
| ';'
|
|
|
start state
|
---|
'*' | state number
|
|
symbol string is
|
---|
'\''
| (list of) one or more
|
---|
Any character (except a newline, or another apostrophe)
(A space or tab (or both)
can appear inside a symbol string, in which case it is significant,
but a newline cannot.)
|
| '\''
|
state number is
|
---|
unsigned number
|
|
---|
Spaces, tabs and newlines
can appear between any components of the input,
but not inside a state number.
|