Chapter 3: Lexical Analysis

Another transition diagram for unsigned numbers

      A more complex transition diagram is difficult to implement and may give rise to errors during coding, however, there are ways to better implementation

We can reduce the number of transition diagrams (automata) by clubbing all these diagrams into a single diagram in some cases. But because of two many arrows going out of each state the complexity of the code may increase very much. This may lead to creeping in of errors during coding. So it is not advisable to reduce the number of transition diagrams at the cost of making them too complex to understand. However, if we use multiple transition diagrams, then the tradeoff is that we may have to unget() a large number of characters as we need to recheck the entire input in some other transition diagram.