📄 gfortran.h
字号:
ref_type type; union { struct gfc_array_ref ar; struct { gfc_component *component; gfc_symbol *sym; } c; struct { struct gfc_expr *start, *end; /* Substring */ gfc_charlen *length; } ss; } u; struct gfc_ref *next;}gfc_ref;#define gfc_get_ref() gfc_getmem(sizeof(gfc_ref))/* Structures representing intrinsic symbols and their arguments lists. */typedef struct gfc_intrinsic_arg{ char name[GFC_MAX_SYMBOL_LEN + 1]; gfc_typespec ts; int optional; gfc_actual_arglist *actual; struct gfc_intrinsic_arg *next;}gfc_intrinsic_arg;/* Specifies the various kinds of check functions used to verify the argument lists of intrinsic functions. fX with X an integer refer to check functions of intrinsics with X arguments. f1m is used for the MAX and MIN intrinsics which can have an arbitrary number of arguments, f3ml is used for the MINLOC and MAXLOC intrinsics as these have special semantics. */typedef union{ try (*f0)(void); try (*f1)(struct gfc_expr *); try (*f1m)(gfc_actual_arglist *); try (*f2)(struct gfc_expr *, struct gfc_expr *); try (*f3)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *); try (*f3ml)(gfc_actual_arglist *); try (*f3red)(gfc_actual_arglist *); try (*f4)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *); try (*f5)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *);}gfc_check_f;/* Like gfc_check_f, these specify the type of the simplification function associated with an intrinsic. The fX are just like in gfc_check_f. cc is used for type conversion functions. */typedef union{ struct gfc_expr *(*f0)(void); struct gfc_expr *(*f1)(struct gfc_expr *); struct gfc_expr *(*f2)(struct gfc_expr *, struct gfc_expr *); struct gfc_expr *(*f3)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *); struct gfc_expr *(*f4)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *); struct gfc_expr *(*f5)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *); struct gfc_expr *(*cc)(struct gfc_expr *, bt, int);}gfc_simplify_f;/* Again like gfc_check_f, these specify the type of the resolution function associated with an intrinsic. The fX are just like in gfc_check_f. f1m is used for MIN and MAX, s1 is used for abort(). */typedef union{ void (*f0)(struct gfc_expr *); void (*f1)(struct gfc_expr *, struct gfc_expr *); void (*f1m)(struct gfc_expr *, struct gfc_actual_arglist *); void (*f2)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *); void (*f3)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *); void (*f4)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *); void (*f5)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *, struct gfc_expr *); void (*s1)(struct gfc_code *);}gfc_resolve_f;typedef struct gfc_intrinsic_sym{ const char *name, *lib_name; gfc_intrinsic_arg *formal; gfc_typespec ts; int elemental, pure, generic, specific, actual_ok, standard, noreturn; gfc_simplify_f simplify; gfc_check_f check; gfc_resolve_f resolve; struct gfc_intrinsic_sym *specific_head, *next; gfc_generic_isym_id generic_id;}gfc_intrinsic_sym;/* Expression nodes. The expression node types deserve explanations, since the last couple can be easily misconstrued: EXPR_OP Operator node pointing to one or two other nodes EXPR_FUNCTION Function call, symbol points to function's name EXPR_CONSTANT A scalar constant: Logical, String, Real, Int or Complex EXPR_VARIABLE An Lvalue with a root symbol and possible reference list which expresses structure, array and substring refs. EXPR_NULL The NULL pointer value (which also has a basic type). EXPR_SUBSTRING A substring of a constant string EXPR_STRUCTURE A structure constructor EXPR_ARRAY An array constructor. */#include <gmp.h>#include <mpfr.h>#define GFC_RND_MODE GMP_RNDNtypedef struct gfc_expr{ expr_t expr_type; gfc_typespec ts; /* These two refer to the overall expression */ int rank; mpz_t *shape; /* Can be NULL if shape is unknown at compile time */ /* Nonnull for functions and structure constructors */ gfc_symtree *symtree; gfc_ref *ref; locus where; /* True if it is converted from Hollerith constant. */ unsigned int from_H : 1; union { int logical; mpz_t integer; mpfr_t real; struct { mpfr_t r, i; } complex; struct { gfc_intrinsic_op operator; gfc_user_op *uop; struct gfc_expr *op1, *op2; } op; struct { gfc_actual_arglist *actual; const char *name; /* Points to the ultimate name of the function */ gfc_intrinsic_sym *isym; gfc_symbol *esym; } function; struct { int length; char *string; } character; struct gfc_constructor *constructor; } value;}gfc_expr;#define gfc_get_shape(rank) ((mpz_t *) gfc_getmem((rank)*sizeof(mpz_t)))/* Structures for information associated with different kinds of numbers. The first set of integer parameters define all there is to know about a particular kind. The rest of the elements are computed from the first elements. */typedef struct{ /* Values really representable by the target. */ mpz_t huge, pedantic_min_int, min_int, max_int; int kind, radix, digits, bit_size, range; /* True if the C type of the given name maps to this precision. Note that more than one bit can be set. */ unsigned int c_char : 1; unsigned int c_short : 1; unsigned int c_int : 1; unsigned int c_long : 1; unsigned int c_long_long : 1;}gfc_integer_info;extern gfc_integer_info gfc_integer_kinds[];typedef struct{ int kind, bit_size; /* True if the C++ type bool, C99 type _Bool, maps to this precision. */ unsigned int c_bool : 1;}gfc_logical_info;extern gfc_logical_info gfc_logical_kinds[];typedef struct{ mpfr_t epsilon, huge, tiny, subnormal; int kind, radix, digits, min_exponent, max_exponent; int range, precision; /* The precision of the type as reported by GET_MODE_PRECISION. */ int mode_precision; /* True if the C type of the given name maps to this precision. Note that more than one bit can be set. */ unsigned int c_float : 1; unsigned int c_double : 1; unsigned int c_long_double : 1;}gfc_real_info;extern gfc_real_info gfc_real_kinds[];/* Equivalence structures. Equivalent lvalues are linked along the *eq pointer, equivalence sets are strung along the *next node. */typedef struct gfc_equiv{ struct gfc_equiv *next, *eq; gfc_expr *expr; const char *module; int used;}gfc_equiv;#define gfc_get_equiv() gfc_getmem(sizeof(gfc_equiv))/* gfc_case stores the selector list of a case statement. The *low and *high pointers can point to the same expression in the case of a single value. If *high is NULL, the selection is from *low upwards, if *low is NULL the selection is *high downwards. This structure has separate fields to allow single and double linked lists of CASEs at the same time. The singe linked list along the NEXT field is a list of cases for a single CASE label. The double linked list along the LEFT/RIGHT fields is used to detect overlap and to build a table of the cases for SELECT constructs with a CHARACTER case expression. */typedef struct gfc_case{ /* Where we saw this case. */ locus where; int n; /* Case range values. If (low == high), it's a single value. If one of the labels is NULL, it's an unbounded case. If both are NULL, this represents the default case. */ gfc_expr *low, *high; /* Next case label in the list of cases for a single CASE label. */ struct gfc_case *next; /* Used for detecting overlap, and for code generation. */ struct gfc_case *left, *right; /* True if this case label can never be matched. */ int unreachable;}gfc_case;#define gfc_get_case() gfc_getmem(sizeof(gfc_case))typedef struct{ gfc_expr *var, *start, *end, *step;}gfc_iterator;#define gfc_get_iterator() gfc_getmem(sizeof(gfc_iterator))/* Allocation structure for ALLOCATE, DEALLOCATE and NULLIFY statements. */typedef struct gfc_alloc{ gfc_expr *expr; struct gfc_alloc *next;}gfc_alloc;#define gfc_get_alloc() gfc_getmem(sizeof(gfc_alloc))typedef struct{ gfc_expr *unit, *file, *status, *access, *form, *recl, *blank, *position, *action, *delim, *pad, *iostat, *iomsg, *convert; gfc_st_label *err;}gfc_open;typedef struct{ gfc_expr *unit, *status, *iostat, *iomsg; gfc_st_label *err;}gfc_close;typedef struct{ gfc_expr *unit, *iostat, *iomsg; gfc_st_label *err;}gfc_filepos;typedef struct{ gfc_expr *unit, *file, *iostat, *exist, *opened, *number, *named, *name, *access, *sequential, *direct, *form, *formatted, *unformatted, *recl, *nextrec, *blank, *position, *action, *read, *write, *readwrite, *delim, *pad, *iolength, *iomsg, *convert; gfc_st_label *err;}gfc_inquire;typedef struct{ gfc_expr *io_unit, *format_expr, *rec, *advance, *iostat, *size, *iomsg; gfc_symbol *namelist; /* A format_label of `format_asterisk' indicates the "*" format */ gfc_st_label *format_label; gfc_st_label *err, *end, *eor; locus eor_where, end_where, err_where;}gfc_dt;typedef struct gfc_forall_iterator{ gfc_expr *var, *start, *end, *stride; struct gfc_forall_iterator *next;}gfc_forall_iterator;/* Executable statements that fill gfc_code structures. */typedef enum{ EXEC_NOP = 1, EXEC_ASSIGN, EXEC_LABEL_ASSIGN, EXEC_POINTER_ASSIGN, EXEC_GOTO, EXEC_CALL, EXEC_RETURN, EXEC_ENTRY, EXEC_PAUSE, EXEC_STOP, EXEC_CONTINUE, EXEC_IF, EXEC_ARITHMETIC_IF, EXEC_DO, EXEC_DO_WHILE, EXEC_SELECT, EXEC_FORALL, EXEC_WHERE, EXEC_CYCLE, EXEC_EXIT, EXEC_ALLOCATE, EXEC_DEALLOCATE, EXEC_OPEN, EXEC_CLOSE, EXEC_READ, EXEC_WRITE, EXEC_IOLENGTH, EXEC_TRANSFER, EXEC_DT_END, EXEC_BACKSPACE, EXEC_ENDFILE, EXEC_INQUIRE, EXEC_REWIND, EXEC_FLUSH}gfc_exec_op;typedef struct gfc_code{ gfc_exec_op op; struct gfc_code *block, *next; locus loc; gfc_st_label *here, *label, *label2, *label3; gfc_symtree *symtree; gfc_expr *expr, *expr2; /* A name isn't sufficient to identify a subroutine, we need the actual symbol for the interface definition. const char *sub_name; */ gfc_symbol *resolved_sym; union { gfc_actual_arglist *actual; gfc_case *case_list; gfc_iterator *iterator; gfc_alloc *alloc_list; gfc_open *open; gfc_close *close; gfc_filepos *filepos; gfc_inquire *inquire; gfc_dt *dt; gfc_forall_iterator *forall_iterator; struct gfc_code *whichloop; int stop_code; gfc_entry_list *entry; } ext; /* Points to additional structures required by statement */ /* Backend_decl is used for cycle and break labels in do loops, and probably for other constructs as well, once we translate them. */ tree backend_decl;}gfc_code;/* Storage for DATA statements. */typedef struct gfc_data_variable{ gfc_expr *expr; gfc_iterator iter; struct gfc_data_variable *list, *next;}gfc_data_variable;typedef struct gfc_data_value{ unsigned int repeat; gfc_expr *expr; struct gfc_data_value *next;}gfc_data_value;typedef struct gfc_data{ gfc_data_variable *var; gfc_data_value *value; locus where; struct gfc_data *next;}gfc_data;#define gfc_get_data_variable() gfc_getmem(sizeof(gfc_data_variable))#define gfc_get_data_value() gfc_getmem(sizeof(gfc_data_value))#define gfc_get_data() gfc_getmem(sizeof(gfc_data))/* Structure for holding compile options */typedef struct{ char *module_dir; gfc_source_form source_form; /* When fixed_line_length or free_line_length are 0, the whole line is used.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -