예제 #1
0
파일: codegen.cs 프로젝트: retahc/old-code
        internal override void Walk(EmitContext ec)
        {
            if (ec.Emitting)
            {
                ec.EmitRArray(alen);
            }

            int i = 0;

            for (RNode n = this; n != null;)
            {
                if (n is RNArray)
                {
                    if (n.head != null)
                    {
                        if (ec.Emitting)
                        {
                            ec.EmitDup();
                            ec.EmitInt(i);
                        }
                        n.head.Walk(ec);
                        if (ec.Emitting)
                        {
                            ec.EmitRArraySet();
                        }
                    }
                    n = n.next;
                    i++;
                }
                else
                {
                    // n.Walk(ec);
                    // break;
                    throw new NotSupportedException("bug: array has tail of type " + n.GetType().Name);
                }
            }
        }
예제 #2
0
파일: codegen.cs 프로젝트: emtees/old-code
 internal override void Walk(EmitContext ec)
 {
     if(ec.Emitting) {
         ec.EmitRArray(alen);
     }
     
     int i = 0;
     for(RNode n = this; n != null; ) {
         if(n is RNArray) {
             if(n.head != null) {
                 if(ec.Emitting) {
                     ec.EmitDup();
                     ec.EmitInt(i);
                 }
                 n.head.Walk(ec);
                 if(ec.Emitting) {
                     ec.EmitRArraySet();
                 }
             }
             n = n.next;
             i++;
         } else {
             // n.Walk(ec);
             // break;
             throw new NotSupportedException("bug: array has tail of type " + n.GetType().Name);
         }
     }
 }