aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/pre_parser.mly
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@college-de-france.fr>2022-05-02 17:31:35 +0200
committerXavier Leroy <xavier.leroy@college-de-france.fr>2022-05-13 11:21:18 +0200
commite44143ad023400c7a8193b7e9fc3b62b9f9614e1 (patch)
treee887f1fac6525441ab4ebdb9de56aa3525eeea0d /cparser/pre_parser.mly
parent1d572b330362711c808094333134ba94fcd7b768 (diff)
downloadcompcert-e44143ad023400c7a8193b7e9fc3b62b9f9614e1.tar.gz
compcert-e44143ad023400c7a8193b7e9fc3b62b9f9614e1.zip
Support _Generic from ISO C 2011
Entirely handled during elaboration. No impact on the verified part of CompCert.
Diffstat (limited to 'cparser/pre_parser.mly')
-rw-r--r--cparser/pre_parser.mly17
1 files changed, 16 insertions, 1 deletions
diff --git a/cparser/pre_parser.mly b/cparser/pre_parser.mly
index cffbd192..ad294398 100644
--- a/cparser/pre_parser.mly
+++ b/cparser/pre_parser.mly
@@ -58,7 +58,7 @@
AUTO REGISTER INLINE NORETURN CHAR SHORT INT LONG SIGNED UNSIGNED FLOAT DOUBLE
UNDERSCORE_BOOL CONST VOLATILE VOID STRUCT UNION ENUM CASE DEFAULT IF ELSE
SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN BUILTIN_VA_ARG ALIGNOF
- ATTRIBUTE ALIGNAS PACKED ASM BUILTIN_OFFSETOF STATIC_ASSERT
+ ATTRIBUTE ALIGNAS PACKED ASM BUILTIN_OFFSETOF STATIC_ASSERT GENERIC
%token EOF
@@ -248,6 +248,21 @@ primary_expression:
| CONSTANT
| string_literals_list
| LPAREN expression RPAREN
+| generic_selection
+ {}
+
+generic_selection:
+| GENERIC LPAREN assignment_expression COMMA generic_assoc_list RPAREN
+ {}
+
+generic_assoc_list:
+| generic_association
+| generic_assoc_list COMMA generic_association
+ {}
+
+generic_association:
+| type_name COLON assignment_expression
+| DEFAULT COLON assignment_expression
{}
postfix_expression: