ISL_TOKEN_UNKNOWN = 256, ISL_TOKEN_VALUE,
ISL_TOKEN_IDENT, ISL_TOKEN_GE,
ISL_TOKEN_LE, ISL_TOKEN_GT, ISL_TOKEN_LT,
+ ISL_TOKEN_NE,
ISL_TOKEN_LEX_GE, ISL_TOKEN_LEX_LE,
ISL_TOKEN_LEX_GT, ISL_TOKEN_LEX_LT,
ISL_TOKEN_TO, ISL_TOKEN_AND,
else if (type == ISL_TOKEN_GT)
cond = isl_pw_aff_list_gt_set(isl_pw_aff_list_copy(left),
isl_pw_aff_list_copy(right));
+ else if (type == ISL_TOKEN_NE)
+ cond = isl_pw_aff_list_ne_set(isl_pw_aff_list_copy(left),
+ isl_pw_aff_list_copy(right));
else
cond = isl_pw_aff_list_eq_set(isl_pw_aff_list_copy(left),
isl_pw_aff_list_copy(right));
case ISL_TOKEN_GT:
case ISL_TOKEN_LE:
case ISL_TOKEN_GE:
+ case ISL_TOKEN_NE:
case '=':
return 1;
default:
tok = isl_token_new(s->ctx, line, col, old_line != line);
if (!tok)
return NULL;
- tok->type = ISL_TOKEN_NOT;
- tok->u.s = strdup("!");
+ if ((c = isl_stream_getc(s)) == '=') {
+ tok->u.s = strdup("!=");
+ tok->type = ISL_TOKEN_NE;
+ return tok;
+ } else {
+ tok->type = ISL_TOKEN_NOT;
+ tok->u.s = strdup("!");
+ }
+ if (c != -1)
+ isl_stream_ungetc(s, c);
return tok;
}
str2 = "{ [i,j] -> [min(i,j)] }";
test_parse_map_equal(ctx, str, str2);
+ str = "{ [i,j] : i != j }";
+ str2 = "{ [i,j] : i < j or i > j }";
+ test_parse_map_equal(ctx, str, str2);
+
test_parse_pwqp(ctx, "{ [i] -> i + [ (i + [i/3])/2 ] }");
test_parse_map(ctx, "{ S1[i] -> [([i/10]),i%10] : 0 <= i <= 45 }");
}