PIPS
|
#include <stdio.h>
#include "genC.h"
#include "misc.h"
#include "pipsdbm.h"
#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
Go to the source code of this file.
Macros | |
#define | isbegincomment(c) ((c)=='!' || (c)=='*' || (c)=='c' || (c)=='C' || (c)=='#') |
added macros More... | |
#define | issquote(c) ((c)=='\'') |
#define | isdquote(c) ((c)=='\"') |
#define | ishH(c) ((c)=='h' || (c)=='H') |
#define | char2int(c) ((int)((c)-'0')) |
#define | LINESIZE 200 |
#define | BSZ 512 |
not lint More... | |
#define | true 1 |
#define | false 0 |
#define | trim(p) while (*p == ' ' || *p == '\t') p++ |
#define | allowed_first_char(c) (((c)>='a' && (c)<='z') || ((c)>='A' && (c)<='Z') || ((c)=='_')) |
#define | allowed_char(c) (allowed_first_char(c) || ((c)>='0' && (c)<='9')) |
#define | skippable_char(c) ((c)==' ' || (c)=='\t' || (c)=='\r') |
#define | FREE_STRINGS |
#define | HOLL_ERROR |
Functions | |
static char * | hollerith_and_bangcomments (char *) |
static char * | look () |
static char * | skiplab () |
static char * | functs () |
static int | scan_name () |
static void | get_name () |
static char * | full_name (char *dir, char *name) |
static void | get_name (char *name) |
static int | GetLine () |
getline does not handle continuations... More... | |
static char * | skip_comment_if_any (char *lines) |
static int | lend () |
return 1 for 'end' alone on card (up to col. More... | |
static int | lname (char *s, int look_for_entry) |
check for keywords for subprograms return 0 if comment card, 1 if found name and put in arg string. More... | |
static int | scan_name (char *s, char *ptr) |
static char * | functs (char *p) |
static char * | skiplab (char *p) |
if first 6 col. More... | |
static char * | look (char *s, char *m) |
return 0 if m doesn't match initial part of s; otherwise return ptr to next char after m in s More... | |
static void | put_upper_from_slash_till_dot_or_end (char *what, FILE *where) |
static void | print_name (FILE *o, char *name, int n, int upper) |
FC. More... | |
char * | fsplit (char *dir_name, char *file_name, FILE *out) |
static int | blank_line_p (char *line) |
char * | process_bang_comments_and_hollerith (FILE *in, FILE *out) |
processing extracted for includes... More... | |
Variables | |
char | fsplit_copyright [] |
split_file.c More... | |
char | fsplit_sccsid [] = "@(#)fsplit.c 5.5 (Berkeley) 3/12/91" |
not lint More... | |
static char | buf [BSZ] |
static FILE * | ifp |
static char * | x |
static char * | mainp |
static char * | blkp |
static struct stat | sbuf |
static int | current_line_number = 0 |
static int | implicit_program |
static int | implicit_blockdata_name |
FC. More... | |
static int | implicit_program_name |
FC. More... | |
static int | it_is_a_main |
FC. More... | |
static int | it_is_an_entry |
FC. More... | |
static int | in_squotes =0 |
ADDITION: basic Hollerith constants handling FC 11 Apr 1997. More... | |
static int | in_dquotes =0 |
static int | in_id =0 |
static int | in_hollerith =0 |
#define allowed_char | ( | c | ) | (allowed_first_char(c) || ((c)>='0' && (c)<='9')) |
Definition at line 356 of file split_file.c.
Definition at line 353 of file split_file.c.
#define BSZ 512 |
not lint
Definition at line 156 of file split_file.c.
#define char2int | ( | c | ) | ((int)((c)-'0')) |
Definition at line 72 of file split_file.c.
#define false 0 |
Definition at line 162 of file split_file.c.
#define FREE_STRINGS |
Definition at line 468 of file split_file.c.
#define HOLL_ERROR |
Definition at line 669 of file split_file.c.
#define isbegincomment | ( | c | ) | ((c)=='!' || (c)=='*' || (c)=='c' || (c)=='C' || (c)=='#') |
added macros
Definition at line 67 of file split_file.c.
#define isdquote | ( | c | ) | ((c)=='\"') |
Definition at line 70 of file split_file.c.
#define ishH | ( | c | ) | ((c)=='h' || (c)=='H') |
Definition at line 71 of file split_file.c.
#define issquote | ( | c | ) | ((c)=='\'') |
Definition at line 69 of file split_file.c.
#define LINESIZE 200 |
Definition at line 75 of file split_file.c.
#define skippable_char | ( | c | ) | ((c)==' ' || (c)=='\t' || (c)=='\r') |
Definition at line 359 of file split_file.c.
#define trim | ( | p | ) | while (*p == ' ' || *p == '\t') p++ |
Definition at line 169 of file split_file.c.
#define true 1 |
Definition at line 161 of file split_file.c.
|
static |
Definition at line 660 of file split_file.c.
References line.
Referenced by hollerith_and_bangcomments().
char* fsplit | ( | char * | dir_name, |
char * | file_name, | ||
FILE * | out | ||
) |
output file
1 if got card in output file, 0 otherwise
1 if got name of subprog., 0 otherwise
??? 20 -> 80 because not checked... smaller than a line is ok ? FC
MALLOC STRINGS
look for a temp file that doesn't correspond to an existing file
FC
if no name yet, try and find one
FC: some hack to deal with entry...
FC again
now we gave it a name!
a new module name is appended to the current line...
look for an 'end' statement
while
no lines in file, forget the file
rename the file
out?
for(;;)
dir_name | ir_name |
file_name | ile_name |
out | ut |
Definition at line 474 of file split_file.c.
Referenced by pips_split_file().
|
static |
static char * functs | ( | ) |
|
static |
look for typed functions such as: real*8 function, character*16 function, character*(*) function
Definition at line 391 of file split_file.c.
|
static |
|
static |
Definition at line 178 of file split_file.c.
|
static |
getline does not handle continuations...
fix for the last line that may not have a
. It is returned however and lend handles it correctly.
Definition at line 204 of file split_file.c.
Referenced by process_bang_comments_and_hollerith().
|
static |
RESET
first column to analyze
RESET
73.. ignored
hack for real*8 hollerith
looks for [0-9 ]+[hH]
YEAH, here it is!
rm potential 73-80 text
should look for a continuation OR pad.
padding
must insert tmp[<j] in line[ni..] first, shift the line...
to the left
to the right
bang comment in the middle of a line.
stop while loop
the new line may exceed the 72 column
caution, len includes cr...
the dilatation cannot exceed one line (?)
then shift and continuation...
the bang comment is moved to the preceding line.
Definition at line 673 of file split_file.c.
References blank_line_p(), BSZ, char2int, current_line_number, HOLL_ERROR, in_dquotes, in_hollerith, in_id, in_squotes, isbegincomment, isdquote, ishH, issquote, line, and malloc().
Referenced by process_bang_comments_and_hollerith().
|
static |
return 1 for 'end' alone on card (up to col.
72), 0 otherwise
a continuation
Definition at line 242 of file split_file.c.
Referenced by freia_migrate_statements().
check for keywords for subprograms
return 0 if comment card, 1 if found name and put in arg string.
invent name for unnamed block datas and main programs.
first check for comment cards
copy to buffer and converting to lower case
entry is looked for within a something...
Definition at line 283 of file split_file.c.
Referenced by binary_to_nary(), c_text_related_entities(), language_module_p(), make_bound(), nary_operator_p(), set_control_to_label(), statement_remove_omp_clauses(), what_operator(), and words_basic().
|
static |
|
static |
return 0 if m doesn't match initial part of s; otherwise return ptr to next char after m in s
Definition at line 438 of file split_file.c.
FC.
Definition at line 462 of file split_file.c.
char* process_bang_comments_and_hollerith | ( | FILE * | in, |
FILE * | out | ||
) |
processing extracted for includes...
in | n |
out | ut |
Definition at line 836 of file split_file.c.
References buf, current_line_number, error, GetLine(), hollerith_and_bangcomments(), ifp, and out.
Referenced by handle_include_file().
|
static |
Definition at line 452 of file split_file.c.
|
static |
|
static |
scan off the name
must have a valid first char.
next char should be a ( or
Definition at line 362 of file split_file.c.
|
static |
Definition at line 228 of file split_file.c.
static char * skiplab | ( | ) |
|
static |
if first 6 col.
blank, return ptr to col. 7, if blanks and then tab, return ptr after tab, else return 0 (labelled statement, comment or continuation
Definition at line 419 of file split_file.c.
|
static |
Definition at line 159 of file split_file.c.
|
static |
Definition at line 157 of file split_file.c.
Referenced by dbll_stat_file(), directory_exists_p(), do_simplify_constant_address_expression(), file_exists_p(), file_readable_p(), gen_read_string(), generate_a_directory_menu(), html_print_area(), html_print_basic(), html_print_constant(), html_print_formal(), html_print_ram(), i2a(), loop_annotate(), make_packing_function(), old_reductions(), print_entity_task_buffers(), print_sesam_tasks_buffers_header(), process_bang_comments_and_hollerith(), put_summary(), read_token(), reductions_get_omp_pragma_str(), safe_readfile(), safe_readline(), set_property(), st_one_message(), string_buffer_to_string_internal(), Value_to_string(), and VASNPRINTF().
|
static |
Definition at line 200 of file split_file.c.
Referenced by hollerith_and_bangcomments(), and process_bang_comments_and_hollerith().
char fsplit_copyright[] |
Definition at line 114 of file split_file.c.
char fsplit_sccsid[] = "@(#)fsplit.c 5.5 (Berkeley) 3/12/91" |
not lint
Definition at line 120 of file split_file.c.
|
static |
Definition at line 158 of file split_file.c.
Referenced by process_bang_comments_and_hollerith().
|
static |
FC.
Definition at line 274 of file split_file.c.
|
static |
Definition at line 273 of file split_file.c.
|
static |
FC.
Definition at line 275 of file split_file.c.
|
static |
Definition at line 658 of file split_file.c.
Referenced by hollerith_and_bangcomments().
|
static |
Definition at line 658 of file split_file.c.
Referenced by hollerith_and_bangcomments().
|
static |
Definition at line 658 of file split_file.c.
Referenced by hollerith_and_bangcomments().
|
static |
ADDITION: basic Hollerith constants handling FC 11 Apr 1997.
bugs:
to improve:
Definition at line 658 of file split_file.c.
Referenced by hollerith_and_bangcomments().
|
static |
FC.
Definition at line 276 of file split_file.c.
|
static |
FC.
Definition at line 277 of file split_file.c.
|
static |
Definition at line 159 of file split_file.c.
|
static |
Definition at line 159 of file split_file.c.
|
static |
Definition at line 159 of file split_file.c.
Referenced by add_bounding_box_constraints(), add_remapping_as_used(), allocate_bucket(), array_dimension_bound_test_undefined_p(), array_test_undefined_p(), average_probability_matrix(), bezout(), bezout_grl(), build_contraction_matrices(), build_convex_constraints_from_vertices(), check_coefficient_reduction(), check_if_direct_reference(), choisir_piv(), compare_attachment_for_qsort(), compare_option_type_for_qsort(), constant_constraint_check(), contrainte_make_1D(), convert_pointer_to_array(), cool_enough_for_a_last_substitution(), corr(), dilate_1d_h(), dilate_1d_v(), dprint(), eligible_for_coefficient_reduction_with_bounding_box_p(), erode_1d_h(), erode_1d_v(), eval_2D_vecteur(), exam_coef(), exponentiate(), expression_try_find_size(), find_eg(), find_first_integer_point_in_between(), find_integer_point_to_the_left(), find_integer_point_to_the_right(), find_intermediate_constraints(), find_intermediate_constraints_recursively(), find_or_allocate(), float_to_frac(), frac_div(), frac_mul(), free_bucket(), free_buckets(), gather_local_indices(), gaussian_noise_reduce(), gen_chunk_identity(), gen_identity(), gen_list_patch(), gen_set_closure_iterate(), gram_param(), include_trans_on_LC_in_ref(), initialization(), integrer(), llog(), loop_flt(), main(), MakeParameter(), MakeStatementLike(), mat_maj_col(), mat_maj_lig(), matrice_hermite(), matrice_smith(), matrice_soustraction_colonne(), matrice_soustraction_ligne(), matrice_unimodulaire_triangulaire_inversion(), matrix_hermite(), matrix_maj_col(), matrix_maj_line(), matrix_smith(), matrix_subtraction_column(), matrix_subtraction_line(), matrix_unimodular_triangular_inversion(), monome_sprint(), monome_to_expression(), my_matrices_to_constraints_with_sym_cst(), my_matrices_to_constraints_with_sym_cst_2(), new_constraint_for_coefficient_reduction_with_bounding_box(), number_of_buckets(), number_of_ordered_statements(), outliner_patch_parameters(), pipsdbm_consistent_statement_function(), pipsdbm_write_statement_function(), pivoter(), printfrac(), reduce_coefficients_with_bounding_box(), remapping_already_computed_p(), sc_min(), schoose_create_abbrev_menu_with_text(), signed_integer_constant_expression_value(), simplify_float_constraint(), small_positive_slope_reduce_coefficients_with_bounding_box(), sol_mod(), sol_pgcd(), sol_ppcm(), stack_head(), stack_map(), stack_pop(), stack_push(), stack_replace(), statement_arrows(), tab_display(), terapix_gram_allocate(), terapix_init_row(), term(), text_loop_craft(), traiter(), transformer_add_equality_with_affine_term(), transformer_add_inequality_with_affine_term(), transformer_add_inequality_with_linear_term(), update_coefficient_signs_in_constraints(), update_coefficient_signs_in_vector(), update_iterator_upward(), vect_cl_ofl_ctrl(), vect_div(), vect_in_p(), vect_make_1D(), vect_make_line(), vect_multiply(), vecteur_bezout(), and x_language_module_p().