home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / Apps / DevTools / COWS / Code / COWSArgumentList.m < prev    next >
Encoding:
Text File  |  1994-03-05  |  862 b   |  76 lines

  1. /*
  2.     Copyright (C) 1994 Sean Luke
  3.  
  4.     COWSArgumentList.m
  5.     Version 1.0
  6.     Sean Luke
  7.     
  8. */
  9.  
  10.  
  11.  
  12.  
  13. #import "COWSArgumentList.h"
  14.  
  15. @implementation COWSArgumentList
  16.  
  17. - init
  18.     {
  19.     id returnval=[super init];
  20.     temp=NULL;
  21.     return returnval;
  22.     }
  23.     
  24.     
  25. - first
  26.     {
  27.     temp=current;
  28.     return temp;
  29.     }
  30.     
  31. - next
  32.     {
  33.     if (temp==NULL) return temp;
  34.     temp=[temp next];
  35.     return temp;
  36.     }
  37.  
  38. - now
  39.     {
  40.     return temp;
  41.     }
  42.  
  43. - prev
  44.     {
  45.     if (temp==NULL) return temp;
  46.     temp=[temp prev];
  47.     return temp;
  48.     }
  49.     
  50. - last
  51.     {
  52.     temp=current;
  53.     if (temp==NULL) return temp;
  54.     while ([temp next]!=NULL)
  55.         {
  56.         temp=[temp next];
  57.         }
  58.     return temp;    
  59.     }
  60.     
  61. - copy
  62.     {
  63.     id new_args=[[COWSArgumentList alloc] init];
  64.     id temp_val=[self last];
  65.     
  66.     while (temp_val!=NULL)
  67.         {
  68.         id new_val=[[COWSStringNode alloc] init];
  69.         [new_val setString:[temp_val string]];
  70.         [new_args push:new_val];
  71.         temp_val=[self prev];
  72.         }
  73.     return new_args;
  74.     }
  75.  
  76. @end