1: #
   2: /*
   3: **  GLOBALS.H -- Equel declarations
   4: **
   5: **	Defines:
   6: **		Structures and variables
   7: **		used in Equel.
   8: **
   9: **	Required By:
  10: **		most of the routines in the precompiler.
  11: **
  12: **	Compilation Flags:
  13: **		xDEBUG -- for Chardebug, to provide compatability
  14: **			with older Equels' "-c" flag, and for
  15: **			Lex_debug for the "-v" flag.
  16: **
  17: **	Files:
  18: **		constants.h -- for manifest constants
  19: **
  20: **	History:
  21: **		5/26/78 -- (marc) written
  22: **		8/24/78 -- (marc) modified for including structures to equel.
  23: **			The variables F_locals, F_globals, and Field_indir
  24: **			were added, and the special sructure was extended.
  25: */
  26: 
  27: 
  28: 
  29: /*
  30: **	Structure declarations
  31: */
  32: 
  33: 
  34:     /* parser keyword and operator table node */
  35: 
  36: struct optab
  37: {
  38:     char    *op_term;   /* pointer to terminal */
  39:     int     op_token;   /* lexical token */
  40:     int     op_code;    /* code to distinguish different op_terms
  41: 				 * with the same .op_token
  42: 				 */
  43: };
  44: 
  45: 
  46:     /* C variable tree node */
  47: 
  48: struct cvar
  49: {
  50:     char        *c_id;      /* identifier */
  51:     char        c_type;     /* type */
  52:     char        c_indir;    /* indirection level (- 1 for strings) */
  53:     struct cvar *c_left;    /* < sub-tree */
  54:     struct cvar *c_right;   /* > sub-tree */
  55: };
  56: 
  57:     /* Display structures (linked list of strings) */
  58: 
  59: struct disp_node
  60: {
  61:     char            *d_elm;     /* display element */
  62:     struct disp_node    *d_next;    /* next node */
  63:     int         d_line; /* for Symsp nodes, line
  64: 					 * where lexeme was seen
  65: 					 */
  66: };
  67: 
  68: struct display
  69: {
  70:     struct disp_node    *disp_first;    /* first node in display */
  71:     struct disp_node    *disp_last; /* last node in display */
  72: };
  73: 
  74:     /* Retrieval list */
  75: 
  76: struct ret_var
  77: {
  78:     char        *r_elm;     /* string invoking variable
  79: 					 * e.g. "*intpa [2]"
  80: 					 */
  81:     struct ret_var  *r_next;    /* next variable used in "tupret" */
  82:     char        r_type;     /* type of variable */
  83: };
  84: 
  85: struct ret_list
  86: {
  87:     struct ret_var  *ret_first; /* first node in ret_var chain */
  88:     struct ret_var  *ret_last;  /* last node in chain */
  89: };
  90: 
  91: 
  92:     /* "# include" file processing stack (list) */
  93: 
  94: struct inc_file
  95: {
  96:     int     inc_yyline; /* old file's yyline */
  97:     int     inc_lineout;    /*  "    "     Lineout */
  98:     char        *inc_fid;   /* name */
  99:     FILE        *inc_infile;    /* In_file */
 100:     FILE        *inc_outfile;   /* Out_file */
 101:     struct inc_file *inc_next;
 102: };
 103: 
 104: 
 105: /*
 106: ** Structure for yacc generated terminal codes
 107: **	This avoids having to include functions in
 108: **	[grammar.y] for the function to know the
 109: **	parser generated token numbers.
 110: */
 111: 
 112: struct special
 113: {
 114:     int sp_name;        /* NAME */
 115:     int sp_sconst;      /* SCONST */
 116:     int sp_i2const;     /* I2CONST */
 117:     int sp_i4const;     /* I4CONST */
 118:     int sp_f8const;     /* F8CONST */
 119:     int sp_quote;       /* QUOTE */
 120:     int sp_bgncmnt;     /* BGNCMNT */
 121:     int sp_endcmnt;     /* ENDCMNT */
 122:     int sp_c_code;      /* C_CODE */
 123:     int sp_struct_var;
 124: };
 125: 
 126: 
 127: /*
 128: **	Global definitions
 129: */
 130: 
 131: int     Opcode;         /* operator code to distinguis tokens */
 132: extern int  yychar;         /* yacc input token */
 133: extern int  yyline;         /* yacc external line counter */
 134: extern int  yylval;         /* yacc external stack variable */
 135: extern int  yydebug;        /* set by "-y" command line arg,
 136: 					 * has yacc parser give details
 137: 					 * of parse
 138: 					 */
 139: int     Newline;        /* less than one token has been
 140: 					 * read from the input line, and
 141: 					 *  yylex isn't sure yet whether it is
 142: 					 * C_CODE or not
 143: 					 */
 144: int     Lineout;        /* output line count */
 145: int     In_quote;       /* set if inside an IIwrite("... */
 146: char        *Input_file_name;   /* input file name */
 147: int     Type_spec;      /* used in parser, in C-declarations */
 148: int         C_code_flg;     /* set to indicate C-code in scanner */
 149: int         Pre_proc_flg;       /* set to indicate a
 150: 					 * pre-processor line
 151: 					 */
 152: int     Block_level;        /* > 0 local, 0 global */
 153: int     Indir_level;        /* holds indirection level
 154: 					 * of a reference to a C-var
 155: 					 */
 156: int     Field_indir;        /* indirection on a field of
 157: 					 * a structure variable
 158: 					 */
 159: int     Opflag;         /* mode in which to interpret syntax */
 160: int     In_string;      /* set if output is in a string */
 161: int     Fillmode;       /* set if output line is being filled */
 162: int     Fillcnt;        /* count to fill a line to */
 163: int     Charcnt;        /* # chars written onto output line */
 164: int     Lastc;          /* type of last char read (OPCHAR or
 165: 					 * KEYCHAR)
 166: 					 */
 167: int     Arg_error;      /* set in argproc() [main.c] on
 168: 					 * error in prcessing command line
 169: 					 * arguments.
 170: 					 */
 171: int     Rtdb;           /* set by "-d" command line arg,
 172: 					 * supplies equel runtime support
 173: 					 * with info to report file name
 174: 					 * and line number in case of an
 175: 					 * error
 176: 					 */
 177: int     Kwrdnum;        /* # of entries in Kwrdtab [tokens.y] */
 178: char        Line_buf [MAXSTRING + 1];   /* buffer for input line */
 179: char        *Line_pos;      /* position in input line */
 180: int     Peekc [2];      /* holds backup character */
 181: int     Struct_flag;        /* while processing a structure
 182: 					 * variable declaration, is set
 183: 					 */
 184: struct cvar *Cvarp, *Fieldp;        /* to process C variables */
 185: 
 186: 
 187: 
 188: struct optab        Kwrdtab []; /* table of key words [tokens.y] */
 189: struct optab        Optab [];   /* table of operators [tokens.y] */
 190: struct special      Tokens;     /* holds yacc generated lex codes
 191: 					 * [tokens.y]
 192: 					 */
 193: char            Cmap [];    /* a type for each character [cmap.c] */
 194: struct cvar     *C_globals; /* Global C-variable tree */
 195: struct cvar     *C_locals;  /* Local C-variable tree */
 196: struct cvar     *F_locals;  /* Local structure fields */
 197: struct cvar     *F_globals; /* Global structure fields */
 198: struct display      Displays [1];   /* Cv_display is set to point at this
 199: 					 * so that Cv_display may be passed
 200: 					 * as a parameter instead of &Cv_display
 201: 					 */
 202: struct display      *Cv_display;    /* display into which "cvarx"'s
 203: 					 * get put
 204: 					 */
 205: struct display      Symsp;      /* storage for symbols read by
 206: 					 * yylex()
 207: 					 */
 208: struct ret_list     Ret_list;   /* list of variables in a "ctlelm" */
 209: struct inc_file     *Inc_files; /* stack of files pushed by #includes */
 210: 
 211: 
 212: 
 213: 
 214: /*
 215: **	I/O manipulation data structures
 216: */
 217: 
 218: FILE    *In_file;       /* input file */
 219: FILE    *Out_file;      /* output file */
 220: 
 221: # ifdef xDEBUG
 222: char    Lex_debug;      /* debugging info for lexemes in yylex()
 223: 				 * [yylex.c]
 224: 				 */
 225: char    Chardebug;      /* print debugging info for routine
 226: 				 * in getch.c
 227: 				 */
 228: # endif

