public override bool Match(Parser p) { int pos = p.GetPos(); if (mRule.Match(p)) { p.SetPos(pos); return(false); } Trace.Assert(p.GetPos() == pos); return(true); }
public override bool Match(Parser p) { if (p.AtEnd()) { return(false); } var m = re.Match(p.Input, p.GetPos()); if (m == null || m.Index != p.GetPos()) { return(false); } p.SetPos(p.GetPos() + m.Length); return(true); }
public PegAstNode Add(Parser p, Object label) { PegAstNode ret = new PegAstNode(p.GetPos(), msText, this, label); mChildren.Add(ret); return(ret); }
public override bool Match(Parser p) { int pos = p.GetPos(); while (!mTerm.Match(p)) { if (!mElem.Match(p)) { p.SetPos(pos); return(false); } } return(true); }
public override bool Match(Parser p) { int iter = p.GetPos(); foreach (Rule r in mRules) { if (!r.Match(p)) { p.SetPos(iter); return(false); } } return(true); }
public override bool Match(Parser p) { if (p.AtEnd()) { return(false); } int pos = p.GetPos(); foreach (char c in mData) { if (p.GetChar() != c) { p.SetPos(pos); return(false); } p.GotoNext(); } return(true); }
public override bool Match(Parser p) { int pos = p.GetPos(); while (!mTerm.Match(p)) { if (!mElem.Match(p)) { p.SetPos(pos); return false; } } return true; }
public override bool Match(Parser p) { if (p.AtEnd()) return false; int pos = p.GetPos(); foreach (char c in mData) { if (p.GetChar() != c) { p.SetPos(pos); return false; } p.GotoNext(); } return true; }
public override bool Match(Parser p) { int pos = p.GetPos(); if (mRule.Match(p)) { p.SetPos(pos); return false; } Trace.Assert(p.GetPos() == pos); return true; }
public override bool Match(Parser p) { int iter = p.GetPos(); foreach (Rule r in mRules) { if (!r.Match(p)) { p.SetPos(iter); return false; } } return true; }
public void Complete(Parser p) { mnCount = p.GetPos() - mnBegin; }
public PegAstNode Add(Parser p, Object label) { PegAstNode ret = new PegAstNode(p.GetPos(), msText, this, label); mChildren.Add(ret); return ret; }