|
|
1.1 root 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 7.1 2/5/81
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: /* error number definitions */
43: # define SYMERR 2600 /* syntactic error */
44: # define STRTERM 2700 /* non term string */
45: # define STRLONG 2701 /* string too long */
46: # define BADOP 2702 /* can't find operator in tables */
47: # define NAMELONG 2703 /* name too long */
48: # define SBUFOFLO 2704 /* over flow symbol table */
49: # define COMMTERM 2705 /* non term comment */
50: # define FCONSTERR 2707 /* float constant error */
51: # define CNTRLCHR 2708 /* control char from equel */
52: # define NUMBUFOFLO 2709 /* buffer oflo in number.c */
53: /* error number for yacc stack overflow */
54: # define YOVRFLOW 2800 /* if yacc stack ^ */
55:
56: /* KEYWORD and OPERATOR TABLE */
57: struct optab /* key word/operator tables */
58: {
59: char *term; /* key word/operator body */
60: int token; /* associated parser token */
61: int opcode; /* associated parser opcode */
62: };
63:
64: /* SPECIAL TOKENS for scanner */
65: struct special
66: {
67: int sconst;
68: int bgncmnt;
69: int endcmnt;
70: int i2const;
71: int i4const;
72: int f4const;
73: int f8const;
74: int name;
75: };
76:
77: /* last token struct */
78: struct lastok
79: {
80: int toktyp;
81: char *tok;
82: int tokop;
83: };
84:
85: /* declarations */
86: struct special Tokens; /* special tokens table */
87: struct optab Optab[]; /* operator table */
88: struct optab Keyword[]; /* keyword table */
89: struct lastok Lastok;
90: int Opcode; /* opcode for current token */
91: int Lcase; /* UPPER->lower conversion flag */
92: int Pars; /* flag for call to getcvar or not */
93: int Newline; /* set if last char read was a newline */
94: int Cflag; /* set if line of C-code recognized */
95: int Keyent; /* number of entries in the Keyword table */
96:
97: char Sbuf[SBUFSIZ]; /* symbol table buffer */
98: /*
99: ** TRACE FLAG ASSIGNMENTS
100: ** Comment, Expand 70
101: ** Name, String 71
102: ** Number, Yylex 72
103: ** Operator 73
104: ** Inout 74
105: */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.