*prefixp = NULL; get_token(&tok); switch (tok.kind) { case TOK_IDENT: *typep = tok.str; break; case TOK_STRUCT: case TOK_ENUM: case TOK_UNION: *prefixp = tok.str; scan(TOK_IDENT, &tok); *typep = tok.str; break; case TOK_UNSIGNED: unsigned_dec(typep); break; case TOK_SHORT: *typep = "short"; (void) peekscan(TOK_INT, &tok); break; case TOK_LONG: *typep = "long"; (void) peekscan(TOK_INT, &tok); break; case TOK_VOID: if (dkind != DEF_UNION && dkind != DEF_PROGRAM) { error("voids allowed only inside union and program definitions with one argument"); } *typep = tok.str; break; case TOK_STRING: case TOK_OPAQUE: case TOK_CHAR: case TOK_INT: case TOK_FLOAT: case TOK_DOUBLE: case TOK_BOOL: *typep = tok.str; break; default: error("expected type specifier");
*prefixp = NULL; get_token (&tok); switch (tok.kind) { case TOK_IDENT: *typep = tok.str; break; case TOK_STRUCT: case TOK_ENUM: case TOK_UNION: *prefixp = tok.str; scan (TOK_IDENT, &tok); *typep = tok.str; break; case TOK_UNSIGNED: unsigned_dec (typep); break; case TOK_SHORT: *typep = "short"; (void) peekscan (TOK_INT, &tok); break; case TOK_LONG: *typep = "long"; (void) peekscan (TOK_INT, &tok); break; case TOK_VOID: if (dkind != DEF_UNION && dkind != DEF_PROGRAM) { error ("voids allowed only inside union and program definitions with one argument");
get_type(const char **prefixp, const char **typep, defkind dkind){	token tok;	*prefixp = NULL;	get_token(&tok);	switch (tok.kind) {	case TOK_IDENT:		*typep = tok.str;		break;	case TOK_STRUCT:	case TOK_ENUM:	case TOK_UNION:		*prefixp = tok.str;		scan(TOK_IDENT, &tok);		*typep = tok.str;		break;	case TOK_UNSIGNED:		unsigned_dec(typep);		break;	case TOK_SHORT:		*typep = "short";		(void) peekscan(TOK_INT, &tok);		break;	case TOK_LONG:		*typep = "long";		(void) peekscan(TOK_INT, &tok);		break;	case TOK_VOID:		if (dkind != DEF_UNION && dkind != DEF_PROGRAM) {			error("voids allowed only inside union and program definitions with one argument");		}		*typep = tok.str;		break;	case TOK_STRING:	case TOK_OPAQUE:	case TOK_CHAR:	case TOK_INT:	case TOK_FLOAT:	case TOK_DOUBLE:	case TOK_BOOL:		*typep = tok.str;		break;	default:		error("expected type specifier");	}}