An exercise while studying scan and parse of compiler