aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-parse.in
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-03-18 21:32:24 +0000
committerRichard Stallman <rms@gnu.org>1993-03-18 21:32:24 +0000
commit12d073e7c8c70ff2df0871bfa5cdf39c122ebac3 (patch)
treec95838d773865e0cf12aecdc6e2c859ea1c17db1 /gcc/c-parse.in
parent0c9cfa6f4fcdb6c403de359fe354406acda454fe (diff)
downloadgcc-12d073e7c8c70ff2df0871bfa5cdf39c122ebac3.zip
gcc-12d073e7c8c70ff2df0871bfa5cdf39c122ebac3.tar.gz
gcc-12d073e7c8c70ff2df0871bfa5cdf39c122ebac3.tar.bz2
(REALPART, IMAGPART): New token types.
(unary_expr): Handle REALPART, IMAGPART. From-SVN: r3780
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r--gcc/c-parse.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 898d407..39428d0 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -131,6 +131,7 @@ void yyerror ();
%token SIZEOF ENUM STRUCT UNION IF ELSE WHILE DO FOR SWITCH CASE DEFAULT
%token BREAK CONTINUE RETURN GOTO ASM_KEYWORD TYPEOF ALIGNOF ALIGN
%token ATTRIBUTE EXTENSION LABEL
+%token REALPART IMAGPART
/* Add precedence rules to solve dangling else s/r conflict */
%nonassoc IF
@@ -439,6 +440,14 @@ unary_expr:
{ $$ = c_alignof_expr ($2); }
| ALIGNOF '(' typename ')' %prec HYPERUNARY
{ $$ = c_alignof (groktypename ($3)); }
+ | REALPART unary_expr %prec UNARY
+ { $$ = build_unary_op (REALPART_EXPR, $2, 0); }
+ | IMAGPART unary_expr %prec UNARY
+ { $$ = build_unary_op (IMAGPART_EXPR, $2, 0); }
+ | REALPART '(' unary_expr ')' %prec HYPERUNARY
+ { $$ = build_unary_op (REALPART_EXPR, $3, 0); }
+ | IMAGPART '(' unary_expr ')' %prec HYPERUNARY
+ { $$ = build_unary_op (IMAGPART_EXPR, $3, 0); }
;
cast_expr: