diff -r 4a0654b18dbe acse/Acse.lex
--- a/acse/Acse.lex	Tue Feb 02 17:19:12 2010 +0100
+++ b/acse/Acse.lex	Thu Nov 29 11:01:31 2012 +0100
@@ -85,6 +85,8 @@
 "!="              { return NOTEQ; }
 "<="              { return LTEQ; }
 ">="              { return GTEQ; }
+"<=>"             { return SHIP_OP; }
+"in"              { return IN_OP; }
 "&&"              { return ANDAND; }
 "||"              { return OROR; }
 ","               { return COMMA; }
diff -r 4a0654b18dbe acse/Acse.y
--- a/acse/Acse.y	Tue Feb 02 17:19:12 2010 +0100
+++ b/acse/Acse.y	Thu Nov 29 11:01:31 2012 +0100
@@ -115,7 +115,7 @@
 %token LBRACE RBRACE LPAR RPAR LSQUARE RSQUARE
 %token SEMI COLON PLUS MINUS MUL_OP DIV_OP MOD_OP
 %token AND_OP OR_OP NOT_OP
-%token ASSIGN LT GT SHL_OP SHR_OP EQ NOTEQ LTEQ GTEQ
+%token ASSIGN LT GT SHL_OP SHR_OP EQ NOTEQ LTEQ GTEQ SHIP_OP IN_OP
 %token ANDAND OROR
 %token COMMA
 %token FOR
@@ -147,7 +147,7 @@
 %left OR_OP
 %left AND_OP
 %left EQ NOTEQ
-%left LT GT LTEQ GTEQ
+%left LT GT LTEQ GTEQ SHIP_OP IN_OP
 %left SHL_OP SHR_OP
 %left MINUS PLUS
 %left MUL_OP DIV_OP
@@ -567,6 +567,73 @@
                                  (program, exp_r0, $2, SUB);
                         }
                      }
+   | exp SHIP_OP exp {
+                        /* do not generate ifs, use math */
+                        t_axe_expression lt = handle_binary_comparison(program,
+                                                                       $1,
+                                                                       $3,
+                                                                      _LT_);
+                        t_axe_expression eq = handle_binary_comparison(program,
+                                                                       $1,
+                                                                       $3,
+                                                                       _EQ_);
+                        t_axe_expression gt = handle_binary_comparison(program,
+                                                                       $1,
+                                                                       $3,
+                                                                       _GT_);
+
+                        /* build weights */
+                        t_axe_expression lt_weight = create_expression(
+                                                       -1,
+                                                       IMMEDIATE);
+                        t_axe_expression eq_weight = create_expression(
+                                                       0,
+                                                       IMMEDIATE);
+                        t_axe_expression gt_weight = create_expression(
+                                                       1,
+                                                       IMMEDIATE);
+
+                        /* weight expressions */
+                        t_axe_expression lt_fact = handle_bin_numeric_op(
+                                                     program,
+                                                     lt,
+                                                     lt_weight,
+                                                     MUL);
+                        t_axe_expression eq_fact = handle_bin_numeric_op(
+                                                     program,
+                                                     eq,
+                                                     eq_weight,
+                                                     MUL);
+                        t_axe_expression gt_fact = handle_bin_numeric_op(
+                                                     program,
+                                                     gt,
+                                                     gt_weight,
+                                                     MUL);
+
+                        /* combine expressions */
+                        t_axe_expression tmp = handle_bin_numeric_op(program,
+                                                                     lt_fact,
+                                                                     eq_fact,
+                                                                     ADD);
+                        $$ = handle_bin_numeric_op(program, tmp, gt_fact, ADD);
+   }
+   | exp IN_OP exp COLON exp
+     %prec IN_OP {
+                    /* check bounds */
+                    t_axe_expression lb = handle_binary_comparison(program,
+                                                                   $1,
+                                                                   $3,
+                                                                   _GTEQ_);
+                    t_axe_expression up = handle_binary_comparison(program,
+                                                                   $1,
+                                                                   $5,
+                                                                   _LTEQ_);
+
+                    /* combine results: ANDL should be used, but it is not yet
+                     * implemented. However, for this purpose, it is equivalent
+                     * to ANDB, so exploit bitwise and */
+                    $$ = handle_bin_numeric_op(program, lb, up, ANDB);
+   }
 ;
 
 %%
diff -r 4a0654b18dbe tests/Makefile
--- a/tests/Makefile	Tue Feb 02 17:19:12 2010 +0100
+++ b/tests/Makefile	Thu Nov 29 11:01:31 2012 +0100
@@ -1,7 +1,8 @@
 asm=$(CURDIR)/../bin/asm
 acse=$(CURDIR)/../bin/acse
 export asm acse
-dirs:=arrays sum dowhile fact mult_table power semi assign arrays arrays2 misc
+dirs:=arrays sum dowhile fact mult_table power semi assign arrays arrays2 misc \
+      ship in
 
 test :
 	for i in $(dirs); do $(MAKE) -C $$i -f ../Makefile.test ; done
diff -r 4a0654b18dbe tests/in/in.src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/in/in.src	Thu Nov 29 11:01:31 2012 +0100
@@ -0,0 +1,8 @@
+
+int a, b;
+
+a = 10;
+b = 30;
+
+write(a in 10:20);
+write(a in 20:b);
diff -r 4a0654b18dbe tests/ship/sanity.src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/ship/sanity.src	Thu Nov 29 11:01:31 2012 +0100
@@ -0,0 +1,8 @@
+
+int a;
+
+a = 20;
+
+write(a <=> 10);
+write(a <=> 20);
+write(a <=> 30);
