a68g-moids.h

     
   1  //! @file a68g-moids.h
   2  //! @author J. Marcel van der Veer
   3  //!
   4  //! @section Copyright
   5  //!
   6  //! This file is part of Algol68G - an Algol 68 compiler-interpreter.
   7  //! Copyright 2001-2023 J. Marcel van der Veer [algol68g@xs4all.nl].
   8  //!
   9  //! @section License
  10  //!
  11  //! This program is free software; you can redistribute it and/or modify it 
  12  //! under the terms of the GNU General Public License as published by the 
  13  //! Free Software Foundation; either version 3 of the License, or 
  14  //! (at your option) any later version.
  15  //!
  16  //! This program is distributed in the hope that it will be useful, but 
  17  //! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
  18  //! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
  19  //! more details. You should have received a copy of the GNU General Public 
  20  //! License along with this program. If not, see [http://www.gnu.org/licenses/].
  21  
  22  #if !defined (__A68G_MOIDS_H__)
  23  #define __A68G_MOIDS_H__
  24  
  25  BOOL_T basic_coercions (MOID_T *, MOID_T *, int, int);
  26  BOOL_T clause_allows_balancing (int);
  27  BOOL_T is_balanced (NODE_T *, SOID_T *, int);
  28  BOOL_T is_coercible_in_context (SOID_T *, SOID_T *, int);
  29  BOOL_T is_coercible (MOID_T *, MOID_T *, int, int);
  30  BOOL_T is_coercible_series (MOID_T *, MOID_T *, int, int);
  31  BOOL_T is_coercible_stowed (MOID_T *, MOID_T *, int, int);
  32  BOOL_T is_deprefable (MOID_T *);
  33  BOOL_T is_equal_modes (MOID_T *, MOID_T *, int);
  34  BOOL_T is_firmly_coercible (MOID_T *, MOID_T *, int);
  35  BOOL_T is_firm (MOID_T *, MOID_T *);
  36  BOOL_T is_meekly_coercible (MOID_T *, MOID_T *, int);
  37  BOOL_T is_mode_isnt_well (MOID_T *);
  38  BOOL_T is_moid_in_pack (MOID_T *, PACK_T *, int);
  39  BOOL_T is_name_struct (MOID_T *);
  40  BOOL_T is_nonproc (MOID_T *);
  41  BOOL_T is_printable_mode (MOID_T *);
  42  BOOL_T is_proc_ref_file_void_or_format (MOID_T *);
  43  BOOL_T is_readable_mode (MOID_T *);
  44  BOOL_T is_ref_row (MOID_T *);
  45  BOOL_T is_rows_type (MOID_T *);
  46  BOOL_T is_softly_coercible (MOID_T *, MOID_T *, int);
  47  BOOL_T is_strongly_coercible (MOID_T *, MOID_T *, int);
  48  BOOL_T is_strong_name (MOID_T *, MOID_T *);
  49  BOOL_T is_strong_slice (MOID_T *, MOID_T *);
  50  BOOL_T is_subset (MOID_T *, MOID_T *, int);
  51  BOOL_T is_transput_mode (MOID_T *, char);
  52  BOOL_T is_unitable (MOID_T *, MOID_T *, int);
  53  BOOL_T is_weakly_coercible (MOID_T *, MOID_T *, int);
  54  BOOL_T is_widenable (MOID_T *, MOID_T *);
  55  char *mode_error_text (NODE_T *, MOID_T *, MOID_T *, int, int, int);
  56  MOID_T *absorb_related_subsets (MOID_T *);
  57  MOID_T *depref_completely (MOID_T *);
  58  MOID_T *depref_once (MOID_T *);
  59  MOID_T *depref_rows (MOID_T *, MOID_T *);
  60  MOID_T *deproc_completely (MOID_T *);
  61  MOID_T *derow (MOID_T *);
  62  MOID_T *determine_unique_mode (SOID_T *, int);
  63  MOID_T *get_balanced_mode (MOID_T *, int, BOOL_T, int);
  64  MOID_T *make_series_from_moids (MOID_T *, MOID_T *);
  65  MOID_T *make_united_mode (MOID_T *);
  66  MOID_T *pack_soids_in_moid (SOID_T *, int);
  67  MOID_T *unites_to (MOID_T *, MOID_T *);
  68  MOID_T *widens_to (MOID_T *, MOID_T *);
  69  void absorb_series_pack (MOID_T **);
  70  void absorb_series_union_pack (MOID_T **);
  71  void add_to_soid_list (SOID_T **, NODE_T *, SOID_T *);
  72  void cannot_coerce (NODE_T *, MOID_T *, MOID_T *, int, int, int);
  73  void coerce_enclosed (NODE_T *, SOID_T *);
  74  void coerce_formula (NODE_T *, SOID_T *);
  75  void coerce_operand (NODE_T *, SOID_T *);
  76  void coerce_unit (NODE_T *, SOID_T *);
  77  void free_soid_list (SOID_T *);
  78  void investigate_firm_relations (PACK_T *, PACK_T *, BOOL_T *, BOOL_T *);
  79  void make_coercion (NODE_T *, int, MOID_T *);
  80  void make_depreffing_coercion (NODE_T *, MOID_T *, MOID_T *);
  81  void make_ref_rowing_coercion (NODE_T *, MOID_T *, MOID_T *);
  82  void make_rowing_coercion (NODE_T *, MOID_T *, MOID_T *);
  83  void make_soid (SOID_T *, int, MOID_T *, int);
  84  void make_strong (NODE_T *, MOID_T *, MOID_T *);
  85  void make_uniting_coercion (NODE_T *, MOID_T *);
  86  void make_void (NODE_T *, MOID_T *);
  87  void make_widening_coercion (NODE_T *, MOID_T *, MOID_T *);
  88  void mode_check_enclosed (NODE_T *, SOID_T *, SOID_T *);
  89  void mode_check_formula (NODE_T *, SOID_T *, SOID_T *);
  90  void mode_check_unit (NODE_T *, SOID_T *, SOID_T *);
  91  void semantic_pitfall (NODE_T *, MOID_T *, int, int);
  92  void warn_for_voiding (NODE_T *, SOID_T *, SOID_T *, int);
  93  
  94  #define DEPREF A68_TRUE
  95  #define NO_DEPREF A68_FALSE
  96  
  97  #define IF_MODE_IS_WELL(n) (! ((n) == M_ERROR || (n) == M_UNDEFINED))
  98  #define INSERT_COERCIONS(n, p, q) make_strong ((n), (p), MOID (q))
  99  
 100  #endif