A Gentle Introduction to
We can nest options, this allows us to specify complicated
options - but we must give "deterministic" expressions.
The bar (|) may be used to allow options. A|B means either A or B
is permitted. We can use brackets in these regular expressions.
Any of the following is allowed:
- A country may have a president only.
- A country may have a king only.
- A country may have a king and a queen.
- A country may have a queen only.
The dtd given is correct - but it cannot be used because it is
A non-deterministic expression can be parsed in more than one way.
The validator uses a "one symbol look ahead" - if there are two
options that start with the same element the validator cannot cope.
Example of a non-deterministic expression
A deterministic equivalent
Replace the dtd with a deterministic equivalent.