|
|
1.1.1.2 root 1: /* Define constants and variables for communication with cp-parse.y.
1.1.1.3 root 2: Copyright (C) 1987, 1992, 1993 Free Software Foundation, Inc.
3: Hacked by Michael Tiemann ([email protected])
4: and by Brendan Kehoe ([email protected]).
1.1 root 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,
1.1.1.3 root 30: RID_WCHAR,
1.1 root 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:
1.1.1.3 root 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,
1.1 root 50: RID_UNSIGNED,
51: RID_SHORT,
1.1.1.3 root 52: RID_INLINE,
53:
1.1 root 54: RID_STATIC,
1.1.1.3 root 55:
1.1 root 56: RID_REGISTER,
57: RID_VOLATILE,
58: RID_FRIEND,
59: RID_VIRTUAL,
60: RID_PUBLIC,
61: RID_PRIVATE,
62: RID_PROTECTED,
1.1.1.3 root 63: RID_SIGNED,
64: RID_EXCEPTION,
65: RID_RAISES,
66: RID_AUTO,
1.1.1.4 ! root 67: RID_MUTABLE,
! 68: /* Before adding enough to get up to 64, the RIDBIT_* macros
! 69: will have to be changed a little. */
1.1 root 70: RID_MAX
71: };
72:
1.1.1.2 root 73: #define NORID RID_UNUSED
74:
1.1.1.3 root 75: #define RID_FIRST_MODIFIER RID_EXTERN
76:
1.1.1.4 ! root 77: /* The type that can represent all values of RIDBIT. */
! 78: /* We assume that we can stick in at least 32 bits into this. */
! 79: typedef struct { unsigned long idata[2]; }
! 80: RID_BIT_TYPE;
! 81:
! 82: /* Be careful, all these modify N twice. */
! 83: #define RIDBIT_SETP(N, V) (((unsigned long)1 << (int) ((N)%32)) \
! 84: & (V).idata[(N)/32])
! 85: #define RIDBIT_NOTSETP(NN, VV) (! RIDBIT_SETP (NN, VV))
! 86: #define RIDBIT_SET(N, V) do { \
! 87: (V).idata[(N)/32] \
! 88: |= ((unsigned long)1 << (int) ((N)%32)); \
! 89: } while (0)
! 90: #define RIDBIT_RESET(N, V) do { \
! 91: (V).idata[(N)/32] \
! 92: &= ~((unsigned long)1 << (int) ((N)%32)); \
! 93: } while (0)
! 94: #define RIDBIT_RESET_ALL(V) do { \
! 95: (V).idata[0] = 0; \
! 96: (V).idata[1] = 0; \
! 97: } while (0)
! 98: #define RIDBIT_ANY_SET(V) ((V).idata[0] || (V).idata[1])
1.1.1.2 root 99:
100: /* The elements of `ridpointers' are identifier nodes
101: for the reserved type names and storage classes.
102: It is indexed by a RID_... value. */
103: extern tree ridpointers[(int) RID_MAX];
104:
105: /* the declaration found for the last IDENTIFIER token read in.
106: yylex must look this up to detect typedefs, which get token type TYPENAME,
107: so it is left around in case the identifier is not a typedef but is
108: used in a context which makes it a reference to a variable. */
109: extern tree lastiddecl;
110:
111: extern char *token_buffer; /* Pointer to token buffer. */
112:
113: /* Back-door communication channel to the lexer. */
114: extern int looking_for_typename;
115:
1.1.1.4 ! root 116: /* Wrap the current header file in extern "C". */
! 117: extern int in_c_header;
! 118:
1.1.1.2 root 119: extern tree make_pointer_declarator (), make_reference_declarator ();
120: extern void reinit_parse_for_function ();
121: extern void reinit_parse_for_method ();
122: extern int yylex ();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.