]> gcc.gnu.org Git - gcc.git/commitdiff
(REALPART, IMAGPART): New token types.
authorRichard Stallman <rms@gnu.org>
Thu, 18 Mar 1993 21:32:24 +0000 (21:32 +0000)
committerRichard Stallman <rms@gnu.org>
Thu, 18 Mar 1993 21:32:24 +0000 (21:32 +0000)
(unary_expr): Handle REALPART, IMAGPART.

From-SVN: r3780

gcc/c-parse.in

index 898d407405fad3f91f38b040aa75c166785c34b3..39428d04e21672bc0cc4c331982ea7591d7fee4c 100644 (file)
@@ -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:
This page took 0.058587 seconds and 5 git commands to generate.