PIPS
|
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include "genC.h"
#include "linear.h"
#include "misc.h"
#include "properties.h"
#include "pipsdbm.h"
#include "text-util.h"
#include "ri-util.h"
#include "prettyprint.h"
Go to the source code of this file.
Macros | |
#define | NL "\n" |
Functions | |
static string | check_derived_and_typedef (basic b, int indent, const char *parent) |
static string | entities_type_and_name (list entities, int indent, const char *parent) |
void | dump_common_layout (string_buffer result, entity c, bool debug_p, bool isfortran) |
This function is called from c_parse() via ResetCurrentModule() and fprint_environment() More... | |
string | get_symbol_table (entity m, bool isfortran) |
void | actual_symbol_table_dump (const char *module_name, bool is_parsed) |
bool | parsed_symbol_table (const char *module_name) |
bool c_symbol_table(const char* module_name) More... | |
bool | symbol_table (const char *module_name) |
To replace c_symbol_table() and fortran_symbol_table() because the information about the language is available in the symbol table. More... | |
Variables | |
static string | indent_table [9] |
#define NL "\n" |
Definition at line 42 of file symbol_table.c.
void actual_symbol_table_dump | ( | const char * | module_name, |
bool | is_parsed | ||
) |
This function is called in two different context: as a standalone phase or as part of debugging the parser?!?
module_name | odule_name |
is_parsed | s_parsed |
Definition at line 582 of file symbol_table.c.
References code_language, concatenate(), db_build_file_resource_name(), db_get_current_workspace_directory(), DB_PUT_FILE_RESOURCE, debug_off, debug_on, entity_initial, entity_undefined_p, fprintf(), free(), get_current_module_entity(), get_symbol_table(), is_language_c, language_c_p, language_fortran95_p, language_fortran_p, module, module_name(), module_name_to_entity(), out, pips_internal_error, reset_current_module_entity(), safe_fclose(), safe_fopen(), set_current_module_entity(), set_prettyprint_language_tag(), strdup(), value_code, and value_code_p.
Referenced by parsed_symbol_table(), and symbol_table().
Definition at line 93 of file symbol_table.c.
References b2, basic_derived, basic_derived_p, basic_typedef, basic_typedef_p, entities_type_and_name(), entity_type, pips_debug, strdup(), type_struct, type_struct_p, type_variable, type_variable_p, and variable_basic.
Referenced by dump_common_layout(), and entities_type_and_name().
void dump_common_layout | ( | string_buffer | result, |
entity | c, | ||
bool | debug_p, | ||
bool | isfortran | ||
) |
This function is called from c_parse() via ResetCurrentModule() and fprint_environment()
FI: a weaker test to stay independent from the syntax library and its internal static variables.
This piece of code can be used in a pass or as debugging code for library syntax.
result | esult |
debug_p | ebug_p |
isfortran | sfortran |
Definition at line 120 of file symbol_table.c.
References area_size, arguments_difference(), arguments_union(), array_size(), basic_to_string(), check_derived_and_typedef(), concatenate(), DYNAMIC_RAM_OFFSET, ENDP, ENTITY, entity_local_name(), entity_module_name(), entity_name, entity_storage, entity_type, entity_user_name(), FOREACH, free(), gen_free_list(), get_bool_property(), get_common_members(), get_current_module_entity(), heap_area_p(), HeapArea, i2a(), NIL, NL, pips_assert, pips_debug, pips_internal_error, place_holder_variable_p(), ram_function, ram_offset, ram_section, ram_shared, SizeOfArray(), sort_list_of_entities(), stack_area_p(), StackArea, storage_ram, storage_ram_p, string_buffer_append(), type_area, type_variable, type_variable_p, UNDEFINED_RAM_OFFSET, user_warning, and variable_basic.
Referenced by get_symbol_table().
Definition at line 57 of file symbol_table.c.
References basic_to_string(), check_derived_and_typedef(), concatenate(), ENTITY, entity_type, entity_user_name(), FOREACH, free(), indent_table, strdup(), type_variable, type_variable_p, and variable_basic.
Referenced by check_derived_and_typedef().
return variable
To simplify validation, at the expense of some information about the parsing process.
FI: struct, union and enum are also declared (in theory...), but their characteristics should be given differently.
&& (storage_ram_p(s) || storage_return_p(s) || storage_formal_p(s))
FI: How do we want to print out structures, unions and enums?
FI: How do we want to print out typedefs?
FI: it would be useful to dump more information aout fields and members
Formal parameters
Return variable
Structure of each area/common
isfortran | sfortran |
Definition at line 304 of file symbol_table.c.
References area_size, basic_pointer, basic_pointer_p, basic_to_string(), CAR, code_declarations, code_externs, compare_entities(), concatenate(), derived_entity_p(), dump_common_layout(), dump_functional(), ENDP, ENTITY, entity_domain, entity_domain_number, entity_enum_p(), entity_initial, entity_list_p(), entity_module_p(), entity_name, entity_storage, entity_struct_p(), entity_type, entity_undefined, entity_undefined_p, entity_union_p(), f(), FOREACH, formal_offset, gen_copy_seq(), gen_free_list(), gen_sort_list(), i2a(), list_to_string(), list_undefined, module_local_name(), NIL, NL, pips_assert, pips_debug, pips_internal_error, POP, SizeOfElements(), storage_formal, storage_formal_p, storage_return_p, storage_undefined_p, strdup(), string_buffer_append(), string_buffer_free(), string_buffer_make(), string_buffer_to_string(), type_area, type_area_p, type_functional, type_functional_p, type_to_string(), type_variable, type_variable_p, type_void_p, typedef_entity_p(), ultimate_type(), value_code, variable_basic, variable_dimensions, variable_qualifiers, words_dimensions(), and words_qualifiers().
Referenced by actual_symbol_table_dump().
bool parsed_symbol_table | ( | const char * | module_name | ) |
bool c_symbol_table(const char* module_name)
{ set_prettyprint_language_tag(is_language_c); //all the way down to words_basic() actual_symbol_table_dump(module_name, false); return true; } bool fortran_symbol_table(const char* module_name) { actual_symbol_table_dump(module_name, true); return true; } To replace c_symbol_table() and fortran_symbol_table() because the information about the language is available in the symbol table.
This the symbol table is never duplicated, this function's output is correct only if the controlizer has not been applied.
module_name | odule_name |
Definition at line 665 of file symbol_table.c.
References actual_symbol_table_dump(), and module_name().
bool symbol_table | ( | const char * | module_name | ) |
To replace c_symbol_table() and fortran_symbol_table() because the information about the language is available in the symbol table.
module_name | odule_name |
Definition at line 673 of file symbol_table.c.
References actual_symbol_table_dump(), and module_name().
Referenced by expression_similar_get_context_p(), and expression_similar_p().
|
static |
Definition at line 44 of file symbol_table.c.
Referenced by entities_type_and_name().