6 #ifndef preprocessor_header_included
7 #define preprocessor_header_included
36 #define SRCPATH "PIPS_SRCPATH"
40 #define CPP_PIPS_ENV "PIPS_CPP"
41 #define CPP_PIPS_OPTIONS_ENV "PIPS_CPP_FLAGS"
42 #define FPP_PIPS_ENV "PIPS_FPP"
43 #define FPP_PIPS_OPTIONS_ENV "PIPS_FPP_FLAGS"
52 #define CPP_CPP "cpp -C -std=c99"
57 #define CPP_CPPFLAGS " -D__PIPS__ -D__HPFC__ -U__GNUC__ "
65 #define FPP_CPP "gfortran -E"
68 #define FPP_CPPFLAGS " -P -D__PIPS__ -D__HPFC__ "
70 #define DEFAULT_PIPS_FLINT "gfortran -Wall"
74 #define DEFAULT_PIPS_CC "gcc -std=c99 -D__PIPS__ -D__HPFC__ -U__GNUC__ "
75 #define DEFAULT_PIPS_CC_FLAGS " -Wall "
81 #define csplit_parser_warning(...) \
82 csplit_parser_warning_func(CURRENT_FUNCTION, __FILE__, __LINE__, \
122 extern char *
fsplit(
char *,
char *, FILE *);
136 extern void csplit_copy(
const char *,
string ,
int ,
int ,
size_t ,
size_t ,
int ,
bool );
143 extern string csplit(
char *,
char *, FILE *);
145 extern char *
f95split(
char *,
char *, FILE **);
gather_comment_state_t
A state-machine to gather the trailing comments of a statement with an heuristic to decide if some co...
void csplit_copy(const char *, string, int, int, size_t, size_t, int, bool)
Create the module directory and file, copy the definition of the module and add the module name to th...
char * fsplit(char *, char *, FILE *)
bool flag_as_stub(const string)
string get_preprocessor_nth_scope(int)
size_t csplit_file_offset_beginning
string csplit_current_function_name
to know if this is the declaration of a function or not, to distinguish between a static variable and...
bool dot_c_file_p(string)
Test if a name ends with .c.
int splitc_get_leng(void)
void init_module_name_list(void)
void splitc_restart(FILE *)
void splitc_set_in(FILE *)
void pop_preprocessor_scope(void)
size_t get_current_csplit_file_offset(void)
Get the current file position in the file to split:
int preprocessor_scope_number(void)
bool bootstrap_stubs(const string)
void ForceResetTypedefStack(void)
FILE * splitc_get_in(void)
void pips_get_fortran_list(gen_array_t)
Select the true file with names ending in ".[fF]" and return a sorted arg list:
string pips_srcpath_append(string)
returns an allocated pointer to the old value
void pips_srcpath_set(string)
Set the PIPS source path.
int get_csplit_current_beginning(void)
string preprocessor_current_split_file_name
Split a C or Fortran file into as many files as modules.
bool csplit_is_static_p
static int enum_counter = 0;
void csplit_close_files(string)
void preprocessor_init_keyword_typedef_table(void)
char fsplit_copyright[]
split_file.c
int csplit_is_function
to know if the variable is declared inside or outside a function
int splitc_get_lineno(void)
void keep_track_of_typedef(string)
int csplit_is_external
splitc.c
void reset_current_input_line(void)
In file just above.
void splitc_error(const char *)
void csplit_parser_warning_func(const char *, const char *, const int, const string,...)
string current_file_name
Split a C file into one file per module (function or procedure) plus.
void reset_preprocessor_scope_stack(void)
int hpfc_get_file_list(gen_array_t, char **)
FILE * splitc_get_out(void)
void update_csplit_file_offset_information(void)
Function called each time a token is read to trac file position information:
string csplit_definite_function_signature
bool dot_f95_file_p(string)
Test if a name ends with .f95.
void error_reset_module_name_list(void)
No checking, to be called from a (future) error handling module.
string preprocessor_current_initial_file_name
The digestion of a user file by PIPS begins here.
void init_processed_include_cache(void)
void reset_csplit_line_number(void)
Reinitialise global position numbers for a new file.
int get_user_current_beginning(void)
Get the current line number in the file to split from the user point of view (before preprocessor exp...
string preprocessed_to_user_file(string)
Allocate a new string containing the user file name, before preprocessing.
char * splitc_get_text(void)
char * process_bang_comments_and_hollerith(FILE *, FILE *)
processing extracted for includes...
void MakeTypedefStack()
Define some functions from the .l or .y since cproto cannot dig them out:
size_t current_csplit_file_offset
void splitc_set_lineno(int)
bool dot_F_file_p(string)
Test if a name ends with .F.
bool process_user_file(string)
string get_preprocessor_current_scope(void)
void csplit_close_compilation_unit(void)
void csplit_error_handler(void)
Close open files and reset variables.
void csplit_parser_error(const string)
Redundant with splitc_error()?
int csplit_line_number
To be exported to the parser for splitting the preprocessed file.
void splitc_pop_buffer_state(void)
string csplit_definite_function_name
void reset_module_name_list(void)
size_t get_csplit_file_offset_beginning(void)
Get the file position in the file to split where the current function begins:
void force_reset_preprocessor_scope_stack(void)
To be used by an error handler.
void close_processed_include_cache(void)
int splitc_get_debug(void)
void pips_get_workspace_list(gen_array_t)
cproto-generated files
string get_splitc_input_file_name(void)
void splitc_set_out(FILE *)
char * current_include_file_path
csplit_file.c
bool preprocessor_scope_stack_empty_p(void)
void csplit_open_compilation_unit(string)
Disambiguate the compilation unit base name (special character to avoid conflicts with function names...
string hpfc_generate_path_name_of_file_name(const char *)
Return the path of an HPFC file name relative to the current PIPS directory.
void init_preprocessor_scope_stack(void)
int check_signature_balance(void)
bool dot_f90_file_p(string)
Test if a name ends with .f90.
void csplit_append_to_compilation_unit(int, unsigned long long)
Copy the input file to the compilation unit between the function declarations up to the current funct...
string pips_change_directory(const char *)
Change to the given directory if it exists and return a canonical name.
int user_line_number
To be exported to the parser for error messages related to the user file.
void * splitc_realloc(void *, yy_size_t)
size_t yy_size_t
symbols exported by lex / yacc
string csplit(char *, char *, FILE *)
void push_new_preprocessor_scope(void)
void copy_between_2_fd_up_to_offset(FILE *, FILE *, unsigned long long, bool)
enum gather_comment_state_t gather_comment_state_machine
Indeed it does not work since csplit_copy() is called from splitc.y when a function definition is fou...
void * splitc_alloc(yy_size_t)
language workspace_language(gen_array_t)
Choose a language if all filenames in "files" have the same C or Fortran extensions.
int find_eol_coding(string)
Returns the newly allocated name if preprocessing succeeds.
void reset_csplit_current_beginning(void)
This function is called at the end of any top-level C construct:
char * f95split(char *, char *, FILE **)
f95split_file.c
bool dot_f_file_p(string)
Test if a name ends with .f.
char fsplit_sccsid[]
not lint
string csplit_current_function_name2
void splitc_set_debug(int)