diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2002-04-28 19:42:54 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-04-28 19:42:54 +0000 |
commit | 87ed109f1f7fab7afc05afca460523a2493c0f43 (patch) | |
tree | c4adc85edfa9fa27de90af625624219e92a87257 /gcc/cpplib.h | |
parent | 14dbfa70082438ba474626d210d4f151354e10d0 (diff) | |
download | gcc-87ed109f1f7fab7afc05afca460523a2493c0f43.zip gcc-87ed109f1f7fab7afc05afca460523a2493c0f43.tar.gz gcc-87ed109f1f7fab7afc05afca460523a2493c0f43.tar.bz2 |
cppexp.c (lex): Update to use state.skip_eval.
* cppexp.c (lex): Update to use state.skip_eval.
(struct op): Remove prio and flags members.
(FLAG_BITS, FLAG_MASK, PRIO_SHIFT, EXTRACT_PRIO, EXTRACT_FLAGS,
SHORT_CIRCUIT, RIGHT_ASSOC, ..._PRIO, op_to_prio): Remove.
(LEFT_ASSOC): New macro.
(optab): New table of operator priorities and flags.
(SHIFT): Update.
(_cpp_parse_expr): Clean up logic. Return bool. Use a
malloc-ed parser stack.
(reduce): New; reduce the operator stack.
(_cpp_expand_op_stack): Expand the operator stack as necessary.
* cpphash.h (struct op): Predeclare.
(struct cpp_reader): New members op_stack, op_limit.
(struct lexer_state): New member skip_eval.
(_cpp_parse_expr): Update.
(_cpp_expand_op_stack): New.
* cpplib.c (do_if): Update.
* cppinit.c (cpp_create_reader): Create op stack.
(cpp_destroy): And destroy it.
* cpplib.h (CPP_LAST_CPP_OP): Correct.
(TTYPE_TABLE): Correct.
testsuite:
* gcc.dg/cpp/if-mop.c: Update.
* gcc.dg/cpp/if-mpar.c: Add test.
* gcc.dg/cpp/if-oppr.c: Update.
From-SVN: r52853
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r-- | gcc/cpplib.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h index 164c4c8..bbf272b 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -58,7 +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 CPP_LAST_CPP_OP CPP_LESS_EQ #define TTYPE_TABLE \ OP(CPP_EQ = 0, "=") \ @@ -86,13 +86,13 @@ struct file_name_map_list; OP(CPP_COMMA, ",") /* grouping */ \ OP(CPP_OPEN_PAREN, "(") \ OP(CPP_CLOSE_PAREN, ")") \ + TK(CPP_EOF, SPELL_NONE) \ OP(CPP_EQ_EQ, "==") /* compare */ \ OP(CPP_NOT_EQ, "!=") \ OP(CPP_GREATER_EQ, ">=") \ OP(CPP_LESS_EQ, "<=") \ \ - /* These 3 are special in preprocessor expressions. */ \ - TK(CPP_EOF, SPELL_NONE) \ + /* These two are unary + / - in preprocessor expressions. */ \ OP(CPP_PLUS_EQ, "+=") /* math */ \ OP(CPP_MINUS_EQ, "-=") \ \ |