home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cplusplus-8 / objc-actions.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-07  |  5.2 KB  |  166 lines

  1. /* Declarations for objc-actions.c.
  2.    Copyright (C) 1990 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20.  
  21. /*** Public Interface (procedures) ***/
  22.  
  23. /* used by compile_file */
  24.  
  25. extern void init_objc (), finish_objc ();
  26.  
  27. /* used by yyparse */
  28.  
  29. extern tree start_class ();
  30. extern tree continue_class ();
  31. extern tree finish_class ();
  32. extern void start_method_def ();
  33. extern void continue_method_def ();
  34. extern void finish_method_def ();
  35. extern tree start_protocol ();
  36. extern void finish_protocol ();
  37.  
  38. extern tree is_ivar ();
  39. extern int  is_private ();
  40. extern int  is_public ();
  41. extern tree add_instance_variable ();
  42. extern tree add_class_method ();
  43. extern tree add_instance_method ();
  44. extern void add_objc_decls ();
  45. extern tree get_super_receiver ();
  46. extern tree get_class_ivars ();
  47. extern tree get_class_reference ();
  48. extern tree get_static_reference ();
  49. extern tree get_object_reference ();
  50.  
  51. extern tree build_message_expr ();
  52. extern tree build_selector_expr ();
  53. extern tree build_protocol_expr ();
  54. extern tree build_ivar_reference ();
  55. extern tree build_keyword_decl ();
  56. extern tree build_method_decl ();
  57. extern tree build_objc_string_object ();
  58. extern tree build_objc_string ();
  59.  
  60. extern void objc_declare_class ();
  61. extern void objc_declare_alias ();
  62. extern tree is_class_name ();
  63.  
  64. /* Nonzero enables objc features.  */
  65.  
  66. extern int doing_objc_thang;
  67.  
  68. /* the following routines are used to implement statically typed objects */
  69.  
  70. extern tree lookup_interface ();
  71. extern int  objc_comptypes ();
  72. extern void objc_check_decl ();
  73.  
  74. /* NeXT extensions */
  75.  
  76. extern tree build_encode_expr ();
  77.  
  78. /* used by rest_of_compilation.  */
  79.  
  80. extern void genPrototype ();
  81.  
  82. /* Used by cplus-lex.c */
  83.  
  84. extern tree objc_method_context;
  85. extern tree objc_ivar_chain;
  86. extern int objc_receiver_context;
  87.  
  88.  
  89. /* Objective-C structures */
  90.  
  91. /* KEYWORD_DECL */
  92. #define KEYWORD_KEY_NAME(DECL) \
  93.     (((struct objc_tree_keyword_decl *)(DECL))->key_name)
  94. #define KEYWORD_ARG_NAME(DECL) \
  95.     (((struct objc_tree_keyword_decl *)(DECL))->arg_name)
  96.  
  97. /* INSTANCE_METHOD_DECL, CLASS_METHOD_DECL */
  98. #define METHOD_FILENAME(DECL) \
  99.     (((struct objc_tree_method_decl *)(DECL))->filename)
  100. #define METHOD_LINENUM(DECL) \
  101.     (((struct objc_tree_method_decl *)(DECL))->linenum)
  102. #define METHOD_SEL_NAME(DECL) \
  103.     (((struct objc_tree_method_decl *)(DECL))->sel_name)
  104. #define METHOD_SEL_ARGS(DECL) \
  105.     (((struct objc_tree_method_decl *)(DECL))->sel_args)
  106. #define METHOD_ADD_ARGS(DECL) \
  107.     (((struct objc_tree_method_decl *)(DECL))->add_args)
  108. #define METHOD_DEFINITION(DECL) \
  109.     (((struct objc_tree_method_decl *)(DECL))->mth_defn)
  110. #define METHOD_ENCODING(DECL) \
  111.     (((struct objc_tree_method_decl *)(DECL))->encode_types)
  112.  
  113. /* CLASS_INTERFACE, CLASS_IMPLEMENTATION,
  114.    CATEGORY_INTERFACE, CATEGORY_IMPLEMENTATION,
  115.    PROTOCOL_INTERFACE */
  116. #define CLASS_NAME(CLASS) \
  117.     (((struct objc_tree_class_type *)(CLASS))->my_name)
  118. #define CLASS_SUPER_NAME(CLASS) \
  119.     (((struct objc_tree_class_type *)(CLASS))->super_name)
  120. #define CLASS_IVARS(CLASS) \
  121.     (((struct objc_tree_class_type *)(CLASS))->ivar_decls)
  122. #define CLASS_RAW_IVARS(CLASS) \
  123.     (((struct objc_tree_class_type *)(CLASS))->raw_ivars)
  124. #define CLASS_NST_METHODS(CLASS) \
  125.     (((struct objc_tree_class_type *)(CLASS))->nst_method_chain)
  126. #define CLASS_CLS_METHODS(CLASS) \
  127.     (((struct objc_tree_class_type *)(CLASS))->cls_method_chain)
  128. #define CLASS_STATIC_TEMPLATE(CLASS) \
  129.     (((struct objc_tree_class_type *)(CLASS))->static_template)
  130. #define CLASS_CATEGORY_LIST(CLASS) \
  131.     (((struct objc_tree_class_type *)(CLASS))->category_list)
  132. #define CLASS_PROTOCOL_LIST(CLASS) \
  133.     (((struct objc_tree_class_type *)(CLASS))->protocol_list)
  134. #define PROTOCOL_NAME(CLASS) \
  135.     (((struct objc_tree_class_type *)(CLASS))->my_name)
  136. #define PROTOCOL_LIST(CLASS) \
  137.     (((struct objc_tree_class_type *)(CLASS))->super_name)
  138. #define PROTOCOL_NST_METHODS(CLASS) \
  139.     (((struct objc_tree_class_type *)(CLASS))->nst_method_chain)
  140. #define PROTOCOL_CLS_METHODS(CLASS) \
  141.     (((struct objc_tree_class_type *)(CLASS))->cls_method_chain)
  142. #define PROTOCOL_FORWARD_DECL(CLASS) \
  143.     (((struct objc_tree_class_type *)(CLASS))->static_template)
  144.  
  145. #ifdef OBJCPLUS
  146. #define TYPE_PROTOCOL_LIST(TYPE) ((TYPE)->type.protocol_list)
  147. #else /* OBJCPLUS */
  148. #define TYPE_PROTOCOL_LIST(TYPE) ((tree) TYPE_LANG_SPECIFIC (TYPE))
  149. #endif /* OBJCPLUS */
  150.  
  151. /* Define the Objective-C language-specific tree codes.  */
  152.  
  153. #ifdef OBJCPLUS
  154. #define FIRST_OBJC_TREE_CODE LAST_CPLUS_TREE_CODE
  155. #else /* OBJCPLUS */
  156. #define FIRST_OBJC_TREE_CODE LAST_AND_UNUSED_TREE_CODE
  157. #endif /* OBJCPLUS */
  158.  
  159. #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
  160. enum objc_tree_code {
  161.   dummy_tree_code = FIRST_OBJC_TREE_CODE,
  162. #include "objc-tree.def"
  163.   LAST_OBJC_TREE_CODE
  164. };
  165. #undef DEFTREECODE
  166.