public override void Compile(CodeBuf cb) { int l1 = cb.NewLabel(); int l2 = cb.NewLabel(); cb.ops.Add(delegate(Frame th) { th.rx.OpenQuant(); return(th); }); cb.labels[l1] = cb.ops.Count; cb.ops.Add(delegate(Frame th) { th.rx.PushBacktrack("*", cb.labels[l2]); return(th); }); inner.Compile(cb); cb.ops.Add(delegate(Frame th) { th.ip = cb.labels[l1]; return(th); }); cb.labels[l2] = cb.ops.Count; cb.ops.Add(delegate(Frame th) { th.rx.CloseQuant(); return(th); }); }
public override void Compile(CodeBuf cb) { cb.ops.Add(delegate(Frame th) { if (!th.rx.Exact(th, s)) return th.rx.Backtrack(th); return th; }); }
public override void Compile(CodeBuf cb) { foreach (RxOp ze in z) { ze.Compile(cb); } }
public override void Compile(CodeBuf cb) { cb.ops.Add(delegate(Frame th) { md(th.rx); return(th); }); }
public override void Compile(CodeBuf cb) { cb.ops.Add(delegate(Frame th) { if (!th.rx.Exact(th, s)) { return(th.rx.Backtrack(th)); } return(th); }); }
private static Frame TestC(Frame th) { if (Kernel.TraceCont) { Console.WriteLine("At {0}", th.ip); } CodeBuf cb = (CodeBuf)th.lex0; if (th.ip == cb.ops.Count) { ok = true; return(null); } CodeBuf.D d = cb.ops[th.ip++]; return(d(th)); }
private static void RunTest(int ix, bool y, string s, RxOp ot) { CodeBuf cb = new CodeBuf(); ot.Compile(cb); Frame th = new Frame(null, null, TestSI); th.rx = new RxFrame(Kernel.MockBox(new Cursor(s))); th.lex0 = cb; ok = false; while (th != null) { th = th.Continue(); } Console.WriteLine((ok == y) ? "ok {0}" : "not ok {0}", ix); }
public override void Compile(CodeBuf cb) { int l1 = cb.NewLabel(); int l2 = cb.NewLabel(); cb.ops.Add(delegate(Frame th) { th.rx.OpenQuant(); return th; }); cb.labels[l1] = cb.ops.Count; cb.ops.Add(delegate(Frame th) { th.rx.PushBacktrack("*", cb.labels[l2]); return th; }); inner.Compile(cb); cb.ops.Add(delegate(Frame th) { th.ip = cb.labels[l1]; return th; }); cb.labels[l2] = cb.ops.Count; cb.ops.Add(delegate(Frame th) { th.rx.CloseQuant(); return th; }); }
private static void RunTest(int ix, bool y, string s, RxOp ot) { CodeBuf cb = new CodeBuf(); ot.Compile(cb); Frame th = new Frame(null, null, TestSI); th.rx = new RxFrame(Kernel.MockBox(new Cursor(s))); th.lex0 = cb; ok = false; while (th != null) th = th.Continue(); Console.WriteLine((ok == y) ? "ok {0}" : "not ok {0}", ix); }
public override void Compile(CodeBuf cb) { foreach (RxOp ze in z) ze.Compile(cb); }
public override void Compile(CodeBuf cb) { cb.ops.Add(delegate(Frame th) { md(th.rx); return th; }); }
public abstract void Compile(CodeBuf cb);