isl_stream: accept lexicographic operators
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 1 May 2010 17:08:46 +0000 (19:08 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 1 May 2010 17:08:46 +0000 (19:08 +0200)
include/isl_stream.h
isl_stream.c

index b3a91f9..b566ae5 100644 (file)
@@ -22,6 +22,8 @@ enum isl_token_type { ISL_TOKEN_ERROR = -1,
                        ISL_TOKEN_UNKNOWN = 256, ISL_TOKEN_VALUE,
                        ISL_TOKEN_IDENT, ISL_TOKEN_GE,
                        ISL_TOKEN_LE, ISL_TOKEN_GT, ISL_TOKEN_LT,
+                       ISL_TOKEN_LEX_GE, ISL_TOKEN_LEX_LE,
+                       ISL_TOKEN_LEX_GT, ISL_TOKEN_LEX_LT,
                        ISL_TOKEN_TO, ISL_TOKEN_AND,
                        ISL_TOKEN_OR, ISL_TOKEN_EXISTS,
                        ISL_TOKEN_DEF, ISL_TOKEN_INFTY, ISL_TOKEN_NAN,
index 88670cb..6dcdafd 100644 (file)
@@ -381,10 +381,16 @@ static struct isl_token *next_token(struct isl_stream *s, int same_line)
                if ((c = isl_stream_getc(s)) == '=') {
                        tok->type = ISL_TOKEN_GE;
                        return tok;
-               }
+               } else if (c == '>') {
+                       if ((c = isl_stream_getc(s)) == '=') {
+                               tok->type = ISL_TOKEN_LEX_GE;
+                               return tok;
+                       }
+                       tok->type = ISL_TOKEN_LEX_GT;
+               } else
+                       tok->type = ISL_TOKEN_GT;
                if (c != -1)
                        isl_stream_ungetc(s, c);
-               tok->type = ISL_TOKEN_GT;
                return tok;
        }
        if (c == '<') {
@@ -395,10 +401,16 @@ static struct isl_token *next_token(struct isl_stream *s, int same_line)
                if ((c = isl_stream_getc(s)) == '=') {
                        tok->type = ISL_TOKEN_LE;
                        return tok;
-               }
+               } else if (c == '<') {
+                       if ((c = isl_stream_getc(s)) == '=') {
+                               tok->type = ISL_TOKEN_LEX_LE;
+                               return tok;
+                       }
+                       tok->type = ISL_TOKEN_LEX_LT;
+               } else
+                       tok->type = ISL_TOKEN_LT;
                if (c != -1)
                        isl_stream_ungetc(s, c);
-               tok->type = ISL_TOKEN_LT;
                return tok;
        }
        if (c == '&') {