Modified lexical analyzer to parse strings and characters properly