There are single and multi-line comments available, like in C.
How to describe the rules for the lexer to ignore all the comments, even nested, such as these:
// comment /* nested comment /* and nested again? */ */
or like these:
/* comment // one more comment /* and more... */ */
UPD:
Here is the valid code to parse nested comments(thanks Sam):
rule token = parse
| "/*" { comments 0 lexbuf }
| [' ' '\t' '\n'] { token lexbuf }
| eof { raise End_of_file }
and comments level = parse
| "*/" {
if level = 0 then token lexbuf
else comments (level-1) lexbuf
}
| "/*" { comments (level+1) lexbuf }
| _ { comments level lexbuf }
When I was playing around with FsLex I found the Ocamllex Tutorial a great help, in particular the nested comments section was easy to change into F#.