home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / gcc / objc-act.h < prev    next >
C/C++ Source or Header  |  1996-02-07  |  5KB  |  134 lines

  1. /* Declarations for objc-act.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, 59 Temple Place - Suite 330,
  19. Boston, MA 02111-1307, USA.  */
  20.  
  21.  
  22. /*** Public Interface (procedures) ***/
  23.  
  24. /* used by yyparse */
  25.  
  26. void finish_file                PROTO((void));
  27. tree start_class                PROTO((enum tree_code, tree, tree, tree));
  28. tree continue_class                PROTO((tree));
  29. void finish_class                PROTO((tree));
  30. void start_method_def                PROTO((tree));
  31. void continue_method_def            PROTO((void));
  32. void finish_method_def                PROTO((void));
  33. tree start_protocol                PROTO((enum tree_code, tree, tree));
  34. void finish_protocol                PROTO((tree));
  35. void add_objc_decls                PROTO((void));
  36.  
  37. tree is_ivar                    PROTO((tree, tree));
  38. int is_private                    PROTO((tree));
  39. int is_public                    PROTO((tree, tree));
  40. tree add_instance_variable            PROTO((tree, int, tree, tree, tree));
  41. tree add_class_method                PROTO((tree, tree));
  42. tree add_instance_method            PROTO((tree, tree));
  43. tree get_super_receiver                PROTO((void));
  44. tree get_class_ivars                PROTO((tree));
  45. tree get_class_reference            PROTO((tree));
  46. tree get_static_reference            PROTO((tree, tree));
  47. tree get_object_reference            PROTO((tree));
  48. tree build_message_expr                PROTO((tree));
  49. tree build_selector_expr            PROTO((tree));
  50. tree build_ivar_reference            PROTO((tree));
  51. tree build_keyword_decl                PROTO((tree, tree, tree));
  52. tree build_method_decl                PROTO((enum tree_code, tree, tree, tree, tree));
  53. tree build_protocol_expr            PROTO((tree));
  54. tree build_objc_string_object            PROTO((tree));
  55. tree lookup_interface                PROTO((tree));
  56. tree lookup_name_type                PROTO((tree));
  57.  
  58. extern tree objc_ivar_chain;
  59. extern tree objc_method_context;
  60.  
  61. void objc_declare_alias                PROTO((tree, tree));
  62. void objc_declare_class                PROTO((tree));
  63.  
  64. extern int objc_receiver_context;
  65.  
  66. /* the following routines are used to implement statically typed objects */
  67.  
  68. int objc_comptypes                PROTO((tree, tree, int));
  69. void objc_check_decl                PROTO((tree));
  70.  
  71. /* NeXT extensions */
  72.  
  73. tree build_encode_expr                PROTO((tree));
  74.  
  75. /* Objective-C structures */
  76.  
  77. /* KEYWORD_DECL */
  78. #define KEYWORD_KEY_NAME(DECL) ((DECL)->decl.name)
  79. #define KEYWORD_ARG_NAME(DECL) ((DECL)->decl.arguments)
  80.  
  81. /* INSTANCE_METHOD_DECL, CLASS_METHOD_DECL */
  82. #define METHOD_SEL_NAME(DECL) ((DECL)->decl.name)
  83. #define METHOD_SEL_ARGS(DECL) ((DECL)->decl.arguments)
  84. #define METHOD_ADD_ARGS(DECL) ((DECL)->decl.result)
  85. #define METHOD_DEFINITION(DECL) ((DECL)->decl.initial)
  86. #define METHOD_ENCODING(DECL) ((DECL)->decl.context)
  87.  
  88. #if defined(NEXT_SEMANTICS) || defined(NEXT_PDO)
  89. #define DIRECT_METHOD_FLAG(DECL) DECL_LANG_FLAG_2(DECL)
  90. #define STATIC_METHOD_FLAG(DECL) DECL_LANG_FLAG_3(DECL)
  91. #define INLINE_METHOD_FLAG(DECL) DECL_LANG_FLAG_4(DECL)
  92. #define METHOD_ORIGIN(DECL) ((DECL)->decl.abstract_origin)
  93. #endif /* NEXT_SEMANTICS */
  94.  
  95. /* CLASS_INTERFACE_TYPE, CLASS_IMPLEMENTATION_TYPE,
  96.    CATEGORY_INTERFACE_TYPE, CATEGORY_IMPLEMENTATION_TYPE,
  97.    PROTOCOL_INTERFACE_TYPE */
  98. #define CLASS_NAME(CLASS) ((CLASS)->type.name)
  99. #define CLASS_SUPER_NAME(CLASS) ((CLASS)->type.context)
  100. #define CLASS_IVARS(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 0)
  101. #define CLASS_RAW_IVARS(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 1)
  102. #define CLASS_NST_METHODS(CLASS) ((CLASS)->type.minval)
  103. #define CLASS_CLS_METHODS(CLASS) ((CLASS)->type.maxval)
  104. #define CLASS_STATIC_TEMPLATE(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 2)
  105. #define CLASS_CATEGORY_LIST(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 3)
  106. #define CLASS_PROTOCOL_LIST(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 4)
  107. #define PROTOCOL_NAME(CLASS) ((CLASS)->type.name)
  108. #define PROTOCOL_LIST(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 0)
  109. #define PROTOCOL_NST_METHODS(CLASS) ((CLASS)->type.minval)
  110. #define PROTOCOL_CLS_METHODS(CLASS) ((CLASS)->type.maxval)
  111. #define PROTOCOL_FORWARD_DECL(CLASS) TREE_VEC_ELT (TYPE_BINFO (CLASS), 1)
  112. #define PROTOCOL_DEFINED(CLASS) TREE_USED (CLASS)
  113. #define TYPE_PROTOCOL_LIST(TYPE) ((TYPE)->type.context)
  114.  
  115. /* Define the Objective-C or Objective-C++ language-specific tree codes.  */
  116.  
  117. /* this requires tree.h and if C++ also cp-tree.h to be included already. */
  118.  
  119. #define OBJC_TREE_CODES
  120. #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
  121. enum objc_tree_code {
  122.   __OBJC_DUMMY =
  123. #ifdef OBJCPLUS
  124.     LAST_CPLUS_TREE_CODE,
  125. #else
  126.     LAST_AND_UNUSED_TREE_CODE,
  127. #endif
  128. #include "objc-tree.def"
  129.   LAST_OBJC_TREE_CODE
  130. };
  131. #undef DEFTREECODE
  132.  
  133.  
  134.