]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/c-exp.y
gdb: merge error handling from different expression parsers
authorAndrew Burgess <aburgess@redhat.com>
Tue, 2 Jan 2024 14:02:44 +0000 (14:02 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Thu, 4 Jan 2024 09:24:18 +0000 (09:24 +0000)
commite89496f42ac7b2d6fbba15f98f3caf496de050f4
tree0e411dc7a998c3a56e25bba1adde8ad2642d4122
parentc9f1e0dfc8f02a7772aa383cc305d9049075d1d8
gdb: merge error handling from different expression parsers

Many (all?) of the expression parsers implement yyerror to handle
parser errors, and all of these functions are basically identical.

This commit adds a new parser_state::parse_error() function, which
implements the common error handling code, this function can then be
called from all the different yyerror functions.

The benefit of this is that (in a future commit) I can improve the
error output, and all the expression parsers will benefit.

This commit is pure refactoring though, and so, there should be no
user visible changes after this commit.

Approved-By: John Baldwin <jhb@FreeBSD.org>
gdb/ada-exp.y
gdb/c-exp.y
gdb/d-exp.y
gdb/f-exp.y
gdb/go-exp.y
gdb/m2-exp.y
gdb/p-exp.y
gdb/parse.c
gdb/parser-defs.h