예제 #1
0
 public void Visit(object t, object parent, int childIndex, IDictionary <string, object> unusedlabels)
 {
     // the unusedlabels arg is null as visit on token type doesn't set.
     _labels.Clear();
     if (_outer.ParseCore(t, _tpattern, _labels))
     {
         _visitor.Visit(t, parent, childIndex, _labels);
     }
 }
예제 #2
0
        /** <summary>Do the recursive work for visit</summary> */
        protected virtual void VisitCore(object t, object parent, int childIndex, int ttype, IContextVisitor visitor)
        {
            if (t == null)
            {
                return;
            }
            if (adaptor.GetType(t) == ttype)
            {
                visitor.Visit(t, parent, childIndex, null);
            }
            int n = adaptor.GetChildCount(t);

            for (int i = 0; i < n; i++)
            {
                object child = adaptor.GetChild(t, i);
                VisitCore(child, t, i, ttype, visitor);
            }
        }
예제 #3
0
파일: TreeWizard.cs 프로젝트: ksmyth/antlr
 /** <summary>Do the recursive work for visit</summary> */
 protected virtual void _Visit( object t, object parent, int childIndex, int ttype, IContextVisitor visitor )
 {
     if ( t == null )
     {
         return;
     }
     if ( adaptor.GetType( t ) == ttype )
     {
         visitor.Visit( t, parent, childIndex, null );
     }
     int n = adaptor.GetChildCount( t );
     for ( int i = 0; i < n; i++ )
     {
         object child = adaptor.GetChild( t, i );
         _Visit( child, t, i, ttype, visitor );
     }
 }
 protected virtual void VisitCore(object t, object parent, int childIndex, int ttype, IContextVisitor visitor)
 {
     if (t != null)
     {
         if (this.adaptor.GetType(t) == ttype)
         {
             visitor.Visit(t, parent, childIndex, null);
         }
         int childCount = this.adaptor.GetChildCount(t);
         for (int i = 0; i < childCount; i++)
         {
             object child = this.adaptor.GetChild(t, i);
             this.VisitCore(child, t, i, ttype, visitor);
         }
     }
 }