mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
push skeleton doesn't have to list them again for pull mode's yyparse. For push mode, remove yypush_parse's local equivalents of these variables to eliminate unnecessary copying between the two sets at run-time. This patch also fixes at least a bug related to multiple %initial-action invocations in push mode. * data/push.c (b4_declare_parser_variables): Rename to... (b4_declare_scanner_communication_variables): ... this for clarity and update both uses. (b4_declare_yyparse_variables): Remove and move its contents to the one spot where it was invoked. (b4_declare_parser_state_variables): New macro containing the parser state variables required by push mode. (struct yypstate): Replace all fields but yynew with b4_declare_parser_state_variables. (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs, yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define each NAME in this list to yyps->NAME so it can be used in yypush_parse. (yyparse or yypush_parse): For yyparse in pull mode, replace local parser state variable declarations with b4_declare_parser_state_variables. Don't initialize parser state variables when calling yypush_parse since yypstate_new already does that. Invoke the user's initial action only upon the first yypush_parse invocation. Remove all code that copies between the local parser state variables and the yypstate.
-*- outline -*- This directory contains Bison skeletons: the general shapes of the different parser kinds, that are specialized for specific grammars by the bison program. Currently, there are only three supported skeletons: - yacc.c It used to be named bison.simple: it corresponds to C Yacc compatible LALR(1) parsers. - lalr1.cc Produces a C++ parser class. It is still very experimental, and not yet supported. Please, subscribe to bison-patches@gnu.org. - glr.c A Generalized LR C parser based on Bison's LALR(1) tables. These skeletons are the only ones supported by the Bison team. Because the interface between skeletons and the bison program is not finished, *we are not bound to it*. In particular, Bison is not mature enough for us to consider that ``foreign skeletons'' are supported. ----- Copyright (C) 2002 Free Software Foundation, Inc. This file is part of GNU Bison. GNU Bison is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Bison is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.