difficulty getting c-style comments in flex/lex
I suggest you use start conditions instead. %x C_COMMENT “/*” { BEGIN(C_COMMENT); } <C_COMMENT>”*/” { BEGIN(INITIAL); } <C_COMMENT>\n { } <C_COMMENT>. { } Do note that there must not be any whitespace between the <condition> and the rule. %x C_COMMENT defines the C_COMMENT state, and the rule /* has it start. Once it’s started, */ … Read more