当前位置: 首页>>代码示例>>C#>>正文


C# Frame.MakeChild方法代码示例

本文整理汇总了C#中Frame.MakeChild方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.MakeChild方法的具体用法?C# Frame.MakeChild怎么用?C# Frame.MakeChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Frame的用法示例。


在下文中一共展示了Frame.MakeChild方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MEMap_for_each

    public static Frame MEMap_for_each(Frame th, P6any lst,
            Func<Variable,Variable> fcn)
    {
        VarDeque iter = new VarDeque(Kernel.NewRWListVar(lst));

        Frame fr = th.MakeChild(null, Kernel.CommonMEMap_I, Kernel.AnyP);
        fr.lexi0 = 0;
        fr.lex0 = new BatchSource(1, iter);
        fr.lex1 = new VarDeque();
        fr.lex2 = fcn;
        return fr;
    }
开发者ID:ebassi,项目名称:niecza,代码行数:12,代码来源:Builtins.cs

示例2: MEZip

 public static Frame MEZip(Frame th, bool with, Variable[] pcl)
 {
     Frame fr = th.MakeChild(null, Kernel.CommonMEMap_I, Kernel.AnyP);
     Kernel.SetTopFrame(fr);
     fr.lexi0 = 0;
     fr.lex2 = ExtractWith(with, ref pcl);
     fr.lex0 = new ZipSource(pcl);
     fr.lex1 = new VarDeque();
     return fr;
 }
开发者ID:ebassi,项目名称:niecza,代码行数:10,代码来源:Builtins.cs

示例3: MEGrep

    public static Frame MEGrep(Frame th, Variable[] lst)
    {
        VarDeque iter = new VarDeque(lst);
        Variable fcn = iter.Shift();
        iter = Kernel.IterFlatten(iter);

        Frame fr = th.MakeChild(null, Kernel.CommonGrep_I, Kernel.AnyP);
        fr.lexi0 = 0;
        fr.lex0 = iter;
        fr.lex1 = new VarDeque();
        fr.lex2 = fcn;
        return fr;
    }
开发者ID:ebassi,项目名称:niecza,代码行数:13,代码来源:Builtins.cs

示例4: MEMap

    public static Frame MEMap(Frame th, Variable[] lst)
    {
        VarDeque iter = new VarDeque(lst);
        Variable fcn = iter.Shift();
        P6any fcni = fcn.Fetch();
        int arity = get_count(fcni);

        Frame fr = th.MakeChild(null, Kernel.CommonMEMap_I, Kernel.AnyP);
        fr.lexi0 = 0;
        fr.lex0 = new BatchSource(arity, iter);
        fr.lex1 = new VarDeque();
        fr.lex2 = fcni;
        return fr;
    }
开发者ID:ebassi,项目名称:niecza,代码行数:14,代码来源:Builtins.cs

示例5: proto_dispatch

 public Frame proto_dispatch(Frame th, Variable unused)
 {
     Frame nth = th.MakeChild(null, Lexer.StandardProtoSI, Kernel.AnyP);
     nth.pos = new Variable[] { MakeCursorV() };
     return nth;
 }
开发者ID:nbrown,项目名称:niecza,代码行数:6,代码来源:Cursor.cs

示例6: list_common

    public Frame list_common(bool eval, Frame th, Variable var)
    {
        VarDeque iter = Builtins.start_iter(var);
        List<object> toks = new List<object>();
        List<LAD> lads = new List<LAD>();

        NFA pad = new NFA();
        pad.cursor_class = st.ns.klass;

        while (Kernel.IterHasFlat(iter, true)) {
            Variable svar = iter.Shift();
            P6any sobj = svar.Fetch();

        retry:
            if (sobj.Isa(Kernel.RegexMO)) {
                toks.Add(sobj);

                pad.outer_stack.Add(Kernel.GetOuter(sobj));
                pad.info_stack.Add(Kernel.GetInfo(sobj));
                lads.Add(pad.info_stack[0].ltm.Reify(pad));
                pad.outer_stack.Clear();
                pad.info_stack.Clear();
            } else if (eval) {
                sobj = Builtins.compile_bind_regex(th,
                        sobj.mo.mro_raw_Str.Get(svar));
                svar = Kernel.NewROScalar(sobj);
                goto retry;
            } else {
                string str = sobj.mo.mro_raw_Str.Get(svar);
                toks.Add(str);
                lads.Add(new LADStr(str));
            }
        }

        int[] cases = (new Lexer(pad, "array_var", lads.ToArray())).
            Run(global.orig_s, st.pos);

        Frame nth = th.MakeChild(null, ArrayHelperSI, Kernel.AnyP);
        nth.lex0 = MakeCursor();
        nth.lex1 = toks;
        nth.lex2 = cases;

        return nth;
    }
开发者ID:nbrown,项目名称:niecza,代码行数:44,代码来源:Cursor.cs

示例7: MECross

 public static Frame MECross(Frame th, bool with, Variable[] pcl)
 {
     var setting = th.info.setting;
     Frame fr = th.MakeChild(null, setting.CommonMEMap_I, setting.AnyP);
     Kernel.SetTopFrame(fr);
     fr.lexi0 = 0;
     fr.lex2 = ExtractWith(with, ref pcl);
     fr.lex0 = new CrossSource(pcl);
     fr.lex1 = new VarDeque();
     return fr;
 }
开发者ID:o-fun,项目名称:niecza,代码行数:11,代码来源:Builtins.cs

示例8: simple_eval

 public static Frame simple_eval(Frame th, Variable str)
 {
     if (up_domain == null)
         return Kernel.Die(th, "Cannot eval; no compiler available");
     CrossDomainReceiver r = (CrossDomainReceiver)
         up_domain.CreateInstanceAndUnwrap("Kernel", "Niecza.UpCallee");
     SubInfo outer = th.caller.info;
     string[] msg = r.Call(AppDomain.CurrentDomain, new string[] { "eval",
             str.Fetch().mo.mro_raw_Str.Get(str),
             (outer.unit == null ? "" : outer.unit.name),
             outer.xref_no.ToString()
             });
     if (msg[0] != "")
         return Kernel.Die(th, msg[0]);
     return th.MakeChild(null, new SubInfo("boot-" +
                 eval_result.Method.DeclaringType, eval_result), Kernel.AnyP);
 }
开发者ID:Util,项目名称:niecza,代码行数:17,代码来源:Builtins.cs

示例9: proto_dispatch

 public Frame proto_dispatch(Frame th, Variable unused) {
     Frame nth = th.MakeChild(null, th.info.setting.StandardLexerSI, global.setting.AnyP);
     nth.pos = new Variable[] { MakeCursorV() };
     return nth;
 }
开发者ID:transformersprimeabcxyz,项目名称:_TO-DO-niecza-sorear,代码行数:5,代码来源:Cursor.cs


注:本文中的Frame.MakeChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。