Skip to content

Commit

Permalink
Merge pull request #82 from yjh-styx/master
Browse files Browse the repository at this point in the history
upgrade win_bison to version 3.8.2
  • Loading branch information
lexxmark authored Jan 10, 2022
2 parents 8e18e32 + 2a7586a commit b2a94ad
Show file tree
Hide file tree
Showing 404 changed files with 22,608 additions and 11,233 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-D_DEBUG)
endif()

# next line needed for compile in C (nor CPP) mode (ucrt headers bug)
add_definitions(-Dinline=__inline)
# next line needed for VS2017 only
add_definitions(-Drestrict=__restrict)

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W3 /MD /Od /Zi /EHsc")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W3 /GL /Od /Oi /Gy /Zi /EHsc")

Expand Down
9 changes: 9 additions & 0 deletions VS2017/common_lib/common_lib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,15 @@
<ClInclude Include="..\..\common\misc\getopt.h" />
<ClInclude Include="..\..\common\misc\getopt_int.h" />
<ClInclude Include="..\..\common\misc\gettext.h" />
<ClInclude Include="..\..\common\misc\gl_hash_map.h" />
<ClInclude Include="..\..\common\misc\gl_map.h" />
<ClInclude Include="..\..\common\misc\gl_xmap.h" />
<ClInclude Include="..\..\common\misc\glthread\lock.h" />
<ClInclude Include="..\..\common\misc\glthread\tls.h" />
<ClInclude Include="..\..\common\misc\hash.h" />
<ClInclude Include="..\..\common\misc\ialloc.h" />
<ClInclude Include="..\..\common\misc\idx.h" />
<ClInclude Include="..\..\common\misc\integer_length.h" />
<ClInclude Include="..\..\common\misc\intprops.h" />
<ClInclude Include="..\..\common\misc\libiberty.h" />
<ClInclude Include="..\..\common\misc\localcharset.h" />
Expand Down Expand Up @@ -255,10 +261,12 @@
<ClCompile Include="..\..\common\misc\getline.c" />
<ClCompile Include="..\..\common\misc\getopt.c" />
<ClCompile Include="..\..\common\misc\getopt1.c" />
<ClCompile Include="..\..\common\misc\gl_hash_map.c" />
<ClCompile Include="..\..\common\misc\glthread\lock.c" />
<ClCompile Include="..\..\common\misc\glthread\threadlib.c" />
<ClCompile Include="..\..\common\misc\glthread\tls.c" />
<ClCompile Include="..\..\common\misc\hash.c" />
<ClCompile Include="..\..\common\misc\integer_length_l.c" />
<ClCompile Include="..\..\common\misc\localcharset.c" />
<ClCompile Include="..\..\common\misc\mbchar.c" />
<ClCompile Include="..\..\common\misc\mbfile.c" />
Expand All @@ -268,6 +276,7 @@
<ClCompile Include="..\..\common\misc\path-join.c" />
<ClCompile Include="..\..\common\misc\progname.c" />
<ClCompile Include="..\..\common\misc\quotearg.c" />
<ClCompile Include="..\..\common\misc\reallocarray.c" />
<ClCompile Include="..\..\common\misc\relocatable.c" />
<ClCompile Include="..\..\common\misc\strverscmp.c" />
<ClCompile Include="..\..\common\misc\timespec.c" />
Expand Down
29 changes: 28 additions & 1 deletion VS2017/common_lib/common_lib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,27 @@
<ClInclude Include="..\..\common\misc\gettext.h">
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\gl_hash_map.h">
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\gl_map.h" />
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\gl_xmap.h" />
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\hash.h">
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\ialloc.h" />
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\idx.h" />
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\integer_length.h" />
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\intprops.h">
<Filter>misc</Filter>
</ClInclude>
Expand Down Expand Up @@ -455,9 +473,15 @@
<ClCompile Include="..\..\common\misc\getopt1.c">
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\gl_hash_map.c" />
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\hash.c">
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\integer_length_l.c" />
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\localcharset.c">
<Filter>misc</Filter>
</ClCompile>
Expand Down Expand Up @@ -485,7 +509,10 @@
<ClCompile Include="..\..\common\misc\quotearg.c">
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\relocatable.c">
<ClCompile Include="..\..\common\misc\reallocarray.c" />
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\relocatable.c">
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\strverscmp.c">
Expand Down
9 changes: 9 additions & 0 deletions VS2019/common_lib/common_lib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,15 @@
<ClInclude Include="..\..\common\misc\getopt_int.h" />
<ClInclude Include="..\..\common\misc\getprogname.h" />
<ClInclude Include="..\..\common\misc\gettext.h" />
<ClInclude Include="..\..\common\misc\gl_hash_map.h" />
<ClInclude Include="..\..\common\misc\gl_map.h" />
<ClInclude Include="..\..\common\misc\gl_xmap.h" />
<ClInclude Include="..\..\common\misc\glthread\lock.h" />
<ClInclude Include="..\..\common\misc\glthread\tls.h" />
<ClInclude Include="..\..\common\misc\hash.h" />
<ClInclude Include="..\..\common\misc\ialloc.h" />
<ClInclude Include="..\..\common\misc\idx.h" />
<ClInclude Include="..\..\common\misc\integer_length.h" />
<ClInclude Include="..\..\common\misc\intprops.h" />
<ClInclude Include="..\..\common\misc\libiberty.h" />
<ClInclude Include="..\..\common\misc\localcharset.h" />
Expand Down Expand Up @@ -269,10 +275,12 @@
<ClCompile Include="..\..\common\misc\getopt.c" />
<ClCompile Include="..\..\common\misc\getopt1.c" />
<ClCompile Include="..\..\common\misc\getprogname.c" />
<ClCompile Include="..\..\common\misc\gl_hash_map.c" />
<ClCompile Include="..\..\common\misc\glthread\lock.c" />
<ClCompile Include="..\..\common\misc\glthread\threadlib.c" />
<ClCompile Include="..\..\common\misc\glthread\tls.c" />
<ClCompile Include="..\..\common\misc\hash.c" />
<ClCompile Include="..\..\common\misc\integer_length_l.c" />
<ClCompile Include="..\..\common\misc\localcharset.c" />
<ClCompile Include="..\..\common\misc\mbchar.c" />
<ClCompile Include="..\..\common\misc\mbfile.c" />
Expand All @@ -282,6 +290,7 @@
<ClCompile Include="..\..\common\misc\path-join.c" />
<ClCompile Include="..\..\common\misc\progname.c" />
<ClCompile Include="..\..\common\misc\quotearg.c" />
<ClCompile Include="..\..\common\misc\reallocarray.c" />
<ClCompile Include="..\..\common\misc\relocatable.c" />
<ClCompile Include="..\..\common\misc\strverscmp.c" />
<ClCompile Include="..\..\common\misc\timespec.c" />
Expand Down
27 changes: 27 additions & 0 deletions VS2019/common_lib/common_lib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,27 @@
<ClInclude Include="..\..\common\misc\gettext.h">
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\gl_hash_map.h">
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\gl_map.h" />
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\gl_xmap.h" />
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\hash.h">
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\ialloc.h" />
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\idx.h" />
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\integer_length.h" />
<Filter>misc</Filter>
</ClInclude>
<ClInclude Include="..\..\common\misc\intprops.h">
<Filter>misc</Filter>
</ClInclude>
Expand Down Expand Up @@ -482,9 +500,15 @@
<ClCompile Include="..\..\common\misc\getopt1.c">
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\gl_hash_map.c" />
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\hash.c">
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\integer_length_l.c" />
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\localcharset.c">
<Filter>misc</Filter>
</ClCompile>
Expand Down Expand Up @@ -512,6 +536,9 @@
<ClCompile Include="..\..\common\misc\quotearg.c">
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\reallocarray.c" />
<Filter>misc</Filter>
</ClCompile>
<ClCompile Include="..\..\common\misc\relocatable.c">
<Filter>misc</Filter>
</ClCompile>
Expand Down
30 changes: 25 additions & 5 deletions bison/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,29 @@ skeletons. If you are to write a new skeleton, please, implement them for
your language. Overall, be sure to follow the same patterns as the existing
skeletons.

