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
Cmap
defined in line
193; used 12 times
Cv_display
defined in line
202; used 26 times
- in /usr/ingres/source/equel/grammar.y line
295-298(2),
305,
394-398(2),
589,
606,
612,
652,
662,
668-671(2),
695-702(3),
713,
738,
746,
764-768(3),
778,
796,
803,
840,
846
Cvarp
defined in line
184; used 29 times
- in /usr/ingres/source/equel/grammar.y line
291-297(3),
306,
387-390(2),
399,
591,
597(2),
607,
613,
629-632(2),
651,
681,
694-703(4),
712,
758-761(2),
779,
793-795(2),
830-833(2),
847
Fieldp
defined in line
184; used 32 times
- in /usr/ingres/source/equel/grammar.y line
293-296(4),
306,
389-390(3),
399,
591,
607,
613-623(3),
663,
681,
694-703(7),
760-761(3),
779,
794(2),
832(2),
847
Opflag
defined in line
159; used 51 times
- in /usr/ingres/source/equel/grammar.y line
408,
448-452(2),
462,
536,
548,
691,
708,
731-735(2),
743,
763-772(4),
815,
911-912(3),
963-968(2),
975,
982,
990-1000(3),
1007,
1014,
1021,
1028,
1035,
1042,
1050,
1056-1057(2),
1063-1064(2),
1072,
1079-1080(2),
1086,
1093,
1101,
1109,
1115,
1122,
1129,
1136,
1145-1151(3)
Peekc
defined in line
180; used 11 times
Rtdb
defined in line
171; used 3 times
Defined struct's
cvar
defined in line
48; used 54 times
- in line 53-54(4),
184(2),
194-197(8)
- in /usr/ingres/source/equel/cvar.c line
32(2),
76(2),
105(2),
130-138(8),
181-185(6),
246-251(6),
313(2),
330(2),
352(2),
359(2)
- in /usr/ingres/source/equel/grammar.y line
107(2),
113(2)
- in /usr/ingres/source/equel/name.c line
75(2)
disp_node
defined in line
59; used 236 times
- in line 62(2),
70-71(4)
- in /usr/ingres/source/equel/display.c line
86-94(6),
148-151(4),
181(2),
217(2),
264(2)
- in /usr/ingres/source/equel/grammar.y line
177-180(4),
286(2),
292(2),
319-325(8),
424(2),
449(2),
510-515(4),
537(2),
549(2),
558-562(4),
571(2),
584-587(4),
606(2),
612(2),
640(2),
651-652(4),
662-671(8),
684-687(6),
709-718(8),
730(4),
736-738(4),
771-776(4),
788(2),
865(2),
895-901(8),
919-952(24),
962(2),
970(2),
977(2),
984-994(6),
1002(2),
1009(2),
1016(2),
1023(2),
1030(2),
1037(2),
1044-1045(4),
1058(2),
1068(2),
1074(2),
1081(2),
1088(2),
1095-1096(4),
1103(2),
1110(2),
1117(2),
1124(2),
1131(2),
1138(2),
1144(2),
1152(2),
1161(2),
1170-1176(6),
1184(2),
1198-1210(10),
1218-1221(4),
1228-1231(4)
- in /usr/ingres/source/equel/prtout.c line
93(2)
- in /usr/ingres/source/equel/retrieve.c line
57(2)
- in /usr/ingres/source/equel/yyerror.c line
52(2),
113(2)
- in /usr/ingres/source/equel/yylex.c line
108(2)
optab
defined in line
36; used 18 times
Usage of this include