/*Parse integer literals and ?Floats?*/
case DIGIT:
addChar();
getChar();
while (charClass == DIGIT)
{
addChar();
getChar();
}
At this point you already know what nextChar
is. If it's a dot, write some more code to consume it and all the following digits and set nextToken
to FLOAT_LIT.
Otherwise fall through to this:
nextToken = INT_LIT;
break;