Unlike C, C++, and Java, FORTRAN generally ignores blanks and therefore may need extensive look ahead to determine how to scan an input line. We noted earlier a famous example of this: DO 10 I = 1, 10, which produces seven tokens, in contrast with DO 10 I= 1 . 10, which produces three tokens.
(a) How would you design a scanner to handle the extended look ahead that FORTRAN requires?
(b) Lex contains a mechanism for doing look ahead of this sort. How would you match the identifier (D0I0I) in this example?