Scanner for calculator language from Ch 2 of Programming Language Pragmatics