Esempio n. 1
0
            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);
            }
Esempio n. 2
0
            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);
            }
Esempio n. 3
0
            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);
            }
Esempio n. 4
0
            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);
            }
Esempio n. 5
0
            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);
            }
Esempio n. 6
0
 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;
 }
Esempio n. 7
0
 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;
 }
Esempio n. 8
0
 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;
 }
Esempio n. 9
0
 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;
 }