/sys/src/cmd/cc/cc.y (you might need the Plan 9 yacc) the lexical analyser is hand written. /sys/src/cmd/cc/lex.c /sys/src/cmd/cc/mac.c (includes /sys/src/cmd/cc/macbody) for the built-in preprocessor in fact, lex.c includes the compiler main program and some other little functions, so the lexical analyser proper is smaller