Given a state diagram for a language recogniser LR. LR should recognise the following sequence of events of the form: d ((c)+ b (a)* b )* d. You need to implement an ASML application program for the LR-system. LR-system should report the result of recognition process. You have to test your recogniser on each of the following event sets:
Input for recogniser: Sequence of events
Output: “Sequence is recognised” or “Sequence is not recognised”
Construction (“event / or sequence of events”)* means that “event / or sequence of events” can be repeated unlimited number of times or not appear at all;
Construction (“event / or sequence of events”)+ means that “event / or sequence of events” can be repeated unlimited number of times and must appear at least once.
In order to implement you LR-system you can use a state diagram on Figure 1. If the recogniser reaches the final state, a sequence of events is “acceptable”(recognised) otherwise a sequence is not recognised.
Figure 1. State diagram for the Recogniser [ d ((c)+ b (a)* b )* d ]