X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fparser_proc_grammar.y;h=4a1cc1957ec2336d6e60dcee3d8747b21f24e569;hp=408a09337ffa4068f44d773fdec703cde58d81e0;hb=cffcbdd1df9f6d5dcf78f49a3d1b44cefe21b2f5;hpb=b78637d9020222f1032349f231c0dc84a69797bc diff --git a/src/parser_proc_grammar.y b/src/parser_proc_grammar.y index 408a093..4a1cc19 100644 --- a/src/parser_proc_grammar.y +++ b/src/parser_proc_grammar.y @@ -83,6 +83,11 @@ static inline void psi_parser_proc_add_impl(struct psi_parser *P, struct psi_imp #include "plist.h" #include "types/layout.h" +#define yytokentype psi_token_type + +#define PSI_T_CAST PSI_T_EQUALS +#define PSI_T_POINTER PSI_T_ASTERISK + struct psi_parser; } @@ -237,6 +242,21 @@ struct psi_parser; %token CPP_RESTRICT %token CPP_ASM +/* virtual tokens */ +%token BSLASH +%token LONG_DOUBLE +%token INT8 +%token UINT8 +%token INT16 +%token UINT16 +%token INT32 +%token UINT32 +%token INT64 +%token UINT64 +%token INT128 +%token UINT128 + + %precedence IIF COLON %precedence OR %precedence AND @@ -837,8 +857,8 @@ typedef_decl[def]: ; typedef_anon_decl[def]: - typedef_decl -| qualified_decl_type[type] { + typedef_decl %dprec 2 +| qualified_decl_type[type] %dprec 1 { $def = psi_decl_arg_init($type, psi_decl_var_init(NULL, 0, 0)); $def->var->token = psi_token_copy($type->token); } @@ -975,6 +995,9 @@ int_signed_types[type]: %empty { $type = NULL; } +| NAME { + $type = psi_token_copy($NAME); +} | CHAR { $type = psi_token_copy($CHAR); } @@ -1222,10 +1245,10 @@ decl_args[args]: decl_anon_arg[arg]: /* FIXME decl_functor_body_anon */ - decl_arg { + decl_arg %dprec 2 { $arg = $decl_arg; } -| qualified_decl_type[type] indirection { +| qualified_decl_type[type] indirection %dprec 1 { $arg = psi_decl_arg_init( $type, psi_decl_var_init(NULL, $indirection, 0)