#include "M3Runtime.h" typedef struct { int tc; char* str; int len; } TXT; PRIVATE TXT txt1 = { 3, "attempt to DIV by 0", 20}; PRIVATE TXT txt2 = { 3, "attempt to MOD by 0", 20}; PRIVATE TXT txt3 = { 3, " @ ", 4}; PRIVATE TXT txt4 = { 3, "@", 2}; #line 16 "../Interfaces/Type.i3" #define t7 ADDRESS #define t81 void typedef int t9; #line 116 ".ROOT/.boots/corelib/Interfaces/Wr.i3" typedef struct { char* elts; int size[1]; } t66; #line 16 "../Interfaces/Type.i3" #define t54 t66 #define TC7 TC_Type__Map IMPORT TYPE TC_Type__Map; #line 16 IMPORT char VS_Type__Map__41dd9f4b33104fce; #define t8 ADDRESS #define TC8 TC_NULL IMPORT TYPE TC_NULL; IMPORT char VS_NULL__fb50c7d53bec30dc; #define t25 ADDRESS #define TC25 TC_REFANY IMPORT TYPE TC_REFANY; IMPORT char VS_REFANY__4b8748e831fc107a; #define t26 ADDRESS #define TC26 TC_ADDRESS IMPORT TYPE TC_ADDRESS; IMPORT char VS_ADDRESS__30f7308738738b44; #line 17 "../Interfaces/Scope.i3" #define t40 ADDRESS #define t78 ADDRESS typedef struct { TYPE self; int private; } t78_methods; #define t78_msize (sizeof (t78_methods)) typedef struct { ADDRESS methods; } t78_fields; #define t78_size (sizeof (t78_fields)) #define TC78 TC_UNTRACED_ROOT IMPORT TYPE TC_UNTRACED_ROOT; IMPORT char VS_UNTRACED_ROOT__3e0964513fd6da20; #line 15 "../Interfaces/M3.i3" #define t34 ADDRESS #define TC34 TC_M3__Value IMPORT TYPE TC_M3__Value; #line 15 IMPORT char VS_M3__Value__6f64cf9c2cae25fb; #line 17 "../Interfaces/Scope.i3" #define t43 t66 #define TC40 TC_Scope__ValueList IMPORT TYPE TC_Scope__ValueList; #line 17 IMPORT char VS_Scope__ValueList__64bf053e22e4e53c; #line 14 "./Expr.i3" #define t48 ADDRESS #define t10 ADDRESS #define TC10 TC_M3__Expr IMPORT TYPE TC_M3__Expr; #line 16 "../Interfaces/M3.i3" IMPORT char VS_M3__Expr__8ae39aaa2d432477; #line 14 "./Expr.i3" #define t49 t66 #define TC48 TC_Expr__List IMPORT TYPE TC_Expr__List; #line 14 IMPORT char VS_Expr__List__3f87eceb2b9a246a; #line 17 "../Interfaces/Type.i3" #define t52 ADDRESS #define t36 ADDRESS #define TC36 TC_M3__Type IMPORT TYPE TC_M3__Type; #line 18 "../Interfaces/M3.i3" IMPORT char VS_M3__Type__4d87bc25311f81d2; #line 17 "../Interfaces/Type.i3" typedef struct { t52 _next; t36 _type; } t53; #define TC52 TC_Type__List IMPORT TYPE TC_Type__List; #line 17 IMPORT char VS_Type__List__5791758e343becc1; #line 15 "IntegerExpr.m3" #define t2 ADDRESS #line 65 "../Interfaces/Emit.i3" typedef t81 (*t3)(); #line 19 "../Interfaces/M3.i3" #define t11 ADDRESS #define TC11 TC_M3__Temp IMPORT TYPE TC_M3__Temp; #line 19 IMPORT char VS_M3__Temp__450b691937f03dae; #line 31 "./ExprRep.i3" typedef t11 (*t12)(); #line 24 typedef t10 (*t13)(); typedef unsigned char t4; #line 44 typedef t4 (*t5)(); #line 15 "IntegerExpr.m3" typedef struct { int filler; } t2_methods; #define t2_msize (sizeof (t2_methods)) typedef struct { #line 15 t9 _value; } t2_fields; #define t2_size (sizeof (t2_fields)) PRIVATE void t2_InitProc (); #line 15 PRIVATE void t2_SetupProc (); PRIVATE void t2_PrintProc (); PRIVATE typecell t2_TC; PRIVATE typecell t2_TC_init = {0, 0, 0, 0, 0, (PROC)NIL, #line 15 t2_size, t2_msize, NIL, 0, 0, t2_InitProc, t2_SetupProc, t2_PrintProc, "IntegerExpr.T", -1726570307, 693041742}; PRIVATE TYPE TC2 = &t2_TC; #line 15 #line 32 #define t1 t66 #define t68 ADDRESS typedef struct { TYPE self; int private; } t68_methods; #define t68_msize (sizeof (t68_methods)) typedef struct { ADDRESS methods; } t68_fields; #define t68_size (sizeof (t68_fields)) #define TC68 TC_ROOT IMPORT TYPE TC_ROOT; IMPORT char VS_ROOT__349f58f628be0ac6; #define t68_MapProc TC_ROOT->mapProc #define t6 ADDRESS #define TC6 TC_Wr__T IMPORT TYPE TC_Wr__T; #line 90 ".ROOT/.boots/corelib/Interfaces/Wr.i3" IMPORT char VS_Wr__T__2555b70b3f7780b1; #define t6_MapProc TC_Wr__T->mapProc typedef signed_char t14; #line 32 "IntegerExpr.m3" typedef struct { t2 elts[39]; } t15; #define t16 ADDRESS #define TC16 TC_TEXT IMPORT TYPE TC_TEXT; IMPORT char VS_TEXT__b7a92447326386f5; #define t16_MapProc TC_TEXT->mapProc #define t17 t66 typedef t16 (*t18)(); #line 13 ".ROOT/.boots/corelib/Interfaces/Fmt.i3" typedef unsigned char t19; typedef unsigned char t20; typedef int t21; typedef double t22; typedef float t23; typedef signed_char t24; typedef unsigned char t27; #line 13 "../Interfaces/String.i3" #define t28 ADDRESS #define TC28 TC_String__T IMPORT TYPE TC_String__T; #line 13 IMPORT char VS_String__T__3a6c7dc12615e4ee; typedef struct { t28 _module; t28 _item; } t29; #line 27 "../Interfaces/Emit.i3" typedef signed_char t30; #line 63 typedef t30 (*t31)(); #line 19 "../Interfaces/String.i3" typedef signed_char t60; #line 65 "../Interfaces/Token.i3" #define t55 t66 typedef struct { t28 elts[100]; } t61; #line 17 "../Interfaces/String.i3" typedef struct { t9 _top; t61 _stk; } t32; #line 16 "../Interfaces/Variable.i3" #define t33 ADDRESS #define TC33 TC_Variable__T IMPORT TYPE TC_Variable__T; #line 16 IMPORT char VS_Variable__T__be7ead4a3afd8be5; #line 14 "../Interfaces/M3.i3" #define t35 ADDRESS #define TC35 TC_M3__Scope IMPORT TYPE TC_M3__Scope; #line 14 IMPORT char VS_M3__Scope__6e6d8848308d8a2d; #line 24 "../Interfaces/Variable.i3" typedef t33 (*t37)(); #line 14 "../Interfaces/Decl.i3" typedef struct { t28 _alias; t4 _isExternal; t4 _isInline; t4 _isUnused; t4 _isObsolete; } t38; #line 15 "../Interfaces/Token.i3" typedef unsigned char t56; #line 45 typedef struct { int elts[4]; } t39; #line 38 "../Interfaces/Scope.i3" typedef t34 (*t41)(); #line 31 typedef t35 (*t42)(); #line 45 "../Interfaces/Value.i3" typedef t36 (*t44)(); #line 18 typedef unsigned char t45; #line 40 typedef t45 (*t46)(); #line 13 "./ExprRep.i3" #define t47 ADDRESS #line 13 typedef struct { t3 _bind; t3 _check; t3 _write; t5 _isEqual; t13 _evaluate; t3 _getBounds; t5 _isWritable; t5 _isDesignator; #line 13 t5 _isZeroes; t3 _genLiteral; t3 _fprint; t12 _compile; } t47_methods; #define t47_msize (sizeof (t47_methods)) typedef struct { #line 13 t9 _origin; t36 _type; t4 _bound; t4 _inCheck; t4 _checked; } t47_fields; #define t47_size (sizeof (t47_fields)) #define TC47 TC_M3__Expr typedef t7 (*t50)(); #line 97 "../Interfaces/Type.i3" typedef t9 (*t51)(); #line 65 "../Interfaces/Token.i3" typedef struct { t28 elts[97]; } t57; #line 34 "../Interfaces/String.i3" typedef t28 (*t58)(); #line 28 #define t59 t66 typedef signed_char t62; #line 67 ".ROOT/.boots/corelib/Interfaces/Text.i3" typedef t62 (*t63)(); #line 26 typedef t21 (*t64)(); #line 23 typedef t20 (*t65)(); #line 91 ".ROOT/.boots/corelib/Interfaces/Wr.i3" typedef unsigned char t67; #line 15 ".ROOT/.boots/corelib/Interfaces/Thread.i3" #define t69 ADDRESS #define TC69 TC_Thread__T IMPORT TYPE TC_Thread__T; #line 15 IMPORT char VS_Thread__T__2555b70b3f7780b1; #define t69_MapProc TC_Thread__T->mapProc typedef t25 (*t70)(); #define t71 ADDRESS #define TC71 TC_Thread__Condition IMPORT TYPE TC_Thread__Condition; #line 21 IMPORT char VS_Thread__Condition__26d5968239e08f4e; #define t71_MapProc TC_Thread__Condition->mapProc #define t72 ADDRESS #define TC72 TC_MUTEX IMPORT TYPE TC_MUTEX; IMPORT char VS_MUTEX__1f9d4e89391ab815; #define t72_MapProc TC_MUTEX->mapProc typedef t69 (*t73)(); #line 23 #define t74 ADDRESS #line 23 typedef struct { t70 _apply; } t74_methods; #define t74_msize (sizeof (t74_methods)) typedef struct { #line 23 int filler; } t74_fields; #define t74_size (sizeof (t74_fields)) #define TC74 TC_Thread__Closure IMPORT TYPE TC_Thread__Closure; #line 23 IMPORT char VS_Thread__Closure__7fb5c6232c5a658a; #define t74_MapProc TC_Thread__Closure->mapProc typedef t71 (*t75)(); typedef t72 (*t76)(); #line 28 #define t77 ADDRESS #line 28 typedef struct { int filler; } t77_methods; #define t77_msize (sizeof (t77_methods)) typedef struct { #line 28 t21 _stackSize; } t77_fields; #define t77_size (sizeof (t77_fields)) #define TC77 TC_Thread__SizedClosure IMPORT TYPE TC_Thread__SizedClosure; #line 28 IMPORT char VS_Thread__SizedClosure__8a46717d2eae7b07; #define t77_MapProc TC_Thread__SizedClosure->mapProc #define t79 ADDRESS #define TC79 TC_M3__Stmt IMPORT TYPE TC_M3__Stmt; #line 17 "../Interfaces/M3.i3" IMPORT char VS_M3__Stmt__376b307627fc1f2f; typedef CLOSURE t80; #line 10 "IntegerExpr.m3" IMPORT INITLINK* Fmt__init; IMPORT INITLINK* Wr__init; IMPORT INITLINK* Temp__init; IMPORT INITLINK* Error__init; IMPORT INITLINK* Emit__init; #line 10 IMPORT INITLINK* Int__init; IMPORT INITLINK* Type__init; IMPORT INITLINK* ExprRep__init; IMPORT INITLINK* Expr__init; IMPORT INITLINK* IntegerExpr__init; #line 10 IMPORT t16 _Fmt__Int (); IMPORT char VS_Fmt__Int__6e220fa1366cffbc; IMPORT EXCEPTION_NAME _Thread__Alerted; IMPORT char VS_Thread__Alerted__fc88feb43485af46; #line 10 IMPORT EXCEPTION_NAME _Wr__Failure; IMPORT char VS_Wr__Failure__5f82cfb43dabf527; IMPORT EXCEPTION_NAME _Wr__Error; IMPORT char VS_Wr__Error__c367253d3ed4fd15; #line 10 IMPORT t81 _Wr__PutText (); IMPORT char VS_Wr__PutText__e034dab73a793846; IMPORT TYPE TC_Temp__T; IMPORT char VS_Temp__T__3a6c7dc12615e4ee; #line 10 IMPORT t11 _Temp__FromExpr (); IMPORT char VS_Temp__FromExpr__808b53eb2a7a6d33; IMPORT t81 _Error__Msg (); IMPORT char VS_Error__Msg__4d119a332467757f; #line 10 IMPORT char VS_Emit__MaxStream__cf0a0e8934c9c9f3; IMPORT TYPE TC_Emit__Format; IMPORT char VS_Emit__Format__bc4a2b083b93bbd7; #line 10 IMPORT t81 _Emit__OpI (); IMPORT char VS_Emit__OpI__02cb878634bb9f49; IMPORT t36 _Int__T; IMPORT char VS_Int__T__1062912139372387; #line 10 IMPORT TYPE TC_Type__T; IMPORT char VS_Type__T__2446b70b3f7780a5; IMPORT t81 _ExprRep__Init (); IMPORT char VS_ExprRep__Init__8b7fff3e227cebab; #line 10 IMPORT t81 _ExprRep__NoBind (); IMPORT char VS_ExprRep__NoBind__e7d0d3dd3d703c08; IMPORT t81 _ExprRep__NoCheck (); IMPORT char VS_ExprRep__NoCheck__c11b54bc361794fa; #line 10 IMPORT t10 _ExprRep__NoValue (); IMPORT char VS_ExprRep__NoValue__8ccc143224598a66; IMPORT t10 _ExprRep__Self (); IMPORT char VS_ExprRep__Self__28962e523a8d814b; #line 10 IMPORT t81 _ExprRep__NoBounds (); IMPORT char VS_ExprRep__NoBounds__b64bb146289ee4f0; IMPORT t4 _ExprRep__IsNever (); IMPORT char VS_ExprRep__IsNever__8f1a069b301903c8; #line 10 IMPORT t4 _ExprRep__NeverEq (); IMPORT char VS_ExprRep__NeverEq__dfdc2412249ccb65; IMPORT t81 _ExprRep__NoWriter (); IMPORT char VS_ExprRep__NoWriter__a97bb1a23bbf506e; #line 10 IMPORT t81 _ExprRep__NoLiteral (); IMPORT char VS_ExprRep__NoLiteral__6c9c90073f496f67; IMPORT TYPE TC_Expr__T; IMPORT char VS_Expr__T__2446b70b3f7780a5; #line 10 EXPORT t10 _IntegerExpr__New (); EXPORT char VS_IntegerExpr__New__864172512ee81acd = '\0'; EXPORT t4 _IntegerExpr__Split (); #line 10 EXPORT char VS_IntegerExpr__Split__132919062838cba6 = '\0'; EXPORT t4 _IntegerExpr__Compare (); EXPORT char VS_IntegerExpr__Compare__4c54a2b92cc8b49a = '\0'; #line 10 EXPORT t4 _IntegerExpr__Add (); EXPORT char VS_IntegerExpr__Add__b47f3d2b3013b51e = '\0'; EXPORT t4 _IntegerExpr__Subtract (); #line 10 EXPORT char VS_IntegerExpr__Subtract__815b8bc324cdec20 = '\0'; EXPORT t4 _IntegerExpr__Multiply (); EXPORT char VS_IntegerExpr__Multiply__9231d45623e78a4a = '\0'; #line 10 EXPORT t4 _IntegerExpr__Div (); EXPORT char VS_IntegerExpr__Div__c053f5573395e3ac = '\0'; EXPORT t4 _IntegerExpr__Mod (); #line 10 EXPORT char VS_IntegerExpr__Mod__93d0f87f2f85e4c8 = '\0'; EXPORT t4 _IntegerExpr__Negate (); EXPORT char VS_IntegerExpr__Negate__292914df373ee439 = '\0'; #line 10 PRIVATE TYPE TC_IntegerExpr__P; PRIVATE t15 _IntegerExpr__cache; PRIVATE t4 _IntegerExpr__EqCheck (); PRIVATE t11 _IntegerExpr__Compile (); #line 10 PRIVATE t81 _IntegerExpr__Writer (); PRIVATE t81 _IntegerExpr__Bounder (); PRIVATE t4 _IntegerExpr__SplitPair (); PRIVATE t81 _IntegerExpr__FPrinter (); #line 10 PRIVATE t4 _IntegerExpr__IsZeroes (); PRIVATE t81 _IntegerExpr__GenLiteral (); IMPORT char VS_M3__Expr__58bf709e39adf1f7; #line 10 #line 34 "IntegerExpr.m3" EXPORT t10 _IntegerExpr__New (_value) t9 _value; { t4 z2; t4 z0; t4 z3; t4 z1; t9 z4; t9 z5; t4 z6; t2 z7; #line 34 "IntegerExpr.m3" { auto t2 _p; auto t10 __result; { ZERO1 (& _p); #line 34 CHECKSTACKOVERFLOW; z2 = ( -7 <= _value); z0 = 0; if (z2) { z3 = (_value <= 31 ); z0 = z3; }; z1 = 0; if (z0) { z4 = _value - -7 ; #line 37 z5 = z4; if ((z5 < 0) || (38 < z5)) RANGEFAULT; z6 = ((_IntegerExpr__cache.elts[z5]) != 0); z1 = z6; }; if (z1) { z4 = _value - -7 ; z5 = z4; if ((z5 < 0) || (38 < z5)) RANGEFAULT; __result = (_IntegerExpr__cache.elts[z5]); return __result; #line 39 }; { register char** ptr = (char**) UNEWOBJ (TC2); z7 = (t2) ptr; }; _p = z7; _ExprRep__Init (_p); NILCHECKA (z7 = _p); (((t2_fields*)(z7+(0+t47_size+t78_size)))->_value) = _value; NILCHECKA (z7 = _p); (((t47_fields*)(z7+(0+t78_size)))->_type) = _Int__T; NILCHECKA (z7 = _p); (((t47_fields*)(z7+(0+t78_size)))->_bound) = 1 ; NILCHECKA (z7 = _p); (((t47_fields*)(z7+(0+t78_size)))->_checked) = 1 ; z2 = ( -7 <= _value); z0 = 0; if (z2) { z3 = (_value <= 31 ); z0 = z3; }; if (z0) { z4 = _value - -7 ; z5 = z4; if ((z5 < 0) || (38 < z5)) RANGEFAULT; (_IntegerExpr__cache.elts[z5]) = _p; goto if_2_end; #line 48 }; if_2_end: /**/; __result = _p; return __result; } } }; #line 53 "IntegerExpr.m3" PRIVATE t4 _IntegerExpr__EqCheck (_a, _e) t2 _a; t10 _e; { t2 z1; t2 z3; t4 z4; #line 53 "IntegerExpr.m3" { auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; { register ADDRESS ref = (ADDRESS) _e; register int tc = TYPECODE (ref); if (tc == 0) goto tc0_0; if (ISSUBTYPE (tc, TC2)) goto tc0_1; #line 55 goto tc0_else; tc0_0:; __result = 0 ; return __result; tc0_1:; { auto t2 _b; { ZERO1 (& _b); #line 56 _b = (t2) ref; NILCHECKA (z1 = _a); NILCHECKA (z3 = _b); z4 = ((((t2_fields*)(z1+(0+t47_size+t78_size)))->_value) == (((t2_fields*)(z3+(0+t47_size+t78_size)))->_value)); #line 57 __result = z4; return __result; } } tc0_else:; __result = 0 ; return __result; tc0_exit:; }; } } }; #line 62 "IntegerExpr.m3" PRIVATE t11 _IntegerExpr__Compile (_p) t2 _p; { t11 z2; #line 62 "IntegerExpr.m3" { auto t11 __result; { CHECKSTACKOVERFLOW; z2 = _Temp__FromExpr (_p); __result = z2; return __result; } } }; #line 67 "IntegerExpr.m3" PRIVATE t81 _IntegerExpr__Writer (_p, _t1, _t2) t2 _p; t11 _t1; t11 _t2; { t2 z3; #line 67 "IntegerExpr.m3" { { CHECKSTACKOVERFLOW; NILCHECKA (z3 = _p); _Emit__OpI (((ADDRESS)(& txt3.str)), (((t2_fields*)(z3+(0+t47_size+t78_size)))->_value)); } } }; #line 72 "IntegerExpr.m3" PRIVATE t81 _IntegerExpr__Bounder (_p, _min, _max) t2 _p; t9 * _min; t9 * _max; { t2 z1; #line 72 "IntegerExpr.m3" { { CHECKSTACKOVERFLOW; NILCHECKA (z1 = _p); (*_min) = (((t2_fields*)(z1+(0+t47_size+t78_size)))->_value); NILCHECKA (z1 = _p); (*_max) = (((t2_fields*)(z1+(0+t47_size+t78_size)))->_value); } } }; #line 78 "IntegerExpr.m3" EXPORT t4 _IntegerExpr__Compare (_a, _b, _sign) t10 _a; t10 _b; t9 * _sign; { t4 z5; t4 z0; t4 z2; t9 z1; #line 78 "IntegerExpr.m3" { auto t9 _x; auto t9 _y; auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; z5 = _IntegerExpr__SplitPair (_a, _b, &_x, &_y); z0 = ! z5; if (z0) { __result = 0 ; return __result; }; z2 = (_x < _y); if (z2) { z1 = - 1 ; (*_sign) = z1; goto if_4_end; }; z2 = (_x > _y); if (z2) { (*_sign) = 1 ; goto if_4_end; }; (*_sign) = 0 ; if_4_end: /**/; __result = 1 ; return __result; } } }; #line 89 "IntegerExpr.m3" EXPORT t4 _IntegerExpr__Add (_a, _b, _c) t10 _a; t10 _b; t10 * _c; { t4 z5; t4 z0; t9 z3; t10 z1; #line 89 "IntegerExpr.m3" { auto t9 _x; auto t9 _y; auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; z5 = _IntegerExpr__SplitPair (_a, _b, &_x, &_y); z0 = ! z5; if (z0) { __result = 0 ; return __result; }; z3 = _x + _y; z1 = _IntegerExpr__New (z3); (*_c) = z1; __result = 1 ; return __result; } } }; #line 97 "IntegerExpr.m3" EXPORT t4 _IntegerExpr__Subtract (_a, _b, _c) t10 _a; t10 _b; t10 * _c; { t4 z5; t4 z0; t9 z3; t10 z1; #line 97 "IntegerExpr.m3" { auto t9 _x; auto t9 _y; auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; z5 = _IntegerExpr__SplitPair (_a, _b, &_x, &_y); z0 = ! z5; if (z0) { __result = 0 ; return __result; }; z3 = _x - _y; z1 = _IntegerExpr__New (z3); (*_c) = z1; __result = 1 ; return __result; } } }; #line 105 "IntegerExpr.m3" EXPORT t4 _IntegerExpr__Multiply (_a, _b, _c) t10 _a; t10 _b; t10 * _c; { t4 z5; t4 z0; t9 z3; t10 z1; #line 105 "IntegerExpr.m3" { auto t9 _x; auto t9 _y; auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; z5 = _IntegerExpr__SplitPair (_a, _b, &_x, &_y); z0 = ! z5; if (z0) { __result = 0 ; return __result; }; z3 = _x * _y; z1 = _IntegerExpr__New (z3); (*_c) = z1; __result = 1 ; return __result; } } }; #line 113 "IntegerExpr.m3" EXPORT t4 _IntegerExpr__Div (_a, _b, _c) t10 _a; t10 _b; t10 * _c; { t4 z5; t4 z0; t4 z2; t9 z3; t10 z1; #line 113 "IntegerExpr.m3" { auto t9 _x; auto t9 _y; auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; z5 = _IntegerExpr__SplitPair (_a, _b, &_x, &_y); z0 = ! z5; if (z0) { __result = 0 ; return __result; }; z2 = (_y == 0 ); if (z2) { _Error__Msg (((ADDRESS)(& txt1.str))); __result = 0 ; return __result; }; z3 = IDIV (_x, _y); z1 = _IntegerExpr__New (z3); (*_c) = z1; __result = 1 ; return __result; } } }; #line 122 "IntegerExpr.m3" EXPORT t4 _IntegerExpr__Mod (_a, _b, _c) t10 _a; t10 _b; t10 * _c; { t4 z5; t4 z0; t4 z2; t9 z3; t9 z4; t9 z6; t10 z1; #line 122 "IntegerExpr.m3" { auto t9 _x; auto t9 _y; auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; z5 = _IntegerExpr__SplitPair (_a, _b, &_x, &_y); z0 = ! z5; if (z0) { __result = 0 ; return __result; }; z2 = (_y == 0 ); if (z2) { _Error__Msg (((ADDRESS)(& txt2.str))); __result = 0 ; return __result; }; z3 = _x; z4 = _y; z6 = z3 - (z4 * (IDIV (z3, z4))); z1 = _IntegerExpr__New (z6); (*_c) = z1; __result = 1 ; return __result; } } }; #line 131 "IntegerExpr.m3" EXPORT t4 _IntegerExpr__Negate (_a, _c) t10 _a; t10 * _c; { t2 z2; t9 z3; t10 z1; #line 131 "IntegerExpr.m3" { auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; { register ADDRESS ref = (ADDRESS) _a; register int tc = TYPECODE (ref); if (tc == 0) goto tc1_0; if (ISSUBTYPE (tc, TC2)) goto tc1_1; #line 133 goto tc1_else; tc1_0:; __result = 0 ; return __result; tc1_1:; { auto t2 _p; { ZERO1 (& _p); #line 134 _p = (t2) ref; NILCHECKA (z2 = _p); z3 = - (((t2_fields*)(z2+(0+t47_size+t78_size)))->_value); z1 = _IntegerExpr__New (z3); #line 135 (*_c) = z1; __result = 1 ; return __result; } } tc1_else:; __result = 0 ; return __result; tc1_exit:; }; } } }; #line 140 "IntegerExpr.m3" PRIVATE t4 _IntegerExpr__SplitPair (_a, _b, _x, _y) t10 _a; t10 _b; t9 * _x; t9 * _y; { t2 z1; #line 140 "IntegerExpr.m3" { auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; { register ADDRESS ref = (ADDRESS) _a; register int tc = TYPECODE (ref); if (tc == 0) goto tc2_0; if (ISSUBTYPE (tc, TC2)) goto tc2_1; #line 142 goto tc2_else; tc2_0:; __result = 0 ; return __result; tc2_1:; { auto t2 _p; { ZERO1 (& _p); #line 143 _p = (t2) ref; NILCHECKA (z1 = _p); (*_x) = (((t2_fields*)(z1+(0+t47_size+t78_size)))->_value); } } goto tc2_exit; tc2_else:; #line 144 __result = 0 ; return __result; tc2_exit:; }; { register ADDRESS ref = (ADDRESS) _b; register int tc = TYPECODE (ref); if (tc == 0) goto tc3_0; if (ISSUBTYPE (tc, TC2)) goto tc3_1; #line 147 goto tc3_else; tc3_0:; __result = 0 ; return __result; tc3_1:; { auto t2 _p; { ZERO1 (& _p); #line 148 _p = (t2) ref; NILCHECKA (z1 = _p); (*_y) = (((t2_fields*)(z1+(0+t47_size+t78_size)))->_value); __result = 1 ; return __result; #line 149 } } tc3_else:; __result = 0 ; return __result; tc3_exit:; }; } } }; #line 154 "IntegerExpr.m3" EXPORT t4 _IntegerExpr__Split (_e, _value) t10 _e; t9 * _value; { t2 z1; #line 154 "IntegerExpr.m3" { auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; { register ADDRESS ref = (ADDRESS) _e; register int tc = TYPECODE (ref); if (tc == 0) goto tc4_0; if (ISSUBTYPE (tc, TC2)) goto tc4_1; #line 156 goto tc4_else; tc4_0:; __result = 0 ; return __result; tc4_1:; { auto t2 _p; { ZERO1 (& _p); #line 157 _p = (t2) ref; NILCHECKA (z1 = _p); (*_value) = (((t2_fields*)(z1+(0+t47_size+t78_size)))->_value); __result = 1 ; return __result; #line 158 } } tc4_else:; __result = 0 ; return __result; tc4_exit:; }; } } }; #line 163 "IntegerExpr.m3" PRIVATE t81 _IntegerExpr__FPrinter (_p, _map, _wr) t2 _p; t7 _map; t6 _wr; { t2 z4; t16 z6; #line 163 "IntegerExpr.m3" { { CHECKSTACKOVERFLOW; NILCHECKA (z4 = _p); z6 = _Fmt__Int ((((t2_fields*)(z4+(0+t47_size+t78_size)))->_value), 10 ); _Wr__PutText (_wr, z6); #line 165 } } }; #line 168 "IntegerExpr.m3" PRIVATE t4 _IntegerExpr__IsZeroes (_p) t2 _p; { t2 z1; t4 z3; #line 168 "IntegerExpr.m3" { auto t4 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; NILCHECKA (z1 = _p); z3 = ((((t2_fields*)(z1+(0+t47_size+t78_size)))->_value) == 0 ); __result = z3; return __result; #line 170 } } }; #line 173 "IntegerExpr.m3" PRIVATE t81 _IntegerExpr__GenLiteral (_p) t2 _p; { t2 z3; #line 173 "IntegerExpr.m3" { { CHECKSTACKOVERFLOW; NILCHECKA (z3 = _p); _Emit__OpI (((ADDRESS)(& txt4.str)), (((t2_fields*)(z3+(0+t47_size+t78_size)))->_value)); } } }; #line 175 PRIVATE int init_done = -1; #line 179 "IntegerExpr.m3" PRIVATE void IntegerExpr__initProc (g) int g; { t9 z4; #line 179 "IntegerExpr.m3" if (init_done >= g) return; init_done = g; INITIALIZE (& IntegerExpr__init); INITIALIZE (& Fmt__init); INITIALIZE (& Wr__init); #line 179 INITIALIZE (& Temp__init); INITIALIZE (& Error__init); INITIALIZE (& Emit__init); INITIALIZE (& Int__init); INITIALIZE (& Type__init); #line 179 INITIALIZE (& ExprRep__init); INITIALIZE (& Expr__init); #line 32 ZERO (156, & _IntegerExpr__cache); #line 179 { int from, to, index; from = -7 ; to = 31 ; { auto t9 _i; { for (index = from; index <= to; index += 1) { _i = (t9) index; #line 179 z4 = _i - -7 ; (_IntegerExpr__cache.elts[z4]) = (t2) 0; } } }; }; return; }; #line 179 "IntegerExpr.m3" PRIVATE void t2_InitProc (obj) char* obj; { register t2_fields* p; #line 179 "IntegerExpr.m3" CHECKSTACKOVERFLOW; p = (t2_fields*) (obj + TC10->datasize); }; #line 179 "IntegerExpr.m3" PRIVATE void t2_SetupProc () { register int* p; #line 179 "IntegerExpr.m3" t2_TC.datasize += TC10->datasize; t2_TC.methodsize += TC10->methodsize; p = (int*) UALLOC (t2_TC.methodsize); COPY (TC10->defaultMethods, p, (TC10->methodsize)); #line 179 p[0] = (int)(& t2_TC); p[1] = 0; ((t47_methods*) (((char*)p) + TC78->methodsize))->_bind = _ExprRep__NoBind; ((t47_methods*) (((char*)p) + TC78->methodsize))->_check = _ExprRep__NoCheck; #line 179 ((t47_methods*) (((char*)p) + TC78->methodsize))->_compile = _IntegerExpr__Compile; ((t47_methods*) (((char*)p) + TC78->methodsize))->_evaluate = _ExprRep__Self; #line 179 ((t47_methods*) (((char*)p) + TC78->methodsize))->_fprint = _IntegerExpr__FPrinter; ((t47_methods*) (((char*)p) + TC78->methodsize))->_write = _IntegerExpr__Writer; #line 179 ((t47_methods*) (((char*)p) + TC78->methodsize))->_isEqual = _IntegerExpr__EqCheck; ((t47_methods*) (((char*)p) + TC78->methodsize))->_getBounds = _IntegerExpr__Bounder; #line 179 ((t47_methods*) (((char*)p) + TC78->methodsize))->_isWritable = _ExprRep__IsNever; ((t47_methods*) (((char*)p) + TC78->methodsize))->_isDesignator = _ExprRep__IsNever; #line 179 ((t47_methods*) (((char*)p) + TC78->methodsize))->_isZeroes = _IntegerExpr__IsZeroes; ((t47_methods*) (((char*)p) + TC78->methodsize))->_genLiteral = _IntegerExpr__GenLiteral; #line 179 t2_TC.defaultMethods = (char*) p; }; #line 179 "IntegerExpr.m3" PRIVATE void t2_PrintProc (obj) char *obj; { t2_fields* o; #line 179 "IntegerExpr.m3" CHECKSTACKOVERFLOW; if (TC10->printProc != 0) {TC10->printProc (obj); } fprintf (stderr, "{%s} ", TC2->brand); o = (t2_fields*) (obj + TC10->datasize); #line 179 fprintf (stderr, "value = %d", o->_value); fprintf (stderr, ", "); }; PRIVATE INITLINK me_0 ={(INITLINK*)NIL, 0, IntegerExpr__initProc}; static char* VSimports[] = { &VS_Fmt__Int__6e220fa1366cffbc, &VS_Thread__Alerted__fc88feb43485af46, &VS_Wr__T__2555b70b3f7780b1, &VS_Wr__Failure__5f82cfb43dabf527, &VS_Wr__Error__c367253d3ed4fd15, &VS_Wr__PutText__e034dab73a793846, &VS_Temp__T__3a6c7dc12615e4ee, &VS_Temp__FromExpr__808b53eb2a7a6d33, &VS_Error__Msg__4d119a332467757f, &VS_Emit__MaxStream__cf0a0e8934c9c9f3, &VS_Emit__Format__bc4a2b083b93bbd7, &VS_Emit__OpI__02cb878634bb9f49, &VS_Int__T__1062912139372387, &VS_Type__T__2446b70b3f7780a5, &VS_Type__Map__41dd9f4b33104fce, &VS_Type__List__5791758e343becc1, &VS_ExprRep__Init__8b7fff3e227cebab, &VS_ExprRep__NoBind__e7d0d3dd3d703c08, &VS_ExprRep__NoCheck__c11b54bc361794fa, &VS_ExprRep__NoValue__8ccc143224598a66, &VS_ExprRep__Self__28962e523a8d814b, &VS_ExprRep__NoBounds__b64bb146289ee4f0, &VS_ExprRep__IsNever__8f1a069b301903c8, &VS_ExprRep__NeverEq__dfdc2412249ccb65, &VS_ExprRep__NoWriter__a97bb1a23bbf506e, &VS_ExprRep__NoLiteral__6c9c90073f496f67, &VS_Expr__T__2446b70b3f7780a5, &VS_Expr__List__3f87eceb2b9a246a, NIL }; void IntegerExpr__MLink (phase) int phase; { switch (phase) { case 0: { me_0.link = IntegerExpr__init; IntegerExpr__init = & me_0; t2_TC = t2_TC_init; REGISTERTYPE (TC2); break; }; case 1: { t2_TC.parent = TC_M3__Expr; break; }; case 2: { break; }; }; };