ISL_TOKEN_TRUE, ISL_TOKEN_FALSE,
ISL_TOKEN_CEILD, ISL_TOKEN_FLOORD, ISL_TOKEN_MOD,
ISL_TOKEN_STRING,
+ ISL_TOKEN_MAP, ISL_TOKEN_AFF,
ISL_TOKEN_LAST };
struct isl_token {
union {
isl_int v;
char *s;
+ isl_map *map;
+ isl_pw_aff *pwaff;
} u;
};
#include <strings.h>
#include <isl/ctx.h>
#include <isl_stream_private.h>
+#include <isl/map.h>
+#include <isl/aff.h>
struct isl_keyword {
char *name;
return;
if (tok->type == ISL_TOKEN_VALUE)
isl_int_clear(tok->u.v);
+ else if (tok->type == ISL_TOKEN_MAP)
+ isl_map_free(tok->u.map);
+ else if (tok->type == ISL_TOKEN_AFF)
+ isl_pw_aff_free(tok->u.pwaff);
else
free(tok->u.s);
free(tok);
fprintf(stderr, "got value '");
isl_int_print(stderr, tok->u.v, 0);
fprintf(stderr, "'\n");
+ } else if (tok->type == ISL_TOKEN_MAP) {
+ isl_printer *p;
+ fprintf(stderr, "got map '");
+ p = isl_printer_to_file(s->ctx, stderr);
+ p = isl_printer_print_map(p, tok->u.map);
+ isl_printer_free(p);
+ fprintf(stderr, "'\n");
+ } else if (tok->type == ISL_TOKEN_AFF) {
+ isl_printer *p;
+ fprintf(stderr, "got affine expression '");
+ p = isl_printer_to_file(s->ctx, stderr);
+ p = isl_printer_print_pw_aff(p, tok->u.pwaff);
+ isl_printer_free(p);
+ fprintf(stderr, "'\n");
} else if (tok->u.s)
fprintf(stderr, "got token '%s'\n", tok->u.s);
else