Scanning and lexical analysis