/* YACC parser for Pascal expressions, for GDB.
- Copyright (C) 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 2000-2016 Free Software Foundation, Inc.
This file is part of GDB.
#define parse_type(ps) builtin_type (parse_gdbarch (ps))
-/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
- as well as gratuitiously global symbol names, so we can have multiple
- yacc generated parsers in gdb. Note that these are only the variables
- produced by yacc. If other parser generators (bison, byacc, etc) produce
- additional global names that conflict at link time, then those parser
- generators need to be fixed instead of adding those names to this list. */
-
-#define yymaxdepth pascal_maxdepth
-#define yyparse pascal_parse_internal
-#define yylex pascal_lex
-#define yyerror pascal_error
-#define yylval pascal_lval
-#define yychar pascal_char
-#define yydebug pascal_debug
-#define yypact pascal_pact
-#define yyr1 pascal_r1
-#define yyr2 pascal_r2
-#define yydef pascal_def
-#define yychk pascal_chk
-#define yypgo pascal_pgo
-#define yyact pascal_act
-#define yyexca pascal_exca
-#define yyerrflag pascal_errflag
-#define yynerrs pascal_nerrs
-#define yyps pascal_ps
-#define yypv pascal_pv
-#define yys pascal_s
-#define yy_yys pascal_yys
-#define yystate pascal_state
-#define yytmp pascal_tmp
-#define yyv pascal_v
-#define yy_yyv pascal_yyv
-#define yyval pascal_val
-#define yylloc pascal_lloc
-#define yyreds pascal_reds /* With YYDEBUG defined */
-#define yytoks pascal_toks /* With YYDEBUG defined */
-#define yyname pascal_name /* With YYDEBUG defined */
-#define yyrule pascal_rule /* With YYDEBUG defined */
-#define yylhs pascal_yylhs
-#define yylen pascal_yylen
-#define yydefred pascal_yydefred
-#define yydgoto pascal_yydgoto
-#define yysindex pascal_yysindex
-#define yyrindex pascal_yyrindex
-#define yygindex pascal_yygindex
-#define yytable pascal_yytable
-#define yycheck pascal_yycheck
-#define yyss pascal_yyss
-#define yysslim pascal_yysslim
-#define yyssp pascal_yyssp
-#define yystacksize pascal_yystacksize
-#define yyvs pascal_yyvs
-#define yyvsp pascal_yyvsp
-
-#ifndef YYDEBUG
-#define YYDEBUG 1 /* Default to yydebug support */
-#endif
-
-#define YYFPRINTF parser_fprintf
+/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
+ etc). */
+#define GDB_YY_REMAP_PREFIX pascal_
+#include "yy-remap.h"
/* The state of the parser, used internally when we are parsing the
expression. */
struct stoken stringsval;
char *buf;
- buf = alloca (strlen (arrayname) + 1);
+ buf = (char *) alloca (strlen (arrayname) + 1);
stringsval.ptr = buf;
stringsval.length = strlen (arrayname);
strcpy (buf, arrayname);
}
write_exp_elt_opcode (pstate, OP_VAR_VALUE);
- /* We want to use the selected frame, not
- another more inner frame which happens to
- be in the same block. */
- write_exp_elt_block (pstate, NULL);
+ write_exp_elt_block (pstate, sym.block);
write_exp_elt_sym (pstate, sym.symbol);
write_exp_elt_opcode (pstate, OP_VAR_VALUE);
current_type = sym.symbol->type; }
so in expression to enter hexadecimal values
we still need to use C syntax with 0xff */
write_dollar_variable (pstate, yylval.sval);
- tmp = alloca (namelen + 1);
+ tmp = (char *) alloca (namelen + 1);
memcpy (tmp, tokstart, namelen);
tmp[namelen] = '\0';
intvar = lookup_only_internalvar (tmp + 1);
struct symbol *cur_sym;
/* As big as the whole rest of the expression, which is
at least big enough. */
- char *ncopy = alloca (strlen (tmp)+strlen (namestart)+3);
+ char *ncopy
+ = (char *) alloca (strlen (tmp) + strlen (namestart)
+ + 3);
char *tmp1;
tmp1 = ncopy;