Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
__isl_give isl_val *isl_token_get_val(isl_ctx *ctx, struct isl_token *tok);
__isl_give char *isl_token_get_str(isl_ctx *ctx, struct isl_token *tok);
+int isl_token_get_type(struct isl_token *tok);
void isl_token_free(struct isl_token *tok);
struct isl_stream {
return tok;
}
+/* Return the type of "tok".
+ */
+int isl_token_get_type(struct isl_token *tok)
+{
+ return tok ? tok->type : ISL_TOKEN_ERROR;
+}
+
/* Given a token of type ISL_TOKEN_VALUE, return the value it represents.
*/
__isl_give isl_val *isl_token_get_val(isl_ctx *ctx, struct isl_token *tok)