As mentioned by others Bjrane is referring to Lexical analysis.
In general terms tokenizing || creating tokens, is a process of processing input streams and dividing them into blocks, without worrying about whitespaces etc. best described earlier by @StoryTeller.
"or as bjrane said: is a sequence of characters that represent something we consider a unit".
The token itself is an example of a C++ user-defined type'UDT' like int or char, so token can be used to define variables and hold values.
UDT can have member functions as well as data members. In your code you define two member functions which is very basic.
1)Kind, 2)Value
class Token {
public:
char kind;
double value;
};
Based on it we can initialize or construct its objects.
Token token_kind_one{'+'};
Initializing token_kind_one with its kind(operator) '+'.
Token token_kind_two{'8',3.14};
and token_kind_two with its kind(integer/number) '8' and with a value of 3.14.
Lets assume we have an expression of ten characters 1+2*3(5/4), which translates to ten tokens.
Tokens:
|----------------------|---------------------|
Kind |'8' |'+' |'8' |'*'|'8'|'('|'8' |'/'|'8' |')'|
|----------------------|---------------------|
Value | 1 | | 2 | | 3 | | 5 | | 4 | |
|----------------------|---------------------|
C++ compiler transfer file data to a token sequence skipping all whitespaces. To make it understandable to itself.