本文整理汇总了C#中Frame.LexicalBind方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.LexicalBind方法的具体用法?C# Frame.LexicalBind怎么用?C# Frame.LexicalBind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame
的用法示例。
在下文中一共展示了Frame.LexicalBind方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopGoal
public void PopGoal(Frame th)
{
bt = new Choice(bt, -1, st);
bt.st.subrule_iter = th.LexicalFind("$*GOAL");
th.LexicalBind("$*GOAL", (Variable)st.ns.cut_to.st.subrule_iter);
st.ns = st.ns.next;
}
示例2: PushGoal
public void PushGoal(Frame th, string newGoal)
{
bt = new Choice(bt, -1, st);
bt.st.subrule_iter = th.LexicalFind("$*GOAL");
th.LexicalBind("$*GOAL", Builtins.MakeStr(newGoal));
st.ns = new NState(bt, "GOAL", st.ns);
st.ns.quant = st.pos;
}
示例3: Backtrack
public Frame Backtrack(Frame th)
{
// throw away cut or mark-only frames
while (bt != rootf && (bt.ip < 0)) {
if (bt.ip == -1) {
// Special frame that does $*GOAL cleanup ...
th.LexicalBind("$*GOAL", (Variable)bt.st.subrule_iter);
}
bt = bt.prev;
}
if (st.pos > global.highwater)
global.IncHighwater(st.pos);
if (bt == rootf) {
if ((flags & RETURN_ONE) != 0) {
if (Cursor.Trace)
Console.WriteLine("Failing {0}@{1} after no matches",
name, from);
return Kernel.Take(th, Kernel.NewROScalar(Kernel.EMPTYP));
} else {
if (Cursor.Trace)
Console.WriteLine("Failing {0}@{1} after some matches",
name, from);
if (EmptyList == null) {
P6opaque lst = new P6opaque(Kernel.ListMO);
lst.slots[0 /*items*/] = new VarDeque();
lst.slots[1 /*rest*/ ] = new VarDeque();
EmptyList = Kernel.NewRWListVar(lst);
}
th.caller.resultSlot = EmptyList;
}
return th.Return();
} else {
th.ip = bt.ip;
st = bt.st;
bt = bt.prev;
return th;
}
}