Esempio n. 1
0
        public override bool Match(IParserState p)
        {
            p.CreateNode(sLabel);
            // Used just to make sure the position is restored
            int  pos    = p.GetPos();
            bool result = FirstChild.Match(p);

            if (result)
            {
                p.CompleteNode();
            }
            else
            {
                p.AbandonNode();
                // As-sure that the position is restored
                Debug.Assert(p.GetPos() == pos);
            }
            return(result);
        }
Esempio n. 2
0
 public override bool Match(IParserState p)
 {
     p.CreateNode(sLabel);
     // Used just to make sure the position is restored
     int pos = p.GetPos();
     bool result = FirstChild.Match(p);
     if (result)
     {
         p.CompleteNode();
     }
     else
     {
         p.AbandonNode();
         // As-sure that the position is restored
         Debug.Assert(p.GetPos() == pos);
     }
     return result;
 }