home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Source / MiscMergeKit / _MiscMergeIdentifyCommand.m < prev    next >
Encoding:
Text File  |  1995-07-08  |  1.4 KB  |  49 lines

  1. //
  2. //    _MiscMergeIdentifyCommand.m -- "identify" merge command implementation
  3. //        Written by Don Yacktman Copyright (c) 1995 by Don Yacktman.
  4. //                Version 1.0.  All rights reserved.
  5. //        This notice may not be removed from this source code.
  6. //
  7. //    This object is included in the MiscKit by permission from the author
  8. //    and its use is governed by the MiscKit license, found in the file
  9. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  10. //    for a list of all applicable permissions and restrictions.
  11. //    
  12.  
  13.  
  14. #import <misckit/miscmerge.h>
  15. #import "_MiscMergeIdentifyCommand.h"
  16.  
  17. @implementation _MiscMergeIdentifyCommand
  18.  
  19. static MiscString *myKey = nil;
  20.  
  21. - parseFromString:(MiscString *)aString
  22. {
  23.     MISC_Merge_Cond_Op operator;
  24.     if (!myKey) {
  25.         myKey = [MiscString new];
  26.         [myKey setStringValue:"identify"];
  27.     }
  28.     [self eatKeyWord:myKey from:aString isOptional:NO];
  29.     value1 = [self getArgumentStringFrom:aString toEnd:NO];
  30.     operator = [self getConditionalFrom:aString];
  31.     if (operator != MISC_MCO_EQUAL) {
  32.         id tempString = [MiscString
  33.                 newWithString:"Identify requires operator to be an =."];
  34.         [self error_conditional:tempString];
  35.         [tempString free];
  36.         value2 = [MiscString new];
  37.     }
  38.     value2 = [self getArgumentStringFrom:aString toEnd:YES];
  39.     return self;
  40. }
  41.  
  42. - executeForMerge:(MiscMergeEngine *)aMerger
  43. {
  44.     [aMerger setSymbol:value1 toValue:value2];
  45.     return self;
  46. }
  47.  
  48. @end
  49.