Cast attributes are added to the C AST. Parse cast attributes in the C parser and place them in the C AST. The attributes are taken from the type_name rule of the C parser.
Signed-off-by: Jaskaran Singh <jaskaransingh7654...@gmail.com> --- parsing_c/parser_c.mly | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parsing_c/parser_c.mly b/parsing_c/parser_c.mly index 34d234d2..ccdfd7f6 100644 --- a/parsing_c/parser_c.mly +++ b/parsing_c/parser_c.mly @@ -818,7 +818,8 @@ arith_expr: cast_expr: | unary_expr { $1 } - | topar2 type_name tcpar2 cast_expr { mk_e(Cast (snd $2, $4)) [$1;$3] } + | topar2 type_name tcpar2 cast_expr + { mk_e(Cast (snd $2, fst $2, $4)) [$1;$3] } /* It could be useful to have the following, but there is no place for the attribute in the AST. -- 2.21.1 _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci