While doing tokenization we look for longer pattern that is available in language.
For Example i = k++;
Like when we see + there are chances that next term is also +, and ++ is allowed in language, so if we end up getting ++ we consider it as single token.
Now your question ' should we consider the ternary operator "? :" as 1 token or two separate tokens "?" and ":"
'
We consider ? and : as two different token.
For example a ? b : c;
when we look how it work, it tells us "b if a is true, else c". You can observe here, that ? and : act as two independent entity. Parser will read it as, [a]{what is the condition} [?]{is it true or false} [b]{if true do this} [:]{And} c{if false do this}. So you can see here they both have their different use. Even we write like this "a ? : c;" parser will think it as "a ? <do nothing> : c; "
If "?:" combinedly define something meaningful, then we consider it as single token. But as we have seen they both have a different role when we use it in some expression, so we consider as two different token.
[result] [=] [x] [>] [y] [?] ["x is greater than y"] [:] ["x is less than or equal to y"][;]
So total token here is 10.