Пример #1
0
        public T Accept <T>(ISppfNodeVisitor <T> visitor, bool ignoreAlternatives)
        {
            if (!ignoreAlternatives && NextAlternative != null)
            {
                return(visitor.VisitAlternatives(this));
            }

            if (Id > 0)
            {
                return(visitor.VisitLeaf(Id, Value, Location));
            }

            return(visitor.VisitBranch(-Id, Children, Location));
        }
Пример #2
0
 public void Accept(ISppfNodeVisitor visitor, bool ignoreAlternatives)
 {
     if (!ignoreAlternatives && NextAlternative != null)
     {
         visitor.VisitAlternatives(this);
     }
     else if (Id > 0)
     {
         visitor.VisitLeaf(Id, Value, Location);
     }
     else
     {
         visitor.VisitBranch(-Id, Children, Location);
     }
 }