support __alignof__ expressions like sizeof()

This commit is contained in:
josh committed 2018-05-12 14:55:39 -04:00
1 parent db98fc1c7e
commit f3c1570c1f
2 files changed
+4 -1

No files matched your search

+1
View File
@@ -121,6 +121,7 @@ break return BREAK;
continue return CONTINUE;
sizeof return SIZEOF;
__alignof__ return ALIGNOF;
__attribute__ return ATTRIBUTE;
__restrict return RESTRICT;
+3 -1
View File
@@ -103,7 +103,7 @@ int yylex(YYSTYPE *, YYLTYPE *);
%token CONTINUE;
%token SIZEOF;
%token ALIGNOF;
%token CHAR_CONST;
%token INT_CONST;
@@ -162,6 +162,8 @@ unary_expression
| unary_operator cast_expression
| SIZEOF unary_expression
| SIZEOF LPAREN type_name RPAREN
| ALIGNOF unary_expression
| ALIGNOF LPAREN type_name RPAREN
;
unary_operator