Skip to content

Commit 1ed89bb

Browse files
committed
Upgrade to bison 3.2.4
1 parent 1d4f496 commit 1ed89bb

File tree

16 files changed

+846
-521
lines changed

16 files changed

+846
-521
lines changed

msys2/usr/bin/bison.exe

3.07 KB
Binary file not shown.

msys2/usr/share/bison/README

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
-*- outline -*-
2-
31
This directory contains data needed by Bison.
42

53
* Skeletons
@@ -52,6 +50,10 @@ into various formats.
5250

5351
-----
5452

53+
Local Variables:
54+
mode: outline
55+
End:
56+
5557
Copyright (C) 2002, 2008-2015, 2018 Free Software Foundation, Inc.
5658

5759
This file is part of GNU Bison.

msys2/usr/share/bison/bison.m4

Lines changed: 104 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,17 @@
2222
## Identification. ##
2323
## ---------------- ##
2424

25+
# b4_generated_by
26+
# ---------------
27+
m4_define([b4_generated_by],
28+
[b4_comment([A Bison parser, made by GNU Bison b4_version.])
29+
])
30+
2531
# b4_copyright(TITLE, [YEARS])
2632
# ----------------------------
2733
# If YEARS are not defined, use b4_copyright_years.
2834
m4_define([b4_copyright],
29-
[b4_comment([A Bison parser, made by GNU Bison b4_version.])
30-
35+
[b4_generated_by
3136
b4_comment([$1
3237
3338
]m4_dquote(m4_text_wrap([Copyright (C)
@@ -58,26 +63,49 @@ Bison output files to be licensed under the GNU General Public
5863
License without this special exception.
5964
6065
This special exception was added by the Free Software Foundation in
61-
version 2.2 of Bison.])])
66+
version 2.2 of Bison.])
67+
])
68+
69+
70+
# b4_disclaimer
71+
# -------------
72+
# Issue a warning about private implementation details.
73+
m4_define([b4_disclaimer],
74+
[b4_comment([Undocumented macros, especially those whose name start with YY_,
75+
are private implementation details. Do not rely on them.])
76+
])
77+
78+
79+
80+
# b4_required_version_if(VERSION, IF_NEWER, IF_OLDER)
81+
# ---------------------------------------------------
82+
# If the version %require'd by the user is VERSION (or newer) expand
83+
# IF_NEWER, otherwise IF_OLDER. VERSION should be an integer, e.g.,
84+
# 302 for 3.2.
85+
m4_define([b4_required_version_if],
86+
[m4_if(m4_eval($1 <= b4_required_version),
87+
[1], [$2], [$3])])
6288

6389

6490
## -------- ##
6591
## Output. ##
6692
## -------- ##
6793

68-
# b4_output_begin(FILE)
69-
# ---------------------
94+
# b4_output_begin(FILE1, FILE2)
95+
# -----------------------------
7096
# Enable output, i.e., send to diversion 0, expand after "#", and
7197
# generate the tag to output into FILE. Must be followed by EOL.
98+
# FILE is FILE1 concatenated to FILE2. FILE2 can be empty, or be
99+
# absolute: do the right thing.
72100
m4_define([b4_output_begin],
73101
[m4_changecom()
74102
m4_divert_push(0)dnl
75-
@output(m4_unquote([$1])@)@dnl
103+
@output(m4_unquote([$1])@,m4_unquote([$2])@)@dnl
76104
])
77105

78106

79-
# b4_output_end()
80-
# ---------------
107+
# b4_output_end
108+
# -------------
81109
# Output nothing, restore # as comment character (no expansions after #).
82110
m4_define([b4_output_end],
83111
[m4_divert_pop(0)
@@ -389,11 +417,11 @@ b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
389417
#
390418
# The following macros provide access to these values.
391419

392-
# b4_symbol_(NUM, FIELD)
420+
# _b4_symbol(NUM, FIELD)
393421
# ----------------------
394422
# Recover a FIELD about symbol #NUM. Thanks to m4_indir, fails if
395423
# undefined.
396-
m4_define([b4_symbol_],
424+
m4_define([_b4_symbol],
397425
[m4_indir([b4_symbol($1, $2)])])
398426

399427

@@ -404,8 +432,8 @@ m4_define([b4_symbol_],
404432
m4_define([b4_symbol],
405433
[m4_case([$2],
406434
[id], [m4_do([b4_percent_define_get([api.token.prefix])],
407-
[b4_symbol_([$1], [id])])],
408-
[b4_symbol_($@)])])
435+
[_b4_symbol([$1], [id])])],
436+
[_b4_symbol($@)])])
409437

