3 #define IDENTBASE 20000
6 #define VALBASE 1000000
7 #define STRBASE 2000000
8 #define XCOMMENT 3000000
49 #define ISASSIGNMENT(x) (x >= ASSIGNA && x <= ASSIGNLS)
58 // C declaration flags
59 RESERVED_auto
= IDENTBASE
,
72 RESERVED___emit_vtbl__
,
75 #define ISDCLFLAG(x) (x >= RESERVED_auto && x <= RESERVED_virtual)
76 #define ISCDCLFLAG(x) (x <= RESERVED_volatile)
78 // these can define a type
90 #define ISTBASETYPE(x) (x >= RESERVED_long && x <= RESERVED_double)
91 #define ISBUILTIN(x) (x >= RESERVED_void && x <= RESERVED_double)
99 #define ISAGGRSPC(x) (x >= RESERVED_enum && x <= RESERVED_union)
101 // standard C reserved
117 RESERVED___extension__
,
118 RESERVED___attribute__
,
121 // our own lwc reserved words
136 RESERVED_dereference
,
138 RESERVED___declexpr__
,
139 RESERVED__lwc_config_
,
142 #define ISRESERVED(x) (x >= RESERVED_auto && x <= RESERVED__lwc_config_)
144 // * * * * * * * * * * * * * * * * * * *
145 // these below fail the ISRESERVED test
146 // and pass the ISSYMBOL test. they are
147 // not reserved and can be used for
148 // various other things
149 // * * * * * * * * * * * * * * * * * * *
151 #define SYMBASE RESERVED_include
162 RESERVED___VA_ARGS__
,
169 #define ISPREDEF(x) (x >= RESERVED___LINE__ && x <= RESERVED___DATE__)
180 RESERVED___enumstr__
,
193 RESERVED___builtin_alloca
,
197 RESERVED___on_throw__
,
199 RESERVED___builtin_memcpy
,
202 RESERVED___builtin_strncmp
,
203 RESERVED_strncasecmp
,
204 RESERVED___builtin_strncasecmp
,
205 RESERVED___FUNCTION__
,
206 RESERVED___PRETTY_FUNCTION__
,
207 RESERVED___section__
,
210 RESERVED_constructor
,
211 RESERVED___lwc_unwind
,
212 RESERVED___lwc_landingpad
,
230 // operator overloaders -safe-
233 RESERVED_oper_thingy
,
244 RESERVED_oper_andand
,
255 // operator overloaders -unsafe-
259 RESERVED_oper_plusplus
,
260 RESERVED_oper_minusminus
,
261 RESERVED_oper_plusplusp
,
262 RESERVED_oper_minusminusp
,
271 RESERVED_oper_assign
,
274 RESERVED_oper_pointsat
277 #define ISIDENT(x) (x >= IDENTBASE && x < VALBASE)
278 #define ISSYMBOL(x) (x >= SYMBASE && x < VALBASE)
279 static inline int issymbol (int x
) { return ISSYMBOL (x
); }
280 #define ISVALUE(x) (x >= VALBASE)
281 static inline int isvalue (int x
) { return ISVALUE (x
); }
282 #define ISSYMVAL(x) (x >= SYMBASE)
283 static inline int isoperator (int x
)
284 { return x
<= '~' || x
> ELLIPSIS
&& x
<= ASSIGNLS
|| x
== RESERVED_sizeof
; }
285 static inline int isescoperator (int x
)
286 { return x
> ESCBASE
&& x
< IDENTBASE
? x
- ESCBASE
: 0; }
287 #define ISTPLARG(x) (x >= ARGBASE && x < VALBASE)
288 static inline int isaggrspc (int x
) { return ISAGGRSPC(x
); }
289 static inline int isdclflag (int x
) { return ISDCLFLAG (x
); }
292 static inline int isoperfunc (int x
) { return x
>= RESERVED_oper_plus
&& x
<= RESERVED_oper_pointsat
; }
293 static inline int isunsafeop (int x
) { return x
>= RESERVED_oper_star
&& x
<= RESERVED_oper_pointsat
; }
295 // these are special values -- they match ISVALUE
297 RESERVED_0
= VALBASE
,