cc: add += and function pointers
This commit is contained in:
@@ -55,7 +55,7 @@ initializer_list: "{" [init_list_field ("," init_list_field)* ","? ] "}"
|
||||
|
||||
?prec14_expr: prec13_expr
|
||||
| prec2_expr "=" prec14_expr -> assignment
|
||||
| prec2_expr "+=" prec14_expr
|
||||
| prec2_expr "+=" prec14_expr -> add_ass
|
||||
| prec2_expr "-=" prec14_expr
|
||||
| prec2_expr "*=" prec14_expr
|
||||
| prec2_expr "/=" prec14_expr
|
||||
@@ -104,7 +104,7 @@ initializer_list: "{" [init_list_field ("," init_list_field)* ","? ] "}"
|
||||
| "-" prec2_expr
|
||||
| "!" prec2_expr -> bool_not
|
||||
| "~" prec2_expr
|
||||
| "(" type ")" prec2_expr -> cast
|
||||
| "(" (type | funptr_type) ")" prec2_expr -> cast
|
||||
| "*" prec2_expr -> dereference
|
||||
| "&" prec2_expr -> address_of
|
||||
| "sizeof" prec2_expr -> sizeof
|
||||
@@ -131,6 +131,7 @@ type: type_qualifier* IDENTIFIER
|
||||
| struct_type
|
||||
| type "*" -> pointer
|
||||
?array_size: INT
|
||||
funptr_type: type "(" "*" ")" "(" [fun_param ("," fun_param)*] ")"
|
||||
|
||||
?type_qualifier: "volatile" -> volatile
|
||||
| "const" -> const
|
||||
|
Reference in New Issue
Block a user