home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a066 / 1.img / CLASS(Y).CH < prev    next >
Encoding:
Text File  |  1992-03-20  |  6.9 KB  |  157 lines

  1. /*
  2.         class(y).ch - v1.05
  3.  
  4.         Copyright (c) 1991 Anton van Straaten.
  5.         All rights reserved.
  6. */
  7.  
  8. #define CLASSY_VER100
  9.  
  10.  
  11. #xcommand   CLASS <className> [FROM <superClass>]   ;
  12.                 =>                                  ;
  13.                 CREATE CLASS <className> [FROM <superClass>]
  14.  
  15. #xcommand   CREATE CLASS <className> [FROM <superClass>]    ;
  16.                 =>                                          ;
  17.                 function <className>                        ;;
  18.                 static self                                 ;;
  19.                 local clsMkr                                ;;
  20.                 if self == NIL                              ;;
  21.                 clsMkr := ClassMaker():new(<"className">, [<superClass>()]) ;;
  22.                 method new constructor                     ;;
  23.                 hidden:
  24.  
  25. #command    INITIALIZE [CLASS] :    =>  self := clsMkr:makeClass; csyMethify(self)
  26.  
  27. #xcommand   END CLASS                           ;
  28.                 =>                              ;
  29.                 if self == nil                  ;;
  30.                     self := clsMkr:makeClass    ;;
  31.                 else                            ;;
  32.                     csyMethify()                ;;
  33.                 end; end                        ;;
  34.                 return self                     ;;
  35.                 #include "endclass.ch"
  36.  
  37. #xcommand   ENDCLASS    =>      END CLASS
  38.  
  39. #command    EXPORTED:   =>      ClassMaker():scope(1)
  40. #command    VISIBLE:    =>      ClassMaker():scope(1)
  41.  
  42. #command    HIDDEN:     =>      ClassMaker():scope(2)
  43. #command    LOCAL:      =>      HIDDEN:
  44. #command    PRIVATE:    =>      HIDDEN:
  45.  
  46. #command    PROTECTED:  =>      ClassMaker():scope(4)
  47.  
  48. #command    VAR <(name1)> [, <(nameN)>] [<ro: READONLY, RO, NOASSIGN>]  ;
  49.                 =>                                                      ;
  50.                 clsMkr:variable({ <(name1)> [, <(nameN)>] }, .f., !<.ro.>)
  51.  
  52. #xcommand   CLASS VAR <(name1)> [, <(nameN)>] [<ro: READONLY, RO, NOASSIGN>] ;
  53.                 =>                                                           ;
  54.                 clsMkr:variable({ <(name1)> [, <(nameN)>] }, .t., !<.ro.>)
  55.  
  56. #command    INSTVAR <*details*>    =>  VAR <details>
  57. #xcommand   CLASSVAR <*details*>   =>  CLASS VAR <details>
  58.  
  59. #command    MESSAGE <message1> [, <messageN>] [<ct: CONSTRUCTOR, CTOR>] ;
  60.                 =>                                                      ;
  61.                 clsMkr:method({ { <"message1">, { || <message1>() } }   ;
  62.                              [, { <"messageN">, { || <messageN>() } }] }, <.ct.>, <.ct.>)
  63.  
  64. #command    MESSAGE <message> METHOD <method> [<ct: CONSTRUCTOR, CTOR>] ;
  65.                 =>                                                      ;
  66.                 clsMkr:method({{ <"message">, { || <method>() } }}, <.ct.>, <.ct.>)
  67.  
  68. #command    MESSAGE <message1> [, <messageN>] <def: DEFERRED, NULL>    ;
  69.                 =>                                                      ;
  70.                 clsMkr:method({ { <"message1">, nil }                   ;
  71.                              [, { <"messageN">, nil }] }, .f., .f.)
  72.  
  73. #xcommand   METHOD <method1> [, <methodN>] [<ct: CONSTRUCTOR, CTOR>]    ;
  74.                 =>                                                      ;
  75.                 MESSAGE <method1> [, <methodN>] <ct>
  76.  
  77. #xcommand   METHOD <msg1> = <mth1> [, <msgN> = <mthN>] [<ct: CONSTRUCTOR, CTOR>] ;
  78.                 =>                                                      ;
  79.                 MESSAGE <msg1> METHOD <mth1> <ct>                       ;
  80.              [; MESSAGE <msgN> METHOD <mthN> <ct>]
  81.  
  82. #xcommand   METHOD <message> = <method> <ct: CONSTRUCTOR, CTOR>    ;
  83.                 =>                                                      ;
  84.                 MESSAGE <message> METHOD <method> <ct>
  85.  
  86. #xcommand   METHOD <method1> [, <methodN>] <def: DEFERRED, NULL>   ;
  87.                 =>                                                      ;
  88.                 MESSAGE <method1> [, <methodN>] <def>
  89.  
  90. #xcommand   CLASS MESSAGE <message1> [, <messageN>] ;
  91.                 =>                                  ;
  92.                 clsMkr:method({ { <"message1">, { || <message1>() } } ;
  93.                              [, { <"messageN">, { || <messageN>() } }] }, .t., .f.)
  94.  
  95. #xcommand   CLASS MESSAGE <message> METHOD <method> ;
  96.                 =>                                  ;
  97.                 clsMkr:method({{ <"message">, { || <method>() } }}, .t., .f.)
  98.  
  99. #xcommand   CLASS MESSAGE <message1> [, <messageN>] <def: DEFERRED, NULL>   ;
  100.                 =>                                                          ;
  101.                 clsMkr:method({ { <"message1">, nil }                       ;
  102.                              [, { <"messageN">, nil }] }, .t., .f.)
  103.  
  104. #command    CLASS METHOD <method1> [, <methodN>]   ;
  105.                 =>                                      ;
  106.                 CLASS MESSAGE <method1> [, <methodN>]
  107.  
  108. #command    CLASS METHOD <message> = <method>      ;
  109.                 =>                                      ;
  110.                 CLASS MESSAGE <message> METHOD <method>
  111.  
  112. #command    CLASS METHOD <method1> [, <methodN>] <def: DEFERRED, NULL> ;
  113.                 =>                                                          ;
  114.                 CLASS MESSAGE <method1> [, <methodN>] <def>
  115.  
  116. #command    _CYCTOR <name>([<params,...>])[()]              ;
  117.                 =>                                          ;
  118.                 __cyMethodType procedure <name> (<params>)
  119.  
  120. #command    _CYCTOR ([<params,...>])[()]                    ;
  121.                 =>                                          ;
  122.                 __cyMethodType procedure new (<params>)
  123.  
  124. #command    _CYSUPCTOR ([<params,...>])[()]                 ;
  125.                 =>                                          ;
  126.                 local __csyDummy := qself():super:new(<params>)
  127.  
  128. #command    _CYSUPCTOR <name>([<params,...>])[()]           ;
  129.                 =>                                          ;
  130.                 local __csyDummy := qself():super:<name>(<params>)
  131.  
  132. #command    CONSTRUCTOR <ctor> [, <superCtor> ]     ;
  133.                 =>                                  ;
  134.                 _CYCTOR <ctor>()                    ;;
  135.                 _CYSUPCTOR <superCtor>()            ;;
  136.                 local self := qself()
  137.  
  138. #command    METHOD PROCEDURE <name>             ;
  139.                 =>                              ;
  140.                 __cyMethodType procedure <name> ;;
  141.                 local self := qself()
  142.  
  143. #command    METHOD FUNCTION <name>              ;
  144.                 =>                              ;
  145.                 __cyMethodType function <name>  ;;
  146.                 local self := qself()
  147.  
  148. #define __cyMethodType
  149.  
  150. #translate  ::  =>  self:
  151.  
  152. #translate  @:<methodName>([<param1>] [, <paramN>]) ;
  153.                 =>                                  ;
  154.                 <methodName>(_cyPshSelf(<param1>) [, <paramN>])
  155.  
  156. // eof class(y).ch
  157.