I make my calculator compiler into my bytecode in C ++ as more productive than Java. It came to turning the string into a token or as they are called differently tokens. That is, the string "(var1 + var2) * var3" should turn into tokens[left_bracket, var var1, operator_plus, var var2, right_bracket, operator_multiplication, var var3] 'The code' of the tokens array consists of the heirs of the Token class. This requires the string getStatement(string str, int statement_position) function string getStatement(string str, int statement_position) which returns a string containing the word.
It is necessary to get the word from space to space. Example: getStatement("int variable_a = variable_b + variable_c", 8); should return variable_a .