home *** CD-ROM | disk | FTP | other *** search
- /* Declarations for objc-actions.c.
- Copyright (C) 1990 Free Software Foundation, Inc.
-
- This file is part of GNU CC.
-
- GNU CC is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU CC is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU CC; see the file COPYING. If not, write to
- the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
- /*** Public Interface (procedures) ***/
-
- /* used by compile_file */
-
- extern void init_objc (), finish_objc ();
-
- /* used by yyparse */
-
- extern tree start_class ();
- extern tree continue_class ();
- extern tree finish_class ();
- extern void start_method_def ();
- extern void continue_method_def ();
- extern void finish_method_def ();
- extern tree start_protocol ();
- extern void finish_protocol ();
-
- extern tree is_ivar ();
- extern int is_private ();
- extern int is_public ();
- extern tree add_instance_variable ();
- extern tree add_class_method ();
- extern tree add_instance_method ();
- extern void add_objc_decls ();
- extern tree get_super_receiver ();
- extern tree get_class_ivars ();
- extern tree get_class_reference ();
- extern tree get_static_reference ();
- extern tree get_object_reference ();
-
- extern tree build_message_expr ();
- extern tree build_selector_expr ();
- extern tree build_protocol_expr ();
- extern tree build_ivar_reference ();
- extern tree build_keyword_decl ();
- extern tree build_method_decl ();
- extern tree build_objc_string_object ();
- extern tree build_objc_string ();
-
- extern void objc_declare_class ();
- extern void objc_declare_alias ();
- extern tree is_class_name ();
-
- /* Nonzero enables objc features. */
-
- extern int doing_objc_thang;
-
- /* the following routines are used to implement statically typed objects */
-
- extern tree lookup_interface ();
- extern int objc_comptypes ();
- extern void objc_check_decl ();
-
- /* NeXT extensions */
-
- extern tree build_encode_expr ();
-
- /* used by rest_of_compilation. */
-
- extern void genPrototype ();
-
- /* Used by cplus-lex.c */
-
- extern tree objc_method_context;
- extern tree objc_ivar_chain;
- extern int objc_receiver_context;
-
-
- /* Objective-C structures */
-
- /* KEYWORD_DECL */
- #define KEYWORD_KEY_NAME(DECL) \
- (((struct objc_tree_keyword_decl *)(DECL))->key_name)
- #define KEYWORD_ARG_NAME(DECL) \
- (((struct objc_tree_keyword_decl *)(DECL))->arg_name)
-
- /* INSTANCE_METHOD_DECL, CLASS_METHOD_DECL */
- #define METHOD_FILENAME(DECL) \
- (((struct objc_tree_method_decl *)(DECL))->filename)
- #define METHOD_LINENUM(DECL) \
- (((struct objc_tree_method_decl *)(DECL))->linenum)
- #define METHOD_SEL_NAME(DECL) \
- (((struct objc_tree_method_decl *)(DECL))->sel_name)
- #define METHOD_SEL_ARGS(DECL) \
- (((struct objc_tree_method_decl *)(DECL))->sel_args)
- #define METHOD_ADD_ARGS(DECL) \
- (((struct objc_tree_method_decl *)(DECL))->add_args)
- #define METHOD_DEFINITION(DECL) \
- (((struct objc_tree_method_decl *)(DECL))->mth_defn)
- #define METHOD_ENCODING(DECL) \
- (((struct objc_tree_method_decl *)(DECL))->encode_types)
-
- /* CLASS_INTERFACE, CLASS_IMPLEMENTATION,
- CATEGORY_INTERFACE, CATEGORY_IMPLEMENTATION,
- PROTOCOL_INTERFACE */
- #define CLASS_NAME(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->my_name)
- #define CLASS_SUPER_NAME(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->super_name)
- #define CLASS_IVARS(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->ivar_decls)
- #define CLASS_RAW_IVARS(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->raw_ivars)
- #define CLASS_NST_METHODS(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->nst_method_chain)
- #define CLASS_CLS_METHODS(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->cls_method_chain)
- #define CLASS_STATIC_TEMPLATE(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->static_template)
- #define CLASS_CATEGORY_LIST(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->category_list)
- #define CLASS_PROTOCOL_LIST(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->protocol_list)
- #define PROTOCOL_NAME(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->my_name)
- #define PROTOCOL_LIST(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->super_name)
- #define PROTOCOL_NST_METHODS(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->nst_method_chain)
- #define PROTOCOL_CLS_METHODS(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->cls_method_chain)
- #define PROTOCOL_FORWARD_DECL(CLASS) \
- (((struct objc_tree_class_type *)(CLASS))->static_template)
-
- #ifdef OBJCPLUS
- #define TYPE_PROTOCOL_LIST(TYPE) ((TYPE)->type.protocol_list)
- #else /* OBJCPLUS */
- #define TYPE_PROTOCOL_LIST(TYPE) ((tree) TYPE_LANG_SPECIFIC (TYPE))
- #endif /* OBJCPLUS */
-
- /* Define the Objective-C language-specific tree codes. */
-
- #ifdef OBJCPLUS
- #define FIRST_OBJC_TREE_CODE LAST_CPLUS_TREE_CODE
- #else /* OBJCPLUS */
- #define FIRST_OBJC_TREE_CODE LAST_AND_UNUSED_TREE_CODE
- #endif /* OBJCPLUS */
-
- #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
- enum objc_tree_code {
- dummy_tree_code = FIRST_OBJC_TREE_CODE,
- #include "objc-tree.def"
- LAST_OBJC_TREE_CODE
- };
- #undef DEFTREECODE
-