Joel E. Denny 28e52c0d62 Encapsulate code properties and related functionality for the various
destructors, printers, and actions into a code_props structure and
interface.  This patch merely implements code_props in scan-code.h and
scan-code.l.  Future patches will rewrite other modules to use it.
Discussed starting at
<http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
* src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
consistently initialize const structs that have an empty location
field.
* src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
to ensure consistency.
* src/scan-code.h (code_props): New structure.
(code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
function, macro, and const global variable for initializing a
code_props with no code.
(code_props_plain_init, code_props_symbol_action_init,
code_props_rule_action_init, code_props_translate_code): The rest of
the new code_props functional interface.  Among other things, the init
functions set the code_props kind field so that
code_props_translate_code will know whether to behave like
translate_symbol_action, translate_rule_action, or translate_code.
These old translate functions must remain until all other modules are
updated to use the new code_props interface.
(code_scanner_last_string_free): New function similar to
gram_scanner_last_string_free.
(code_scanner_free): Add documentation.
* src/scan-code.l: Implement the new interface.
(code_lex): Make it static, add a code_props* argument, and remove the
rule argument.
(last_string): New static global similar to the one in scan-gram.l.
(SC_RULE_ACTION): Update to use the code_props* argument to code_lex
instead of rule.
(SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
code_props since Bison may one day use this information for destructors
and printers.
(<*><<EOF>>): Use STRING_FINISH so that last_string is set.
(handle_action_dollar): Use symbol_list_n_get and set used flag
directly since symbol_list_n_used_set is removed.
(translate_action): Add a code_props* argument and remove the rule,
action, and location arguments.  Pass the code_props* on to code_lex.
(translate_rule_action, translate_symbol_action, translate_code):
Rewrite as wrappers around the new code_props interface.
* src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
it would eventually need to break the encapsulation of code_props.
2007-01-02 23:31:14 +00:00
2007-01-02 05:13:27 +00:00
2006-01-22 07:59:51 +00:00
2006-01-22 07:59:51 +00:00
1998-11-25 22:13:23 +00:00
2006-12-18 17:23:37 +00:00
2005-05-14 06:49:48 +00:00
2005-05-14 06:49:48 +00:00
2005-09-20 17:42:48 +00:00
2005-05-14 06:49:48 +00:00
2006-10-12 23:35:24 +00:00

This directory contains the Bison parser generator.

See the file INSTALL for generic compilation and installation instructions.
See the file doc/FAQ for frequently asked questions.

Bison requires GNU m4 1.4.3 or later.  See:

ftp://ftp.gnu.org/gnu/m4/m4-1.4.3.tar.gz

Bison can work with pre-1.4.3 distributions of GNU m4 if they are
sufficiently patched, but if you encounter a bug with an older
distribution and report a bug we will probably suggest that you
upgrade to 1.4.3 as the first step in trying to fix it.

Please send bug reports to <bug-bison@gnu.org>.  Please include the
version number from `bison --version', and a complete, self-contained
test case in each bug report.

If you have questions about using Bison and the documentation does
not answer them, please send mail to <help-bison@gnu.org>.

-----

Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.

This file is part of Bison, the GNU Compiler Compiler.

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.

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 autoconf; see the file COPYING.  If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Description
No description provided
Readme 18 MiB
Languages
C 61%
M4 11.7%
C++ 11.3%
Shell 4.1%
XSLT 3.1%
Other 8.8%