Defined variables

Arg_error defined in line 167; used 3 times
C_code_flg defined in line 148; used 5 times
Cv_display defined in line 202; used 26 times
Cvarp defined in line 184; used 29 times
Displays defined in line 198; used 1 times
Field_indir defined in line 156; used 9 times
Fieldp defined in line 184; used 32 times
Fillcnt defined in line 162; used 6 times
Indir_level defined in line 153; used 16 times
Kwrdnum defined in line 177; used 2 times
Kwrdtab defined in line 188; used 1 times
Lastc defined in line 164; used 5 times
Opflag defined in line 159; used 51 times
Peekc defined in line 180; used 11 times
Ret_list defined in line 208; used 3 times
Rtdb defined in line 171; used 3 times
Struct_flag defined in line 181; used 4 times
Symsp defined in line 205; used 2 times
Type_spec defined in line 147; used 12 times

Defined struct's

cvar defined in line 48; used 54 times
disp_node defined in line 59; used 236 times
display defined in line 68; used 26 times
inc_file defined in line 94; used 10 times
ret_list defined in line 85; used 6 times
ret_var defined in line 76; used 14 times
special defined in line 112; used 2 times
  • in line 190(2)

Usage of this include

Last modified: 1995-02-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3696
Valid CSS Valid XHTML 1.0 Strict