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:
10:
11: /* MANIFEST CONSTANTS */
12: # define SBUFSIZ 2000 /* max size of symbol table for */
13: # define MAXSTRING 255 /* max length of strings */
14: # define GOVAL -1 /* semantic value for command names */
15:
16: /* CHARACTER TYPES */
17: # define ALPHA 1
18: # define NUMBR 2
19: # define OPATR 3
20: # define PUNCT 4
21: # define CNTRL 5
22:
23: /* Modes for input from EQUEL front end */
24: # define CVAR_I2 '\1' /* 2 byte integer */
25: # define CVAR_F8 '\4' /* 8 byte floating number */
26: # define CVAR_S '\3' /* string with null byte */
27: # define CVAR_I4 '\6' /* 4 byte integer */
28:
29: /* error number definitions */
30: # define SYMERR 2500 /* syntactic error */
31: # define STRTERM 2700 /* non term string */
32: # define STRLONG 2701 /* string too long */
33: # define BADOP 2702 /* can't find operator in tables */
34: # define NAMELONG 2703 /* name too long */
35: # define SBUFOFLO 2704 /* over flow symbol table */
36: # define COMMTERM 2705 /* non term comment */
37: # define FCONSTERR 2707 /* float constant error */
38: # define CNTRLCHR 2708 /* control char from equel */
39: # define NUMBUFOFLO 2709 /* buffer oflo in number.c */
40:
41: /* KEYWORD and OPERATOR TABLE */
42: struct optab /* key word/operator tables */
43: {
44: char *term; /* key word/operator body */
45: int token; /* associated parser token */
46: int opcode; /* associated parser opcode */
47: };
48:
49: /* SPECIAL TOKENS for scanner */
50: struct special
51: {
52: int sconst;
53: int bgncmnt;
54: int endcmnt;
55: int i2const;
56: int i4const;
57: int f4const;
58: int f8const;
59: int name;
60: };
61:
62: /* last token struct */
63: struct lastok
64: {
65: int toktyp;
66: char *tok;
67: int tokop;
68: };
69:
70: /* declarations */
71: struct special Tokens; /* special tokens table */
72: struct optab Optab[]; /* operator table */
73: struct optab Keyword[]; /* keyword table */
74: struct lastok Lastok;
75: int Opcode; /* opcode for current token */
76: int Lcase; /* UPPER->lower conversion flag */
77: int Pars; /* flag for call to getcvar or not */
78: int Newline; /* set if last char read was a newline */
79: int Cflag; /* set if line of C-code recognized */
80: int Keyent; /* number of entries in the Keyword table */
81:
82: char Sbuf[SBUFSIZ]; /* symbol table buffer */
83: /*
84: ** TRACE FLAG ASSIGNMENTS
85: ** Comment, Expand 70
86: ** Name, String 71
87: ** Number, Yylex 72
88: ** Operator 73
89: ** Inout 74
90: */
Defined variables
Cflag
defined in line
79;
never used
Lastok
defined in line
74; used 23 times
Lcase
defined in line
76; used 22 times
- in /usr/ingres/source/parser/control.c line
52
- in /usr/ingres/source/scanner/inout.c line
29
- in /usr/ingres/source/scanner/number.c line
27-28(2),
102
- in /usr/ingres/source/scanner/operator.c line
20-21(2),
30,
57,
63
- in /usr/ingres/source/scanner/string.c line
26-27(2),
33,
44,
54,
66,
77
- in /usr/ingres/source/scanner/yylex.c line
100-101(2),
113-118(2),
125
Optab
defined in line
72; used 4 times
Pars
defined in line
77; used 2 times
Sbuf
defined in line
82; used 2 times
Tokens
defined in line
71; used 16 times
Defined struct's
optab
defined in line
42; used 10 times
Defined macros
ALPHA
defined in line
17; used 54 times
BADOP
defined in line
33; used 1 times
CNTRL
defined in line
21; used 31 times
GOVAL
defined in line
14; used 2 times
NUMBR
defined in line
18; used 16 times
OPATR
defined in line
19; used 32 times
PUNCT
defined in line
20; used 4 times
Usage of this include