410438

411439
# b4_symbol_if(NUM, FIELD, IF-TRUE, IF-FALSE)
@@ -443,8 +471,8 @@ m4_define([b4_symbol_action],
443471
b4_symbol_if([$1], [has_type],
444472
[m4_dquote(b4_symbol([$1], [type]))]),
445473
[(*yylocationp)])dnl
446-
b4_symbol_case_([$1])[]dnl
447-
b4_syncline([b4_symbol([$1], [$2_line])], ["b4_symbol([$1], [$2_file])"])
474+
_b4_symbol_case([$1])[]dnl
475+
b4_syncline([b4_symbol([$1], [$2_line])], [b4_symbol([$1], [$2_file])])
448476
b4_symbol([$1], [$2])
449477
b4_syncline([@oline@], [@ofile@])
450478
break;
@@ -478,10 +506,10 @@ m4_ifval(m4_defn([b4_actions_]),
478506
m4_popdef([b4_actions_])dnl
479507
])
480508

481-
# b4_symbol_case_(SYMBOL-NUM)
509+
# _b4_symbol_case(SYMBOL-NUM)
482510
# ---------------------------
483511
# Issue a "case NUM" for SYMBOL-NUM.
484-
m4_define([b4_symbol_case_],
512+
m4_define([_b4_symbol_case],
485513
[case b4_symbol([$1], [number]): b4_symbol_tag_comment([$1])])
486514
])
487515

