//void WriteCurrent() {
        //    enumerator.Current.AcceptVisitor(visitor, null);
        //    available = enumerator.MoveNext();
        //}

        //AttributedNode currentAttributedNode;

        /// <summary>
        /// Writes all specials up to the start position of the node.
        /// </summary>
        public void AcceptNodeStart(INode node)
        {
            SpecialsContainer specials = node.UserData as SpecialsContainer;

            if (specials != null)
            {
                foreach (ISpecial special in specials.NodeStart)
                {
                    special.AcceptVisitor(visitor, null);
                }
            }
        }
 private static void CollectSpecials(List <ISpecial> specials, List <INode> children)
 {
     foreach (INode node in children)
     {
         if (node.UserData != null && node.UserData is SpecialsContainer)
         {
             SpecialsContainer container = node.UserData as SpecialsContainer;
             specials.AddRange(container.NodeStart);
             specials.AddRange(container.NodeEnd);
         }
         CollectSpecials(specials, node.Children);
     }
 }
        /// <summary>
        /// Writes all specials up to the end position of the node.
        /// </summary>
        public void AcceptNodeEnd(INode node)
        {
            visitor.ForceWriteInPreviousLine = true;
            SpecialsContainer specials = node.UserData as SpecialsContainer;

            if (specials != null)
            {
                foreach (ISpecial special in specials.NodeEnd)
                {
                    special.AcceptVisitor(visitor, null);
                }
            }
            visitor.ForceWriteInPreviousLine = false;
        }
Esempio n. 4
0
        void WriteCurrent(INode node, SpecialLocation location)
        {
            SpecialsContainer container = node.UserData as SpecialsContainer;

            if (container == null)
            {
                container     = new SpecialsContainer();
                node.UserData = container;
            }

            if (location == SpecialLocation.NodeStart)
            {
                container.NodeStart.Add(enumerator.Current);
            }
            else
            {
                container.NodeEnd.Add(enumerator.Current);
            }
            available = enumerator.MoveNext();
        }
 public SpecialOutputVisitor(IOutputFormatter formatter)
 {
     this.formatter       = formatter;
     startAndEndContainer = new SpecialsContainer();
 }