aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.h
diff options
context:
space:
mode:
authorZack Weinberg <zackw@stanford.edu>2001-07-01 18:48:13 +0000
committerZack Weinberg <zack@gcc.gnu.org>2001-07-01 18:48:13 +0000
commitb8363a243d4778afbdcc3794c86a7e08eb076f76 (patch)
tree3248bbe65b87f7c0868d63322c7f0b313358975f /gcc/c-common.h
parent128e8aa95204284655c889767409150181ce0b19 (diff)
downloadgcc-b8363a243d4778afbdcc3794c86a7e08eb076f76.zip
gcc-b8363a243d4778afbdcc3794c86a7e08eb076f76.tar.gz
gcc-b8363a243d4778afbdcc3794c86a7e08eb076f76.tar.bz2
c-common.h (enum rid): Add RID_FIRST_AT, RID_LAST_AT, RID_LAST_PQ.
* c-common.h (enum rid): Add RID_FIRST_AT, RID_LAST_AT, RID_LAST_PQ. Move RID_FIRST_PQ down with the other FIRST/LAST enumerators. (OBJC_IS_AT_KEYWORD, OBJC_IS_PQ_KEYWORD): New macros. * c-parse.in (OBJC_STRING): Kill. (objc_string): Decompose to [objc_string] '@' STRING. (reswords): Take the leading '@' off all the Objective C keywords. (objc_rid_sans_at): Kill. (init_reswords): Don't initialize it. (yylexname): Use OBJC_IS_AT_KEYWORD and OBJC_IS_PQ_KEYWORD. (_yylex): Kill reconsider label. Look ahead one token after an '@'; if we get an identifier, check whether it's an Objective C @-keyword. If so, return the keyword. Otherwise, put back the token and return the '@' as a terminal. * cpplib.c (lex_macro_node): Remove unnecessary check for leading '@' on identifier. Clarify control flow and commentary. From-SVN: r43674
Diffstat (limited to 'gcc/c-common.h')
-rw-r--r--gcc/c-common.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 05350c1..95ead54 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -63,7 +63,7 @@ enum rid
RID_FRIEND, RID_VIRTUAL, RID_EXPLICIT, RID_EXPORT, RID_MUTABLE,
/* ObjC */
- RID_FIRST_PQ, RID_IN = RID_FIRST_PQ, RID_OUT, RID_INOUT, RID_BYCOPY, RID_BYREF, RID_ONEWAY,
+ RID_IN, RID_OUT, RID_INOUT, RID_BYCOPY, RID_BYREF, RID_ONEWAY,
/* C */
RID_INT, RID_CHAR, RID_FLOAT, RID_DOUBLE, RID_VOID,
@@ -107,9 +107,22 @@ enum rid
RID_MAX,
RID_FIRST_MODIFIER = RID_STATIC,
- RID_LAST_MODIFIER = RID_ONEWAY
+ RID_LAST_MODIFIER = RID_ONEWAY,
+
+ RID_FIRST_AT = RID_AT_ENCODE,
+ RID_LAST_AT = RID_AT_IMPLEMENTATION,
+ RID_FIRST_PQ = RID_IN,
+ RID_LAST_PQ = RID_ONEWAY
};
+#define OBJC_IS_AT_KEYWORD(rid) \
+ ((unsigned int)(rid) >= (unsigned int)RID_FIRST_AT && \
+ (unsigned int)(rid) <= (unsigned int)RID_LAST_AT)
+
+#define OBJC_IS_PQ_KEYWORD(rid) \
+ ((unsigned int)(rid) >= (unsigned int)RID_FIRST_PQ && \
+ (unsigned int)(rid) <= (unsigned int)RID_LAST_PQ)
+
/* The elements of `ridpointers' are identifier nodes for the reserved
type names and storage classes. It is indexed by a RID_... value. */
extern tree *ridpointers;