I guess that the suffix u is intended to mark unsigned integers. So, I
would say that the alternatives [fFlL] and [fFlLuU] should be swapped.
Okay.
Furthermore, is it intentional that you do not recognize the '_' digit
separator in floating point numbers that begin with a decimal point?
No. I will fix it.
> + /* unary and binary operators */
> + "|[-+*/<>%&^|=!]?==?|--|\\+\\+|<<?=?|>>?=?|&&|\\|[|]?|->|\\.\\*|!!|::|[?:.][.:]"),
What is the justification that there is still "|&&|\\|[|]?|" instead of
"|&&|\\|\\||" that I suggested (and I think I stressed that the point is
that single-character operators are matched elsewhere) and to which you
said "yes, right"?
Yes. Must have slipped my mind. Sorry.
Also, the part "|<<?=?|>>?=?|" can match <, >, <=, and >=, all of which
are matched by other expressions, so you could reduce it to "|<<=|>>=|",
because that are the only tokens that they must match.
Alright.
So, the final regexes are these, right?:
"[a-zA-Z_][a-zA-Z0-9_]*"
/* hexadecimal and binary numbers */
"|0[xXbB][0-9a-fA-F_]+[lLuU]*"
/* integers and floats */
"|[0-9][.]?[0-9_]+([Ee][-+]?[0-9]+)?[fFlLuU]*"
/* floating point numbers beginning with decimal point */
"|[.][0-9][0-9_]*([Ee][-+]?[0-9]+)?[fFlL]?"
/* unary and binary operators */
"|[-+*/<>%&^|=!]?==?|--|\\+\\+|<<=|>>=|&&|[||]|->|\\.\\*|!!|::|[?:.][.:]"),
Thanks,
Jaydeep.