1: #
2: /*
3: ** SCANNER.H
4: ** contains the global structures and variable declarations needed
5: ** by the lexical analyzer. This includes Manifest Constants and
6: ** certain variables for internal communication purposes. Therefore,
7: ** extreme care should be exercised when modifying this file.
8: **
9: ** Version:
10: ** @(#)scanner.h 8.2 2/8/85
11: */
12:
13:
14: /* MANIFEST CONSTANTS */
15: # define SBUFSIZ 2000 /* max size of symbol table for */
16: # define MAXSTRING 255 /* max length of strings */
17: # define GOVAL -1 /* semantic value for command names */
18:
19: # ifndef WARN
20: # define WARN 0
21: # define FATAL 1
22: # endif
23:
24: /* CONSTANTS FOR THE GET_SCANNER CALL */
25: # define NORMAL 0 /* get a character from front */
26: # define PRIME 1 /* prime the front end */
27: # define SYNC 2 /* sync the front end */
28:
29: /* CHARACTER TYPES */
30: # define ALPHA 1
31: # define NUMBR 2
32: # define OPATR 3
33: # define PUNCT 4
34: # define CNTRL 5
35:
36: /* Modes for input from EQUEL front end */
37: # define CVAR_I2 '\1' /* 2 byte integer */
38: # define CVAR_F8 '\4' /* 8 byte floating number */
39: # define CVAR_S '\3' /* string with null byte */
40: # define CVAR_I4 '\6' /* 4 byte integer */
41:
42: /* Number of PAT_SPEC indices allowed. */
43: /* Already defined in ovqp.h. */
44: /* Temporarily defining here too. */
45: # define PATNUM 10
46:
47: /* Bits used with Patspec_flag[] */
48: # define TARGBIT 1 /* Set when index used in target list */
49: # define QUALBIT 2 /* Set when index used in qual list */
50:
51: /* KEYWORD and OPERATOR TABLE */
52: struct optab /* key word/operator tables */
53: {
54: char *term; /* key word/operator body */
55: int token; /* associated parser token */
56: int opcode; /* associated parser opcode */
57: };
58:
59: /* SPECIAL TOKENS for scanner */
60: struct special
61: {
62: int sconst;
63: int bgncmnt;
64: int endcmnt;
65: int i2const;
66: int i4const;
67: int f4const;
68: int f8const;
69: int name;
70: };
71:
72: /* last token struct */
73: struct lastok
74: {
75: int toktyp;
76: char *tok;
77: int tokop;
78: };
79:
80: /* declarations */
81: struct special Tokens; /* special tokens table */
82: struct optab Optab[]; /* operator table */
83: struct optab Keyword[]; /* keyword table */
84: struct lastok Lastok;
85: int Opcode; /* opcode for current token */
86: int Lcase; /* UPPER->lower conversion flag */
87: int Pars; /* flag for call to getcvar or not */
88: int Newline; /* set if last char read was a newline */
89: int Cflag; /* set if line of C-code recognized */
90: int Keyent; /* number of entries in the Keyword table */
91: unsigned Patspec_flag[PATNUM]; /* Flag array for determining correct */
92: /* usage of PAT_SPEC indices. */
93: /* Patspec_flag[0] is not used. */
94:
95: char Sbuf[SBUFSIZ]; /* symbol table buffer */
96: /*
97: ** TRACE FLAG ASSIGNMENTS
98: ** Comment, Expand 70
99: ** Name, String 71
100: ** Number, Yylex 72
101: ** Operator 73
102: ** Inout 74
103: */
Defined variables
Cflag
defined in line
89;
never used
Lastok
defined in line
84; used 24 times
Lcase
defined in line
86; used 23 times
- in /usr/ingres/source/parser/control.c line
58,
71
- in /usr/ingres/source/parser/get_scan.c line
49
- in /usr/ingres/source/parser/s_number.c line
31-32(2),
106
- in /usr/ingres/source/parser/s_operator.c line
24-25(2),
34,
61,
67
- in /usr/ingres/source/parser/s_string.c line
30-31(2),
37,
48,
58,
70,
81
- in /usr/ingres/source/parser/s_yylex.c line
118-119(2),
131-136(2),
143
Optab
defined in line
82; used 4 times
Pars
defined in line
87; used 3 times
Sbuf
defined in line
95; used 2 times
Tokens
defined in line
81; used 16 times
Defined struct's
optab
defined in line
52; used 14 times
Defined macros
ALPHA
defined in line
30; used 54 times
CNTRL
defined in line
34; used 31 times
FATAL
defined in line
21; used 5 times
GOVAL
defined in line
17; used 2 times
NORMAL
defined in line
25; used 15 times
NUMBR
defined in line
31; used 16 times
OPATR
defined in line
32; used 32 times
PRIME
defined in line
26; used 1 times
PUNCT
defined in line
33; used 4 times
SYNC
defined in line
27; used 1 times
WARN
defined in line
20; used 47 times
- in line 19
- in /usr/ingres/source/parser/control.c line
155,
161
- in /usr/ingres/source/parser/grammar.y line
230,
338,
346,
360,
368,
379,
402,
417,
555,
615,
644,
665,
679,
736,
934,
1060,
1068,
1084,
1093,
1137,
1145,
1153,
1203
- in /usr/ingres/source/parser/par_util.c line
109-112(2),
118,
342,
354,
363,
369,
375,
381,
500
- in /usr/ingres/source/parser/s_name.c line
35
- in /usr/ingres/source/parser/s_number.c line
41,
55,
68,
76,
84
- in /usr/ingres/source/parser/s_operator.c line
63
- in /usr/ingres/source/parser/s_string.c line
72-76(2)
- in /usr/ingres/source/parser/s_yylex.c line
132,
138
Usage of this include