Skip to content

Commit

Permalink
up to date "date" folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lexxmark committed Jul 25, 2017
1 parent defbae7 commit 8faa989
Show file tree
Hide file tree
Showing 23 changed files with 434 additions and 317 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
##WinFlexBison - Flex and Bison for Microsoft Windows
## WinFlexBison - Flex and Bison for Microsoft Windows

Main winflexbison repository for http://sourceforge.net/projects/winflexbison/

##Downloads
## Downloads
Go to http://sourceforge.net/projects/winflexbison/files/

##HowTo
## HowTo
http://sourceforge.net/p/winflexbison/wiki/Visual%20Studio%20custom%20build%20rules/

##History
## History
see "bin/Release/README.txt"

## Example flex/bison files
Go to https://github.com/meyerd/flex-bison-example
5 changes: 5 additions & 0 deletions bin/Release/README.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
=======
versions 2.4.9/2.5.10
--------------
data folder was up to dated for bison 3.0.4

=======
versions 2.4.9/2.5.9
--------------
Expand Down
71 changes: 62 additions & 9 deletions bin/Release/data/c++.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# C++ skeleton for Bison

# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2015 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 All @@ -17,6 +17,21 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Sanity checks, before defaults installed by c.m4.
b4_percent_define_ifdef([[api.value.union.name]],
[b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]),
[named %union is invalid in C++])])

# Sanity checks, before defaults installed by c.m4.
b4_percent_define_ifdef([[api.value.union.name]],
[b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]),
[named %union is invalid in C++])])

# Sanity checks, before defaults installed by c.m4.
b4_percent_define_ifdef([[api.value.union.name]],
[b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]),
[named %union is invalid in C++])])

m4_include(b4_pkgdatadir/[c.m4])

