This is an example for C comments, taken from the HP man page for lex: "/*" { loop: while (input() != '*'); switch (input()) { case '/': break; case '*': unput('*'); default: goto loop; } }