⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 symtab.h

📁 这是一个Linux下的集成开发环境
💻 H
📖 第 1 页 / 共 2 页
字号:
/*Copyright (c) 2000, Red Hat, Inc.This file is part of Source-Navigator.Source-Navigator is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public License as publishedby the Free Software Foundation; either version 2, or (at your option)any later version.Source-Navigator is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public License alongwith Source-Navigator; see the file COPYING.  If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330, Boston,MA 02111-1307, USA.*//* symtab.h:	Shared declarations for symbol-table routines.  Note: uses	declarations in ftnchek.h.    Copyright (C) 1993 by Robert K. Moniot.    This program is free software.  Permission is granted to    modify it and/or redistribute it, retaining this notice.    No guarantees accompany this software.*/#ifdef SYMTAB			/* "home" for variables is symtab.c */#define SYM_SHARED#else#define SYM_SHARED extern#endif#ifdef DYNAMIC_TABLES#ifdef __TURBOC__	/* Turbo C has only one free() */#define cfree free#endif#endif		/* Definitions of symbol table information *//*	Token subclasses (classes are in fortran.h) */#define relop_EQ	0#define relop_NE	1#define relop_LE	2#define relop_LT	3#define relop_GE	4#define relop_GT	5	/* Storage Class types for variables, consts, and externals */#define class_VAR 0#define class_SUBPROGRAM 1#define class_COMMON_BLOCK 2#define class_STMT_FUNCTION 3#define class_LABEL 4#define class_NAMELIST 5	/* Data types for variables, consts, and externals */	/* N.B. 0 thru 7 are wired into lookup tables in exprtype.c */#define type_UNDECL 0#define type_ERROR 0		/* for result of erroneous operation */#define type_INTEGER 1#define type_REAL 2#define type_DP 3#define type_COMPLEX 4#define type_DCOMPLEX 5#define type_LOGICAL 6#define type_STRING 7#define type_HOLLERITH 8#define type_GENERIC 9#define type_SUBROUTINE 10#define type_COMMON_BLOCK 11#define type_PROGRAM 12#define type_BLOCK_DATA 13#define type_LABEL 14#define type_NAMELIST 15#define type_POINTER 16#define type_RECORD 17#define size_DEFAULT	(0L)	/* code for standard numeric sizes */#define size_ADJUSTABLE	(-1L)	/* codes for special char string lengths */#define size_UNKNOWN	(-2L)				/* test for types usable in exprs */#define is_computational_type(t) ((unsigned)(t) <= (unsigned)type_HOLLERITH)				/* test for numeric types */#define is_numeric_type(t) ((unsigned)(t) <= (unsigned)type_DCOMPLEX)				/* test for arith, char, or logical type */#define is_const_type(t) (((t)>(unsigned)0) && ((t)<=(unsigned)type_STRING))				/* test for numeric or logical type */#define is_num_log_type(t) ((t) <= type_LOGICAL)				/* test for real/d.p./complex/d.complx type */#define is_float_type(t) ((t)>=type_REAL && (t)<=type_DCOMPLEX)	/* Type categories equate DoubleP to Real, Double Complex	   to Complex, and Hollerith to Int to simplify expression	   type propagation and argument checking.  Computational	   types only, except that since subroutine can be passed	   as an argument, table goes up that high.  */SYM_SHAREDunsigned char type_category[]#ifdef SYMTAB={	type_UNDECL,	type_INTEGER,	type_REAL,	type_REAL,	type_COMPLEX,	type_COMPLEX,	type_LOGICAL,	type_STRING,	type_INTEGER,	type_GENERIC,	type_SUBROUTINE,}#endif;	/* Equivalence types equate Real, DoubleP, Complex and Double	   Complex, for use in checking mixed equivalence and mixed	   common, since it is standard and portable to interpret complex	   as a pair of real values: real part and imag part */SYM_SHAREDunsigned char equiv_type[]#ifdef SYMTAB={	type_UNDECL,	type_INTEGER,	type_REAL,	type_REAL,	type_REAL,	type_REAL,	type_LOGICAL,	type_STRING,	type_INTEGER}#endif;typedef unsigned char BYTE;		/* Array of class and type name translations */SYM_SHAREDchar *class_name[]#ifdef SYMTAB = {	"",	"subprog",	"common",	"stmt fun",	"label",	"namelist",}#endif;SYM_SHAREDchar *type_name[]#ifdef SYMTAB = {	"undf",	"intg",	"real",	"dble",	"cplx",	"dcpx",	"logl",	"char",	"holl",	"genr",	"subr",	"comm",	"prog",	"data",	"labl",	"naml",}#endif;/* Here declare typical sizes of objects of each data type, for use inchecking argument and common block size matchups.  BpW (bytes per word)is defined in ftnchek.h */SYM_SHAREDBYTE type_size[]#ifdef SYMTAB={	0, /*undf*/      BpW, /*intg*/      BpW, /*real*/    2*BpW, /*dble*/    2*BpW, /*cplx*/    4*BpW, /*dcpx*/      BpW, /*logl*/	1, /*char*/      BpW, /*holl*/	0, /*genr*/	0, /*subr*/	0, /*comm*/	0, /*prog*/	0, /*data*/	0, /*labl*/	0, /*naml*/}#endif;		/* implicit and default typing lookup table.  Big		   enough to accommodate '$' and '_' too */SYM_SHAREDint implicit_type[28],	/* indexed by [char - 'A'] */    implicit_size[28];	/* Declaration of Token data structure.  N.B. do not change without	   consulting preamble of fortran.y for uses with nonterminals.	 */struct tokstruct {	union {		long integer;		double dbl;		char *string;	} value;	struct tokstruct *next_token;	struct tokstruct *dot_token;	long size;	long class,subclass;	unsigned line_num;	/* Line and column where token occurred */	unsigned col_num : 8;	int curr_index;};typedef struct tokstruct Token;#define YYSTYPE Token	/* Type defn for yylval and Yacc stack */SYM_SHAREDunsigned long loc_symtab_top,	/* Next avail spot in local symbol table */   glob_symtab_top;		/* Ditto global */	/* Stringspace is partitioned into local (growing from bottom up)	   and global (growing from top down). */SYM_SHAREDunsigned long loc_str_top,	/* Top of local stringspace */   glob_str_bot;		/* Bottom of global stringspace */SYM_SHARED   unsigned long token_space_top,	/* Top of token space */		 token_head_space_top;	/* Top of TL_head space */SYM_SHARED  int global_save;	/* module contains SAVE with no list */		/* Define names for anonymous things */#ifdef SYMTABchar blank_com_name[] = "%BLANK",  /* id for blank common entry in symtab */     unnamed_prog[]="%MAIN",	  /* id for unnamed program module */     unnamed_block_data[]="%DAT00";  /* id for unnamed block data module */int  block_data_number=0;       /* count of multiple anonymous block data */#elseextern char blank_com_name[],	    unnamed_prog[],	    unnamed_block_data[];extern int block_data_number;#endif                /* Symbol table argument list declarations */typedef union {		/* InfoUnion: misc info about symtab entry */	     unsigned long array_dim;	/* array size and no. of dims */	     struct ALHead *arglist;	/* ptr to func/subr argument list */	     struct CMHead *comlist;    /* ptr to common block list */	     struct TLHead *toklist;  /* ptr to token list */	     struct IInfo *intrins_info;/* ptr to intrinsic func info */	     long int_value;		/* value of integer parameter */} InfoUnion;typedef struct {	/* ArgListElement: holds subprog argument data */	InfoUnion info;	long size;	BYTE type;	unsigned is_lvalue: 1,		 set_flag: 1,		 assigned_flag: 1,		 used_before_set: 1,		 array_var: 1,		 array_element: 1,		 declared_external: 1;} ArgListElement;typedef struct ALHead {	    /* ArgListHeader: head node of argument list */	long size;	BYTE type;	short numargs;	ArgListElement *arg_array;	struct gSymtEntry *module;	char *filename,*topfile;	unsigned	     line_num,	     is_defn: 1,	     is_call: 1,	     external_decl: 1,	/* EXTERNAL decl, not arg list */             actual_arg: 1;	/* subprog passed as arg */	struct ALHead *next;} ArgListHeader;		/* Symbol table common block list declarations */typedef struct {	/* ComListElement: holds common var data */	unsigned long dimen_info;	long size;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -