Example #1
0
 public CASTElementDescentantsFlattenEventIterator(CASTElement astNode,
                                                   CASTGenericIteratorEvents events, object info = null)
 {
     m_Event = events;
     m_node  = astNode as CASTComposite;
     if (m_node == null)
     {
         throw new Exception("Iterator cannot iterate over leaf nodes");
     }
 }
        public override CAbstractIterator <CASTElement> AcceptEventIterator(CASTAbstractConcreteIteratorFactory iteratorFactory,
                                                                            CASTGenericIteratorEvents events, object info = null)
        {
            IASTAbstractConcreteIteratorFactory typedFactory = iteratorFactory as IASTAbstractConcreteIteratorFactory;

            if (typedFactory != null)
            {
                return(iteratorFactory.CreateLexerDescriptionIteratorEvents(this, events, info));
            }
            return(iteratorFactory.CreateIteratorASTElementDescentantsFlattenEvents(this, events, info));
        }
Example #3
0
 public CASTAbstractVisitor(IAbstractASTIteratorsFactory iteratorFactory = null, CASTGenericIteratorEvents events = null)
 {
     if (iteratorFactory == null)
     {
         m_iteratorFactory = new CASTAbstractConcreteIteratorFactory();
     }
     else
     {
         m_iteratorFactory = iteratorFactory;
     }
     if (events == null)
     {
         m_events = new CASTGenericIteratorEvents();
     }
     else
     {
         m_events = events;
     }
 }
Example #4
0
 public virtual CAbstractIterator <CASTElement> CreateIteratorASTElementDescentantsContextEvents(CASTElement element,
                                                                                                 CASTGenericIteratorEvents events, object info = null)
 {
     return(new CASTElementDescentantsContextEventIterator(element, events, info));
 }
Example #5
0
 /// <summary>
 /// Accepts the event iterator.
 /// </summary>
 /// <param name="iteratorFactory">The iterator factory.</param>
 /// <returns></returns>
 public abstract CAbstractIterator <CASTElement> AcceptEventIterator(CASTAbstractConcreteIteratorFactory iteratorFactory,
                                                                     CASTGenericIteratorEvents events, object info = null);
 public virtual CAbstractIterator <CASTElement> CreateLexerDescriptionIteratorEvents(CASTElement element,
                                                                                     CASTGenericIteratorEvents events, object info = null)
 {
     return(CreateIteratorASTElementDescentantsFlattenEvents(element, events, info));
 }
 public CAbstractIterator <CASTElement> CreateRangeIteratorEvents(CASTElement element, CASTGenericIteratorEvents events, object info = null)
 {
     throw new NotImplementedException();
 }
 public CAbstractIterator <CASTElement> CreateQuantifierNoneormultiplengIteratorEvents(CASTElement element, CASTGenericIteratorEvents events,
                                                                                       object info = null)
 {
     throw new NotImplementedException();
 }
 public CAbstractIterator <CASTElement> CreateRegexpAlternationIteratorEvents(CASTElement element, CASTGenericIteratorEvents events,
                                                                              object info = null)
 {
     return(CreateIteratorASTElementDescentantsFlattenEvents(element, events, info));
 }