Lexical Analysis and Scanning Compiler Construction Lecture 2 Spring 2001 Robert Dewar The Input Read string input Might be sequence of characters (Unix) Might be sequence…