summaryrefslogtreecommitdiffstats
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-26 06:32:50 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-26 06:32:50 +0000
commit87215b905fa696bfb36549cc49d36c815f022392 (patch)
tree41b138ea9b50f42af72e2ae19543c9e1a16ce126 /gcc/cpplib.h
parentdeae487ab287f34088fdbdd50375dbfc954ad24f (diff)
downloadppe42-gcc-87215b905fa696bfb36549cc49d36c815f022392.tar.gz
ppe42-gcc-87215b905fa696bfb36549cc49d36c815f022392.zip
* cppexp.c (CPP_UMINUS, CPP_UPLUS): New.
(HAVE_NO_R_OPERAND): Remove. (HAVE_VALUE): Remove. (op_to_prio): Update. (UNARY): Don't alter flags. (_cpp_parse_expr): want_value used to indicate whether a number or unary operator is expected next. Distinguish unary and binary +/-. (op_as_text): Update for unary operators. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52780 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 765d65a3869..164c4c8b5b5 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -46,9 +46,9 @@ typedef struct cpp_callbacks cpp_callbacks;
struct answer;
struct file_name_map_list;
-/* The first two groups, apart from '=', can appear in preprocessor
- expressions. This allows a lookup table to be implemented in
- _cpp_parse_expr.
+/* The first three groups, apart from '=', can appear in preprocessor
+ expressions (+= and -= are used to indicate unary + and - resp.).
+ This allows a lookup table to be implemented in _cpp_parse_expr.
The first group, to CPP_LAST_EQ, can be immediately followed by an
'='. The lexer needs operators ending in '=', like ">>=", to be in
@@ -58,6 +58,7 @@ struct file_name_map_list;
#define CPP_LAST_EQ CPP_MAX
#define CPP_FIRST_DIGRAPH CPP_HASH
#define CPP_LAST_PUNCTUATOR CPP_DOT_STAR
+#define CPP_LAST_CPP_OP CPP_EOF
#define TTYPE_TABLE \
OP(CPP_EQ = 0, "=") \
@@ -90,8 +91,11 @@ struct file_name_map_list;
OP(CPP_GREATER_EQ, ">=") \
OP(CPP_LESS_EQ, "<=") \
\
+ /* These 3 are special in preprocessor expressions. */ \
+ TK(CPP_EOF, SPELL_NONE) \
OP(CPP_PLUS_EQ, "+=") /* math */ \
OP(CPP_MINUS_EQ, "-=") \
+\
OP(CPP_MULT_EQ, "*=") \
OP(CPP_DIV_EQ, "/=") \
OP(CPP_MOD_EQ, "%=") \
@@ -135,8 +139,7 @@ struct file_name_map_list;
TK(CPP_COMMENT, SPELL_NUMBER) /* Only if output comments. */ \
/* SPELL_NUMBER happens to DTRT. */ \
TK(CPP_MACRO_ARG, SPELL_NONE) /* Macro argument. */ \
- TK(CPP_PADDING, SPELL_NONE) /* Whitespace for cpp0. */ \
- TK(CPP_EOF, SPELL_NONE) /* End of line or file. */
+ TK(CPP_PADDING, SPELL_NONE) /* Whitespace for cpp0. */
#define OP(e, s) e,
#define TK(e, s) e,
OpenPOWER on IntegriCloud