## Vocabulary

We use "formal arguments", or "formals" for short, to denote the declared
parameters of a function (e.g., `int argc, const char **argv`). Yes, this
is somewhat contradictory with `param` in the `%param` directives.

We use "effective arguments", or "args" for short, to denote the values
passed in function calls (e.g., `argc, argv`).

## Symbols

### `b4_symbol(NUM, FIELD)`
In order to unify the handling of the various aspects of symbols (tag, type
name, whether terminal, etc.), bison.exe defines one macro per (token,
field), where field can `has_id`, `id`, etc.: see
`prepare_symbols_definitions()` in `src/output.c`.
`prepare_symbol_definitions()` in `src/output.c`.

The macro `b4_symbol(NUM, FIELD)` gives access to the following FIELDS:
NUM can be:
- `empty` to denote the "empty" pseudo-symbol when it exists,
- `eof`, `error`, or `undef`
- a symbol number.

FIELD can be:

- `has_id`: 0 or 1
Whether the symbol has an `id`.
Expand Down Expand Up @@ -142,11 +156,17 @@ The macro `b4_symbol(NUM, FIELD)` gives access to the following FIELDS:
When api.value.type=union, the generated name for the union member.
yytype_INT etc. for symbols that has_id, otherwise yytype_1 etc.

- `type`
- `type`: string
If it has a semantic value, its type tag, or, if variant are used,
its type.
In the case of api.value.type=union, type is the real type (e.g. int).

