home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cc-61.0.1 / cc / c-tree.h < prev    next >
C/C++ Source or Header  |  1991-06-04  |  8KB  |  231 lines

  1. /* Definitions for C parsing and type checking.
  2.    Copyright (C) 1987 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. /* Language-dependent contents of an identifier.  */
  21.  
  22. struct lang_identifier
  23. {
  24.   struct tree_identifier ignore;
  25.   tree global_value, local_value, label_value, implicit_decl;
  26.   tree error_locus;
  27. };
  28.  
  29. /* Macros for access to language-specific slots in an identifier.  */
  30.  
  31. #define IDENTIFIER_GLOBAL_VALUE(NODE)    \
  32.   (((struct lang_identifier *)(NODE))->global_value)
  33. #define IDENTIFIER_LOCAL_VALUE(NODE)    \
  34.   (((struct lang_identifier *)(NODE))->local_value)
  35. #define IDENTIFIER_LABEL_VALUE(NODE)    \
  36.   (((struct lang_identifier *)(NODE))->label_value)
  37. #define IDENTIFIER_IMPLICIT_DECL(NODE)    \
  38.   (((struct lang_identifier *)(NODE))->implicit_decl)
  39. #define IDENTIFIER_ERROR_LOCUS(NODE)    \
  40.   (((struct lang_identifier *)(NODE))->error_locus)
  41.  
  42. /* In identifiers, C uses the following fields in a special way:
  43.    TREE_PUBLIC        to record that there was a previous local extern decl.
  44.    TREE_USED          to record that such a decl was used.
  45.    TREE_ADDRESSABLE   to record that the address of such a decl was used.  */
  46.  
  47. /* Nonzero means reject anything that ANSI standard C forbids.  */
  48. extern int pedantic;
  49.  
  50. /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only.  */
  51. #define C_TYPE_FIELDS_READONLY(type) TREE_LANG_FLAG_1 (type)
  52.  
  53. /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is volatile.  */
  54. #define C_TYPE_FIELDS_VOLATILE(type) TREE_LANG_FLAG_2 (type)
  55.  
  56. /* In a RECORD_TYPE or UNION_TYPE or ENUMERAL_TYPE
  57.    nonzero if the definition of the type has already started.  */
  58. #define C_TYPE_BEING_DEFINED(type) TYPE_LANG_FLAG_0 (type)
  59.  
  60. /* Mark which labels are explicitly declared.
  61.    These may be shadowed, and may be referenced from nested functions.  */
  62. #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
  63.  
  64. /* Record whether a type or decl was written with nonconstant size.
  65.    Note that TYPE_SIZE may have simplified to a constant.  */
  66. #define C_TYPE_VARIABLE_SIZE(type) TYPE_LANG_FLAG_1 (type)
  67. #define C_DECL_VARIABLE_SIZE(type) DECL_LANG_FLAG_0 (type)
  68.  
  69. /* Record in each node resulting from a binary operator
  70.    what operator was specified for it.  */
  71. #define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp))
  72.  
  73. /* Store a value in that field.  */
  74. #define C_SET_EXP_ORIGINAL_CODE(exp, code) \
  75.   (TREE_COMPLEXITY (exp) = (int)(code))
  76.  
  77. /* Record whether a typedef for type `int' was actually `signed int'.  */
  78. #define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
  79.  
  80. /* in c-typecheck.c */
  81. extern tree build_component_ref (), build_conditional_expr (), build_compound_expr ();
  82. extern tree build_unary_op (), build_binary_op (), build_function_call ();
  83. extern tree build_binary_op_nodefault ();
  84. extern tree parser_build_binary_op ();
  85. extern tree build_indirect_ref (), build_array_ref (), build_c_cast ();
  86. extern tree build_modify_expr ();
  87. extern tree c_sizeof (), c_alignof (), c_alignof_expr ();
  88. extern void store_init_value ();
  89. extern tree digest_init ();
  90. extern tree c_expand_start_case ();
  91. extern tree default_conversion ();
  92.  
  93. /* Given two integer or real types, return the type for their sum.
  94.    Given two compatible ANSI C types, returns the merged type.  */
  95.  
  96. extern tree common_type ();
  97.  
  98. /* in c-decl.c */
  99. extern tree build_label ();
  100.  
  101. extern int start_function ();
  102. extern void finish_function ();
  103. extern void store_parm_decls ();
  104. extern tree get_parm_info ();
  105.  
  106. extern void pushlevel ();
  107. extern tree poplevel ();
  108.  
  109. extern tree groktypename (), lookup_name ();
  110.  
  111. extern tree lookup_label (), define_label (), shadow_label ();
  112.  
  113. extern tree implicitly_declare (), getdecls (), gettags ();
  114.  
  115. extern tree start_decl ();
  116. extern void finish_decl ();
  117.  
  118. extern tree start_struct (), finish_struct (), xref_tag ();
  119. extern tree grokfield ();
  120.  
  121. extern tree start_enum (), finish_enum ();
  122. extern tree build_enumerator ();
  123.  
  124. extern tree make_index_type ();
  125.  
  126. /* Add qualifiers to a type, in the fashion for C.  */
  127. extern tree c_build_type_variant ();
  128.  
  129. /* Functions in c-common.c: */
  130.  
  131. /* Concatenate a list of STRING_CST nodes into one STRING_CST.  */
  132. extern tree combine_strings ();
  133.  
  134. /* Validate the expression after `case' and apply default promotions.  */
  135. extern tree check_case_value ();
  136.  
  137. /* Print an error message for invalid operands to arith operation CODE.
  138.    NOP_EXPR is used as a special case (see truthvalue_conversion).  */
  139.  
  140. extern void binary_op_error ();
  141.  
  142. /* Subroutine of build_binary_op_nodefault, used for comparison operations.
  143.    See if the operands have both been converted from subword integer types
  144.    and, if so, perhaps change them both back to their original type.  */
  145.  
  146. extern tree shorten_compare ();
  147.  
  148. extern tree short_integer_type_node, integer_type_node;
  149. extern tree long_integer_type_node, long_long_integer_type_node;
  150. extern tree short_unsigned_type_node, unsigned_type_node;
  151. extern tree long_unsigned_type_node, long_long_unsigned_type_node;
  152. extern tree ptrdiff_type_node;
  153. extern tree unsigned_char_type_node, signed_char_type_node, char_type_node;
  154. extern tree wchar_type_node, signed_wchar_type_node, unsigned_wchar_type_node;
  155. extern tree float_type_node, double_type_node, long_double_type_node;
  156. extern tree void_type_node, ptr_type_node, const_ptr_type_node;
  157. extern tree string_type_node, const_string_type_node;
  158. extern tree char_array_type_node, int_array_type_node, wchar_array_type_node;
  159. extern tree default_function_type;
  160. extern tree double_ftype_double, double_ftype_double_double;
  161. extern tree int_ftype_int, long_ftype_long;
  162. extern tree void_ftype_ptr_ptr_int, int_ftype_ptr_ptr_int;
  163. extern tree void_ftype_ptr_int_int, string_ftype_ptr_ptr;
  164. extern tree int_ftype_string_string, int_ftype_cptr_cptr_sizet;
  165.  
  166. extern int current_function_returns_value;
  167. extern int current_function_returns_null;
  168.  
  169. extern tree ridpointers[];
  170.  
  171. /* Nonzero means `$' can be in an identifier.  */
  172.  
  173. extern int dollars_in_ident;
  174.  
  175. /* Nonzero means allow type mismatches in conditional expressions;
  176.    just make their values `void'.   */
  177.  
  178. extern int flag_cond_mismatch;
  179.  
  180. /* Nonzero means don't recognize the keyword `asm'.  */
  181.  
  182. extern int flag_no_asm;
  183.  
  184. /* Nonzero means warn about implicit declarations.  */
  185.  
  186. extern int warn_implicit;
  187.  
  188. /* Nonzero means give string constants the type `const char *'
  189.    to get extra warnings from them.  These warnings will be too numerous
  190.    to be useful, except in thoroughly ANSIfied programs.  */
  191.  
  192. extern int warn_write_strings;
  193.  
  194. /* Nonzero means warn about sizeof (function) or addition/subtraction
  195.    of function pointers.  */
  196.  
  197. extern int warn_pointer_arith;
  198.  
  199. /* Nonzero means warn for all old-style non-prototype function decls.  */
  200.  
  201. extern int warn_strict_prototypes;
  202.  
  203. /* Nonzero means warn about pointer casts that can drop a type qualifier
  204.    from the pointer target type.  */
  205.  
  206. extern int warn_cast_qual;
  207.  
  208. /* Warn about traditional constructs whose meanings changed in ANSI C.  */
  209.  
  210. extern int warn_traditional;
  211.  
  212. /* Warn about *printf or *scanf format/argument anomalies. */
  213.  
  214. extern int warn_format;
  215.  
  216. /* Warn if a type conversion is done that might have confusing results.  */
  217.  
  218. extern int warn_conversion;
  219.  
  220. /* Nonzero means do some things the same way PCC does.  */
  221.  
  222. extern int flag_traditional;
  223.  
  224. /* Nonzero means this is a function to call to perform comptypes
  225.    on two record types.  */
  226.  
  227. extern int (*comptypes_record_hook) ();
  228.  
  229. extern int maybe_objc_comptypes ();
  230. extern tree maybe_building_objc_message_expr ();
  231.