#include <isl/hash.h>
#include <isl/aff_type.h>
#include <isl/obj.h>
+#include <isl/val.h>
#if defined(__cplusplus)
extern "C" {
} u;
};
+__isl_give isl_val *isl_token_get_val(isl_ctx *ctx, struct isl_token *tok);
void isl_token_free(struct isl_token *tok);
struct isl_stream {
#include <isl_stream_private.h>
#include <isl/map.h>
#include <isl/aff.h>
+#include <isl_val_private.h>
struct isl_keyword {
char *name;
return tok;
}
+/* 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)
+{
+ if (!tok)
+ return NULL;
+ if (tok->type != ISL_TOKEN_VALUE)
+ isl_die(ctx, isl_error_invalid, "not a value token",
+ return NULL);
+
+ return isl_val_int_from_isl_int(ctx, tok->u.v);
+}
+
void isl_token_free(struct isl_token *tok)
{
if (!tok)