- `slot`: string
If it has a semantic value, the name of the union member (i.e., bounces to
either `type_tag` or `type`). It would be better to fix our mess and
always use `type` for the true type of the member, and `type_tag` for the
name of the union member.

- `has_printer`: 0, 1
- `printer`: string
- `printer_file`: string
Expand Down Expand Up @@ -187,7 +207,7 @@ fill-column: 76
ispell-dictionary: "american"
End:
Copyright (C) 2002, 2008-2015, 2018-2020 Free Software Foundation, Inc.
Copyright (C) 2002, 2008-2015, 2018-2021 Free Software Foundation, Inc.
This file is part of GNU Bison.
Expand All @@ -202,6 +222,6 @@ 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 this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
2 changes: 1 addition & 1 deletion bison/data/bison-default.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Default styling rules for Bison when doing terminal output.
Copyright (C) 2019-2020 Free Software Foundation, Inc.
Copyright (C) 2019-2021 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
6 changes: 3 additions & 3 deletions bison/data/local.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright (C) 2002, 2005-2015, 2018-2020 Free Software Foundation,
## Copyright (C) 2002, 2005-2015, 2018-2021 Free Software Foundation,
## Inc.

## This program is free software: you can redistribute it and/or modify
Expand All @@ -12,7 +12,7 @@
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
## along with this program. If not, see <https://www.gnu.org/licenses/>.

dist_pkgdata_DATA = \
data/README.md \
Expand All @@ -28,6 +28,7 @@ dist_skeletons_DATA = \
data/skeletons/c.m4 \
data/skeletons/glr.c \
data/skeletons/glr.cc \
data/skeletons/glr2.cc \
data/skeletons/java-skel.m4 \
data/skeletons/java.m4 \
data/skeletons/lalr1.cc \
Expand All @@ -40,7 +41,6 @@ dist_skeletons_DATA = \

# Experimental support for the D language.
dist_skeletons_DATA += \
data/skeletons/README-D.txt \
data/skeletons/d-skel.m4 \
data/skeletons/d.m4 \
data/skeletons/lalr1.d
Expand Down
2 changes: 1 addition & 1 deletion bison/data/m4sugar/foreach.m4
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Speeds up GNU M4 1.4.x by avoiding quadratic $@ recursion, but penalizes
# GNU M4 1.6 by requiring more memory and macro expansions.
#
# Copyright (C) 2008-2017 Free Software Foundation, Inc.
# Copyright (C) 2008-2017, 2020 Free Software Foundation, Inc.

# This file is part of Autoconf. This program is free
# software; you can redistribute it and/or modify it under the
Expand Down
23 changes: 22 additions & 1 deletion bison/data/m4sugar/m4sugar.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ divert(-1)# -*- Autoconf -*-
# Base M4 layer.
# Requires GNU M4.
#
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
# Copyright (C) 1999-2017, 2020 Free Software Foundation, Inc.

# This file is part of Autoconf. This program is free
# software; you can redistribute it and/or modify it under the
Expand Down Expand Up @@ -2412,6 +2412,27 @@ m4_define([m4_normalize],
[m4_strip(m4_flatten([$1]))])
# m4_validate_w(STRING)
# ---------------------
# Expands into m4_normalize(m4_expand([STRING])), but if that is not
# the same as just m4_normalize([STRING]), issue a warning.
#
# This is used in several Autoconf macros that take a
# whitespace-separated list of symbols as an argument. Ideally that
# list would not be expanded before use, but several packages used
# `dnl' to put comments inside those lists, so they must be expanded
# for compatibility's sake.
m4_define([m4_validate_w],
[_m4_validate_w(m4_normalize([$1]), m4_normalize(m4_expand([$1])))])
m4_define([_m4_validate_w],
[m4_if([$1], [$2], [],
[m4_warn([obsolete], [whitespace-separated list contains macros;
in a future version of Autoconf they will not be expanded]dnl
m4_if(m4_bregexp([$1], [\bdn[l]\b]), -1, [], [
note: `dn@&t@l' is a macro]))])dnl
[$2]])
# m4_join(SEP, ARG1, ARG2...)
# ---------------------------
Expand Down
Loading

0 comments on commit b2a94ad

Please sign in to comment.