1:
Entirely depends on how you do it, but if you have the variable name in an std::string use:
Code:
std::string VariableName;
File >> VariableName; //Read the variable name somehow
int Length = VariableName.size(); //Get the size of the variable name
2:
functions have a parameter list (brackets: ( ) ). Of course you'll need some kind of look-ahead to find these. One simple (and perhaps not too safe) way of doing this is to read an extra character, if it's a ( then it's a function, if it's a ; or = it's a variable.