Returning a pointer to the globaltoken structure in your scanner()
* The scanner converts the lexeme to the correct
* type, inserts the value and the type into the
* global structure, then returns a pointer to the
* global structure (for coding convenience).
TokenType token; /* the global token structure */
extern TokenType *scanner();
extern TokenType token; /* the global token */
token.type = T_STRING; /* return a string */
token.value.string = mystring;
token.type = T_IDENT; /* IDs are strings */
token.value.string = mystring;
/* convert ASCII digits to a real integer */
status = convert_to_integer(lexeme_str,&myint);
if( status != GOOD_INT ) do_error(. . .);
token.type = T_INTEGER; /* return an integer */
token.value.integer = myint;