@@ -536,16 +564,16 @@ m4_define([b4_token_format],
536564
## Types. ##
537565
## ------- ##
538566

539-
# b4_type_action_(NUMS)
567+
# _b4_type_action(NUMS)
540568
# ---------------------
541569
# Run actions for the symbol NUMS that all have the same type-name.
542570
# Skip NUMS that have no type-name.
543571
#
544572
# To specify the action to run, define b4_dollar_dollar(NUMBER,
545573
# TAG, TYPE).
546-
m4_define([b4_type_action_],
574+
m4_define([_b4_type_action],
547575
[b4_symbol_if([$1], [has_type],
548-
[m4_map([ b4_symbol_case_], [$@])[]dnl
576+
[m4_map([ _b4_symbol_case], [$@])[]dnl
549577
b4_dollar_dollar([b4_symbol([$1], [number])],
550578
[b4_symbol([$1], [tag])],
551579
[b4_symbol([$1], [type])]);
@@ -601,13 +629,15 @@ m4_define([b4_user_code],
601629
b4_syncline([@oline@], [@ofile@])])
602630

603631

604-
# b4_define_user_code(MACRO)
605-
# --------------------------
606-
# From b4_MACRO, build b4_user_MACRO that includes the synclines.
632+
# b4_define_user_code(MACRO, COMMENT)
633+
# -----------------------------------
634+
# From b4_MACRO, if defined, build b4_user_MACRO that includes the synclines.
607635
m4_define([b4_define_user_code],
608636
[m4_define([b4_user_$1],
609-
[b4_user_code([b4_$1])])])
610-
637+
[m4_ifdef([b4_$1],
638+
[m4_ifval([$2],
639+
[b4_comment([$2])
640+
])b4_user_code([b4_$1])])])])
611641

612642
# b4_user_actions
613643
# b4_user_initial_action
@@ -617,9 +647,9 @@ m4_define([b4_define_user_code],
617647
# ----------------------
618648
# Macros that issue user code, ending with synclines.
619649
b4_define_user_code([actions])
620-
b4_define_user_code([initial_action])
621-
b4_define_user_code([post_prologue])
622-
b4_define_user_code([pre_prologue])
650+
b4_define_user_code([initial_action], [User initialization code.])
651+
b4_define_user_code([post_prologue], [Second part of user prologue.])
652+
b4_define_user_code([pre_prologue], [First part of user prologue.])
623653
b4_define_user_code([union_members])
624654

625655

@@ -701,7 +731,7 @@ m4_define([b4_percent_define_use],
701731
# b4_percent_define_get([[foo]])
702732
m4_define([b4_percent_define_get],
703733
[b4_percent_define_use([$1])dnl
704-
b4_percent_define_ifdef_([$1],
734+
_b4_percent_define_ifdef([$1],
705735
[m4_indir([b4_percent_define(]$1[)])],
706736
[$2])])
707737

@@ -710,7 +740,7 @@ b4_percent_define_ifdef_([$1],
710740
# Mimic muscle_percent_define_get_loc in ../src/muscle-tab.h exactly. That is,
711741
# if the %define variable VARIABLE is undefined, complain fatally since that's
712742
# a Bison or skeleton error. Otherwise, return its definition location in a
713-
# form approriate for the first two arguments of b4_warn_at, b4_complain_at, or
743+
# form appropriate for the first two arguments of b4_warn_at, b4_complain_at, or
714744
# b4_fatal_at. Don't record this as a Bison usage of VARIABLE as there's no
715745
# reason to suspect that the user-supplied value has yet influenced the output.
716746
#
@@ -755,15 +785,15 @@ m4_define([b4_percent_define_get_syncline],
755785
[m4_indir([b4_percent_define_syncline(]$1[)])],
756786
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
757787

758-
# b4_percent_define_ifdef_(VARIABLE, IF-TRUE, [IF-FALSE])
788+
# _b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
759789
# ------------------------------------------------------
760790
# If the %define variable VARIABLE is defined, expand IF-TRUE, else expand
761791
# IF-FALSE. Don't record usage of VARIABLE.
762792
#
763793
# For example:
764794
#
765-
# b4_percent_define_ifdef_([[foo]], [[it's defined]], [[it's undefined]])
766-
m4_define([b4_percent_define_ifdef_],
795+
# _b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
796+
m4_define([_b4_percent_define_ifdef],
767797
[m4_ifdef([b4_percent_define(]$1[)],
768798
[$2],
769799
[$3])])
@@ -779,11 +809,44 @@ m4_define([b4_percent_define_ifdef_],
779809
#
780810
# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
781811
m4_define([b4_percent_define_ifdef],
782-
[b4_percent_define_ifdef_([$1],
812+
[_b4_percent_define_ifdef([$1],
783813
[b4_percent_define_use([$1])$2],
784814
[$3])])
785815

786816

817+
# b4_percent_define_check_file_complain(VARIABLE)
818+
# -----------------------------------------------
819+
# Warn about %define variable VARIABLE having an incorrect
820+
# value.
821+
m4_define([b4_percent_define_check_file_complain],
822+
[b4_complain_at(b4_percent_define_get_loc([$1]),
823+
[[%%define variable '%s' requires 'none' or '"..."' values]],
824+
[$1])])
825+
826+
827+
# b4_percent_define_check_file(MACRO, VARIABLE, DEFAULT)
828+
# ------------------------------------------------------
829+
# If the %define variable VARIABLE:
830+
# - is undefined, then if DEFAULT is non-empty, define MACRO to DEFAULT
831+
# - is a string, define MACRO to its value
832+
# - is the keyword 'none', do nothing
833+
# - otherwise, warn about the incorrect value.
834+
m4_define([b4_percent_define_check_file],
835+
[b4_percent_define_ifdef([$2],
836+
[m4_case(b4_percent_define_get_kind([$2]),
837+
[string],
838+
[m4_define([$1], b4_percent_define_get([$2]))],
839+
[keyword],
840+
[m4_if(b4_percent_define_get([$2]), [none], [],
841+
[b4_percent_define_check_file_complain([$2])])],
842+
[b4_percent_define_check_file_complain([$2])])
843+
],
844+
[m4_ifval([$3],
845+
[m4_define([$1], [$3])])])
846+
])
847+
848+
849+
787850
## --------- ##
788851
## Options. ##
789852
## --------- ##
@@ -824,7 +887,7 @@ m4_define([b4_percent_define_flag_if],
824887
#
825888
# b4_percent_define_default([[foo]], [[default value]])
826889
m4_define([b4_percent_define_default],
827-
[b4_percent_define_ifdef_([$1], [],
890+
[_b4_percent_define_ifdef([$1], [],
828891
[m4_define([b4_percent_define(]$1[)], [$2])dnl
829892
m4_define([b4_percent_define_kind(]$1[)],
830893
[m4_default([$3], [keyword])])dnl
@@ -839,26 +902,26 @@ m4_define([b4_percent_define_default],
839902
# Define b4_NAME_if that executes its $1 or $2 depending whether
840903
# VARIABLE was %defined. The characters '.' and `-' in VARIABLE are mapped
841904
# to '_'.
842-
m4_define([b4_percent_define_if_define_],
905+
m4_define([_b4_percent_define_if_define],
843906
[m4_define(m4_bpatsubst([b4_$1_if], [[-.]], [_]),
844907
[b4_percent_define_flag_if(m4_default([$2], [$1]),
845908
[$3], [$4])])])
846909
m4_define([b4_percent_define_if_define],
847910
[b4_percent_define_default([m4_default([$2], [$1])], [[false]])
848-
b4_percent_define_if_define_([$1], [$2], $[1], $[2])])
911+
_b4_percent_define_if_define([$1], [$2], $[1], $[2])])
849912

850913

851914
# b4_percent_define_check_kind(VARIABLE, KIND, [DIAGNOSTIC = complain])
852915
# ---------------------------------------------------------------------
853916
m4_define([b4_percent_define_check_kind],
854-
[b4_percent_define_ifdef_([$1],
917+
[_b4_percent_define_ifdef([$1],
855918
[m4_if(b4_percent_define_get_kind([$1]), [$2], [],
856919
[b4_error([m4_default([$3], [complain])],
857920
b4_percent_define_get_loc([$1]),
858921
[m4_case([$2],
859-
[code], [[%%define variable '%s' requires '{...}' values]],
922+
[code], [[%%define variable '%s' requires '{...}' values]],
860923
[keyword], [[%%define variable '%s' requires keyword values]],
861-
[string], [[%%define variable '%s' requires '"..."' values]])],
924+
[string], [[%%define variable '%s' requires '"..."' values]])],
862925
[$1])])])dnl
863926
])
864927

@@ -884,7 +947,7 @@ m4_define([b4_percent_define_check_values],
884947
[_b4_percent_define_check_values(b4_sublist)])])
885948

886949
m4_define([_b4_percent_define_check_values],
887-
[b4_percent_define_ifdef_([$1],
950+
[_b4_percent_define_ifdef([$1],
888951
[b4_percent_define_check_kind(]$1[, [keyword], [deprecated])dnl
889952
m4_pushdef([b4_good_value], [0])dnl
890953
m4_if($#, 1, [],
@@ -946,7 +1009,7 @@ m4_define([b4_percent_code_ifdef],
9461009
# b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
9471010
# b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
9481011
# b4_token_ctor_if([IF-YYLEX-RETURNS-A-TOKEN], [IF-NOT])
949-
# ----------------------------------------------
1012+
# ----------------------------------------------------------
9501013
b4_percent_define_if_define([token_ctor], [api.token.constructor])
9511014
b4_percent_define_if_define([locations]) # Whether locations are tracked.
9521015
b4_percent_define_if_define([parse.assert])
@@ -1011,8 +1074,6 @@ b4_check_user_names_wrap([[code]], [[qualifier]])
10111074
## ---------------- ##
10121075

10131076
# m4_define_default([b4_lex_param], []) dnl breaks other skeletons
1014-
m4_define_default([b4_pre_prologue], [])
1015-
m4_define_default([b4_post_prologue], [])
10161077
m4_define_default([b4_epilogue], [])
10171078
m4_define_default([b4_parse_param], [])
10181079

0 commit comments

Comments
 (0)