|
|
1 //! @file a68g-parser.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-2026 J. Marcel van der Veer [algol68g@algol68genie.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 //! @section Synopsis 23 //! 24 //! Definitions related to the parser. 25 26 #if !defined (__A68G_PARSER_H__) 27 #define __A68G_PARSER_H__ 28 29 #define STOP_CHAR 127 30 31 BOOL_T dont_mark_here (NODE_T *); 32 BOOL_T is_coercion (NODE_T *); 33 BOOL_T is_firm (MOID_T *, MOID_T *); 34 BOOL_T is_firm (MOID_T *, MOID_T *); 35 BOOL_T is_formal_bounds (NODE_T *); 36 BOOL_T is_loop_keyword (NODE_T *); 37 BOOL_T are_modes_equivalent (MOID_T *, MOID_T *); 38 BOOL_T is_new_lexical_level (NODE_T *); 39 BOOL_T is_one_of (NODE_T * p, ...); 40 BOOL_T is_ref_refety_flex (MOID_T *); 41 BOOL_T is_semicolon_less (NODE_T *); 42 BOOL_T is_subset (MOID_T *, MOID_T *, int); 43 BOOL_T is_unitable (MOID_T *, MOID_T *, int); 44 BOOL_T is_unit_terminator (NODE_T *); 45 BOOL_T lexical_analyser (void); 46 BOOL_T match_string (char *, char *, char); 47 BOOL_T prove_moid_equivalence (MOID_T *, MOID_T *); 48 BOOL_T whether (NODE_T * p, ...); 49 char *phrase_to_text (NODE_T *, NODE_T **); 50 GINFO_T *new_genie_info (void); 51 int count_formal_bounds (NODE_T *); 52 int count_operands (NODE_T *); 53 int count_pack_members (PACK_T *); 54 int first_tag_global (TABLE_T *, char *); 55 int get_good_attribute (NODE_T *); 56 int is_identifier_or_label_global (TABLE_T *, char *); 57 KEYWORD_T *find_keyword_from_attribute (KEYWORD_T *, int); 58 KEYWORD_T *find_keyword (KEYWORD_T *, char *); 59 LINE_T *new_source_line (void); 60 MOID_T *add_mode (MOID_T **, int, int, NODE_T *, MOID_T *, PACK_T *); 61 MOID_T *depref_completely (MOID_T *); 62 MOID_T *get_mode_from_declarer (NODE_T *); 63 MOID_T *new_moid (void); 64 MOID_T *register_extra_mode (MOID_T **, MOID_T *); 65 MOID_T *unites_to (MOID_T *, MOID_T *); 66 NODE_INFO_T *new_node_info (void); 67 NODE_T *get_next_format_pattern (NODE_T *, A68G_REF, BOOL_T); 68 NODE_T *new_node (void); 69 NODE_T *reduce_dyadic (NODE_T *, int u); 70 NODE_T *some_node (char *); 71 NODE_T *top_down_loop (NODE_T *); 72 NODE_T *top_down_skip_unit (NODE_T *); 73 PACK_T *absorb_union_pack (PACK_T *); 74 PACK_T *new_pack (void); 75 TABLE_T *find_level (NODE_T *, int); 76 TABLE_T *new_symbol_table (TABLE_T *); 77 TAG_T *add_tag (TABLE_T *, int, NODE_T *, MOID_T *, int); 78 TAG_T *find_tag_global (TABLE_T *, int, char *); 79 TAG_T *find_tag_local (TABLE_T *, int, const char *); 80 TAG_T *new_tag (void); 81 TOKEN_T *add_token (TOKEN_T **, char *); 82 void a68g_parser (void); 83 void add_mode_to_pack_end (PACK_T **, MOID_T *, char *, NODE_T *); 84 void add_mode_to_pack (PACK_T **, MOID_T *, char *, NODE_T *); 85 void annotate_gc (NODE_T *); 86 void append_source_line (char *, LINE_T **, int *, char *); 87 void assign_offsets (NODE_T *); 88 void assign_offsets_packs (MOID_T *); 89 void assign_offsets_table (TABLE_T *); 90 void bind_format_tags_to_tree (NODE_T *); 91 void bind_routine_tags_to_tree (NODE_T *); 92 void bottom_up_error_check (NODE_T *); 93 void bottom_up_parser (NODE_T *); 94 void check_parenthesis (NODE_T *); 95 void coercion_inserter (NODE_T *); 96 void coercion_inserter (NODE_T *); 97 void collect_taxes (NODE_T *); 98 void contract_union (MOID_T *); 99 void count_pictures (NODE_T *, int *); 100 void elaborate_bold_tags (NODE_T *); 101 void extract_declarations (NODE_T *); 102 void extract_declarations (NODE_T *); 103 void extract_identities (NODE_T *); 104 void extract_indicants (NODE_T *); 105 void extract_labels (NODE_T *, int); 106 void extract_operators (NODE_T *); 107 void extract_priorities (NODE_T *); 108 void extract_proc_identities (NODE_T *); 109 void extract_proc_variables (NODE_T *); 110 void extract_variables (NODE_T *); 111 void fill_symbol_table_outer (NODE_T *, TABLE_T *); 112 void finalise_symbol_table_setup (NODE_T *, int); 113 void free_genie_heap (NODE_T *); 114 void get_max_simplout_size (NODE_T *); 115 void get_refinements (void); 116 void ignore_superfluous_semicolons (NODE_T *); 117 void init_before_tokeniser (void); 118 void init_parser (void); 119 void jumps_from_procs (NODE_T * p); 120 void make_moid_list (MODULE_T *); 121 void make_special_mode (MOID_T **, int); 122 void make_standard_environ (void); 123 void make_sub (NODE_T *, NODE_T *, int); 124 void mark_auxilliary (NODE_T *); 125 void mark_jump_in_par (NODE_T *, BOOL_T); 126 void mark_moids (NODE_T *); 127 void mode_checker (NODE_T *); 128 void mode_checker (NODE_T *); 129 void portcheck (NODE_T *); 130 void preliminary_symbol_table_setup (NODE_T *); 131 void prune_echoes (OPTION_LIST_T *); 132 void put_refinements (void); 133 void rearrange_goto_less_jumps (NODE_T *); 134 void recover_from_error (NODE_T *, int, BOOL_T); 135 void reduce_arguments (NODE_T *); 136 void reduce_basic_declarations (NODE_T *); 137 void reduce_bounds (NODE_T *); 138 void reduce_branch (NODE_T *, int); 139 void reduce_collateral_clauses (NODE_T *); 140 void reduce_declaration_lists (NODE_T *); 141 void reduce_declarers (NODE_T *, int); 142 void reduce_enclosed_clauses (NODE_T *, int); 143 void reduce_enquiry_clauses (NODE_T *); 144 void reduce_erroneous_units (NODE_T *); 145 void reduce_format_texts (NODE_T *); 146 void reduce_formulae (NODE_T *); 147 void reduce_generic_arguments (NODE_T *); 148 void reduce (NODE_T *, void (*)(NODE_T *), BOOL_T *, ...); 149 void reduce_primaries (NODE_T *, int); 150 void reduce_primary_parts (NODE_T *, int); 151 void reduce_right_to_left_constructs (NODE_T * q); 152 void reduce_secondaries (NODE_T *); 153 void reduce_serial_clauses (NODE_T *); 154 void reduce_tertiaries (NODE_T *); 155 void reduce_units (NODE_T *); 156 void register_nodes (NODE_T *); 157 void renumber_moids (MOID_T *, int); 158 void renumber_nodes (NODE_T *, int *); 159 void reset_symbol_table_nest_count (NODE_T *); 160 void scope_checker (NODE_T *); 161 void scope_checker (NODE_T *); 162 void set_moid_sizes (MOID_T *); 163 void set_nest (NODE_T *, NODE_T *); 164 void set_proc_level (NODE_T *, int); 165 void set_up_tables (void); 166 void substitute_brackets (NODE_T *); 167 void tie_label_to_serial (NODE_T *); 168 void tie_label_to_unit (NODE_T *); 169 void top_down_parser (NODE_T *); 170 void verbosity (void); 171 void victal_checker (NODE_T *); 172 void warn_for_unused_tags (NODE_T *); 173 void widen_denotation (NODE_T *); 174 175 #endif
© 2001-2026 J.M. van der Veer
jmvdveer@algol68genie.nl