home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Source / GNU / cc / cc / objc-actions.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-18  |  3.9 KB  |  136 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. void init_objc (), finish_objc ();
  26.  
  27. /* used by yyparse */
  28.  
  29. tree start_class ();
  30. tree continue_class ();
  31. void finish_class ();
  32. void start_method_def ();
  33. void continue_method_def ();
  34. void finish_method_def ();
  35. tree start_protocol ();
  36. void finish_protocol ();
  37. void add_objc_decls ();
  38.  
  39. tree is_ivar ();
  40. int  is_public ();
  41. tree add_instance_variable ();
  42. tree add_class_method ();
  43. tree add_instance_method ();
  44. tree get_super_receiver ();
  45. tree get_class_ivars ();
  46. tree get_class_reference ();
  47. tree get_static_reference ();
  48. tree get_object_reference ();
  49.  
  50. tree build_message_expr ();
  51. tree build_selector_expr ();
  52. tree build_ivar_reference ();
  53. tree build_keyword_decl ();
  54. tree build_method_decl ();
  55. tree build_protocol_expr ();
  56. tree build_objc_string_object ();
  57.  
  58. extern tree objc_ivar_chain;
  59. extern tree objc_method_context;
  60.  
  61. void objc_declare_class ();
  62. void objc_declare_alias ();
  63. tree is_class_name ();
  64.  
  65. /* Nonzero enables objc features.  */
  66.  
  67. extern int doing_objc_thang;
  68. extern int objc_receiver_context;
  69.  
  70. /* the following routines are used to implement statically typed objects */
  71.  
  72. tree lookup_interface ();
  73. int  objc_comptypes ();
  74. void objc_check_decl ();
  75.  
  76. /* NeXT extensions */
  77.  
  78. tree build_encode_expr ();
  79.  
  80. /* used by rest_of_compilation.  */
  81.  
  82. void genPrototype ();
  83.  
  84. /* Objective-C structures */
  85.  
  86. /* KEYWORD_DECL */
  87. #define KEYWORD_KEY_NAME(DECL) ((DECL)->decl.name)
  88. #define KEYWORD_ARG_NAME(DECL) ((DECL)->decl.arguments)
  89.  
  90. /* INSTANCE_METHOD_DECL, CLASS_METHOD_DECL */
  91. #define METHOD_SEL_NAME(DECL) ((DECL)->decl.name)
  92. #define METHOD_SEL_ARGS(DECL) ((DECL)->decl.arguments)
  93. #define METHOD_ADD_ARGS(DECL) ((DECL)->decl.result)
  94. #define METHOD_DEFINITION(DECL) ((DECL)->decl.initial)
  95. #define METHOD_ENCODING(DECL) ((DECL)->decl.context)
  96.  
  97. /*
  98.  * CLASS_INTERFACE_TYPE, CLASS_IMPLEMENTATION_TYPE,
  99.  * CATEGORY_INTERFACE_TYPE, CATEGORY_IMPLEMENTATION_TYPE,
  100.  * PROTOCOL_INTERFACE_TYPE
  101.  */
  102. #define CLASS_NAME(CLASS) ((CLASS)->type.name)
  103. #define CLASS_SUPER_NAME(CLASS) ((CLASS)->type.binfo)
  104. #define CLASS_IVARS(CLASS) ((CLASS)->type.maxval)
  105. #define CLASS_RAW_IVARS(CLASS) ((CLASS)->type.noncopied_parts)
  106. #define CLASS_NST_METHODS(CLASS) ((CLASS)->type.instance_methods)
  107. #define CLASS_CLS_METHODS(CLASS) ((CLASS)->type.class_methods)
  108. #define CLASS_STATIC_TEMPLATE(CLASS) ((CLASS)->type.context)
  109. #define CLASS_CATEGORY_LIST(CLASS) ((CLASS)->type.minval)
  110. #define CLASS_PROTOCOL_LIST(CLASS) ((CLASS)->type.protocol_list)
  111. #define PROTOCOL_NAME(CLASS) ((CLASS)->type.name)
  112. #define PROTOCOL_LIST(CLASS) ((CLASS)->type.binfo)
  113. #define PROTOCOL_NST_METHODS(CLASS) ((CLASS)->type.instance_methods)
  114. #define PROTOCOL_CLS_METHODS(CLASS) ((CLASS)->type.class_methods)
  115. #define PROTOCOL_FORWARD_DECL(CLASS) ((CLASS)->type.context)
  116. #define TYPE_PROTOCOL_LIST(TYPE) ((TYPE)->type.protocol_list)
  117.  
  118. /* Define the Objective-C language-specific tree codes.  */
  119.  
  120. #ifdef OBJCPLUS
  121. #include "cp-tree.h"
  122. #endif
  123.  
  124. #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
  125. enum objc_tree_code {
  126. #ifdef OBJCPLUS
  127.   dummy_tree_code = LAST_CPLUS_TREE_CODE,
  128. #else
  129.   dummy_tree_code = LAST_AND_UNUSED_TREE_CODE,
  130. #endif
  131.  
  132. #include "objc-tree.def"
  133.   LAST_OBJC_TREE_CODE
  134. };
  135. #undef DEFTREECODE
  136.