- default:
- if(isdigit(*c) || *c == '-') {
- bool have_nondigits = false;
- bool have_digits = false;
- int have_floating_point = 0;
-
- do {
- if(isdigit(*c))
- have_digits = true;
- else if(*c == '.')
- ++have_floating_point;
- else if(isalnum(*c) || *c == '_')
- have_nondigits = true;
-
- if(token_length < MAX_TOKEN_LENGTH)
- token_string[token_length++] = *c;
-
- nextChar();
- } while(!isspace(*c) && !strchr(delims, *c));
-
- token_string[token_length] = 0;
-
- // no nextChar
-
- if(have_nondigits || !have_digits || have_floating_point > 1)
- return TOKEN_SYMBOL;
- else if(have_floating_point == 1)
- return TOKEN_REAL;
- else
- return TOKEN_INTEGER;
- } else {
- do {
- if(token_length < MAX_TOKEN_LENGTH)
- token_string[token_length++] = *c;
- nextChar();
- } while(!isspace(*c) && !strchr(delims, *c));
- token_string[token_length] = 0;
-
- // no nextChar