home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / Apps / DevTools / COWS / Code / COWSProtocols.h < prev    next >
Encoding:
Text File  |  1994-03-24  |  2.0 KB  |  82 lines

  1. /*
  2.     Copyright (C) 1994 Sean Luke
  3.  
  4.     COWSProtocols.h
  5.     Version 1.0
  6.     Sean Luke
  7.     
  8. */
  9.  
  10.  
  11.  
  12. #import "COWSStringNode.h"
  13. #import "COWSArgumentList.h"
  14.  
  15.  
  16.  
  17. @protocol LibraryControl
  18.     // The interpreter adheres to this protocol.
  19.     // Used to load libraries, and to allow libraries to
  20.     // top the interpreter, if need be, until they get an answer
  21.     // back to give to it.
  22.  
  23. - addLibrary:this_library;
  24. - addLibraryFunction:(const char*) this_name
  25.     selector: (SEL) this_selector
  26.     target: this_target;
  27. - clearLibraryFunctions;
  28. - pauseInterpreting:calling_library;
  29. - resumeInterpretingWithValue:(COWSStringNode*)this_value;
  30. @end
  31.  
  32.  
  33.  
  34. @protocol InterpreterToLibrary
  35.     // Libraries adhere to this protocol.
  36.     // Used to load libraries.
  37.  
  38. - loadLibrary:sender;
  39. - pauseCancelled:sender;
  40. @end
  41.  
  42.  
  43.  
  44. @protocol InterpreterToAppDelegate
  45.     // Delegates of the interpreter adhere to this protocol.
  46.     // This protocol consists of delegate messages from the interpreter.
  47.  
  48. - finishedInterpreting:(const char*)returnValue:(int)thisMessage:sender;
  49. - errorInterpreting:(int) thisError:(const char*)thisFunction:
  50.     (int)thisPosition:(const char*)thisString:sender;
  51. @end
  52.  
  53.  
  54.  
  55. @protocol InterpreterControl
  56.     // The interpreter adheres to this protocol.
  57.     // This protocol gives the application control over the interpreter itself.
  58.  
  59. - (int) setProgram:(const char*) this_string;    
  60. - setDelegate:this_delegate;
  61. - delegate;
  62. - interpretFunction:(const char*) this_name 
  63.     arguments:(COWSArgumentList*)these_arguments;
  64. - stopInterpreting;
  65. @end
  66.  
  67.  
  68. @protocol InterpreterIPC
  69.     // The interpreter adheres to this protocol.
  70.     // This protocol gives one app's interpreter control over
  71.     // another app's interpreter.
  72.     
  73. - sendFunction:(const char*) this_name:reply;
  74.     // synchronous communication
  75.     // this function does not currently work when sending to background process
  76.     // reply is a COWSStringNode. 
  77. - addArgument:(const char*)this_argument;    // returns NULL
  78. - (oneway void) sendOutFunction:(const char*) this_name;
  79.     // asynchronous communication
  80.     // this function works in all cases, as opposed to sendFunction.
  81. - (BOOL) isForeground;
  82. @end