aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y28
1 files changed, 20 insertions, 8 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index e16f409..5e6932c 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -42,14 +42,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "symfile.h"
#include "objfiles.h"
-/* Ensure that if the generated parser contains any calls to malloc/realloc,
- that they get mapped to xmalloc/xrealloc. */
-
-#define malloc xmalloc
-#define realloc xrealloc
-
-/* These MUST be included in any grammar file!!!!
- Please choose unique names! */
+/* These MUST be included in any grammar file!!!! Please choose unique names!
+ Note that this are a combined list of variables that can be produced
+ by any one of bison, byacc, or yacc. */
#define yymaxdepth c_maxdepth
#define yyparse c_parse
#define yylex c_lex
@@ -77,6 +72,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define yy_yyv c_yyv
#define yyval c_val
#define yylloc c_lloc
+#define yyss c_yyss /* byacc */
+#define yyssp c_yysp /* byacc */
+#define yyvs c_yyvs /* byacc */
+#define yyvsp c_yyvsp /* byacc */
int
yyparse PARAMS ((void));
@@ -193,9 +192,22 @@ parse_number PARAMS ((char *, int, int, YYSTYPE *));
%token <ssym> BLOCKNAME
%type <bval> block
%left COLONCOLON
+
%%
+%{
+/* Ensure that if the generated parser contains any calls to malloc/realloc,
+ that they get mapped to xmalloc/xrealloc. We have to do this here
+ rather than earlier in the file because this is the first point after
+ the place where the SVR4 yacc includes <malloc.h>, and if we do it
+ before that, then the remapped declarations in <malloc.h> will collide
+ with the ones in "defs.h". */
+
+#define malloc xmalloc
+#define realloc xrealloc
+%}
+
start : exp1
| type_exp
;