Ejemplo n.º 1
0
 public Func <Action, EJudge> ElseIf(object temp)
 {
     il.NoErrorLoad(temp);
     CurrentLabel = il.DefineLabel();
     LabelIndex  += 1;
     il.REmit(ThreadCache.GetJudgeCode(), CurrentLabel);
     return(TrueFunc);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 提供while操作
        /// </summary>
        /// <param name="condition">判断语句</param>
        /// <returns></returns>
        public static Func <Action, ELoop> While(Action condition)
        {
            ELoop loopHandler = new ELoop();

            loopHandler.StartLabel = loopHandler.il.DefineLabel();
            loopHandler.EndLabel   = loopHandler.il.DefineLabel();
            loopHandler.il.MarkLabel(loopHandler.StartLabel);                        //设置开始标签
            condition();                                                             //条件判断
            loopHandler.il.REmit(ThreadCache.GetJudgeCode(), loopHandler.EndLabel);  //不成立就跳转到末尾
            return(loopHandler.BodyFunc);
        }
Ejemplo n.º 3
0
        public static Func <Action, EJudge> If(Action action)
        {
            EJudge newEJudge = new EJudge();

            action?.Invoke();
            newEJudge.EndLabel     = newEJudge.il.DefineLabel();
            newEJudge.CurrentLabel = newEJudge.il.DefineLabel();
            newEJudge.LabelIndex  += 1;
            newEJudge.il.REmit(ThreadCache.GetJudgeCode(), newEJudge.CurrentLabel);
            return(newEJudge.TrueFunc);
        }
Ejemplo n.º 4
0
        //其他跳转方式 已经由重载运算符完成
        public static Func <Action, EJudge> If(object temp)
        {
            EJudge newEJudge = new EJudge();

            newEJudge.il.NoErrorLoad(temp);
            newEJudge.EndLabel     = newEJudge.il.DefineLabel();
            newEJudge.CurrentLabel = newEJudge.il.DefineLabel();
            newEJudge.LabelIndex  += 1;
            newEJudge.il.REmit(ThreadCache.GetJudgeCode(), newEJudge.CurrentLabel);
            return(newEJudge.TrueFunc);
        }