# b4_comment(TEXT, [PREFIX])
Expand Down Expand Up @@ -169,9 +184,12 @@ m4_define([b4_public_types_declare],
/// (External) token type, as returned by yylex.
typedef token::yytokentype token_type;
/// Internal symbol number.
/// Symbol type: an internal symbol number.
typedef int symbol_number_type;
/// The symbol type number to denote an empty symbol.
enum { empty_symbol = -2 };
/// Internal symbol number for tokens (subsumed by symbol_number_type).
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
Expand Down Expand Up @@ -204,8 +222,15 @@ m4_define([b4_public_types_declare],
const semantic_type& v]b4_locations_if([,
const location_type& l])[);
/// Destroy the symbol.
~basic_symbol ();
/// Destroy contents, and record that is empty.
void clear ();
/// Whether empty.
bool empty () const;
/// Destructive move, \a s is emptied into this.
void move (basic_symbol& s);
Expand Down Expand Up @@ -235,21 +260,23 @@ m4_define([b4_public_types_declare],
/// Constructor from (external) token numbers.
by_type (kind_type t);
/// Record that this symbol is empty.
void clear ();
/// Steal the symbol type from \a that.
void move (by_type& that);
/// The (internal) type number (corresponding to \a type).
/// -1 when this symbol is empty.
/// \a empty when empty.
symbol_number_type type_get () const;
/// The token.
token_type token () const;
enum { empty = 0 };
/// The symbol type.
/// -1 when this symbol is empty.
token_number_type type;
/// \a empty_symbol when empty.
/// An int, not token_number_type, to be able to store empty_symbol.
int type;
};
/// "External" symbols: returned by the scanner.
Expand Down Expand Up @@ -318,9 +345,19 @@ m4_define([b4_public_types_define],
template <typename Base>
inline
]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol ()
{
clear ();
}
template <typename Base>
inline
void
]b4_parser_class_name[::basic_symbol<Base>::clear ()
{]b4_variant_if([[
// User destructor.
symbol_number_type yytype = this->type_get ();
basic_symbol<Base>& yysym = *this;
(void) yysym;
switch (yytype)
{
]b4_symbol_foreach([b4_symbol_destructor])dnl
Expand All @@ -330,6 +367,15 @@ m4_define([b4_public_types_define],
// Type destructor.
]b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[
Base::clear ();
}
template <typename Base>
inline
bool
]b4_parser_class_name[::basic_symbol<Base>::empty () const
{
return Base::type_get () == empty_symbol;
}
template <typename Base>
Expand All @@ -347,7 +393,7 @@ m4_define([b4_public_types_define],
// by_type.
inline
]b4_parser_class_name[::by_type::by_type ()
: type (empty)
: type (empty_symbol)
{}
inline
Expand All @@ -360,12 +406,19 @@ m4_define([b4_public_types_define],
: type (yytranslate_ (t))
{}
inline
void
]b4_parser_class_name[::by_type::clear ()
{
type = empty_symbol;
}
inline
void
]b4_parser_class_name[::by_type::move (by_type& that)
{
type = that.type;
that.type = empty;
that.clear ();
}
inline
Expand Down
2 changes: 1 addition & 1 deletion bin/Release/data/c-like.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Common code for C-like languages (C, C++, Java, etc.)

# Copyright (C) 2012-2013 Free Software Foundation, Inc.
# Copyright (C) 2012-2015 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
2 changes: 1 addition & 1 deletion bin/Release/data/c-skel.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# C skeleton dispatching for Bison.

# Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
# Copyright (C) 2006-2007, 2009-2015 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
69 changes: 45 additions & 24 deletions bin/Release/data/c.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# C M4 Macros for Bison.

# Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
# Copyright (C) 2002, 2004-2015 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 Expand Up @@ -97,7 +97,8 @@ m4_define([b4_api_PREFIX],
m4_define_default([b4_prefix], [b4_api_prefix])

# If the %union is not named, its name is YYSTYPE.
m4_define_default([b4_union_name], [b4_api_PREFIX[]STYPE])
b4_percent_define_default([[api.value.union.name]],
[b4_api_PREFIX[][STYPE]])


## ------------------------ ##
Expand Down Expand Up @@ -205,13 +206,32 @@ m4_define([b4_table_value_equals],

# b4_attribute_define
# -------------------
# Provide portability for __attribute__.
# Provide portable compiler "attributes".
m4_define([b4_attribute_define],
[#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if (! defined __GNUC__ || __GNUC__ < 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
# define __attribute__(Spec) /* empty */
[#ifndef YY_ATTRIBUTE
# if (defined __GNUC__ \
&& (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
|| defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
# else
# define YY_ATTRIBUTE(Spec) /* empty */
# endif
#endif
#ifndef YY_ATTRIBUTE_PURE
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
#endif
#ifndef YY_ATTRIBUTE_UNUSED
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
#endif
#if !defined _Noreturn \
&& (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
# if defined _MSC_VER && 1200 <= _MSC_VER
# define _Noreturn __declspec (noreturn)
# else
# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
# endif
#endif
Expand Down Expand Up @@ -250,14 +270,14 @@ m4_define([b4_attribute_define],

# b4_null_define
# --------------
# Portability issues: define a YY_NULL appropriate for the current
# Portability issues: define a YY_NULLPTR appropriate for the current
# language (C, C++98, or C++11).
m4_define([b4_null_define],
[# ifndef YY_NULL
[# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
# define YY_NULL nullptr
# define YY_NULLPTR nullptr
# else
# define YY_NULL 0
# define YY_NULLPTR 0
# endif
# endif[]dnl
])
Expand All @@ -266,7 +286,7 @@ m4_define([b4_null_define],
# b4_null
# -------
# Return a null pointer constant.
m4_define([b4_null], [YY_NULL])
m4_define([b4_null], [YY_NULLPTR])

# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT)
# -------------------------------------------------------------
Expand Down Expand Up @@ -541,15 +561,15 @@ b4_locations_if([, yylocationp])[]b4_user_args[);
# b4_symbol_type_register(SYMBOL-NUM)
# -----------------------------------
# Symbol SYMBOL-NUM has a type (for variant) instead of a type-tag.
# Extend the definition of %union's body with a field of that type,
# and extend the symbol's "type" field to point to the field name,
# instead of the type name.
# Extend the definition of %union's body (b4_union_members) with a
# field of that type, and extend the symbol's "type" field to point to
# the field name, instead of the type name.
m4_define([b4_symbol_type_register],
[m4_define([b4_symbol($1, type_tag)],
[b4_symbol_if([$1], [has_id],
[b4_symbol([$1], [id])],
[yytype_[]b4_symbol([$1], [number])])])dnl
m4_append([b4_user_union_members],
m4_append([b4_union_members],
m4_expand([
b4_symbol_tag_comment([$1])dnl
b4_symbol([$1], [type]) b4_symbol([$1], [type_tag]);]))
Expand Down Expand Up @@ -589,10 +609,9 @@ m4_copy_force([b4_symbol_value_union], [b4_symbol_value])
])


# ---------------- #
# api.value.type. #
# ---------------- #

# -------------------------- #
# api.value.type = variant. #
# -------------------------- #

# b4_value_type_setup_variant
# ---------------------------
Expand Down Expand Up @@ -667,11 +686,13 @@ typedef ]b4_percent_define_get([[api.value.type]])[ ]b4_api_PREFIX[STYPE;
[m4_bmatch(b4_percent_define_get([[api.value.type]]),
[union\|union-directive],
[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
typedef union ]b4_union_name[ ]b4_api_PREFIX[STYPE;
union ]b4_union_name[
]b4_percent_define_get_syncline([[api.value.union.name]])[
union ]b4_percent_define_get([[api.value.union.name]])[
{
]b4_user_union_members[
};
]b4_percent_define_get_syncline([[api.value.union.name]])[
typedef union ]b4_percent_define_get([[api.value.union.name]])[ ]b4_api_PREFIX[STYPE;
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
#endif
Expand Down Expand Up @@ -783,7 +804,7 @@ m4_define([b4_yy_location_print_define],
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
__attribute__((__unused__))
YY_ATTRIBUTE_UNUSED
]b4_function_define([yy_location_print_],
[static unsigned],
[[FILE *yyo], [yyo]],
Expand Down
Loading

0 comments on commit 8faa989

Please sign in to comment.