package ti.lang; #pragma TI nobcheck #pragma TI nosrcpos #ifdef SCAN final public class Scan { #else #define SCAN 0 final public class Reduce { native static void trace(int isScan, String local opname, String local type); #endif private static int phase = 0; private static boolean [1d] single [2d] lz_boolean = null; private static int [1d] single [2d] lz_int = null; private static long [1d] single [2d] lz_long = null; private static double [1d] single [2d] lz_double = null; private static Object [1d] single [2d] lz_Object = null; #ifndef STRINGIFY #define STRINGIFY_HELPER(x) #x #define STRINGIFY(x) STRINGIFY_HELPER(x) #endif #ifndef CONCAT #define CONCAT_HELPER(a,b) a ## b #define CONCAT(a,b) CONCAT_HELPER(a,b) #endif #define OP add #define UPDATE(x, y) x += y #include "Reduce-int-long-double.cti" #undef OP #undef UPDATE #define OP mult #define UPDATE(x, y) x *= y #include "Reduce-int-long-double.cti" #undef OP #undef UPDATE #define OP min #define UPDATE(x, y) if (y < x) x = y #include "Reduce-int-long-double.cti" #undef OP #undef UPDATE #define OP max #define UPDATE(x, y) if (y > x) x = y #include "Reduce-int-long-double.cti" #undef OP #undef UPDATE #define OP or #define UPDATE(x, y) x |= y #include "Reduce-int-long-bool.cti" #undef OP #undef UPDATE #define OP xor #define UPDATE(x, y) x ^= y #include "Reduce-int-long-bool.cti" #undef OP #undef UPDATE #define OP and #define UPDATE(x, y) x &= y #include "Reduce-int-long-bool.cti" #undef OP #undef UPDATE // user-defined operator #define DEFAULT_VALUE 0 #define OP gen #define UPDATE(x, y) x = Oper.eval(x, y) #define T int #define INTERFACE IntOp #include "Reduce-guts.cti" #undef INTERFACE #undef T #define T long #define INTERFACE LongOp #include "Reduce-guts.cti" #undef INTERFACE #undef T #define T double #define INTERFACE DoubleOp #include "Reduce-guts.cti" #undef INTERFACE #undef T #undef DEFAULT_VALUE #define DEFAULT_VALUE null #define T Object #define INTERFACE ObjectOp #define NOT_SINGLE 1 #include "Reduce-guts.cti" #undef NOT_SINGLE #undef INTERFACE #undef T #undef DEFAULT_VALUE }