diff options
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 8890f74..14fd53d 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -170,7 +170,7 @@ static struct stoken operator_stoken (const char *); %type <voidval> exp exp1 type_exp start variable qualified_name lcurly %type <lval> rcurly %type <tval> type typebase -%type <tvec> nonempty_typelist func_mod +%type <tvec> nonempty_typelist func_mod parameter_typelist /* %type <bval> block */ /* Fancy type parsing. */ @@ -254,6 +254,8 @@ static struct stoken operator_stoken (const char *); %type <bval> block %left COLONCOLON +%token DOTDOTDOT + %% @@ -440,7 +442,7 @@ arglist : arglist ',' exp %prec ABOVE_COMMA { arglist_len++; } ; -exp : exp '(' nonempty_typelist ')' const_or_volatile +exp : exp '(' parameter_typelist ')' const_or_volatile { int i; VEC (type_ptr) *type_list = $3; struct type *type_elt; @@ -1025,7 +1027,7 @@ array_mod: '[' ']' func_mod: '(' ')' { $$ = NULL; } - | '(' nonempty_typelist ')' + | '(' parameter_typelist ')' { $$ = $2; } ; @@ -1223,6 +1225,15 @@ typename: TYPENAME } ; +parameter_typelist: + nonempty_typelist + | nonempty_typelist ',' DOTDOTDOT + { + VEC_safe_push (type_ptr, $1, NULL); + $$ = $1; + } + ; + nonempty_typelist : type { @@ -1942,7 +1953,8 @@ static const struct token tokentab3[] = { {">>=", ASSIGN_MODIFY, BINOP_RSH, 0}, {"<<=", ASSIGN_MODIFY, BINOP_LSH, 0}, - {"->*", ARROW_STAR, BINOP_END, 1} + {"->*", ARROW_STAR, BINOP_END, 1}, + {"...", DOTDOTDOT, BINOP_END, 0} }; static const struct token tokentab2[] = |