@@ -1136,6 +1136,11 @@ algorithm
11361136 case "listMember" guard Config . acceptMetaModelicaGrammar() then cevalListMember;
11371137 case "anyString" guard Config . acceptMetaModelicaGrammar() then cevalAnyString;
11381138 case "listArrayLiteral" guard Config . acceptMetaModelicaGrammar() then cevalListArrayLiteral;
1139+ case "intBitAnd" guard Config . acceptMetaModelicaGrammar() then cevalIntBitAnd;
1140+ case "intBitOr" guard Config . acceptMetaModelicaGrammar() then cevalIntBitOr;
1141+ case "intBitXor" guard Config . acceptMetaModelicaGrammar() then cevalIntBitXor;
1142+ case "intBitLShift" guard Config . acceptMetaModelicaGrammar() then cevalIntBitLShift;
1143+ case "intBitRShift" guard Config . acceptMetaModelicaGrammar() then cevalIntBitRShift;
11391144 case "numBits" then cevalNumBits;
11401145 case "integerMax" then cevalIntegerMax;
11411146
@@ -2570,6 +2575,96 @@ algorithm
25702575 end match;
25712576end cevalIntegerMax;
25722577
2578+ function cevalIntBitAnd
2579+ input output FCore . Cache cache;
2580+ input FCore . Graph env;
2581+ input list< DAE . Exp > args;
2582+ input Boolean impl;
2583+ input Absyn . Msg msg;
2584+ input Integer numIter;
2585+ output Values . Value result;
2586+ protected
2587+ DAE . Exp e1, e2;
2588+ Integer i1, i2;
2589+ algorithm
2590+ e1 :: e2 :: _ := args;
2591+ (cache, Values . INTEGER (i1)) := ceval(cache, env, e1, impl, msg, numIter + 1 );
2592+ (cache, Values . INTEGER (i2)) := ceval(cache, env, e2, impl, msg, numIter + 1 );
2593+ result := Values . INTEGER (intBitAnd(i1, i2));
2594+ end cevalIntBitAnd;
2595+
2596+ function cevalIntBitOr
2597+ input output FCore . Cache cache;
2598+ input FCore . Graph env;
2599+ input list< DAE . Exp > args;
2600+ input Boolean impl;
2601+ input Absyn . Msg msg;
2602+ input Integer numIter;
2603+ output Values . Value result;
2604+ protected
2605+ DAE . Exp e1, e2;
2606+ Integer i1, i2;
2607+ algorithm
2608+ e1 :: e2 :: _ := args;
2609+ (cache, Values . INTEGER (i1)) := ceval(cache, env, e1, impl, msg, numIter + 1 );
2610+ (cache, Values . INTEGER (i2)) := ceval(cache, env, e2, impl, msg, numIter + 1 );
2611+ result := Values . INTEGER (intBitOr(i1, i2));
2612+ end cevalIntBitOr;
2613+
2614+ function cevalIntBitXor
2615+ input output FCore . Cache cache;
2616+ input FCore . Graph env;
2617+ input list< DAE . Exp > args;
2618+ input Boolean impl;
2619+ input Absyn . Msg msg;
2620+ input Integer numIter;
2621+ output Values . Value result;
2622+ protected
2623+ DAE . Exp e1, e2;
2624+ Integer i1, i2;
2625+ algorithm
2626+ e1 :: e2 :: _ := args;
2627+ (cache, Values . INTEGER (i1)) := ceval(cache, env, e1, impl, msg, numIter + 1 );
2628+ (cache, Values . INTEGER (i2)) := ceval(cache, env, e2, impl, msg, numIter + 1 );
2629+ result := Values . INTEGER (intBitXor(i1, i2));
2630+ end cevalIntBitXor;
2631+
2632+ function cevalIntBitLShift
2633+ input output FCore . Cache cache;
2634+ input FCore . Graph env;
2635+ input list< DAE . Exp > args;
2636+ input Boolean impl;
2637+ input Absyn . Msg msg;
2638+ input Integer numIter;
2639+ output Values . Value result;
2640+ protected
2641+ DAE . Exp e1, e2;
2642+ Integer i, s;
2643+ algorithm
2644+ e1 :: e2 :: _ := args;
2645+ (cache, Values . INTEGER (i)) := ceval(cache, env, e1, impl, msg, numIter + 1 );
2646+ (cache, Values . INTEGER (s)) := ceval(cache, env, e2, impl, msg, numIter + 1 );
2647+ result := Values . INTEGER (intBitLShift(i, s));
2648+ end cevalIntBitLShift;
2649+
2650+ function cevalIntBitRShift
2651+ input output FCore . Cache cache;
2652+ input FCore . Graph env;
2653+ input list< DAE . Exp > args;
2654+ input Boolean impl;
2655+ input Absyn . Msg msg;
2656+ input Integer numIter;
2657+ output Values . Value result;
2658+ protected
2659+ DAE . Exp e1, e2;
2660+ Integer i, s;
2661+ algorithm
2662+ e1 :: e2 :: _ := args;
2663+ (cache, Values . INTEGER (i)) := ceval(cache, env, e1, impl, msg, numIter + 1 );
2664+ (cache, Values . INTEGER (s)) := ceval(cache, env, e2, impl, msg, numIter + 1 );
2665+ result := Values . INTEGER (intBitRShift(i, s));
2666+ end cevalIntBitRShift;
2667+
25732668protected function makeLoadLibrariesEntry "Needed to be able to resolve modelica:// during runtime, etc.
25742669Should not be part of CevalScript since ModelicaServices needs this feature and the frontend needs to take care of it."
25752670 input SCode . Element cl;
0 commit comments