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

  1. //
  2. //    _MiscMergeDelayedParseCommand.m -- delayed 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 "_MiscMergeDelayedParseCommand.h"
  16.  
  17. @implementation _MiscMergeDelayedParseCommand
  18.  
  19. - parseFromString:(MiscString *)aString
  20. { // hold onto the text until we're actually merging...
  21.     unparsedCommand = [aString copy]; 
  22.     return self;
  23. }
  24.  
  25. - executeForMerge:(MiscMergeEngine *)aMerger
  26. {
  27.     MiscString *result;
  28.     MiscMergeCommand *theCommand;
  29.     MiscMergeTemplate *template =
  30.             [[MiscMergeTemplate alloc] initWithString:unparsedCommand];
  31.     MiscMergeEngine *anEngine = [[MiscMergeEngine alloc] init];
  32.  
  33.     [anEngine setTemplate:template];
  34.     [anEngine setParentMerge:aMerger];
  35.     [anEngine setMergeDictionary:[aMerger dictionary]];
  36.     result = [anEngine merge:self];
  37.     theCommand = [[[MiscMergeTemplate getClassForCommand:result]
  38.                 alloc] initFrom:result];
  39.     [theCommand executeForMerge:aMerger];
  40.     [result free];
  41.     [theCommand free];
  42.     [template free];
  43.     [anEngine free];
  44.     return self;
  45. }
  46.  
  47. @end
  48.  
  49.  
  50.  
  51.