Scanner Else, it is an Identifier (or is it?) {L}({L}|{D})* { count(); return(check_type()); } Some "type recognition" done at this (lex) level. Basically allows us to decide whether something is a type or an identifier right here, makes the job of the parser easier. int check_type() { Lookup symbol table for identifier if (a typedef which is found in table) return TYPEDEF; else return IDENTIFIER; }