|
|
1.1 root 1: /* Define constants and variables for communication with cp-parse.y.
2: Copyright (C) 1987, 1992, 1993 Free Software Foundation, Inc.
3: Hacked by Michael Tiemann ([email protected])
4: and by Brendan Kehoe ([email protected]).
5:
6: This file is part of GNU CC.
7:
8: GNU CC is distributed in the hope that it will be useful,
9: but WITHOUT ANY WARRANTY. No author or distributor
10: accepts responsibility to anyone for the consequences of using it
11: or for whether it serves any particular purpose or works at all,
12: unless he says so in writing. Refer to the GNU CC General Public
13: License for full details.
14:
15: Everyone is granted permission to copy, modify and redistribute
16: GNU CC, but only under the conditions described in the
17: GNU CC General Public License. A copy of this license is
18: supposed to have been given to you along with GNU CC so you
19: can know your rights and responsibilities. It should be in a
20: file named COPYING. Among other things, the copyright notice
21: and this notice must be preserved on all copies. */
22:
23:
24:
25: enum rid
26: {
27: RID_UNUSED,
28: RID_INT,
29: RID_CHAR,
30: RID_WCHAR,
31: RID_FLOAT,
32: RID_DOUBLE,
33: RID_VOID,
34:
35: /* C++ extension */
36: RID_CLASS,
37: RID_RECORD,
38: RID_UNION,
39: RID_ENUM,
40: RID_LONGLONG,
41:
42: /* This is where grokdeclarator starts its search when setting the specbits.
43: The first seven are in the order of most frequently used, as found
44: building libg++. */
45:
46: RID_EXTERN,
47: RID_CONST,
48: RID_LONG,
49: RID_TYPEDEF,
50: RID_UNSIGNED,
51: RID_SHORT,
52: RID_INLINE,
53:
54: RID_STATIC,
55:
56: RID_REGISTER,
57: RID_VOLATILE,
58: RID_FRIEND,
59: RID_VIRTUAL,
60: RID_PUBLIC,
61: RID_PRIVATE,
62: RID_PROTECTED,
63: RID_SIGNED,
64: RID_EXCEPTION,
65: RID_RAISES,
66: RID_AUTO,
67: RID_MUTABLE,
68:
69: #ifdef OBJCPLUS
70: RID_IN, /* begin Objective-C type modifiers */
71: RID_OUT,
72: RID_INOUT,
73: RID_BYCOPY,
74: RID_ONEWAY,
75: RID_ID, /* end Objective-C type modifiers */
76: #endif
77:
78: /* Before adding enough to get up to 64, the RIDBIT_* macros
79: will have to be changed a little. */
80:
81: RID_MAX
82: };
83:
84: #define NORID RID_UNUSED
85:
86: #define RID_FIRST_MODIFIER RID_EXTERN
87:
88: /* The type that can represent all values of RIDBIT. */
89: /* We assume that we can stick in at least 32 bits into this. */
90: typedef struct { unsigned long idata[2]; }
91: RID_BIT_TYPE;
92:
93: /* Be careful, all these modify N twice. */
94: #define RIDBIT_SETP(N, V) (((unsigned long)1 << (int) ((N)%32)) \
95: & (V).idata[(N)/32])
96: #define RIDBIT_NOTSETP(NN, VV) (! RIDBIT_SETP (NN, VV))
97: #define RIDBIT_SET(N, V) do { \
98: (V).idata[(N)/32] \
99: |= ((unsigned long)1 << (int) ((N)%32)); \
100: } while (0)
101: #define RIDBIT_RESET(N, V) do { \
102: (V).idata[(N)/32] \
103: &= ~((unsigned long)1 << (int) ((N)%32)); \
104: } while (0)
105: #define RIDBIT_RESET_ALL(V) do { \
106: (V).idata[0] = 0; \
107: (V).idata[1] = 0; \
108: } while (0)
109: #define RIDBIT_ANY_SET(V) ((V).idata[0] || (V).idata[1])
110:
111: /* The elements of `ridpointers' are identifier nodes
112: for the reserved type names and storage classes.
113: It is indexed by a RID_... value. */
114: extern tree ridpointers[(int) RID_MAX];
115:
116: /* the declaration found for the last IDENTIFIER token read in.
117: yylex must look this up to detect typedefs, which get token type TYPENAME,
118: so it is left around in case the identifier is not a typedef but is
119: used in a context which makes it a reference to a variable. */
120: extern tree lastiddecl;
121:
122: extern char *token_buffer; /* Pointer to token buffer. */
123:
124: /* Back-door communication channel to the lexer. */
125: extern int looking_for_typename;
126:
127: /* Wrap the current header file in extern "C". */
128: extern int in_c_header;
129:
130: extern tree make_pointer_declarator (), make_reference_declarator ();
131: extern void reinit_parse_for_function ();
132: extern void reinit_parse_for_method ();
133: extern int yylex ();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.